Ejemplo n.º 1
0
 /**
  * @param Logic_Negotiator_Option $option
  * @param $reasons
  * @return boolean
  */
 public static function qualifyForManualService(Logic_Negotiator_Option $option, &$reasons)
 {
     $manual = false;
     $reasons = array();
     if (self::$_model === null) {
         self::$_model = new ManualserviceFactor();
     }
     $data = array();
     $step = $option->getStep();
     $negotiation = $step->getNegotiation();
     $data['branchid'] = Base_Convert::strToHex($negotiation->getBranchId());
     $data['period'] = $option->getDuration();
     $data['requestNo'] = $step->getOrder();
     $data['amount'] = $negotiation->getTotalAmount();
     $data['interest'] = $option->getInterest()->getValue();
     $data['clienttype'] = $negotiation->getCustomerType();
     $data['operationtype'] = $negotiation->getOperationType();
     $data['currency'] = $negotiation->getCurrency();
     $data['commitment'] = $negotiation->getCustomer()->engagement;
     $rows = self::$_model->fetchAllActive();
     foreach ($rows as $row) {
         if ($row->factor->check($data)) {
             $reasons[] = $row->name;
             $manual = true;
         }
     }
     return $manual;
 }