ET
Problema ao carregar dados em datagrid de um form mestre/detalhe
Boa tarde a todos,
Estou com um problema ao carregar os dados em um datagrid de um formulário mestre/detalhe para edição de cadastros.
O formulário mestre carrega os dados normalmente, a dificuldade está em carregar os dados no datagrid do formulário de detalhe.
Alguém poderia me ajudar? Desde já agradeço a atenção.
Segue código:
FORMULÁRIO MESTRE DETALHE:
MODEL DA TABELA CLIENTE:
MODEL DA TABELA DEPENDENTE:
MODEL DA TABELA STATUS DEPENDENTE:
Estou com um problema ao carregar os dados em um datagrid de um formulário mestre/detalhe para edição de cadastros.
O formulário mestre carrega os dados normalmente, a dificuldade está em carregar os dados no datagrid do formulário de detalhe.
Alguém poderia me ajudar? Desde já agradeço a atenção.
Segue código:
FORMULÁRIO MESTRE DETALHE:
- <?php
- /**
- * ClienteForm Form
- * @author <your name here>
- */
- class ClienteForm extends TPage
- {
- protected $form; // form
- use adianti\base\AdiantiMasterDetailTrait;
- /**
- * Form constructor
- * @param $param Request
- */
- public function __construct( $param )
- {
- parent::__construct();
- $this->form = new BootstrapFormBuilder('list_Cliente');
- $this->form->setFormTitle('Cliente');
- // master fields
- $id = new TEntry('id');
- $codigo_cliente = new TEntry('codigo_cliente');
- $data_cadastro = new TDate('data_cadastro');
- $nome = new TEntry('nome');
- $sexo_id = new TDBCombo('sexo_id', 'microerp', 'Sexo', 'id', '{sexo}','id asc');
- $rg = new TEntry('rg');
- $orgao_expeditor = new TEntry('orgao_expeditor');
- $cpf = new TEntry('cpf');
- $profissao = new TEntry('profissao');
- $religiao = new TEntry('religiao');
- $estado_civil = new TEntry('estado_civil');
- $data_nascimento = new TDate('data_nascimento');
- $idade = new TEntry('idade');
- $data_falecimento = new TDate('data_falecimento');
- $telefone_um = new TEntry('telefone_um');
- $telefone_dois = new TEntry('telefone_dois');
- $celular = new TEntry('celular');
- $uf_id = new TDBUniqueSearch('uf_id', 'microerp', 'Cidade', 'id', 'uf','id asc' );
- $cidade_id = new TDBUniqueSearch('cidade_id', 'microerp', 'Cidade', 'id', 'nome','id asc' );
- $area_id = new TDBCombo('area_id', 'microerp', 'Area', 'id', '{area}','id asc');
- $bairro_id = new TDBUniqueSearch('bairro_id', 'microerp', 'Cidade', 'id', 'bairro','id asc' );
- $numero = new TEntry('numero');
- $cep = new TEntry('cep');
- $referencia = new TEntry('referencia');
- $complemento = new TEntry('complemento');
- $data_admissao = new TDate('data_admissao');
- $data_carencia = new TDate('data_carencia');
- $primeiro_vencimento = new TDate('primeiro_vencimento');
- // detail fields
- $dependente_nome = new TEntry('dependente_nome');
- $dependente_data_admissao = new TDate('dependente_data_admissao');
- $dependente_data_carencia = new TDate('dependente_data_carencia');
- $status_dependente_id = new TDBCombo('status_dependente_id', 'microerp', 'StatusDependente', 'id', '{status_dependente}','id asc');
- $dependente_id = new THidden('dependente_id');
- $nome->addValidation('Nome', new TRequiredValidator());
- $sexo_id->addValidation('Sexo', new TRequiredValidator());
- $rg->addValidation('RG', new TRequiredValidator());
- $cpf->addValidation('CPF', new TRequiredValidator());
- $idade->addValidation('Idade', new TRequiredValidator());
- $uf_id->addValidation('UF', new TRequiredValidator());
- $cidade_id->addValidation('Cidade', new TRequiredValidator());
- $area_id->addValidation('Area', new TRequiredValidator());
- $bairro_id->addValidation('Bairro', new TRequiredValidator());
- $cep->addValidation('CEP', new TRequiredValidator());
- $uf_id->setMinLength(1);
- $cidade_id->setMinLength(2);
- $bairro_id->setMinLength(2);
- $cpf->setMaxLength(14);
- $rg->setMaxLength(20);
- $cep->setMaxLength(9);
- $telefone_um->setMaxLength(11);
- $telefone_dois->setMaxLength(11);
- $celular->setMaxLength(11);
- $numero->setMaxLength(4);
- $data_cadastro->setDatabaseMask('yyyy-mm-dd');
- $data_nascimento->setDatabaseMask('yyyy-mm-dd');
- $data_falecimento->setDatabaseMask('yyyy-mm-dd');
- $data_admissao->setDatabaseMask('yyyy-mm-dd');
- $data_carencia->setDatabaseMask('yyyy-mm-dd');
- $primeiro_vencimento->setDatabaseMask('yyyy-mm-dd');
- $data_cadastro->setMask('dd/mm/yyyy');
- $data_nascimento->setMask('dd/mm/yyyy');
- $data_falecimento->setMask('dd/mm/yyyy');
- $data_admissao->setMask('dd/mm/yyyy');
- $data_carencia->setMask('dd/mm/yyyy');
- $primeiro_vencimento->setMask('dd/mm/yyyy');
- $dependente_data_admissao->setDatabaseMask('yyyy-mm-dd');
- $dependente_data_carencia->setDatabaseMask('yyyy-mm-dd');
- $dependente_data_admissao->setMask('dd/mm/yyyy');
- $dependente_data_carencia->setMask('dd/mm/yyyy');
- $id->setEditable(false);
- $id->setSize(100);
- $codigo_cliente->setSize('72%');
- $data_cadastro->setSize('72%');
- $nome->setSize('72%');
- $sexo_id->setSize('10%');
- $rg->setSize('72%');
- $orgao_expeditor->setSize('70%');
- $cpf->setSize('72%');
- $profissao->setSize('70%');
- $religiao->setSize('72%');
- $estado_civil->setSize('70%');
- $data_nascimento->setSize('70%');
- $idade->setSize('70%');
- $data_falecimento->setSize('70%');
- $telefone_um->setSize('70%');
- $telefone_dois->setSize('70%');
- $celular->setSize('70%');
- $uf_id->setSize('70%');
- $cidade_id->setSize('72%');
- $area_id->setSize('72%');
- $bairro_id->setSize('72%');
- $numero->setSize('70%');
- $complemento->setSize('70%');
- $cep->setSize('70%');
- $referencia->setSize('70%');
- $data_admissao->setSize('70%');
- $data_carencia->setSize('70%');
- $primeiro_vencimento->setSize('70%');
- $id->setEditable(FALSE);
- $status_dependente_id->setSize(100);
- $dependente_nome->setSize('70%');
- $dependente_data_admissao->setSize('70%');
- $dependente_data_carencia->setSize('70%');
- $status_dependente_id->setSize('70%');
- // master fields
- $this->form->addFields([new TLabel('Id:')],[$id]);
- $this->form->addFields([new TLabel('Codigo Cliente:')],[$codigo_cliente], [new TLabel('Data Cadastro:')],[$data_cadastro]);
- $this->form->addFields([new TLabel('Nome:', '#ff0000')],[$nome], [new TLabel('Sexo:', '#ff0000')],[$sexo_id]);
- $this->form->addFields([new TLabel('RG:', '#ff0000')],[$rg], [new TLabel('Orgão Expeditor:')],[$orgao_expeditor]);
- $this->form->addFields([new TLabel('CPF:', '#ff0000')],[$cpf], [new TLabel('Profissão:')],[$profissao]);
- $this->form->addFields([new TLabel('Religião:')],[$religiao], [new TLabel('Estado Civil:')],[$estado_civil]);
- $this->form->addFields([new TLabel('Data Nascimento:')],[$data_nascimento], [new TLabel('Idade:', '#ff0000')],[$idade], [new TLabel('Data Falecimento:')],[$data_falecimento]);
- $this->form->addFields([new TLabel('Telefone 1:')],[$telefone_um], [new TLabel('Telefone 2:')],[$telefone_dois], [new TLabel('Celular:')],[$celular]);
- $this->form->addFields([new TLabel('UF:', '#ff0000')],[$uf_id], [new TLabel('Cidade:', '#ff0000')],[$cidade_id], [new TLabel('Área:', '#ff0000')],[$area_id]);
- $this->form->addFields([new TLabel('Bairro:', '#ff0000')],[$bairro_id], [new TLabel('Número:')],[$numero], [new TLabel('CEP:', '#ff0000')],[$cep]);
- $this->form->addFields([new TLabel('Complemento:')],[$complemento], [new TLabel('Referência:')],[$referencia]);
- $this->form->addFields([new TLabel('Data Admissão:')],[$data_admissao], [new TLabel('Data Carência:')],[$data_carencia], [new TLabel('Primeiro Vencimento:')],[$primeiro_vencimento]);
- // detail fields
- $this->form->addContent([new TFormSeparator('Dependentes', '#333333', '18', '#eeeeee')]);
- //$this->form->addFields([new TLabel('Id:')],[$id]);
- $this->form->addFields([new TLabel('Nome:')],[$dependente_nome]);
- $this->form->addFields([new TLabel('Data Admissão:')],[$dependente_data_admissao], [new TLabel('Data Carência:')],[$dependente_data_carencia]);
- $this->form->addFields([new TLabel('Status do Dependente:')],[$status_dependente_id]);
- $this->form->addFields([$dependente_id]);
- // add button
- $add_dependente = new TButton('add_dependente');
- $add_dependente->setAction(new TAction(array($this, 'onAddDependente')), 'Adicionar');
- $add_dependente->setImage('fa:plus #51c249');
- $this->form->addFields([$add_dependente]);
- // detail datagrid
- $this->item_dependente_list = new BootstrapDatagridWrapper(new TQuickGrid);
- $this->item_dependente_list->style = 'width:100%';
- $this->item_dependente_list->class .= ' table-bordered';
- $this->item_dependente_list->disableDefaultClick();
- $this->item_dependente_list->addQuickColumn('', 'edit', 'left', 50);
- $this->item_dependente_list->addQuickColumn('', 'delete', 'left', 50);
- $col_dependente_id = $this->item_dependente_list->addQuickColumn('Dependente', 'dependente_nome', 'left');
- $col_data_admissao = $this->item_dependente_list->addQuickColumn('Data Admissão', 'dependente_data_admissao', 'left');
- $col_data_carencia = $this->item_dependente_list->addQuickColumn('Data Carência', 'dependente_data_carencia', 'right');
- $col_status_dependente = $this->item_dependente_list->addQuickColumn('Status Dependente', 'status_dependente_id', 'right');
- $this->item_dependente_list->createModel();
- $this->form->addContent([$this->item_dependente_list]);
- // create the form actions
- $this->form->addAction('Salvar', new TAction([$this, 'onSave']), 'fa:floppy-o')->addStyleClass('btn-primary');
- $this->form->addAction('Limpar formulário', new TAction([$this, 'onClear']), 'fa:eraser #dd5a43');
- // vertical box container
- $container = new TVBox;
- $container->style = 'width: 100%';
- $container->class = 'form-container';
- $container->add(new TXMLBreadCrumb('menu.xml', 'ClienteList'));
- $container->add($this->form);
- parent::add($container);
- }
- /**
- * Adiciona dependente ao cliente
- * @param $param Request
- */
- public function onAddDependente( $param )
- {
- try
- {
- $data = $this->form->getData();
- if(!$data->dependente_nome)
- {
- throw new Exception(AdiantiCoreTranslator::translate('The field ^1 is required', 'Dependente'));
- }
- $item_dependente_items = TSession::getValue('item_dependente_items');
- $key = !empty($data->dependente_id) ? $data->dependente_id : uniqid();
- $fields = [];
- $fields['dependente_nome'] = $data->dependente_nome;
- $fields['dependente_data_admissao'] = $data->dependente_data_admissao;
- $fields['dependente_data_carencia'] = $data->dependente_data_carencia;
- $fields['status_dependente_id'] = $data->status_dependente_id;
- $item_dependente_items[ $key ] = $fields;
- TSession::setValue('item_dependente_items', $item_dependente_items);
- // limpa os campos do item do dependente
- $data->dependente_nome = '';
- $data->dependente_data_admissao = '';
- $data->dependente_data_carencia = '';
- $data->status_dependente_id = '';
- $data->dependente_id = '';
- $this->form->setData($data);
- $this->onReload( $param );
- }
- catch (Exception $e)
- {
- $this->form->setData( $this->form->getData());
- new TMessage('error', $e->getMessage());
- }
- }
- /**
- * Recarrega tudo
- * @param $param Request
- */
- public function onReload($params = null)
- {
- $this->loaded = TRUE;
- $this->onReloadDependenteItemDependente($params);
- }
- /**
- * Recarrega itens do dependente
- * @param $param Request
- */
- public function onReloadDependenteItemDependente( $param )
- {
- $items = TSession::getValue('item_dependente_items');
- $this->item_dependente_list->clear();
- if($items)
- {
- $cont = 1;
- foreach ($items as $key => $item)
- {
- $rowItem = new StdClass;
- $action_del = new TAction(array($this, 'onDeleteItemDependente'));
- $action_del->setParameter('item_dependente_id_row_id', $key);
- $action_edi = new TAction(array($this, 'onEditItemDependente'));
- $action_edi->setParameter('item_dependente_id_row_id', $key);
- $button_del = new TButton('delete_item_dependente'.$cont);
- $button_del->class = 'btn btn-default btn-sm';
- $button_del->setAction($action_del, '');
- $button_del->setImage('fa:trash-o');
- $button_del->setFormName($this->form->getName());
- $button_edi = new TButton('edit_item_dependente'.$cont);
- $button_edi->class = 'btn btn-default btn-sm';
- $button_edi->setAction($action_edi, '');
- $button_edi->setImage('bs:edit');
- $button_edi->setFormName($this->form->getName());
- $rowItem->edit = $button_edi;
- $rowItem->delete = $button_del;
- $rowItem->status_dependente_id = '';
- if (isset($item['status_dependente_id']) && $item['status_dependente_id'])
- {
- TTransaction::open('microerp');
- $statusdependente = StatusDependente::find($item['status_dependente_id']);
- $rowItem->status_dependente_id = $statusdependente->render('{status_dependente}');
- TTransaction::close();
- }
- $rowItem->dependente_nome = isset($item['dependente_nome']) ? $item['dependente_nome'] : '';
- $rowItem->dependente_data_admissao = isset($item['dependente_data_admissao']) ? $item['dependente_data_admissao'] : '';
- $rowItem->dependente_data_carencia = isset($item['dependente_data_carencia']) ? $item['dependente_data_carencia'] : '';
- $rowItem->status_dependente_id = isset($item['status_dependente_id']) ? $item['status_dependente_id'] : '';
- $this->item_dependente_list->addItem($rowItem);
- $cont ++;
- }
- }
- }
- /**
- * Edita item dependente
- * @param $param Request
- */
- public function onEditItemDependente( $param )
- {
- $data = $this->form->getData();
- // read session items
- $items = TSession::getValue('item_dependente_items');
- // get the session item
- $item = $items[$param['item_dependente_id_row_id']];
- $data->dependente_nome = $item['dependente_nome'];
- $data->dependente_data_admissao = $item['dependente_data_admissao'];
- $data->dependente_data_carencia = $item['dependente_data_carencia'];
- $data->status_dependente_id = $item['status_dependente_id'];
- $data->dependente_id = $param['item_dependente_id_row_id'];
- // fill product fields
- $this->form->setData( $data );
- $this->onReload( $param );
- }
- /**
- * Exclui item do pedido
- * @param $param Request
- */
- public function onDeleteItemDependente( $param )
- {
- $data = $this->form->getData();
- $data->dependente_nome = '';
- $data->dependente_data_admissao = '';
- $data->dependente_data_carencia = '';
- $data->status_dependente_id = '';
- $this->form->setData( $data );
- // read session items
- $items = TSession::getValue('item_dependente_items');
- // delete the item from session
- unset($items[$param['item_dependente_id_row_id']]);
- TSession::setValue('item_dependente_items', $items);
- $this->onReload( $param );
- }
- /**
- * Limpa formulário
- * @param $param Request
- */
- public function onClear( $param )
- {
- $this->form->clear();
- TSession::setValue('item_dependente_items', null);
- $this->onReload();
- }
- /**
- * Salva registro
- * @param $param Request
- */
- public function onSave($param = null)
- {
- try
- {
- TTransaction::open('microerp');
- $this->form->validate();
- $data = $this->form->getData();
- $object = new Cliente;
- $object->fromArray( (array) $data);
- $object->store();
- $this->storeItems('Dependente', 'cliente_id', $object, 'item_dependente',
- function($masterObject, $detailObject) {
- });
- $object->store();
- $data->id = $object->id;
- $this->form->setData($data);
- TTransaction::close();
- new TMessage('info', AdiantiCoreTranslator::translate('Record saved'));
- }
- catch (Exception $e)
- {
- new TMessage('error', $e->getMessage());
- $this->form->setData( $this->form->getData() );
- TTransaction::rollback();
- }
- }
- /**
- * Edita formulário
- * @param $param Request
- */
- public function onEdit( $param )
- {
- try
- {
- if (isset($param['key']))
- {
- $key = $param['key'];
- TTransaction::open('microerp');
- $object = new Cliente($key);
- $this->loadItems('Dependente', 'cliente_id', $object, 'item_dependente');
- $this->form->setData($object);
- $this->onReload();
- TTransaction::close();
- }
- else
- {
- $this->form->clear();
- }
- }
- catch (Exception $e)
- {
- new TMessage('error', $e->getMessage());
- TTransaction::rollback();
- }
- }
- /**
- * Exibe a página
- * @param $param Request
- */
- public function show()
- {
- if (!$this->loaded AND (!isset($_GET['method']) OR $_GET['method'] !== 'onReload') )
- {
- $this->onReload( func_get_arg(0) );
- }
- parent::show();
- }
- }
- ?>
MODEL DA TABELA CLIENTE:
- <?php
- class Cliente extends TRecord
- {
- const TABLENAME = 'cliente';
- const PRIMARYKEY = 'id';
- const IDPOLICY = 'serial'; // {max, serial}
- /**
- * Constructor method
- */
- public function __construct($id = NULL, $callObjectLoad = TRUE)
- {
- parent::__construct($id, $callObjectLoad);
- parent::addAttribute('codigo_cliente');
- parent::addAttribute('data_cadastro');
- parent::addAttribute('nome');
- parent::addAttribute('sexo_id');
- parent::addAttribute('rg');
- parent::addAttribute('orgao_expeditor');
- parent::addAttribute('cpf');
- parent::addAttribute('profissao');
- parent::addAttribute('religiao');
- parent::addAttribute('estado_civil');
- parent::addAttribute('data_nascimento');
- parent::addAttribute('idade');
- parent::addAttribute('data_falecimento');
- parent::addAttribute('telefone_um');
- parent::addAttribute('telefone_dois');
- parent::addAttribute('celular');
- parent::addAttribute('uf_id');
- parent::addAttribute('cidade_id');
- parent::addAttribute('bairro_id');
- parent::addAttribute('numero');
- parent::addAttribute('complemento');
- parent::addAttribute('cep');
- parent::addAttribute('referencia');
- parent::addAttribute('data_admissao');
- parent::addAttribute('data_carencia');
- parent::addAttribute('primeiro_vencimento');
- parent::addAttribute('area_id');
- }
- /**
- * Method set_status_dependente
- * Sample of usage: $var->area = $object;
- * @param $object Instance of Cidade
- */
- public function set_area(Area $object)
- {
- $this->area = $object;
- $this->area_id = $object->id;
- }
- /**
- * Method get_status_dependente
- * Sample of usage: $var->area->attribute;
- * @returns Cidade instance
- */
- public function get_area()
- {
- // loads the associated object
- if (empty($this->area))
- $this->area = new Area($this->area_id);
- // returns the associated object
- return $this->area;
- }
- /**
- * Method set_status_dependente
- * Sample of usage: $var->sexo = $object;
- * @param $object Instance of Cidade
- */
- public function set_sexo(Sexo $object)
- {
- $this->sexo = $object;
- $this->sexo_id = $object->id;
- }
- /**
- * Method get_status_dependente
- * Sample of usage: $var->sexo->attribute;
- * @returns Cidade instance
- */
- public function get_sexo()
- {
- // loads the associated object
- if (empty($this->sexo))
- $this->sexo = new Sexo($this->sexo_id);
- // returns the associated object
- return $this->sexo;
- }
- /**
- * Method set_uf
- * Sample of usage: $var->uf = $object;
- * @param $object Instance of Cidade
- */
- public function set_uf(Cidade $object)
- {
- $this->uf = $object;
- $this->uf_id = $object->id;
- }
- /**
- * Method get_uf
- * Sample of usage: $var->uf->attribute;
- * @returns Cidade instance
- */
- public function get_uf()
- {
- // loads the associated object
- if (empty($this->uf))
- $this->uf = new Cidade($this->uf_id);
- // returns the associated object
- return $this->uf;
- }
- /**
- * Method set_cidade
- * Sample of usage: $var->cidade = $object;
- * @param $object Instance of Cidade
- */
- public function set_cidade(Cidade $object)
- {
- $this->cidade = $object;
- $this->cidade_id = $object->id;
- }
- /**
- * Method get_cidade
- * Sample of usage: $var->cidade->attribute;
- * @returns Cidade instance
- */
- public function get_cidade()
- {
- // loads the associated object
- if (empty($this->cidade))
- $this->cidade = new Cidade($this->cidade_id);
- // returns the associated object
- return $this->cidade;
- }
- /**
- * Method set_bairro
- * Sample of usage: $var->bairro = $object;
- * @param $object Instance of Cidade
- */
- public function set_bairro(Cidade $object)
- {
- $this->bairro = $object;
- $this->bairro_id = $object->id;
- }
- /**
- * Method get_uf
- * Sample of usage: $var->bairro->attribute;
- * @returns Cidade instance
- */
- public function get_bairro()
- {
- // loads the associated object
- if (empty($this->bairro))
- $this->bairro = new Cidade($this->bairro_id);
- // returns the associated object
- return $this->bairro;
- }
- }
- ?>
MODEL DA TABELA DEPENDENTE:
- <?php
- class Dependente extends TRecord
- {
- const TABLENAME = 'dependente';
- const PRIMARYKEY = 'dependente_id';
- const IDPOLICY = 'serial'; // {max, serial}
- /**
- * Constructor method
- */
- public function __construct($id = NULL, $callObjectLoad = TRUE)
- {
- parent::__construct($dependente_id, $callObjectLoad);
- parent::addAttribute('dependente_nome');
- parent::addAttribute('dependente_data_admissao');
- parent::addAttribute('dependente_data_carencia');
- parent::addAttribute('cliente_id');
- parent::addAttribute('status_dependente_id');
- }
- /**
- * Method set_cliente
- * Sample of usage: $var->cliente = $object;
- * @param $object Instance of Cidade
- */
- public function set_cliente(Cliente $object)
- {
- $this->cliente = $object;
- $this->cliente_id = $object->id;
- }
- /**
- * Method public function get_cliente()
- * Sample of usage: $var->cliente->attribute;
- * @returns Cidade instance
- */
- public function get_cliente()
- {
- // loads the associated object
- if (empty($this->cliente))
- $this->cliente = new Cliente($this->cliente_id);
- // returns the associated object
- return $this->cliente;
- }
- /**
- * Method set_status_dependente
- * Sample of usage: $var->status_dependente = $object;
- * @param $object Instance of Cidade
- */
- public function set_status_dependente(StatusDependente $object)
- {
- $this->status_dependente = $object;
- $this->status_dependente_id = $object->id;
- }
- /**
- * Method get_status_dependente
- * Sample of usage: $var->status_dependente->attribute;
- * @returns Cidade instance
- */
- public function get_status_dependente()
- {
- // loads the associated object
- if (empty($this->status_dependente))
- $this->status_dependente = new StatusDependente($this->status_dependente_id);
- // returns the associated object
- return $this->status_dependente;
- }
- }
- ?>
MODEL DA TABELA STATUS DEPENDENTE:
- <?php
- class StatusDependente extends TRecord
- {
- const TABLENAME = 'status_dependente';
- const PRIMARYKEY = 'id';
- const IDPOLICY = 'serial'; // {max, serial}
- /**
- * Constructor method
- */
- public function __construct($id = NULL, $callObjectLoad = TRUE)
- {
- parent::__construct($id, $callObjectLoad);
- parent::addAttribute('status_dependente');
- }
- }
- ?>
Tem algumas diferenças entre o nome dos campos e os identificadores de sessão. Ex:
Sugiro criar esse mestre x detalhe pelo Studio e comparar com o atual para encontrar as diferenças
OK, deu certo Nataniel. Obrigado.