projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0182501
)
1.7 sucks. add a "balance over" option to the 1.7 style agent-specific invoice send...
author
ivan
<ivan>
Fri, 30 May 2008 03:55:49 +0000
(
03:55
+0000)
committer
ivan
<ivan>
Fri, 30 May 2008 03:55:49 +0000
(
03:55
+0000)
FS/FS/cust_bill.pm
patch
|
blob
|
history
httemplate/edit/part_bill_event.cgi
patch
|
blob
|
history
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
9b7c4ad
..
b96b097
100644
(file)
--- 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.
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 {
=cut
sub queueable_send {
@@
-828,6
+831,11
@@
sub send {
? shift
: ( $self->_agent_invoice_from || $conf->config('invoice_from') );
? 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)
my @invoicing_list = $self->cust_main->invoicing_list;
$self->email($template, $invoice_from)
diff --git
a/httemplate/edit/part_bill_event.cgi
b/httemplate/edit/part_bill_event.cgi
index
6dd92c0
..
df09bab
100755
(executable)
--- a/
httemplate/edit/part_bill_event.cgi
+++ b/
httemplate/edit/part_bill_event.cgi
@@
-249,7
+249,11
@@
Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %>
%
% 'send_agent' => {
% 'name' => 'Send invoice (email/print/fax) ',
%
% 'send_agent' => {
% 'name' => 'Send invoice (email/print/fax) ',
-% 'code' => '$cust_bill->send(\'%%%agent_templatename%%%\', [ %%%agentnum%%% ], \'%%%agent_invoice_from%%%\');',
+% 'code' => '$cust_bill->send( \'%%%agent_templatename%%%\',
+% [ %%%agentnum%%% ],
+% \'%%%agent_invoice_from%%%\',
+% %%%agent_balanceover%%%
+% );',
% 'html' => sub {
% '<TABLE BORDER=0>
% <TR>
% 'html' => sub {
% '<TABLE BORDER=0>
% <TR>
@@
-268,6
+272,13
@@
Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %>
% <INPUT TYPE="text" NAME="agent_invoice_from" VALUE="%%%agent_invoice_from%%%">
% </TD>
% </TR>
% <INPUT TYPE="text" NAME="agent_invoice_from" VALUE="%%%agent_invoice_from%%%">
% </TD>
% </TR>
+% <TR>
+% <TD ALIGN="right">if balance (this invoice and previous) over
+% </TD>
+% <TD>
+% '. $money_char. '<INPUT TYPE="text" SIZE="7" NAME="agent_balanceover" VALUE="%%%agent_balanceover%%%">
+% </TD>
+% </TR>
% </TABLE>';
% },
% 'weight' => 50,
% </TABLE>';
% },
% 'weight' => 50,