[freeside-commits] branch FREESIDE_4_BRANCH updated. d20bfa4ce8103281e192e221020ec89a123875f6

Mark Wells mark at 420.am
Sun Aug 30 22:30:36 PDT 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  d20bfa4ce8103281e192e221020ec89a123875f6 (commit)
      from  50e00caf8ba629f85beaa499197947716dd30733 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d20bfa4ce8103281e192e221020ec89a123875f6
Author: Mark Wells <mark at freeside.biz>
Date:   Sun Aug 30 22:30:10 2015 -0700

    fix invoice deletion vs. cust_pay_batch records, #37837

diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index b694924..dee8a8f 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -294,13 +294,13 @@ sub delete {
 
   foreach my $table (qw(
     cust_credit_bill
-    cust_bill_pay
-    cust_pay_batch
     cust_bill_pay_batch
+    cust_bill_pay
     cust_bill_batch
     cust_bill_pkg
   )) {
     #cust_event # problematic
+    #cust_pay_batch # unnecessary
 
     foreach my $linked ( $self->$table() ) {
       my $error = $linked->delete;
@@ -2910,6 +2910,18 @@ sub call_details {
   ( $header, grep { $_ ne $header } @details );
 }
 
+=item cust_pay_batch
+
+Returns all L<FS::cust_pay_batch> records linked to this invoice. Deprecated,
+will be removed.
+
+=cut
+
+sub cust_pay_batch {
+  carp "FS::cust_bill->cust_pay_batch is deprecated";
+  my $self = shift;
+  qsearch('cust_pay_batch', { 'invnum' => $self->invnum });
+}
 
 =back
 
diff --git a/FS/FS/cust_pay_batch.pm b/FS/FS/cust_pay_batch.pm
index a5fa89b..8dd6446 100644
--- a/FS/FS/cust_pay_batch.pm
+++ b/FS/FS/cust_pay_batch.pm
@@ -3,7 +3,7 @@ use base qw( FS::payinfo_Mixin FS::cust_main_Mixin FS::Record );
 
 use strict;
 use vars qw( $DEBUG );
-use Carp qw( confess );
+use Carp qw( carp confess );
 use Business::CreditCard 0.28;
 use FS::Record qw(dbh qsearch qsearchs);
 
@@ -502,6 +502,19 @@ sub unbatch_and_delete {
 
 }
 
+=item cust_bill
+
+Returns the invoice linked to this batched payment. Deprecated, will be 
+removed.
+
+=cut
+
+sub cust_bill {
+  carp "FS::cust_pay_batch->cust_bill is deprecated";
+  my $self = shift;
+  $self->invnum ? qsearchs('cust_bill', { invnum => $self->invnum }) : '';
+}
+
 =back
 
 =head1 BUGS

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_bill.pm      |   16 ++++++++++++++--
 FS/FS/cust_pay_batch.pm |   15 ++++++++++++++-
 2 files changed, 28 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list