X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=d4a51a60d8e3b4e246d54cf4ec7f0e185a9f6dfa;hb=37f181cc0b65e4509dd68593cb7555db42d8e088;hp=33197680786da2e7a168fb2d881c54e5556c2eb8;hpb=fc9bcde48628f8c01c651d282471c3dbd73f421e;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 331976807..d4a51a60d 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -303,6 +303,7 @@ sub tables_hashref { my @date_type = ( 'int', 'NULL', '' ); my @perl_type = ( 'text', 'NULL', '' ); my @money_type = ( 'decimal', '', '10,2' ); + my @money_typen = ( 'decimal', 'NULL', '10,2' ); my $username_len = 32; #usernamemax config file @@ -517,7 +518,7 @@ sub tables_hashref { ], 'primary_key' => 'crednum', 'unique' => [], - 'index' => [ ['custnum'] ], + 'index' => [ ['custnum'], ['_date'] ], }, 'cust_credit_bill' => { @@ -665,6 +666,68 @@ sub tables_hashref { 'index' => [ [ 'county' ], [ 'state' ], [ 'country' ] ], }, + 'tax_rate' => { + 'columns' => [ + 'taxnum', 'serial', '', '', '', '', + 'geocode', 'varchar', 'NULL', $char_d, '', '',#cch provides 10 char + 'data_vendor', 'varchar', 'NULL', $char_d, '', '',#auto update source + 'location', 'varchar', 'NULL', $char_d, '', '',#provided by tax authority + 'taxclassnum', 'int', '', '', '', '', + 'effective_date', @date_type, '', '', + 'tax', 'real', '', '', '', '', # tax % + 'excessrate', 'real', 'NULL','', '', '', # second tax % + 'taxbase', @money_typen, '', '', # amount at first tax rate + 'taxmax', @money_typen, '', '', # maximum about at both rates + 'usetax', 'real', 'NULL', '', '', '', # tax % when non-local + 'useexcessrate', 'real', 'NULL', '', '', '', # second tax % when non-local + 'unittype', 'int', 'NULL', '', '', '', # for fee + 'fee', 'real', 'NULL', '', '', '', # amount tax per unit + 'excessfee', 'real', 'NULL', '', '', '', # second amount tax per unit + 'feebase', 'real', 'NULL', '', '', '', # units taxed at first rate + 'feemax', 'real', 'NULL', '', '', '', # maximum number of unit taxed + 'maxtype', 'int', 'NULL', '', '', '', # indicator of how thresholds accumulate + 'taxname', 'varchar', 'NULL', $char_d, '', '', # may appear on invoice + 'taxauth', 'int', 'NULL', '', '', '', # tax authority + 'basetype', 'int', 'NULL', '', '', '', # indicator of basis for tax + 'passtype', 'int', 'NULL', '', '', '', # indicator declaring how item should be shown + 'passflag', 'char', 'NULL', 1, '', '', # Y = required to list as line item, N = Prohibited + 'setuptax', 'char', 'NULL', 1, '', '', # Y = setup tax exempt + 'recurtax', 'char', 'NULL', 1, '', '', # Y = recur tax exempt + 'manual', 'char', 'NULL', 1, '', '', # Y = manually edited + ], + 'primary_key' => 'taxnum', + 'unique' => [], + 'index' => [ ['taxclassnum'], ['data_vendor', 'geocode'] ], + }, + + 'cust_tax_location' => { + 'columns' => [ + 'custlocationnum', 'serial', '', '', '', '', + 'data_vendor', 'varchar', 'NULL', $char_d, '', '', # update source + 'zip', 'char', '', 5, '', '', + 'state', 'char', '', 2, '', '', + 'plus4hi', 'char', '', 4, '', '', + 'plus4lo', 'char', '', 4, '', '', + 'default_location','char', 'NULL', 1, '', '', # Y = default for zip + 'geocode', 'varchar', '', 20, '', '', + ], + 'primary_key' => 'custlocationnum', + 'unique' => [], + 'index' => [ [ 'zip', 'plus4lo', 'plus4hi' ] ], + }, + + 'tax_class' => { + 'columns' => [ + 'taxclassnum', 'serial', '', '', '', '', + 'data_vendor', 'varchar', 'NULL', $char_d, '', '', + 'taxclass', 'varchar', '', $char_d, '', '', + 'description', 'varchar', '', 2*$char_d, '', '', + ], + 'primary_key' => 'taxclassnum', + 'unique' => [ [ 'data_vendor', 'taxclass' ] ], + 'index' => [], + }, + 'cust_pay_pending' => { 'columns' => [ 'paypendingnum','serial', '', '', '', '', @@ -694,10 +757,10 @@ sub tables_hashref { 'cust_pay' => { 'columns' => [ 'paynum', 'serial', '', '', '', '', - #now cust_bill_pay #'invnum', 'int', '', '', '', '', 'custnum', 'int', '', '', '', '', - 'paid', @money_type, '', '', '_date', @date_type, '', '', + 'paid', @money_type, '', '', + 'otaker', 'varchar', 'NULL', 32, '', '', #NULL for the upgrade so we can create & populate the field 'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should be # index into payby table # eventually @@ -873,7 +936,6 @@ sub tables_hashref { 'cust_refund' => { 'columns' => [ 'refundnum', 'serial', '', '', '', '', - #now cust_credit_refund #'crednum', 'int', '', '', '', '', 'custnum', 'int', '', '', '', '', '_date', @date_type, '', '', 'refund', @money_type, '', '', @@ -889,7 +951,7 @@ sub tables_hashref { ], 'primary_key' => 'refundnum', 'unique' => [], - 'index' => [ [ 'custnum' ] ], + 'index' => [ ['custnum'], ['_date'] ], }, 'cust_credit_refund' => { @@ -902,7 +964,7 @@ sub tables_hashref { ], 'primary_key' => 'creditrefundnum', 'unique' => [], - 'index' => [ [ 'crednum', 'refundnum' ] ], + 'index' => [ ['crednum'], ['refundnum'] ], }, @@ -934,6 +996,7 @@ sub tables_hashref { 'disabled', 'char', 'NULL', 1, '', '', 'taxclass', 'varchar', 'NULL', $char_d, '', '', 'classnum', 'int', 'NULL', '', '', '', + 'taxproductnum', 'int', 'NULL', '', '', '', 'pay_weight', 'real', 'NULL', '', '', '', 'credit_weight', 'real', 'NULL', '', '', '', 'agentnum', 'int', 'NULL', '', '', '', @@ -944,6 +1007,61 @@ sub tables_hashref { 'index' => [ [ 'promo_code' ], [ 'disabled' ], [ 'agentnum' ], ], }, + 'part_pkg_taxclass' => { + 'columns' => [ + 'taxclassnum', 'serial', '', '', '', '', + 'taxclass', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'taxclassnum', + 'unique' => [ [ 'taxclass' ] ], + 'index' => [], + }, + + 'part_pkg_taxproduct' => { + 'columns' => [ + 'taxproductnum', 'serial', '', '', '', '', + 'data_vendor', 'varchar', 'NULL', $char_d, '', '', + 'taxproduct', 'varchar', '', $char_d, '', '', + 'description', 'varchar', '', 2*$char_d, '', '', + ], + 'primary_key' => 'taxproductnum', + 'unique' => [ [ 'data_vendor', 'taxproduct' ] ], + 'index' => [], + }, + + 'part_pkg_taxrate' => { + 'columns' => [ + 'pkgtaxratenum', 'serial', '', '', '', '', + 'data_vendor', 'varchar', 'NULL', $char_d, '', '', # update source + 'geocode', 'varchar', 'NULL', $char_d, '', '', # cch provides 10 + 'taxproductnum', 'int', '', '', '', '', + 'city', 'varchar', 'NULL', $char_d, '', '', # tax_location? + 'county', 'varchar', 'NULL', $char_d, '', '', + 'state', 'varchar', 'NULL', $char_d, '', '', + 'local', 'varchar', 'NULL', $char_d, '', '', + 'country', 'char', 'NULL', 2, '', '', + 'taxclassnumtaxed', 'int', 'NULL', '', '', '', + 'taxcattaxed', 'varchar', 'NULL', $char_d, '', '', + 'taxclassnum', 'int', 'NULL', '', '', '', + 'effdate', @date_type, '', '', + 'taxable', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'pkgtaxratenum', + 'unique' => [], + 'index' => [ [ 'data_vendor', 'geocode', 'taxproductnum' ] ], + }, + + 'part_pkg_taxoverride' => { + 'columns' => [ + 'taxoverridenum', 'serial', '', '', '', '', + 'pkgpart', 'serial', '', '', '', '', + 'taxclassnum', 'serial', '', '', '', '', + ], + 'primary_key' => 'taxoverridenum', + 'unique' => [], + 'index' => [ [ 'pkgpart' ], [ 'taxclassnum' ] ], + }, + # 'part_title' => { # 'columns' => [ # 'titlenum', 'int', '', '', @@ -1057,6 +1175,8 @@ sub tables_hashref { 'totalbytes','bigint', 'NULL', '', '', '', 'totalbytes_threshold', 'bigint', 'NULL', '', '', '', 'domsvc', 'int', '', '', '', '', + 'last_login', @date_type, '', '', + 'last_logout', @date_type, '', '', ], 'primary_key' => 'svcnum', #'unique' => [ [ 'username', 'domsvc' ] ], @@ -1355,6 +1475,7 @@ sub tables_hashref { 'routernum', 'serial', '', '', '', '', 'routername', 'varchar', '', $char_d, '', '', 'svcnum', 'int', 'NULL', '', '', '', + 'agentnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'routernum', 'unique' => [], @@ -1378,6 +1499,7 @@ sub tables_hashref { 'routernum', 'int', '', '', '', '', 'ip_gateway', 'varchar', '', 15, '', '', 'ip_netmask', 'int', '', '', '', '', + 'agentnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'blocknum', 'unique' => [ [ 'blocknum', 'routernum' ] ],