/** * * @return boolean */ protected function _validFundContract() { $mapperFinancial = new Fefop_Model_Mapper_Financial(); $fundContract = $mapperFinancial->listFundsContract($this->_contract->id_fefop_contract); // If there is fund contract statement if (!empty($fundContract['funds'])) { $this->addMessage('Ita la bele edita kontratu nee tamba iha lansamentu finanseiru tiha ona ba fundu.'); return false; } return true; }
/** * */ public function saveTransactionContractAction() { $form = new Fefop_Form_TransactionContract(); if ($this->getRequest()->isPost()) { if ($form->isValid($this->getRequest()->getPost())) { $this->_mapper->setData($form->getValues()); $return = $this->_mapper->saveTransactionContract(); $message = $this->_mapper->getMessage()->toArray(); $result = array('status' => (bool) $return, 'id' => $return, 'description' => $message, 'data' => $form->getValues(), 'fields' => $this->_mapper->getFieldsError()); $this->_helper->json($result); } else { $message = new App_Message(); $message->addMessage($this->_config->messages->warning, App_Message::WARNING); $result = array('status' => false, 'description' => $message->toArray(), 'errors' => $form->getMessages()); $this->_helper->json($result); } } }
/** * @access public * @return array */ public function financialContractReport() { $mapper = new Fefop_Model_Mapper_Financial(); $rows = $mapper->listByFilters($this->_data); return array('rows' => $rows->toArray()); }
/** * * @param array $financial_transactions * @return Zend_Db_Table_Rowset */ public function listFinancialTransactionsIn($financial_transactions) { $mapperFinancial = new Fefop_Model_Mapper_Financial(); $select = $mapperFinancial->getSelect(); $select->where('t.id_fefop_transaction IN (?)', $financial_transactions); return $this->_dbTable->fetchAll($select); }