estimate tax on quotations, #32489
[freeside.git] / FS / FS / Schema.pm
index 73b2a70..cd4f01d 100644 (file)
@@ -200,6 +200,7 @@ sub dbdef_dist {
     grep {    ! /^(clientapi|access_user)_session/
            && ! /^h_/
            && ! /^log(_context)?$/
+           && ! /^legacy_cust_history$/
            && ( ! /^queue(_arg|_depend|_stat)?$/ || ! $opt->{'queue-no_history'} )
            && ! $tables_hashref_torrus->{$_}
          }
@@ -778,6 +779,31 @@ sub tables_hashref {
                         ],
     },
 
+    'legacy_cust_history' => {
+      'columns' => [
+        'legacyhistorynum', 'serial',     '',        '', '', '',
+        'custnum',             'int',     '',        '', '', '',
+        'history_action',  'varchar',     '',   $char_d, '', '',
+        'history_date',           @date_type,            '', '',
+        'history_usernum',     'int', 'NULL',        '', '', '',
+        'item',            'varchar', 'NULL',   $char_d, '', '',
+        'description',     'varchar', 'NULL', 2*$char_d, '', '',
+        'change_data',        'text', 'NULL',        '', '', '',
+      ],
+      'primary_key'  => 'legacyhistorynum',
+      'unique'       => [],
+      'index'        => [ ['custnum'], ['history_date'], ],
+      'foreign_keys' => [
+                          { columns    => [ 'custnum' ],
+                            table      => 'cust_main',
+                          },
+                          { columns    => [ 'history_usernum' ],
+                            table      => 'access_user',
+                            references => [ 'usernum' ],
+                          },
+                        ],
+    },
+
     'cust_statement' => {
       'columns' => [
         'statementnum', 'serial', '', '', '', '',
@@ -1371,6 +1397,7 @@ sub tables_hashref {
         #void fields
         'void_date',  @date_type,                  '', '', 
         'void_reason', 'varchar', 'NULL', $char_d, '', '', 
+        'void_reasonnum', 'int', 'NULL', '', '', '', 
         'void_usernum',    'int', 'NULL',      '', '', '',
       ],
       'primary_key'  => 'crednum',
@@ -1406,6 +1433,10 @@ sub tables_hashref {
                             table      => 'cust_pkg',
                             references => [ 'pkgnum' ],
                           },
+                          { columns    => [ 'void_reasonnum' ],
+                            table      => 'reason',
+                            references => [ 'reasonnum' ],
+                          },
                           { columns    => [ 'void_usernum' ],
                             table      => 'access_user',
                             references => [ 'usernum' ],
@@ -1936,6 +1967,21 @@ sub tables_hashref {
                         ],
     },
 
+    'quotation_pkg_tax' => {
+      'columns' => [
+        'quotationtaxnum',  'serial',     '',      '', '', '',
+        'quotationpkgnum',     'int',     '',      '', '', '',
+        'itemdesc',        'varchar',     '', $char_d, '', '',
+        'taxnum',              'int',     '',      '', '', '', 
+        'taxtype',         'varchar',     '', $char_d, '', '',
+        'setup_amount',    @money_type,                '', '',
+        'recur_amount',    @money_type,                '', '',
+      ],
+      'primary_key' => 'quotationtaxnum',,
+      'unique' => [],
+      'index'  => [ [ 'quotationpkgnum' ] ],
+    },
+
     'cust_location' => { #'location' now that its prospects too, but...
       'columns' => [
         'locationnum',      'serial',     '',      '', '', '',
@@ -2654,6 +2700,7 @@ sub tables_hashref {
         'recur_show_zero',    'char', 'NULL',  1, '', '',
         'setup_show_zero',    'char', 'NULL',  1, '', '',
         'change_to_pkgnum',    'int', 'NULL', '', '', '',
+        'separate_bill',      'char', 'NULL',  1, '', '',
       ],
       'primary_key'  => 'pkgnum',
       'unique'       => [],
@@ -5161,16 +5208,17 @@ sub tables_hashref {
 
     'banned_pay' => {
       'columns' => [
-        'bannum',  'serial',   '',     '', '', '', 
-        'payby',   'char',     '',       4, '', '', 
-        'payinfo', 'varchar',  '',     128, '', '', #say, a 512-big digest _hex encoded
-       #'paymask', 'varchar',  'NULL', $char_d, '', ''
-        '_date',            @date_type,         '', '', 
-        'end_date',         @date_type,         '', '', 
-        'otaker',  'varchar',  'NULL',      32, '', '', 
-        'usernum',     'int',  'NULL',      '', '', '',
-        'bantype', 'varchar',  'NULL', $char_d, '', '',
-        'reason',  'varchar',  'NULL', $char_d, '', '', 
+        'bannum',        'serial',     '',      '', '', '', 
+        'payby',           'char',     '',       4, '', '', 
+        'payinfo',      'varchar',     '',     128, '', '', #say, a 512-big digest _hex encoded
+        'payinfo_hash', 'varchar', 'NULL',      32, '', '',
+       #'paymask',      'varchar',  'NULL', $char_d, '', ''
+        '_date',                @date_type,         '', '', 
+        'end_date',             @date_type,         '', '', 
+        'otaker',       'varchar', 'NULL',      32, '', '', 
+        'usernum',          'int', 'NULL',      '', '', '',
+        'bantype',      'varchar', 'NULL', $char_d, '', '',
+        'reason',       'varchar', 'NULL', $char_d, '', '', 
       ],
       'primary_key'  => 'bannum',
       'unique'       => [],