Advertisement
GLASHATAY_007

Untitled

Apr 13th, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. Select
  2. lot_id,
  3. sum(finsum)finsum,
  4. sum(finsum_f)finsum_f
  5. From(
  6. Select lot_id,
  7. finsum,
  8. finsum_f,
  9. -- Ограничение на квр 244, т.к. на 30.01.23 данный квр ТОЛЬКО у ЦС '0510057840'
  10. case
  11. when (tar.targetexpenseitemcode in ( select targetexpenseitemcode from dwh_targetexpenseitemcode_aip where year='2024' /*year*/) and tar.expensetypecode not in ('244')) -- !!!!!!!!!!!
  12. or (tar.targetexpenseitemcode='022E15305F' and tar.expensetypecode='414' and tar.kosgucode='310' and tar.contragent_account='0230004') -- правило по письму крицкой от 5.10.222
  13. or tar.aip_code is not null
  14. then 'Да' else 'Нет'
  15. end priznak_aip --Признак совпадения целевой статьи (АИП)
  16. From FIN_TARG_CON_2024_VIEW /*year*/ tar -- !!!!!!!!!!!
  17. )
  18. Where finsum is not null
  19. Group By lot_id
  20. -- , targetexpenseitemcode ,budget_type ,expensetypecode,kosgucode ,contragent_account ,tar.aip_code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement