grep { ! /^(clientapi|access_user)_session/
&& ! /^h_/
&& ! /^log(_context)?$/
+ && ! /^legacy_cust_history$/
&& ( ! /^queue(_arg|_depend|_stat)?$/ || ! $opt->{'queue-no_history'} )
&& ! $tables_hashref_torrus->{$_}
+ && ! /^cacti_page$/
}
$dbdef->tables
) {
],
},
- 'cust_statement' => {
+ 'legacy_cust_history' => {
'columns' => [
- 'statementnum', 'serial', '', '', '', '',
- 'custnum', 'int', '', '', '', '',
- '_date', @date_type, '', '',
+ 'legacyhistorynum', 'serial', '', '', '', '',
+ 'custnum', 'int', '', '', '', '',
+ 'history_action', 'varchar', '', $char_d, '', '',
+ 'history_date', @date_type, '', '',
+ 'history_usernum', 'int', 'NULL', '', '', '',
+ 'item', 'varchar', 'NULL', $char_d, '', '',
+ 'description', 'varchar', 'NULL', 2*$char_d, '', '',
+ 'change_data', 'text', 'NULL', '', '', '',
],
- 'primary_key' => 'statementnum',
+ 'primary_key' => 'legacyhistorynum',
'unique' => [],
- 'index' => [ ['custnum'], ['_date'], ],
+ 'index' => [ ['custnum'], ['history_date'], ],
'foreign_keys' => [
{ columns => [ 'custnum' ],
table => 'cust_main',
},
- ],
- },
-
- #old "invoice" events, deprecated
- 'cust_bill_event' => {
- 'columns' => [
- 'eventnum', 'serial', '', '', '', '',
- 'invnum', 'int', '', '', '', '',
- 'eventpart', 'int', '', '', '', '',
- '_date', @date_type, '', '',
- 'status', 'varchar', '', $char_d, '', '',
- 'statustext', 'text', 'NULL', '', '', '',
- ],
- 'primary_key' => 'eventnum',
- #no... there are retries now #'unique' => [ [ 'eventpart', 'invnum' ] ],
- 'unique' => [],
- 'index' => [ ['invnum'], ['status'], ['eventpart'],
- ['statustext'], ['_date'],
- ],
- 'foreign_keys' => [
- { columns => [ 'invnum' ],
- table => 'cust_bill',
- },
- { columns => [ 'eventpart' ],
- table => 'part_bill_event',
+ { columns => [ 'history_usernum' ],
+ table => 'access_user',
+ references => [ 'usernum' ],
},
],
},
- #old "invoice" events, deprecated
- 'part_bill_event' => {
+ 'cust_statement' => {
'columns' => [
- 'eventpart', 'serial', '', '', '', '',
- 'freq', 'varchar', 'NULL', $char_d, '', '',
- 'payby', 'char', '', 4, '', '',
- 'event', 'varchar', '', $char_d, '', '',
- 'eventcode', @perl_type, '', '',
- 'seconds', 'int', 'NULL', '', '', '',
- 'weight', 'int', '', '', '', '',
- 'plan', 'varchar', 'NULL', $char_d, '', '',
- 'plandata', 'text', 'NULL', '', '', '',
- 'reason', 'int', 'NULL', '', '', '',
- 'disabled', 'char', 'NULL', 1, '', '',
+ 'statementnum', 'serial', '', '', '', '',
+ 'custnum', 'int', '', '', '', '',
+ '_date', @date_type, '', '',
],
- 'primary_key' => 'eventpart',
+ 'primary_key' => 'statementnum',
'unique' => [],
- 'index' => [ ['payby'], ['disabled'], ],
+ 'index' => [ ['custnum'], ['_date'], ],
'foreign_keys' => [
- { columns => [ 'reason' ],
- table => 'reason',
- references => [ 'reasonnum' ],
+ { columns => [ 'custnum' ],
+ table => 'cust_main',
},
],
},
{ columns => [ 'eventnum' ],
table => 'cust_event',
},
- { columns => [ 'billpkgnum' ],
- table => 'cust_bill_pkg',
- },
+ #{ columns => [ 'billpkgnum' ],
+ # table => 'cust_bill_pkg',
+ #},
{ columns => [ 'feepart' ],
table => 'part_fee',
},
{ columns => [ 'billpkgnum' ],
table => 'cust_bill_pkg',
},
- { columns => [ 'base_billpkgnum' ],
- table => 'cust_bill_pkg',
- references => [ 'billpkgnum' ],
- },
- { columns => [ 'base_invnum' ],
- table => 'cust_bill',
- references => [ 'invnum' ],
+ ],
+ },
+
+ 'cust_bill_pkg_fee_void' => {
+ 'columns' => [
+ 'billpkgfeenum', 'serial', '', '', '', '',
+ 'billpkgnum', 'int', '', '', '', '',
+ 'base_invnum', 'int', '', '', '', '',
+ 'base_billpkgnum', 'int', 'NULL', '', '', '',
+ 'amount', @money_type, '', '',
+ ],
+ 'primary_key' => 'billpkgfeenum',
+ 'unique' => [],
+ 'index' => [ ['billpkgnum'],
+ ['base_invnum'],
+ ['base_billpkgnum'],
+ ],
+ 'foreign_keys' => [
+ { columns => [ 'billpkgnum' ],
+ table => 'cust_bill_pkg_void',
},
],
},
+
'cust_bill_pkg_tax_location' => {
'columns' => [
'billpkgtaxlocationnum', 'serial', '', '', '', '',
{ columns => [ 'locationnum' ],
table => 'cust_location',
},
- { columns => [ 'taxable_billpkgnum' ],
- table => 'cust_bill_pkg',
- references => [ 'billpkgnum' ],
- },
+ #{ columns => [ 'taxable_billpkgnum' ],
+ # table => 'cust_bill_pkg',
+ # references => [ 'billpkgnum' ],
+ #},
],
},
'amount', @money_type, '', '',
'currency', 'char', 'NULL', 3, '', '',
'taxable_billpkgnum', 'int', 'NULL', '', '', '',
+ 'taxclass', 'varchar', 'NULL', 10, '', '',
],
'primary_key' => 'billpkgtaxratelocationnum',
'unique' => [],
{ columns => [ 'taxratelocationnum' ],
table => 'tax_rate_location',
},
- { columns => [ 'taxable_billpkgnum' ],
- table => 'cust_bill_pkg',
- references => [ 'billpkgnum' ],
- },
+ #{ columns => [ 'taxable_billpkgnum' ],
+ # table => 'cust_bill_pkg',
+ # references => [ 'billpkgnum' ],
+ #},
],
},
'unitsetup', @money_typen, '', '',
'unitrecur', @money_typen, '', '',
'hidden', 'char', 'NULL', 1, '', '',
+ 'feepart', 'int', 'NULL', '', '', '',
#void fields
'void_date', @date_type, '', '',
'reason', 'varchar', 'NULL', $char_d, '', '',
{ columns => [ 'billpkgnum' ],
table => 'cust_bill_pkg_void',
},
- { columns => [ 'pkgnum' ],
- table => 'cust_pkg',
- },
{ columns => [ 'locationnum' ],
table => 'cust_location',
},
- { columns => [ 'taxable_billpkgnum' ],
- table => 'cust_bill_pkg_void',
- references => [ 'billpkgnum' ],
- },
+ #{ columns => [ 'taxable_billpkgnum' ],
+ # table => 'cust_bill_pkg_void',
+ # references => [ 'billpkgnum' ],
+ #},
],
},
#void fields
'void_date', @date_type, '', '',
'void_reason', 'varchar', 'NULL', $char_d, '', '',
+ 'void_reasonnum', 'int', 'NULL', '', '', '',
'void_usernum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'crednum',
table => 'cust_pkg',
references => [ 'pkgnum' ],
},
+ { columns => [ 'void_reasonnum' ],
+ table => 'reason',
+ references => [ 'reasonnum' ],
+ },
{ columns => [ 'void_usernum' ],
table => 'access_user',
references => [ 'usernum' ],
'message_noemail', 'char', 'NULL', 1, '', '',
'bill_locationnum', 'int', 'NULL', '', '', '',
'ship_locationnum', 'int', 'NULL', '', '', '',
- 'taxstatusnum', 'char', 'NULL', 32, '', '',
+ 'taxstatusnum', 'int', 'NULL', '', '', '',
+ 'complimentary', 'char', 'NULL', 1, '', '',
+ 'po_number', 'varchar', 'NULL', $char_d, '', '',
+ 'invoice_attn', 'varchar', 'NULL', $char_d, '', '',
+ 'invoice_ship_address', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'custnum',
'unique' => [ [ 'agentnum', 'agent_custid' ] ],
'columns' => [
'custpaybynum', 'serial', '', '', '', '',
'custnum', 'int', '', '', '', '',
- 'weight', 'int', '', '', '', '',
+ 'weight', 'int', 'NULL', '', '', '',
'payby', 'char', '', 4, '', '',
'payinfo', 'varchar', 'NULL', 512, '', '',
'cardtype', 'varchar', 'NULL', $char_d, '', '',
'disabled', 'char', 'NULL', 1, '', '',
'custnum', 'int', 'NULL', '', '', '',
'refnum', 'int', 'NULL', '', '', '',
+ 'taxstatusnum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'prospectnum',
'unique' => [],
],
},
+ 'quotation_pkg_tax' => {
+ 'columns' => [
+ 'quotationtaxnum', 'serial', '', '', '', '',
+ 'quotationpkgnum', 'int', '', '', '', '',
+ 'itemdesc', 'varchar', '', $char_d, '', '',
+ 'setup_amount', @money_type, '', '',
+ 'recur_amount', @money_type, '', '',
+ ],
+ 'primary_key' => 'quotationtaxnum',
+ 'unique' => [],
+ 'index' => [ [ 'quotationpkgnum' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'quotationpkgnum' ],
+ table => 'quotation_pkg',
+ },
+ ],
+ },
+
'cust_location' => { #'location' now that its prospects too, but...
'columns' => [
'locationnum', 'serial', '', '', '', '',
'locationname', 'varchar', 'NULL', $char_d, '', '',
'address1', 'varchar', '', $char_d, '', '',
'address2', 'varchar', 'NULL', $char_d, '', '',
- 'city', 'varchar', '', $char_d, '', '',
+ 'city', 'varchar', 'NULL', $char_d, '', '',
'county', 'varchar', 'NULL', $char_d, '', '',
'state', 'varchar', 'NULL', $char_d, '', '',
'zip', 'varchar', 'NULL', 10, '', '',
'payunique', 'varchar', 'NULL', $char_d, '', '',#separate paybatch "unique" functions from current usage
'closed', 'char', 'NULL', 1, '', '',
'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
+ 'no_auto_apply', 'char', 'NULL', 1, '', '',
# cash/check deposit info fields
'bank', 'varchar', 'NULL', $char_d, '', '',
'download', @date_type, '', '',
'upload', @date_type, '', '',
'title', 'varchar', 'NULL',255, '', '',
+ 'processor_id', 'varchar', 'NULL',255, '', '',
],
'primary_key' => 'batchnum',
'unique' => [],
'first', 'varchar', '', $char_d, '', '',
'address1', 'varchar', '', $char_d, '', '',
'address2', 'varchar', 'NULL', $char_d, '', '',
- 'city', 'varchar', '', $char_d, '', '',
+ 'city', 'varchar', 'NULL', $char_d, '', '',
'state', 'varchar', 'NULL', $char_d, '', '',
'zip', 'varchar', 'NULL', 10, '', '',
'country', 'char', '', 2, '', '',
{ columns => [ 'batchnum' ],
table => 'pay_batch',
},
- { columns => [ 'invnum' ],
- table => 'cust_bill',
- },
+ #{ columns => [ 'invnum' ],
+ # table => 'cust_bill',
+ #},
{ columns => [ 'custnum' ],
table => 'cust_main',
},
'recur_show_zero', 'char', 'NULL', 1, '', '',
'setup_show_zero', 'char', 'NULL', 1, '', '',
'change_to_pkgnum', 'int', 'NULL', '', '', '',
+ 'separate_bill', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'pkgnum',
'unique' => [],
'cust_pkg_detail' => {
'columns' => [
- 'pkgdetailnum', 'serial', '', '', '', '',
- 'pkgnum', 'int', '', '', '', '',
- 'detail', 'varchar', '', $char_d, '', '',
- 'detailtype', 'char', '', 1, '', '', # "I"nvoice or "C"omment
- 'weight', 'int', '', '', '', '',
+ 'pkgdetailnum', 'serial', '', '', '', '',
+ 'pkgnum', 'int', '', '', '', '',
+ 'detail', 'varchar', '', 2*$char_d, '', '',
+ 'detailtype', 'char', '', 1, '', '', #"I"nvoice or "C"omment
+ 'weight', 'int', '', '', '', '',
],
'primary_key' => 'pkgdetailnum',
'unique' => [],
],
},
+ 'cust_pkg_reason_fee' => {
+ 'columns' => [
+ 'pkgreasonfeenum', 'serial', '', '', '', '',
+ 'pkgreasonnum', 'int', '', '', '', '',
+ 'billpkgnum', 'int', 'NULL', '', '', '',
+ 'feepart', 'int', '', '', '', '',
+ 'nextbill', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'pkgreasonfeenum',
+ 'unique' => [ [ 'billpkgnum' ], [ 'pkgreasonnum' ] ], # one-to-one link
+ 'index' => [ [ 'feepart' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'pkgreasonnum' ],
+ table => 'cust_pkg_reason',
+ references => [ 'num' ],
+ },
+ { columns => [ 'feepart' ],
+ table => 'part_fee',
+ },
+ # can't link billpkgnum, because of voids
+ ],
+ },
+
'cust_pkg_discount' => {
'columns' => [
'pkgdiscountnum', 'serial', '', '', '', '',
'delay_start', 'int', 'NULL', '', '', '',
'start_on_hold', 'char', 'NULL', 1, '', '',
'agent_pkgpartid', 'varchar', 'NULL', 20, '', '',
+ 'expire_months', 'int', 'NULL', '', '', '',
+ 'adjourn_months', 'int', 'NULL', '', '', '',
+ 'contract_end_months','int','NULL', '', '', '',
+ 'change_to_pkgpart', 'int', 'NULL', '', '', '',
],
'primary_key' => 'pkgpart',
'unique' => [],
table => 'part_pkg',
references => [ 'pkgpart' ],
},
+ { columns => [ 'change_to_pkgpart' ],
+ table => 'part_pkg',
+ references => [ 'pkgpart' ],
+ },
],
},
'primary_svc', 'char', 'NULL', 1, '', '',
'hidden', 'char', 'NULL', 1, '', '',
'bulk_skip', 'char', 'NULL', 1, '', '',
+ 'provision_hold', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'pkgsvcnum',
'unique' => [ ['pkgpart', 'svcpart'] ],
'columnlabel', 'varchar', 'NULL', $char_d, '', '',
'columnvalue', 'varchar', 'NULL', 512, '', '',
'columnflag', 'char', 'NULL', 1, '', '',
+ 'required', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'columnnum',
'unique' => [ [ 'svcpart', 'columnname' ] ],
'index' => [ ['disabled'] ],
},
+ 'part_svc_link' => {
+ 'columns' => [
+ 'svclinknum', 'serial', '', '', '', '',
+ #'linkname', 'varchar', 'NULL', $char_d, '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
+ 'src_svcpart', 'int', '', '', '', '',
+ 'dst_svcpart', 'int', '', '', '', '',
+ 'link_type', 'varchar', '', $char_d, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'svclinknum',
+ 'unique' => [ ['agentnum','src_svcpart','dst_svcpart','link_type'] ],
+ 'index' => [ [ 'src_svcpart' ], [ 'src_svcpart', 'link_type' ], [ 'disabled' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'src_svcpart' ],
+ table => 'part_svc',
+ references => [ 'svcpart' ]
+ },
+ { columns => [ 'dst_svcpart' ],
+ table => 'part_svc',
+ references => [ 'svcpart' ]
+ },
+ ],
+ },
+
#(this should be renamed to part_pop)
'svc_acct_pop' => {
'columns' => [
#'custnum', 'int', '', '', '', ''
'billpkgnum', 'int', '', '', '', '',
'taxnum', 'int', '', '', '', '',
+ 'taxtype', 'varchar', 'NULL', $char_d, '', '',
'year', 'int', 'NULL', '', '', '',
'month', 'int', 'NULL', '', '', '',
'creditbillpkgnum', 'int', 'NULL', '', '', '',
'unique' => [],
'index' => [ [ 'taxnum', 'year', 'month' ],
[ 'billpkgnum' ],
- [ 'taxnum' ],
+ [ 'taxnum', 'taxtype' ],
[ 'creditbillpkgnum' ],
],
'foreign_keys' => [
{ columns => [ 'billpkgnum' ],
table => 'cust_bill_pkg',
},
- { columns => [ 'taxnum' ],
- table => 'cust_main_county',
- },
{ columns => [ 'creditbillpkgnum' ],
table => 'cust_credit_bill_pkg',
},
#'custnum', 'int', '', '', '', ''
'billpkgnum', 'int', '', '', '', '',
'taxnum', 'int', '', '', '', '',
+ 'taxtype', 'varchar', 'NULL', $char_d, '', '',
'year', 'int', 'NULL', '', '', '',
'month', 'int', 'NULL', '', '', '',
'creditbillpkgnum', 'int', 'NULL', '', '', '',
'unique' => [],
'index' => [ [ 'taxnum', 'year', 'month' ],
[ 'billpkgnum' ],
- [ 'taxnum' ],
+ [ 'taxnum', 'taxtype' ],
[ 'creditbillpkgnum' ],
],
'foreign_keys' => [
'banned_pay' => {
'columns' => [
- 'bannum', 'serial', '', '', '', '',
- 'payby', 'char', '', 4, '', '',
- 'payinfo', 'varchar', '', 128, '', '', #say, a 512-big digest _hex encoded
- #'paymask', 'varchar', 'NULL', $char_d, '', ''
- '_date', @date_type, '', '',
- 'end_date', @date_type, '', '',
- 'otaker', 'varchar', 'NULL', 32, '', '',
- 'usernum', 'int', 'NULL', '', '', '',
- 'bantype', 'varchar', 'NULL', $char_d, '', '',
- 'reason', 'varchar', 'NULL', $char_d, '', '',
+ 'bannum', 'serial', '', '', '', '',
+ 'payby', 'char', '', 4, '', '',
+ 'payinfo', 'varchar', '', 128, '', '', #say, a 512-big digest _hex encoded
+ 'payinfo_hash', 'varchar', 'NULL', 32, '', '',
+ #'paymask', 'varchar', 'NULL', $char_d, '', ''
+ '_date', @date_type, '', '',
+ 'end_date', @date_type, '', '',
+ 'otaker', 'varchar', 'NULL', 32, '', '',
+ 'usernum', 'int', 'NULL', '', '', '',
+ 'bantype', 'varchar', 'NULL', $char_d, '', '',
+ 'reason', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'bannum',
'unique' => [],
'index' => [],
},
+ 'access_user_log' => {
+ 'columns' => [
+ 'lognum', 'serial', '', '', '', '',
+ 'usernum', 'int', '', '', '', '',
+ 'path', 'varchar', '', 2*$char_d, '', '',
+ '_date', @date_type, '', '',
+ ],
+ 'primary_key' => 'lognum',
+ 'unique' => [],
+ 'index' => [ ['usernum'], ['path'], ['_date'] ],
+ },
+
'sched_item' => {
'columns' => [
'itemnum', 'serial', '', '', '', '',
'devicepart', 'serial', '', '', '', '',
'devicename', 'varchar', '', $char_d, '', '',
'inventory_classnum', 'int', 'NULL', '', '', '',
+ 'title', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'devicepart',
'unique' => [ [ 'devicename' ] ], #?
'unsuspend_pkgpart', 'int', 'NULL', '', '', '',
'unsuspend_hold','char', 'NULL', 1, '', '',
'unused_credit', 'char', 'NULL', 1, '', '',
+ 'feepart', 'int', 'NULL', '', '', '',
+ 'fee_on_unsuspend','char', 'NULL', 1, '', '',
+ 'fee_hold', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'reasonnum',
'unique' => [],
'latexsmallfooter', 'text', 'NULL', '', '', '',
'latexreturnaddress', 'text', 'NULL', '', '', '',
'with_latexcoupon', 'char', 'NULL', '1', '', '',
+ 'htmlwatermark', 'text', 'NULL', '', '', '',
+ 'latexwatermark', 'text', 'NULL', '', '', '',
'lpr', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'confnum',
],
},
-
-
-
+ 'cacti_page' => {
+ 'columns' => [
+ 'cacti_pagenum', 'serial', '', '', '', '',
+ 'exportnum', 'int', 'NULL', '', '', '',
+ 'svcnum', 'int', 'NULL', '', '', '',
+ 'graphnum', 'int', 'NULL', '', '', '',
+ 'imported', @date_type, '', '',
+ 'content', 'text', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'cacti_pagenum',
+ 'unique' => [ ],
+ 'index' => [ ['svcnum'], ['imported'] ],
+ 'foreign_keys' => [
+ { columns => [ 'svcnum' ],
+ table => 'cust_svc',
+ references => [ 'svcnum' ],
+ },
+ { columns => [ 'exportnum' ],
+ table => 'part_export',
+ references => [ 'exportnum' ],
+ },
+ ],
+ },
# name type nullability length default local