Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select
- cc.id contract,
- cc.lot_id,
- pf.amount,
- pf.date::date pay_date,
- pf.number number_,
- substring(pf.payment_description,0,100)payment_description,
- pf.sub_type_code,
- vbc.description,
- pf.kosgu_rs kosgu,
- pf.e_code cvr,
- pf.article_code targetexpenseitemcode,
- pf.section_code,
- pf.pay_doc_name,
- pf.fund_code,
- pf.req_code,
- pf.year,
- pf.aip_code,
- c.inn,
- l_aip.name aip_name
- ,pf.receiver_inn
- From cm_contracts cc
- Inner Join lots l On (l.id = cc.lot_id And l.actual = true)
- Inner Join cm_contract_payments pf On (pf.cm_contract_id = cc.id)
- Left join po_vocab_budget_types vbc on (vbc.code=pf.sub_type_code)
- Left Join gpo_list_aip l_aip On (l_aip.aip_code= pf.aip_code and l_aip.year=pf.year)
- Left Join contragents c On (c.id = cc.contract_customer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement