diff options
author | jeff <jeff> | 2010-09-22 19:16:20 +0000 |
---|---|---|
committer | jeff <jeff> | 2010-09-22 19:16:20 +0000 |
commit | 5250c44bd7f282c7d782bf0e8349af12376929df (patch) | |
tree | b2afcd8e47270c6f5b78cff378849168d17ed765 /FS/FS/cust_credit_bill_pkg.pm | |
parent | 60ee9af0e885def0dd61f4a5506ac0e55d779e89 (diff) |
prepayment discounts rt#5318
Diffstat (limited to 'FS/FS/cust_credit_bill_pkg.pm')
-rw-r--r-- | FS/FS/cust_credit_bill_pkg.pm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/FS/FS/cust_credit_bill_pkg.pm b/FS/FS/cust_credit_bill_pkg.pm index 019a1a8..64f1f29 100644 --- a/FS/FS/cust_credit_bill_pkg.pm +++ b/FS/FS/cust_credit_bill_pkg.pm @@ -106,7 +106,10 @@ sub insert { my $payable = $self->cust_bill_pkg->payable($self->setuprecur); my $taxable = $self->_is_taxable ? $payable : 0; my $part_pkg = $self->cust_bill_pkg->part_pkg; - my $freq = $part_pkg ? $part_pkg->freq || 1 : 1;# assume unchanged + my $freq = $self->cust_bill_pkg->freq; + unless ($freq) { + $freq = $part_pkg ? ($part_pkg->freq || 1) : 1;#fallback.. assumes unchanged + } my $taxable_per_month = sprintf("%.2f", $taxable / $freq ); my $credit_per_month = sprintf("%.2f", $self->amount / $freq ); #pennies? @@ -334,13 +337,13 @@ sub cust_bill_pkg_tax_Xlocation { B<setuprecur> field is a kludge to compensate for cust_bill_pkg having separate setup and recur fields. It should be removed once that's fixed. -B<insert> method assumes that the frequency of the package associated with the -associated line item remains unchanged during the lifetime of the system. -It may get the tax exemption adjustments wrong if package definitions change -frequency. The presense of delete methods in FS::cust_main_county and -FS::tax_rate makes crediting of old "texas tax" unreliable in the presense of -changing taxes. Explicit tax credit requests? Carry 'taxable' onto line -items? +B<insert> method used to assume that the frequency of the package associated +with the associated line item remained unchanged during the lifetime of the +system. That is still used as a fallback. It may get the tax exemption +adjustments wrong if package definitions change frequency. The presense of +delete methods in FS::cust_main_county and FS::tax_rate makes crediting of +old "texas tax" unreliable in the presense of changing taxes. Explicit tax +credit requests? Carry 'taxable' onto line items? =head1 SEE ALSO |