X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fquotation.pm;h=cf6652f9517eb534230ade5357bb00d9e153bad8;hb=881215feafc01aeee19864c39f0d98d3d6909e65;hp=bf2711b0af02dff189b42381378853242135311e;hpb=0af38652da3b3be7da2d35b048285ef6f2194e1a;p=freeside.git diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm index bf2711b0a..cf6652f95 100644 --- a/FS/FS/quotation.pm +++ b/FS/FS/quotation.pm @@ -1,12 +1,9 @@ package FS::quotation; -use base qw( FS::Template_Mixin FS::cust_main_Mixin FS::otaker_Mixin FS::Record ); +use base qw( FS::Template_Mixin FS::cust_main_Mixin FS::otaker_Mixin FS::Record + ); use strict; -use FS::Record qw( qsearch qsearchs ); use FS::CurrentUser; -use FS::cust_main; -use FS::prospect_main; -use FS::quotation_pkg; =head1 NAME @@ -122,29 +119,14 @@ sub check { =item prospect_main -=cut - -sub prospect_main { - my $self = shift; - qsearchs('prospect_main', { 'prospectnum' => $self->prospectnum } ); -} - =item cust_main -=cut - -sub cust_main { - my $self = shift; - qsearchs('cust_main', { 'custnum' => $self->custnum } ); -} - =item cust_bill_pkg =cut sub cust_bill_pkg { #actually quotation_pkg objects - my $self = shift; - qsearch('quotation_pkg', { quotationnum=>$self->quotationnum }); + shift->quotation_pkg(@_); } =item total_setup @@ -176,6 +158,36 @@ sub _total { } +#prevent things from falsely showing up as taxes, at least until we support +# quoting tax amounts.. +sub _items_tax { + return (); +} +sub _items_nontax { + shift->cust_bill_pkg; +} + +sub _items_total { + my( $self, $total_items ) = @_; + + if ( $self->total_setup > 0 ) { + push @$total_items, { + 'total_item' => $self->mt( $self->total_recur > 0 ? 'Total Setup' : 'Total' ), + 'total_amount' => $self->total_setup, + }; + } + + #could/should add up the different recurring frequencies on lines of their own + # but this will cover the 95% cases for now + if ( $self->total_recur > 0 ) { + push @$total_items, { + 'total_item' => $self->mt('Total Recurring'), + 'total_amount' => $self->total_recur, + }; + } + +} + =item enable_previous =cut