finish package location tax reporing, RT#4499
[freeside.git] / FS / FS / Schema.pm
index 2c3c967..2cdf41c 100644 (file)
@@ -498,19 +498,19 @@ sub tables_hashref {
 
     'cust_bill_pkg' => {
       'columns' => [
-        'billpkgnum', 'serial', '', '', '', '', 
-        'pkgnum',  'int', '', '', '', '', 
-        'pkgpart_override',  'int', 'NULL', '', '', '', 
-        'invnum',  'int', '', '', '', '', 
-        'setup',   @money_type, '', '', 
-        'recur',   @money_type, '', '', 
-        'sdate',   @date_type, '', '', 
-        'edate',   @date_type, '', '', 
-        'itemdesc', 'varchar', 'NULL', $char_d, '', '', 
-        'section',  'varchar', 'NULL', $char_d, '', '', 
-        'quantity',  'int', 'NULL', '', '', '',
-        'unitsetup', @money_typen, '', '', 
-        'unitrecur', @money_typen, '', '', 
+        'billpkgnum',        'serial',     '',      '', '', '', 
+        'invnum',               'int',     '',      '', '', '', 
+        'pkgnum',               'int',     '',      '', '', '', 
+        'pkgpart_override',     'int', 'NULL',      '', '', '', 
+        'setup',               @money_type,             '', '', 
+        'recur',               @money_type,             '', '', 
+        'sdate',               @date_type,              '', '', 
+        'edate',               @date_type,              '', '', 
+        'itemdesc',         'varchar', 'NULL', $char_d, '', '', 
+        'section',          'varchar', 'NULL', $char_d, '', '', 
+        'quantity',             'int', 'NULL',      '', '', '',
+        'unitsetup',           @money_typen,            '', '', 
+        'unitrecur',           @money_typen,            '', '', 
       ],
       'primary_key' => 'billpkgnum',
       'unique' => [],
@@ -549,6 +549,21 @@ sub tables_hashref {
       'index' => [ ['billpkgnum'], ],
     },
 
+    'cust_bill_pkg_tax_location' => {
+      'columns' => [
+        'billpkgtaxlocationnum', 'serial',      '', '', '', '',
+        'billpkgnum',               'int',      '', '', '', '',
+        'taxnum',                   'int',      '', '', '', '',
+        'taxtype',              'varchar', $char_d, '', '', '',
+        'pkgnum',                   'int',      '', '', '', '',
+        'locationnum',              'int',      '', '', '', '', #redundant?
+        'amount',                   @money_type,        '', '',
+      ],
+      'primary_key' => 'billpkgtaxlocationnum',
+      'unique' => [],
+      'index'  => [ [ 'billpkgnum' ], [ 'taxnum' ], [ 'pkgnum' ], [ 'locationnum' ] ],
+    },
+
     'cust_credit' => {
       'columns' => [
         'crednum',  'serial', '', '', '', '', 
@@ -742,7 +757,9 @@ sub tables_hashref {
       'primary_key' => 'taxnum',
       'unique' => [],
   #    'unique' => [ ['taxnum'], ['state', 'county'] ],
-      'index' => [ [ 'county' ], [ 'state' ], [ 'country' ] ],
+      'index' => [ [ 'county' ], [ 'state' ], [ 'country' ],
+                   [ 'taxclass' ],
+                 ],
     },
 
     'tax_rate'    => {