-
-
Save devfabriciobr/7ea695248dd17ffb05f6d89fc9bcbd25 to your computer and use it in GitHub Desktop.
LER ITENS DO TFieldList e DetailForm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| # CASO QUEIRA LER OS REGISTROS DOS COMPONENTES TFieldList OU DetailForm | |
| # EM ALGUM MÉTODO PARA REALIZAR ALGUM PROCESSO, VALIDAÇÃO, etc.. | |
| # SEGUE OS EXEMPLOS: | |
| $total = 0.00; | |
| # LER ITENS DO TFieldList | |
| if(!empty($param['venda_item_id']) and is_array($param['venda_item_id'])) | |
| { | |
| foreach($param['venda_item_id'] as $linha => $linha_id) | |
| { | |
| $total += floatval($param['venda_item_valor'][$linha]); | |
| } | |
| } | |
| # LER ITENS DO DetailForm | |
| if(!empty($param['venda_item__row__data'])) | |
| { | |
| $linhas = 0; | |
| $rowId = $param['venda_item__row__id']; | |
| foreach($param['venda_item__row__data'] as $item) | |
| { | |
| $item = unserialize(base64_decode($item)); | |
| $total += floatval($item->total); | |
| $linhas++; | |
| } | |
| } | |
| # ATUALIZA O TOTAL | |
| $object->total = $total; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment