OM客户、客户地点

1.什么是客户

  按系统结构,一个客户可以对应多个地点。有人觉得,客户名称必须是客户“集团”名称,各分公司、子公司应建立不同客户地址,其实可以不必这样。

 

  一个客户可以当做是一个对方的业务实体(OU),只要可以独立核算、独立业务往来的都可能是一个客户。所以“分公司”,“子公司”都应当建立为独立的客户。

 

  通过设置客户关系(可通过系统选项把条件放送),可以实现一个子公司订购产品,一个子公司收单付款,再由另一个子公司收货(可以多个子公司收货),甚至再继续交付最终使用用户这样多方业务往来的情境。

 

  在AR模块,系统标准报表都统计到客户层,而不是客户地点层。故将客户理解为大的集团现在觉得并不是很合适,应当是一个独立的业务实体(子公司)。

2.常见的地点用途

  首先客户收单方、收货方一般不能缺。

  收单方按订单上字段理解是“Invoice to ”,也就是收“发票”的单位(地方)。收货方字段理解是“ship to ”,还有一个翻译为最终收货方“deliver to ”,按英文字面意思理解,在复杂业务情况下,货物一般不直接送到客户公司中,也许是送到码头、车站,或者是仓库。而这个码头、车站...应该是ship to,也就是交货地点,我方要负责送达的地点。(可在shipping模块直接看到),当送到地点后,收货客户就是“deliver to ”,也就是货物最后要送达的地方(最终地点)。

  另外还有一个“标识地址”的功能,一个客户可以有多个地址,但只能将一个地址设置为“标识地址”。这也是这个客户的最直接的地址。如果客户是一家公司,那就是公司总部的地址。

3.如何从订单关联到客户地址、客户名称

  客户地址关联关系:

  oe_order_headers_all -> hz_cust_site_uses_all -> hz_cust_acct_sites_all -> hz_party_sites -> hz_locations

  客户名称的关联关系:

  oe_order_headers_all -> hz_cust_accounts -> hz_parties

  销售订单到客户收货地址关联关系:

  oe_order_headers_all -> hz_cust_site_uses_all -> hz_cust_acct_sites_all -> hz_party_sites -> hz_locations -> hz_parties

  

代码
select ooh.order_number,/*订单号*/
       hps.party_id,
/*客户id*/
       hp.party_number, 
/*客户number*/
       hp.party_name,   
/*客户名称*/
       hps.party_site_id,
       hps.party_site_number,       
       hl.location_id,
       hl.country,
       hl.address1,
       hl.address2,
       hl.address3, 
       hl.address4 
 
from oe_order_headers_all   ooh, 
      hz_cust_site_uses_all  hcsua, 
      hz_cust_acct_sites_all hcasa,  
      hz_party_sites         hps, 
      hz_locations           hl, 
      hz_parties             hp 
where ooh.ship_to_org_id = hcsua.site_use_id 
  
and hcsua.cust_acct_site_id = hcasa.cust_acct_site_id 
  
and hcasa.party_site_id = hps.party_site_id
  
and hl.location_id = hps.location_id 
  
and hps.party_id = hp.party_id 
  
and ooh.order_number = '50064'

 

--收单地址

 

代码
select ooh.order_number,/*订单号*/ 
       hps.party_id,    
/*客户id*/ 
       hp.party_number, 
/*客户number*/
       hp.party_name,   
/*客户名称*/ 
       hps.party_site_id, 
       hps.party_site_number,  
       hl.location_id, 
       hl.country, 
       hl.address1, 
       hl.address2, 
       hl.address3, 
       hl.address4  
from oe_order_headers_all   ooh, 
     hz_cust_site_uses_all  hcsua, 
     hz_cust_acct_sites_all hcasa,   
     hz_party_sites         hps, 
     hz_locations           hl,
     hz_parties             hp 
where ooh.invoice_to_org_id = hcsua.site_use_id(+
  
and hcsua.cust_acct_site_id = hcasa.cust_acct_site_id(+)   
  
and hcasa.party_site_id = hps.party_site_id(+
  
and hl.location_id(+= hps.location_id 
  
and hps.party_id = hp.party_id 
  
and ooh.order_number = '50064'

 

 

hz_cust_site_uses_all 上面的site_user_code = BILL_TO 代表是收单方,primary_flag等于Y就是主要收单方


收货地址site_uses_id

收单方bill_to_xxx_id

CCID:gl_xx_rec

posted @ 2009-12-14 21:50  郭振斌  阅读(2129)  评论(0编辑  收藏  举报