[freeside-commits] branch master updated. 9fe9b2f47608e1ea7387539a77a95023f9872bdf

Jonathan Prykop jonathan at 420.am
Mon Apr 25 17:45:51 PDT 2016


The branch, master has been updated
       via  9fe9b2f47608e1ea7387539a77a95023f9872bdf (commit)
      from  940da07a1b4a80bab5b2b9c9b893bfaa350bc32d (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 9fe9b2f47608e1ea7387539a77a95023f9872bdf
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Mon Apr 25 19:45:29 2016 -0500

    RT#39819: Packages with Show zero setup/recurring do not print on quotations

diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm
index 8e32eff..f3bfc27 100644
--- a/FS/FS/quotation.pm
+++ b/FS/FS/quotation.pm
@@ -280,8 +280,8 @@ sub _items_sections {
     my $part_pkg = $pkg->part_pkg;
 
     my $recur_freq = $part_pkg->freq;
-    $show{$recur_freq} = 1 if $pkg->unitrecur > 0;
-    $show{0} = 1 if $pkg->unitsetup > 0;
+    $show{$recur_freq} = 1 if $pkg->unitrecur > 0 or $part_pkg->recur_show_zero;
+    $show{0} = 1 if $pkg->unitsetup > 0 or $part_pkg->setup_show_zero;
     ($subtotals{0} ||= 0) += $pkg->setup + $pkg->setup_tax;
     ($subtotals{$recur_freq} ||= 0) += $pkg->recur + $pkg->recur_tax;
 
@@ -1053,7 +1053,11 @@ sub _items_pkg {
       $quotation_pkg->get('unit'.$setuprecur));
     $this_item->{'amount'} = sprintf('%.2f', $this_item->{'unit_amount'}
                                              * $quotation_pkg->quantity);
-    next if $this_item->{'amount'} == 0;
+    next if $this_item->{'amount'} == 0 and !(
+      $setuprecur eq 'setup'
+      ? $part_pkg->setup_show_zero
+      : $part_pkg->recur_show_zero
+    );
 
     if ( $preref ) {
       $this_item->{'preref_html'} = &$preref($quotation_pkg);

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

Summary of changes:
 FS/FS/quotation.pm |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list