diff options
author | ivan <ivan> | 2009-02-17 02:02:00 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-02-17 02:02:00 +0000 |
commit | 74190e6834c47c73b7f073fb1de444e572180333 (patch) | |
tree | 2fe33ac06aa8631de9cfa704bfbdd64de7108918 | |
parent | 7621140d9f8945c54523c05bcac8e79693a16a52 (diff) |
add tax-exempt checkbox to one-time charges, RT#4858
-rw-r--r-- | FS/FS/cust_main.pm | 8 | ||||
-rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 15 | ||||
-rw-r--r-- | httemplate/edit/quick-charge.html | 14 | ||||
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 1 |
4 files changed, 25 insertions, 13 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 7d68536a4..865632f6c 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -5164,14 +5164,16 @@ the error, otherwise returns false. sub charge { my $self = shift; - my ( $amount, $quantity, $pkg, $comment, $taxclass, $additional, $classnum ); - my ( $taxproduct, $override ); + my ( $amount, $quantity, $pkg, $comment, $classnum, $additional ); + my ( $setuptax, $taxclass ); #internal taxes + my ( $taxproduct, $override ); #vendor (CCH) taxes if ( ref( $_[0] ) ) { $amount = $_[0]->{amount}; $quantity = exists($_[0]->{quantity}) ? $_[0]->{quantity} : 1; $pkg = exists($_[0]->{pkg}) ? $_[0]->{pkg} : 'One-time charge'; $comment = exists($_[0]->{comment}) ? $_[0]->{comment} : '$'. sprintf("%.2f",$amount); + $setuptax = exists($_[0]->{setuptax}) ? $_[0]->{setuptax} : ''; $taxclass = exists($_[0]->{taxclass}) ? $_[0]->{taxclass} : ''; $classnum = exists($_[0]->{classnum}) ? $_[0]->{classnum} : ''; $additional = $_[0]->{additional}; @@ -5182,6 +5184,7 @@ sub charge { $quantity = 1; $pkg = @_ ? shift : 'One-time charge'; $comment = @_ ? shift : '$'. sprintf("%.2f",$amount); + $setuptax = ''; $taxclass = @_ ? shift : ''; $additional = []; } @@ -5204,6 +5207,7 @@ sub charge { 'freq' => 0, 'disabled' => 'Y', 'classnum' => $classnum ? $classnum : '', + 'setuptax' => $setuptax, 'taxclass' => $taxclass, 'taxproductnum' => $taxproduct, } ); diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 839a4e911..8fa57ddea 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -53,14 +53,15 @@ unless ( $error ) { or $error .= "Unknown customer number $custnum. "; $error ||= $cust_main->charge( { - 'amount' => $amount, - 'quantity' => $quantity, - 'pkg' => scalar($cgi->param('pkg')), - 'taxclass' => scalar($cgi->param('taxclass')), + 'amount' => $amount, + 'quantity' => $quantity, + 'pkg' => scalar($cgi->param('pkg')), + 'setuptax' => scalar($cgi->param('setuptax')), + 'taxclass' => scalar($cgi->param('taxclass')), 'taxproductnum' => scalar($cgi->param('taxproductnum')), - 'tax_override' => $override, - 'classnum' => scalar($cgi->param('classnum')), - 'additional' => \@description, + 'tax_override' => $override, + 'classnum' => scalar($cgi->param('classnum')), + 'additional' => \@description, } ); } diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 8f376a54d..c18b2bc64 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -1,4 +1,4 @@ -<% include("/elements/header-popup.html", 'One-time charge entry', '', +<% include("/elements/header-popup.html", 'One-time charge', '', ( $cgi->param('error') ? '' : 'onload="addRow()"' ), ) %> @@ -62,7 +62,7 @@ function validate_quick_charge () { <TABLE ID="QuickChargeTable" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 STYLE="background-color: #cccccc"> <TR> - <TD ALIGN="right">Amount: </TD> + <TD ALIGN="right">Amount </TD> <TD> $<INPUT TYPE="text" NAME="amount" SIZE=6 VALUE="<% $amount %>" onChange="enable_quick_charge()" onKeyPress="enable_quick_charge()"> </TD> @@ -70,7 +70,7 @@ function validate_quick_charge () { % if ( $conf->exists('invoice-unitprice') ) { <TR> - <TD ALIGN="right">Quantity: </TD> + <TD ALIGN="right">Quantity </TD> <TD> <INPUT TYPE="text" NAME="quantity" SIZE=4 VALUE="<% $quantity %>"> </TD> @@ -79,6 +79,12 @@ function validate_quick_charge () { <% include('/elements/tr-select-pkg_class.html', 'curr_value' => $cgi->param('classnum') ) %> + +<TR> + <TD ALIGN="right">Tax exempt </TD> + <TD><INPUT TYPE="checkbox" NAME="setuptax" VALUE="Y" <% $cgi->param('setuptax') ? 'CHECKED' : '' %>></TD> +</TR> + <% include('/elements/tr-select-taxclass.html', 'curr_value' => $cgi->param('taxclass') ) %> <% include('/elements/tr-select-taxproduct.html', 'label' => 'Tax product', 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') ) %> @@ -86,7 +92,7 @@ function validate_quick_charge () { <% include('/elements/tr-select-taxoverride.html', 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') ) %> <TR> - <TD>Description:</TD> + <TD ALIGN="right">Description </TD> <TD> <INPUT TYPE="text" NAME="pkg" SIZE="50" MAXLENGTH="50" VALUE="<% $pkg %>" onChange="enable_quick_charge()" onKeyPress="enable_quick_charge()"> </TD> diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 5c0ee48af..2c258881a 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -86,6 +86,7 @@ function taxoverridequickchargemagic() { 'actionlabel' => 'One-time charge', 'color' => '#333399', 'width' => 763, + 'height' => 408, }) %> % } |