sistem Posted July 30, 2018 Report Share Posted July 30, 2018 a Quote Link to comment Share on other sites More sharing options...
crisvam Posted July 30, 2018 Report Share Posted July 30, 2018 Esta opção é para quando não tiver pagamento. tPag = 90 Quote Link to comment Share on other sites More sharing options...
crisvam Posted July 30, 2018 Report Share Posted July 30, 2018 Eu faço assim: Function LoadPagamento(oNfe,vNdoc,nTpag,vFinfe,Pag_Troco) Memvar Tot_Paga Local oItem,vCnpj:=Space(14),vArea,N:=0 ******************************************************************************** Abre_Nfe(.T.) vArea := Select(); Forpag->(DbGoTop() ) If Forpag->(DbSetOrder(1),DbSeek(vNdoc),Found() ) If ForPag->Ndoc != vNdoc vNdoc := Forpag->Ndoc Endif Do While Forpag->Ndoc==vNdoc vCnpj := Forpag->Cnpj oItem := TVoNfePag() N := N+1 WITH OBJECT oItem If N==1 // :indPag := nTpag :tPag := Forpag->Fpag :vPag := Forpag->Vpag Endif If !Empty(vCnpj) Cartao->(DbSetOrder(1),DbSeek(vCnpj),Found() ) :tPag := Forpag->Fpag :vPag := Forpag->Vpag :CNPJ := vCnpj :tBand := Cartao->Band :cAut := Forpag->Auto // :vTroco:= Pag_Troco Endif oNfe:addItem(oItem) END Forpag->(DbSkip() ) Tot_Paga += oItem:vPag Enddo Else oItem := TVoNfePag() WITH Object oItem // :indPag := nTpag :tPag := "90" :vPag := 0 End oNfe:AddItem(oItem) Endif ******************************************************************************** Return(NIL) // Fim da proc LoadPagamento() ******************************************************************************** jfaguiar 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.