问题现象: |
在客户档案里将客户编码为1807的客户并到1801客户时,提示:基础档案中使用,不可并户. |
问题原因: |
问题分析: 1、此问题是由于在升级前委托代销发货单数据写到 endispatch(s) 表中,升级后将此部分数据写到 dispatchlist (s)表中以字段‘cbustype’='委托代销'的形式体现,而升级后委托代销业务数据在 endispatch(s) 表中还存在记录。 2、在并户过程中,程序首先会将源客户编码为1807的字段在各个已使用表中的记录都替换为目标客户编码1801,再修改客户档案1807的总公司为1801的总公司后将1807删除。而在调用到存储过程sp_UniteArchive_Pu 时出现错误,没有将 endispatch 表中的 1807客户编码替换为1801,造成在此表中还存在1807的记录,所以后续的操作都将终止。 |
解决方案: |
解决办法:(请做好数据备份) 修改存储过程,将 endispatch 表中需要并户的客户编码进行更新。请在查询分析器中选择您的账套及当前年度,执行如下存储过程 : ALTER PROCEDURE [sp_UniteArchive_Pu] @ArchiveType varchar(50), @cDestCode varchar(20), @cSourceCode varchar(20) AS if @ArchiveType='vendor' begin update po_poMain set cVenCode=@cDestCode where cVencode=@cSourceCode update purbillvouch set cVenCode=@cDestCode where cVencode=@cSourceCode update purbillvouch set cUnitcode=@cDestCode where cUnitcode=@cSourceCode update purSettlevouch set cVenCode=@cDestCode where cVencode=@cSourceCode update PU_AppVouchs set cVenCode=@cDestCode where cVencode=@cSourceCode update PU_ArrivalVouch set cVenCode=@cDestCode where cVencode=@cSourceCode delete ven_inv_price_ruleitem from ven_inv_price_ruleitem inner join ven_inv_price_rule on ven_inv_price_rule.id =ven_inv_price_ruleitem.id and ven_inv_price_rule.cvencode=@cSourceCode delete from ven_inv_price_rule where ven_inv_price_rule.cvencode=@cSourceCode update pp_ppcdetails set cVenCode=@cDestCode where cVencode=@cSourceCode update pp_ppcquota set cVenCode=@cDestCode where cVencode=@cSourceCode update pp_productpo set cVenCode=@cDestCode where cVencode=@cSourceCode end if @ArchiveType='customer' begin update SO_SOMain set cCusCode=@cDestCode where cCuscode=@cSourceCode update dispatchlist set cCusCode=@cDestCode where cCuscode=@cSourceCode update endispatch set cCusCode=@cDestCode where cCuscode=@cSourceCode update salebillvouch set cCusCode=@cDestCode where cCuscode=@cSourceCode update sa_settlevouch set cCusCode=@cDestCode where cCuscode=@cSourceCode update expensevouch set cCusCode=@cDestCode where cCuscode=@cSourceCode update SA_WrapLease set cCusCode=@cDestCode where cCuscode=@cSourceCode update salepayvouch set cCusCode=@cDestCode where cCuscode=@cSourceCode update SA_QuoMain set cCusCode=@cDestCode where cCuscode=@cSourceCode if exists(select ccuscode from SA_CusUPrice where ccuscode=@cDestCode) delete from SA_CusUPrice where ccuscode=@cSourceCode else update SA_CusUPrice set cCusCode=@cDestCode where cCuscode=@cSourceCode if exists(select ccuscode from SA_ClassDisRate where ccuscode=@cDestCode) delete from SA_ClassDisRate where ccuscode=@cSourceCode else update SA_ClassDisRate set cCusCode=@cDestCode where cCuscode=@cSourceCode end if @ArchiveType='inventory' begin update po_podetails set cInvCode=@cDestCode where cInvcode=@cSourceCode update purbillvouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update purbillvouchs set ccorinvcode=@cDestCode where cInvcode=@cSourceCode update pursettlevouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update pu_appvouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update pu_arrivalvouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update pp_ppcdetails set cInvCode=@cDestCode where cInvcode=@cSourceCode update pp_ppcquota set cInvCode=@cDestCode where cInvcode=@cSourceCode update pp_rmrpdetails set cInvCode=@cDestCode where cInvcode=@cSourceCode update pp_forecastdetails set cInvCode=@cDestCode where cInvcode=@cSourceCode update pp_pomain set cInvCode=@cDestCode where cInvcode=@cSourceCode update so_sodetails set cInvCode=@cDestCode where cInvcode=@cSourceCode update salebillvouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update salepayvouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update expensevouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update sa_wraplease set cInvCode=@cDestCode where cInvcode=@cSourceCode update sa_quodetails set cInvCode=@cDestCode where cInvcode=@cSourceCode update sa_settlevouchs set cInvCode=@cDestCode where cInvcode=@cSourceCode update pricejustify set cInvCode=@cDestCode where cInvcode=@cSourceCode update sa_invuprice set cInvCode=@cDestCode where cInvcode=@cSourceCode update sa_cusuprice set cInvCode=@cDestCode where cInvcode=@cSourceCode update dispatchlists set cInvCode=@cDestCode where cInvcode=@cSourceCode update endispatchs set cInvCode=@cDestCode where cInvCode=@cSourceCode update sa_quantitydisrate set cInvCode=@cDestCode where cInvcode=@cSourceCode update sa_quodetails set cInvCode=@cDestCode where cInvcode=@cSourceCode delete from lowlevel where cinvcode=@cSourceCode if exists(select cinvcode from SA_saleplan where cinvcode=@cDestCode) delete from SA_saleplan where cinvcode=@cSourceCode else update SA_saleplan set cinvcode=@cDestCode where cinvcode=@cSourceCode end GO |
相关补丁: |
|
版本: |
8.52 |
模块: |
企业门户 |
产品: |
U852----企业门户 |
问题名称: |
客户档案无法并户 |
最后更新: |
2005-08-16 00:00:00 |