From: ivan Date: Tue, 17 Feb 2009 02:02:00 +0000 (+0000) Subject: add tax-exempt checkbox to one-time charges, RT#4858 X-Git-Tag: root_of_webpay_support~51 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=74190e6834c47c73b7f073fb1de444e572180333 add tax-exempt checkbox to one-time charges, RT#4858 --- 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 () { - + @@ -70,7 +70,7 @@ function validate_quick_charge () { % if ( $conf->exists('invoice-unitprice') ) { - + @@ -79,6 +79,12 @@ function validate_quick_charge () { <% include('/elements/tr-select-pkg_class.html', 'curr_value' => $cgi->param('classnum') ) %> + + + + + + <% 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') ) %> - + 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, }) %> % }
Amount: Amount $
Quantity: Quantity
Tax exempt param('setuptax') ? 'CHECKED' : '' %>>
Description:Description