exptraderid int
)
insert into @Traderid(traderid, exptraderid)
select traderid, [id] from crm_trader where id in
(select distinct traderid from b_expense where traderid is not null)
--select * from @Traderid
delete from crm_trader
delete from crm_linkman
exec crm_XpUpdate
declare @tradid int, @exptraderid int, @id int
declare upt cursor local optimistic forward_only for
select traderid,exptraderid from @Traderid
open upt
fetch next from upt into @tradid,@exptraderid
while @@fetch_status
= 0
begin
select @id = id from crm_trader where traderid = @tradid
update b_expense
set traderid = @id
where traderid = @exptraderid
fetch next from upt into @tradid,@exptraderid
end
close upt
deallocate upt
5、点击会计科目打不开、进入时没有反映的处理方法:
是因为用户采用的是总帐下设,
并且用户将相关的预收帐款和预付帐款会计科目删除掉了。所以出现该问题
只能一条条在al_subject表中增加进去!
6、发现货品资料和帐面库存成本不对处理方法:
A、先将底稿表里面的所以成本标志改为1(未算成本状态)执行下列语句:
update aa_billflow set status=1
update aa_onhand set status=1
B、然后重算成本执行下列语句:
exec aa_costcaculator
C、 如果发现还不对,再执行以下语句
exec aa_rebuildrealqty(算实际库存)
exec aa_rebuild_quantity(关键存储过程重算成本)
exec aa_rebuildusedqty(算占用数量)
exec
aa_recostcaculator(重算所有成本)
7、MRP运算时提示“traderid不能为空”解决办法
该问题是由于往来单位已经被删除,但是在货品资料的存货信息中对应了该主往来单位ID。所以造成在MRP运算的时候下达采购建议的时候检测主往来ID的时候检测不到造成的。
处理方法:
先在后台数据库总查找出所有的出现该问题的货品:
select * from l_goods where traderid not in (select traderid from l_trader)
记录所有货品的编码,然后进入软件里面将所有有问题的货品的主往来单位重新选择一下!
12、算成本的时候提示什么表中不能插入空值的处理方法!
该问题是由于提示的表跟底稿表明细号对应不上造成的
declare @billid int
declare @itemno int
declare cur cursor for select billid,abs(itemno) from aa_billflow where billtype=26
open cur
fetch next from cur into @billid , @itemno
while @@fetch_status = 0
begin
if not exists(select * from i_allotdetail where billid=@billid and itemno=@itemno)
print @billid
fetch next from cur into @billid , @itemno
end
close cur
deallocate cur
billtype该字段是对应的单据类型ID。请去L_BillType 表中查找对应的报错信息中提示的单据
/*通过上面的语句查出抱错表跟底稿表明细号不同的单据*/
将该单据删除重做即可!
13、算成本提示某货品成本溢出处理方法
该问题是由于货品成本异常,成本上亿或者负亿造成的。
A、先在L_GOODS中找到该货品的GOODSID
select * from l_goods where code='货品编码'
B、然后在底稿表AA_BILLFLOW中找到该货品的相关记录
select * from aa_billflow where goodsid='货品ID'
C、然后按price ,amount,eprice,eamount.这几个字段分别排序。
看是哪个成本非常大或者非常小。已经上亿了。
select * from aa_billflow where goodsid='货品ID' order by price
select * from aa_billflow where goodsid='货品ID' order by amount
select * from aa_billflow where goodsid='货品ID' order by eprice
select * from aa_billflow where goodsid='货品ID' order by eamount
D、这四条查询语句不是一定都要执行。你自己要看是上面列举的哪个字段异常。
一般是金额异常。。单价也异常。不过不能光改单价。还要更新金额。先更新单价
再更新金额。
E、更新单价
update aa_billflow set price='正确成本价'where goodsid='货品ID'
update aa_billflow set eprice='正确成本价'where goodsid='货品ID'
上面两条更新语句一般看哪个价格不对。就更新哪个字段。一般是都要更新。
F、更新金额
update aa_billflow set amount=price*quantity where goodsid='货品ID'
update aa_billflow set eamount=eprice*eqty where goodsid='货品ID'