ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle TCA 吓死我了 终于搞明白啦!!!

oracle TCA 吓死我了 终于搞明白啦!!!

原创 Linux操作系统 作者:wzk1314 时间:2012-04-12 21:57:26 0 删除 编辑
首先明确一点,TCA既不是OA的一个独立模块也不是OA某个模块的功能,它仅仅是一种架构。TCA(Trading Community Architecture)是R12中通过增加供应商和银行来扩展R11客户模型以支持复杂的贸易关系,满足额外需求的一种架构。因此,TCA是一种用来管理与公司商业有关的成员的复杂信息的数据模型,该成员是可以是客户、供应商和银行,同时也可以是组织,地点,或成员之间的网络层次关系,同时也是一种很灵活和健壮的支持录入和管理与我们交易相关的实体的数据模型。
1.实现了用户创建和管理实体关系,该关系是联系各个成员的核心,同时也是后台取数逻辑的重点。
2.TCA模型集成了跨越整个Oracle EBS Applications 的客户,潜在客户,供应商,批发商,零售商,投资方,银行的数据。
3.TCA不仅考虑到本公司和其商业伙伴关系的维护,同时考虑到了自己的商业伙伴之间,以及商业伙伴和其自身的商业伙伴之间的关系的维护,也即是类似于系统中考虑到了实施公司的供应商和该供应商的其它客户的关系的维护。
4.TCA中实现了高级的关系模型,任何一个成员可以包括到多个数量的合理成员关系,甚至是矩阵层次结构的关系网络。
5.TCA可以自定义成员分类,用于进行不同类成员之间的报告和分配目的。
6.可以扩展数据模型以满足各种业务数据的需求。
7.TCA中三个实体驱动了整个模型:关系(Relationships),成员(Party),账户(Account) 
8.为客户信息提供了一个唯一来源。
9.TCA将所有的商业实体作为一个成员(组织,个人,团体,关系),并以同样的方式处理它们。这种方式为同一模型中适应B2B  B2C和混合模式提供了灵活的处理机制。
10.成员和地址之间的多对多关系,减少了地址的重复,并且使数据的更新更加简便。
11.支持实际世界中复杂的,多层次,多组织 的交易关系。


oracel ebs R12 TCA 架构该帖主要是介绍TCA的架构 是入门的绝佳文章,后面的帖子会进行简单技术分析

转 http://www.oracleappshub.com/accounts-receivable/oracle-tca/trading-community-architecture-tca-101/ 
    Trading Community Architecture (TCA) is a structure which was based out of R11 Customer Model designed to support complex trading relationships to cater additional need which further extended in R12 with Supplier and Bank. So, TCA is a data model that allows you to manage complex information about the parties, or customers or suppliers or bank who belong to your commercial community, including organizations, locations, and the network of hierarchical relationships among them.

what is TCA? 
What is TCA, the Trading Community Architecture? Is TCA an Oracle Applications module? Is it functionality within an Oracle module? These are few common question, and there are often many answers given.
The TCA is a data model that supports the entry and management of entities that you interact with. So lets revisit the concept.
Trading Community Architecture is a Very flexible, very robust model which defines the components involve in trading within in E-business Suite.
The implementation of technology and applications to allow users to create and maintain relationships among entities
The universal data schema for customers, prospects, suppliers, distributors, resellers, consortiums, bank across all Oracle EBS applications
TCA not only allows for the tracking of relationships between the implementing organization and its trading partners, but also tracks relationships between the trading partners themselves.
You should also note, TCA is neither an Oracle Applications module nor requires separate license.
If you see TCA guide, you can find these are the key features of TCA


  • Provides a foundation for a single source for customer information.
  • Ability to represent all business entities as a “Party” (organizations, people, groups, relationships) and to handle them the same way. This approach provides flexibility to accommodate all B2B, B2C and hybrid models in the same repository.
  • Many-to-many relationships between Parties and Locations, that allows for less duplication and easier updating.
  • Capability for advanced relationship modeling between entities within the trading community. Any party can figure in any number of Party Relationships even within matrix hierarchies (relationship networks).
  • Ability to setup and maintain any number of party classifications which can be used for reporting and assignment purposes.
  • Extensible data model to enable various business data requirements.
  • In reality , three entities Drive in the TCA model , which are Party, Account, and Relationships.


TCA Terminologies

  • Party
    • The concept of ‘Party’ enables the Customer Model to treat all business entities equally, regardless of type. It easily handles B2B, B2C.
      Parties of type ‘Group’ allow for the grouping of any number of other parties into a single entity which enable modeling of households and buying consortiums.
    • Parties of type ‘Relationship’ allow for the relationship between two parties to be viewed as a party in its own right
    • Party - A Party is an entity that can enter into a business relationship and can be of four types.
      • Person - A unique individual (dead or alive) of interest to the owner of the software.
      • Organization - A legal entity recognized by some government authority.
      • Group - a combination of two or more people, organizations or groups of created for the use of the owner of the software.
      • Relationship - The association between an individual person and an organization. Usually a contact at an organization or group.
        1.jpg 
        • Account
          • Account - Is a financial roll-up point to track the monitory portion of a customer’s purchases and payments. Stores details about a customer relationship between a Party and your business.
            • This Represents selling-buying relationship such as billing and shipping events
            • Accounts required for a transaction
            • A account cannot exist without a party
          • A Party may have one or more Customer Accounts
            • Account Role - The relationship that a Party has in regard to controlling or using an account.
            • Customer Account Site is a Party Site that is used within the context of a Customer Account (e.g., for billing or shipping purposes).
            • A Customer Account Contact is a Party Contact that is used in the context of a Customer Account.
        • Customer
          A customer account represents the business relationship that a party can enter in to with another party. The account has information about the terms and conditions of doing business with the party. For example, you could open a commercial account for purchases to be made by Vision Distribution for its internal use and a reseller account for purchases made by Vision Distribution for sales of your products to end-users .
        You can also define contact people, bank accounts, payment methods, telephone numbers, and relationships for each customer account.
        You can also maintain multiple customer accounts for a customer that transacts business with more than one line of business in your organization. You maintain separate customer profiles, addresses, and contacts for each customer account.
        A party site is the location where a particular party is physically located. Every party has only one identifying address, but a party can have multiple party sites. A customer address is a party site used in the context of a customer account for billing, shipping, or other purposes.


        A contact communicates for or acts on behalf of a party or customer account. A contact can exist for a customer at the account or address level. A person usually acts as a contact for an organization, but can also be a contact for another person. For example, an administrative assistant could be the contact for an executive.

        Old Model vs New Customer Model
        3.jpg 
        Fig 2; Customer old model and TCA model
        2.jpg

  • Locations/site :A Location is a point in geographical space described by an address. A party site is a location.
  • Party Relationship :Any relationship between two parties of the above type (person and organization) that needs to be stored as its. own record. Data that directly corresponds to this relationship (contact info etc.) is stored as well. Relationships are stored in the HZ_PARTY_RELATIONSHIPS table.

Factors which you can consider for TCA entities

  • Business requirement including your reporting
  • System/application requirement
  • Country or Organization Legal Requirement
  • Global Consideration
  • Process standardization
TCA Setup Considerations
When you are doing TCA customer Modeling, keep these things in mind;
  • Party be any real Person or Organization.
  • Party sites are locations for Party or Organization.
  • Relationships are generally used to construct hierarchical structure of Organizations.
  • Party becomes a Customer/Account, once a selling relationship is established.
  • An account should typically have at least one active ‘bill_to’ site. It helps for accounting and reporting purposes.
  • When creating Parties, what all party sites can be or should be created as Parties.
  • Generally, if you want to see activities for site level separately from your parent level party, you should create that Site as a separate Party/Entity.
  • An account is a separate entity. Create account only where you have selling relationship i.e. only for customers. It identifies selling attributes e.g.payment terms, shipping and billing preferences etc. of the relationship.
  • You can have multiple accounts, for each relationship between external party and your business entity. It enables you to have multiple
    sets of selling attributes e.g. payment terms etc.
  • You can build relationship between accounts and have one account to pay for another.
  • If transaction needs to be segregated within a party to perform. granular analysis based on selling or business relation,separate accounts with a party should be created.

TCA Integration with Other Oracle Products
This is how TCA data is tighten with other Oracle products.


4.jpg 
TCA Technical Tables


  • TCA - Customer : Here are Technical details for 11i/R12 customer in TCA.
5.jpg 
  • TCA - Suppliers
Here are Technical details for R12 Supplier in TCA. You can also refer old post for more details.
6.jpg
HZ_PARTIES
The HZ_PARTIES table stores basic information about parties that can be shared with any relationship that the party might establish with another party. Although a record in the HZ_PARTIES table represents a unique party, multiple parties can have the same name. The parties can be one of four types:
{{"bul:1"}}Organization-for example, Oracle Corporation
{{"bul:1"}}Person-for example, Jane Doe
{{"bul:1"}}Group-for example, World Wide Web Consortium
{{"bul:1"}}Relationship-for example, Jane Doe at Oracle Corporation.
{{"bodytext"}}Party records can be created and updated using third party data sources such as Dun & Bradstreet's Global Data Products. The HZ_PARTIES table contains denormalized information from the HZ_LOCATIONS, HZ_PERSON_PROFILES, HZ_CONTACT_POINTS, HZ_ORGANIZATION_PROFILES, and HZ_PERSON_LANGUAGE tables. The identifying address contained in the HZ_PARTIES table is denormalized from the HZ_LOCATIONS table.
.
The primary key for this table is PARTY_ID. 



HZ_ORGANIZATION_PROFILES 
The HZ_ORGANIZATION_PROFILES table stores a variety of information about a party. This table gets populated when a party of the Organization type is created. This table also contains data retrieved from Dun & Bradstreet using either the Dun & Bradstreet online or batch download methods. Historical data for the organization can also be stored in this table. Each time organization information is changed, the effective end date column for the original record is updated and a new record that contains the updated information is created.
.
The primary key for this table is ORGANIZATION_PROFILE_ID.

HZ_PERSON_PROFILES
The HZ_PERSON_PROFILES table stores personal and family information about a party of the Person type. For example, this table could contain the correct spelling and phonetic pronunciation of the person's name. Note that some information in this table may also be entered into the HZ_PARTIES table.
.
The primary key for this table is PERSON_PROFILE_ID. 


HZ_CODE_ASSIGNMENTS
The HZ_CODE_ASSIGNMENTS table is an intersection table that links the classification codes in the FND_LOOKUP_VALUES table to the names of parties or other entities stored in the table identified in the OWNER_TABLE_NAME column. For example, the classification code for databases can be linked to Oracle Corporation. 
.
The primary key for this table is CODE_ASSIGNMENT_ID. 

HZ_PARTY_USG_ASSIGNMENTS
Stores information about party usage assignments. 

SELECT party_usg_assignment_id,
        party_usage_code,
        effective_start_date
FROM   hz_party_usg_assignments
WHERE  party_id = p_party_id
AND    status_flag = 'A'
AND    trunc(sysdate) between
          effective_start_date and effective_end_date;

-- load party usages
    CURSOR c_party_usages IS
    SELECT party_usage_code,
           party_usage_type,
           status_flag,
           restrict_manual_assign_flag,
           restrict_manual_update_flag,
           created_by
    FROM   hz_party_usages_b;

    -- load rules
    CURSOR c_exist_exclusive_rules IS
    SELECT null
    FROM   hz_party_usage_rules
    WHERE  (party_usage_rule_type = 'EXCLUSIVE' OR
            party_usage_rule_type = 'CANNOT_COEXIST')
    AND    trunc(sysdate) between
             effective_start_date AND effective_end_date
    AND    rownum = 1;

    CURSOR c_party_usage_rules IS
    SELECT party_usage_rule_type||'##'||
           party_usage_code||'##'||
           related_party_usage_code
    FROM   hz_party_usage_rules
    WHERE  trunc(sysdate) between
             effective_start_date AND effective_end_date;

HZ_ORG_CONTACTS 
    The HZ_ORG_CONTACTS table stores information about the position of the contact for a party or party site. The records in this table provide information about a contact position such as JOB_TITLE, RANK, and general contact information. This table is not used to store information about a specific person or organization, such as name and identification codes. That information is stored in the HZ_PARTIES table. For example, this table may include a record for the position of vice president of manufacturing that indicates that the contact is a senior executive, but it would not include the name of the person in that position.
.
The primary key for this table is ORG_CONTACT_ID. 



HZ_ORIG_SYS_REFERENCES
   The HZ_ORIG_SYSTEM_REFERENCES table stores the mapping between source system references and the owner tables. The source system reference is an identifier for the record that the data came from the source system and the owner table is the TCA table, which stores that data. A record with an Active status means the cross-reference mapping between TCA and source system is vaild. An Inactive status means the cross-referencing mapping is no longer valid. 

HZ_RELATIONSHIPS 
   The HZ_RELATIONSHIPS table stores information about relationships between one party and another party. The SUBJECT_ID and OBJECT_ID columns specify the relationship that exists between two parties. For example, if the party relationship is of the Parent Of type, a holding company could be the SUBJECT_ID in the relationship while one of its subsidiaries could be the OBJECT_ID. Creating a party contact causes a party relationship to be created. A party can have different relationships with one or more other parties. A party relationship can be specified with specific start and end dates so that the subject or object of a relationship can change over time.
.
The primary key for this table is RELATIONSHIP_ID. 

HZ_RELATIONSHIP_TYPES
The HZ_RELATIONSHIP_TYPES table defines the business rules that are associated with a relationship type. A non-directional relationship type consists of a single record with the same forward (FORWARD_REL_CODE) and backward (BACKWARD_REL_CODE) relationship codes. A directional relationship type consists of two records: one for the parent (DIRECTION_CODE is P) and the other for a child (DIRECTION_CODE is C) of that parent. Forward and backward relationship codes are validated against the PARTY_RELATIONS_TYPE lookup type.
.
The primary key for this table is RELATIONSHIP_TYPE_ID.
.
The RELATIONSHIP_TYPE_ID is used as the foreign key to the HZ_CODE_ASSIGNMENTS table, in the OWNER_TABLE_ID column. You can define a relationship type as part of a relationship type group in 
the HZ_CODE_ASSIGNMENTS table.



HZ_ORG_CONTACT_ROLES

The HZ_ORG_CONTACT_ROLES table stores information about the role of the contact position that is specified in the HZ_ORG_CONTACTS table. Contacts may have multiple roles. For example, a vice president of manufacturing may have a custom-defined role as a member of a capital expenditures review board.
.
The primary key for this table is ORG_CONTACT_ROLE_ID.

HZ_CUST_ACCOUNTS
The HZ_CUST_ACCOUNTS table stores information about customer accounts , or business relationships that the deploying company establishes with a party of type Organization or Person. This table focuses on business relationships and how transactions are conducted in the relationship.
Since a party can have multiple customer accounts, this table might contain several records for a single party. For example, an individual person can establish a personal account, family account, and a professional account for a consulting practice. 

HZ_CUST_ACCOUNT_ROLES

The HZ_CUST_ACCOUNT_ROLES table stores information about a role or function that a party performs in relation to a customer account. For example, Jane Doe might be a legal contact for Vision Corporation.
.
The primary key for this table is CUST_ACCOUNT_ROLE_ID. 

select  b.person_first_name||' '||b.person_last_name
from   hz_cust_account_roles a,
        hz_parties b,
        hz_relationships c
where a.cust_account_role_id = v_contact_id
and   c.party_id =a.party_id
and   c.subject_id = b.party_id
and   c.subject_table_name = 'HZ_PARTIES'
and   c.object_table_name = 'HZ_PARTIES'
and   c.directional_flag = 'F';

HZ_PARTY_SITES
The HZ_PARTY_SITES table links a party (see HZ_PARTIES) and a location (see HZ_LOCATIONS) and stores location-specific party information such as MAILSTOP and ADDRESSEE. One party can optionally have one or more party sites. One location can optionally be used by one or more parties. For example, 500 Oracle Parkway can be specified as a party site for Oracle Corporation. This party site can then be used for multiple customer accounts within the same party.
.
The primary key for this table is PARTY_SITE_ID.
整理的R12 TCA 的一些查询逻辑及语句
1.--查看HZ_Party的成员类型
SELECT ptypelu.lookup_type
      ,ptypelu.lookup_code
      ,ptypelu.meaning
      ,ptypelu.description
  FROM fnd_lookup_values ptypelu
WHERE ptypelu.view_application_id(+) = 222
   AND ptypelu.lookup_type(+) = 'PARTY_TYPE'
   AND ptypelu.LANGUAGE(+) = userenv('LANG');

2.--查看成员关系
SELECT rolelu.lookup_type
      ,rolelu.lookup_code
      ,rolelu.meaning
      ,rolelu.description
  FROM fnd_lookup_values rolelu
  where rolelu.view_application_id = 222
   AND rolelu.lookup_type = 'HZ_RELATIONSHIP_ROLE'
   AND rolelu.LANGUAGE = userenv('LANG');


3.hz_code_assignments(branchcp)和hz_parties关联一般是根据 hz_code_assignments和其他表
关联主要是通过class_category、owner_table_name、owner_table_id莱进行的。
   AND (branchca.class_category(+) = 'BANK_INSTITUTION_TYPE') --类型
   AND hca.primary_flag = 'Y'                                 --主要分配
   AND hca.status = 'A';                                      --分配有效
   AND (branchca.owner_table_name(+) = 'HZ_PARTIES')          --主要表
   AND (branchca.owner_table_id)                              --HZ_PARTIES表中对应的party_id,如果是银行可以是银行的账户或者银行,或者客户,根据不同类型,对应不同的party类型party_id,这三个条件就可以关联整理出这两个表,从而得到当前的party类型hz_code_assignments.class_code;


4.hz_contact_points(branchcp)和hz_parties关联一般是根据 
   AND (branchcp.contact_point_type(+) = 'EFT')           ---类型,例如电话就是'PHONE',邮箱就是'EMAIL'
   AND (nvl(branchcp.status(+),'A') = 'A')                ---状态
   AND (branchcp.owner_table_name(+) = 'HZ_PARTIES')      ---主要表
   AND (branchcp.owner_table_id(+) = eb.branch_id)        ---HZ_PARTIES表中对应的party_id,如果是银行可以是银行的账户或者银行,或者客户,根据不同类型,对应不同的party类型party_id,也可以是与HZ_PARTIES.party_id 相对应的party_id  例如银行账户ID,银行ID
  


5.
SELECT hzp.party_name       客户名称
      ,hzp.party_number     客户标示
      ,hzcacc.account_name  客户账户名称
      ,bp.party_name        银行名称 --银行
      ,br.party_name        银行分行 --分行
      ,eb.bank_account_num  银行帐号 --银行帐号
      ,eb.currency_code     币种
      ,iepa.org_id          业务实体
      ,hzcacc.creation_date 客户账户创建日期
      ,iepa.creation_date   付款人创建日期
      ,ow.creation_date     账户所属创建日期
      ,eb.creation_date     账户创建日期
      ,ipiua.creation_date  付款手段日期创建时间
  FROM iby_external_payers_all  iepa
      ,iby_pmt_instr_uses_all   ipiua
      ,hz_parties               hzp
      ,hz_cust_accounts         hzcacc
      ,hz_organization_profiles bapr
      ,hz_organization_profiles brpr
      ,hz_parties               bp --银行
      ,hz_party_sites           s
      ,iby_account_owners       ow
      ,hz_parties               br --分行
      ,hz_parties               op
      ,iby_ext_bank_accounts    eb
      ,hz_code_assignments      branchca
      ,hz_contact_points        branchcp
WHERE eb.bank_id = bp.party_id(+)
   AND eb.bank_id = bapr.party_id(+)
   AND eb.branch_id = br.party_id(+)
   AND eb.branch_id = brpr.party_id(+)
   AND eb.ext_bank_account_id = ow.ext_bank_account_id(+)
   AND ow.primary_flag(+) = 'Y'
   AND nvl(ow.end_date,
           SYSDATE + 10) > SYSDATE
   AND ow.account_owner_party_id = op.party_id(+)
   AND (br.party_id = s.party_id(+))
   AND (s.identifying_address_flag(+) = 'Y')
   AND (branchcp.owner_table_name(+) = 'HZ_PARTIES')
   AND (branchcp.owner_table_id(+) = eb.branch_id)
   AND (branchcp.contact_point_type(+) = 'EFT')
   AND (nvl(branchcp.status(+),
            'A') = 'A')
   AND (branchca.class_category(+) = 'BANK_INSTITUTION_TYPE')
   AND (branchca.owner_table_name(+) = 'HZ_PARTIES')
   AND (branchca.owner_table_id(+) = eb.branch_id)
   AND SYSDATE BETWEEN nvl(trunc(bapr.effective_start_date),
                           SYSDATE - 1) AND nvl(trunc(bapr.effective_end_date),
                                                SYSDATE + 1)
   AND SYSDATE BETWEEN nvl(trunc(brpr.effective_start_date),
                           SYSDATE - 1) AND nvl(trunc(brpr.effective_end_date),
                                                SYSDATE + 1)
   AND iepa.payment_function = 'CUSTOMER_PAYMENT'
   AND eb.ext_bank_account_id = ipiua.instrument_id
   AND ipiua.instrument_type = 'BANKACCOUNT'
   AND ipiua.ext_pmt_party_id = iepa.ext_payer_id
   AND ipiua.payment_function = 'CUSTOMER_PAYMENT'
   AND hzp.party_id = iepa.party_id
   AND hzcacc.party_id = iepa.party_id
   AND hzcacc.cust_account_id = iepa.cust_account_id
   AND hzp.party_name LIKE '汉森%';

6.hz_relationships(hzr)和hz_party(hp)关联
   AND hp.party_id = hzr.subject_id         --和主表联系
   AND hzr.relationship_type = 'CONTACT'    --关系类型
   AND hzr.relationship_code = 'CONTACT_OF' --关系代码
   AND hzr.subject_type = 'PERSON'          --被关联者
   AND hzr.object_type = 'ORGANIZATION'     --主关联者
   AND hzr.status = 'A'                     --关联是否有效
  eg:获取银行数据
       SELECT hop.party_id,
              hop.bank_or_branch_number,
              hop.organization_name,
              hop.home_country
       FROM   hz_organization_profiles hop,
              hz_parties hp,
              hz_relationships hr
       WHERE  hr.object_id = p_bank_rec.organization_rec.party_rec.party_id
         AND  hr.relationship_type = 'BANK_AND_BRANCH'
         AND  hr.relationship_code = 'HAS_BRANCH'
         AND  hr.object_type = 'ORGANIZATION'
         AND  hr.object_table_name = 'HZ_PARTIES'
         AND  hr.subject_type = 'ORGANIZATION'
         AND  hr.subject_table_name = 'HZ_PARTIES'
         AND  SYSDATE BETWEEN hr.start_date AND NVL(hr.end_date, SYSDATE + 1)
         AND  hr.status = 'A'
         AND  hop.party_id = hr.subject_id
         AND  SYSDATE BETWEEN TRUNC(hop.effective_start_date)
         AND  NVL(hop.effective_end_date, SYSDATE+1)
         AND  hp.party_id = hop.party_id
         AND  hp.status = 'A';

7.hz_organization_profiles(hop)和hz_party(hp)关联 hz_organization_profiles和外表关联主要
是使用party_id和effective_start_date,effective_end_date来实现的。
     SELECT  hop.bank_or_branch_number,  --根据类型获取相应的数据
             hop.organization_name,
             hop.home_country
       FROM  hz_organization_profiles hop,
             hz_parties hp
      WHERE  hop.party_id = p_bank_id    --主party_id
        AND  SYSDATE BETWEEN TRUNC(hop.effective_start_date)
        AND  NVL(hop.effective_end_date, SYSDATE+1)
        AND  hp.party_id = hop.party_id
        AND  hp.status='A';

8查看客户信站点信息
  SELECT hl.address1      --地点地址
       ,hcsu.location    --地点
       ,hzp.party_name    --客户名称
       ,hca.cust_account_id --
       ,hcsu.site_use_code   --       
   FROM hz_cust_accounts   hca
       ,hz_cust_site_uses  hcsu
       ,hz_cust_acct_sites hcas
       ,hz_party_sites     hps
       ,hz_locations       hl
       ,hz_parties         hzp
  WHERE hl.location_id = hps.location_id
    AND hps.party_site_id = hcas.party_site_id
    AND hcas.cust_account_id = hca.cust_account_id
    AND hcas.cust_acct_site_id = hcsu.cust_acct_site_id
    AND hcsu.site_use_code = 'BILL_TO'
    AND hzp.party_id = hca.party_id
    AND hcas.status = 'A'
    AND hcsu.status = 'A'
    AND hcsu.org_id = 122
    AND hca.cust_account_id = 35041;

--9获取客户银行账户
SELECT hzp.party_name                       客户名称
      ,hzp.party_number                     客户标示
      ,hzcacc.account_name                  客户账户名称
      ,ibybanks.bank_name                   银行名称 --银行
      ,ibybanks.bank_branch_name            银行分行 --分行
      ,ibybanks.bank_account_num_electronic 银行帐号 --银行帐号
      ,iepa.org_id                          账户
      ,ipiua.creation_date                  付款手段日期创建时间
  FROM iby_external_payers_all iepa
      ,iby_pmt_instr_uses_all  ipiua
      ,iby_ext_bank_accounts_v ibybanks
      ,hz_parties              hzp
      ,hz_cust_accounts        hzcacc
WHERE iepa.payment_function = 'CUSTOMER_PAYMENT'     
   AND ibybanks.bank_account_id = ipiua.instrument_id
   AND ipiua.instrument_type = 'BANKACCOUNT'
   AND ipiua.ext_pmt_party_id = iepa.ext_payer_id
   AND ipiua.payment_function = 'CUSTOMER_PAYMENT'   
   AND hzp.party_id = iepa.party_id
   AND hzcacc.party_id = iepa.party_id
   AND hzcacc.cust_account_id = iepa.cust_account_id;
   and iepa.cust_account_id = --客户帐户ID

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

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2012-01-09

  • 博文量
    8
  • 访问量
    22979