Changeset 1030

Show
Ignore:
Timestamp:
09/16/08 16:13:16 (4 months ago)
Author:
rach
Message:

Change the behaviours of the "not enough credit" to handle the package and precision

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/AGI/a2billing.php

    r1019 r1030  
    188188                        $A2B-> deck_switch($agi); 
    189189                         
    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) { 
    191191 
    192192                                $A2B -> debug( WRITELOG, $agi, __FILE__, __LINE__, "[NOTENOUGHCREDIT - Refill with vouchert]"); 
     
    199199                        } 
    200200                         
    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()) { 
    202204 
    203205                                // SAY TO THE CALLER THAT IT DEOSNT HAVE ENOUGH CREDIT TO MAKE A CALL 
     
    776778                        } 
    777779 
    778                         if( $A2B->credit < $A2B->agiconfig['min_credit_2call'] && $A2B -> typepaid==0) { 
     780                        if( $A2B->enough_credit_to_call()) { 
    779781                                // SAY TO THE CALLER THAT IT DEOSNT HAVE ENOUGH CREDIT TO MAKE A CALL 
    780782                                $prompt = "prepaid-no-enough-credit-stop"; 
  • trunk/common/lib/Class.A2Billing.php

    r1019 r1030  
    726726 
    727727 
     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        } 
    728743 
    729744        /** 


Google