'cust_bill' => {
'columns' => [
+ #regular fields
'invnum', 'serial', '', '', '', '',
'custnum', 'int', '', '', '', '',
'_date', @date_type, '', '',
'charged', @money_type, '', '',
+ 'invoice_terms', 'varchar', 'NULL', $char_d, '', '',
+
+ #customer balance info at invoice generation time
+ 'previous_balance', @money_typen, '', '', #eventually not nullable
+ 'billing_balance', @money_typen, '', '', #eventually not nullable
+
+ #deprecated (unused by now, right?)
'printed', 'int', '', '', '', '',
- 'closed', 'char', 'NULL', 1, '', '',
- 'statementnum', 'int', 'NULL', '', '', '',
+
+ #specific use cases
+ 'closed', 'char', 'NULL', 1, '', '', #not yet used much
+ 'statementnum', 'int', 'NULL', '', '', '', #invoice aggregate statements
+ 'agent_invid', 'int', 'NULL', '', '', '', #(varchar?) importing legacy
],
'primary_key' => 'invnum',
- 'unique' => [],
- 'index' => [ ['custnum'], ['_date'], ['statementnum'], ],
+ 'unique' => [ [ 'custnum', 'agent_invid' ] ], #agentnum? huh
+ 'index' => [ ['custnum'], ['_date'], ['statementnum'], ['agent_invid'] ],
},
'cust_statement' => {
# a tax rate.
'columns' => [
'taxnum', 'serial', '', '', '', '',
- 'state', 'varchar', 'NULL', $char_d, '', '',
+ 'city', 'varchar', 'NULL', $char_d, '', '',
'county', 'varchar', 'NULL', $char_d, '', '',
+ 'state', 'varchar', 'NULL', $char_d, '', '',
'country', 'char', '', 2, '', '',
'taxclass', 'varchar', 'NULL', $char_d, '', '',
'exempt_amount', @money_type, '', '',
'primary_key' => 'taxnum',
'unique' => [],
# 'unique' => [ ['taxnum'], ['state', 'county'] ],
- 'index' => [ [ 'county' ], [ 'state' ], [ 'country' ],
+ 'index' => [ [ 'city' ], [ 'county' ], [ 'state' ], [ 'country' ],
[ 'taxclass' ],
],
},
'custom', 'char', 'NULL', 1, '', '',
'taxclass', 'varchar', 'NULL', $char_d, '', '',
'classnum', 'int', 'NULL', '', '', '',
+ 'addon_classnum','int', 'NULL', '', '', '',
'taxproductnum', 'int', 'NULL', '', '', '',
'setup_cost', @money_typen, '', '',
'recur_cost', @money_typen, '', '',
],
'primary_key' => 'pkgpart',
'unique' => [],
- 'index' => [ [ 'promo_code' ], [ 'disabled' ], [ 'agentnum' ], ],
+ 'index' => [ [ 'promo_code' ], [ 'disabled' ], [ 'classnum' ],
+ [ 'agentnum' ],
+ ],
},
'part_pkg_link' => {
'queue' => {
'columns' => [
'jobnum', 'serial', '', '', '', '',
- 'job', 'text', '', '', '', '',
+ 'job', 'varchar', '', 512, '', '',
'_date', 'int', '', '', '', '',
'status', 'varchar', '', $char_d, '', '',
'statustext', 'text', 'NULL', '', '', '',
'columns' => [
'categorynum', 'serial', '', '', '', '',
'categoryname', 'varchar', '', $char_d, '', '',
+ 'weight', 'int', 'NULL', '', '', '',
'disabled', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'categorynum',
###
# fields for unitel/RSLCOM/convergent that don't map well to asterisk
# defaults
+ # though these are now used elsewhere:
+ # charged_party, upstream_price, rated_price, carrierid
###
#cdr_type: Usage = 1, S&E = 7, OC&C = 8
#NULL, done (or something)
'freesiderewritestatus', 'varchar', 'NULL', 32, '', '',
+ #an indexed place to put big numbers
+ 'cdrid', 'bigint', 'NULL', '', '', '',
+
+ #i should become a table
'cdrbatch', 'varchar', 'NULL', 255, '', '',
+ #'cdrbatchnum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'acctid',
'unique' => [],
'index' => [ [ 'calldate' ],
[ 'src' ], [ 'dst' ], [ 'dcontext' ], [ 'charged_party' ],
- [ 'accountcode' ], [ 'carrierid' ],
+ [ 'accountcode' ], [ 'carrierid' ], [ 'cdrid' ],
[ 'freesidestatus' ], [ 'freesiderewritestatus' ],
[ 'cdrbatch' ],
],
},
+ #'cdr_batch' => {
+ # 'columns' => [
+ # 'cdrbatchnum', 'serial', '', '', '', '',
+ # 'cdrbatch', 'varchar', 'NULL', 255, '', '',
+ # '_date', @date_type, '', '',
+ # ],
+ # 'primary_key' => 'cdrbatchnum',
+ # 'unique' => [ [ 'cdrbatch' ] ],
+ # 'index' => [],
+ #},
+
'cdr_termination' => {
'columns' => [
'cdrtermnum', 'bigserial', '', '', '', '',