add cust_main.archived field, skip billing if Y, RT#4412
authorivan <ivan>
Mon, 20 Apr 2009 16:58:08 +0000 (16:58 +0000)
committerivan <ivan>
Mon, 20 Apr 2009 16:58:08 +0000 (16:58 +0000)
FS/FS/Cron/bill.pm
FS/FS/Schema.pm
FS/FS/cust_main.pm

index ecc8910..5c0a5da 100644 (file)
@@ -24,6 +24,8 @@ sub bill {
 
   my @search = ();
 
+  push @search, "cust_main.archived != 'Y' "; #disable?
+
   push @search, "cust_main.payby    = '". $opt{'p'}. "'"
     if $opt{'p'};
   push @search, "cust_main.agentnum =  ". $opt{'a'}
index f1692b5..6aae916 100644 (file)
@@ -551,16 +551,23 @@ sub tables_hashref {
         'referral_custnum', 'int',  'NULL', '', '', '', 
         'comments', 'text', 'NULL', '', '', '', 
         'spool_cdr','char', 'NULL', 1, '', '', 
+        'archived', 'char', 'NULL', 1, '', '',
       ],
       'primary_key' => 'custnum',
       'unique' => [ [ 'agentnum', 'agent_custid' ] ],
       #'index' => [ ['last'], ['company'] ],
-      'index' => [ ['last'], [ 'company' ], [ 'referral_custnum' ],
-                   [ 'daytime' ], [ 'night' ], [ 'fax' ], [ 'refnum' ],
-                   [ 'county' ], [ 'state' ], [ 'country' ], [ 'zip' ],
-                   [ 'ship_last' ], [ 'ship_company' ],
+      'index' => [
+                   [ 'agentnum' ], [ 'refnum' ], [ 'custbatch' ],
+                   [ 'referral_custnum' ],
                    [ 'payby' ], [ 'paydate' ],
-                   [ 'agentnum' ], [ 'custbatch' ],
+                   [ 'archived' ],
+                   #billing
+                   ['last'], [ 'company' ],
+                   [ 'county' ], [ 'state' ], [ 'country' ],
+                   [ 'zip' ],
+                   [ 'daytime' ], [ 'night' ], [ 'fax' ],
+                   #shipping
+                   [ 'ship_last' ], [ 'ship_company' ],
                  ],
     },
 
index a5bf36d..076831a 100644 (file)
@@ -1569,7 +1569,7 @@ sub check {
     $self->payname($1);
   }
 
-  foreach my $flag (qw( tax spool_cdr )) {
+  foreach my $flag (qw( tax spool_cdr archived )) {
     $self->$flag() =~ /^(Y?)$/ or return "Illegal $flag: ". $self->$flag();
     $self->$flag($1);
   }