X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=bf516b28fdaceb642efd8c45f3f88f65e73a79b5;hb=30e2dfd524a3f52445cbca6bc2cd1962dce7eb04;hp=4211ee28f1d8f4dd051fd2b4604b51ae466584be;hpb=af0778d5f900697e0a523c6f88b3b250d5a0d1c9;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 4211ee28f..bf516b28f 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -937,6 +937,29 @@ sub tables_hashref { ], }, + 'cust_event_fee' => { + 'columns' => [ + 'eventfeenum', 'serial', '', '', '', '', + 'eventnum', 'int', '', '', '', '', + 'billpkgnum', 'int', 'NULL', '', '', '', + 'feepart', 'int', '', '', '', '', + ], + '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', '', '', '', '', @@ -959,6 +982,7 @@ sub tables_hashref { 'freq', 'varchar', 'NULL', $char_d, '', '', 'quantity', 'int', 'NULL', '', '', '', 'hidden', 'char', 'NULL', 1, '', '', + 'feepart', 'int', 'NULL', '', '', '', ], 'primary_key' => 'billpkgnum', 'unique' => [], @@ -975,6 +999,9 @@ sub tables_hashref { table => 'part_pkg', references => [ 'pkgpart' ], }, + { columns => [ 'feepart' ], + table => 'part_fee', + }, ], }, @@ -1017,7 +1044,7 @@ sub tables_hashref { 'cust_bill_pkg_display' => { 'columns' => [ - 'billpkgdisplaynum', 'serial', '', '', '', '', + 'billpkgdisplaynum', 'serial', '', '', '', '', 'billpkgnum', 'int', '', '', '', '', 'section', 'varchar', 'NULL', $char_d, '', '', #'unitsetup', @money_typen, '', '', #override the linked real one? @@ -1036,6 +1063,35 @@ sub tables_hashref { ], }, + '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', '', '', '', '', @@ -1060,9 +1116,9 @@ sub tables_hashref { { 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', }, @@ -1879,6 +1935,26 @@ sub tables_hashref { ], }, + 'cust_main_credit_limit' => { + 'columns' => [ + 'creditlimitnum', 'serial', '', '', '', '', + 'custnum', 'int', '', '', '', '', + '_date', @date_type, '', '', + 'amount', @money_typen, '', '', + #'amount_currency', 'char', 'NULL', 3, '', '', + 'credit_limit', @money_typen, '', '', + #'credit_limit_currency', 'char', 'NULL', 3, '', '', + ], + 'primary_key' => 'creditlimitnum', + 'unique' => [], + 'index' => [ ['custnum'], ], + 'foreign_keys' => [ + { columns => [ 'custnum' ], + table => 'cust_main', + }, + ], + }, + 'cust_main_note' => { 'columns' => [ 'notenum', 'serial', '', '', '', '', @@ -3052,6 +3128,63 @@ sub tables_hashref { ], }, + '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_pkg_link' => { 'columns' => [ 'pkglinknum', 'serial', '', '', '', '',