add tax-exempt checkbox to one-time charges, RT#4858
authorivan <ivan>
Tue, 17 Feb 2009 02:02:00 +0000 (02:02 +0000)
committerivan <ivan>
Tue, 17 Feb 2009 02:02:00 +0000 (02:02 +0000)
FS/FS/cust_main.pm
httemplate/edit/process/quick-charge.cgi
httemplate/edit/quick-charge.html
httemplate/view/cust_main/packages.html

index 7d68536..865632f 100644 (file)
@@ -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,
   } );
index 839a4e9..8fa57dd 100644 (file)
@@ -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,
   } );
 }
 
index 8f376a5..c18b2bc 100644 (file)
@@ -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>
index 5c0ee48..2c25888 100755 (executable)
@@ -86,6 +86,7 @@ function taxoverridequickchargemagic() {
        'actionlabel' => 'One-time charge',
        'color'       => '#333399',
        'width'       => 763,
+       'height'      => 408,
      })
   %>
 % }