X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=bd1b8bbec8deb466a74672211c60192778154c7c;hp=8b94dcc8750a9bcb6102756873a193b13a36b983;hb=b4fa2aa2f73721c6f2c467c73b25e20f59cb04ea;hpb=4e7954f0f0703afc22b649ce38aea4e63db81daa diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 8b94dcc87..bd1b8bbec 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -215,7 +215,7 @@ sub insert { } -=item void [ REASON ] +=item void [ REASON [ , REPROCESS_CDRS ] ] Voids this invoice: deletes the invoice and adds a record of the voided invoice to the FS::cust_bill_void table (and related tables starting from @@ -226,6 +226,7 @@ FS::cust_bill_pkg_void). sub void { my $self = shift; my $reason = scalar(@_) ? shift : ''; + my $reprocess_cdrs = scalar(@_) ? shift : ''; unless (ref($reason) || !$reason) { $reason = FS::reason->new_or_existing( @@ -257,7 +258,7 @@ sub void { } foreach my $cust_bill_pkg ( $self->cust_bill_pkg ) { - my $error = $cust_bill_pkg->void($reason); + my $error = $cust_bill_pkg->void($reason, $reprocess_cdrs); if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; @@ -3541,6 +3542,23 @@ sub _items_aging_balances { return map{ sprintf('%.2f',$_) } @aging_balances; } +=item has_call_details + +Returns true if this invoice has call details. + +=cut + +sub has_call_details { + my $self = shift; + $self->scalar_sql(" + SELECT 1 FROM cust_bill_pkg_detail + LEFT JOIN cust_bill_pkg USING (billpkgnum) + WHERE cust_bill_pkg_detail.format = 'C' + AND cust_bill_pkg.invnum = ? + LIMIT 1 + ", $self->invnum); +} + =item call_details [ OPTION => VALUE ... ] Returns an array of CSV strings representing the call details for this invoice