summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-11-15 11:37:27 -0500
committerChristopher Burger <burgerc@freeside.biz>2018-11-15 13:52:30 -0500
commita8944edbf9043e38df231ad6495f375f8655b585 (patch)
tree6606cbb7149a91bdc312e5d20ff6341efbf7add6 /FS/FS
parent3d262a9f8af976a08152a9fbc70cbcdbbf3b305e (diff)
RT# 80138 - Added config option to display/edit customer option to send or not send payment receipts
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Conf.pm9
-rw-r--r--FS/FS/Schema.pm1
-rw-r--r--FS/FS/cust_pay.pm4
3 files changed, 14 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index a2436aacd..87e5838c0 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1718,6 +1718,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 8d54326af..b092063e8 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -1664,6 +1664,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;