value issues and many bits remain
authorjeff <jeff>
Fri, 16 Jun 2006 01:23:41 +0000 (01:23 +0000)
committerjeff <jeff>
Fri, 16 Jun 2006 01:23:41 +0000 (01:23 +0000)
FS/FS/cust_bill.pm
FS/FS/pay_batch.pm
httemplate/misc/download-batch.cgi

index c2a39af..8a05fcf 100644 (file)
@@ -1286,10 +1286,11 @@ sub batch_card {
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
-  my $pay_batch = qsearchs('pay_batch'=> '');
+  my $pay_batch = qsearchs('pay_batch', {'status' => 'O'});
 
   unless ($pay_batch) {
     $pay_batch = new FS::pay_batch;
 
   unless ($pay_batch) {
     $pay_batch = new FS::pay_batch;
+    $pay_batch->setfield('status' => 'O');
     my $error = $pay_batch->insert;
     if ( $error ) {
       die "error creating new batch: $error\n";
     my $error = $pay_batch->insert;
     if ( $error ) {
       die "error creating new batch: $error\n";
index 192c5df..41b312c 100644 (file)
@@ -98,7 +98,7 @@ sub check {
 
   my $error = 
     $self->ut_numbern('batchnum')
 
   my $error = 
     $self->ut_numbern('batchnum')
-    || $self->ut_enum('status', [ '', 'I', 'R' ])
+    || $self->ut_enum('status', [ 'O', 'I', 'R' ])
   ;
   return $error if $error;
 
   ;
   return $error if $error;
 
index 2d6f8a2..6172b13 100644 (file)
@@ -16,7 +16,7 @@ my $oldAutoCommit = $FS::UID::AutoCommit;
 local $FS::UID::AutoCommit = 0;
 my $dbh = dbh;
 
 local $FS::UID::AutoCommit = 0;
 my $dbh = dbh;
 
-my $pay_batch = qsearchs('pay_batch', {'status'=>''} );
+my $pay_batch = qsearchs('pay_batch', {'status'=>'O'} );
 die "No pending batch. \n" unless $pay_batch;
 
 my %batchhash = $pay_batch->hash;
 die "No pending batch. \n" unless $pay_batch;
 
 my %batchhash = $pay_batch->hash;