--r12 Vendor Location Tier payment Method sql:
SELECT Ipmv.payment_method_name
, Ipmv.payment_method_code
, ' N ' Primary_flag
, ' Y ' global
From Iby_applicable_pmt_mthds aipmv, IBY_PAYMENT_METHODS_VL ipmv
WHERE Aipmv.payment_method_code = Ipmv.payment_method_code
and Aipmv.payment_flow = ' disbursements '
and NVL (Ipmv.inactive_date, TRUNC (sysdate + 1)) > TRUNC (sysdate)
and aipmv.application_id = 200
and Aipmv.applicable_type_code = ' payee '
and Aipmv.applicable_value_to is NULL
And not EXISTS
(SELECT 1
From Iby_ext_party_pmt_mthds Iepp
, Iby_external_payees_all Iepa
WHERE Aipmv.payment_method_code = Iepp.payment_method_code
and Aipmv.payment_flow = Iepp.payment_flow
and iepp.payment_function = ' PAYABLES_DISB '
and iepp.ext_pmt_party_id = iepa.ext_payee_id
and iepa.org_id = &p_org_id
and iepa.supplier_site_id = &p_vendor_site_id)
UNION
SELECT Ipmv.payment_method_name
, Iepp.payment_method_code
, Iepp.primary_flag
, ' N ' global
From IBY_PAYMENT_METHODS_VL IPMV
, Iby_ext_party_pmt_mthds Iepp
, Iby_external_payees_all Iepa
WHERE Ipmv.payment_method_code = Iepp.payment_method_code (+)
and Iepp.payment_flow = ' disbursements '
and NVL (Ipmv.inactive_date, TRUNC (sysdate + 1)) > TRUNC (sysdate)
and iepp.payment_function = ' PAYABLES_DISB '
and iepp.ext_pmt_party_id = iepa.ext_payee_id
and iepa.org_id = &p_org_id
and iepa.supplier_site_id = &p_vendor_site_id
R12 Vendor Location tier payment Method sql