Advertisement
tercnem

saldo awal

Nov 12th, 2020
927
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --AR
  2. select f_get_ou_code(a.ou_id) as ou_code,f_get_ou_name(a.ou_id) as ou_name,
  3.        f_get_doc_desc(a.doc_type_id) as doc_desc,
  4.        b.doc_no,
  5.        b.doc_date,
  6.        f_get_partner_code(b.partner_id) as partner_code,
  7.        f_get_partner_name(b.partner_id) as partner_name,
  8.        b.amount,
  9.        a.payment_amount,
  10.        b.amount - a.payment_amount as remain_amount
  11. from fi_summary_monthly_ap a
  12. 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
  13. where A.date_year_month='202008'
  14. order by a.ou_id, b.doc_date, b.doc_no
  15. and b.flg_payment <> 'Y'
  16.  
  17.  
  18. --AP
  19. select f_get_ou_code(a.ou_id) as ou_code,f_get_ou_name(a.ou_id) as ou_name,
  20.        f_get_doc_desc(a.doc_type_id) as doc_desc,
  21.        b.doc_no,
  22.        b.doc_date,
  23.        f_get_partner_code(b.partner_id) as partner_code,
  24.        f_get_partner_name(b.partner_id) as partner_name,
  25.        b.amount,
  26.        a.payment_amount,
  27.        b.amount - a.payment_amount as remain_amount
  28. from fi_summary_monthly_ar a
  29. 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
  30. where A.date_year_month='202008'
  31. order by a.ou_id, b.doc_date, b.doc_no
  32. and b.flg_payment <> 'Y'
  33.  
  34.  
  35. --CB
  36. select f_get_ou_code(a.ou_id) as ou_code,
  37.        f_get_ou_name(a.ou_id) as ou_name,
  38.        b.cashbank_code, b.cashbank_name,
  39.        a.amount
  40. from cb_cashbank_balance a
  41. inner join m_cashbank b on a.cashbank_id = b.cashbank_id
  42. where a.cash_bank_date ='20200901' and rec_type ='A'
  43. order by a.ou_id, b.cashbank_code, b.cashbank_name
  44.  
  45. --stock qty
  46. select f_get_ou_code(a.ou_id) as ou_code,
  47.        f_get_ou_name(a.ou_id) as ou_name,
  48.        f_get_ou_code(a.sub_ou_id) as ou_sub_code,
  49.        f_get_ou_name(a.sub_ou_id) as ou_sub_name,
  50.        f_get_warehouse_code(a.warehouse_id) as warehouse_code,
  51.        f_get_warehouse_name(a.warehouse_id) as warehouse_name,
  52.        f_get_product_code(product_id) as product_code,
  53.        f_get_product_name(product_id) as product_name,
  54.        f_get_uom_code(base_uom_id) as uom,
  55.        qty
  56. from in_summary_monthly_qty a
  57. where date_year_month='202009'
  58. order by ou_code, ou_sub_code, warehouse_code, product_code
  59.  
  60.  
  61. --stock amount
  62. select f_get_ou_code(a.ou_bu_id) as ou_code,
  63.        f_get_ou_name(a.ou_bu_id) as ou_name,
  64.        f_get_product_code(product_id) as product_code,
  65.        f_get_product_name(product_id) as product_name,
  66.        f_get_uom_code(base_uom_id) as uom,
  67.        qty,
  68.        gl_amount
  69. from in_summary_monthly_amount a
  70. where date_year_month='202009' and doc_type_id=-99
  71. order by ou_code, product_code
  72. base_uom_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement