projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 31208 Docs $FS::Record::qsearch_qualify_columns
[freeside.git]
/
httemplate
/
search
/
cust_bill.html
diff --git
a/httemplate/search/cust_bill.html
b/httemplate/search/cust_bill.html
index
368120d
..
88e291b
100755
(executable)
--- a/
httemplate/search/cust_bill.html
+++ b/
httemplate/search/cust_bill.html
@@
-8,7
+8,7
@@
'count_addl' => $count_addl,
'redirect' => $link,
'header' => [ emt('Invoice #'),
'count_addl' => $count_addl,
'redirect' => $link,
'header' => [ emt('Invoice #'),
- emt('Gross Amount'),
+ emt(
$invoiced ? 'Charged' :
'Gross Amount'),
emt('Discount'),
emt('Credits'),
emt('Net Amount'),
emt('Discount'),
emt('Credits'),
emt('Net Amount'),
@@
-18,7
+18,7
@@
],
'fields' => [
'display_invnum',
],
'fields' => [
'display_invnum',
- 'gross',
+
$invoiced ? 'charged' :
'gross',
'discounted',
'credited',
'net',
'discounted',
'credited',
'net',
@@
-28,7
+28,7
@@
],
'sort_fields' => [
'COALESCE( agent_invid, invnum )',
],
'sort_fields' => [
'COALESCE( agent_invid, invnum )',
- 'gross',
+
$invoiced ? 'charged' :
'gross',
'discounted',
'credited',
'net',
'discounted',
'credited',
'net',
@@
-87,6
+87,9
@@
my( $count_query, $sql_query );
my $count_addl = '';
my %search = ();
my $count_addl = '';
my %search = ();
+# show invoiced amount (charged) instead of gross sales
+my $invoiced = $cgi->param('invoiced') ? 1 : 0;
+
if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
my $join_cust_main = FS::UI::Web::join_cust_main('cust_bill');
if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
my $join_cust_main = FS::UI::Web::join_cust_main('cust_bill');
@@
-128,11
+131,12
@@
if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
($search{'days'}, my $field) = ($2, $3);
$field = "_date" if $field eq 'date';
$search{'order_by'} = "cust_bill.$field";
($search{'days'}, my $field) = ($2, $3);
$field = "_date" if $field eq 'date';
$search{'order_by'} = "cust_bill.$field";
+ $search{'invoiced'} = 1; # preserve old behavior under 3.x
}
#scalars
for (qw( agentnum custnum cust_status refnum invnum_min invnum_max
}
#scalars
for (qw( agentnum custnum cust_status refnum invnum_min invnum_max
- open net newest_percust
+ open net newest_percust
invoiced
))
{
))
{
@@
-193,7
+197,7
@@
my $html_init = join("\n", map {
( my $action = $_ ) =~ s/_$//;
include('/elements/progress-init.html',
$_.'form',
( my $action = $_ ) =~ s/_$//;
include('/elements/progress-init.html',
$_.'form',
- [ keys %search ],
+ [
sort
keys %search ],
"../misc/${_}invoices.cgi",
{ 'message' => "Invoices re-${action}ed" }, #would be nice to show the number of them, but...
$_, #key
"../misc/${_}invoices.cgi",
{ 'message' => "Invoices re-${action}ed" }, #would be nice to show the number of them, but...
$_, #key
@@
-203,7
+207,7
@@
my $html_init = join("\n", map {
my @values = ref($search{$f}) ? @{ $search{$f} } : $search{$f};
map qq!<INPUT TYPE="hidden" NAME="$f" VALUE="$_">!, @values;
}
my @values = ref($search{$f}) ? @{ $search{$f} } : $search{$f};
map qq!<INPUT TYPE="hidden" NAME="$f" VALUE="$_">!, @values;
}
- keys %search
+
sort
keys %search
),
qq!</FORM>!
} qw( print_ email_ fax_ ftp_ spool_ ) ).
),
qq!</FORM>!
} qw( print_ email_ fax_ ftp_ spool_ ) ).