promo codes and separate signup addresses for hdn
[freeside.git] / FS / bin / freeside-setup
index 33b3465..49953b8 100755 (executable)
@@ -270,7 +270,7 @@ foreach my $country ( sort map uc($_), all_country_codes ) {
 
 #billing events
 foreach my $aref ( 
-  [ 'COMP', 'Comp invoice', '$cust_bill->comp();', 30, 'comp' ],
+  #[ 'COMP', 'Comp invoice', '$cust_bill->comp();', 30, 'comp' ],
   [ 'CARD', 'Batch card', '$cust_bill->batch_card();', 40, 'batch-card' ],
   [ 'BILL', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
   [ 'DCRD', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
@@ -498,7 +498,7 @@ sub tables_hash_hack {
       'unique' => [],
       #'index' => [ ['last'], ['company'] ],
       'index' => [ ['last'], [ 'company' ], [ 'referral_custnum' ],
-                   [ 'daytime' ], [ 'night' ], [ 'fax' ],
+                   [ 'daytime' ], [ 'night' ], [ 'fax' ], [ 'refnum' ],
                  ],
     },
 
@@ -552,6 +552,26 @@ sub tables_hash_hack {
       'index' => [ [ 'custnum' ], [ 'paybatch' ], [ 'payby' ], [ '_date' ] ],
     },
 
+    'cust_pay_void' => {
+      'columns' => [
+        'paynum',    'int',    '',   '',
+        'custnum',   'int',    '',   '',
+        'paid',      @money_type,
+        '_date',     @date_type,
+        'payby',     'char',   '',     4, # CARD/BILL/COMP, should be index into
+                                          # payment type table.
+        'payinfo',   'varchar',   'NULL', $char_d,  #see cust_main above
+        'paybatch',  'varchar',   'NULL', $char_d, #for auditing purposes.
+        'closed',    'char', 'NULL', 1,
+        'void_date', @date_type,
+        'reason',    'varchar',   'NULL', $char_d,
+        'otaker',   'varchar', '', 32,
+      ],
+      'primary_key' => 'paynum',
+      'unique' => [],
+      'index' => [ [ 'custnum' ] ],
+    },
+
     'cust_bill_pay' => {
       'columns' => [
         'billpaynum', 'serial',     '',   '',
@@ -660,6 +680,7 @@ sub tables_hash_hack {
         'pkgpart',    'serial',    '',   '',
         'pkg',        'varchar',   '',   $char_d,
         'comment',    'varchar',   '',   $char_d,
+        'promo_code', 'varchar', 'NULL', $char_d,
         'setup',      @perl_type,
         'freq',       'varchar',   '',   $char_d,  #billing frequency
         'recur',      @perl_type,
@@ -671,8 +692,8 @@ sub tables_hash_hack {
         'taxclass',   'varchar', 'NULL', $char_d,
       ],
       'primary_key' => 'pkgpart',
-      'unique' => [],
-      'index' => [ [ 'disabled' ], ],
+      'unique' => [ [ 'promo_code' ] ],
+      'index' => [ [ 'disabled' ] ],
     },
 
 #    'part_title' => {
@@ -1107,7 +1128,7 @@ sub tables_hash_hack {
     'svc_external' => {
       'columns' => [
         'svcnum', 'int', '', '',
-        'id',     'int', '', '',
+        'id',     'int', 'NULL', '',
         'title',  'varchar', 'NULL', $char_d,
       ],
       'primary_key' => 'svcnum',
@@ -1128,6 +1149,63 @@ sub tables_hash_hack {
       'index' => [ ['paynum'], ['refundnum'] ],
     },
 
+    'part_pkg_option' => {
+      'columns' => [
+        'optionnum', 'serial', '', '',
+        'pkgpart', 'int', '', '',
+        'optionname', 'varchar', '', $char_d,
+        'optionvalue', 'text', 'NULL', '',
+      ],
+      'primary_key' => 'optionnum',
+      'unique'      => [],
+      'index'       => [ [ 'pkgpart' ], [ 'optionname' ] ],
+    },
+
+    'rate' => {
+      'columns' => [
+        'ratenum',  'serial', '', '',
+        'ratename', 'varchar', '', $char_d,
+      ],
+      'primary_key' => 'ratenum',
+      'unique'      => [],
+      'index'       => [],
+    },
+
+    'rate_detail' => {
+      'columns' => [
+        'ratenum',         'int',     '', '',
+        'orig_regionnum',  'int', 'NULL', '',
+        'dest_regionnum',  'int',     '', '',
+        'min_included',    'int',     '', '',
+        'min_charge',      @money_type,
+        'sec_granularity', 'int',     '', '',
+        #time period (link to table of periods)?
+      ],
+      'primary_key' => '',
+      'unique'      => [ [ 'ratenum', 'orig_regionnum', 'dest_regionnum' ] ],
+      'index'       => [],
+    },
+
+    'rate_region' => {
+      'columns' => [
+        'regionnum',   'serial',      '', '',
+        'regionname',  'varchar',     '', $char_d,
+      'primary_key' => 'regionnum',
+      'unique'      => [].
+      'index'       => [],
+    },
+
+    'rate_prefix' => {
+      'columns' => [
+        'prefixnum',   'serial',    '', '',
+        'regionnum',   'int',       '', '',,
+        'countrycode', 'varchar',     '', 3,
+        'npa',         'varchar', 'NULL', 4, #not 3?
+        'nxx',         'varchar', 'NULL', 3,
+      ],
+      'primary_key' => 'prefixnum',
+      'unique'      => [].
+      'index'       => [ [ 'countrycode' ], [ 'regionnum' ] ],
 
 
   );