summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-06-30 19:48:58 -0400
committerMark Wells <mark@freeside.biz>2015-06-30 19:48:58 -0400
commit02b3110eb22945351c1b840a6686b9ad6541be0b (patch)
tree9996691f3d76aea5e6b7a8233875353e8957ddf7
parentf4a1726c30243e7945f6720398423bedc7ecf59b (diff)
show first payment amount on quotations, #36997
-rw-r--r--FS/FS/quotation.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm
index fef69ed63..0e6b4e7d0 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;