public function saveAction()
 {
     $columns = $this->_model->info(Zend_Db_Table_Abstract::COLS);
     $array = array();
     $this->_model->getAdapter()->beginTransaction();
     $message = '';
     // Declaração dos Render() do Zend para a Validação do Formulário
     $formRenders = array($this->_form->addElementsForm(), $this->_form->addElementsExistantStock(), $this->_form->addElementsStockControl());
     // Função que valida os Campos do Formulario com multiplos Render()
     parent::validateMultipleForm($formRenders);
     // <-----
     try {
         foreach ($this->_values as $id => $value) {
             if (isset($value) && $value != '' && in_array($id, $columns)) {
                 $array[$id] = addslashes($value);
             }
         }
         if ($this->_values['cdsupply'] != null) {
             $array['fgsupplycontrol'] = 1;
             if ($this->_values['cdsupplycentre'] != null && $this->_values['cdsupplier'] != null) {
                 date_default_timezone_set('UTC');
                 $supplystockModel = new SupplystockModel();
                 $arraySupplyStock = array();
                 $arraySupplyStock['cdsupply'] = $this->_values['cdsupply'];
                 $arraySupplyStock['cdsupplycentre'] = $this->_values['cdsupplycentre'];
                 $arraySupplyStock['cdsupplier'] = $this->_values['cdsupplier'];
                 $dtcheckin = date("Y-m-d") . " " . date("H:i");
                 $arraySupplyStock['dtcheckin'] = $dtcheckin;
                 if ($this->_values['vlsupplyunit'] != null) {
                     $vlunitprice = $this->_values['vlsupplyunit'];
                     $vlsupplytoDB = str_replace(" ", "", $vlunitprice);
                     $vlsupplytoDB = str_replace(",", ".", $vlsupplytoDB);
                     $vlsupplytoDB = str_replace("R\$", "", $vlsupplytoDB);
                     $arraySupplyStock['vlunitprice'] = $vlsupplytoDB;
                 }
                 if ($this->_values['nrsupplyquantity'] != null) {
                     $supplyModel = new SupplyModel();
                     $arraySupplyStock['qtquantity'] = $this->_values['nrsupplyquantity'];
                     $arraySupplyStock['qtsupplybalance'] = $this->_values['nrsupplyquantity'];
                     $qtdebalance = $supplyModel->fetchRow("cdsupply = " . $this->_values['cdsupply']);
                     $supplyModel->update(array("qtbalance" => $qtdebalance['qtbalance'] + $arraySupplyStock['qtsupplybalance']), "cdsupply = " . $this->_values['cdsupply']);
                 }
                 $supplystockModel->insert($arraySupplyStock);
             }
         } else {
             $array['fgsupplycontrol'] = 2;
         }
         $this->_model->insert($array);
         $message = "Cadastro realizado com sucesso.";
         $this->_model->getAdapter()->commit();
     } catch (Exception $e) {
         $this->_model->getAdapter()->rollBack();
         $message = '';
         $message = "Erro na operação.";
         $message = $e->getMessage();
     }
     $this->view->message = $message;
 }
 public function indexAction()
 {
     $this->_form->addAttributesForm($this->view->baseUrl . "/stock/stockview/index", "stockview_form", "post");
     $controllerName = $this->getRequest()->getControllerName();
     $actionName = $this->getRequest()->getActionName();
     $cdwindow = $this->getCdWindow($controllerName, $actionName);
     $buttonPrint = $this->_form->createButton("Hidden", "Impressões", "prints", $this->view->baseUrl . "/report/report/index/cdwindow/" . $cdwindow, "_self", "print_btn");
     $params = array("print_btn" => $buttonPrint);
     $this->_form->createFormToolbar(null, null, $params, null);
     $this->_form->addElementsForm();
     $this->view->form = $this->_form;
     $cdsupply = 0;
     $contSupplyStockInput = 0;
     $contSupplyStockOutput = 0;
     $contSupplyQuantity = 0;
     if (isset($_POST['cdsupply'])) {
         $array = $_POST;
         $dateInitialDate = new Zend_Date($array["initialDate"], 'dd-MM-YYYY HH:mm:ss');
         $array["initialDate"] = $dateInitialDate->toString('YYYY-MM-dd HH:mm:ss');
         $dateFinalDate = new Zend_Date($array["finalDate"], 'dd-MM-YYYY HH:mm:ss');
         $array["finalDate"] = $dateFinalDate->toString('YYYY-MM-dd HH:mm:ss');
         $supplystockModel = new SupplystockModel();
         $supplyModel = new SupplyModel();
         $cdsupply = $_POST['cdsupply'];
         $supplyQuantity = $supplyModel->fetchAll($supplyModel->getAllSupllyQuantityBySupply($cdsupply));
         $supplyStockInputSupply = $supplystockModel->fetchAll($supplystockModel->getTotalInputMovimentationFlowBySupply($array));
         $supplystockOutputSupply = $supplystockModel->fetchAll($supplystockModel->getTotalOutputMovimentationSupplyStock($array));
         foreach ($supplyStockInputSupply as $supplystockinput) {
             $contSupplyStockInput += $supplystockinput->numberInput;
         }
         foreach ($supplystockOutputSupply as $supplystockOutput) {
             $contSupplyStockOutput += $supplystockOutput->numberOutput;
         }
         foreach ($supplyQuantity as $supplystockquantity) {
             $contSupplyQuantity += $supplystockquantity->qtbalance;
         }
         $this->_form->setValues($_POST);
         $this->_form->addElementsForm();
         $this->view->form = $this->_form;
         if ($contSupplyStockInput == 0 || $contSupplyStockOutput == 0) {
             $this->addMessage("Nenhuma movimentação realizada neste item durante período selecionado.");
             $this->_redirect("/message/warning/param_module/stock/param_controller/stockview/param_action/index");
         }
     }
     $this->view->cdsupply = $cdsupply;
     $this->view->supplyQuantity = $contSupplyQuantity;
     $this->view->supplyStockIputSupply = $contSupplyStockInput;
     $this->view->supplystockOutputSupply = $contSupplyStockOutput;
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     $supplyModel = new SupplyModel();
     $supplyData = $supplyModel->fetchAll($supplyModel->getAllSuplly());
     $supplyCentre = new SupplycentreModel();
     $supplyCentreData = $supplyCentre->fetchAll($supplyCentre->getAllSupllyCentre());
     $this->_cdsupply = new Zend_Form_Element_Select('cdsupply');
     $this->_cdsupply->setRegisterInArrayValidator(false);
     $this->_cdsupply->addMultiOption("0", 'Selecione');
     foreach ($supplyData as $supply) {
         $this->_cdsupply->addMultiOption($supply->cdsupply, $supply->nmsupply);
     }
     $this->_cdsupply->setLabel("Item");
     $this->_cdsupply->setDecorators($this->_decoratorsDefault);
     $this->_cdsupply->setAttrib("id", "stockview_cdsupply");
     $this->_cdsupply->setAttrib("class", "search_combobox");
     $this->_cdsupply->setRequired(true);
     $this->_cdsupplycentre = new Zend_Form_Element_Select('cdsupplycentre');
     $this->_cdsupplycentre->setRegisterInArrayValidator(false);
     $this->_cdsupplycentre->addMultiOption("0", 'Selecione');
     foreach ($supplyCentreData as $supplyCentre) {
         $this->_cdsupplycentre->addMultiOption($supplyCentre->cdsupplycentre, $supplyCentre->idsupplycentre);
     }
     $this->_cdsupplycentre->setLabel("Centro");
     $this->_cdsupplycentre->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplycentre->setAttrib("id", "stockview_cdsupplycentre");
     $this->_cdsupplycentre->setAttrib("class", "search_combobox");
     $this->_cdsupplycentre->setRequired(true);
     $this->_initialDate = new Zend_Form_Element_Text('initialDate');
     $this->_initialDate->setLabel("Data Inicial");
     $this->_initialDate->setDecorators($this->_decoratorsRequired);
     $this->_initialDate->setAttrib("id", "stockview_initialDate");
     $this->_initialDate->setAttrib("class", "datepicker");
     $this->_initialDate->setRequired(true);
     $this->_finalDate = new Zend_Form_Element_Text('finalDate');
     $this->_finalDate->setLabel("Data Final");
     $this->_finalDate->setDecorators($this->_decoratorsRequired);
     $this->_finalDate->setAttrib("id", "stockview_finalDate");
     $this->_finalDate->setAttrib("class", "datepicker");
     $this->_finalDate->setRequired(true);
     $this->_submitservice = new Zend_Form_Element_Button('submitservice');
     $this->_submitservice->setLabel("Consultar");
     $this->_submitservice->setAttrib("id", "stockview_submitservice");
 }
Exemplo n.º 4
0
 public function alterAction()
 {
     $equipmentModel = new EquipmentModel();
     $documentModel = new DocumentModel();
     $supplyModel = new SupplyModel();
     $equipmentData = $equipmentModel->fetchAll($equipmentModel->getShortEquipmentData());
     $documentData = $documentModel->fetchAll($documentModel->getShortDocumentData());
     $supplyData = $supplyModel->fetchAll('cdsupply = "1"');
     $this->view->equipmentdata = $equipmentData;
     $this->view->documentdata = $documentData;
     $this->view->supplydata = $supplyData;
     $cdmethod = $this->_request->getParam("cdmethod");
     if (isset($cdmethod)) {
         $methodModel = new MethodModel();
         $dataMethod = $methodModel->fetchRow($methodModel->getMethodByCd($cdmethod));
         $this->view->dataMethod = $dataMethod;
     }
 }
 public function saveAction()
 {
     parent::saveAction();
     /* Instancia classe SupplyStock */
     $supplystockModel = new SupplystockModel();
     /* Instancia classe Supply */
     $supplyModel = new SupplyModel();
     /* Instancia classe SupplyFlow */
     $supplyflowModel = new SupplyflowModel();
     $supplies = json_decode($_GET['supply'], true);
     $i = 0;
     $supply = array();
     $supplystockModel->getAdapter()->beginTransaction();
     try {
         foreach ($supplies as $row) {
             $data = explode("-", $_POST['dtcheckout']);
             if ($row['dtexpires'] != "Indeterminado") {
                 $expire = explode("-", $row['dtexpires']);
             }
             $valor = substr($row['vlunitprice'], 2);
             /* Adiciona lista de Itens na SupplyStock */
             $supply[$i] = array('cdsupply' => $row['cdsupply'], 'qtquantity' => $row['qtquantity'], 'qtsupplybalance' => $row['qtquantity'], 'cdsupplycentre' => $_POST['cdsupplycentrefrom'], 'dtexpire' => $expire[2] . "-" . $expire[1] . "-" . $expire[0] . " 00:00:00", 'dtcheckin' => $data[2] . "-" . $data[1] . "-" . $data[0] . " " . $_POST['hrcheckin'] . ":00", 'cdsupplier' => $_POST['cdsupplyentrysupplier'], 'idinvoice' => $_POST['cdsupplyinvoice'], 'idbatch' => $_POST['cdsupplylot'], 'vlunitprice' => $valor);
             /* Insere registros na StockFlow */
             $supplyflow[$i] = array('cdsupply' => $row['cdsupply'], 'qtquantity' => $row['qtquantity'], 'cdsupplycentreto' => $_POST['cdsupplycentrefrom'], 'fgsupplyioreason' => '4', 'dtcheckin' => date("Y-m-d H:i:s"), 'dtcheckout' => date("Y-m-d H:i:s"), 'cdsupplycentrefrom' => null);
             /* Atualiza quantidade de itens na Supply */
             $dataSupplier = $supplyModel->fetchRow($supplyModel->getSupplyByCdSupply($row['cdsupply']));
             $dataSupplier['qtbalance'] = $dataSupplier['qtbalance'] + $row['qtquantity'];
             $array['qtbalance'] = $dataSupplier['qtbalance'];
             $supplyModel->update($array, 'cdsupply = ' . $row['cdsupply']);
             $supplystockModel->insert($supply[$i]);
             $supplyflowModel->insert($supplyflow[$i]);
             $i++;
         }
         $lastId = $supplystockModel->getAdapter()->lastInsertId();
         $message = "Cadastro efetuado com sucesso.<br>Número no Protocolo gerado: " . $lastId;
         $supplystockModel->getAdapter()->commit();
     } catch (Exception $e) {
         $supplystockModel->getAdapter()->rollBack();
         $message = "Erro na inserção dos dados.";
     }
     $this->view->message = $message;
 }
Exemplo n.º 6
0
 public function __construct()
 {
     parent::__construct();
     $supplyModel = new SupplycentreModel();
     //fetchaAll eesta buscando as informações no $suplyModel e enviando para o vetor
     $supplyDadosArray = $supplyModel->fetchAll();
     $supplyCentreModel = new SupplierModel();
     $supplyCentreDadosArray = $supplyCentreModel->fetchAll();
     $suppliesModel = new SupplyModel();
     $suppliesDadosArray = $suppliesModel->fetchAll();
     ///////////////
     $suppliesMUModel = new MeasurementUnitModel();
     $suppliesMUDadosArray = $suppliesMUModel->fetchAll();
     /* >>> Nº Protocolo */
     $this->_cdsupplyentryprotocol = new Zend_Form_Element_Text('cdsupplyentryprotocol');
     $this->_cdsupplyentryprotocol->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplyentryprotocol->setLabel("N° Protocolo");
     $this->_cdsupplyentryprotocol->setAttrib("id", "supplyentry_cdsupplyentryprotocol");
     $this->_cdsupplyentryprotocol->setAttrib("disabled", "disabled");
     /* <<< */
     /* >>> Código */
     $this->_rowId = new Zend_Form_Element_Hidden('rowId');
     $this->_rowId->setDecorators($this->_decoratorsDefault);
     $this->_rowId->setAttrib("id", "rowId");
     /* <<< */
     /* >>> Campo Oculto RowId */
     $this->_cdsupplyentrycode = new Zend_Form_Element_Hidden('cdsupplyentrycode');
     $this->_cdsupplyentrycode->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplyentrycode->setAttrib("id", "supplyentry_cdsupplyentrycode");
     /* <<< */
     /* >>> Fornecedor * */
     $this->_cdsupplyentrysupplier = new Zend_Form_Element_Select('cdsupplyentrysupplier');
     /////////////////////////////
     $this->_cdsupplyentrysupplier->addMultiOption("", "Selecione");
     //$this->_cdsupplyentrysupplier->setRequired(true);
     foreach ($supplyCentreDadosArray as $supplyCentreDado) {
         $this->_cdsupplyentrysupplier->addMultiOption($supplyCentreDado->cdsupplier, $supplyCentreDado->nmsupplier);
     }
     $this->_cdsupplyentrysupplier->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplyentrysupplier->setLabel("Fornecedor");
     $this->_cdsupplyentrysupplier->setAttrib("id", "supply_flow_cdsupplycentreto");
     //////////////////////////
     $this->_cdsupplyentrysupplier->setAttrib("class", "search_combobox");
     /* <<< */
     /* >>> Lote * */
     $this->_cdsupplyinvoice = new Zend_Form_Element_Text('cdsupplyinvoice');
     $this->_cdsupplyinvoice->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplyinvoice->setLabel("Nota Fiscal");
     $this->_cdsupplyinvoice->setAttrib("id", "supplyentry_cdsupplyinvoice");
     $this->_cdsupplyinvoice->setAttrib("size", "10");
     /* <<< */
     /* >>> Centro de Estocagem ou Consumo * */
     $this->_cdsupplycentrefrom = new Zend_Form_Element_Select('cdsupplycentrefrom');
     //$this->_cdsupplycentrefrom->setRequired(true);
     $this->_cdsupplycentrefrom->addMultiOption("", "Selecione");
     foreach ($supplyDadosArray as $supplyCentreDado) {
         $this->_cdsupplycentrefrom->addMultiOption($supplyCentreDado->cdsupplycentre, $supplyCentreDado->idsupplycentre);
     }
     $this->_cdsupplycentrefrom->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplycentrefrom->setLabel("Centro de Estocagem ou Consumo");
     $this->_cdsupplycentrefrom->setAttrib("id", "supply_flow_cdsupplycentrefrom");
     $this->_cdsupplycentrefrom->setAttrib("class", "search_combobox");
     /* <<< */
     /* >>> Data de Recebimento */
     $this->_dtcheckout = new Zend_Form_Element_Text('dtcheckout');
     $this->_dtcheckout->setLabel("Data de Recebimento");
     $this->_dtcheckout->setDecorators($this->_decoratorsDefault);
     $this->_dtcheckout->setAttrib("id", "supply_flow_dtcheckout");
     $this->_dtcheckout->setAttrib("class", "mask_date");
     $this->_dtcheckout->setAttrib("class", "datepicker");
     $this->_dtcheckout->setAttrib("size", "10");
     /* <<< */
     /* >>> Horário */
     $this->_hrcheckin = new Zend_Form_Element_Text('hrcheckin');
     $this->_hrcheckin->setLabel("Horário");
     $this->_hrcheckin->setDecorators($this->_decoratorsDefault);
     $this->_hrcheckin->setAttrib("id", "supply_flow_hrcheckin");
     $this->_hrcheckin->setAttrib("class", "mask_time");
     $this->_hrcheckin->setAttrib("size", "10");
     /* <<< */
     /* >>> Item */
     $this->_cdsupply = new Zend_Form_Element_Select('cdsupply');
     $this->_cdsupply->addMultiOption("", "Selecione");
     foreach ($suppliesDadosArray as $supplyCentreDado) {
         $this->_cdsupply->addMultiOption($supplyCentreDado->cdsupply, $supplyCentreDado->nmsupply);
     }
     $this->_cdsupply->setDecorators($this->_decoratorsDefault);
     $this->_cdsupply->setLabel("Item");
     $this->_cdsupply->setAttrib("id", "supply_flow_cdsupply");
     $this->_cdsupply->setAttrib("class", "search_combobox");
     /* <<< */
     /* >>> Quantidade */
     $this->_cdsupplyqty = new Zend_Form_Element_Text('cdsupplyqty');
     $this->_cdsupplyqty->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplyqty->setLabel("Quantidade");
     $this->_cdsupplyqty->setAttrib("id", "supplyentry_cdsupplyqty");
     $this->_cdsupplyqty->setAttrib("size", "10");
     $this->_cdsupplyqty->setAttrib("class", "mask_price_db");
     /* <<< */
     /* >>> Unidade Medida */
     $this->_cdsupplyunit = new Zend_Form_Element_Text('cdsupplyunit');
     $this->_cdsupplyunit->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplyunit->setLabel("Unidade Medida");
     $this->_cdsupplyunit->setAttrib("id", "supply_flow_cdsupplyunit");
     $this->_cdsupplyunit->setAttrib("size", "10");
     $this->_cdsupplyunit->setAttrib("disabled", "disabled");
     /* <<< */
     /* >>> Valor Unitário */
     $this->_cdsupplyvalue = new Zend_Form_Element_Text('cdsupplyvalue');
     $this->_cdsupplyvalue->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplyvalue->setLabel("Valor Unit. (R\$)");
     $this->_cdsupplyvalue->setAttrib("id", "supplyentry_cdsupplyvalue");
     $this->_cdsupplyvalue->setAttrib("size", "10");
     $this->_cdsupplyvalue->setAttrib("class", "mask_price_db");
     /* <<< */
     /* >>> Lote */
     $this->_cdsupplylot = new Zend_Form_Element_Text('cdsupplylot');
     $this->_cdsupplylot->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplylot->setLabel("Lote");
     $this->_cdsupplylot->setAttrib("id", "supplyentry_cdsupplylot");
     $this->_cdsupplylot->setAttrib("size", "10");
     /* <<< */
     /* >>> Validade */
     $this->_dtvalidity = new Zend_Form_Element_Text('dtvalidity');
     $this->_dtvalidity->setLabel("Validade");
     $this->_dtvalidity->setDecorators($this->_decoratorsDefault);
     $this->_dtvalidity->setAttrib("id", "supply_flow_dtvalidity");
     $this->_dtvalidity->setAttrib("class", "mask_date");
     $this->_dtvalidity->setAttrib("class", "datepicker");
     /* <<< */
     $this->_btadd = new Zend_Form_Element_Button('btadd');
     $this->_btadd->setLabel("Adicionar");
     $this->_btadd->setDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'li'))));
     $this->_btadd->setAttrib("class", "submit_button");
 }
Exemplo n.º 7
0
 public function __construct()
 {
     parent::__construct();
     $itemModel = new SupplyModel();
     $selectSupply = $itemModel->fetchAll();
     $userModel = new UserModel();
     $selectUser = $userModel->fetchAll();
     $userInfo = Zend_Auth::getInstance()->getStorage()->read();
     //Novas...
     $this->_cdopernature = new Zend_Form_Element_Select('cdopernature');
     $this->_cdopernature->setAttrib("id", "accountentry_cdopernature");
     $this->_cdopernature->setAttrib("class", "multiple_select");
     //     $this->_cdopernature->setMultiOptions(' ');
     $this->_cdopernature->setLabel("Natureza");
     $this->_cdopernature->setDecorators($this->_decoratorsDefault);
     $this->_cdopernature->setRegisterInArrayValidator(false);
     $this->_cdopernature->setRequired(false);
     $this->_cdsupply = new Zend_Form_Element_Select('cdsupply');
     $this->_cdsupply->setAttrib("id", "accountentry_cdsupply");
     $this->_cdsupply->setAttrib("class", "multiple_select");
     foreach ($selectSupply as $value) {
         $this->_cdsupply->addMultiOption($value->cdsupply, $value->nmsupply);
     }
     $this->_cdsupply->setLabel("Item");
     $this->_cdsupply->setDecorators($this->_decoratorsRequired);
     $this->_cdsupply->setRegisterInArrayValidator(false);
     $this->_cdsupply->setRequired(true);
     $this->_cdusergslab = new Zend_Form_Element_Select('cdusergslab');
     $this->_cdusergslab->setAttrib("id", "accountentry_cdusergslab");
     $this->_cdusergslab->setAttrib("class", "multiple_select");
     foreach ($selectUser as $value) {
         $this->_cdusergslab->addMultiOption($value->cdusergslab, $value->nmusergslab);
     }
     // $this->_cdusergslab->setValue($userInfo->nmusergslab);
     $this->_cdusergslab->setDecorators($this->_decoratorsDefault);
     $this->_cdusergslab->setRegisterInArrayValidator(false);
     $this->_cdusergslab->setRequired(false);
     $this->_dtdeadline = new Zend_Form_Element_Text('dtdeadline');
     $this->_dtdeadline->setAttrib("id", "accountentry_dtdeadline");
     $this->_dtdeadline->setAttrib("class", "datepicker");
     $this->_dtdeadline->setLabel("Data de Vencimento");
     $this->_dtdeadline->setDecorators($this->_decoratorsRequired);
     $this->_dtdeadline->setRequired(true);
     $this->_dtdeadline = new Zend_Form_Element_Text('dtentrydate');
     $this->_dtdeadline->setAttrib("id", "accountentry_dtentrydate");
     $this->_dtdeadline->setAttrib("class", "datepicker");
     $this->_dtdeadline->setDecorators($this->_decoratorsRequired);
     $this->_dtdeadline->setRequired(false);
     $this->_accountcheckusergslab = new Zend_Form_Element_Text('accountcheckusergslab');
     $this->_accountcheckusergslab->setAttrib("id", "accountentry__accountcheck_cdusergslab");
     $this->_accountcheckusergslab->setAttrib("class", "datepicker");
     $this->_accountcheckusergslab->setLabel("Data de Vencimento");
     $this->_accountcheckusergslab->setDecorators($this->_decoratorsRequired);
     $this->_accountcheckusergslab->setRequired(false);
     $this->_dtaccountentrydate = new Zend_Form_Element_Text('dtaccountentrydate');
     $this->_dtaccountentrydate->setAttrib("id", "accountentry_dtaccountentrydate");
     $this->_dtaccountentrydate->setAttrib("class", "datepicker");
     $this->_dtaccountentrydate->setLabel("Data de Lançamento");
     $this->_dtaccountentrydate->setDecorators($this->_decoratorsDefault);
     $this->_dtaccountentrydate->setRequired(false);
     $this->_dttransactiondate = new Zend_Form_Element_Text('dttransactiondate');
     $this->_dttransactiondate->setAttrib("id", "accountentry_dttransactiondate");
     $this->_dttransactiondate->setAttrib("class", "datepicker");
     $this->_dttransactiondate->setLabel("Data de Compra/Venda");
     $this->_dttransactiondate->setDecorators($this->_decoratorsRequired);
     $this->_dttransactiondate->setRequired(true);
     $this->_dtinvoicedate = new Zend_Form_Element_Text('dtinvoicedate');
     $this->_dtinvoicedate->setAttrib("id", "accountentry_dtinvoicedate");
     $this->_dtinvoicedate->setAttrib("class", "datepicker");
     $this->_dtinvoicedate->setLabel("Data da NF");
     $this->_dtinvoicedate->setDecorators($this->_decoratorsDefault);
     $this->_dtinvoicedate->setRequired(false);
     $this->_idinvoiceref = new Zend_Form_Element_Text('idinvoiceref');
     $this->_idinvoiceref->setAttrib("id", "accountentry_idinvoiceref");
     $this->_idinvoiceref->setLabel("Nota Fiscal");
     $this->_idinvoiceref->setDecorators($this->_decoratorsDefault);
     $this->_idinvoiceref->setRequired(false);
     $this->_nraccountentry = new Zend_Form_Element_Text('nraccountentry');
     $this->_nraccountentry->setAttrib("id", "accountentry_nraccountentry");
     $this->_nraccountentry->setLabel("Nº Fatura/Orçamento");
     $this->_nraccountentry->setDecorators($this->_decoratorsDefault);
     $this->_nraccountentry->setRequired(false);
     $this->_vlinvoicevalue = new Zend_Form_Element_Text('vlinvoicevalue');
     $this->_vlinvoicevalue->setAttrib("id", "accountentry_vlinvoicevalue");
     $this->_vlinvoicevalue->setLabel("Valor (R\$)");
     $this->_vlinvoicevalue->setDecorators($this->_decoratorsDefault);
     $this->_vlinvoicevalue->setRequired(false);
     $this->_cdclient = new Zend_Form_Element_Text('cdclient');
     $this->_cdclient->setAttrib("id", "accountentry_cdclient");
     $this->_cdclient->setLabel("Credor");
     $this->_cdclient->setDecorators($this->_decoratorsDefault);
     $this->_cdclient->setRequired(false);
     $this->_cdsupplier = new Zend_Form_Element_Text('cdsupplier');
     $this->_cdsupplier->setAttrib("id", "accountentry_cdsupplier");
     $this->_cdsupplier->setLabel("Favorecido");
     $this->_cdsupplier->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplier->setRequired(false);
     $this->_dsaccountentrydescription = new Zend_Form_Element_Textarea('dsaccountentrydescription');
     $this->_dsaccountentrydescription->setAttrib("id", "accountentry_dsaccountentrydescription");
     $this->_dsaccountentrydescription->setLabel("Descrição");
     $this->_dsaccountentrydescription->setRequired(false);
     $this->_dsaccountentrydescription->setAttrib('cols', '20');
     $this->_dsaccountentrydescription->setAttrib('rows', '20');
     $this->_dsaccountentrydescription->setDecorators($this->_decoratorsDefault);
     $this->_dsaccountentrydescription->setRequired(false);
     $this->_dtaccountcheckdate = new Zend_Form_Element_Text('dtaccountcheckdate');
     $this->_dtaccountcheckdate->setAttrib("id", "accountentry_dtaccountcheckdate");
     $this->_dtaccountcheckdate->setAttrib("class", "datepicker");
     $this->_dtaccountcheckdate->setLabel("Data da Baixa");
     $this->_dtaccountcheckdate->setDecorators($this->_decoratorsDefault);
     $this->_dtaccountcheckdate->setRequired(false);
     //        $this->_cdusergslab = new Zend_Form_Element_Select('cdusergslab');
     //        $this->_cdusergslab->setAttrib("id", "accountentry_cdusergslab");
     //        $this->_cdusergslab->setAttrib("class", "multiple_select");
     //        $this->_cdusergslab->setLabel("Usuário Responsável");
     //        $arrayUser['0'] = "Selecione";
     //        foreach ($selectUser as $userLog) {
     //            if ($userInfo->idusergslab == $userLog->idusergslab) {
     //                $arrayUser[$userLog->idusergslab] = $userLog->nmusergslab;
     //            }
     //            $arrayUser[$userLog->idusergslab] = $userLog->nmusergslab;
     //        }
     //        $this->_cdusergslab->setMultiOptions($arrayUser);
     //        $this->_cdusergslab->setValue($userInfo);
     //        $this->_cdusergslab->setDecorators($this->_decoratorsDefault);
     //        $this->_cdusergslab->setRegisterInArrayValidator(false);
     //        $this->_cdusergslab->setRequired(false);
     //        $this->_cdusergslab->setMultiOptions($arrayUser);
     //        $this->_cdusergslab->setValue($userInfo);
     //        $this->_cdusergslab->setDecorators($this->_decoratorsDefault);
     //        $this->_cdusergslab->setRegisterInArrayValidator(false);
     //        $this->_cdusergslab->setRequired(false);
     $this->_vlaccountcheckvalue = new Zend_Form_Element_Text('vlaccountcheckvalue');
     $this->_vlaccountcheckvalue->setAttrib("id", "accountentry_vlaccountcheckvalue");
     $this->_vlaccountcheckvalue->setLabel("Valor Baixa (R\$)");
     $this->_vlaccountcheckvalue->setDecorators($this->_decoratorsDefault);
     $this->_vlaccountcheckvalue->setRequired(false);
     $this->_vltotaltaxvalue = new Zend_Form_Element_Text('vltotaltaxvalue');
     $this->_vltotaltaxvalue->setAttrib("id", "accountentry_vltotaltaxvalue");
     $this->_vltotaltaxvalue->setLabel("Impostos");
     $this->_vltotaltaxvalue->setDecorators($this->_decoratorsDefault);
     $this->_vltotaltaxvalue->setRequired(false);
     $this->_vlnetvalue = new Zend_Form_Element_Text('vlnetvalue');
     $this->_vlnetvalue->setAttrib("id", "accountentry_vlnetvalue");
     $this->_vlnetvalue->setLabel("Valor Líquido");
     $this->_vlnetvalue->setDecorators($this->_decoratorsDefault);
     $this->_vlnetvalue->setRequired(false);
 }
 public function autosearchitemAction()
 {
     $this->_helper->viewRenderer->setNoRender(true);
     $nmitem = $this->_request->getParam('term');
     $itemModel = new SupplyModel();
     $itemData = $itemModel->fetchAll('nmsupply like "%' . $nmitem . '%"');
     $json = '[';
     $first = true;
     foreach ($itemData as $row) {
         $balance = explode('.', $row['qtbalance']);
         if (!$first) {
             $json .= ',';
         } else {
             $first = false;
         }
         $json .= '{"id":"' . $row['cdsupply'] . '", "value":"' . $row['nmsupply'] . '", "balance":"' . $balance[0] . '"}';
     }
     $json .= ']';
     echo $json;
 }
 public function autosupplysearchAction()
 {
     $supply = $this->_request->getParam('term');
     $supplyModel = new SupplyModel();
     $supplyData = $supplyModel->fetchAll('nmsupply like "%' . $supply . '%"');
     $json = '[';
     $first = true;
     foreach ($supplyData as $row) {
         if (!$first) {
             $json .= ',';
         } else {
             $first = false;
         }
         $json .= '{"id":"' . $row['cdsupply'] . '", "value":"' . $row['nmsupply'] . '", "vlchargeprice":"' . $row['vlchargeprice'] . '"}';
     }
     $json .= ']';
     echo $json;
 }
Exemplo n.º 10
0
 public function __construct()
 {
     parent::__construct();
     $measurementunitModel = new MeasurementunitModel();
     $measurementunitDadosArray = $measurementunitModel->fetchAll();
     $supplycentreModel = new SupplycentreModel();
     $supplycentreDadosArray = $supplycentreModel->fetchAll();
     $supplierModel = new SupplierModel();
     $supplierDadosArray = $supplierModel->fetchAll();
     $supplyModel = new SupplyModel();
     $supplyDados = $supplyModel->fetchAll($supplyModel->getSupplyNotInMedicine());
     //Cód. medicamento
     $this->_idmedicine = new Zend_Form_Element_Text('idmedicine');
     $this->_idmedicine->setLabel("Cód. Medicamento");
     $this->_idmedicine->setDecorators($this->_decoratorsRequired);
     $this->_idmedicine->setAttrib("size", "11");
     $this->_idmedicine->setRequired(true);
     //Nome/Descrição do Medicamento
     $this->_nmmedicine = new Zend_Form_Element_Text('nmmedicine');
     $this->_nmmedicine->setLabel("Nome/Descrição do Medicamento");
     $this->_nmmedicine->setDecorators($this->_decoratorsRequired);
     $this->_nmmedicine->setAttrib("id", "nmcenter");
     $this->_nmmedicine->setAttrib("size", "35");
     $this->_nmmedicine->setRequired(true);
     //Princípio Ativo
     $this->_nmactive = new Zend_Form_Element_text('nmactive');
     $this->_nmactive->setLabel("Princípio Ativo");
     $this->_nmactive->setDecorators($this->_decoratorsDefault);
     $this->_nmactive->setAttrib("size", "35");
     //Unidade de Medida
     $this->_cdmeasurementunit = new Zend_Form_Element_select('cdmeasurementunit');
     $this->_cdmeasurementunit->addMultiOption("", "Selecione");
     foreach ($measurementunitDadosArray as $measurementunitDado) {
         $this->_cdmeasurementunit->addMultiOption($measurementunitDado->cdmeasurementunit, $measurementunitDado->idnotation);
     }
     $this->_cdmeasurementunit->setLabel("Unidade de Medida");
     $this->_cdmeasurementunit->setDecorators($this->_decoratorsRequired);
     $this->_cdmeasurementunit->setAttrib("class", "search_combobox");
     $this->_cdmeasurementunit->setRequired(true);
     //Item do Estoque
     $this->_cdsupplymedicine = new Zend_Form_Element_select('cdsupply');
     $this->_cdsupplymedicine->addMultiOption("", "Selecione");
     foreach ($supplyDados as $supply) {
         $this->_cdsupplymedicine->addMultiOption($supply->cdsupply, $supply->nmsupply);
     }
     $this->_cdsupplymedicine->setLabel("Item");
     $this->_cdsupplymedicine->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplymedicine->setAttrib("id", "cdsupplymedicine");
     $this->_cdsupplymedicine->setAttrib("class", "search_combobox");
     //Quantidade do Item
     $this->_nrsupplyquantity = new Zend_Form_Element_text('nrsupplyquantity');
     $this->_nrsupplyquantity->setLabel("Quantidade");
     $this->_nrsupplyquantity->setDecorators($this->_decoratorsDefault);
     $this->_nrsupplyquantity->setAttrib("size", "10");
     $this->_nrsupplyquantity->setAttrib("disabled", "disabled");
     $this->_nrsupplyquantity->setAttrib("class", "numeric");
     //Valor da unidade
     $this->_vlsupplyunit = new Zend_Form_Element_text('vlsupplyunit');
     $this->_vlsupplyunit->setLabel("Valor Unit.");
     $this->_vlsupplyunit->setDecorators($this->_decoratorsDefault);
     $this->_vlsupplyunit->setAttrib("size", "10");
     $this->_vlsupplyunit->setAttrib("disabled", "disabled");
     $this->_vlsupplyunit->setAttrib("class", "mask_price");
     $this->_cdsupplycentre = new Zend_Form_Element_select('cdsupplycentre');
     $this->_cdsupplycentre->addMultiOption("", "Selecione");
     foreach ($supplycentreDadosArray as $supplycentre) {
         $this->_cdsupplycentre->addMultiOption($supplycentre->cdsupplycentre, $supplycentre->idsupplycentre);
     }
     $this->_cdsupplycentre->setLabel("Centro");
     $this->_cdsupplycentre->setDecorators($this->_decoratorsRequired);
     $this->_cdsupplycentre->setAttrib("class", "search_combobox");
     $this->_cdsupplier = new Zend_Form_Element_select('cdsupplier');
     $this->_cdsupplier->addMultiOption("", "Selecione");
     foreach ($supplierDadosArray as $supplier) {
         $this->_cdsupplier->addMultiOption($supplier->cdsupplier, $supplier->nmsupplier);
     }
     $this->_cdsupplier->setLabel("Fornecedor");
     $this->_cdsupplier->setDecorators($this->_decoratorsRequired);
     $this->_cdsupplier->setAttrib("class", "search_combobox");
 }
Exemplo n.º 11
0
 public function __construct()
 {
     parent::__construct();
     $supplyModel = new SupplyModel();
     $supplyDadosArray = $supplyModel->fetchAll();
     $supplyCentreModel = new SupplycentreModel();
     $supplyCentreDadosArray = $supplyCentreModel->fetchAll();
     /*>>> Origem(Centro Estocador)*/
     $this->_cdsupplycentrefrom = new Zend_Form_Element_Select('cdsupplycentrefrom');
     $this->_cdsupplycentrefrom->setRegisterInArrayValidator(false);
     $this->_cdsupplycentrefrom->setRequired(true);
     $this->_cdsupplycentrefrom->addMultiOption("", "Selecione");
     foreach ($supplyCentreDadosArray as $supplyCentreDado) {
         $this->_cdsupplycentrefrom->addMultiOption($supplyCentreDado->cdsupplycentre, $supplyCentreDado->idsupplycentre);
     }
     $this->_cdsupplycentrefrom->setDecorators($this->_decoratorsRequired);
     $this->_cdsupplycentrefrom->setLabel("Origem(Centro Estocador)");
     $this->_cdsupplycentrefrom->setAttrib("id", "supply_flow_cdsupplycentrefrom");
     /*<<<*/
     /*>>> Destino(Centro de Consumo)*/
     $this->_cdsupplycentreto = new Zend_Form_Element_Select('cdsupplycentreto');
     $this->_cdsupplycentreto->setRegisterInArrayValidator(false);
     $this->_cdsupplycentreto->addMultiOption("", "Selecione");
     $this->_cdsupplycentreto->setRequired(true);
     foreach ($supplyCentreDadosArray as $supplyCentreDado) {
         $this->_cdsupplycentreto->addMultiOption($supplyCentreDado->cdsupplycentre, $supplyCentreDado->idsupplycentre);
     }
     $this->_cdsupplycentreto->setDecorators($this->_decoratorsRequired);
     $this->_cdsupplycentreto->setLabel("Destino(Centro de Consumo)");
     $this->_cdsupplycentreto->setAttrib("id", "supply_flow_cdsupplycentreto");
     /*<<<*/
     /*>>> Tipo de Movimentação*/
     $this->_fgsupplyioreason = new Zend_Form_Element_Select('fgsupplyioreason');
     $this->_fgsupplyioreason->setRegisterInArrayValidator(false);
     $this->_fgsupplyioreason->addMultiOptions(array("" => "Selecione", "1" => "Consumo", "2" => "Empréstimo", "3" => "Devolução", "4" => "Estocagem", "5" => "Descarte"));
     $this->_fgsupplyioreason->setDecorators($this->_decoratorsRequired);
     $this->_fgsupplyioreason->setRequired(true);
     $this->_fgsupplyioreason->setLabel("Tipo de Movimentação");
     $this->_fgsupplyioreason->setAttrib("id", "supply_flow_fgsupplyioreason");
     /*<<<*/
     /*>>> Item*/
     $this->_cdsupply = new Zend_Form_Element_Select('cdsupply');
     $this->_cdsupply->setRegisterInArrayValidator(false);
     $this->_cdsupply->addMultiOption("", "Selecione");
     foreach ($supplyDadosArray as $supplyDado) {
         $this->_cdsupply->addMultiOption($supplyDado->cdsupply, $supplyDado->idsupply . " - " . $supplyDado->nmsupply);
     }
     $this->_cdsupply->setDecorators($this->_decoratorsRequired);
     $this->_cdsupply->setRequired(true);
     $this->_cdsupply->setLabel("Item");
     $this->_cdsupply->setAttrib("id", "supply_flow_cdsupply");
     $this->_cdsupply->setAttrib("class", "search_combobox");
     /*<<<*/
     /*>>> Item*/
     $this->_qtquantity = new Zend_Form_Element_Text('qtquantity');
     $this->_qtquantity->setLabel("Quantidade");
     $this->_qtquantity->setRequired(true);
     $this->_qtquantity->setDecorators($this->_decoratorsRequired);
     $this->_qtquantity->setAttrib("id", "supply_flow_qtquantity");
     $this->_qtquantity->setAttrib("class", "mask_decimal");
     /*<<<*/
     $this->_measurementunit = new Zend_Form_Element_Text('measurementunit');
     $this->_measurementunit->setLabel("Unidade de Medida");
     $this->_measurementunit->setDecorators($this->_decoratorsDefault);
     $this->_measurementunit->setAttrib("id", "supply_flow_measurementunit");
     $this->_measurementunit->setAttrib("disabled", "disabled");
     $this->_button_add_supply_flow = new Zend_Form_Element_Button('button_add_supply_flow');
     $this->_button_add_supply_flow->setLabel('Adicionar');
     $this->_button_add_supply_flow->setDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'li'))));
     $this->_button_add_supply_flow->setAttrib("class", "button_add_supply_flow");
     $this->_dtcheckout = new Zend_Form_Element_Text('dtcheckout');
     $this->_dtcheckout->setLabel("Data de Saída");
     $this->_dtcheckout->setDecorators($this->_decoratorsDefault);
     $this->_dtcheckout->setAttrib("id", "supply_flow_dtcheckout");
     $this->_dtcheckout->setAttrib("class", "mask_date");
     $this->_dtcheckout->setAttrib("class", "datepicker");
     $this->_dtcheckout_time = new Zend_Form_Element_Text('dtcheckout_time');
     $this->_dtcheckout_time->setLabel("Horário");
     $this->_dtcheckout_time->setDecorators($this->_decoratorsDefault);
     $this->_dtcheckout_time->setAttrib("id", "supply_flow_dtcheckout_time");
     $this->_dtcheckout_time->setAttrib("class", "mask_time");
     $this->_dtcheckin = new Zend_Form_Element_Text('dtcheckin');
     $this->_dtcheckin->setLabel("Data de Entrada");
     $this->_dtcheckin->setDecorators($this->_decoratorsDefault);
     $this->_dtcheckin->setAttrib("id", "supply_flow_dtcheckin");
     $this->_dtcheckin->setAttrib("class", "mask_date");
     $this->_dtcheckin->setAttrib("class", "datepicker");
     $this->_dtcheckin_time = new Zend_Form_Element_Text('dtcheckin_time');
     $this->_dtcheckin_time->setLabel("Horário");
     $this->_dtcheckin_time->setDecorators($this->_decoratorsDefault);
     $this->_dtcheckin_time->setAttrib("id", "supply_flow_dtcheckin_time");
     $this->_dtcheckin_time->setAttrib("class", "mask_time");
 }
 public function getsupplymeasurementunitAction()
 {
     $value = $this->_request->getParam('cdsupply');
     $supplyModel = new SupplyModel();
     $measurementunit = $supplyModel->fetchAll($supplyModel->getMeasurementUnit($value));
     $this->view->measurementunit = $measurementunit[0]['nmmeasurementunit'];
 }
 public function editAction()
 {
     $cdaccountentry = $this->_request->getParam('cdaccountentry');
     $accountentryopernatureData = $this->_model->fetchRow($this->_model->getAccountentryopernature($cdaccountentry));
     $accountentryModel = new AccountentryModel();
     $accountentryData = $accountentryModel->fetchRow($accountentryModel->getSupplyUserAccountEntryById($cdaccountentry));
     //   print_r($accountentryData['dttransactiondate']); die;
     $accountentrySupplierData = $accountentryModel->fetchRow($accountentryModel->getAccountEntrySupplierById($cdaccountentry));
     if ($accountentryData['cdclient'] != '' && $accountentryData['fgclienttype'] == 'a') {
         print_r('1');
         $clientData = $accountentryModel->fetchRow($accountentryModel->getClientByCdAccountentry($cdaccountentry));
         $cdclient = $clientData['cdclient'];
         $nmclient = $clientData['nmclient'];
         $cdsupplier = '';
         $nmsupplier = '';
     } else {
         if ($accountentryData['cdclient'] != '' && $accountentryData['fgclienttype'] == 'b') {
             print_r('2');
             $covenantModel = new CovenantModel();
             $covenantData = $covenantModel->fetchRow($covenantModel->getCovenantByCdClient($accountentryData['cdclient']));
             $cdclient = $covenantData['cdcovenant'];
             $nmclient = $covenantData['nmcovenant'];
             $cdsupplier = '';
             $nmsupplier = '';
         } else {
             if ($accountentryData['cdclient'] == '' && $accountentryData['cdsupplier'] == '') {
                 print_r('3');
                 $cdclient = '';
                 $nmclient = '';
                 $cdsupplier = '';
                 $nmsupplier = '';
             } else {
                 print_r('4');
                 $cdclient = '';
                 $nmclient = '';
                 $cdsupplier = $accountentrySupplierData['cdsupplier'];
                 $nmsupplier = $accountentrySupplierData['nmsupplier'];
             }
         }
     }
     $dtinvoicedate = $accountentryData['dtinvoicedate'];
     $dtinvoicedate = new Zend_Date($dtinvoicedate, 'YYYY-MM-dd');
     $dtinvoicedate = $dtinvoicedate->toString('dd-MM-YYYY');
     $dtdeadline = $accountentryData['dtdeadline'];
     $dtdeadline = new Zend_Date($dtdeadline, 'YYYY-MM-dd');
     $dtdeadline = $dtdeadline->toString('dd-MM-YYYY');
     $dttransactiondate = $accountentryData['dttransactiondate'];
     $dttransactiondate = new Zend_Date($dttransactiondate, 'YYYY-MM-dd');
     $dttransactiondate = $dttransactiondate->toString('dd-MM-YYYY');
     $dtentrydate = $accountentryData['dtentrydate'];
     $dtentrydate = new Zend_Date($dtentrydate, 'YYYY-MM-dd');
     $dtentrydate = $dtentrydate->toString('dd-MM-YYYY');
     $this->view->dtinvoicedate = $dtinvoicedate;
     $this->view->dtdeadline = $dtdeadline;
     $this->view->dttransactiondate = $dttransactiondate;
     $this->view->dtentrydate = $dtentrydate;
     $cdopernature = $accountentryopernatureData['cdopernature'];
     $nmopernature = $accountentryopernatureData['nmopernature'];
     if ($accountentryopernatureData['cdopernature'] != '') {
         $this->view->cdopernature = $cdopernature;
         $this->view->nmopernature = $nmopernature;
     } else {
         $this->view->cdopernature = '';
         $this->view->nmopernature = 'Selecione';
     }
     $this->view->cdclient = $cdclient;
     $this->view->nmclient = $nmclient;
     $this->view->cdsupplier = $cdsupplier;
     $this->view->nmsupplier = $nmsupplier;
     $this->view->accountentryData = $accountentryData;
     $this->view->cdaccountentry = $cdaccountentry;
     $supplyModel = new SupplyModel();
     $selectSupply = $supplyModel->fetchAll();
     $this->view->selectSupply = $selectSupply;
     $userInfo = Zend_Auth::getInstance()->getStorage()->read();
     $this->view->user = $userInfo->nmusergslab;
     $this->view->cduser = $userInfo->cdusergslab;
 }
Exemplo n.º 14
0
 public function __construct()
 {
     parent::__construct();
     $equipmentModel = new EquipmentModel();
     $documentModel = new DocumentModel();
     $supplyModel = new SupplyModel();
     $equipmentData = $equipmentModel->fetchAll($equipmentModel->getShortEquipmentData());
     $arrayEquipmentData = array();
     $arrayEquipmentData[0] = "Selecione";
     foreach ($equipmentData as $equipmentdata) {
         $arrayEquipmentData[$equipmentdata->cdequipment] = $equipmentdata->nmequipment;
     }
     $documentData = $documentModel->fetchAll($documentModel->getShortDocumentData());
     $arrayDocumentData = array();
     $arrayDocumentData[0] = "Selecione";
     foreach ($documentData as $documentdata) {
         $arrayDocumentData[$documentdata->cddocument] = $documentdata->nmdocument;
     }
     $supplyData = $supplyModel->fetchAll();
     $arraysupplyData = array();
     $arraysupplyData[0] = "Selecione";
     foreach ($supplyData as $supplydata) {
         $arraysupplyData[$supplydata->cdsupply] = $supplydata->nmsupply;
     }
     $this->_cdmethod = new Zend_Form_Element_Hidden('cdmethod');
     $this->_cdmethod->setAttrib("id", "method_cdmethod");
     //        $this->_cdmethod->setDecorators($this->_decoratorsDefault);
     $this->_cdmethod->setRequired(false);
     $this->_idmethod = new Zend_Form_Element_Text('idmethod');
     $this->_idmethod->setAttrib("id", "method_idmethod");
     $this->_idmethod->setAttrib("size", "15");
     $this->_idmethod->setLabel("ID do Método");
     $this->_idmethod->setDecorators($this->_decoratorsRequired);
     $this->_idmethod->setRequired(true);
     $this->_nmmethod = new Zend_Form_Element_Text('nmmethod');
     $this->_nmmethod->setAttrib("id", "method_nmmethod");
     $this->_nmmethod->setAttrib("size", "58");
     $this->_nmmethod->setLabel("Nome/Descrição do Método");
     $this->_nmmethod->setDecorators($this->_decoratorsRequired);
     $this->_nmmethod->setRequired(true);
     $this->_selectequipment = new Zend_Form_Element_Select('cdequipment');
     $this->_selectequipment->setAttrib("id", "method_select_equipment");
     $this->_selectequipment->setMultiOptions($arrayEquipmentData);
     $this->_selectequipment->setLabel("Equipamento");
     $this->_selectequipment->setDecorators($this->_decoratorsDefault);
     $this->_selectequipment->setRegisterInArrayValidator(true);
     $this->_selectequipment->setRequired(true);
     $this->_selectdocument = new Zend_Form_Element_Select('cddocument');
     $this->_selectdocument->setAttrib("id", "method_select_document");
     $this->_selectdocument->setMultiOptions($arrayDocumentData);
     $this->_selectdocument->setLabel("Documento Relacionado");
     $this->_selectdocument->setDecorators($this->_decoratorsDefault);
     $this->_selectdocument->setRegisterInArrayValidator(true);
     $this->_selectdocument->setRequired(true);
     $this->_samplesize = new Zend_Form_Element_Text('nrsamplesize');
     $this->_samplesize->setAttrib("id", "method_nmsamplesize");
     $this->_samplesize->setAttrib("size", "15");
     $this->_samplesize->setLabel("Tamanho do Ciclo");
     $this->_samplesize->setDecorators($this->_decoratorsDefault);
     $this->_samplesize->setRequired(false);
     $this->_procediment = new Zend_Form_Element_Textarea('dsmethodprocedure');
     $this->_procediment->setAttrib("id", "method_procediment");
     $this->_procediment->setLabel("Procedimento do Método");
     $this->_procediment->setDecorators($this->_decoratorsDefault);
     $this->_procediment->setRequired(false);
     //        $this->_procediment->setValue("boo");
     // Formulário da Grid
     $this->_typecenter = new Zend_Form_Element_Select('typecenter');
     $this->_typecenter->setAttrib("id", "methodsupply_select");
     $this->_typecenter->setMultiOptions($arraysupplyData);
     $this->_typecenter->setLabel("Item (Kit de Exame) ");
     $this->_typecenter->setDecorators($this->_decoratorsDefault);
     $this->_typecenter->setRegisterInArrayValidator(true);
     $this->_typecenter->setRequired(true);
     $this->_nrpriority = new Zend_Form_Element_Text('nrpriority');
     $this->_nrpriority->setAttrib("id", "methodsupply_nrpriority");
     $this->_nrpriority->setAttrib("size", "15");
     $this->_nrpriority->setLabel("Prioridade");
     $this->_nrpriority->setDecorators($this->_decoratorsDefault);
     $this->_nrpriority->setRequired(false);
 }
Exemplo n.º 15
0
 public function dadoseditAction()
 {
     $this->_helper->layout->disableLayout();
     $page = $this->_request->getParam("page", 1);
     $limit = $this->_request->getParam("rows");
     $sidx = $this->_request->getParam("sidx", 1);
     $sord = $this->_request->getParam("sord");
     $cdsupplier = $this->_request->getParam("cdsupplier");
     $filters = $this->_request->getParam("filters");
     $supply = new SupplyModel();
     $supplysuplierModel = new SupplysupplierModel();
     $supplysuplier = $supplysuplierModel->fetchAll("cdsupplier = " . $cdsupplier);
     $i = 0;
     foreach ($supplysuplier as $row) {
         $supply_nmitem = array();
         $supply_nmitem = $supply->fetchRow("cdsupply = " . $row->cdsupply);
         $responce->rows[$i]['cell'] = array($row->cdsupplysupplier, $row->cdsupply, $supply_nmitem["nmsupply"], $row->qtquantity, $row->vlunitprice);
         $i++;
     }
     $this->view->dadosedit = $responce;
 }
Exemplo n.º 16
0
 function dadosupplyAction()
 {
     $this->_helper->layout->disableLayout();
     $page = $this->_request->getParam("page", 1);
     $limit = $this->_request->getParam("rows");
     $sidx = $this->_request->getParam("sidx", 1);
     $sord = $this->_request->getParam("sord");
     $supplyModel = new SupplyModel();
     $supply = $supplyModel->fetchALL();
     $count = count($supply);
     if ($count > 0 && $limit > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $supply = $supplyModel->fetchALL($supplyModel->getAllSupplyGrid($sidx, $sord, $limit, $page));
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     foreach ($supply as $row) {
         $responce->rows[$i]['cdsupply'] = $row->cdsupply;
         $responce->rows[$i]['cell'] = array($row->nmsupply, $row->nmsupplytype, $row->idnotation, $row->cdsupply);
         $i++;
     }
     $this->view->dadosupply = $responce;
 }
Exemplo n.º 17
0
 public function __construct()
 {
     parent::__construct();
     $supplierModel = new SupplyModel();
     $supplierDadosArray = $supplierModel->fetchAll();
     $supplyModel = new SupplyModel();
     $stateModel = new StateModel();
     $nmsupply = array();
     $nmsupply[0] = 'Selecione';
     $suppliersupply = $supplyModel->getAllSuplly();
     foreach ($suppliersupply as $row) {
         $nmsupply[$row->cdsupply] = $row->nmsupply;
     }
     $state = array();
     $state[0] = 'Selecione';
     $supplierstate = $stateModel->fetchAll();
     foreach ($supplierstate as $row) {
         $state[$row->idstate] = $row->nmstate;
     }
     $this->_cdsupplier = new Zend_Form_Element_Text('cdsupplier');
     $this->_cdsupplier->setLabel('Código');
     $this->_cdsupplier->setAttrib("id", "supplier_cdsupplier");
     $this->_cdsupplier->setAttrib("maxlenght", "11");
     $this->_cdsupplier->setDecorators($this->_decoratorsRequired);
     $this->_cdsupplier->setRequired(true);
     $this->_nmsupplier = new Zend_Form_Element_Text('nmsupplier');
     $this->_nmsupplier->setLabel('Razão Social');
     $this->_nmsupplier->setAttrib("id", "supplier_nmsupplier");
     $this->_nmsupplier->setAttrib("maxlenght", "255");
     $this->_nmsupplier->setDecorators($this->_decoratorsRequired);
     $this->_nmsupplier->setRequired(true);
     $this->_nmfantasyname = new Zend_Form_Element_Text('nmfantasyname');
     $this->_nmfantasyname->setLabel('Nome Fantasia');
     $this->_nmfantasyname->setAttrib("id", "supplier_nmfantasyname");
     $this->_nmfantasyname->setAttrib("maxlenght", "255");
     $this->_nmfantasyname->setDecorators($this->_decoratorsRequired);
     $this->_nmfantasyname->setRequired(true);
     $this->_idcnpj = new Zend_Form_Element_Text('idcnpj');
     $this->_idcnpj->setLabel('CNPJ');
     $this->_idcnpj->setAttrib("id", "supplier_idcnpj");
     $this->_idcnpj->setAttrib("class", "mask_cnpj");
     $this->_idcnpj->setDecorators($this->_decoratorsRequired);
     $this->_idcnpj->addFilter(new Zend_Filter_Alnum());
     $this->_idcnpj->setRequired(false);
     $this->_idcep = new Zend_Form_Element_Text('idcep');
     $this->_idcep->setLabel('CEP');
     $this->_idcep->setAttrib("id", "supplier_idcep");
     $this->_idcep->setAttrib("maxlenght", "8");
     $this->_idcep->setDecorators($this->_decoratorsRequired);
     //$this->_idcep->setAttrib("class", "mask_cep");
     $this->_idcep->addFilter(new Zend_Filter_Alnum());
     $this->_nmstreet = new Zend_Form_Element_Text('nmstreet');
     $this->_nmstreet->setLabel('Endereço');
     $this->_nmstreet->setAttrib("id", "supplier_nmstreet");
     $this->_nmstreet->setAttrib("maxlenght", "290");
     $this->_nmstreet->setDecorators($this->_decoratorsRequired);
     $this->_nmstreet->setRequired(true);
     $this->_nrnumber = new Zend_Form_Element_Text('nrnumber');
     $this->_nrnumber->setLabel('Número');
     $this->_nrnumber->setAttrib("id", "supplier_nrnumber");
     $this->_nrnumber->setAttrib("maxlenght", "5");
     $this->_nrnumber->setAttrib("class", "numeric");
     $this->_nrnumber->setDecorators($this->_decoratorsDefault);
     $this->_nrnumber->setRequired(true);
     $this->_nmneighborhood = new Zend_Form_Element_Text('nmneighborhood');
     $this->_nmneighborhood->setLabel('Bairro');
     $this->_nmneighborhood->setAttrib("id", "supplier_nmneighborhood");
     $this->_nmneighborhood->setAttrib("maxlenght", "255");
     $this->_nmneighborhood->setAttrib("class", "alpha");
     $this->_nmneighborhood->setDecorators($this->_decoratorsRequired);
     $this->_nmneighborhood->setRequired(true);
     $this->_idcity = new Zend_Form_Element_Text('idcity');
     $this->_idcity->setLabel('Cidade');
     $this->_idcity->setAttrib("id", "supplier_idcity");
     $this->_idcity->setAttrib("maxlenght", "50");
     $this->_idcity->setDecorators($this->_decoratorsRequired);
     $this->_idcity->setRequired(true);
     $this->_idstate = new Zend_Form_Element_Select('idstate');
     $this->_idstate->setLabel('Estado');
     $this->_idstate->addMultiOptions($state);
     $this->_idstate->setAttrib("id", "supplier_idstate");
     $this->_idstate->setAttrib("maxlenght", "2");
     $this->_idstate->setDecorators($this->_decoratorsRequired);
     $this->_idstate->setRequired(true);
     $this->_nmkeyperson = new Zend_Form_Element_Text('nmkeyperson');
     $this->_nmkeyperson->setLabel('Vendedor (Contato Comercial)');
     $this->_nmkeyperson->setAttrib("id", "supplier_nmkeyperson");
     $this->_nmkeyperson->setAttrib("maxlenght", "11");
     $this->_nmkeyperson->setDecorators($this->_decoratorsRequired);
     $this->_nmkeyperson->setRequired(true);
     $this->_nrphone = new Zend_Form_Element_Text('nrphone');
     $this->_nrphone->setLabel('Telefone Comercial');
     $this->_nrphone->setAttrib("id", "supplier_nrphone");
     $this->_nrphone->setAttrib("class", "numeric");
     $this->_nrphone->setAttrib("maxlenght", "11");
     $this->_nrphone->setDecorators($this->_decoratorsRequired);
     $this->_nrphone->setRequired(true);
     $this->_nrcellphone = new Zend_Form_Element_Text('nrcellphone');
     $this->_nrcellphone->setLabel('Telefone Celular');
     $this->_nrcellphone->setAttrib("id", "supplier_nrcellphone");
     $this->_nrcellphone->setAttrib("maxlenght", "11");
     $this->_nrcellphone->setAttrib("class", "numeric");
     $this->_nrcellphone->setDecorators($this->_decoratorsDefault);
     $this->_nrcellphone->setRequired(true);
     $this->_nmsupply = new Zend_Form_Element_Select('nmsupply');
     $this->_nmsupply->setLabel('Nome');
     $this->_nmsupply->addMultiOption("", "Selecione");
     foreach ($supplierDadosArray as $supplierDado) {
         $this->_nmsupply->addMultiOption($supplierDado->cdsupply, $supplierDado->nmsupply);
     }
     $this->_nmsupply->setAttrib("id", "supplier_nmsupply");
     $this->_nmsupply->setAttrib("class", "search_combobox");
     $this->_nmsupply->setAttrib("maxlenght", "11");
     $this->_nmsupply->setDecorators($this->_decoratorsDefault);
     $this->_nmsupply->setRequired(true);
     $this->_qtquantitysupply = new Zend_Form_Element_Text('qtquantitysupply');
     $this->_qtquantitysupply->setLabel('Quantidade');
     $this->_qtquantitysupply->setAttrib("id", "supplier_qtquantitysupply");
     $this->_qtquantitysupply->setAttrib("maxlenght", "11");
     //        $this->_qtquantitysupply->setAttrib("class", "numeric");
     $this->_qtquantitysupply->setDecorators($this->_decoratorsDefault);
     $this->_qtquantitysupply->setRequired(true);
     $this->_vlunitsupply = new Zend_Form_Element_Text('vlunitsupply');
     $this->_vlunitsupply->setLabel('Preço Unitário (R$)');
     $this->_vlunitsupply->setAttrib("id", "supplier_vlunitsupply");
     $this->_vlunitsupply->setAttrib("maxlenght", "11");
     //        $this->_vlunitsupply->setAttrib("class", "numeric");
     $this->_vlunitsupply->setDecorators($this->_decoratorsDefault);
     $this->_vlunitsupply->setRequired(true);
     $this->_fgmanufacturer = new Zend_Form_Element_Checkbox('fgmanufacturer');
     $this->_fgmanufacturer->setLabel('Fabricante');
     $this->_fgmanufacturer->setAttrib("id", "supplier_fgmanufacturer");
     $this->_fgmanufacturer->setAttrib("value", "1");
     $this->_fgmanufacturer->setDecorators($this->_decoratorsDefault);
     $this->_fgmanufacturer->setRequired(true);
     $this->_assistance = new Zend_Form_Element_Checkbox('assistance');
     $this->_assistance->setLabel('Assistência');
     $this->_assistance->setAttrib("id", "supplier_assistance");
     $this->_assistance->setAttrib("value", "1");
     $this->_assistance->setDecorators($this->_decoratorsDefault);
     $this->_assistance->setRequired(true);
     $this->_includesupply = new Zend_Form_Element_Button('includesupply');
     $this->_includesupply->setLabel('Adicionar');
     $this->_includesupply->setAttrib("id", "supplier_includesupply");
     $this->_includesupply->setAttrib("maxlenght", "11");
     $this->_includesupply->setDecorators($this->_decoratorsDefault);
     $this->_includesupply->setRequired(true);
     $this->_includesupply = new Zend_Form_Element_Button('includesupply');
     $this->_includesupply->setLabel("Adicionar");
     $this->_includesupply->setDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'li'))));
     $this->_includesupply->setAttrib("class", "submit_button");
     $this->_includesupply->setAttrib("maxlenght", "11");
     $this->_includesupply->setAttrib("onClick", "jqGridSelect();");
 }