diff options
author | Mark Wells <mark@freeside.biz> | 2015-03-06 14:20:22 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-03-06 14:20:22 -0800 |
commit | 35c18f29bc29dedfe2fa4ef037390d90b17f87ba (patch) | |
tree | 8fdf10f87443bae43d46a25f1fe983e087c3a9bd /FS/FS/quotation_pkg.pm | |
parent | 92acdafd28e41e0e333d2e9df59af657f1f1242c (diff) |
estimate tax on quotations, #32489
Diffstat (limited to 'FS/FS/quotation_pkg.pm')
-rw-r--r-- | FS/FS/quotation_pkg.pm | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm index 25edc94..c579e35 100644 --- a/FS/FS/quotation_pkg.pm +++ b/FS/FS/quotation_pkg.pm @@ -145,7 +145,7 @@ sub delete { my $oldAutoCommit = $FS::UID::AutoCommit; local $FS::UID::AutoCommit = 0; - foreach ($self->quotation_pkg_discount) { + foreach ($self->quotation_pkg_discount, $self->quotation_pkg_tax) { my $error = $_->delete; if ( $error ) { $dbh->rollback if $oldAutoCommit; @@ -358,13 +358,13 @@ sub _item_discount { sub setup { my $self = shift; - ($self->unitsetup - sum(map { $_->setup_amount } $self->pkg_discount)) + ($self->unitsetup - sum(0, map { $_->setup_amount } $self->pkg_discount)) * ($self->quantity || 1); } sub recur { my $self = shift; - ($self->unitrecur - sum(map { $_->recur_amount } $self->pkg_discount)) + ($self->unitrecur - sum(0, map { $_->recur_amount } $self->pkg_discount)) * ($self->quantity || 1); } @@ -417,6 +417,11 @@ sub cust_bill_pkg_display { $recur->{'type'} = 'R'; if ( $type eq 'S' ) { +sub tax_locationnum { + my $self = shift; + $self->locationnum; +} + return ($setup); } elsif ( $type eq 'R' ) { return ($recur); @@ -453,11 +458,21 @@ sub prospect_main { $quotation->prospect_main; } +sub quotation_pkg_tax { + my $self = shift; + qsearch('quotation_pkg_tax', { quotationpkgnum => $self->quotationpkgnum }); +} + +sub cust_location { + my $self = shift; + $self->locationnum ? qsearchs('cust_location', { locationnum => $self->locationnum }) : ''; +} + =back =head1 BUGS -Doesn't support taxes, fees, or add-on packages. +Doesn't support fees, or add-on packages. =head1 SEE ALSO |