ITPub博客

首页 > Linux操作系统 > Linux操作系统 > R12供应商头层及供应商地址层付款方法SQL

R12供应商头层及供应商地址层付款方法SQL

原创 Linux操作系统 作者:kawontony 时间:2013-09-22 14:41:48 0 删除 编辑
--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;
--供应商头层付款方法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,
               Ap_Suppliers            Aps
         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.Payee_Party_Id = Aps.Party_Id
           And Iepa.Org_Id = &p_Org_Id
           And Aps.Vendor_Id = &p_Vendor_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,
       Ap_Suppliers            Aps
 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.Payee_Party_Id = Aps.Party_Id
   And Iepa.Org_Id = &p_Org_Id
   And Aps.Vendor_Id = &p_Vendor_Id;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24627116/viewspace-772966/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-17

  • 博文量
    164
  • 访问量
    362542