summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-04-26 11:41:05 -0700
committerMark Wells <mark@freeside.biz>2012-04-26 11:41:05 -0700
commit527b92c4f125282e267863cb102664da57f94ebd (patch)
treef3c983f22e8d8e90b50ccff6feb1a17bc162652e /httemplate/misc
parent580dd345b7616365903b9fbedc162f77e5c8b91f (diff)
allocate quick payment only when customer has multiple open invoices, #15861
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/batch-cust_pay.html5
-rw-r--r--httemplate/misc/xmlhttp-cust_main-search.cgi4
2 files changed, 6 insertions, 3 deletions
diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html
index 45459f14d..887b92489 100644
--- a/httemplate/misc/batch-cust_pay.html
+++ b/httemplate/misc/batch-cust_pay.html
@@ -23,7 +23,10 @@ function add_row_callback(rownum, prefix) {
function custnum_update_callback(rownum, prefix) {
var custnum = document.getElementById('custnum'+rownum).value;
- document.getElementById('enable_app'+rownum).disabled = (custnum == 0);
+ document.getElementById('enable_app'+rownum).disabled = (
+ custnum == 0 ||
+ num_open_invoices[rownum] < 2
+ );
% if ( $use_discounts ) {
select_discount_term(rownum, prefix);
% }
diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi
index 436501e8b..86983e462 100644
--- a/httemplate/misc/xmlhttp-cust_main-search.cgi
+++ b/httemplate/misc/xmlhttp-cust_main-search.cgi
@@ -12,7 +12,7 @@
% my @cust_main = smart_search( 'search' => $string,
% 'no_fuzzy_on_exact' => 1, #pref?
% );
-% my $return = [ map [ $_->custnum, $_->name, $_->balance, $_->ucfirst_status, $_->statuscolor ], @cust_main ];
+% my $return = [ map [ $_->custnum, $_->name, $_->balance, $_->ucfirst_status, $_->statuscolor, scalar($_->open_cust_bill) ], @cust_main ];
%
<% objToJson($return) %>
% } elsif ( $sub eq 'invnum_search' ) {
@@ -57,7 +57,7 @@ sub findbycustnum{
'hashref' => $hashref,
'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
});
- return [ $c->custnum, $c->name, $c->balance, $c->ucfirst_status, $c->statuscolor ]
+ return [ $c->custnum, $c->name, $c->balance, $c->ucfirst_status, $c->statuscolor, scalar($c->open_cust_bill) ]
if $c;
[];
}