JA India - Creditors Trial Balance - draft

Description
Categories: BI Publisher
Application: Asia/Pacific Localizations
Source: India - Creditors Trial Balance Report (XML) - Not Supported: Reserved For Future Use
Short Name: JAINCTRB_XML
DB package: JA_JAINCTRB_XMLP_PKG
SELECT SUM(abs(apd.amount))  amount,
               api.vendor_id, 
               api.invoice_currency_code, 
               api.org_id,
               api.accts_pay_code_combination_id accts, 
	JA_JAINCTRB_XMLP_PKG.cf_addrformula(api.org_id) CF_addr, 
	JA_JAINCTRB_XMLP_PKG.cf_acctsformula(api.accts_pay_code_combination_id) CF_accts, 
	JA_JAINCTRB_XMLP_PKG.cf_addr1formula(api.org_id) CF_addr1, 
	JA_JAINCTRB_XMLP_PKG.cf_vendor_typeformula(api.vendor_id) CF_vendor_type, 
	JA_JAINCTRB_XMLP_PKG.cf_vendor_nameformula(api.vendor_id) CF_vendor_name, 
	JA_JAINCTRB_XMLP_PKG.cf_vendor_codeformula(api.vendor_id) CF_vendor_code, 
	JA_JAINCTRB_XMLP_PKG.cf_entered_amountformula(api.accts_pay_code_combination_id, api.vendor_id, api.org_id, api.invoice_currency_code) CF_entered_amount, 
	JA_JAINCTRB_XMLP_PKG.cf_re_amtformula(api.accts_pay_code_combination_id, api.org_id, api.vendor_id, api.invoice_currency_code) CF_re_amt
FROM   ap_invoices_all api,
              ap_invoice_distributions_all apd,
              po_vendors pov,
              ap_supplier_sites povs
WHERE api.invoice_id = apd.invoice_id
AND       api.vendor_id = pov.vendor_id
AND       pov.vendor_id = povs.vendor_id
AND       api.vendor_site_id = povs.vendor_site_id
&LP_SELECTED_VENDOR_ID
&LP_SELECTED_VENDOR_NO
AND      ( 
                (:p_vendor_type_lookup_code is null)
                OR
                ( (:p_vendor_type_lookup_code is not null) and (pov.vendor_type_lookup_code = :p_vendor_type_lookup_code) )
               )  
AND     TRUNC(apd.accounting_date) <= TRUNC(:p_as_of_date)
AND     (api.org_id = :p_org_id ) 
AND     apd.match_status_flag =  'A'         
AND     DECODE(povs.accts_pay_code_combination_id, NULL, povs.accts_pay_code_combination_id, povs.accts_pay_code_combination_id) = NVL(:p_accts_id, DECODE(povs.accts_pay_code_combination_id, NULL, povs.accts_pay_code_combination_id, povs.accts_pay_code_combination_id))
GROUP BY api.org_id, api.accts_pay_code_combination_id,  
  api.vendor_id, api.invoice_currency_code
  order by api.org_id,accts,api.vendor_id, amount DESC,
               api.invoice_currency_code
Parameter Name SQL text Validation
Org ID
 
Number
Chart Of Accts
 
Number
As Of Date
 
Date
Account Code
 
Vendor Type
 
LOV Oracle
Vendor Number
 
LOV Oracle
Vendor Name
 
LOV Oracle