summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authormark <mark>2010-09-07 23:31:14 +0000
committermark <mark>2010-09-07 23:31:14 +0000
commit12acbe5a4071314fe87b949ffac478f132f5d305 (patch)
tree9b606886b3edba8d7dfd698f5524b3fc87b478d0 /httemplate/search
parented8ba09ae208a58242d16b36c6dfa04d9cd75414 (diff)
Option to include customers with credit balances in aging report, RT#9834
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/elements/cust_main_dayranges.html6
-rwxr-xr-xhttemplate/search/report_receivables.html19
2 files changed, 22 insertions, 3 deletions
diff --git a/httemplate/search/elements/cust_main_dayranges.html b/httemplate/search/elements/cust_main_dayranges.html
index 9b8b08f47..91e039d28 100644
--- a/httemplate/search/elements/cust_main_dayranges.html
+++ b/httemplate/search/elements/cust_main_dayranges.html
@@ -145,8 +145,12 @@ unless ( $cgi->param('all_customers') ) {
$days = $1;
}
+ # If this is set, allow cust_main records with nonzero balances
+ my $negative = $cgi->param('negative') || 0;
+
push @where,
- call_range_sub($range_sub, $days, 0, 'offset' => $offset, 'no_as'=>1). ' > 0'; # != 0';
+ call_range_sub($range_sub, $days, 0, 'offset' => $offset, 'no_as'=>1).
+ ($negative ? ' != 0' : ' > 0');
}
if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
diff --git a/httemplate/search/report_receivables.html b/httemplate/search/report_receivables.html
index 912ef26b4..e85d78697 100755
--- a/httemplate/search/report_receivables.html
+++ b/httemplate/search/report_receivables.html
@@ -20,8 +20,23 @@
<TR>
<TD ALIGN="right">Customers</TD>
<TD>
- <INPUT TYPE="radio" NAME="all_customers" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.days.disabled=true; document.OneTrueForm.days.style.backgroundColor = '#dddddd'; } else { document.OneTrueForm.days.disabled=false; document.OneTrueForm.days.style.backgroundColor = '#ffffff'; }">All customers (even those without an outstanding balance)<BR>
- <INPUT TYPE="radio" NAME="all_customers" VALUE="0" CHECKED onClick="if ( ! this.checked ) { document.OneTrueForm.days.disabled=true; document.OneTrueForm.days.style.backgroundColor = '#dddddd'; } else { document.OneTrueForm.days.disabled=false; document.OneTrueForm.days.style.backgroundColor = '#ffffff'; }">Customers with a balance over <INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3 VALUE="0"> days old
+ <SCRIPT TYPE="text/javascript">
+function toggle(obj) {
+ var f = document.OneTrueForm;
+ var val = (obj.value == obj.checked);
+ f.days.disabled = val;
+ f.negative.disabled = val;
+ f.days.style.backgroundColor = val ? '#dddddd' : '#ffffff';
+}
+ </SCRIPT>
+ <TABLE STYLE="padding: 0px">
+ <TR><TD><INPUT TYPE="radio" NAME="all_customers" VALUE="1" onClick="toggle(this)"></TD>
+ <TD>All customers (even those without an outstanding balance)</TD></TR>
+ <TR><TD><INPUT TYPE="radio" NAME="all_customers" VALUE="0" CHECKED onClick="toggle(this)"></TD>
+ <TD>Customers with a balance over <INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3 VALUE="0"> days old</TD></TR>
+ <TR><TD></TD>
+ <TD><INPUT TYPE="checkbox" NAME="negative" VALUE="1">&nbsp;Including customers with credit balances</TD></TR>
+ </TABLE>
</TD>
</TR>
<% include( '/elements/tr-input-date-field.html', {