首页 > 代码库 > R12供应商地点层付款方法SQL

R12供应商地点层付款方法SQL

技术分享

--R12供应商地点层付款方法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供应商地点层付款方法SQL