问题现象: |
入库单与发票之间进行单据联查时发现错误 一、在入库单中联查的发票不是与该笔入库单对应结算的发票。例:入库单单号104 二、在入库单主表的cbuscode字段下有发票号且此发票号与入库能对应上,但联查不到发票。例:入库单号00000017号 |
问题原因: |
问题原因: 入库单联查发票是根据PurSettleVouchs.iRdsID字段上记录的RdRecords.AutoID查询的。 错误的原因是:
1)此字段上已经结算的记录为空;
2)此字段上记录与RdRecords.AutoID上记录不对应; 使用下面的语句可以测试出来:
select *
from PurBillVouchs
INNER JOIN PurBillVouch on PurBillVouchs.PbVID=PurBillVouch.PbVID
inner join PurSettleVouchs ON PurBillVouch.cPBVCode = PurSettleVouchs.cBillCode
WHERE (PurBillVouchs.RdsId<>PurSettleVouchs.iRdsID or PurBillVouchs.RdsId is null )
and (PurBillVouchs.dsdate is not null) |
解决方案: |
将不对应的PurSettleVouchs.iRdsID修改成对应的RdRecords.AutoID。可用如下语句修改,修改前做好备份工作:
update PurBillVouchs
set PurBillVouchs.RdsId=PurSettleVouchs.iRdsID
FROM PurBillVouchs
INNER JOIN PurBillVouch on PurBillVouchs.PbVID=PurBillVouch.PbVID
inner join PurSettleVouchs ON PurBillVouch.cPBVCode = PurSettleVouchs.cBillCode
WHERE (PurBillVouchs.RdsId<>PurSettleVouchs.iRdsID or PurBillVouchs.RdsId is null )
and (PurBillVouchs.dsdate is not null) |
相关补丁: |
|
版本: |
8.51 |
模块: |
采购管理 |
产品: |
U851----采购管理 |
问题名称: |
入库单联查出错 |
最后更新: |
2005-06-28 00:00:00 |