Histórico da Página
Ponto de Entrada
Descrição: | Este Ponto de Entrada será executado na rotina Pedidos de Veiculo (VEIVM190) ao ser executada a funcionalidade Levantar Bonus. A mesma permite a alteração do Valor Base de cálculo no levantamento do bônus. | ||||||
Localização: | Atualizações \ Mov Saida \ Pedidos de Veiculo (VEIVM190) | ||||||
Eventos: | If aExiste:ExistTable(RetSqlName("VR3")) cQuery := "SELECT * FROM "+RetSqlName("VR3")+" VR3 " cQuery += "WHERE VR3.VR3_FILIAL = '"+xFilial("VR3")+"' AND VR3.VR3_CODMAR = '"+VQ0->VQ0_CODMAR+"' AND " cQuery += "VR3.VR3_MODVEI = '"+VQ0->VQ0_MODVEI+"' AND VR3.D_E_L_E_T_ = ' '" TcQuery cQuery New Alias "TMPVR3" If !TMPVR3->(Eof()) nPerDCc := TMPVR3->(VR3_DESCON) nPerDCd := TMPVR3->(VR3_DESCDC) nPerDTr := TMPVR3->(VR3_DESTRI) nPerDTa := TMPVR3->(VR3_DESTAT) nPerImp := TMPVR3->(VR3_PERIMP) nPerBon := TMPVR3->(VR3_PERBON) Else nPerDCc := nPDcCon nPerDCd := nPDcCdc nPerDTr := nPDcTri nPerDTa := nPDcTat nPerImp := nPImpos nPerBon := nPBonus EndIf TMPVR3->(DbCloseArea()) Else nPerDCc := nPDcCon nPerDCd := nPDcCdc nPerDTr := nPDcTri nPerDTa := nPDcTat nPerImp := nPImpos nPerBon := nPBonus EndIf nVlrBas := nVlrIni // Ponto de entrada para alteração do Valor Base If lPEVM190BAS nVlrBas := ExecBlock("VM190BAS",.f.,.f.,{nVlrBas}) EndIf nVlrBas := ( nVlrBas - ( ( nPerDCc * nVlrBas ) / 100 ) ) nVlrBas := ( nVlrBas - ( ( nPerDCd * nVlrBas ) / 100 ) ) // If aBonVei[ni,3] > 0 // Valor Fixo do Bonus nVlrBon := aBonVei[ni,3] nVlrLiq := aBonVei[ni,3] nVlrIni := aBonVei[ni,3] nPerBon := 100 nPerDCc := 0 nPerDCd := 0 nPerDTr := 0 nPerDTa := 0 nPerImp := 0 Else // Calcular o Valor do Bonus pelo Percentual If aBonVei[ni,2] > 0 nPerBon := aBonVei[ni,2] EndIf nVlrBon := round(( ( nVlrBas * nPerBon ) / 100 ),2) nVlrLiq := round( nVlrBon - ( ( nVlrBon * nPerImp ) / 100 ),2) EndIf | ||||||
Programa Fonte: | VEIVM190.PRW | ||||||
Função: | FS_LEVANTA() | ||||||
Parâmetros: |
| ||||||
Retorno: |
|
Exemplo:
Include totvs.ch
/*
===============================================================================
###############################################################################
##+----------+------------+-------+-----------------------+------+----------+##
##|Função | VM190BAS | Autor | MIL | Data | 03/10/19 |##
##+----------+------------+-------+-----------------------+------+----------+##
##|Descrição | Alteração Valor Base na rotina Pedidos de Veiculo (VEIVM190)|##
##+----------+--------------------------------------------------------------+##
##+----------+--------------------------------------------------------------+##
###############################################################################
===============================================================================
*/
User Function VM190BAS()
Local nBase := ParamIxb[1]
// Novo Valor Base aqui
// Caso precise alterar o posicionamento, reposicionar na VQ0!
MsgInfo("Ponto de Entrada VM190BAS executado com sucesso!","")
Return nBase