[freeside-commits] branch FREESIDE_3_BRANCH updated. 207978f5897048e616e2c49a6e11cf8af35b0444

Mark Wells mark at 420.am
Fri Apr 25 14:18:10 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  207978f5897048e616e2c49a6e11cf8af35b0444 (commit)
      from  2087a0f972b1ef1cb918d2c2316577e533ffd3f1 (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 207978f5897048e616e2c49a6e11cf8af35b0444
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Apr 24 20:23:48 2014 -0700

    allow fees to be charged based on batch payment attempts, #27778

diff --git a/FS/FS/cust_event_fee.pm b/FS/FS/cust_event_fee.pm
index ad78b0e..f668633 100644
--- a/FS/FS/cust_event_fee.pm
+++ b/FS/FS/cust_event_fee.pm
@@ -153,6 +153,15 @@ sub by_cust {
     table     => 'cust_event_fee',
     addl_from => 'JOIN cust_event USING (eventnum) ' .
                  'JOIN part_event USING (eventpart) ' .
+                 'JOIN cust_pay_batch ON (cust_event.tablenum = cust_pay_batch.paybatchnum)',
+    extra_sql => "$where eventtable = 'cust_pay_batch' ".
+                 "AND cust_pay_batch.custnum = $custnum",
+    %params
+  }),
+  qsearch({
+    table     => 'cust_event_fee',
+    addl_from => 'JOIN cust_event USING (eventnum) ' .
+                 'JOIN part_event USING (eventpart) ' .
                  'JOIN cust_pkg ON (cust_event.tablenum = cust_pkg.pkgnum)',
     extra_sql => "$where eventtable = 'cust_pkg' ".
                  "AND cust_pkg.custnum = $custnum",
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index bdb4520..d0fd12c 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -570,7 +570,10 @@ sub bill {
       my $object = $event_fee->cust_event->cust_X;
       my $part_fee = $event_fee->part_fee;
       my $cust_bill;
-      if ( $object->isa('FS::cust_main') or $object->isa('FS::cust_pkg') ) {
+      if ( $object->isa('FS::cust_main')
+           or $object->isa('FS::cust_pkg')
+           or $object->isa('FS::cust_pay_batch') )
+      {
         # Not the real cust_bill object that will be inserted--in particular
         # there are no taxes yet.  If you want to charge a fee on the total 
         # invoice amount including taxes, you have to put the fee on the next
diff --git a/FS/FS/part_event/Action/cust_fee.pm b/FS/FS/part_event/Action/cust_fee.pm
index 9373091..27ca2a1 100644
--- a/FS/FS/part_event/Action/cust_fee.pm
+++ b/FS/FS/part_event/Action/cust_fee.pm
@@ -6,7 +6,8 @@ use base qw( FS::part_event::Action::Mixin::fee );
 sub description { 'Charge a fee based on the customer\'s current invoice'; }
 
 sub eventtable_hashref {
-    { 'cust_main' => 1 };
+    { 'cust_main'       => 1,
+      'cust_pay_batch'  => 1 };
 }
 
 sub hold_until_bill { 1 }

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

Summary of changes:
 FS/FS/cust_event_fee.pm             |    9 +++++++++
 FS/FS/cust_main/Billing.pm          |    5 ++++-
 FS/FS/part_event/Action/cust_fee.pm |    3 ++-
 3 files changed, 15 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list