this is usefull
if u want to see what was remaining balnce of customer after a call
after completion steps below your system will log every customer s remaining balance in CDRwarning make backup of these files in case any mistakestep 1
Code:
mysql -uroot -p"rootpassword" mya2billing
make a new column "userbalance" in table cc_call in mya2billing database
Code:
ALTER TABLE cc_call ADD userbalance decimal(15,2) DEFAULT '0.00';
step 2
edit these files
/var/www/html/a2billing/common/lib/Class.RateEngine.php
line 1140 oregional
Code:
" id_trunk, src, sipiax, buycost, id_card_package_offer, dnid, destination ";
replace with
Code:
" id_trunk, src, sipiax, buycost, id_card_package_offer, dnid, destination ,userbalance";
line 1156 oregional is empty
replace with
Code:
$baqayabalance = $A2B->credit - a2b_round(abs($cost)) ;
line 1159 oregional
Code:
" '$buycost', $id_card_package_offer, '" . $A2B->dnid . "', $calldestination )";
replace with
Code:
" '$buycost', $id_card_package_offer, '" . $A2B->dnid . "', $calldestination ,$baqayabalance)";
/var/www/html/a2billing/customer/call-history.php
line 107 oregianal is empty
line 107 replace with
Code:
$FG_TABLE_COL[]=array (gettext("Balance"), "userbalance", "12%", "center", "SORT", "30", "", "", "", "", "", "display_2bill");
and line 108 oreginal
Code:
$FG_COL_QUERY = 't1.starttime, t1.src, t1.calledstation, t1.destination, t1.sessiontime, t1.terminatecauseid, t1.sipiax, t1.sessionbill';
replace with
Code:
$FG_COL_QUERY = 't1.starttime, t1.src, t1.calledstation, t1.destination, t1.sessiontime, t1.terminatecauseid, t1.sipiax, t1.sessionbill,t1.userbalance';
after this every customer will be able to see his remaining balance in cdr after every call
and admin also can see customers balance in CDR in customers account