[freeside-commits] freeside/FS/FS cust_pay.pm,1.81,1.82

Ivan,,, ivan at wavetail.420.am
Mon Aug 23 17:55:50 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv4253

Modified Files:
	cust_pay.pm 
Log Message:
fix payment receipts when payment_receipt_msgnum is unconfigured

Index: cust_pay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay.pm,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -w -d -r1.81 -r1.82
--- cust_pay.pm	30 Jul 2010 22:08:54 -0000	1.81
+++ cust_pay.pm	24 Aug 2010 00:55:48 -0000	1.82
@@ -458,12 +458,15 @@
 
     my $error = '';
 
-    if( $conf->exists('payment_receipt_msgnum') ) {
+    if ( $conf->exists('payment_receipt_msgnum')
+         && $conf->config('payment_receipt_msgnum')
+       )
+    {
       my $msg_template = 
           FS::msg_template->by_key($conf->config('payment_receipt_msgnum'));
       $error = $msg_template->send('cust_main'=> $cust_main, 'object'=> $self);
-    }
-    elsif ( $conf->exists('payment_receipt_email') ) {
+
+    } elsif ( $conf->exists('payment_receipt_email') ) {
       my $receipt_template = new Text::Template (
         TYPE   => 'ARRAY',
         SOURCE => [ map "$_\n", $conf->config('payment_receipt_email') ],
@@ -506,8 +509,7 @@
         'body'    => [ $receipt_template->fill_in( HASH => \%fill_in ) ],
       );
 
-    } 
-    else { # no payment_receipt_msgnum or payment_receipt_email
+    } else { # no payment_receipt_msgnum or payment_receipt_email
 
       my $queue = new FS::queue {
          'paynum' => $self->paynum,



More information about the freeside-commits mailing list