my $char_d = 80; #default maxlength for text fields
#my(@date_type) = ( 'timestamp', '', '' );
- my @date_type = ( 'int', 'NULL', '' );
+ my @date_type = ( 'int', 'NULL', '' );
my @perl_type = ( 'text', 'NULL', '' );
my @money_type = ( 'decimal', '', '10,2' );
my @money_typen = ( 'decimal', 'NULL', '10,2' );
],
},
+ 'cust_event_fee' => {
+ 'columns' => [
+ 'eventfeenum', 'serial', '', '', '', '',
+ 'eventnum', 'int', '', '', '', '',
+ 'billpkgnum', 'int', 'NULL', '', '', '',
+ 'feepart', 'int', '', '', '', '',
+ 'nextbill', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'eventfeenum', # I'd rather just use eventnum
+ 'unique' => [ [ 'billpkgnum' ], [ 'eventnum' ] ], # one-to-one link
+ 'index' => [ [ 'feepart' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'eventnum' ],
+ table => 'cust_event',
+ },
+ { columns => [ 'billpkgnum' ],
+ table => 'cust_bill_pkg',
+ },
+ { columns => [ 'feepart' ],
+ table => 'part_fee',
+ },
+ ],
+ },
+
'cust_bill_pkg' => {
'columns' => [
'billpkgnum', 'serial', '', '', '', '',
'freq', 'varchar', 'NULL', $char_d, '', '',
'quantity', 'int', 'NULL', '', '', '',
'hidden', 'char', 'NULL', 1, '', '',
+ 'feepart', 'int', 'NULL', '', '', '',
],
'primary_key' => 'billpkgnum',
'unique' => [],
table => 'part_pkg',
references => [ 'pkgpart' ],
},
+ { columns => [ 'feepart' ],
+ table => 'part_fee',
+ },
],
},
'cust_bill_pkg_display' => {
'columns' => [
- 'billpkgdisplaynum', 'serial', '', '', '', '',
+ 'billpkgdisplaynum', 'serial', '', '', '', '',
'billpkgnum', 'int', '', '', '', '',
'section', 'varchar', 'NULL', $char_d, '', '',
#'unitsetup', @money_typen, '', '', #override the linked real one?
],
},
+ 'cust_bill_pkg_fee' => {
+ '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',
+ },
+ { columns => [ 'base_billpkgnum' ],
+ table => 'cust_bill_pkg',
+ references => [ 'billpkgnum' ],
+ },
+ { columns => [ 'base_invnum' ],
+ table => 'cust_bill',
+ references => [ 'invnum' ],
+ },
+ ],
+ },
+
'cust_bill_pkg_tax_location' => {
'columns' => [
'billpkgtaxlocationnum', 'serial', '', '', '', '',
{ columns => [ 'billpkgnum' ],
table => 'cust_bill_pkg',
},
- { columns => [ 'pkgnum' ],
- table => 'cust_pkg',
- },
+ #{ columns => [ 'pkgnum' ],
+ # table => 'cust_pkg',
+ #}, # taxes can apply to fees
{ columns => [ 'locationnum' ],
table => 'cust_location',
},
'stateid_state', 'varchar', 'NULL', $char_d, '', '',
'national_id', 'varchar', 'NULL', $char_d, '', '',
'birthdate' ,@date_type, '', '',
- 'spouse_birthdate' ,@date_type, '', '',
- 'anniversary_date' ,@date_type, '', '',
+ 'spouse_last', 'varchar', 'NULL', 2*$char_d, '', '',
+ 'spouse_first', 'varchar', 'NULL', $char_d, '', '',
+ 'spouse_birthdate', @date_type, '', '',
+ 'anniversary_date', @date_type, '', '',
'signupdate',@date_type, '', '',
'dundate', @date_type, '', '',
'company', 'varchar', 'NULL', $char_d, '', '',
'gatewaynum', 'int', 'NULL', '', '', '',
#'cust_balance', @money_type, '', '',
'paynum', 'int', 'NULL', '', '', '',
+ 'void_paynum', 'int', 'NULL', '', '', '',
'jobnum', 'bigint', 'NULL', '', '', '',
'invnum', 'int', 'NULL', '', '', '',
'manual', 'char', 'NULL', 1, '', '',
{ columns => [ 'paynum' ],
table => 'cust_pay',
},
+ { columns => [ 'void_paynum' ],
+ table => 'cust_pay_void',
+ references => [ 'paynum' ],
+ },
{ columns => [ 'jobnum' ],
table => 'queue',
},
'currency', 'char', 'NULL', 3, '', '',
'otaker', 'varchar', 'NULL', 32, '', '',
'usernum', 'int', 'NULL', '', '', '',
- 'reason', 'varchar', '', $char_d, '', '',
+ 'reason', 'varchar', 'NULL', $char_d, '', '',
+ 'reasonnum', 'int', 'NULL', '', '', '',
'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should
# be index into payby
# table eventually
{ columns => [ 'usernum' ],
table => 'access_user',
},
+ { columns => [ 'reasonnum' ],
+ table => 'reason',
+ },
{ columns => [ 'gatewaynum' ],
table => 'payment_gateway',
},
],
},
+ 'part_fee' => {
+ 'columns' => [
+ 'feepart', 'serial', '', '', '', '',
+ 'itemdesc', 'varchar', '', $char_d, '', '',
+ 'comment', 'varchar', 'NULL', 2*$char_d, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ 'classnum', 'int', 'NULL', '', '', '',
+ 'taxclass', 'varchar', 'NULL', $char_d, '', '',
+ 'taxproductnum', 'int', 'NULL', '', '', '',
+ 'pay_weight', 'real', 'NULL', '', '', '',
+ 'credit_weight', 'real', 'NULL', '', '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
+ 'amount', @money_type, '', '',
+ 'percent', 'decimal', '', '7,4', '', '',
+ 'basis', 'varchar', '', 16, '', '',
+ 'minimum', @money_typen, '', '',
+ 'maximum', @money_typen, '', '',
+ 'limit_credit', 'char', 'NULL', 1, '', '',
+ 'setuprecur', 'char', '', 5, '', '',
+ 'taxable', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'feepart',
+ 'unique' => [],
+ 'index' => [ [ 'disabled' ], [ 'classnum' ], [ 'agentnum' ]
+ ],
+ 'foreign_keys' => [
+ { columns => [ 'classnum' ],
+ table => 'pkg_class',
+ },
+ { columns => [ 'taxproductnum' ],
+ table => 'part_pkg_taxproduct',
+ },
+ { columns => [ 'agentnum' ],
+ table => 'agent',
+ },
+ ],
+ },
+
+ 'part_fee_msgcat' => {
+ 'columns' => [
+ 'feepartmsgnum', 'serial', '', '', '', '',
+ 'feepart', 'int', '', '', '', '',
+ 'locale', 'varchar', '', 16, '', '',
+ 'itemdesc', 'varchar', '', $char_d, '', '', #longer/no limit?
+ 'comment', 'varchar', 'NULL', 2*$char_d, '', '', #longer/no limit?
+ ],
+ 'primary_key' => 'feepartmsgnum',
+ 'unique' => [ [ 'feepart', 'locale' ] ],
+ 'index' => [],
+ 'foreign_keys' => [
+ { columns => [ 'feepart' ],
+ table => 'part_fee',
+ },
+ ],
+ },
+
+ 'part_fee_usage' => {
+ 'columns' => [
+ 'feepartusagenum','serial', '', '', '', '',
+ 'feepart', 'int', '', '', '', '',
+ 'classnum', 'int', '', '', '', '',
+ 'amount', @money_type, '', '',
+ 'percent', 'decimal', '', '7,4', '', '',
+ ],
+ 'primary_key' => 'feepartusagenum',
+ 'unique' => [ [ 'feepart', 'classnum' ] ],
+ 'index' => [],
+ 'foreign_keys' => [
+ { columns => [ 'feepart' ],
+ table => 'part_fee',
+ },
+ { columns => [ 'classnum' ],
+ table => 'usage_class',
+ },
+ ],
+ },
+
'part_pkg_link' => {
'columns' => [
'pkglinknum', 'serial', '', '', '', '',
'unique' => [ [ 'blocknum', 'routernum' ] ],
'index' => [],
'foreign_keys' => [
- { columns => [ 'routernum' ],
- table => 'router',
- },
+ #{ columns => [ 'routernum' ],
+ # table => 'router',
+ #},
{ columns => [ 'agentnum' ],
table => 'agent',
},
'cust_msg' => {
'columns' => [
'custmsgnum', 'serial', '', '', '', '',
- 'custnum', 'int', '', '', '', '',
+ 'custnum', 'int', 'NULL', '', '', '',
'msgnum', 'int', 'NULL', '', '', '',
'_date', @date_type, '', '',
'env_from', 'varchar', 'NULL', 255, '', '',
'body', 'blob', 'NULL', '', '', '',
'error', 'varchar', 'NULL', 255, '', '',
'status', 'varchar', '',$char_d, '', '',
+ 'msgtype', 'varchar', 'NULL', 16, '', '',
],
'primary_key' => 'custmsgnum',
'unique' => [ ],