[freeside-commits] branch master updated. 64514e0541c94b23a096acb265cb47e9ca6e6f85

Alex Brelsfoard alex at 420.am
Sat Jan 31 20:22:26 PST 2015


The branch, master has been updated
       via  64514e0541c94b23a096acb265cb47e9ca6e6f85 (commit)
       via  1ed6875a411a829607836f514b9aa0bb96620181 (commit)
      from  4770b1f7e1abf6ddc8d5b8093fe4d2c48345b386 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 64514e0541c94b23a096acb265cb47e9ca6e6f85
Merge: 1ed6875 4770b1f
Author: Alex Brelsfoard <alex at freeside.biz>
Date:   Sat Jan 31 23:22:08 2015 -0500

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


4770b1f7e1abf6ddc8d5b8093fe4d2c48345b386
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index d2a6ded..888e88b 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1902,13 +1902,18 @@ sub print_csv {
     my $lineseq = 0;
     foreach my $item ( $self->_items_pkg ) {
 
+      my $description = $item->{'description'};
+      if ( $item->{'_is_discount'} and exists($item->{ext_description}[0]) ) {
+        $description .= ': ' . $item->{ext_description}[0];
+      }
+
       $csv->combine(
         '',                     #  1 | N/A-Leave Empty            CHAR   2
         '',                     #  2 | N/A-Leave Empty            CHAR  15
         $tracctnum,             #  3 | Account Number             CHAR  15
         $self->invnum,          #  4 | Invoice Number             CHAR  15
         $lineseq++,             #  5 | Line Sequence (sort order) NUM    6
-        $item->{'description'}, #  6 | Transaction Detail         CHAR 100
+        $description,           #  6 | Transaction Detail         CHAR 100
         $item->{'amount'},      #  7 | Amount                     NUM*   9
         '',                     #  8 | Line Format Control**      CHAR   2
         '',                     #  9 | Grouping Code              CHAR   2

commit 1ed6875a411a829607836f514b9aa0bb96620181
Author: Alex Brelsfoard <alex at freeside.biz>
Date:   Sat Jan 31 23:20:19 2015 -0500

    RT #31482 you can now change the tax class when modifying a one-time charge.

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 0f0983b..3bd2107 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2456,6 +2456,13 @@ sub modify_charge {
 
   } # else simply ignore them; the UI shouldn't allow editing the fields
 
+  
+  if ( exists($opt{'taxclass'}) 
+          and $part_pkg->taxclass ne $opt{'taxclass'}) {
+    
+      $part_pkg->set('taxclass', $opt{'taxclass'});
+  }
+
   my $error;
   if ( $part_pkg->modified or $pkg_opt_modified ) {
     # can we safely modify the package def?
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi
index c130a55..aa6010e 100644
--- a/httemplate/edit/process/quick-charge.cgi
+++ b/httemplate/edit/process/quick-charge.cgi
@@ -67,6 +67,18 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge
   my $start_date = $cgi->param('start_date')
                      ? parse_datetime($cgi->param('start_date'))
                      : time;
+   
+  $param->{'tax_override'} =~ /^\s*([,\d]*)\s*$/
+    or $error .= "Illegal tax override " . $param->{"tax_override"} . "  ";
+  my $override = $1;
+ 
+  if ( $param->{'taxclass'} eq '(select)' ) {
+    $error .= "Must select a tax class.  "
+      unless ($conf->exists('enable_taxproducts') &&
+               ( $override || $param->{taxproductnum} )
+             );
+    $cgi->param('taxclass', '');
+  }
 
   $error = $cust_pkg->modify_charge(
       'pkg'               => scalar($cgi->param('pkg')),
@@ -75,6 +87,10 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge
       'adjust_commission' => ($cgi->param('adjust_commission') ? 1 : 0),
       'amount'            => $amount,
       'setup_cost'        => $setup_cost,
+      'setuptax'          => scalar($cgi->param('setuptax')),
+      'taxclass'          => scalar($cgi->param('taxclass')),
+      'taxproductnum'     => scalar($cgi->param('taxproductnum')),
+      'tax_override'      => $override,
       'quantity'          => $quantity,
       'start_date'        => $start_date,
   );
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index dfaf404..20a9ec7 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -171,6 +171,15 @@ function bill_now_changed (what) {
       &>
 %   }
 
+<TR>
+  <TD ALIGN="right"><% mt('Tax exempt') |h %> </TD>
+  <TD><INPUT TYPE="checkbox" NAME="setuptax" VALUE="Y" <% $cgi->param('setuptax') ? 'CHECKED' : '' %>></TD>
+</TR>
+
+<& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass')  &>
+
+<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $part_pkg->get('taxproductnum')  &>
+
 % } else { # new one-time charge
 
     <TR>

4770b1f7e1abf6ddc8d5b8093fe4d2c48345b386
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index d2a6ded..888e88b 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1902,13 +1902,18 @@ sub print_csv {
     my $lineseq = 0;
     foreach my $item ( $self->_items_pkg ) {
 
+      my $description = $item->{'description'};
+      if ( $item->{'_is_discount'} and exists($item->{ext_description}[0]) ) {
+        $description .= ': ' . $item->{ext_description}[0];
+      }
+
       $csv->combine(
         '',                     #  1 | N/A-Leave Empty            CHAR   2
         '',                     #  2 | N/A-Leave Empty            CHAR  15
         $tracctnum,             #  3 | Account Number             CHAR  15
         $self->invnum,          #  4 | Invoice Number             CHAR  15
         $lineseq++,             #  5 | Line Sequence (sort order) NUM    6
-        $item->{'description'}, #  6 | Transaction Detail         CHAR 100
+        $description,           #  6 | Transaction Detail         CHAR 100
         $item->{'amount'},      #  7 | Amount                     NUM*   9
         '',                     #  8 | Line Format Control**      CHAR   2
         '',                     #  9 | Grouping Code              CHAR   2

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_pkg.pm                        |    7 +++++++
 httemplate/edit/process/quick-charge.cgi |   16 ++++++++++++++++
 httemplate/edit/quick-charge.html        |    9 +++++++++
 3 files changed, 32 insertions(+)




More information about the freeside-commits mailing list