RT#40056: Export DID's to portaone switch [improvements]
[freeside.git] / FS / FS / Schema.pm
index 3849443..aa0bcd7 100644 (file)
@@ -56,6 +56,7 @@ sub reload_dbdef {
     warn "[debug]$me re-using cached dbdef for $file\n" if $DEBUG;
   }
   $dbdef = $dbdef_cache{$file};
+  FS::Record::fk_methods_init();
 }
 
 =item dbdef
@@ -1924,6 +1925,8 @@ sub tables_hashref {
         '_date',        @date_type,             '', '', 
         'disabled',         'char', 'NULL',  1, '', '', 
         'usernum',           'int', 'NULL', '', '', '',
+        'close_date',   @date_type,             '', '', 
+        'confidence',        'int', 'NULL', '', '', '',
         #'total',      @money_type,       '', '', 
         #'quotation_term', 'varchar', 'NULL', $char_d, '', '',
       ],
@@ -1979,6 +1982,7 @@ sub tables_hashref {
         'quotationpkgnum', 'int', '', '', '', '',
         'format',  'char', 'NULL', 1, '', '',       # not used for anything
         'detail',  'varchar', '', 255, '', '',
+        'copy_on_order',        'char', 'NULL',  1, '', '', # 'Y' to copy when ordering
       ],
       'primary_key'  => 'detailnum',
       'unique'       => [],
@@ -2270,6 +2274,7 @@ sub tables_hashref {
         'taxname',  'varchar', 'NULL', $char_d, '', '', 
         'setuptax',    'char', 'NULL',       1, '', '', # Y = setup tax exempt
         'recurtax',    'char', 'NULL',       1, '', '', # Y = recur tax exempt
+        'source',   'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'taxnum',
       'unique' => [],
@@ -3075,6 +3080,7 @@ sub tables_hashref {
        'paymask', 'varchar', 'NULL', $char_d, '', '', 
         'paybatch',     'varchar',   'NULL', $char_d, '', '', 
         'closed',    'char', 'NULL', 1, '', '', 
+        'source_paynum', 'int', 'NULL', '', '', '', # link to cust_payby, to prevent unapply of gateway-generated refunds
         # credit card/EFT fields (formerly in paybatch)
         'gatewaynum',     'int', 'NULL', '', '', '', # payment_gateway FK
         'processor',  'varchar', 'NULL', $char_d, '', '', # module name
@@ -3097,6 +3103,10 @@ sub tables_hashref {
                           { columns    => [ 'gatewaynum' ],
                             table      => 'payment_gateway',
                           },
+                          { columns    => [ 'source_paynum' ],
+                            table      => 'cust_pay',
+                            references => [ 'paynum' ],
+                          },
                         ],
     },
 
@@ -5491,6 +5501,7 @@ sub tables_hashref {
         'rated_ratedetailnum',        'int', 'NULL',      '', '', '',
         'rated_classnum',             'int', 'NULL',      '', '', '', 
         'rated_ratename',         'varchar', 'NULL', $char_d, '', '', 
+        'rated_cost',            'decimal', 'NULL',  '10,4', '', '',
 
         'carrierid',               'bigint', 'NULL',      '', '', '',
 
@@ -5529,6 +5540,7 @@ sub tables_hashref {
                    [ 'freesidestatus' ], [ 'freesiderewritestatus' ],
                    [ 'cdrbatch' ], [ 'cdrbatchnum' ],
                    [ 'src_ip_addr' ], [ 'dst_ip_addr' ], [ 'dst_term' ],
+                   [ 'detailnum' ],
                  ],
       #no FKs on cdr table... choosing not to throw errors no matter what's
       # thrown in here.  better to have the data.
@@ -5788,10 +5800,11 @@ sub tables_hashref {
 
     'access_user_log' => {
       'columns'      => [
-        'lognum',  'serial', '',        '', '', '',
-        'usernum',    'int', '',        '', '', '',
-        'path',   'varchar', '', 2*$char_d, '', '',
-        '_date',         @date_type,        '', '',
+        'lognum',          'serial',     '',        '', '', '',
+        'usernum',            'int',     '',        '', '', '',
+        'path',           'varchar',     '', 2*$char_d, '', '',
+        '_date',                   @date_type,          '', '',
+        'render_seconds',     'int', 'NULL',        '', '', '',
       ],
       'primary_key'  => 'lognum',
       'unique'       => [],
@@ -5848,6 +5861,7 @@ sub tables_hashref {
         'pbxsvc',                         'int', 'NULL',      '', '', '',
         'domsvc',                         'int', 'NULL',      '', '', '', 
         'locationnum',                    'int', 'NULL',      '', '', '',
+        'forward_svcnum',                 'int', 'NULL',      '', '', '',
         'forwarddst',                 'varchar', 'NULL',      15, '', '', 
         'email',                      'varchar', 'NULL',     255, '', '', 
         'lnp_status',                 'varchar', 'NULL', $char_d, '', '',