X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=9e7b07f1948a08a08c9819c764d26e6410194779;hb=48c79870d414b579eb8163dbae1a22941b183f22;hp=9548aa760a2bf03d3a46077cf3ab857e48c71a95;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 9548aa760..9e7b07f19 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -192,6 +192,14 @@ sub dbdef_dist { } keys %indices; + $h_indices{"h_${table}_srckey"} = DBIx::DBSchema::Index->new({ + 'name' => "h_${table}_srckey", + 'unique' => 0, + 'columns' => [ 'history_action', #right? + $tableobj->primary_key, + ], + }); + my $h_tableobj = DBIx::DBSchema::Table->new( { 'name' => "h_$table", 'primary_key' => 'historynum', @@ -303,6 +311,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 @@ -480,6 +489,7 @@ sub tables_hashref { 'columns' => [ 'billpkgnum', 'serial', '', '', '', '', 'pkgnum', 'int', '', '', '', '', + 'pkgpart_override', 'int', 'NULL', '', '', '', 'invnum', 'int', '', '', '', '', 'setup', @money_type, '', '', 'recur', @money_type, '', '', @@ -497,6 +507,7 @@ sub tables_hashref { 'detailnum', 'serial', '', '', '', '', 'pkgnum', 'int', '', '', '', '', 'invnum', 'int', '', '', '', '', + 'format', 'char', 'NULL', 1, '', '', 'detail', 'varchar', '', $char_d, '', '', ], 'primary_key' => 'detailnum', @@ -665,6 +676,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', '', '', '', '', @@ -933,6 +1006,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', '', '', '', @@ -943,6 +1017,18 @@ sub tables_hashref { 'index' => [ [ 'promo_code' ], [ 'disabled' ], [ 'agentnum' ], ], }, + 'part_pkg_link' => { + 'columns' => [ + 'pkglinknum', 'serial', '', '', '', '', + 'src_pkgpart', 'int', '', '', '', '', + 'dst_pkgpart', 'int', '', '', '', '', + 'link_type', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'pkglinknum', + 'unique' => [ [ 'src_pkgpart', 'dst_pkgpart', 'link_type' ] ], + 'index' => [ [ 'src_pkgpart' ] ], + }, + 'part_pkg_taxclass' => { 'columns' => [ 'taxclassnum', 'serial', '', '', '', '', @@ -953,6 +1039,51 @@ sub tables_hashref { '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', '', '', @@ -1366,6 +1497,7 @@ sub tables_hashref { 'routernum', 'serial', '', '', '', '', 'routername', 'varchar', '', $char_d, '', '', 'svcnum', 'int', 'NULL', '', '', '', + 'agentnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'routernum', 'unique' => [], @@ -1389,6 +1521,7 @@ sub tables_hashref { 'routernum', 'int', '', '', '', '', 'ip_gateway', 'varchar', '', 15, '', '', 'ip_netmask', 'int', '', '', '', '', + 'agentnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'blocknum', 'unique' => [ [ 'blocknum', 'routernum' ] ],