X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_bill.pm;h=bd1b8bbec8deb466a74672211c60192778154c7c;hb=908b5627cc5899b00d3b9e83602403eb956dd038;hp=5ae4f3686649ce7447204a936d5743237573ad92;hpb=22dd0016d0938f6acb2127d8168a4a1c5e296d3f;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 5ae4f3686..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; @@ -3450,17 +3451,12 @@ sub _items_total { $total_descr = $self->mt('Total Charges'); } - if ( $conf->exists('invoice_show_prior_due_date') ) { + if ( $conf->exists('invoice_show_prior_due_date') && !$conf->exists('invoice_omit_due_date') ) { # then the due date should be shown with Total New Charges, # and should NOT be shown with the Balance Due message. if ( $self->due_date ) { - $total_descr = join(' ', - $total_descr, - '-', - $self->mt('Please pay by'), - $self->due_date2str('short') - ); + $total_descr .= $self->invoice_pay_by_msg; } elsif ( $self->terms ) { $total_descr = join(' ', $total_descr, @@ -3546,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