summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2011-02-16 10:52:50 +0000
committerivan <ivan>2011-02-16 10:52:50 +0000
commit47ac94800061b47fd8e789738de58fd8c1210d1c (patch)
treec1df687351f64c05b90b17f583f02273e43289b7 /FS
parentbc03d12fffd22153b5035bc021450387bacc17b8 (diff)
add debugging
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/ClientAPI/PrepaidPhone.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/FS/FS/ClientAPI/PrepaidPhone.pm b/FS/FS/ClientAPI/PrepaidPhone.pm
index 00bc0ffd0..c918dde06 100644
--- a/FS/FS/ClientAPI/PrepaidPhone.pm
+++ b/FS/FS/ClientAPI/PrepaidPhone.pm
@@ -6,7 +6,7 @@ use FS::Record qw(qsearchs);
use FS::rate;
use FS::svc_phone;
-$DEBUG = 0;
+$DEBUG = 1;
$me = '[FS::ClientAPI::PrepaidPhone]';
#TODO:
@@ -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,