summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_pkg.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2018-02-04 17:47:57 -0800
committerIvan Kohler <ivan@freeside.biz>2018-02-04 17:47:57 -0800
commite4aff0c0af3139118b4ae02e814ba7d0d8f46774 (patch)
tree1e6befdd61805ef7b697f032d5fdf20886ba411c /FS/FS/cust_bill_pkg.pm
parent889eafade02f1b7463cc47202020ddb8c5d8394f (diff)
option to reprocess CDRs when voiding an invoice, RT#79001
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r--FS/FS/cust_bill_pkg.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 9567278..77dce24 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -324,7 +324,7 @@ sub insert {
}
-=item void [ REASON ]
+=item void [ REASON [ , REPROCESS_CDRS ] ]
Voids this line item: deletes the line item and adds a record of the voided
line item to the FS::cust_bill_pkg_void table (and related tables).
@@ -334,6 +334,7 @@ line item to the FS::cust_bill_pkg_void table (and related tables).
sub void {
my $self = shift;
my $reason = scalar(@_) ? shift : '';
+ my $reprocess_cdrs = scalar(@_) ? shift : '';
unless (ref($reason) || !$reason) {
$reason = FS::reason->new_or_existing(
@@ -373,6 +374,9 @@ sub void {
cust_tax_exempt_pkg
cust_bill_pkg_fee
)) {
+ my %delete_args = ();
+ $delete_args{'reprocess_cdrs'} = $reprocess_cdrs
+ if $table eq 'cust_bill_pkg_detail';
foreach my $linked ( qsearch($table, { billpkgnum=>$self->billpkgnum }) ) {
@@ -380,7 +384,7 @@ sub void {
my $void = $vclass->new( {
map { $_ => $linked->get($_) } $linked->fields
});
- my $error = $void->insert || $linked->delete;
+ my $error = $void->insert || $linked->delete(%delete_args);
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;