From 23b0288f93882b3de9e6531b33c76517e47353c5 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 6 Apr 2012 12:33:20 -0700 Subject: [PATCH] search by change date on advanced package report, #17113 --- FS/FS/cust_pkg.pm | 2 +- httemplate/search/cust_pkg.cgi | 11 +++++---- httemplate/search/report_cust_pkg.html | 43 ++++++++++++++++++++++------------ 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 855accc0c..bee1b82fb 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -3300,7 +3300,7 @@ sub search { "NOT (".FS::cust_pkg->onetime_sql . ")"; } else { - foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end cancel )) { + foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel )) { next unless exists($params->{$field}); diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 297edee90..887ec6039 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -20,6 +20,7 @@ emt('Susp. delay'), emt('Expire'), emt('Contract end'), + emt('Changed'), emt('Cancel'), emt('Reason'), FS::UI::Web::cust_header( @@ -45,7 +46,7 @@ sub { FS::part_pkg::freq_pretty(shift); }, ( map { time_or_blank($_) } - qw( setup last_bill bill adjourn susp dundate expire contract_end cancel ) ), + qw( setup last_bill bill adjourn susp dundate expire contract_end change_date cancel ) ), sub { my $self = shift; my $return = ''; @@ -94,13 +95,14 @@ '', '', '', + '', FS::UI::Web::cust_colors(), '', ], - 'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', '', + 'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', '', '', FS::UI::Web::cust_styles() ], 'size' => [ '', '', '', '', '-1' ], - 'align' => 'rrlccrrlrrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r', + 'align' => 'rrlccrrlrrrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r', 'links' => [ $link, $link, @@ -117,6 +119,7 @@ '', '', '', + '', # link to changed-from package? '', '', '', @@ -182,7 +185,7 @@ my %disable = ( '' => {}, ); -foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end cancel active )) { +foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) { my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field); diff --git a/httemplate/search/report_cust_pkg.html b/httemplate/search/report_cust_pkg.html index 3da59c2ac..e47bbb1e5 100755 --- a/httemplate/search/report_cust_pkg.html +++ b/httemplate/search/report_cust_pkg.html @@ -88,23 +88,35 @@ %> % } - + + + + + + + + +% my $noinit = 0; % foreach my $field (@date_fields) { - - - - - -% } + + +% foreach (qw(beginning ending)) { + +% $noinit = 1; +% } + +% } #foreach $field +
From date (m/d/y)To date (m/d/y)
<% $label{$field} %> - - <% include( '/elements/tr-input-beginning_ending.html', - prefix => $field, - layout => 'horiz', - ) - %> -
-
<% $label{$field} %> + <& /elements/input-date-field.html, { + 'name' => $field.'_'.$_, + 'value' => '', + 'noinit' => $noinit, + 'format' => '%m/%d/%Y', + } &> +
+ +