diff options
-rw-r--r-- | FS/FS/Report/Table/Daily.pm | 4 | ||||
-rw-r--r-- | httemplate/elements/tr-input-beginning_ending.html | 4 | ||||
-rw-r--r-- | httemplate/graph/report_money_time_daily.html | 9 |
3 files changed, 10 insertions, 7 deletions
diff --git a/FS/FS/Report/Table/Daily.pm b/FS/FS/Report/Table/Daily.pm index 6087b0dcc..570fefe4d 100644 --- a/FS/FS/Report/Table/Daily.pm +++ b/FS/FS/Report/Table/Daily.pm @@ -27,6 +27,7 @@ FS::Report::Table::Daily - Tables of report data, indexed daily 'end_day' => 27, #opt 'agentnum' => 54 + 'cust_classnum' => [ 1,2,4 ], 'params' => [ [ 'paramsfor', 'item_one' ], [ 'item', 'two' ] ], # ... 'remove_empty' => 1, #collapse empty rows, default 0 'item_labels' => [ ], #useful with remove_empty @@ -54,6 +55,8 @@ sub data { my $emonth = $self->{'end_month'}; my $eyear = $self->{'end_year'}; my $agentnum = $self->{'agentnum'}; + my $cust_classnum = $self->{'cust_classnum'} || []; + $cust_classnum = [ $cust_classnum ] if !ref($cust_classnum); my %data; @@ -83,6 +86,7 @@ sub data { for ( $i = 0; $i < scalar(@items); $i++ ) { my $item = $items[$i]; my @param = $self->{'params'} ? @{ $self->{'params'}[$col] }: (); + push @param, 'cust_classnum' => $cust_classnum if @$cust_classnum; my $value = $self->$item($speriod, $eperiod, $agentnum, @param); push @{$data{data}->[$col++]}, $value; } diff --git a/httemplate/elements/tr-input-beginning_ending.html b/httemplate/elements/tr-input-beginning_ending.html index ffc903875..91f55eb69 100644 --- a/httemplate/elements/tr-input-beginning_ending.html +++ b/httemplate/elements/tr-input-beginning_ending.html @@ -7,7 +7,7 @@ <TR> <TD ALIGN="right">From date: </TD> - <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>beginning" ID="<% $opt{prefix} %>beginning_text" VALUE="<% $from %>" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>beginning_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>beginning_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD> + <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>beginning" ID="<% $opt{prefix} %>beginning_text" VALUE="<% time2str($date_format, $from) %>" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>beginning_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>beginning_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD> <SCRIPT TYPE="text/javascript"> Calendar.setup({ inputField: "<% $opt{prefix} %>beginning_text", @@ -26,7 +26,7 @@ % } <TD ALIGN="right">To date: </TD> - <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>ending" ID="<% $opt{prefix} %>ending_text" VALUE="<% $to %>" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>ending_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>ending_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD> + <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>ending" ID="<% $opt{prefix} %>ending_text" VALUE="<% time2str($date_format, $to) %>" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>ending_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>ending_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD> <SCRIPT TYPE="text/javascript"> Calendar.setup({ inputField: "<% $opt{prefix} %>ending_text", diff --git a/httemplate/graph/report_money_time_daily.html b/httemplate/graph/report_money_time_daily.html index a436d0879..e80f5862c 100644 --- a/httemplate/graph/report_money_time_daily.html +++ b/httemplate/graph/report_money_time_daily.html @@ -4,12 +4,11 @@ <TABLE> -<% include( '/elements/tr-input-beginning_ending.html', +<& /elements/tr-input-beginning_ending.html, 'datesrequired' => 1, - 'from' => time2str('%m/%d/%Y',$from), - 'to' => time2str('%m/%d/%Y',time), - ) -%> + 'from' => $from, + 'to' => time, +&> <% include('/elements/tr-select-agent.html', 'label' => 'For agent: ', |