[freeside-commits] branch FREESIDE_4_BRANCH updated. 1db55f45e7fa604d152a4d5168885a1e6d88c5ce

Mark Wells mark at 420.am
Fri Jul 10 18:18:06 PDT 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  1db55f45e7fa604d152a4d5168885a1e6d88c5ce (commit)
       via  15c6641b273064dd4c23e0a47cb4a0701d0c6bca (commit)
       via  5f18e4b6de3cd9c8b0282f003655c46c4c6628c4 (commit)
       via  ac3329e210b11172d56fd987624a1a85c3bcfeb9 (commit)
       via  88bf5db0cca989c51237c661a13078eef08b3674 (commit)
       via  9c15ffe3a5ee987e30e10c6a0ad1b5bf0b2a12e3 (commit)
      from  e7eb845db1afab1cbdbc34ff9c387c5ac554659e (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 1db55f45e7fa604d152a4d5168885a1e6d88c5ce
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 10 11:56:45 2015 -0700

    mark tax status as mandatory when using a tax vendor

diff --git a/httemplate/elements/tr-select-tax_status.html b/httemplate/elements/tr-select-tax_status.html
index 1e0ea8a..387e49e 100644
--- a/httemplate/elements/tr-select-tax_status.html
+++ b/httemplate/elements/tr-select-tax_status.html
@@ -10,6 +10,7 @@
     name_col  => 'description',
     hashref   => { data_vendor => $vendor },
     order_by  => 'order by taxstatus',
+    required  => 1,
     %opt
   &>
 

commit 15c6641b273064dd4c23e0a47cb4a0701d0c6bca
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 10 15:16:08 2015 -0700

    UI nit: self_url ends up pointing to Change History

diff --git a/httemplate/view/cust_main/menu.html b/httemplate/view/cust_main/menu.html
index ab56bcf..ff001bb 100644
--- a/httemplate/view/cust_main/menu.html
+++ b/httemplate/view/cust_main/menu.html
@@ -557,6 +557,7 @@ foreach my $submenu (@menu) {
       }
       $a .= qq[>$label</A> ];
 
+      $cgi->param('show', $opt{show});
 
     } elsif ( $entry->{popup} ) {
 

commit 5f18e4b6de3cd9c8b0282f003655c46c4c6628c4
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 10 14:29:33 2015 -0700

    avoid sending SureTax requests when no items are taxable

diff --git a/FS/FS/TaxEngine/suretax.pm b/FS/FS/TaxEngine/suretax.pm
index 8139b1d..4e7edd5 100644
--- a/FS/FS/TaxEngine/suretax.pm
+++ b/FS/FS/TaxEngine/suretax.pm
@@ -85,6 +85,8 @@ sub build_request {
   my @lines = map { $self->build_item($_) }
               $cust_bill->cust_bill_pkg;
 
+  return if !@lines;
+
   my $ClientNumber = $conf->config('suretax-client_number')
     or die "suretax-client_number config required.\n";
   my $ValidationKey = $conf->config('suretax-validation_key')
@@ -306,6 +308,10 @@ sub make_taxlines {
 
   # assemble the request hash
   my $request = $self->build_request;
+  if (!$request) {
+    warn "no taxable items in invoice; skipping SureTax request\n" if $DEBUG;
+    return;
+  }
 
   warn "sending SureTax request\n" if $DEBUG;
   my $request_json = $json->encode($request);

commit ac3329e210b11172d56fd987624a1a85c3bcfeb9
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 10 18:14:40 2015 -0700

    avoid generating spurious zero-amount bills on cancellation, #37229, from #16066

diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index f4c8045..87be4e6 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -1107,6 +1107,14 @@ sub _make_lines {
     return "$@ running $method for $cust_pkg\n"
       if ( $@ );
 
+    if ($recur eq 'NOTHING') {
+      # then calc_cancel (or calc_recur but that's not used) has declined to
+      # generate a recurring lineitem at all. treat this as zero, but also 
+      # try not to generate a lineitem.
+      $recur = 0;
+      $lineitems--;
+    }
+
     #base_cancel???
     $unitrecur = $cust_pkg->base_recur( \$sdate ) || $recur; #XXX uuh, better
 
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 930966a..eb70253 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -220,13 +220,13 @@ sub calc_cancel {
        and $self->option('bill_recur_on_cancel', 1) ) {
     # run another recurring cycle
     return $self->calc_recur(@_);
-  }
-  elsif ( $conf->exists('bill_usage_on_cancel') # should be a package option?
+  } elsif ( $conf->exists('bill_usage_on_cancel') # should be a package option?
           and $self->can('calc_usage') ) {
     # bill for outstanding usage
     return $self->calc_usage(@_);
+  } else {
+    return 'NOTHING'; # numerically zero, but has special meaning
   }
-  0;
 }
 
 sub calc_remain {

commit 88bf5db0cca989c51237c661a13078eef08b3674
Merge: 9c15ffe e7eb845
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 10 18:15:08 2015 -0700

    Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x


commit 9c15ffe3a5ee987e30e10c6a0ad1b5bf0b2a12e3
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Jul 8 14:40:59 2015 -0700

    fix package def creation under SureTax

diff --git a/httemplate/elements/tr-part_pkg-taxproducts.html b/httemplate/elements/tr-part_pkg-taxproducts.html
index 274dc3b..ad464ca 100644
--- a/httemplate/elements/tr-part_pkg-taxproducts.html
+++ b/httemplate/elements/tr-part_pkg-taxproducts.html
@@ -21,9 +21,12 @@
 my %opt = @_;
 my $field = delete($opt{field}) || 'taxproductnum';
 my $pkgpart = delete($opt{pkgpart});
-my $part_pkg = FS::part_pkg->by_key($pkgpart);
-my %pkg_options = $part_pkg->options;
-$pkg_options{'usage_taxproductnum_'} = $part_pkg->taxproductnum;
+my %pkg_options;
+if ($pkgpart) {
+  my $part_pkg = FS::part_pkg->by_key($pkgpart);
+  my %pkg_options = $part_pkg->options;
+  $pkg_options{'usage_taxproductnum_'} = $part_pkg->taxproductnum;
+}
 
 my @classes = qsearch('usage_class', { 'disabled' => '' });
 unshift @classes,

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

Summary of changes:
 FS/FS/TaxEngine/suretax.pm                       |    6 ++++++
 FS/FS/cust_main/Billing.pm                       |    8 ++++++++
 FS/FS/part_pkg/flat.pm                           |    6 +++---
 httemplate/elements/tr-part_pkg-taxproducts.html |    9 ++++++---
 httemplate/elements/tr-select-tax_status.html    |    1 +
 httemplate/view/cust_main/menu.html              |    1 +
 6 files changed, 25 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list