heraldogama

Untitled

Mar 5th, 2021
661
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.        FMC.EMPRESA,
  3.        FMC.REVENDA,
  4.        FMC.NUMERO_NOTA_FISCAL,
  5.        FMC.TIPO_TRANSACAO,
  6.        FMC.DTA_DOCUMENTO,
  7.        FMC.CHASSI,
  8.        FMC.TOT_NOTA_FISCAL,
  9.        FT.STATUS,
  10.        FT.VAL_TITULO,
  11.        SUM(FTP.VAL_PAGAMENTO),
  12.        FMC.NUMERO_DAV,
  13.        CAST((COALESCE((FT.VAL_TITULO), 0.0) -
  14.             COALESCE(SUM(FTP.VAL_PAGAMENTO), 0.0)) AS
  15.             DECIMAL(22, 2)) AS SALDO_TITULO
  16. FROM FAT_MOVIMENTO_CAPA FMC
  17. INNER JOIN FIN_TITULO FT ON FT.EMPRESA = FMC.EMPRESA
  18. INNER JOIN FIN_TITULO_PAGAMENTO FTP ON FTP.EMPRESA = FT.EMPRESA
  19. WHERE FT.TIPO = 'CR'
  20. AND FMC.TIPO_TRANSACAO = 'G21'
  21. AND FMC.EMPRESA = 7
  22. AND FMC.REVENDA IN (6)
  23. AND FT.STATUS IN 'PP'
  24. AND FMC.DTA_DOCUMENTO BETWEEN '01/JAN/2021' AND '31/JAN/2021'
  25.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×