From: levinse Date: Thu, 26 May 2011 20:59:58 +0000 (+0000) Subject: daily sales, credits, and receipts report X-Git-Tag: freeside_2_3_0~205 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=a2d31d7aeeec3e0d08e7ebe30b191da94f96618e daily sales, credits, and receipts report --- diff --git a/httemplate/elements/tr-input-beginning_ending.html b/httemplate/elements/tr-input-beginning_ending.html index 2aa597479..7481c9bb6 100644 --- a/httemplate/elements/tr-input-beginning_ending.html +++ b/httemplate/elements/tr-input-beginning_ending.html @@ -7,7 +7,7 @@ From date: - MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %> + MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %> +% unless ( $datesrequired ) { > (leave one or both dates blank for an open-ended search) +% } <%once> @@ -57,6 +59,13 @@ my %opt = @_; my $conf = new FS::Conf; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; +my $datesrequired = 0; +$datesrequired = $opt{'datesrequired'} if $opt{'datesrequired'}; + +my $from = ''; +$from = $opt{'from'} if $opt{'from'}; +my $to = ''; +$to = $opt{'to'} if $opt{'to'}; $opt{prefix} = '' unless defined $opt{prefix}; $opt{prefix} .= '_' if $opt{prefix}; diff --git a/httemplate/graph/report_money_time_daily.html b/httemplate/graph/report_money_time_daily.html index 1e1b45d4e..8328199c7 100644 --- a/httemplate/graph/report_money_time_daily.html +++ b/httemplate/graph/report_money_time_daily.html @@ -4,7 +4,12 @@ -<% include( '/elements/tr-input-beginning_ending.html' ) %> +<% include( '/elements/tr-input-beginning_ending.html', + 'datesrequired' => 1, + 'from' => time2str('%m/%d/%Y',$from), + 'to' => time2str('%m/%d/%Y',time), + ) +%> <% include('/elements/tr-select-agent.html', 'label' => 'For agent: ', @@ -20,6 +25,8 @@ <% include('/elements/footer.html') %> <%init> +my $from = time - 30*86400; + die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');