Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --AR
- select f_get_ou_code(a.ou_id) as ou_code,f_get_ou_name(a.ou_id) as ou_name,
- f_get_doc_desc(a.doc_type_id) as doc_desc,
- b.doc_no,
- b.doc_date,
- f_get_partner_code(b.partner_id) as partner_code,
- f_get_partner_name(b.partner_id) as partner_name,
- b.amount,
- a.payment_amount,
- b.amount - a.payment_amount as remain_amount
- from fi_summary_monthly_ap a
- inner join fi_invoice_ap_balance b on a.invoice_id = b.invoice_ap_balance_id and a.doc_type_id = b.doc_type_id
- where A.date_year_month='202008'
- order by a.ou_id, b.doc_date, b.doc_no
- and b.flg_payment <> 'Y'
- --AP
- select f_get_ou_code(a.ou_id) as ou_code,f_get_ou_name(a.ou_id) as ou_name,
- f_get_doc_desc(a.doc_type_id) as doc_desc,
- b.doc_no,
- b.doc_date,
- f_get_partner_code(b.partner_id) as partner_code,
- f_get_partner_name(b.partner_id) as partner_name,
- b.amount,
- a.payment_amount,
- b.amount - a.payment_amount as remain_amount
- from fi_summary_monthly_ar a
- inner join fi_invoice_ar_balance b on a.invoice_id = b.invoice_ar_balance_id and a.doc_type_id = b.doc_type_id
- where A.date_year_month='202008'
- order by a.ou_id, b.doc_date, b.doc_no
- and b.flg_payment <> 'Y'
- --CB
- select f_get_ou_code(a.ou_id) as ou_code,
- f_get_ou_name(a.ou_id) as ou_name,
- b.cashbank_code, b.cashbank_name,
- a.amount
- from cb_cashbank_balance a
- inner join m_cashbank b on a.cashbank_id = b.cashbank_id
- where a.cash_bank_date ='20200901' and rec_type ='A'
- order by a.ou_id, b.cashbank_code, b.cashbank_name
- --stock qty
- select f_get_ou_code(a.ou_id) as ou_code,
- f_get_ou_name(a.ou_id) as ou_name,
- f_get_ou_code(a.sub_ou_id) as ou_sub_code,
- f_get_ou_name(a.sub_ou_id) as ou_sub_name,
- f_get_warehouse_code(a.warehouse_id) as warehouse_code,
- f_get_warehouse_name(a.warehouse_id) as warehouse_name,
- f_get_product_code(product_id) as product_code,
- f_get_product_name(product_id) as product_name,
- f_get_uom_code(base_uom_id) as uom,
- qty
- from in_summary_monthly_qty a
- where date_year_month='202009'
- order by ou_code, ou_sub_code, warehouse_code, product_code
- --stock amount
- select f_get_ou_code(a.ou_bu_id) as ou_code,
- f_get_ou_name(a.ou_bu_id) as ou_name,
- f_get_product_code(product_id) as product_code,
- f_get_product_name(product_id) as product_name,
- f_get_uom_code(base_uom_id) as uom,
- qty,
- gl_amount
- from in_summary_monthly_amount a
- where date_year_month='202009' and doc_type_id=-99
- order by ou_code, product_code
- base_uom_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement