<?php declare(strict_types=1);

class Relatorio_Form_Formidentificacaocredito extends Agro_Form
{
   public function init()
   {
      $usuario = Zend_Auth::getInstance()->getIdentity();

      if ($usuario->tp_usuario == 'C') {
         $this->addElement('text', 'cpf_cnpj', [
            'decorators' => $this->elementDecorator,
            'label' => 'CPF/CNPJ',
            'maxlength' => 18
         ]);
      }

      $safras = (new Produto_Model_Safras())->fetchPairs('id', 'ds_nome_safra', false, false, 1, false, false, 'DESC');
      $this->addElement('select', 'id_safra', [
         'decorators' => $this->elementDecorator,
         'MultiOptions' => $safras,
         'label' => 'Safra',
         'required' => true,
         'maxlength' => 18
      ]);

      $status = [
         Sinistro2_Model_Liquidacoes::ID_STATUS_AGUARDANDO_PAGAMENTO => 'Aguardando Pagamento',
         Sinistro2_Model_Liquidacoes::ID_STATUS_INDENIZACAO_PAGA => 'Indenização Paga',
         Sinistro2_Model_Liquidacoes::ID_STATUS_SEM_INDENIZACAO => 'Sem Indenização',
      ];

      $this->addElement('multiselect', 'id_status', [
         'decorators' => $this->elementDecorator,
         'MultiOptions' => $status,
         'label' => 'Status liquidação',
         'required' => true,
         'maxlength' => 18
      ]);
   }
}
