Não atualiza o valor total da nota na exclusão do ultimo item ...
GG
Não atualiza o valor total da nota na exclusão do ultimo item  
 
  1. <?php
  2. /**
  3. * Pedido_compraForm Master/Detail
  4. * @author <your name here>
  5. */
  6. class Pedido_compraForm extends TPage
  7. {
  8. protected $form; // form
  9. protected $formFields;
  10. protected $detail_list;
  11. /**
  12. * Page constructor
  13. */
  14. public function __construct()
  15. {
  16. parent::__construct();
  17. // creates the form
  18. $this->form = new TForm('form_Pedido_compra');
  19. $this->form->class = 'tform'; // CSS class
  20. $this->form->style = 'max-width:2500px'; // style
  21. $vbox = new TVBox;
  22. $vbox->style = 'width: 100%';
  23. parent::include_css('app/resources/custom-frame.css');
  24. $table_master = new TTable;
  25. $table_master->width = '100%';
  26. $table_master->addRowSet( new TLabel('Pedido de compra'), '', '')->class = 'tformtitle';
  27. // add a table inside form
  28. $table_general = new TTable;
  29. $table_detail = new TTable;
  30. $table_general-> width = '100%';
  31. $table_detail-> width = '100%';
  32. $frame_general = new TFrame;
  33. $frame_general->setLegend('Capa');
  34. $frame_general->style = 'background:whiteSmoke';
  35. $frame_general->add($table_general);
  36. $frame_general-> width = '100%';
  37. $table_master->addRow()->addCell( $frame_general )->colspan=2;
  38. $row = $table_master->addRow();
  39. $row->addCell( $table_detail );
  40. $this->form->add($table_master);
  41. // master fields
  42. $id = new TEntry('id');
  43. $fornecedor_id = new ">TDBSeekButton('fornecedor_id', 'erpweb',$this->form->getName(), 'Fornecedor','pessoa->nome', 'fornecedor_id', 'fornecedor_nome');
  44. $condicao_pagamento_id = new TDBCombo('condicao_pagamento_id', 'erpweb', 'Condicao_pagamento', 'id', 'descricao');
  45. $fornecedor_nome = new TEntry('fornecedor_nome');
  46. $data_compra = new TDate('data_compra');
  47. $observacao = new TText('observacao');
  48. $estoque_interno = new TRadioGroup('estoque_interno');
  49. $situacao = new TRadioGroup('situacao');
  50. $valor_total = new TEntry('valor_total');
  51. $valor_desconto = new TEntry('valor_desconto');
  52. $valor_tota_liquido = new TEntry('valor_tota_liquido');
  53. $valor_desconto->setExitAction(new TAction(array($this,'onValorDescontoChange')));
  54. $items = array();
  55. $items['1'] ='Sim';
  56. $items['0'] ='Nao';
  57. $estoque_interno->addItems($items);
  58. $situacao->setLayout('horizontal');
  59. $items = array();
  60. $items['0'] ='Em aberto';
  61. $items['1'] ='Em andamento';
  62. $items['2'] ='Atendido';
  63. $items['3'] ='Cancelado';
  64. $situacao->addItems($items);
  65. if (!empty($id))
  66. {
  67. $id->setEditable(FALSE);
  68. }
  69. $id->setSize('5%');
  70. $fornecedor_id->setSize('30%');
  71. $fornecedor_nome->setSize('150%');
  72. $fornecedor_nome->setEditable(false);
  73. $data_compra->setValue(date("Y-m-d"));
  74. $valor_total->setEditable(FALSE);
  75. $valor_tota_liquido->setEditable(FALSE);
  76. $valor_total->setNumericMask(2, ',','.',true);
  77. $valor_tota_liquido->setNumericMask(2, ',','.',true);
  78. $valor_desconto->setNumericMask(2, ',','.',true);
  79. // detail fields
  80. $detail_id = new THidden('detail_id');
  81. $detail_qtde = new TEntry('detail_qtde');
  82. $detail_qtde_bonificada = new TEntry('detail_qtde_bonificada');
  83. $detail_valor_item = new TEntry('detail_valor_item');
  84. $detail_valor_total_item = new TEntry('detail_valor_total_item');
  85. $detail_produto_id = new ">TDBSeekButton('detail_produto_id', 'erpweb',$this->form->getName(), 'Produto','descricao', 'detail_produto_id', 'detail_produto_nome');
  86. $detail_produto_nome = new TEntry('detail_produto_nome');
  87. $detail_qtde->setNumericMask(3, ',','.',true);
  88. $detail_qtde_bonificada->setNumericMask(3, ',','.',true);
  89. $detail_valor_item->setNumericMask(2, ',','.',true);
  90. $detail_valor_total_item->setNumericMask(2, ',','.',true);
  91. $detail_produto_id->setSize(50,'100%');
  92. $detail_valor_total_item->setEditable(FALSE);
  93. $detail_produto_id->setExitAction(new TAction(array($this,'onProductChange')));
  94. $detail_qtde_bonificada->setExitAction(new TAction(array($this,'onQtdebonificadaChange')));
  95. $detail_produto_nome->setEditable(false);
  96. /** samples
  97. $this->form->addQuickFields('Date', array($date1, new TLabel('to'), $date2)); // side by side fields
  98. $fieldX->addValidation( 'Field X', new TRequiredValidator ); // add validation
  99. $fieldX->setSize( 100, 40 ); // set size
  100. **/
  101. // master
  102. $table_general->addRowSet( new TLabel('Id'), $id );
  103. $table_general->addRowSet( new TLabel('Data de Compra'), $data_compra );
  104. $table_general->addRowSet( $label_fornecedor = new TLabel('Fornecedor (*)'), array( $fornecedor_id, $fornecedor_nome ) );
  105. $table_general->addRowSet( new TLabel('Condicao de Pagamento (*)'), $condicao_pagamento_id );
  106. $table_general->addRowSet( new TLabel('Estoque Interno'), $estoque_interno );
  107. $table_general->addRowSet( new TLabel('Situação'), $situacao );
  108. $table_general->addRowSet( new TLabel('Valor Total'), $valor_total );
  109. $table_general->addRowSet( new TLabel('Valor Desconto'), $valor_desconto );
  110. $table_general->addRowSet( new TLabel('Valor Total Liquido'), $valor_tota_liquido );
  111. $table_general->addRowSet( new TLabel('Observação'), $observacao );
  112. // detail
  113. $frame_details = new TFrame();
  114. $frame_details->setLegend('Ítens');
  115. $row = $table_detail->addRow();
  116. $row->addCell($frame_details);
  117. $frame_details-> width = '30%';
  118. $vbox->add( $frame_general );
  119. $vbox->add( $frame_details );
  120. $vbox-> width = '30%';
  121. $btn_save_detail = new TButton('btn_save_detail');
  122. $btn_save_detail->setAction(new TAction(array($this, 'onSaveDetail')), 'Adicionar');
  123. $btn_save_detail->setImage('fa:save');
  124. $table_details = new TTable;
  125. $frame_details->add($table_details);
  126. $table_details-> width = '30%';
  127. $table_details->addRowSet( '', $detail_id );
  128. $table_details->addRowSet( new TLabel('Produto (*)'), array( $detail_produto_id, $detail_produto_nome ) );
  129. $table_details->addRowSet( new TLabel('Qtde'), $detail_qtde );
  130. $table_details->addRowSet( new TLabel('Qtde Bonificada'), $detail_qtde_bonificada );
  131. $table_details->addRowSet( new TLabel('Valor Item'), $detail_valor_item );
  132. $table_details->addRowSet( new TLabel('Valor Total Item'), $detail_valor_total_item );
  133. $table_details->addRowSet( $btn_save_detail );
  134. $this->detail_list = new TQuickGrid;
  135. $this->detail_list->setHeight( 200 );
  136. $this->detail_list->makeScrollable();
  137. $this->detail_list->disableDefaultClick();
  138. $this->detail_list->addQuickColumn('', 'edit', 'left', 60);
  139. $this->detail_list->addQuickColumn('', 'delete', 'left', 60);
  140. // items
  141. $this->detail_list->style = "margin-bottom: 10px";
  142. $this->detail_list->addQuickColumn('Id', 'produto_id', 'center', 50);
  143. $this->detail_list->addQuickColumn('Produto', 'produto_nome', 'left', 200);
  144. $qt = $this->detail_list->addQuickColumn('Qtde', 'qtde', 'left', 200);
  145. $qb = $this->detail_list->addQuickColumn('Qtde Bonificada', 'qtde_bonificada', 'left', 200);
  146. $pr = $this->detail_list->addQuickColumn('Valor Item', 'valor_item', 'left', 200);
  147. $st = $this->detail_list->addQuickColumn('Valor Total Item', 'valor_total_item', 'left', 200);
  148. $this->detail_list->createModel();
  149. $vbox->add( $this->detail_list );
  150. $format_value = function($value) {
  151. if (is_numeric($value)) {
  152. return 'R$ '.number_format($value, 2, ',', '.');
  153. }
  154. return $value;
  155. };
  156. $format_qtde = function($value) {
  157. if (is_numeric($value)) {
  158. return number_format($value, 3, ',', '.');
  159. }
  160. return $value;
  161. };
  162. $pr->setTransformer( $format_value );
  163. $st->setTransformer( $format_value );
  164. $qt->setTransformer( $format_qtde );
  165. $qb->setTransformer( $format_qtde );
  166. $st->setTotalFunction( function($values) {
  167. return array_sum((array) $values);
  168. });
  169. $row = $table_detail->addRow();
  170. $row->addCell($this->detail_list);
  171. // create an action button (save)
  172. $save_button=new TButton('save');
  173. $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
  174. $save_button->setImage('ico_save.png');
  175. // create an new button (edit with no parameters)
  176. $new_button=new TButton('new');
  177. $new_button->setAction(new TAction(array($this, 'onClear')), _t('New'));
  178. $new_button->setImage('ico_new.png');
  179. // define form fields
  180. $this->formFields = array($id,$data_compra,$valor_total,$valor_desconto,$valor_tota_liquido,$observacao,$estoque_interno,$situacao,$fornecedor_id,$fornecedor_nome,$condicao_pagamento_id,$detail_qtde,$detail_qtde_bonificada,$detail_valor_item,$detail_valor_total_item,$detail_produto_id,$detail_produto_nome);
  181. $this->formFields[] = $btn_save_detail;
  182. $this->formFields[] = $save_button;
  183. $this->formFields[] = $new_button;
  184. $this->formFields[] = $detail_id;
  185. $this->form->setFields( $this->formFields );
  186. $table_master->addRowSet( array($save_button, $new_button), '', '')->class = 'tformaction'; // CSS class
  187. // create the page container
  188. $container = new TVBox;
  189. $container->style = 'width: 100%';
  190. // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
  191. $container->add($this->form);
  192. parent::add($container);
  193. }
  194. public function onLoad($param)
  195. {
  196. $data = new stdClass;
  197. $data->fornecedor_id = $param['fornecedor_id'];
  198. $data->fornecedor_nome = $param['fornecedor_nome'];
  199. $this->form->setData($data);
  200. }
  201. static function onValorDescontoChange( $params )
  202. {
  203. if( isset($params['valor_total']) && $params['valor_total'] )
  204. {
  205. try
  206. {
  207. TTransaction::open('erpweb');
  208. $fill_data = new StdClass;
  209. $fill_data->valor_tota_liquido = number_format((double) str_replace(',', '.',$params['valor_total']) - (double) str_replace(',', '.',$params['valor_desconto']), 2, ',', '.' );
  210. TForm::sendData('form_Pedido_compra', $fill_data);
  211. TTransaction::close();
  212. }
  213. catch (Exception $e) // in case of exception
  214. {
  215. new TMessage('error', '<b>Error</b> ' . $e->getMessage());
  216. TTransaction::rollback();
  217. }
  218. }
  219. else
  220. {
  221. $fill_data = new StdClass;
  222. TForm::sendData('form_Pedido_compra', $fill_data);
  223. TTransaction::close();
  224. }
  225. }
  226. static function onProductChange( $params )
  227. {
  228. if( isset($params['detail_produto_id']) && $params['detail_produto_id'] )
  229. {
  230. try
  231. {
  232. TTransaction::open('erpweb');
  233. $produto = new Produto($params['detail_produto_id']);
  234. $fill_data = new StdClass;
  235. $fill_data->detail_valor_item = number_format($produto->valor_unitario_venda, 2, ',','.');
  236. $fill_data->detail_qtde_bonificada = '';
  237. $fill_data->detail_qtde = '';
  238. $fill_data->detail_valor_total_item = '';
  239. TForm::sendData('form_Pedido_compra', $fill_data);
  240. TTransaction::close();
  241. }
  242. catch (Exception $e) // in case of exception
  243. {
  244. new TMessage('error', '<b>Error</b> ' . $e->getMessage());
  245. TTransaction::rollback();
  246. }
  247. }
  248. else
  249. {
  250. $fill_data = new StdClass;
  251. $fill_data->detail_valor_item = null;
  252. $fill_data->detail_produto_nome = null;
  253. TForm::sendData('form_Pedido_compra', $fill_data);
  254. TTransaction::close();
  255. }
  256. }
  257. static function onQtdebonificadaChange( $params )
  258. {
  259. if( isset($params['detail_produto_id']) && $params['detail_produto_id'] )
  260. {
  261. try
  262. {
  263. TTransaction::open('erpweb');
  264. $produto = new Produto($params['detail_produto_id']);
  265. $fill_data = new StdClass;
  266. $fill_data->detail_valor_total_item = number_format((((double) str_replace(',', '.',$params['detail_qtde']) - (double) str_replace(',', '.',$params['detail_qtde_bonificada']) ) * (double) str_replace(',', '.',$params['detail_valor_item'])), 2, ',', '.');
  267. TForm::sendData('form_Pedido_compra', $fill_data);
  268. TTransaction::close();
  269. }
  270. catch (Exception $e) // in case of exception
  271. {
  272. new TMessage('error', '<b>Error</b> ' . $e->getMessage());
  273. TTransaction::rollback();
  274. }
  275. }
  276. else
  277. {
  278. $fill_data = new StdClass;
  279. $fill_data->detail_valor_item = null;
  280. $fill_data->detail_produto_nome = null;
  281. TForm::sendData('form_Pedido_compra', $fill_data);
  282. TTransaction::close();
  283. }
  284. }
  285. /**
  286. * Clear form
  287. * @param $param URL parameters
  288. */
  289. public function onClear($param)
  290. {
  291. $this->form->clear(TRUE);
  292. TSession::setValue(__CLASS__.'_items', array());
  293. $this->onReload( $param );
  294. }
  295. /**
  296. * Save an item from form to session list
  297. * @param $param URL parameters
  298. */
  299. public function onSaveDetail( $param )
  300. {
  301. try
  302. {
  303. TTransaction::open('erpweb');
  304. $data = $this->form->getData();
  305. /** validation sample
  306. if (! $data->fieldX)
  307. throw new Exception('The field fieldX is required');
  308. **/
  309. $items = TSession::getValue(__CLASS__.'_items');
  310. $key = empty($data->detail_id) ? 'X'.mt_rand(1000000000, 1999999999) : $data->detail_id;
  311. $items[ $key ] = array();
  312. $items[ $key ]['id'] = $key;
  313. $items[ $key ]['qtde'] = $data->detail_qtde;
  314. $items[ $key ]['qtde_bonificada'] = $data->detail_qtde_bonificada;
  315. $items[ $key ]['valor_item'] = $data->detail_valor_item;
  316. $items[ $key ]['valor_total_item'] = $data->detail_valor_total_item;
  317. $items[ $key ]['produto_id'] = $data->detail_produto_id;
  318. $items[ $key ]['produto_nome'] = $data->detail_produto_nome;
  319. TSession::setValue(__CLASS__.'_items', $items);
  320. // clear detail form fields
  321. $data->detail_id = '';
  322. $data->detail_qtde = '';
  323. $data->detail_qtde_bonificada = '';
  324. $data->detail_valor_item = '';
  325. $data->detail_valor_total_item = '';
  326. $data->detail_produto_id = '';
  327. $data->detail_produto_nome = '';
  328. $this->form->setData($data);
  329. TTransaction::close();
  330. $this->onReload( $param ); // reload the items
  331. }
  332. catch (Exception $e)
  333. {
  334. $this->form->setData( $this->form->getData());
  335. new TMessage('error', $e->getMessage());
  336. }
  337. }
  338. /**
  339. * Load an item from session list to detail form
  340. * @param $param URL parameters
  341. */
  342. public function onEditDetail( $param )
  343. {
  344. $data = $this->form->getData();
  345. // read session items
  346. $items = TSession::getValue(__CLASS__.'_items');
  347. // get the session item
  348. $item = $items[ $param['item_key'] ];
  349. $data->detail_id = $item['id'];
  350. $data->detail_qtde = $item['qtde'];
  351. $data->detail_qtde_bonificada = $item['qtde_bonificada'];
  352. $data->detail_valor_item = $item['valor_item'];
  353. $data->detail_valor_total_item = $item['valor_total_item'];
  354. $data->detail_produto_id = $item['produto_id'];
  355. $data->detail_produto_nome = $item['produto_nome'];
  356. // fill detail fields
  357. $this->form->setData( $data );
  358. $this->onReload( $param );
  359. }
  360. /**
  361. * Delete an item from session list
  362. * @param $param URL parameters
  363. */
  364. public function onDeleteDetail( $param )
  365. {
  366. $data = $this->form->getData();
  367. // reset items
  368. $data->detail_qtde = '';
  369. $data->detail_qtde_bonificada = '';
  370. $data->detail_valor_item = '';
  371. $data->detail_valor_total_item = '';
  372. $data->detail_produto_id = '';
  373. $data->detail_produto_nome = '';
  374. $data->valor_total = '';
  375. // clear form data
  376. $this->form->setData( $data );
  377. // read session items
  378. $items = TSession::getValue(__CLASS__.'_items');
  379. // delete the item from session
  380. unset($items[ $param['item_key'] ] );
  381. TSession::setValue(__CLASS__.'_items', $items);
  382. // reload items
  383. $this->onReload( $param );
  384. }
  385. /**
  386. * Load the items list from session
  387. * @param $param URL parameters
  388. */
  389. public function onReload($param)
  390. {
  391. // read session items
  392. $items = TSession::getValue(__CLASS__.'_items');
  393. $this->detail_list->clear(); // clear detail list
  394. $data = $this->form->getData();
  395. $total = 0.00;
  396. if ($items)
  397. {
  398. $cont = 1;
  399. foreach ($items as $list_item_key => $list_item)
  400. {
  401. $item_name = 'prod_' . $cont++;
  402. $item = new StdClass;
  403. // create action buttons
  404. $action_del = new TAction(array($this, 'onDeleteDetail'));
  405. $action_del->setParameter('item_key', $list_item_key);
  406. $action_edi = new TAction(array($this, 'onEditDetail'));
  407. $action_edi->setParameter('item_key', $list_item_key);
  408. $button_del = new TButton('delete_detail'.$cont);
  409. $button_del->class = 'btn btn-default btn-sm';
  410. $button_del->setAction( $action_del, '' );
  411. $button_del->setImage('fa:trash-o red fa-lg');
  412. $button_edi = new TButton('edit_detail'.$cont);
  413. $button_edi->class = 'btn btn-default btn-sm';
  414. $button_edi->setAction( $action_edi, '' );
  415. $button_edi->setImage('fa:edit blue fa-lg');
  416. $item->edit = $button_edi;
  417. $item->delete = $button_del;
  418. $this->formFields[ $item_name.'_edit' ] = $item->edit;
  419. $this->formFields[ $item_name.'_delete' ] = $item->delete;
  420. // items
  421. $item->id = $list_item['id'];
  422. $item->qtde = $list_item['qtde'];
  423. $item->qtde_bonificada = $list_item['qtde_bonificada'];
  424. $item->valor_item = $list_item['valor_item'];
  425. $item->valor_total_item = $list_item['valor_total_item'];
  426. $item->produto_id = $list_item['produto_id'];
  427. $item->produto_nome = $list_item['produto_nome'];
  428. $total += $item->valor_total_item;
  429. $row = $this->detail_list->addItem( $item );
  430. $row->onmouseover='';
  431. $row->onmouseout='';
  432. }
  433. $data = $this->form->getData();
  434. $valor_desconto = number_format(0.00, 2, ',','.');
  435. if ($data->valor_desconto) {
  436. $valor_desconto = number_format($data->valor_desconto, 2, ',','.');
  437. }
  438. $data = new Stdclass();
  439. $data->valor_total = number_format($total, 2, ',','.');
  440. $data->valor_desconto = $valor_desconto;
  441. TForm::sendData('form_Pedido_compra', $data);
  442. $this->form->setFields( $this->formFields );
  443. }
  444. $this->loaded = TRUE;
  445. }
  446. /**
  447. * Load Master/Detail data from database to form/session
  448. */
  449. public function onEdit($param)
  450. {
  451. try
  452. {
  453. TTransaction::open('erpweb');
  454. if (isset($param['key']))
  455. {
  456. $key = $param['key'];
  457. $object = new Pedido_compra($key);
  458. $items = Item_pedido_compra::where('pedido_compra_id', '=', $key)->load();
  459. $session_items = array();
  460. foreach( $items as $item )
  461. {
  462. $item_key = $item->id;
  463. $session_items[$item_key] = $item->toArray();
  464. $session_items[$item_key]['id'] = $item->id;
  465. $session_items[$item_key]['qtde'] = $item->qtde;
  466. $session_items[$item_key]['qtde_bonificada'] = $item->qtde_bonificada;
  467. $session_items[$item_key]['valor_item'] = $item->valor_item;
  468. $session_items[$item_key]['valor_total_item'] = $item->valor_total_item;
  469. $session_items[$item_key]['produto_id'] = $item->produto_id;
  470. $session_items[$item_key]['produto_nome'] = $item->produto->descricao;
  471. }
  472. TSession::setValue(__CLASS__.'_items', $session_items);
  473. $this->form->setData($object); // fill the form with the active record data
  474. $this->onReload( $param ); // reload items list
  475. TTransaction::close(); // close transaction
  476. }
  477. else
  478. {
  479. $this->form->clear(TRUE);
  480. TSession::setValue(__CLASS__.'_items', null);
  481. $this->onReload( $param );
  482. }
  483. }
  484. catch (Exception $e) // in case of exception
  485. {
  486. new TMessage('error', $e->getMessage());
  487. TTransaction::rollback();
  488. }
  489. }
  490. /**
  491. * Save the Master/Detail data from form/session to database
  492. */
  493. public function onSave()
  494. {
  495. try
  496. {
  497. // open a transaction with database
  498. TTransaction::open('erpweb');
  499. $data = $this->form->getData();
  500. $master = new Pedido_compra;
  501. $master->fromArray( (array) $data);
  502. $this->form->validate(); // form validation
  503. $master->store(); // save master object
  504. // delete details
  505. $old_items = Item_pedido_compra::where('pedido_compra_id', '=', $master->id)->load();
  506. $keep_items = array();
  507. // get session items
  508. $items = TSession::getValue(__CLASS__.'_items');
  509. if( $items )
  510. {
  511. foreach( $items as $item )
  512. {
  513. if (substr($item['id'],0,1) == 'X' ) // new record
  514. {
  515. $detail = new Item_pedido_compra;
  516. }
  517. else
  518. {
  519. $detail = Item_pedido_compra::find($item['id']);
  520. }
  521. $detail->qtde = $item['qtde'];
  522. $detail->qtde_bonificada = $item['qtde_bonificada'];
  523. $detail->valor_item = $item['valor_item'];
  524. $detail->valor_total_item = $item['valor_total_item'];
  525. $detail->produto_id = $item['produto_id'];
  526. $detail->pedido_compra_id = $master->id;
  527. $detail->store();
  528. $keep_items[] = $detail->id;
  529. }
  530. }
  531. if ($old_items)
  532. {
  533. foreach ($old_items as $old_item)
  534. {
  535. if (!in_array( $old_item->id, $keep_items))
  536. {
  537. $old_item->delete();
  538. }
  539. }
  540. }
  541. TTransaction::close(); // close the transaction
  542. // reload form and session items
  543. $this->onEdit(array('key'=>$master->id));
  544. new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'));
  545. }
  546. catch (Exception $e) // in case of exception
  547. {
  548. new TMessage('error', $e->getMessage());
  549. $this->form->setData( $this->form->getData() ); // keep form data
  550. TTransaction::rollback();
  551. }
  552. }
  553. /**
  554. * Show the page
  555. */
  556. public function show()
  557. {
  558. // check if the datagrid is already loaded
  559. if (!$this->loaded AND (!isset($_GET['method']) OR $_GET['method'] !== 'onReload') )
  560. {
  561. $this->onReload( func_get_arg(0) );
  562. }
  563. parent::show();
  564. }
  565. }

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework Quero me inscrever agora!

Comentários (2)


NR

Na função onReload o código responsável por enviar os totais para o formulário está dentro do if abaixo:
 
  1. <?php
  2. if ($items)
  3. ?>

Ou seja, só irá atualizar quando houver itens.
GG

Obrigado Nataniel funcionou