diff options
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/elements/tr-select-from_to.html | 2 | ||||
| -rw-r--r-- | httemplate/graph/elements/monthly.html | 9 | ||||
| -rw-r--r-- | httemplate/graph/report_cust_bill_pkg.html | 6 | ||||
| -rw-r--r-- | httemplate/misc/xmlhttp-cust_main-duplicates.html | 68 | ||||
| -rwxr-xr-x | httemplate/search/cust_pkg.cgi | 11 | ||||
| -rwxr-xr-x | httemplate/search/report_cust_pkg.html | 43 |
6 files changed, 108 insertions, 31 deletions
diff --git a/httemplate/elements/tr-select-from_to.html b/httemplate/elements/tr-select-from_to.html index 100381234..a27412f99 100644 --- a/httemplate/elements/tr-select-from_to.html +++ b/httemplate/elements/tr-select-from_to.html @@ -39,7 +39,7 @@ my %hash = ( 'show_month_abbr' => 1, 'start_year' => '1999', - 'end_year' => '2012', #haha, well... + 'end_year' => '2013', #haha, well... @_, ); </%init> diff --git a/httemplate/graph/elements/monthly.html b/httemplate/graph/elements/monthly.html index 072798c2a..86530dd39 100644 --- a/httemplate/graph/elements/monthly.html +++ b/httemplate/graph/elements/monthly.html @@ -92,10 +92,7 @@ $opt{'start_year'} ||= $cgi->param('start_year'); # || 1899+$curyear; $opt{'end_month'} ||= $cgi->param('end_month'); # || $curmon+1; $opt{'end_year'} ||= $cgi->param('end_year'); # || 1900+$curyear; -#find end of projection -$opt{'project_month'} ||= $cgi->param('project_month') || 0; -$opt{'project_year'} ||= $cgi->param('project_year') || 0; -# setting these to zero prevents projection on reports that don't support it +$opt{'projection'} ||= $cgi->param('projection') ? 1 : 0; if ( $opt{'daily'} ) { # daily granularity $opt{'start_day'} ||= $cgi->param('start_day'); @@ -118,9 +115,7 @@ my %reportopts = ( 'end_day' => $opt{'end_day'}, 'end_month' => $opt{'end_month'}, 'end_year' => $opt{'end_year'}, - 'project_day' => $opt{'project_day'}, - 'project_month' => $opt{'project_month'}, - 'project_year' => $opt{'project_year'}, + 'projection' => $opt{'projection'}, 'agentnum' => $opt{'agentnum'}, 'remove_empty' => $opt{'remove_empty'}, 'doublemonths' => $opt{'doublemonths'}, diff --git a/httemplate/graph/report_cust_bill_pkg.html b/httemplate/graph/report_cust_bill_pkg.html index f2c486cf4..07d4421e8 100644 --- a/httemplate/graph/report_cust_bill_pkg.html +++ b/httemplate/graph/report_cust_bill_pkg.html @@ -7,10 +7,8 @@ <% include('/elements/tr-select-from_to.html' ) %> <TR> - <TD ALIGN="right">Project to:</TD> - <TD><& /elements/select-month_year.html, - prefix => 'project', - show_month_abbr => 1 &></TD> + <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="projection" VALUE="1"></TD> + <TD>Show projected data for future months</TD> </TR> <% include('/elements/tr-select-agent.html', diff --git a/httemplate/misc/xmlhttp-cust_main-duplicates.html b/httemplate/misc/xmlhttp-cust_main-duplicates.html new file mode 100644 index 000000000..6654b3e39 --- /dev/null +++ b/httemplate/misc/xmlhttp-cust_main-duplicates.html @@ -0,0 +1,68 @@ +% if ( @cust_main ) { +<CENTER><BR><B>Duplicate customer</B><BR> +Choose an existing customer +<TABLE WIDTH="300px"> +<FORM name="DuplicateForm"> +% foreach (@cust_main) { +% my $custnum = $_->custnum; +<TR> + <TD ALIGN="right" VALIGN="top"><B><% $custnum %>: </B></TD> + <TD ALIGN="left"> + <% $_->name %>—<B><FONT COLOR="#<%$_->statuscolor%>"><%$_->ucfirst_cust_status%></FONT></B><BR> +<% $_->address1 %><BR> +<% $_->city %>, <% $_->state %> <% $_->zip %> + </TD> + <TD ALIGN="center"> + <INPUT TYPE="radio" NAME="dup_custnum" VALUE="<%$custnum%>"> + </TD> +</TR> +% } #foreach cust_main +</FORM> +</TABLE> +<TABLE WIDTH="100%"> +<TR> + <TD ALIGN="center"> + <BUTTON TYPE="button" onclick="submit_continue();"> + <IMG SRC="<%$p%>images/error.png"> Create a new customer + </BUTTON> + </TD> + <TD ALIGN="center"> + <BUTTON TYPE="button" onclick="<% $set_to_customer %>"> + <IMG SRC="<%$p%>images/tick.png"> Use the selected customer + </BUTTON> + </TD> +</TR> +<TR> + <TD COLSPAN=2 ALIGN="center"> + <BUTTON TYPE="button" onclick="submit_abort();"> + <IMG SRC="<%$p%>images/cross.png"> Cancel submission + </BUTTON> + </TD> +</TR> +% } +%# else return nothing +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('List customers'); + +my $conf = new FS::Conf; + +my $sub = $cgi->param('sub'); +my $hashref = decode_json($cgi->param('arg')); +my @cust_main = qsearch('cust_main', $hashref); + +my $set_to_customer = <<EOF; + var custnum_array = document.getElementsByName('dup_custnum'); + var custnum; + for(i=0; i<custnum_array.length; i++) { + if(custnum_array[i].checked) { + custnum = custnum_array[i].value; + } + } + //alert('Setting to customer '+custnum); + document.CustomerForm.elements['duplicate_of_custnum'].value = custnum; + submit_continue(); +EOF + +</%init> 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 @@ %> % } - + <TR> + <TD COLSPAN=2> + <TABLE> + <TR> + <TD></TD> + <TD>From date <i>(m/d/y)</i></TD> + <TD>To date <i>(m/d/y)</i></TD> + </TR> +% my $noinit = 0; % foreach my $field (@date_fields) { - <TR> - <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD> - <TD> - <TABLE> - <% include( '/elements/tr-input-beginning_ending.html', - prefix => $field, - layout => 'horiz', - ) - %> - </TABLE> - </TD> - </TR> - -% } + <TR> + <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD> +% foreach (qw(beginning ending)) { + <TD> + <& /elements/input-date-field.html, { + 'name' => $field.'_'.$_, + 'value' => '', + 'noinit' => $noinit, + 'format' => '%m/%d/%Y', + } &> + </TD> +% $noinit = 1; +% } + </TR> +% } #foreach $field + </TABLE> + </TD> + </TR> <SCRIPT TYPE="text/javascript"> @@ -186,6 +198,7 @@ tie my %label, 'Tie::IxHash', 'dundate' => 'Suspension delayed until', 'expire' => 'Expires', 'contract_end' => 'Contract ends', + 'change_date' => 'Changed from other package', 'cancel' => 'Cancelled', ; my @date_fields = keys %label; |
