[freeside-commits] branch master updated. 0e115ecd7e70269ac58ce705adec4b1c801d14de

Christopher Burger burgerc at freeside.biz
Thu Nov 15 08:37:58 PST 2018


The branch, master has been updated
       via  0e115ecd7e70269ac58ce705adec4b1c801d14de (commit)
      from  96077ef6ef66cf65bb47eb78158fb89b65a3af0c (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 0e115ecd7e70269ac58ce705adec4b1c801d14de
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Nov 15 11:37:27 2018 -0500

    RT# 80138 - Added config option to display/edit customer option to send or not send payment receipts

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index d5b72fa4b..5a744510d 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1694,6 +1694,15 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'allow_payment_receipt_noemail',
+    'section'     => 'notification',
+    'description' => 'Add option on customer edit/view page to disable emailing of payment receipts.  If this option is set to NO it will override customer specific option, so when set to NO system will not check for payment_receipt_noemail option at customer level.',
+    'type'        => 'checkbox',
+    'per_agent'   => 1,
+    'agent_bool'  => 1,
+  },
+
+  {
     'key'         => 'payment_receipt',
     'section'     => 'notification',
     'description' => 'Send payment receipts.',
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 6ea060963..169d22ac8 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -1695,6 +1695,7 @@ sub tables_hashref {
         'invoice_attn', 'varchar', 'NULL', $char_d, '', '',
         'invoice_ship_address', 'char', 'NULL', 1, '', '',
         'postal_invoice', 'char', 'NULL', 1, '', '',
+        'paymentreceipt_noemail', 'char', 'NULL', 1, '', '',
       ],
       'primary_key'  => 'custnum',
       'unique'       => [ [ 'agentnum', 'agent_custid' ] ],
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 4c82d106e..915cb3303 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -241,6 +241,8 @@ sub insert {
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
+  my $conf = new FS::Conf;
+
   my $cust_bill;
   if ( $self->invnum ) {
     $cust_bill = qsearchs('cust_bill', { 'invnum' => $self->invnum } )
@@ -650,6 +652,8 @@ sub send_receipt {
 
   return '' unless $conf->config_bool('payment_receipt', $cust_main->agentnum);
 
+  return '' if ($conf->config_bool('allow_payment_receipt_noemail', $cust_main->agentnum) && $cust_main->paymentreceipt_noemail);
+
   my @invoicing_list = $cust_main->invoicing_list_emailonly;
   return '' unless @invoicing_list;
 
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index fa7abd2c0..618e1913a 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -105,6 +105,16 @@
       box_first   => 1,
     &>
 
+% if ( $conf->config_bool('allow_payment_receipt_noemail', $cust_main->agentnum) ) {
+    <& /elements/tr-checkbox.html,
+      field       => 'paymentreceipt_noemail',
+      label       => emt('Do not send email payment receipts'),
+      value       => 'Y',
+      curr_value  => $cust_main->paymentreceipt_noemail,
+      box_first   => 1,
+    &>
+% }
+
     <& /elements/tr-checkbox.html,
       field       => 'message_noemail',
       label       => emt('Do not send other email notices'),
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index 5935da9cd..29ed2c760 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -167,6 +167,12 @@ set_display_recurring(<% encode_json({'display_recurring' => [ $cust_main->displ
   <TD><% $cust_main->invoice_noemail ? $refused : $allowed %></TD>
 % }
 </TR>
+% if ( $conf->config_bool('allow_payment_receipt_noemail', $cust_main->agentnum) ) {
+<TR>
+  <TH ALIGN="right"><% mt('Email payment receipts') |h %></TH>
+  <TD><% $cust_main->paymentreceipt_noemail ? $refused : $allowed %></TD>
+</TR>
+% }
 <TR>
   <TH ALIGN="right"><% mt('Other email notices') |h %></TH>
   <TD>

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

Summary of changes:
 FS/FS/Conf.pm                          |  9 +++++++++
 FS/FS/Schema.pm                        |  1 +
 FS/FS/cust_pay.pm                      |  4 ++++
 httemplate/edit/cust_main/billing.html | 10 ++++++++++
 httemplate/view/cust_main/billing.html |  6 ++++++
 5 files changed, 30 insertions(+)




More information about the freeside-commits mailing list