X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fquotation_pkg.pm;h=cc45a85e9ebf9c9ef5c879b9dde8004b4f3567a1;hb=abc56e03d9cff03757f9a2f8a3d8f35e97cbb7c5;hp=efff9683fe63885ac4790cbc018d789b87b852e4;hpb=821f900c5a594cdf3cff082e5d527eade23f2e18;p=freeside.git diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm index efff9683f..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 @@ -201,6 +221,18 @@ sub cust_bill_pkg_display { } +=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