CM
Duplicando Registro ao Salvar e erro não encontrado.
Boa noite galera.
Tenho um form que ao Salvar o registro ele simplesmente duplica e cria um novo.
Também ocorre um erro após alvar nesta linha: Notice: Undefined index: ComprasSub_list_quant in C:xampphtdocsadiantiourorioappcontrolourorioComprasForm.php on line 399
Segue o código, obrigado.
Tenho um form que ao Salvar o registro ele simplesmente duplica e cria um novo.
Também ocorre um erro após alvar nesta linha: Notice: Undefined index: ComprasSub_list_quant in C:xampphtdocsadiantiourorioappcontrolourorioComprasForm.php on line 399
Segue o código, obrigado.
- <?php
- <?php
- /**
- * ComprasForm Master/Detail
- * @author <your name here>
- */
- class ComprasFormNew extends TPage
- {
- protected $form; // form
- protected $detail_list;
- /**
- * Page constructor
- */
- public function __construct()
- {
- parent::__construct();
- // creates the form
- $this->form = new BootstrapFormBuilder('form_Compras');
- $this->form->setFormTitle('Compras');
- // master fields
- $id_compra = new THidden('id_compra');
- $data_compra = new TDate('data_compra');
- $tipo_compra_id = new TDBCombo('tipo_compra_id', 'ourorio', 'ComprasTipo', 'id_tipo_compra', 'descricao','descricao');
- $tipo_compra_txt = new TEntry('tipo_compra_txt');
- $kilate_id = new TDBCombo('kilate_id', 'ourorio', 'ComprasKilate', 'id_kilate', 'descricao_kilate','descricao_kilate');
- $kilate_txt = new TEntry('kilate_txt');
- $criteria = new TCriteria;
- $criteria->setProperty('order', 'nome_cliente');
- $cliente_id = new ">TDBSeekButton('cliente_id', 'ourorio', 'form_Compras', 'Clientes', 'nome_cliente', 'cliente_id', 'cliente_txt', $criteria);
- $cliente_txt = new TEntry('cliente_txt');
- $cliente_txt->setEditable(FALSE);
- $cliente_cep = new THidden('cliente_cep');
- $cliente_endereco_tipo = new THidden('cliente_endereco_tipo');
- $cliente_endereco = new THidden('cliente_endereco');
- $cliente_endereco_numero = new THidden('cliente_endereco_numero');
- $cliente_bairro = new THidden('cliente_bairro');
- $cliente_cidade = new THidden('cliente_cidade');
- $cliente_estado = new THidden('cliente_estado');
- $cliente_telefone = new THidden('cliente_telefone');
- $cliente_nascimento = new THidden('cliente_nascimento');
- $cliente_identidade = new THidden('cliente_identidade');
- $cliente_email = new THidden('cliente_email');
- $cliente_cpf = new THidden('cliente_cpf');
- $anexo_nf_joia_cliente = new TFile('anexo_nf_joia_cliente');
- $vendedor_txt = new THidden('vendedor_txt');
- $loja_id = new TEntry('loja_id');
- $loja_id = new THidden('loja_id');
- $loja_txt = new TEntry('loja_txt');
- $loja_txt = new THidden('loja_txt');
- $finalizada = new TEntry('finalizada');
- $movimento_fechado = new TEntry('movimento_fechado');
- $movimento_fechado_em = new TDate('movimento_fechado_em');
- //Campos Obrigatórios
- $cliente_id->addValidation('Cliente', new TRequiredValidator);
- $tipo_compra_id->addValidation('Tipo de Compra', new TRequiredValidator);
- $kilate_id->addValidation('Kilate', new TRequiredValidator);
- // define ação de saída do campo
- $cliente_id->setExitAction(new TAction(array($this, 'onExitCliente')));
- // máscara Master
- $data_compra ->setDatabaseMask('yyyy-mm-dd');
- $data_compra ->setMask('dd/mm/yyyy');
- $data_compra->setValue(date("Y-m-d"));
- $loja_id->setValue(TSession::getValue('userunitid')) ; //id da unidade
- $loja_id->setEditable(FALSE);
- $loja_txt->setValue(TSession::getValue('userunitname')); //nome da unidade
- $loja_txt->setEditable(FALSE);
- $vendedor_txt->setEditable(FALSE);
- $vendedor_txt->setValue(TSession::getValue('username')); //nome do usuário
- // detail fields
- $detail_uniqid = new THidden('detail_uniqid');
- $detail_id_automatico = new THidden('detail_id_automatico');
- $detail_quantidade = new TEntry('detail_quantidade');
- $detail_unidade = new TEntry('detail_unidade');
- $detail_descricao = new TEntry('detail_descricao');
- $detail_valor_unit = new TEntry('detail_valor_unit');
- $detail_subtotal = new TEntry('detail_subtotal');
- $detail_tipo_compra_id = new TDBCombo('detail_tipo_compra_id', 'ourorio', 'ComprasTipo', 'id_tipo_compra', 'descricao','descricao');
- $detail_kilate_id = new TDBCombo('detail_kilate_id', 'ourorio', 'ComprasKilate', 'id_kilate', 'descricao_kilate','descricao_kilate');
- // mascara detalhes
- $detail_descricao->forceUpperCase();
- $detail_unidade->setValue('GR');
- $detail_valor_unit->setNumericMask(2, ',', '.', true);
- $detail_subtotal->setNumericMask(2, ',', '.', true);
- if (!empty($id_compra))
- {
- $id_compra->setEditable(FALSE);
- }
- // master fields
- $row = $this->form->addFields( [new TLabel('Data')], [$data_compra] ,
- [new TLabel('ID')], [$cliente_id],
- [new TLabel('Cliente')], [$cliente_txt]);
- $row->layout = ['col-1','col-2','col-sm-1','col-2','col-sm-1','col-sm-5'];
- $row = $this->form->addFields( [new TLabel('Anexo N.F. Joia')], [$anexo_nf_joia_cliente],
- [new TLabel('Tipo')], [$tipo_compra_id],
- [new TLabel('Kilate')], [$kilate_id]);
- $row->layout = ['col-sm-1', 'col-sm-3','col-sm-1', 'col-sm-3','col-sm-1', 'col-sm-3'];
- $row = $this->form->addFields([new THidden('CEP')], [$cliente_cep],
- [new THidden('Tipo')], [$cliente_endereco_tipo],
- [new THidden('Endereço')], [$cliente_endereco],
- [new THidden('Numero')], [$cliente_endereco_numero],
- [new THidden('Bairro')], [$cliente_bairro],
- [new THidden('Cidade')], [$cliente_cidade],
- [new THidden('Estado')], [$cliente_estado],
- [new THidden('Telefone')], [$cliente_telefone],
- [new THidden('Nasc')], [$cliente_nascimento],
- [new THidden('Identidade')], [$cliente_identidade],
- [new THidden('Email')], [$cliente_email],
- [new THidden('CPF')], [$cliente_cpf],
- );
- $row->layout = ['col-sm-1','col-sm-2','col-sm-1','col-sm-2','col-sm-1','col-sm-2','col-sm-1','col-sm-4','col-sm-1','col-sm-2','col-sm-1', 'col-sm-2', 'col-sm-1','col-sm-2', 'col-sm-1','col-sm-2', 'col-sm-1','col-sm-2', 'col-sm-1','col-sm-2', 'col-sm-1','col-sm-2', 'col-sm-1','col-sm-2'];
- $row = $this->form->addFields([new THidden('Vendedor')], [$vendedor_txt] ,
- [new THidden('ID')], [$loja_id] ,
- [new THidden('Loja')], [$loja_txt]);
- $row->layout = ['col-sm-1', 'col-sm-3','col-sm-1', 'col-sm-3','col-sm-1','col-sm-3'];
- // detail fields
- $this->form->addContent( ['<h4>Item(s) da Compra</h4><hr>'] );
- $this->form->addFields( [$detail_uniqid] );
- $this->form->addFields( [$detail_id_automatico] );
- $row = $this->form->addFields( [new TLabel('quantidade')], [$detail_quantidade],
- [new TLabel('Produto')], [$detail_descricao],
- [new TLabel('Valor')], [$detail_valor_unit] );
- $row->layout = ['col-sm-1', 'col-sm-2','col-sm-1','col-sm-5','col-sm-1','col-sm-2'];
- $row = $this->form->addFields( [new TLabel('Unidade')], [$detail_unidade],
- [new TLabel('Tipo')], [$detail_tipo_compra_id],
- [new TLabel('Kilate')], [$detail_kilate_id],
- [new TLabel('Subtotal')], [$detail_subtotal] ,
- );
- $row->layout = ['col-sm-1', 'col-sm-2','col-sm-1','col-sm-2','col-sm-1','col-sm-2','col-sm-1','col-sm-2'];
- $add = TButton::create('add', [$this, 'onDetailAdd'], 'Register', 'fa:plus-circle green');
- $add->getAction()->setParameter('static','1');
- $this->form->addFields( [], [$add] );
- $this->detail_list = new BootstrapDatagridWrapper(new TDataGrid);
- $this->detail_list->setId('ComprasSub_list');
- $this->detail_list->generateHiddenFields();
- $this->detail_list->style = "min-width: 700px; width:100%;margin-bottom: 10px";
- // items
- $this->detail_list->addColumn( new TDataGridColumn('uniqid', 'Uniqid', 'center') )->setVisibility(false);
- $this->detail_list->addColumn( new TDataGridColumn('id_automatico', 'Id', 'center') )->setVisibility(false);
- $this->detail_list->addColumn( new TDataGridColumn('quant', 'Quant', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('descricao', 'Descricao', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('unidade', 'Unidade', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('valor_unit', 'Valor Unit', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('subtotal', 'Subtotal', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('tipo_compra_id', 'Tipo Compra Id', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('tipo_compra_txt', 'Tipo Compra Txt', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('kilate_id', 'Kilate Id', 'left', 100) );
- $this->detail_list->addColumn( new TDataGridColumn('kilate_txt', 'Kilate Txt', 'left', 100) );
- // detail actions
- $action1 = new TDataGridAction([$this, 'onDetailEdit'] );
- $action1->setFields( ['uniqid', '*'] );
- $action2 = new TDataGridAction([$this, 'onDetailDelete']);
- $action2->setField('uniqid');
- // add the actions to the datagrid
- $this->detail_list->addAction($action1, _t('Edit'), 'fa:edit blue');
- $this->detail_list->addAction($action2, _t('Delete'), 'far:trash-alt red');
- $this->detail_list->createModel();
- $panel = new TPanelGroup;
- $panel->add($this->detail_list);
- $panel->getBody()->style = 'overflow-x:auto';
- $this->form->addContent( [$panel] );
- $btn_gravar = $this->form->addAction( 'SALVAR', new TAction([$this, 'onSave'], ['static'=>'1']), 'fa:save white');
- $btn_gravar->class = 'btn btn-sm btn-primary';
- $btn_limpar = $this->form->addAction( 'LIMPAR', new TAction([$this, 'onClear']), 'fa:eraser white');
- $btn_limpar->class = 'btn btn-sm btn-danger';
- $btn_voltar = $this->form->addAction('VOLTAR',new TAction(array('ComprasList','onReload')),'far:arrow-alt-circle-left white');
- $btn_voltar->class = 'btn btn-sm btn-warning';
- //BOTÃO PARA GERAR PDF
- $btn_print = $this->form->addAction('RECIBO COMPRA', new TAction(array($this, 'OnPDF')),'far:arrow-alt-circle-left white');
- $btn_print->class = 'btn btn-sm btn-secondary';
- // create the page container
- $container = new TVBox;
- $container->style = 'width: 100%';
- // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
- $container->add($this->form);
- parent::add($container);
- }
- /**
- * Clear form
- * @param $param URL parameters
- */
- public function onClear($param)
- {
- $this->form->clear(TRUE);
- }
- /**
- * Add detail item
- * @param $param URL parameters
- */
- public function onDetailAdd( $param )
- {
- try
- {
- $this->form->validate();
- $data = $this->form->getData();
- /** validation sample
- if (empty($data->fieldX))
- {
- throw new Exception('The field fieldX is required');
- }
- **/
- $uniqid = !empty($data->detail_uniqid) ? $data->detail_uniqid : uniqid();
- $grid_data = [];
- $grid_data['uniqid'] = $uniqid;
- $grid_data['id_automatico'] = $data->detail_id_automatico;
- $grid_data['quant'] = $data->detail_quant;
- $grid_data['descricao'] = $data->detail_descricao;
- $grid_data['unidade'] = $data->detail_unidade;
- $grid_data['valor_unit'] = $data->detail_valor_unit;
- $grid_data['subtotal'] = $data->detail_subtotal;
- $grid_data['tipo_compra_id'] = $data->detail_tipo_compra_id;
- $grid_data['tipo_compra_txt'] = $data->detail_tipo_compra_txt;
- $grid_data['kilate_id'] = $data->detail_kilate_id;
- $grid_data['kilate_txt'] = $data->detail_kilate_txt;
- // insert row dynamically
- $row = $this->detail_list->addItem( (object) $grid_data );
- $row->id = $uniqid;
- TDataGrid::replaceRowById('ComprasSub_list', $uniqid, $row);
- // clear detail form fields
- $data->detail_uniqid = '';
- $data->detail_id_automatico = '';
- $data->detail_quant = '';
- $data->detail_descricao = '';
- $data->detail_unidade = '';
- $data->detail_valor_unit = '';
- $data->detail_subtotal = '';
- $data->detail_tipo_compra_id = '';
- $data->detail_tipo_compra_txt = '';
- $data->detail_kilate_id = '';
- $data->detail_kilate_txt = '';
- // send data, do not fire change/exit events
- TForm::sendData( 'form_Compras', $data, false, false );
- }
- catch (Exception $e)
- {
- $this->form->setData( $this->form->getData());
- new TMessage('error', $e->getMessage());
- }
- }
- /**
- * Edit detail item
- * @param $param URL parameters
- */
- public static function onDetailEdit( $param )
- {
- $data = new stdClass;
- $data->detail_uniqid = $param['uniqid'];
- $data->detail_id_automatico = $param['id_automatico'];
- $data->detail_quant = $param['quant'];
- $data->detail_descricao = $param['descricao'];
- $data->detail_unidade = $param['unidade'];
- $data->detail_valor_unit = $param['valor_unit'];
- $data->detail_subtotal = $param['subtotal'];
- $data->detail_tipo_compra_id = $param['tipo_compra_id'];
- $data->detail_tipo_compra_txt = $param['tipo_compra_txt'];
- $data->detail_kilate_id = $param['kilate_id'];
- $data->detail_kilate_txt = $param['kilate_txt'];
- // send data, do not fire change/exit events
- TForm::sendData( 'form_Compras', $data, false, false );
- }
- /**
- * Delete detail item
- * @param $param URL parameters
- */
- public static function onDetailDelete( $param )
- {
- // clear detail form fields
- $data = new stdClass;
- $data->detail_uniqid = '';
- $data->detail_id_automatico = '';
- $data->detail_quant = '';
- $data->detail_descricao = '';
- $data->detail_unidade = '';
- $data->detail_valor_unit = '';
- $data->detail_subtotal = '';
- $data->detail_tipo_compra_id = '';
- $data->detail_tipo_compra_txt = '';
- $data->detail_kilate_id = '';
- $data->detail_kilate_txt = '';
- // send data, do not fire change/exit events
- TForm::sendData( 'form_Compras', $data, false, false );
- // remove row
- TDataGrid::removeRowById('ComprasSub_list', $param['uniqid']);
- }
- /**
- * Load Master/Detail data from database to form
- */
- public function onEdit($param)
- {
- try
- {
- TTransaction::open('ourorio');
- if (isset($param['key']))
- {
- $key = $param['key'];
- $object = new Compras($key);
- $items = ComprasSub::where('compra_id', '=', $key)->load();
- foreach( $items as $item )
- {
- $item->uniqid = uniqid();
- $row = $this->detail_list->addItem( $item );
- $row->id = $item->uniqid;
- }
- $this->form->setData($object);
- TTransaction::close();
- }
- else
- {
- $this->form->clear(TRUE);
- }
- }
- catch (Exception $e) // in case of exception
- {
- new TMessage('error', $e->getMessage());
- TTransaction::rollback();
- }
- }
- /**
- * Save the Master/Detail data from form to database
- */
- public function onSave($param)
- {
- try
- {
- // open a transaction with database
- TTransaction::open('ourorio');
- $data = $this->form->getData();
- $this->form->validate();
- $master = new Compras;
- $master->fromArray( (array) $data);
- $master->store();
- ComprasSub::where('compra_id', '=', $master->id_compra)->delete();
- if( $param['ComprasSub_list_quant'] )
- {
- foreach( $param['ComprasSub_list_quant'] as $key => $item_id )
- {
- $detail = new ComprasSub;
- $detail->quant = $param['ComprasSub_list_quant'][$key];
- $detail->descricao = $param['ComprasSub_list_descricao'][$key];
- $detail->unidade = $param['ComprasSub_list_unidade'][$key];
- $detail->valor_unit = $param['ComprasSub_list_valor_unit'][$key];
- $detail->subtotal = $param['ComprasSub_list_subtotal'][$key];
- $detail->tipo_compra_id = $param['ComprasSub_list_tipo_compra_id'][$key];
- $detail->tipo_compra_txt = $param['ComprasSub_list_tipo_compra_txt'][$key];
- $detail->kilate_id = $param['ComprasSub_list_kilate_id'][$key];
- $detail->kilate_txt = $param['ComprasSub_list_kilate_txt'][$key];
- $detail->compra_id = $master->id_compra;
- $detail->store();
- }
- }
- TTransaction::close(); // close the transaction
- TForm::sendData('form_Compras', (object) ['id' => $master->id_compra]);
- TToast::show('success', 'Compra Registrada com Sucesso!', 'top left', 'far:check-circle' );
- //AdiantiCoreApplication::loadPage( 'ComprasList' );
- //exit;
- }
- catch (Exception $e) // in case of exception
- {
- new TMessage('error', $e->getMessage());
- $this->form->setData( $this->form->getData() ); // keep form data
- TTransaction::rollback();
- }
- }
- public function OnPDF($param)
- {
- $data = $this->form->getData();
- $data_compra2 = TDate::date2br($data->data_compra);
- $pdf = new TPDFDesigner;
- $pdf->fromXml('app/reports/recibo_compra_cliente.pdf.xml');
- $pdf->replace('{id_compra}',$data->id_compra);
- $pdf->replace('{data_compra}',$data->data_compra);
- $pdf->replace('{cliente_txt}',utf8_decode($data->cliente_txt));
- $pdf->replace('{endereco_tipo}',utf8_decode($data->cliente_endereco_tipo), 0, 0, 'L');
- $pdf->replace('{endereco_numero}',utf8_decode($data->cliente_endereco_numero), 0, 0, 'L');
- $pdf->replace('{endereco}',utf8_decode($data->cliente_endereco), 0, 0, 'L');
- $pdf->replace('{bairro}',utf8_decode($data->cliente_bairro), 0, 0, 'L');
- $pdf->replace('{cpf}',utf8_decode($data->cliente_cpf), 0, 0, 'L');
- $pdf->replace('{identidade}',utf8_decode($data->cliente_identidade), 0, 0, 'L');
- $pdf->replace('{telefone}',utf8_decode($data->cliente_telefone), 0, 0, 'L');
- $pdf->replace('{nascimento}',utf8_decode($data->cliente_nascimento), 0, 0, 'L');
- $pdf->replace('{cidade}',utf8_decode($data->cliente_cidade), 0, 0, 'L');
- $pdf->replace('{estado}',utf8_decode($data->cliente_estado), 0, 0, 'L');
- $pdf->replace('{email}',utf8_decode($data->cliente_email), 0, 0, 'L');
- $pdf->replace('{vendedor_txt}',utf8_decode($data->vendedor_txt));
- $pdf->replace('{loja_txt}',utf8_decode($data->loja_txt));
- $pdf->generate();
- //CABEÇALHO DETALHES
- $pdf->SetFont('Arial','B',10);
- $pdf->SetX(18);
- $pdf->SetFillColor(200, 200, 200);
- //$pdf->Cell(48, 22,'ITEM', 1, 0,'C', TRUE);
- $pdf->Cell(50, 22, utf8_decode('QUANT'), 1, 0,'C', TRUE);
- $pdf->Cell(300, 22, utf8_decode('PRODUTO'), 1, 0,'L', TRUE);
- $pdf->Cell(30, 22, utf8_decode('UND'), 1, 0,'C', TRUE);
- $pdf->Cell(70, 22, utf8_decode('VALOR UNT'), 1, 1,'R', TRUE);
- $pdf->Cell(70, 22, utf8_decode('SUBTOTAL'), 1, 1,'R', TRUE);
- // Itens do Pedido
- // inicio do rodapé
- $pdf->SetY(-12);
- $pdf->SetFont('Arial', '', 8);
- $pdf->setFontColorRGB( '#000000' );
- $pdf->Cell(590, 10, utf8_decode('Pág. ').$pdf->PageNo().' de {nb}',0,0,'R');
- $pdf->SetY(-12);
- $pdf->Cell(130, 10, utf8_decode('Sistema Gestor OuroRio © 2021 '),0,0,'R');
- $pdf->SetY(-12);
- $pdf->Cell(340,10,utf8_decode("Impresso em ".date("d/m/Y H:i:s"."")),0,1,'R');
- $pdf->SetY(-12);
- $pdf->Cell(420,10,utf8_decode(" Por ".TSession::getValue('username')),0,1,'R'); //nome do usuário
- // fim do rodapé
- $file = 'app/output/' .time(). '-Recibo.pdf';
- if (!file_exists($file) OR is_writable($file))
- {
- $pdf->save($file);
- //parent::openFile($file);
- $window = TWindow::create('Ouro Rio', 0.8, 0.8);
- $object = new TElement('object');
- $object->data = $file;
- $object->type = 'application/pdf';
- $object->style = "width: 100%; height:calc(100% - 10px)";
- $window->add($object);
- $window->show();
- }
- else
- {
- throw new Exception(_t('Permission denied') . ': ' . $file);
- }
- TToast::show('success','RECIBO GERADO COM SUCESSO!', 'top left', 'fas fa-check');
- TTransaction::close();
- AdiantiCoreApplication::loadPage( 'ComprasList' );
- exit;
- }
- // CÓDIGO PARA PASSAR VALORES DO CLIENTE AOS CAMPOS
- public static function onExitCliente($param)
- {
- $cliente_id = $param['cliente_id']; // get the product code
- try
- {
- TTransaction::open('ourorio');
- $cliente = new Clientes($cliente_id); // reads the product
- $obj = new StdClass;
- //$obj->detail_valor_unit = number_format($produto->valor_unit, 2, ',', '.');
- //$obj->detail_quantidade = 1;
- //$obj->detail_valor_total = number_format($produto->valor_unit, 2, ',', '.');
- $obj->cliente_cep = ($cliente->cep);
- $obj->cliente_endereco_tipo = ($cliente->endereco_tipo);
- $obj->cliente_endereco = ($cliente->endereco);
- $obj->cliente_endereco_numero = ($cliente->endereco_numero);
- $obj->cliente_bairro = ($cliente->bairro);
- $obj->cliente_cidade = ($cliente->cidade);
- $obj->cliente_estado = ($cliente->estado);
- $obj->cliente_telefone = ($cliente->telefone);
- $obj->cliente_nascimento = ($cliente->data_nascimento);
- $obj->cliente_identidade = ($cliente->identidade);
- $obj->cliente_email = ($cliente->email);
- $obj->cliente_cpf = ($cliente->cpf);
- TScript::create('setTimeout(function() { $("input[name=\'detail_quantidade\']").focus() }, 500);');
- TTransaction::close();
- TForm::sendData('form_Compras', $obj);
- }
- catch (Exception $e)
- {
- new TMessage('error', $e->getMessage());
- $this->form->setData( $this->form->getData() ); // keep form data
- TTransaction::rollback();
- }
- }
- }
- ?>
Você está criando o campo "id_compra", mas não está adicionando ao formulário. Dessa forma, ao salvar, esse valor vai como null e acaba sendo gravado como um novo registro.
Bom dia Nataniel.
Obrigado por sua dica. Resolveu.
Mas no meu tópico ficou a outra dúvida de erro nesta linha:
Notice: Undefined index: ComprasSub_list_quant in C:xampphtdocsadiantiourorioappcontrolourorioComprasForm.php on line 399
Que aqui neste post está na linha 391