[freeside-commits] branch master updated. 27f72f8225edc0d903ce534613ad037b7baf3bcf

Mark Wells mark at 420.am
Mon Oct 26 18:02:30 PDT 2015


The branch, master has been updated
       via  27f72f8225edc0d903ce534613ad037b7baf3bcf (commit)
      from  434137989f7343ada30ceff4056c5f75ef8d9d27 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 27f72f8225edc0d903ce534613ad037b7baf3bcf
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Oct 26 18:01:01 2015 -0700

    calculate in_transit_payments correctly for partially complete batches, #37193

diff --git a/FS/FS/cust_main/Billing_Batch.pm b/FS/FS/cust_main/Billing_Batch.pm
index 0cf2bee..cdaf293 100644
--- a/FS/FS/cust_main/Billing_Batch.pm
+++ b/FS/FS/cust_main/Billing_Batch.pm
@@ -48,7 +48,13 @@ sub batch_card {
   }else{
     $amount = sprintf("%.2f", $self->balance - $self->in_transit_payments);
   }
-  return '' unless $amount > 0;
+  if ($amount <= 0) {
+    warn(sprintf("Customer balance %.2f - in transit amount %.2f is <= 0.\n",
+        $self->balance,
+        $self->in_transit_payments
+    ));
+    return;
+  }
   
   my $invnum = delete $options{invnum};
 
@@ -218,6 +224,7 @@ sub in_transit_payments {
     foreach my $cust_pay_batch ( qsearch('cust_pay_batch', {
       'batchnum' => $pay_batch->batchnum,
       'custnum' => $self->custnum,
+      'status'  => '',
     } ) ) {
       $in_transit_payments += $cust_pay_batch->amount;
     }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Billing_Batch.pm |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list