projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9686d04
)
when billing a package on cancellation, ignore non-usage taxes, #29443, fallout from...
author
Mark Wells
<mark@freeside.biz>
Mon, 16 Jun 2014 21:09:10 +0000
(14:09 -0700)
committer
Mark Wells
<mark@freeside.biz>
Mon, 16 Jun 2014 21:09:10 +0000
(14:09 -0700)
FS/FS/cust_main/Billing.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main/Billing.pm
b/FS/FS/cust_main/Billing.pm
index
545243c
..
4f91080
100644
(file)
--- a/
FS/FS/cust_main/Billing.pm
+++ b/
FS/FS/cust_main/Billing.pm
@@
-630,6
+630,7
@@
sub bill {
$taxlisthash{$pass},
$fee_item,
location => $fee_location
$taxlisthash{$pass},
$fee_item,
location => $fee_location
+ # probably not right to pass cancel => 1 for fees
);
return $error if $error;
);
return $error if $error;
@@
-1353,7
+1354,8
@@
sub _make_lines {
# handle taxes
###
# handle taxes
###
- my $error = $self->_handle_taxes( $taxlisthash, $cust_bill_pkg );
+ my $error = $self->_handle_taxes( $taxlisthash, $cust_bill_pkg,
+ cancel => $options{cancel} );
return $error if $error;
$cust_bill_pkg->set_display(
return $error if $error;
$cust_bill_pkg->set_display(
@@
-1473,6
+1475,8
@@
OPTIONS may include:
- part_item: a part_pkg or part_fee object to be used as the package/fee
definition.
- location: a cust_location to be used as the billing location.
- part_item: a part_pkg or part_fee object to be used as the package/fee
definition.
- location: a cust_location to be used as the billing location.
+- cancel: true if this package is being billed on cancellation. This
+ allows tax to be calculated on usage charges only.
If not supplied, part_item will be inferred from the pkgnum or feepart of the
cust_bill_pkg, and location from the pkgnum (or, for fees, the invnum and
If not supplied, part_item will be inferred from the pkgnum or feepart of the
cust_bill_pkg, and location from the pkgnum (or, for fees, the invnum and
@@
-1507,10
+1511,9
@@
sub _handle_taxes {
my %taxes = ();
my @classes;
my %taxes = ();
my @classes;
- #push @classes, $cust_bill_pkg->usage_classes if $cust_bill_pkg->type eq 'U';
push @classes, $cust_bill_pkg->usage_classes if $cust_bill_pkg->usage;
push @classes, $cust_bill_pkg->usage_classes if $cust_bill_pkg->usage;
- push @classes, 'setup' if $cust_bill_pkg->setup;
- push @classes, 'recur' if $cust_bill_pkg->recur;
+ push @classes, 'setup' if $cust_bill_pkg->setup
and !$options{cancel}
;
+ push @classes, 'recur' if $cust_bill_pkg->recur
and !$options{cancel}
;
my $exempt = $conf->exists('cust_class-tax_exempt')
? ( $self->cust_class ? $self->cust_class->tax : '' )
my $exempt = $conf->exists('cust_class-tax_exempt')
? ( $self->cust_class ? $self->cust_class->tax : '' )