用友u8软件核算记账单价翻倍
2018-07-11 17:44 来源:用友
核算记账单价翻倍原因分析:采购优化流程一张采购入库单应对应一张采购结算单,出现问题原因是优化流程下,一张采购入库单对应多张结算单。问题解答:更新脚本(注意备份数据):BeginDeclare @ID intBEGINBEGIN TRANSACTIONDECLARE PSV CURSOR FOR SELECT Distinct PSVID FROM PurSettleVouchs WHERE ID Not In (SELECT ps.id FROM RdRecord r join RdRecords rs on (r.id = rs.id) join PurSettleVouchs ps on (ps.iRdsID = rs.AutoID and r.cCode = ps.cPIVCode) )OPEN PSVFETCH NEXT FROM PSV INTO @IDWHILE @@FETCH_STATUS = 0BEGIN--删除结算单明细表DELETE FROM PurSettleVouchs WHERE PurSettleVouchs.PSVID = @ID IF (@@ERROR 0)Begin RollBack TRANSACTIONCLOSE PSVDEALLOCATE PSVReturnEndELSEBEGIN--删除结算单主表DELETE FROM PurSettleVouch WHERE PSVID = @IDENDPrint @IDFETCH NEXT FROM PSV INTO @IDEND ENDCOMMIT TRANSACTIONCLOSE PSVDEALLOCATE PSVEnd