[freeside-commits] freeside/FS/FS cust_main.pm, 1.460, 1.461 cust_bill.pm, 1.261, 1.262

Ivan,,, ivan at wavetail.420.am
Wed Oct 7 22:44:42 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv17084

Modified Files:
	cust_main.pm cust_bill.pm 
Log Message:
avoid some (look to be harmless) warnings:

Argument "" isn't numeric in sprintf at /usr/local/share/perl/5.10.0/FS/cust_bill.pm line 2358.

Argument "" isn't numeric in subtraction (-) at /usr/local/share/perl/5.10.0/FS/cust_bill.pm line 2359.

Argument "" isn't numeric in addition (+) at /usr/local/share/perl/5.10.0/FS/cust_main.pm line 2788.



Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.460
retrieving revision 1.461
diff -u -d -r1.460 -r1.461
--- cust_main.pm	5 Oct 2009 02:35:50 -0000	1.460
+++ cust_main.pm	8 Oct 2009 05:44:40 -0000	1.461
@@ -2782,8 +2782,8 @@
   my @cust_bill = $self->cust_bill;
   my $balance = $self->balance;
   my $previous_balance = scalar(@cust_bill)
-                           ?  $cust_bill[$#cust_bill]->billing_balance
-                           :  0;
+                           ? ( $cust_bill[$#cust_bill]->billing_balance || 0 )
+                           : 0;
 
   $previous_balance += $cust_bill[$#cust_bill]->charged
     if scalar(@cust_bill);
@@ -7306,6 +7306,7 @@
 
 sub cust_bill {
   my $self = shift;
+  map { $_ } #return $self->num_cust_bill unless wantarray;
   sort { $a->_date <=> $b->_date }
     qsearch('cust_bill', { 'custnum' => $self->custnum, } )
 }
@@ -7337,6 +7338,7 @@
 
 sub cust_statement {
   my $self = shift;
+  map { $_ } #return $self->num_cust_statement unless wantarray;
   sort { $a->_date <=> $b->_date }
     qsearch('cust_statement', { 'custnum' => $self->custnum, } )
 }
@@ -7349,6 +7351,7 @@
 
 sub cust_credit {
   my $self = shift;
+  map { $_ } #return $self->num_cust_credit unless wantarray;
   sort { $a->_date <=> $b->_date }
     qsearch( 'cust_credit', { 'custnum' => $self->custnum } )
 }
@@ -7362,6 +7365,7 @@
 
 sub cust_credit_pkgnum {
   my( $self, $pkgnum ) = @_;
+  map { $_ } #return $self->num_cust_credit_pkgnum($pkgnum) unless wantarray;
   sort { $a->_date <=> $b->_date }
     qsearch( 'cust_credit', { 'custnum' => $self->custnum,
                               'pkgnum'  => $pkgnum,
@@ -7406,6 +7410,7 @@
 
 sub cust_pay_pkgnum {
   my( $self, $pkgnum ) = @_;
+  map { $_ } #return $self->num_cust_pay_pkgnum($pkgnum) unless wantarray;
   sort { $a->_date <=> $b->_date }
     qsearch( 'cust_pay', { 'custnum' => $self->custnum,
                            'pkgnum'  => $pkgnum,
@@ -7421,6 +7426,7 @@
 
 sub cust_pay_void {
   my $self = shift;
+  map { $_ } #return $self->num_cust_pay_void unless wantarray;
   sort { $a->_date <=> $b->_date }
     qsearch( 'cust_pay_void', { 'custnum' => $self->custnum } )
 }
@@ -7433,6 +7439,7 @@
 
 sub cust_pay_batch {
   my $self = shift;
+  map { $_ } #return $self->num_cust_pay_batch unless wantarray;
   sort { $a->paybatchnum <=> $b->paybatchnum }
     qsearch( 'cust_pay_batch', { 'custnum' => $self->custnum } )
 }
@@ -7480,6 +7487,7 @@
 
 sub cust_refund {
   my $self = shift;
+  map { $_ } #return $self->num_cust_refund unless wantarray;
   sort { $a->_date <=> $b->_date }
     qsearch( 'cust_refund', { 'custnum' => $self->custnum } )
 }

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.261
retrieving revision 1.262
diff -u -d -r1.261 -r1.262
--- cust_bill.pm	8 Oct 2009 05:09:27 -0000	1.261
+++ cust_bill.pm	8 Oct 2009 05:44:40 -0000	1.262
@@ -2355,8 +2355,8 @@
 #  my( $cr_total, @cr_cust_credit ) = $self->cust_credit; #credits
   #my $balance_due = $self->owed + $pr_total - $cr_total;
   my $balance_due = $self->owed + $pr_total;
-  $invoice_data{'true_previous_balance'} = sprintf("%.2f", $self->previous_balance);
-  $invoice_data{'balance_adjustments'} = sprintf("%.2f", $self->previous_balance - $self->billing_balance);
+  $invoice_data{'true_previous_balance'} = sprintf("%.2f", ($self->previous_balance || 0) );
+  $invoice_data{'balance_adjustments'} = sprintf("%.2f", ($self->previous_balance || 0) - ($self->billing_balance || 0) );
   $invoice_data{'previous_balance'} = sprintf("%.2f", $pr_total);
   $invoice_data{'balance'} = sprintf("%.2f", $balance_due);
 



More information about the freeside-commits mailing list