Ejemplo n.º 1
0
 /**
  * @access public
  * @return void
  */
 public function init()
 {
     parent::init();
     $elements = array();
     $elements[] = $this->createElement('hidden', 'path')->setAttrib('class', 'no-clear')->setValue(self::PATH)->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'title')->setAttrib('class', 'no-clear')->setValue(self::TITLE)->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'orientation')->setValue('landscape')->setAttrib('class', 'no-clear')->setDecorators(array('ViewHelper'));
     $this->removeElement('fk_id_dec');
     $dbTypeTransaction = App_Model_DbTable_Factory::get('FEFOPTypeTransaction');
     $rows = $dbTypeTransaction->fetchAll();
     $optTypeTransaction = array();
     foreach ($rows as $row) {
         $optTypeTransaction[$row['id_fefop_type_transaction']] = $row['acronym'] . ' - ' . $row['description'];
     }
     $elements[] = $this->createElement('multiselect', 'fk_id_fefop_type_transaction')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optTypeTransaction)->setLabel('Tipu Transasaun');
     $mapperFund = new Fefop_Model_Mapper_Fund();
     $funds = $mapperFund->fetchAll();
     $optFunds = array();
     foreach ($funds as $fund) {
         $optFunds[$fund['id_fefopfund']] = $fund['name_fund'];
     }
     $elements[] = $this->createElement('multiselect', 'fk_id_fefopfund')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optFunds)->setLabel('Fundu');
     $optStatus = array();
     $optStatus['C'] = 'Consolidado';
     $optStatus['P'] = 'Pendente';
     $optStatus['A'] = 'Parcial';
     $elements[] = $this->createElement('multiselect', 'status')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optStatus)->setLabel('Status');
     $optPayment[''] = 'Hotu-hotu';
     $optPayment['C'] = 'Kontratu';
     $optPayment['F'] = 'Fundu';
     $elements[] = $this->createElement('select', 'bank_payment')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optPayment)->setLabel('Pagamentu');
     $this->addElements($elements);
 }
Ejemplo n.º 2
0
 /**
  * 
  */
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form')->setName('formstatement');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'id_fefop_bank_statements')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'status')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'id_fefop_bank_contract')->setIsArray(true);
     $elements[] = $this->createElement('hidden', 'fk_id_fefop_contract')->setIsArray(true);
     $elements[] = $this->createElement('hidden', 'total_contract')->setIsArray(true);
     $elements[] = $this->createElement('hidden', 'total_expense')->setIsArray(true);
     $elements[] = $this->createElement('hidden', 'fk_id_budget_category')->setIsArray(true);
     $elements[] = $this->createElement('text', 'date_statement')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setAttrib('class', 'm-wrap span12 date-mask')->setValue(Zend_Date::now()->toString('dd/MM/yyyy'))->setLabel('Data');
     $elements[] = $this->createElement('text', 'amount')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setValue(0)->setAttrib('class', 'm-wrap span12 money-mask bold text-right')->setAttrib('style', 'font-size: 19px')->setLabel('Total');
     $dbTypeTransaction = App_Model_DbTable_Factory::get('FEFOPTypeTransaction');
     $rows = $dbTypeTransaction->fetchAll();
     $optTypeTransaction = array('' => '');
     foreach ($rows as $row) {
         $optTypeTransaction[$row['id_fefop_type_transaction']] = $row['acronym'] . ' - ' . $row['description'];
     }
     $elements[] = $this->createElement('select', 'fk_id_fefop_type_transaction')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optTypeTransaction)->setRequired(true)->setLabel('Tipu Transasaun');
     $optOperation[Fefop_Model_Mapper_BankStatement::DEBIT] = 'Saída';
     $optOperation[Fefop_Model_Mapper_BankStatement::CREDIT] = 'Entrada';
     $elements[] = $this->createElement('select', 'operation')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optOperation)->setRequired(true)->setLabel('Operasaun');
     $mapperFund = new Fefop_Model_Mapper_Fund();
     $funds = $mapperFund->fetchAll();
     $optFunds[''] = '';
     foreach ($funds as $fund) {
         $optFunds[$fund['id_fefopfund']] = $fund['name_fund'];
     }
     $elements[] = $this->createElement('select', 'fk_id_fefopfund')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optFunds)->setLabel('Fundu');
     $elements[] = $this->createElement('textarea', 'description')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setAttrib('rows', '2')->setRequired(true)->setLabel('Deskrisaun');
     $this->addElements($elements);
     App_Form_Toolbar::build($this, self::ID);
     $this->setDecorators($this->getDefaultFormDecorators());
 }
Ejemplo n.º 3
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form')->setName('search');
     $elements = array();
     $dbTypeTransaction = App_Model_DbTable_Factory::get('FEFOPTypeTransaction');
     $rows = $dbTypeTransaction->fetchAll();
     $optTypeTransaction[''] = '';
     foreach ($rows as $row) {
         $optTypeTransaction[$row['id_fefop_type_transaction']] = $row['acronym'] . ' - ' . $row['description'];
     }
     $elements[] = $this->createElement('select', 'fk_id_fefop_type_transaction')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optTypeTransaction)->setLabel('Tipu Transasaun');
     $mapperFund = new Fefop_Model_Mapper_Fund();
     $funds = $mapperFund->fetchAll();
     $optFunds[''] = '';
     foreach ($funds as $fund) {
         $optFunds[$fund['id_fefopfund']] = $fund['name_fund'];
     }
     $elements[] = $this->createElement('select', 'fk_id_fefopfund')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optFunds)->setLabel('Fundu');
     $optStatus[''] = '';
     $optStatus['C'] = 'Consolidado';
     $optStatus['P'] = 'Pendente';
     $optStatus['A'] = 'Parcial';
     $elements[] = $this->createElement('select', 'status')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optStatus)->setLabel('Status');
     $dbBudgetCategoryType = App_Model_DbTable_Factory::get('BudgetCategoryType');
     $rows = $dbBudgetCategoryType->fetchAll();
     $optBudgetCategoryType[''] = '';
     foreach ($rows as $row) {
         $optBudgetCategoryType[$row['id_budget_category_type']] = $row['description'];
     }
     $elements[] = $this->createElement('multiselect', 'fk_id_budget_category_type')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optBudgetCategoryType)->setLabel('Komponente');
     $dbBudgetCategory = App_Model_DbTable_Factory::get('BudgetCategory');
     $rows = $dbBudgetCategory->fetchAll();
     $optBudgetCategory[''] = '';
     foreach ($rows as $row) {
         $optBudgetCategory[$row['id_budget_category']] = $row['description'];
     }
     $elements[] = $this->createElement('multiselect', 'fk_id_budget_category')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optBudgetCategory)->setLabel('Rúbrica');
     $elements[] = $this->createElement('text', 'date_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask')->setLabel('Loron Inisiu');
     $elements[] = $this->createElement('text', 'date_finish')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask')->setLabel('Loron Remata');
     $elements[] = $this->createElement('text', 'minimum_amount')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 money-mask text-right')->setValue(0)->setLabel('Valor total mínimo');
     $elements[] = $this->createElement('text', 'maximum_amount')->setDecorators($this->getDefaultElementDecorators())->setValue(200000)->setAttrib('class', 'm-wrap span12 money-mask text-right')->setLabel('Valor total máximo');
     $elements[] = $this->createElement('text', 'num_contract')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setLabel('Kontratu');
     $this->addElements($elements);
 }
Ejemplo n.º 4
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'modules_cost')->setIsArray(true);
     $mapperFund = new Fefop_Model_Mapper_Fund();
     $funds = $mapperFund->fetchAll();
     $optFunds[''] = '';
     foreach ($funds as $fund) {
         $optFunds[$fund['id_fefopfund']] = $fund['name_fund'];
     }
     $elements[] = $this->createElement('select', 'fk_id_fefopfund')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setRequired(true)->addMultiOptions($optFunds)->setLabel('Fundu');
     $optYear[''] = '';
     $finalYear = 2014 + 10;
     for ($yearIni = 2014 - 2; $yearIni <= $finalYear; $yearIni++) {
         $optYear[$yearIni] = $yearIni;
     }
     $elements[] = $this->createElement('select', 'year_planning')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->addMultiOptions($optYear)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Tinan');
     $elements[] = $this->createElement('text', 'amount')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->removeDecorator('Label')->setAttrib('class', 'm-wrap span12 money-mask required')->setLabel('Total')->setRequired(true);
     $elements[] = $this->createElement('text', 'additional_cost')->setDecorators($this->getDefaultElementDecorators())->setValue(0)->removeDecorator('Label')->setAttrib('class', 'm-wrap cost-module span12 money-mask required')->setRequired(true);
     $this->addElements($elements);
     App_Form_Toolbar::build($this, self::ID);
     $this->setDecorators($this->getDefaultFormDecorators());
 }
Ejemplo n.º 5
0
 /**
  * 
  */
 public function totalsAction()
 {
     $this->_helper->layout()->disableLayout();
     $this->view->totals = $this->_mapper->listTotals();
 }
Ejemplo n.º 6
0
 /**
  * 
  */
 public function fundContractAction()
 {
     $this->_helper->layout()->disableLayout();
     $id = $this->_getParam('id');
     $formFundContract = new Fefop_Form_ContractFund();
     $formFundContract->setAction($this->_helper->url('save-fund-contract'));
     $formFundContract->getElement('fk_id_fefop_contract')->setValue($id);
     // List all Funds
     $mapperFunds = new Fefop_Model_Mapper_Fund();
     $funds = $mapperFunds->fetchAll(array(), array('type'));
     // Fetch the totals by fund
     $reportFefop = new Report_Model_Mapper_Fefop();
     $filterReport = array('year' => date('Y'));
     $fundsTotals = $reportFefop->donorContractCostReport();
     $donorsTotals = $fundsTotals['item']['donor'];
     $donorTotalsViews = array();
     foreach ($donorsTotals as $typeDonor) {
         foreach ($typeDonor as $idDonor => $donor) {
             $donorTotalsViews[$idDonor] = $donor['balance'];
         }
     }
     $this->view->donor_totals = $donorTotalsViews;
     // List the funds already registered to the contract
     $fundsContract = $this->_mapper->listFundsContract($id);
     // List all the components related to the contract
     $mapperContract = new Fefop_Model_Mapper_Contract();
     $components = $mapperContract->listComponentsContract($id);
     // Reimbursement by Component
     $reimbursement = $this->_mapper->listExpenseTypeTotalsByContract($id, Fefop_Model_Mapper_Financial::TYPE_REIMBURSEMENT);
     $dataReimbursement = array();
     foreach ($reimbursement as $row) {
         $dataReimbursement[$row->fk_id_budget_category_type] = $row->total;
     }
     $this->view->reimbursement = $dataReimbursement;
     $this->view->components = $components;
     $this->view->funds = $funds;
     $this->view->funds_contract = $fundsContract;
     $this->view->form = $formFundContract;
 }