R12客户表结构分析
HZ_PARTIES
客户账户表
HZ_CUST_ACCOUNTS
例子:
select hp.party_number --客户注册标识
,
hp.party_name --组织名/客户
,
hp.known_as --别名
,
hp.organization_name_phonetic --名称拼音
,
acc.account_number --帐号
,
flv_sale.meaning sales_channel_code --销售渠道
,
acc.account_name --账记说明
,
flv_customer.meaning customer_class_code --分类
,
acc.orig_system_reference --参考
,
flv_status.meaning status --状态
,
flv_type.meaning customer_type --账户类型
,
acc.attribute_category --上下文
,
acc.attribute1 --注册
,
acc.attribute2 --人员推广
,
acc.attribute3 --特殊要求
,
acc.attribute4 --发货单是否打印价格
,
acc.attribute5 --所属利润
from hz_parties hp,
hz_cust_accounts acc,
fnd_lookup_values flv_sale --销售渠道
,
fnd_lookup_values flv_customer --分类
,
fnd_lookup_values flv_status --状态
,
fnd_lookup_values flv_type --账户类型
where hp.party_id = acc.party_id
and acc.sales_channel_code = flv_sale.lookup_code
and flv_sale.lookup_type = 'SALES_CHANNEL'
and flv_sale.language = userenv('LANG')
and acc.customer_class_code = flv_customer.lookup_code
and flv_customer.lookup_type = 'CUSTOMER CLASS'
and flv_customer.language = userenv('LANG')
and acc.status = flv_status.lookup_code
and flv_status.lookup_type = 'HZ_CPUI_REGISTRY_STATUS'
and flv_status.language = userenv('LANG')
and acc.customer_type = flv_type.lookup_code
and flv_type.lookup_type = 'CUSTOMER_TYPE'
and flv_type.language = userenv('LANG')
and hp.party_id = hz_parties.party_id;
HZ_CUSTOMER_PROFILES
字段
cust_account_role_id --oe_order_headers.sold_to_contract_id
cust_account_id
site_use_id --客户头的该字段为空
--客户地点层为hz_cust_site_uses_all.site_use_id
配置文件金额
HZ_CUST_PROFILE_AMTS --客户头层/客户地点层
关联:hz_customer_profiles.cust_account_profile_id
客户联系人
HZ_CUST_ACCOUNT_ROLES --客户头层/地点层
cust_account_id
cust_acct_site_id --头层该字段为空
party_id --类型为 PARTY_RELATIONSHIP 的 PARTY_ID
role_type --CONTACT
以头层的联系人为例
select hp_per.*
from hz_cust_account_roles rol,
hz_parties hp_rel,
hz_relationships rel,
hz_parties hp_per
where rol.party_id = hp_rel.party_id
and hp_rel.party_id = rel.party_id
and rel.object_type = 'PERSON'
and rel.relationship_code = 'CONTACT'
and rel.object_id = hp_per.party_id
and rol.cust_acct_site_id is null --头层
and rol.cust_account_id = hz_cust_accounts.cust_account_id;
HZ_CONTACT_POINTS
字段
owner_table_name HZ_PARTIES/HZ_PARTY_SITES
owner_table_id PARTY_ID/PARTY_SITE_ID
客户地点层的联系方式,直接用party_site_id 关联 owner_table_id 即可
客户头层的联系方式,要用 HZ_RELATIONSHIPS 表转换一下,与 hz_relationships.party_id 关联
客户联系人下面的联系方式,要用HZ_CUST_ACCOUNT_ROLES的PARTY_ID关联owner_table_id
例子:
客户头层
select con.*
from hz_parties hp,
hz_relationships rel,
hz_contact_points con
where hp.party_id = rel.subject_id
and rel.subject_type = 'ORGANIZATION'
and rel.party_id = con.owner_table_id
and con.owner_table_name = 'HZ_PARTIES'
and hp.party_id = hz_parties.party_id;
--客户地点层
select *
from hz_contact_points con
where con.owner_table_id = hz_party_sites.party_site_id;
--客户联系人下的联系方式
select *
from hz_contact_points c
where c.owner_table_id = hz_cust_account_roles.party_id
客户的税
HZ_CODE_ASSIGNMENTS 会计分类/客户头层/地点层
字段
OWNER_TABLE_NAME 关联表名/'ZX_PARTY_TAX_PROFILE'
OWNER_TABLE_ID 关联表主键/PARTY_TAX_PROFILE_ID
CLASS_CODE 会计分类代码
ZX_PARTY_TAX_PROFILE 供应商的税的配置文件
字段
PARTY_TYPE_CODE 类型 THIRD_PARTY/THIRD_PARTY_SITE
PARTY_ID 关联表 HZ_PARTIES/HZ_PARTY_SITES
头层: PARTY_TYPE_CODE = 'THIRD_PARTY'
AND PARTY_ID = HZ_PARTIES.PARTY_ID
地点层: PARTY_TYPE_CODE = 'THIRD_PARTY_SITE'
AND PARTY_ID = HZ_PARTY_SITES.PARTY_SITE_ID
REP_REGISTRATION_NUMBER 纳税登记编号
PARTY_TAX_PROFILE_ID 主键
HZ_CLASS_CODE_DENORM 会计分类描述
ZX_EXEMPTIONS 客户免税/ 客户头层/地点层
字段
PARTY_TAX_PROFILE_ID 关联 ZX_PARTY_TAX_PROFILE.PARTY_TAX_PROFILE_ID
客户地点
HZ_PARTY_SITES
地点地址
HZ_LOCATIONS
客户地点帐户表
HZ_CUST_ACCT_SITES_ALL
客户地点业务目的
HZ_CUST_SITE_USES_ALL
滞纳费用
HZ_CUSTOMER_PROFILES
--由销售订单分析客户结构
select h.sold_from_org_id, --业务实体/ORG ID
h.sold_to_org_id, --客户
h.ship_from_org_id, --发货仓库
h.ship_to_org_id, --收货方
h.invoice_to_org_id,
h.sold_to_contact_id
from oe_order_headers_all h;--业务实体
select org.name
from hr_organization_units org
where org.organization_id = oe_order_headers_all.sold_from_org_id;
--客户
select hz.party_name
from hz_cust_accounts acc,
hz_parties hz
where acc.party_id = hz.party_id
and acc.cust_account_id = oe_order_headers_all.sold_to_org_id;
--发货仓库
select para.organization_code,
para.*
from mtl_parameters para
where para.organization_id = oe_order_headers_all.ship_from_org_id; select *
from org_organization_definitions org
where org.organization_id = oe_order_headers_all.ship_from_org_id;
--地点详细信息
select loc.*
from hz_parties hp,
hz_party_sites hps,
hz_locations loc
where hp.party_id = hps.party_id
and hps.location_id = loc.location_id
and hp.party_id = 5042;
--业务目的
select hp.party_name --客户
,
hp.party_number --注册表标识
,
uses.site_use_code,
acnt.account_number --账号
,
flv.meaning businesspurpose --业务目的
,
uses.location --地点
,
acnt.account_name --帐户说明
,
decode(loc.address1, null, loc.address1, loc.address1 || ',') ||
decode(loc.city, null, loc.city, loc.city || ',') ||
decode(loc.state, null, loc.state, loc.state || ',') ||
decode(loc.postal_code, null, ' ', loc.postal_code) address --地点地址
,
hps.party_site_number --地点说明
,
uses.payment_term_id --付款条件
,
site.cust_acct_site_id,
acnt.cust_account_id,
uses.site_use_id
from hz_parties hp,
hz_cust_accounts acnt,
hz_cust_acct_sites_all site,
hz_cust_site_uses_all uses,
hz_party_sites hps,
hz_locations loc,
fnd_lookup_values flv
where hp.party_id = acnt.party_id
and acnt.cust_account_id = site.cust_account_id
and site.cust_acct_site_id = uses.cust_acct_site_id
and hps.party_site_id = site.party_site_id
and loc.location_id = hps.location_id
and uses.site_use_code = flv.lookup_code
and flv.lookup_type = 'SITE_USE_CODE'
and flv.language = userenv('LANG')
and hp.party_id = 5042
and hps.party_site_id = 3023;
--联系人电话/地点层
select phone.phone_number
from hz_contact_points phone
where phone.owner_table_name = 'HZ_PARTY_SITES'
and phone.owner_table_id = :hz_party_sites.party_sites_id;
--联系人/地点层
select hpsub.party_name
from hz_cust_account_roles hcar,
hz_relationships hr,
hz_parties hpsub
where hcar.party_id = hr.party_id
and hr.subject_id = hpsub.party_id
and hcar.role_type = 'CONTACT'
and hr.directional_flag = 'F'
and hcar.cust_account_role_id = :oe_order_headers_all.sold_to_contact_id
and hpsub.status = 'A';
R12客户表结构分析的更多相关文章
- Oracle EBS R12 客户表结构
参考链接: Oracle EBS R12 客户表结构 Oracle EBS中的“客户”."客户地点".‘订单’之间的关系 Oracle EBS中的“客户”."客户地点&q ...
- Sde表结构分析
原文 Sde表结构分析 今天开始想分析一下sde的表结构,希望能够弄明白sde一个要素类的每个Feature是如何存储的. 弄ArcSDE的人都知道,ArcSDE内一个要素类在关系数据库(以MS SQ ...
- EBS 客户表结构
客户表/联系人/PARTY关联 HZ_PARTIES 客户账户表 HZ_CUST_ACCOUNTS SELECT hp.party_number --客户注册标识 , hp.party_name ...
- PHPCMS V9数据库表结构分析
PHPCMS V9可以轻松承载百万级的访问数据,最大的功臣就是PHPCMS良好的数据库结构,在数据库的设计方面,一定是下足了功夫. 一般网站的信息量离这个级别相差甚远,但是了解学习一下PHPCMS ...
- Dynamics CRM 2013 SP1 客户表单界面上联系人subgrid上的添加现有联系人功能缺失
CRM2013打了SP1的同学会发现一个问题,客户关联联系人的1:N关系,在表单subgrid中添加联系人时,只能新建而无法添加现有联系人,而这个现象在之前的版本中是没有的. 我们通过工具ribbon ...
- Grafana关键表结构分析
Grafana默认使用SQLite存储数据表,默认数据库文件存储在/var/lib/grafana/grafana.db中,可以将文件拷贝到Widnows中,使用Navicat for SQLite进 ...
- WordPress数据库及各表结构分析
默认WordPress一共有以下11个表.这里加上了默认的表前缀 wp_ . wp_commentmeta:存储评论的元数据wp_comments:存储评论wp_links:存储友情链接(Blogro ...
- 学习计划 mysql desc表结构分析
在完成数据表建表后,我们需要知道我们的表结构是什么,有没有和构造表时差异的地方. -- 简单查看表结构 desc 表名 这里拿数据库的一张表中做示例 mysql> desc rental; +- ...
- activity工作流表结构分析
版权声明:本文为博主原创文章,未经博主允许不得转载. 1.结构设计 1.1. 逻辑结构设计 Activiti使用到的表都是ACT_开头的. ACT_RE_*: ’RE’表示repository( ...
随机推荐
- 手势识别控制pygame精灵
步骤: 编写简易pygame精灵游戏(只实现键盘上下左右控制) 解决opencv手势识别核心问题 上述2部分对接上 pygame部分我们只加载个背景,然后里面放1只乌龟精灵,用键盘的上下左右键来控制, ...
- 使用FileZilla Pro S3协议访问七牛云对象存储
偶然发现FileZilla还有Pro版本,主要是比免费版多了一些协议支持,也偶然发现七牛云支持了S3协议接口,这样刚好弥补了其没有FTP的不足,于是找官方文档,折腾一下,使用FileZilla Pro ...
- influxdb+Grafana+jmeter监控搭建
安装InfluxDB InfluxDB的简介 InfluxDB 是用Go语言编写的一个开源分布式时序.事件和指标数据库,无需外部依赖. 类似的数据库有Elasticsearch.Graphite等.. ...
- kuangbin专题专题十一 网络流 Going Home POJ - 2195
题目链接:https://vjudge.net/problem/POJ-2195 思路:曼哈顿距离来求每个人到每个房间的距离,把距离当作费用. 就可以用最小费用最大流来解决了,把每个房子拆成两个点,限 ...
- 长连接 Websocket
import json from flask import Flask,request,render_template from geventwebsocket.handler import WebS ...
- 基于快排思想的第(前)k大(小)
算法思路就是根据快排的partition,先随机选择一个分隔元素(或a[0]),将数组分为[小于a[p]的元素] a[p] [大于a[p]的元素],如果这时候n-p+1等于k的话,a[p]就是所求的第 ...
- 编译调试 .NET Core 5.0 Preview 并分析 Span 的实现原理
很久没有写过 .NET Core 相关的文章了,目前关店在家休息所以有些时间写一篇新的
- 我的一个git(码云)之旅
合作开发项目,你就会用到git,现在码云比较简单,因为是中文化界面,学习起来难度比较低,又支持5人以下项目免费,所以学习码云更好入手一点. 下面的东西适合一些个基础比较低的用户学习,因为我就是啊... ...
- Docker(二):理解容器编排工具Kubernetes内部工作原理
一.Kubernetes是什么 要说到Docker就不得不说说Kubernetes.当Docker容器在微服务的环境下数量一多,那么统一的,自动化的管理自然少不了.而Kubernetes就是一个这样的 ...
- ICC教程 - Flow系列 - 概念系列 - ECO (理论+实践+脚本分享)
本文转自:自己的微信公众号<集成电路设计及EDA教程> <ICC教程 - Flow系列 - 概念系列 - ECO (理论+实践+脚本分享)> 这篇推文讲一下数字IC设计中的po ...