From 0ea039f9084014e27a1b99ff033bf04bdab94966 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 14 Nov 2009 00:08:13 +0000 Subject: [PATCH] add invoice terms to advanced customer report. dogfood. --- FS/FS/cust_main.pm | 16 ++++++++++++++++ httemplate/elements/select-terms.html | 17 ++++++++++++++++- httemplate/search/cust_main.html | 2 +- httemplate/search/report_cust_main.html | 11 +++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 858ac14ff..08c7a5113 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -8405,6 +8405,22 @@ sub search_sql { ; } + ### + # invoice terms + ### + + if ( $params->{'invoice_terms'} =~ /^([\w ]+)$/ ) { + my $terms = $1; + if ( $1 eq 'NULL' ) { + push @where, + "( cust_main.invoice_terms IS NULL OR cust_main.invoice_terms = '' )"; + } else { + push @where, + "cust_main.invoice_terms IS NOT NULL", + "cust_main.invoice_terms = '$1'"; + } + } + ## # amounts ## diff --git a/httemplate/elements/select-terms.html b/httemplate/elements/select-terms.html index 629d1e464..52f9fb542 100644 --- a/httemplate/elements/select-terms.html +++ b/httemplate/elements/select-terms.html @@ -2,7 +2,18 @@ ID = "invoice_terms" <% $opt{'disabled'} ? 'DISABLED' : ''%> > -