<?php

class Comercializacao_Form_TaxaValor extends Agro_Form {
	public function init() {
		$Session = new Zend_Session_Namespace('agrupamento');

		$this->addElement('hidden', 'id', array('decorators' => $this->elementDecorator));
		$this->addElement('select', 'id_preposto', array(
			'decorators' => $this->elementDecorator,
			'label' => 'Preposto'
		));

		$Cobertura = new Produto_Model_Coberturas();
		$this->addElement('select', 'id_cobertura', array(
			'MultiOptions' => !empty($Session->taxa['id_produto']) ? $Cobertura->getComboProduto($Session->taxa['id_produto']) : array(),
			'decorators' => $this->elementDecorator,
			'label' => 'Cobertura',
			'required' => true
		));

		$this->addElement('select', 'fl_franquia_disponivel', array(
			'MultiOptions' => array('S'=>'SEMPRE','N'=>'NOVOS ORÇAMENTOS','R'=>'RENOVAÇÕES'),
			'decorators' => $this->elementDecorator,
			'label' => 'Disponibilizada em ',
			'required' => true
		));

		$this->addElement('select', 'fl_ativo', array(
			'MultiOptions' => array(1=>'Sim',0=>'Não'),
			'decorators' => $this->elementDecorator,
			'label' => 'Ativo'
		));

		$this->vl_franquia = $this->createElement('text', 'vl_franquia');
		$this->vl_franquia->setDecorators($this->elementDecorator);
		$this->vl_franquia->setRequired(true);
		$this->vl_franquia->setAttrib('class', 'integer');
		$this->vl_franquia->setLabel('Franquia/NC (%)');
		$this->addElement($this->vl_franquia);

		$this->vl_taxa = $this->createElement('text', 'vl_taxa');
		$this->vl_taxa->setDecorators($this->elementDecorator);
		$this->vl_taxa->setRequired(true);
		$this->vl_taxa->setAttrib('class', 'decimal');
		$this->vl_taxa->setLabel('Taxa (%)');
		$this->addElement($this->vl_taxa);

		$this->vl_produtividade_estimada = $this->createElement('text', 'vl_produtividade_estimada');
		$this->vl_produtividade_estimada->setDecorators($this->elementDecorator);
		$this->vl_produtividade_estimada->setAttrib('class', 'integer');
		$this->vl_produtividade_estimada->setLabel('Prod. Estimada');
		$this->addElement($this->vl_produtividade_estimada);

		$this->vl_taxa_renovacao = $this->createElement('text', 'vl_taxa_renovacao');
		$this->vl_taxa_renovacao->setDecorators($this->elementDecorator);
		$this->vl_taxa_renovacao->setRequired(true);
		$this->vl_taxa_renovacao->setAttrib('class', 'decimal');
		$this->vl_taxa_renovacao->setLabel('Renovação (%)');
		$this->addElement($this->vl_taxa_renovacao);

		$this->vl_taxa_inadimplente = $this->createElement('text', 'vl_taxa_inadimplente');
		$this->vl_taxa_inadimplente->setDecorators($this->elementDecorator);
		$this->vl_taxa_inadimplente->setRequired(true);
		$this->vl_taxa_inadimplente->setAttrib('class', 'decimal');
		$this->vl_taxa_inadimplente->setLabel('Inadimplente (%)');
		$this->addElement($this->vl_taxa_inadimplente);

		$this->vl_taxa_reduzida = $this->createElement('text', 'vl_taxa_reduzida');
		$this->vl_taxa_reduzida->setDecorators($this->elementDecorator);
		$this->vl_taxa_reduzida->setRequired(true);
		$this->vl_taxa_reduzida->setAttrib('class', 'decimal');
		$this->vl_taxa_reduzida->setAttrib('maxlength', 3);
		$this->vl_taxa_reduzida->setLabel('Reduzida (%)');
		$this->addElement($this->vl_taxa_reduzida);

		$this->vl_percentual_subvencao_federal = $this->createElement('text', 'vl_percentual_subvencao_federal');
		$this->vl_percentual_subvencao_federal->setDecorators($this->elementDecorator);
		$this->vl_percentual_subvencao_federal->setRequired(false);
		$this->vl_percentual_subvencao_federal->setAttrib('class', 'decimal');
		$this->vl_percentual_subvencao_federal->setAttrib('maxlength', 3);
		$this->vl_percentual_subvencao_federal->setLabel('Subvenção Federal (%)');
		$this->addElement($this->vl_percentual_subvencao_federal);
	}
}
