Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- FAA_REF as referencia,
- OPG_IMP as import,
- OPG_FRE as data,
- OPG_TXT as concepte,
- FAA_IMP as import_pagat
- from OPG, FAA, TER
- where
- OPG_NUM = FAA_OPD and
- OPG_ITE = TER_ITE and
- TER_DOC = '#{nif_proveidor}' and
- OPG_OPE in ('220', '230')
- union
- select
- IAG_REF as referencia,
- OPG_IMP as import,
- OPG_FRE as data,
- OPG_TXT as concepte,
- IAG_IMP as import_pagat
- from OPG, IAG, TER
- where
- OPG_NUM = IAG_ASC and
- OPG_ITE = TER_ITE and
- TER_DOC = '#{nif_proveidor}' and
- OPG_OPE in ('220', '230') and
- IAG_SGN = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement