diff options
author | mark <mark> | 2010-10-12 01:15:17 +0000 |
---|---|---|
committer | mark <mark> | 2010-10-12 01:15:17 +0000 |
commit | 29472410e3b882a6a6b74fe48d28db411fe8fcff (patch) | |
tree | 727d1670a720d424ec2b5c5e3480657c992bcb44 /httemplate | |
parent | fa5a1ac184e1fa9448453655b7e1f8e1297ef3b6 (diff) |
package contract end date field, RT#9918
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/REAL_cust_pkg.cgi | 6 | ||||
-rw-r--r-- | httemplate/edit/process/quick-cust_pkg.cgi | 4 | ||||
-rw-r--r-- | httemplate/elements/input-date-field.html | 6 | ||||
-rw-r--r-- | httemplate/misc/order_pkg.html | 39 | ||||
-rwxr-xr-x | httemplate/search/cust_pkg.cgi | 5 | ||||
-rwxr-xr-x | httemplate/search/report_cust_pkg.html | 3 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/status.html | 2 |
7 files changed, 37 insertions, 28 deletions
diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index 77e5da141..98a37bb94 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -55,12 +55,14 @@ <& .row_edit, cust_pkg=>$cust_pkg, column=>'setup', label=>'Setup' &> <& .row_edit, cust_pkg=>$cust_pkg, column=>'last_bill', label=>$last_bill_or_renewed &> <& .row_edit, cust_pkg=>$cust_pkg, column=>'bill', label=>$next_bill_or_prepaid_until &> - <& .row_display, cust_pkg=>$cust_pkg, column=>'adjourn', label=>'Adjournment', note=>'(will <b>suspend</b> this package when the date is reached)' &> - <& .row_display, cust_pkg=>$cust_pkg, column=>'susp', label=>'Suspension' &> + <& .row_display, cust_pkg=>$cust_pkg, column=>'contract_end',label=>'Contract end' &> + <& .row_display, cust_pkg=>$cust_pkg, column=>'adjourn', label=>'Adjournment', note=>'(will <b>suspend</b> this package when the date is reached)' &> + <& .row_display, cust_pkg=>$cust_pkg, column=>'susp', label=>'Suspension' &> <& .row_display, cust_pkg=>$cust_pkg, column=>'expire', label=>'Expiration', note=>'(will <b>cancel</b> this package when the date is reached)' &> <& .row_display, cust_pkg=>$cust_pkg, column=>'cancel', label=>'Cancellation' &> + <%def .row_edit> <%args> $cust_pkg diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 71f424ca3..599f7607c 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -66,6 +66,10 @@ my $cust_pkg = new FS::cust_pkg { 'discountnum_amount' => scalar($cgi->param('discountnum_amount')), 'discountnum_percent' => scalar($cgi->param('discountnum_percent')), 'discountnum_months' => scalar($cgi->param('discountnum_months')), + 'contract_end' => ( scalar($cgi->param('contract_end')) + ? parse_datetime($cgi->param('contract_end')) + : '' + ), #'discountnum_disabled' => scalar($cgi->param('discountnum_disabled')), }; diff --git a/httemplate/elements/input-date-field.html b/httemplate/elements/input-date-field.html index 0ea4be70a..2a9bc1d53 100644 --- a/httemplate/elements/input-date-field.html +++ b/httemplate/elements/input-date-field.html @@ -1,8 +1,9 @@ - +% if(!$noinit) { <LINK REL="stylesheet" TYPE="text/css" HREF="<%$fsurl%>elements/calendar-win2k-2.css" TITLE="win2k-2"> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar_stripped.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-en.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-setup.js"></SCRIPT> +% } <INPUT TYPE="text" NAME="<% $name %>" ID="<% $name %>_text" VALUE="<% $value %>"> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $name %>_button" STYLE="cursor: pointer" TITLE="Select date"> @@ -18,13 +19,14 @@ <%init> -my($name, $value, $format, $usedatetime); +my($name, $value, $format, $usedatetime, $noinit); if ( ref($_[0]) ) { my $opt = shift; $name = $opt->{'name'}; $value = $opt->{'value'}; $format = $opt->{'format'}; $usedatetime = $opt->{'usedatetime'}; + $noinit = $opt->{'noinit'}; } else { ($name, $value, $format, $usedatetime) = @_; } diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index e9a56b1a5..b232debd7 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -38,34 +38,19 @@ ) %> -%# false laziness w/edit/quick-charge.html <TR> <TH ALIGN="right">Start date </TD> <TD COLSPAN=6> - <INPUT TYPE = "text" - NAME = "start_date" - SIZE = 32 - ID = "start_date_text" - VALUE = "<% $start_date %>" - > - <IMG SRC = "../images/calendar.png" - ID = "start_date_button" - STYLE = "cursor: pointer" - TITLE = "Select date" - > + <% include('/elements/input-date-field.html',{ + 'name' => 'start_date', + 'format' => $date_format, + 'value' => $start_date, + 'noinit' => 1, + }) %> <FONT SIZE=-1>(leave blank to start immediately)</FONT> </TD> </TR> -<SCRIPT TYPE="text/javascript"> - Calendar.setup({ - inputField: "start_date_text", - ifFormat: "<% $date_format %>", - button: "start_date_button", - align: "BR" - }); -</SCRIPT> - % if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { % my $what = lc(FS::payby->shortname($cust_main->payby)); <TR> @@ -99,6 +84,18 @@ ) %> +<TR> + <TH ALIGN="right">Contract end date </TD> + <TD COLSPAN=6> + <% include('/elements/input-date-field.html',{ + 'name' => 'contract_end', + 'format' => $date_format, + 'value' => '', + 'noinit' => 1, + }) %> + </TD> +</TR> + </TABLE> <% include( '/elements/standardize_locations.html', diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index da4371f5e..207e4f611 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -19,6 +19,7 @@ 'Adjourn', 'Susp.', 'Expire', + 'Contract end', 'Cancel', 'Reason', FS::UI::Web::cust_header( @@ -59,7 +60,7 @@ #sub { time2str('%b %d %Y', shift->expire); }, #sub { time2str('%b %d %Y', shift->get('cancel')); }, ( map { time_or_blank($_) } - qw( setup last_bill bill adjourn susp expire cancel ) ), + qw( setup last_bill bill adjourn susp expire contract_end cancel ) ), sub { my $self = shift; my $return = ''; @@ -206,7 +207,7 @@ my %disable = ( '' => {}, ); -foreach my $field (qw( setup last_bill bill adjourn susp expire cancel active )) { +foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end 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 58fcf619e..289fec458 100755 --- a/httemplate/search/report_cust_pkg.html +++ b/httemplate/search/report_cust_pkg.html @@ -89,7 +89,7 @@ % } -% foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { +% foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end cancel )) { <TR> <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD> @@ -181,6 +181,7 @@ my %label = ( 'adjourn' => 'Adjourns', 'susp' => 'Suspended', 'expire' => 'Expires', + 'contract_end' => 'Contract ends', 'cancel' => 'Cancelled', ); diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index a6868434b..74e52efdd 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -56,6 +56,7 @@ <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %> % # pkg_status_row($cust_pkg, 'Next bill', 'bill', %opt) <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', %opt, curuser=>$curuser ) %> + <% pkg_status_row_if( $cust_pkg, 'Contract ends', 'contract_end', %opt ) %> <TR> <TD COLSPAN=<%$colspan%>> @@ -167,6 +168,7 @@ <% pkg_status_row_if($cust_pkg, 'Will automatically suspend by', 'autosuspend', %opt) %> <% pkg_status_row_if( $cust_pkg, 'Will suspend on', 'adjourn', %opt, curuser=>$curuser ) %> <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', %opt, curuser=>$curuser ) %> + <% pkg_status_row_if( $cust_pkg, 'Contract ends', 'contract_end', %opt ) %> % if ( $part_pkg->freq ) { |