[freeside-commits] branch FREESIDE_3_BRANCH updated. 45e80dcb65ede22713ea6795a89729429392d504

Ivan ivan at 420.am
Sun Apr 27 15:38:47 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  45e80dcb65ede22713ea6795a89729429392d504 (commit)
      from  729956733bf21293c801358c3e711c81d7df5b4f (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 45e80dcb65ede22713ea6795a89729429392d504
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Apr 27 15:38:46 2014 -0700

    invoice # in payment receipts, RT#26083

diff --git a/FS/FS/cust_bill_pay_pkg.pm b/FS/FS/cust_bill_pay_pkg.pm
index eb2e80c..5d154d0 100644
--- a/FS/FS/cust_bill_pay_pkg.pm
+++ b/FS/FS/cust_bill_pay_pkg.pm
@@ -102,7 +102,11 @@ sub insert {
 
   #payment receipt
   my $conf = new FS::Conf;
-  my $trigger = $conf->config('payment_receipt-trigger') || 'cust_pay';
+  my $trigger =
+    $conf->config('payment_receipt-trigger',
+                    $self->cust_bill_pay->cust_bill->cust_main->agentnum,
+                 )
+    || 'cust_pay';
   if ( $trigger eq 'cust_bill_pay_pkg' ) {
     my $error = $self->send_receipt(
       'manual'    => $options{'manual'},
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 3cdbdb3..26d46dc 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -644,6 +644,9 @@ sub send_receipt {
     my $msgnum = $conf->config('payment_receipt_msgnum', $cust_main->agentnum);
     if ( $msgnum ) {
 
+      my %substitutions = ();
+      $substitutions{invnum} = $opt->{cust_bill}->invnum if $opt->{cust_bill};
+
       my $queue = new FS::queue {
         'job'     => 'FS::Misc::process_send_email',
         'paynum'  => $self->paynum,
@@ -651,9 +654,10 @@ sub send_receipt {
       };
       $error = $queue->insert(
         FS::msg_template->by_key($msgnum)->prepare(
-          'cust_main'   => $cust_main,
-          'object'      => $self,
-          'from_config' => 'payment_receipt_from',
+          'cust_main'     => $cust_main,
+          'object'        => $self,
+          'from_config'   => 'payment_receipt_from',
+          'substitutions' => \%substitutions,
         ),
         'msgtype' => 'receipt', # override msg_template's default
       );

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

Summary of changes:
 FS/FS/cust_bill_pay_pkg.pm |    6 +++++-
 FS/FS/cust_pay.pm          |   10 +++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list