/** * @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; }
/** * * @param Logic_Negotiator_Option $option */ public function __construct(Logic_Negotiator_Option $option = null) { if ($option != null) { $step = $option->getStep(); $negotiation = $step->getNegotiation(); $this->_nonAssume = !($negotiation->getOperationType() == 'assume' || $negotiation->getOperationType() == '1'); $this->customer = $negotiation->getCustomer(); $this->customerTypeId = $negotiation->getCustomerType(); $this->brandId = $negotiation->getBranchId(); $depositAmount = $negotiation->getTotalAmount(); $duration = $option->getDuration(); $filter = new Zend_Filter_Int(); if (strpos($duration, 'M') !== false) { $months = $filter->filter($duration); $this->depositDays = $months % 12 * 30 + ($months - $months % 12) / 12 * 365; } elseif (strpos($duration, 'D') !== false) { $this->depositDays = $filter->filter($duration); } elseif (strpos($duration, 'Y') !== false) { $this->depositDays = $filter->filter($duration) * 365; } $this->depositAmount = $depositAmount; $this->newMoney = $negotiation->isNewMoney(); $this->currency = $negotiation->getCurrency(); $this->customerExpectance = $option->getCustomerExpectance(); $this->counterOfferNo = $step->getOrder(); parent::__construct(); } else { $this->_debugMode = true; } }