X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fquotation_pkg.pm;h=cc45a85e9ebf9c9ef5c879b9dde8004b4f3567a1;hb=abc56e03d9cff03757f9a2f8a3d8f35e97cbb7c5;hp=b5823f450e8125aea7c164275bf455608bd48ec0;hpb=53a1130923c4905b267239c369949aadde657c7c;p=freeside.git diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm index b5823f450..cc45a85e9 100644 --- a/FS/FS/quotation_pkg.pm +++ b/FS/FS/quotation_pkg.pm @@ -164,6 +164,26 @@ sub recur { sprintf('%.2f', $recur); } +sub unitsetup { + my $self = shift; + return '0.00' if $self->waive_setup eq 'Y' || $self->{'_NO_SETUP_KLUDGE'}; + my $part_pkg = $self->part_pkg; + my $setup = $part_pkg->option('setup_fee'); + + #XXX discounts + sprintf('%.2f', $setup); +} + +sub unitrecur { + my $self = shift; + return '0.00' if $self->{'_NO_RECUR_KLUDGE'}; + my $part_pkg = $self->part_pkg; + my $recur = $part_pkg->can('base_recur') ? $part_pkg->base_recur + : $part_pkg->option('recur_fee'); + #XXX discounts + sprintf('%.2f', $recur); +} + =item cust_bill_pkg_display [ type => TYPE ] =cut @@ -193,13 +213,26 @@ sub cust_bill_pkg_display { } elsif ( $type eq 'R' ) { return ($recur); } else { - return ($setup, $recur); + #return ($setup, $recur); + return ($self); } } } +=item cust_main + +Returns the customer (L object). + +=cut + +sub cust_main { + my $self = shift; + my $quotation = FS::quotation->by_key($self->quotationnum) or return ''; + $quotation->cust_main; +} + =back =head1 BUGS