summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pay.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-11-02 17:11:59 -0800
committerIvan Kohler <ivan@freeside.biz>2014-11-02 17:11:59 -0800
commit6d47b55c98b1a8e145a4b63579e148241c65b6ed (patch)
tree0d2f45e2f79d5f4e792d5b42c61d2873b5149f89 /FS/FS/cust_pay.pm
parent878072579607ed3e01c9f430d8b259626483aaec (diff)
add cust_pay insert noemail flag, RT#23357, github #32
Diffstat (limited to 'FS/FS/cust_pay.pm')
-rw-r--r--FS/FS/cust_pay.pm25
1 files changed, 23 insertions, 2 deletions
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 80a1e3e..87fad02 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -190,7 +190,13 @@ If the additional field discount_term is defined then a prepayment discount
is taken for that length of time. It is an error for the customer to owe
after this payment is made.
-A hash of optional arguments may be passed. Currently "manual" is supported.
+A hash of optional arguments may be passed. The following arguments are
+supported:
+
+=over 4
+
+=item manual
+
If true, a payment receipt is sent instead of a statement when
'payment_receipt_email' configuration option is set.
@@ -203,6 +209,13 @@ payment is created directly from the web interface, from a user-initiated
realtime payment, or from a third-party payment via self-service. It should
be I<false> when creating a payment from a billing event or from a batch.
+=item noemail
+
+Don't send an email receipt. (Note: does not currently work when
+payment_receipt-trigger is set to something other than default / cust_bill)
+
+=back
+
=cut
sub insert {
@@ -379,6 +392,7 @@ sub insert {
if ( $trigger eq 'cust_pay' ) {
my $error = $self->send_receipt(
'manual' => $options{'manual'},
+ 'noemail' => $options{'noemail'},
'cust_bill' => $cust_bill,
'cust_main' => $cust_main,
);
@@ -581,6 +595,12 @@ will be assumed.
Customer (FS::cust_main) object (for efficiency).
+=item noemail
+
+Don't send an email receipt.
+
+=cut
+
=back
=cut
@@ -687,7 +707,8 @@ sub send_receipt {
}
- } elsif ( ! $cust_main->invoice_noemail ) { #not manual
+ #not manual and no noemail flag (here or on the customer)
+ } elsif ( ! $opt->{'noemail'} && ! $cust_main->invoice_noemail ) {
my $queue = new FS::queue {
'job' => 'FS::cust_bill::queueable_email',