|
发表于 2016-4-16 14:43:29
|
显示全部楼层
ufsystem..ua_identity 字段标识描述主表字段子表字段
Rd收发记录主子表Rdrecord.idRdrecords.autoid
BILLVOUCH销售发票主子表SaleBillVouch.SBVID SaleBillVouchs.autoid
DISPATCH发货退货单主子表DispatchList.dlidDispatchLists.idlsid
POMain采购订单主子表PO_Pomain.POIDPO_Podetails.id
SOMain销售订单主子表SO_SOMain.idSO_SODetails.autoid
PURBILL采购发票主子表PurBillVouch.PBVIDPurBillVouchs.ID
PURSTID采购结算单主子表PurSettleVouch.PSVIDPurSettleVouchs.ID
SETTLEVOUCH委托代销结算单主子表SA_SettleVouch.IDSA_SettleVouchs.Autoid
Ju出入库调整单主子表JustInVouch.IDJustInVouch.Autoid
PUAPP采购请购单主子表PU_AppVouch.IDPU_AppVouchs.Autoid
PUARRIVAL采购到货单主子表PU_ArrivalVouch.IDPU_ArrivalVouchs.Autoid
Tr库存调拨单主子表TransVouch.IdTransVouchs.Autoid
EXPENSE代垫费用单主子表ExpenseVouch.IDExpenseVouchs.Autoid
Ch盘点单主子表CheckVouch.ID CheckVouchs.Autoid
Ma限额领料单主子表MatchVouch.IDMatchVouchs.Autoid
SALEPAY销售支出单主子表SalePayVouch.IDSalePayVouchs.Autoid
QUOMAIN销售报价单主子表SA_QuoMain.IDSA_QuoDetails.Autoid
XJ收付款单主子表(销售现结使用)Ap_CloseBill.ccancelnoAp_CloseBills.ID
SK收付款单主子表(收款cCancelNo is null)Ap_CloseBill.iIDAp_CloseBills.ID
OM_MO委外订单主子表OM_MOMain.MoidOM_MODetails.MODetailsID
OM_MS
委外结算主子表OM_MatSettleVouch.MSIDOM_MatSettleVouchs.MSDetailsID
OM_Materials委外用料表OM_MOMaterials.MOIDOM_MOMaterials.MOMaterialsID
对应单据名称 cvouchtype data库中相关联主子表 相关联主子表ID字段标识
采购请购单PuApp PU_AppVouch/s ID/Autoid
采购订单 Pomain PO_Pomain/PO_Podetails POID/ID
采购到货单 PuArrivalPU_ArrivalVouch/s ID/autoid
采购入库单rd Rdrecord/s ID/Autoid
采购发票 Purbill PurBillVouch/s PBVID/ID
销售报价单 QuoMain SA_QuoMain/ SA_QuoDetails ID/Autoid
销售订单 Somain SO_SOMain/SO_SODetails ID/Autoid
销售发(退)货单 DispatchDispatchList/s DLID/Autoid
销售发票 Billvouch SaleBillVouch/s SBVID/Autoid
委托代销发货(退)单Dispatch DispatchList/s DLID/Autoid
委托代销结算单 SettleVouch SA_SettleVouch/s ID/Autoid
委托代销调整单Dispatch DispatchList/s DLID/Autoid
销售调拨单(红、蓝)Billvouch SaleBillVouch/s SBVID/Autoid
销售零售日报(红、蓝)Billvouch SaleBillVouch/s SBVID/Autoid
代垫费用单Expense ExpenseVouch/s ID/Autoid
销售支出单Salepay SalePayVouch/s ID/autoid
委外发票Wwpurbill OM_PurBillVouch/s PBVID/ID
产成品入库单 rd Rdrecord/s ID/Autoid
其他入库单rd Rdrecord/s ID/Autoid
材料出库单rd Rdrecord/s ID/Autoid
其他出库单 rd Rdrecord/s ID/Autoid
调拨单td TransVouch/s ID/Autoid
盘点单 ch CheckVouch/s ID/autoid
限额领料单 ma MatchVouch/s ID/autoid
不合格品记录单 sc ScrapVouch/ScrapVouchs ID/Autoid
不合格品处理单 sc ScrapVouch/ScrapVouchs ID/Autoid
货位调整单 ad AdjustPVouch/s ID/Autoid
应收应付单sk ap_closebill/s IID/ID
下面是对应的更新语句
以002账套2010年度数据为例
update ufsystem..ua_identity Set iFatherId=(Select Max(ID) As ID From UFDATA_002_2010..RdRecord),
iChildId=(Select Max(AutoID) As AutoID From UFDATA_002_2010..RdRecords)
Where cAcc_Id='002' And cVouchType='rd'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(dlID) As ID From UFDATA_002_2010..DISPATCHlist),
iChildId=(Select Max(AUTOID) As AutoID From UFDATA_002_2010..DISPATCHlists)
Where cAcc_Id='002' And cVouchType='dispatch'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(SBVID) As ID From UFDATA_002_2010..SaleBillVouch),
iChildId=(Select Max(AutoID) As AutoID From UFDATA_002_2010..SaleBillVouchs)
Where cAcc_Id='002' And cVouchType='billvouch'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(poid) As ID From UFDATA_002_2010..po_POMain),
iChildId=(Select Max(id) As AutoID From UFDATA_002_2010..po_podetails)
Where cAcc_Id='002' And cVouchType='POMain'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..JustInVouch),
iChildId=(Select Max(autoid) As AutoID From UFDATA_002_2010..JustInVouchs)
Where cAcc_Id='002' And cVouchType='ju'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..PU_ArrivalVouch),
iChildId=(Select Max(autoid) As AutoID From UFDATA_002_2010..PU_ArrivalVouchs)
Where cAcc_Id='002' And cVouchType='puarrival'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..PU_ArrivalVouch),
iChildId=(Select Max(autoid) As AutoID From UFDATA_002_2010..PU_ArrivalVouchs)
Where cAcc_Id='002' And cVouchType='puarrival'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..PU_AppVouch),
iChildId=(Select Max(autoid) As AutoID From UFDATA_002_2010..PU_AppVouchs)
Where cAcc_Id='002' And cVouchType='puapp'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(pbvid) As ID From UFDATA_002_2010..PurBillVouch),
iChildId=(Select Max(id) As AutoID From UFDATA_002_2010..PurBillVouchs)
Where cAcc_Id='002' And cVouchType='purbill'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(psvid) As ID From UFDATA_002_2010..PurSettleVouch),
iChildId=(Select Max(id) As AutoID From UFDATA_002_2010..PurSettleVouchs)
Where cAcc_Id='002' And cVouchType='PURSTID'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..SA_QuoMain),
iChildId=(Select Max(autoid) As AutoID From UFDATA_002_2010..SA_Quodetails)
Where cAcc_Id='002' And cVouchType='QUOMAIN'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..SO_SOMain),
iChildId=(Select Max(isosid) As isosidFrom UFDATA_002_2010..SO_SOdetails)
Where cAcc_Id='002' And cVouchType='somain'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(iid) As ID From UFDATA_002_2010..Ap_CloseBill),
iChildId=(Select Max(id) As AutoID From UFDATA_002_2010..Ap_CloseBills)
Where cAcc_Id='002' And cVouchType='sk'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..TransVouch),
iChildId=(Select Max(autoid) As AutoID From UFDATA_002_2010..TransVouchs)
Where cAcc_Id='002' And cVouchType='tr'
go
update ufsystem..ua_identity Set iFatherId=(Select Max(id) As ID From UFDATA_002_2010..ExpenseVouch),
iChildId=(Select Max(autoid) As AutoID From UFDATA_002_2010..ExpenseVouchS)
Where cAcc_Id='002' And cVouchType='EXPENSE'
go
|
|