Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TVendaClass.CancelaItensdaVenda(const codebar: string): Boolean;
- var Th: TThread;
- begin
- try
- TDtmConexao.FDMasterPdv.ExecSQL(
- ' DELETE FROM ITENS_VENDA where ITENS_CODBARRAS = '+codebar+' and VENDA_NUMERO = '+Vendas.FNumerodaVenda.ToString );
- TDtmConexao.FDMasterPdv.Commit;
- finally
- Th := TThread.CreateAnonymousThread( procedure
- begin
- try
- FDatasetItensdaVenda.Refresh;
- FRichVenda.Clear;
- FTVendaop.MontaDadosNoRich(FRichVenda);
- FDatasetItensdaVenda.First;
- while not FDatasetItensdaVenda.Eof do
- begin
- GerarLog( Datetostr(Now)+' - '+TimeTostr(now)+' Log.: RETIRADO DA VENDA NRO.: '+ Vendas.FNumerodaVenda.ToString +' O PRODUTO '+ FDatasetItensdaVenda.FieldByName('ITENS_DESCPRODUTO').AsString);
- FDatasetItensdaVenda.Edit;
- FDatasetItensdaVenda.FieldByName('ITENS_POSICAOITEN').AsInteger := FDatasetItensdaVenda.RecNo;
- FDatasetItensdaVenda.Post;
- FTVendaop.AppendProdtoRitchCancelbyCode( FDatasetItensdaVenda );
- FDatasetItensdaVenda.Next;
- end;
- AfterRefreshDatasetItensdavenda;
- except
- on E: Exception do
- GerarLog( Datetostr(Now)+' - '+TimeTostr(now)+' Log.: ERRO NO PROCESSO RETIRA ITENS DA VENDA [ I ] '+ e.Message);
- end;
- end);
- Th.Start;
- end;
- Result:= True;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement