diff options
author | ivan <ivan> | 2010-03-18 07:59:52 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-03-18 07:59:52 +0000 |
commit | e078ca418dcf3c7b92efcd371ce761df3314c369 (patch) | |
tree | a296537d522a47cf083db299fa016c818881a4db /httemplate | |
parent | ca68d3b10051450d8523f54cc4e579bb0d8a6cc2 (diff) |
disable auto-billing of specific customer packages, RT#6378
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 1 | ||||
-rw-r--r-- | httemplate/edit/process/quick-cust_pkg.cgi | 1 | ||||
-rw-r--r-- | httemplate/edit/quick-charge.html | 7 | ||||
-rw-r--r-- | httemplate/misc/order_pkg.html | 10 | ||||
-rw-r--r-- | httemplate/view/cust_main/one_time_charge_link.html | 2 | ||||
-rw-r--r-- | httemplate/view/cust_main/order_pkg_link.html | 2 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/status.html | 29 |
7 files changed, 48 insertions, 4 deletions
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 827530e50..27921b8c3 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -61,6 +61,7 @@ unless ( $error ) { ? str2time($cgi->param('start_date')) : '' ), + 'no_auto' => scalar($cgi->param('no_auto')), 'pkg' => scalar($cgi->param('pkg')), 'setuptax' => scalar($cgi->param('setuptax')), 'taxclass' => scalar($cgi->param('taxclass')), diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index a0958922e..202d0a3cf 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -57,6 +57,7 @@ my $cust_pkg = new FS::cust_pkg { ? str2time($cgi->param('start_date')) : '' ), + 'no_auto' => scalar($cgi->param('no_auto')), 'refnum' => $refnum, 'locationnum' => $locationnum, 'discountnum' => $discountnum, diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 64ad3a289..a472915a1 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -153,6 +153,13 @@ function bill_now_changed (what) { }); </SCRIPT> +% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { +% my $what = lc(FS::payby->shortname($cust_main->payby)); + <TR> + <TD ALIGN="right">Disable automatic <% $what %> charge </TD> + <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="no_auto" VALUE="Y"></TD> + </TR> +% } <TR> <TD ALIGN="right">Tax exempt </TD> diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index 666099a02..33b2bb390 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -66,6 +66,14 @@ }); </SCRIPT> +% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { +% my $what = lc(FS::payby->shortname($cust_main->payby)); + <TR> + <TH ALIGN="right">Disable automatic <% $what %> charge </TH> + <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="no_auto" VALUE="Y"></TD> + </TR> +% } + % if ( $curuser->access_right('Discount customer package') ) { <% include('/elements/tr-select-discount.html', 'element_etc' => 'DISABLED', @@ -119,7 +127,7 @@ my $cust_main = qsearchs({ my $pkgpart = scalar($cgi->param('pkgpart')); -my $format = "%m/%d/%Y %T %z (%Z)"; #false laziness w/REAL_cust_pkg.cgi? +my $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi? my $start_date = $cust_main->next_bill_date; $start_date = $start_date ? time2str($format, $start_date) : ''; diff --git a/httemplate/view/cust_main/one_time_charge_link.html b/httemplate/view/cust_main/one_time_charge_link.html index 4ce8a28a3..b3defa294 100644 --- a/httemplate/view/cust_main/one_time_charge_link.html +++ b/httemplate/view/cust_main/one_time_charge_link.html @@ -80,7 +80,7 @@ function taxoverridequickchargemagic() { 'actionlabel' => 'One-time charge', 'color' => '#333399', 'width' => 763, - 'height' => 408, + 'height' => 460, #more for more room for lines of add'l description? }) %> diff --git a/httemplate/view/cust_main/order_pkg_link.html b/httemplate/view/cust_main/order_pkg_link.html index 0c53f2a59..30c86a757 100644 --- a/httemplate/view/cust_main/order_pkg_link.html +++ b/httemplate/view/cust_main/order_pkg_link.html @@ -6,7 +6,7 @@ 'cust_main' => $cust_main, 'closetext' => 'Close', 'width' => 763, - 'height' => 476, + 'height' => 538, ) %> <%init> diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 7b1b53add..a6868434b 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -42,6 +42,8 @@ ) %> + <% pkg_status_row_noauto( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> % unless ( $cust_pkg->get('setup') ) { @@ -76,7 +78,9 @@ <% pkg_status_row_colspan( $cust_pkg, 'Not yet billed (one-time charge)', '', 'colspan'=>$colspan, %opt ) %> - <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + <% pkg_status_row_noauto( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + + <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> <% pkg_status_row_if( $cust_pkg, @@ -100,6 +104,8 @@ <% pkg_status_row_colspan($cust_pkg, "Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')', '', 'colspan'=>$colspan, %opt ) %> + <% pkg_status_row_noauto( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> <% pkg_status_row_if($cust_pkg, 'Start billing', 'start_date', %opt) %> @@ -114,6 +120,8 @@ <% pkg_status_row($cust_pkg, 'Billed', 'setup', %opt) %> + <% pkg_status_row_noauto( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> % } else { @@ -138,6 +146,8 @@ %> % } + <% pkg_status_row_noauto( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> <% pkg_status_row($cust_pkg, 'Setup', 'setup', %opt) %> @@ -290,6 +300,23 @@ sub pkg_status_row_changed { $html; } +sub pkg_status_row_noauto { + my( $cust_pkg, %opt ) = @_; + my $part_pkg = $opt{'part_pkg'}; + return '' unless $cust_pkg->no_auto || $part_pkg->no_auto; + + #inefficient, should be passed in + my $cust_main = $cust_pkg->cust_main; + + return '' unless $cust_main->payby =~ /^(CARD|CHEK)$/; + my $what = lc(FS::payby->shortname($cust_main->payby)); + + pkg_status_row_colspan( $cust_pkg, "No automatic $what charge", '', + 'colspan' => $opt{'colspan'}, + #%opt, + ); +} + sub pkg_status_row_discount { my( $cust_pkg, %opt ) = @_; |