问题原因: |
问题一:
收发存汇总表:7月期初对帐相符,说明7月份收入、发出金额有问题,查询库存商品科目总帐,数值分别如下:
收发存汇总表:收入12293872.38,发出11654527.10
库存商品科目总帐:借方12408056.14,贷方11654527.10
从上述数值看收入对不上。
先从存货与总帐对帐查看:
存货系统借方:1278313.40,总帐系统借方:12408056.14
存货系统借方与收发存汇总表收入数对不上,说明有未生成凭证的记录。
SELECT SUM(iAInPrice) AS SUM
FROM IA_Subsidiary
WHERE (iMonth = 7) AND (cPZID IS NULL)
11015558.98+1278313.40=12293872.38
问题二:查询存货明细账中所有结算报销的入库单和蓝字回冲单金额与本月采购发票总金额不等。
--查询存货明细账中所有结算报销的入库单和蓝字回冲单金额
select sum(iainprice),sum(iainquantity)
from ia_subsidiary
where imonth=7 and ((cvoutype='01' and bflag<>1) or (cvoutype='30' and bflag=2))
--11070768.3800 4549.0
--查询本月采购发票总金额
SELECT sum(isvprice),sum(isvquantity)
FROM PurSettleVouchs INNER JOIN
PurSettleVouch ON PurSettleVouchs.PSVID = PurSettleVouch.PSVID
WHERE (PurSettleVouch.dSVDate >= CONVERT(DATETIME, '2004-07-01 00:00:00', 102)) AND
(PurSettleVouch.dSVDate <= CONVERT(DATETIME, '2004-07-31 00:00:00', 102))
--11129742.7400 4564.0
两者相差58974.36,15
对比缺少的id号
SELECT PurSettleVouchs.iRdsID
FROM PurSettleVouchs INNER JOIN
PurSettleVouch ON PurSettleVouchs.PSVID = PurSettleVouch.PSVID
WHERE (PurSettleVouch.dSVDate >= CONVERT(DATETIME, '2004-07-01 00:00:00', 102)) AND
(PurSettleVouch.dSVDate <= CONVERT(DATETIME, '2004-07-31 00:00:00', 102)) and (PurSettleVouchs.iRdsID not in (
SELECT id
FROM IA_Subsidiary
WHERE (iMonth = 7) AND (cVouType = '01') AND (bFlag <> 1) OR
(iMonth = 7) AND (cVouType = '30') AND (bFlag = 2)))
iRdsID=20819
036893单据,存货明细账ID=20819的记录在7月份结算后,没有在存货系统中暂估结算成本处理。
|