[freeside-commits] branch master updated. 5b193ee2c5fae0743699adb1a28591f2a1735eb7

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


The branch, master has been updated
       via  5b193ee2c5fae0743699adb1a28591f2a1735eb7 (commit)
       via  0ed195595b5c7ea404c8848d9d1881ada4214489 (commit)
       via  af05c3dda381122e0a45f72dbc0b4e9492f13fe7 (commit)
       via  32eacfe9022ab9edb6fd986618ac2d3949fc7dcd (commit)
       via  45121e05ad3e284386826ae53d41845bfa8eb0f1 (commit)
       via  4b1eb1861b9dce418af41b88e9b5d58342d4a3d6 (commit)
      from  df4a68099abfa067014f36f92874fccefdea662e (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 5b193ee2c5fae0743699adb1a28591f2a1735eb7
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 0ed195595b5c7ea404c8848d9d1881ada4214489
Merge: af05c3d df4a680
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 10 16:38:28 2015 -0700

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


commit af05c3dda381122e0a45f72dbc0b4e9492f13fe7
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 9486c24..279373d 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 32eacfe9022ab9edb6fd986618ac2d3949fc7dcd
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 45121e05ad3e284386826ae53d41845bfa8eb0f1
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 4b1eb1861b9dce418af41b88e9b5d58342d4a3d6
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