Changeset 1030
- Timestamp:
- 09/16/08 16:13:16 (4 months ago)
- Files:
-
- trunk/AGI/a2billing.php (modified) (3 diffs)
- trunk/common/lib/Class.A2Billing.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/AGI/a2billing.php
r1019 r1030 188 188 $A2B-> deck_switch($agi); 189 189 190 if( $A2B ->credit < $A2B->agiconfig['min_credit_2call'] && $A2B -> typepaid==0&& $A2B->agiconfig['jump_voucher_if_min_credit']==1) {190 if( $A2B -> enough_credit_to_call() && $A2B->agiconfig['jump_voucher_if_min_credit']==1) { 191 191 192 192 $A2B -> debug( WRITELOG, $agi, __FILE__, __LINE__, "[NOTENOUGHCREDIT - Refill with vouchert]"); … … 199 199 } 200 200 201 if( $A2B->credit < $A2B->agiconfig['min_credit_2call'] && $A2B -> typepaid==0) { 201 $A2B -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "TARIFF ID -> ". $A2B->tariff); 202 203 if($A2B -> enough_credit_to_call()) { 202 204 203 205 // SAY TO THE CALLER THAT IT DEOSNT HAVE ENOUGH CREDIT TO MAKE A CALL … … 776 778 } 777 779 778 if( $A2B-> credit < $A2B->agiconfig['min_credit_2call'] && $A2B -> typepaid==0) {780 if( $A2B->enough_credit_to_call()) { 779 781 // SAY TO THE CALLER THAT IT DEOSNT HAVE ENOUGH CREDIT TO MAKE A CALL 780 782 $prompt = "prepaid-no-enough-credit-stop"; trunk/common/lib/Class.A2Billing.php
r1019 r1030 726 726 727 727 728 function enough_credit_to_call(){ 729 $test_package = true; 730 $QUERY = "SELECT id_cc_package_offer FROM cc_tariffgroup WHERE id= ".$this->tariff ; 731 $result = $this -> instance_table -> SQLExec ($this->DBHandle, $QUERY); 732 if( !empty($result[0][0])){ 733 734 $id_package_groupe = $result[0][0]; 735 736 if($id_package_groupe!=-1){ 737 $test_package = floor($this->credit*100)>0; 738 } 739 } 740 if ( (!$test_package || $this->credit < $this->agiconfig['min_credit_2call']) && $A2B -> typepaid==0) return true; 741 else return false; 742 } 728 743 729 744 /**
