美文网首页
EBS AP付款界面汇入账户取值SQL

EBS AP付款界面汇入账户取值SQL

作者: 穿越人海zx | 来源:发表于2019-01-17 21:20 被阅读0次
    image.png
     SELECT hr.name
           ,v.bank_account_num_electronic
           ,ac.vendor_name
           ,ac.check_number
           ,ac.check_date
           ,ac.amount
           ,ac.check_id
       FROM ap_checks_all             ac
           ,iby_ext_bank_accounts_v   v
           ,hr_all_organization_units hr
      WHERE 1 = 1
        AND ac.external_bank_account_id = v.ext_bank_account_id(+)
        AND ac.org_id = hr.organization_id;
    
    

    汇入账户lov的SQL

    SELECT bank_account_name
          ,bank_account_id
          ,bank_account_number
          ,currency_code
          ,iban_number
          ,bank_name
          ,bank_number
          ,bank_branch_name
          ,branch_number
          ,country_code
          ,alternate_account_name
          ,bank_account_type
          ,account_suffix
          ,description
          ,foreign_payment_use_flag
          ,payment_factor_flag
          ,eft_swift_code
      FROM (SELECT b.bank_account_name
                  ,b.ext_bank_account_id bank_account_id
                  ,b.bank_account_number
                  ,b.currency_code
                  ,b.iban_number
                  ,b.bank_name
                  ,b.bank_number
                  ,b.bank_branch_name
                  ,b.branch_number
                  ,b.country_code
                  ,b.alternate_account_name
                  ,b.bank_account_type
                  ,b.account_suffix
                  ,b.description
                  ,b.foreign_payment_use_flag
                  ,b.payment_factor_flag
                  ,b.eft_swift_code
                  ,rank() over(PARTITION BY ibyu.instrument_id, ibyu.instrument_type ORDER BY ibyu.instrument_payment_use_id) not_dup
              FROM iby_pmt_instr_uses_all  ibyu
                  ,iby_ext_bank_accounts_v b
                  ,iby_external_payees_all ibypayee
             WHERE ibyu.instrument_id = b.ext_bank_account_id
               AND ibyu.instrument_type = 'BANKACCOUNT'
               AND (b.currency_code = :parameter.p_pba_pmt_currency OR
                   b.currency_code IS NULL)
               AND ibyu.ext_pmt_party_id = ibypayee.ext_payee_id
               AND ibyu.payment_flow = 'DISBURSEMENTS'
               AND ibypayee.payment_function = :parameter.p_pba_pmt_function
               AND ibypayee.payee_party_id = :parameter.p_pba_payee_party_id
               AND trunc(SYSDATE) BETWEEN
                   trunc(nvl(ibyu.start_date
                            ,SYSDATE - 1)) AND
                   trunc(nvl(ibyu.end_date - 1
                            ,SYSDATE + 1))
               AND trunc(SYSDATE) BETWEEN
                   trunc(nvl(b.start_date
                            ,SYSDATE - 1)) AND
                   trunc(nvl(b.end_date - 1
                            ,SYSDATE + 1))
               AND (ibypayee.party_site_id IS NULL OR
                   ibypayee.party_site_id =
                   :parameter.p_pba_payee_party_site_id)
               AND (ibypayee.supplier_site_id IS NULL OR
                   ibypayee.supplier_site_id =
                   :parameter.p_pba_supplier_site_id)
               AND (ibypayee.org_id IS NULL OR
                   (ibypayee.org_id = :parameter.p_pba_org_id AND
                   ibypayee.org_type = :parameter.p_pba_org_type)))
     WHERE not_dup = 1;
    
    

    相关文章

      网友评论

          本文标题:EBS AP付款界面汇入账户取值SQL

          本文链接:https://www.haomeiwen.com/subject/lcywdqtx.html