[freeside-commits] freeside/FS/FS/ClientAPI PrepaidPhone.pm, 1.5, 1.5.8.1

Ivan,,, ivan at wavetail.420.am
Wed Feb 16 02:52:53 PST 2011


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

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	PrepaidPhone.pm 
Log Message:
add debugging

Index: PrepaidPhone.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/PrepaidPhone.pm,v
retrieving revision 1.5
retrieving revision 1.5.8.1
diff -u -w -d -r1.5 -r1.5.8.1
--- PrepaidPhone.pm	26 Nov 2008 00:30:25 -0000	1.5
+++ PrepaidPhone.pm	16 Feb 2011 10:52:51 -0000	1.5.8.1
@@ -6,7 +6,7 @@
 use FS::rate;
 use FS::svc_phone;
 
-$DEBUG = 0;
+$DEBUG = 1;
 $me = '[FS::ClientAPI::PrepaidPhone]';
 
 #TODO:
@@ -230,12 +230,17 @@
 sub phonenum_balance {
   my $packet = shift;
 
+  warn "$me phonenum_balance called with countrycode ".$packet->{'countrycode'}.
+       " and phonenum ". $packet->{'phonenum'}. "\n"
+    if $DEBUG;
+
   my $svc_phone = qsearchs('svc_phone', {
     'countrycode' => ( $packet->{'countrycode'} || 1 ),
     'phonenum'    => $packet->{'phonenum'},
   });
 
   unless ( $svc_phone ) {
+    warn "$me no phone number found\n" if $DEBUG;
     return { 'custnum' => '',
              'balance' => 0,
            };
@@ -243,6 +248,10 @@
 
   my $cust_pkg = $svc_phone->cust_svc->cust_pkg;
 
+  warn "$me returning ". $cust_pkg->cust_main->balance.
+       " balance for custnum ". $cust_pkg->custnum
+    if $DEBUG;
+
   return {
     'custnum' => $cust_pkg->custnum,
     'balance' => $cust_pkg->cust_main->balance,



More information about the freeside-commits mailing list