summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2008-05-30 03:55:49 +0000
committerivan <ivan>2008-05-30 03:55:49 +0000
commit2ec94a2d96b62fd452556819eb594dea6be2c65d (patch)
treee83274120de50aebc6c459d8bdc8068c62c52158 /FS
parent0182501c5e99b67911bee1f9393cd494f4e00f36 (diff)
1.7 sucks. add a "balance over" option to the 1.7 style agent-specific invoice send event
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_bill.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 9b7c4add7..b96b09710 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -798,6 +798,9 @@ single agent) or an arrayref of agentnums.
INVOICE_FROM, if specified, overrides the default email invoice From: address.
+AMOUNT, if specified, only sends the invoice if the total amount owed on this
+invoice and all older invoices is greater than the specified amount.
+
=cut
sub queueable_send {
@@ -828,6 +831,11 @@ sub send {
? shift
: ( $self->_agent_invoice_from || $conf->config('invoice_from') );
+ my $balance_over = ( scalar(@_) && $_[0] !~ /^\s*$/ ) ? shift : 0;
+
+ return ''
+ unless $self->cust_main->total_owed_date($self->_date) > $balance_over;
+
my @invoicing_list = $self->cust_main->invoicing_list;
$self->email($template, $invoice_from)