X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fquotation.pm;h=669a254172c77882f3bf021f5efac5c5c7db32a6;hb=c463320a7aa49cf01cd1d66b48739d4e9998dad6;hp=cf75267a1097691e45e4d4cd07c8417ebb2072c9;hpb=e19085190e34fce90b15bd9ec0c8d98b4fc8cd9a;p=freeside.git diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm index cf75267a1..669a25417 100644 --- a/FS/FS/quotation.pm +++ b/FS/FS/quotation.pm @@ -342,6 +342,29 @@ 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|torrus|agent$)/ + || $part_pkg->option('recur_method') eq 'prorate' + || ( $part_pkg->option('sync_bill_date') + && $self->custnum + && $self->cust_main->billing_pkgs #num_billing_pkgs when we have it + ) + ) { + $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; @@ -698,7 +721,7 @@ sub estimate { my $quotation_pkg_tax = FS::quotation_pkg_tax->new({ quotationpkgnum => $pkg->quotationpkgnum, - itemdesc => $tax_def->taxname, + itemdesc => ($tax_def->taxname || 'Tax'), taxnum => $taxnum, taxtype => ref($tax_def), });