X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FPrepaidPhone.pm;h=c3461792217dfd398057e03f9336f591e04174e5;hb=98676b828fb42b1bbad8efc44bace00839bc9f32;hp=00bc0ffd07135c0e63c7590f4d933be897a67863;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/FS/FS/ClientAPI/PrepaidPhone.pm b/FS/FS/ClientAPI/PrepaidPhone.pm index 00bc0ffd0..c34617922 100644 --- a/FS/FS/ClientAPI/PrepaidPhone.pm +++ b/FS/FS/ClientAPI/PrepaidPhone.pm @@ -230,12 +230,17 @@ Customer balance. 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 @@ sub phonenum_balance { 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,