[freeside-commits] branch FREESIDE_3_BRANCH updated. 02b3110eb22945351c1b840a6686b9ad6541be0b

Mark Wells mark at 420.am
Tue Jun 30 16:52:42 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  02b3110eb22945351c1b840a6686b9ad6541be0b (commit)
      from  f4a1726c30243e7945f6720398423bedc7ecf59b (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 02b3110eb22945351c1b840a6686b9ad6541be0b
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jun 30 19:48:58 2015 -0400

    show first payment amount on quotations, #36997

diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm
index fef69ed..0e6b4e7 100644
--- a/FS/FS/quotation.pm
+++ b/FS/FS/quotation.pm
@@ -342,6 +342,27 @@ sub _items_total {
       'total_amount' => sprintf('%.2f',$total_recur),
       'break_after'  => 1,
     };
+    # show 'first payment' line (setup + recur) if there are no prorated 
+    # packages included
+    my $disable_total = 0;
+    foreach my $quotation_pkg ($self->quotation_pkg) {
+      my $part_pkg = $quotation_pkg->part_pkg;
+      if (   $part_pkg->plan =~ /^prorate/
+          or $part_pkg->plan eq 'agent'
+          or $part_pkg->plan =~ /^torrus/
+          or $part_pkg->option('sync_bill_date')
+          or $part_pkg->option('recur_method') eq 'prorate' ) {
+        $disable_total = 1;
+        last;
+      }
+    }
+    if (!$disable_total) {
+      push @items, {
+        'total_item'   => $self->mt('First payment'),
+        'total_amount' => sprintf('%.2f', $total_setup + $total_recur),
+        'break_after'  => 1,
+      };
+    }
   }
 
   return @items;

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

Summary of changes:
 FS/FS/quotation.pm |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)




More information about the freeside-commits mailing list