summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_ApplicationCommon.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-09-26 00:53:05 -0700
committerMark Wells <mark@freeside.biz>2012-09-26 00:53:05 -0700
commit82d8565fbeaebd69177a3a14d833685ecb86a545 (patch)
tree2b5313e05aaa0cdbc1be393f10263010db2d62d8 /FS/FS/cust_bill_ApplicationCommon.pm
parenteb9148f0ab9aac5e4f89824b7fab6bb9d648e688 (diff)
tax calculation and reporting for new customer locations, #940
Diffstat (limited to 'FS/FS/cust_bill_ApplicationCommon.pm')
-rw-r--r--FS/FS/cust_bill_ApplicationCommon.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/FS/FS/cust_bill_ApplicationCommon.pm b/FS/FS/cust_bill_ApplicationCommon.pm
index cadb8a7..cb07050 100644
--- a/FS/FS/cust_bill_ApplicationCommon.pm
+++ b/FS/FS/cust_bill_ApplicationCommon.pm
@@ -337,6 +337,7 @@ sub calculate_applications {
# could expand @open above, instead, for a slightly different magic effect
my @result = ();
foreach my $apply ( @apply ) {
+ # $apply = [ FS::cust_bill_pkg_tax_location record, amount ]
my @sub_lines = $apply->[0]->cust_bill_pkg_tax_Xlocation;
my $amount = $apply->[1];
warn "applying ". $apply->[1]. " to ". $apply->[0]->desc
@@ -346,6 +347,10 @@ sub calculate_applications {
my $owed = $subline->owed;
push @result, [ $apply->[0],
sprintf('%.2f', min($amount, $owed) ),
+ # $subline->primary_key is "billpkgtaxlocationnum"
+ # or "billpkgtaxratelocationnum"
+ # This is the ONLY place either of those fields will
+ # be set.
{ $subline->primary_key => $subline->get($subline->primary_key) },
];
$amount -= $owed;