projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b9d2d7f
)
add debugging
author
ivan
<ivan>
Wed, 16 Feb 2011 10:52:51 +0000
(10:52 +0000)
committer
ivan
<ivan>
Wed, 16 Feb 2011 10:52:51 +0000
(10:52 +0000)
FS/FS/ClientAPI/PrepaidPhone.pm
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/PrepaidPhone.pm
b/FS/FS/ClientAPI/PrepaidPhone.pm
index
00bc0ff
..
c918dde
100644
(file)
--- 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;
use FS::rate;
use FS::svc_phone;
-$DEBUG =
0
;
+$DEBUG =
1
;
$me = '[FS::ClientAPI::PrepaidPhone]';
#TODO:
$me = '[FS::ClientAPI::PrepaidPhone]';
#TODO:
@@
-230,12
+230,17
@@
Customer balance.
sub phonenum_balance {
my $packet = shift;
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 ) {
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,
};
return { 'custnum' => '',
'balance' => 0,
};
@@
-243,6
+248,10
@@
sub phonenum_balance {
my $cust_pkg = $svc_phone->cust_svc->cust_pkg;
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,
return {
'custnum' => $cust_pkg->custnum,
'balance' => $cust_pkg->cust_main->balance,