單據(jù)記賬時(shí)不選‘包含未開(kāi)發(fā)票的出庫(kù)單’選項(xiàng),篩選出來(lái)的單據(jù)也包含一些未開(kāi)發(fā)票的
發(fā)布于:2018-03-16 09:21:42
問(wèn)題現(xiàn)象:在[821存貨核算]模塊中,銷售出庫(kù)單進(jìn)行單據(jù)記賬時(shí),不選‘包含未開(kāi)發(fā)票的出庫(kù)單’選項(xiàng),篩選出來(lái)的單據(jù)也包含一些未開(kāi)發(fā)票的,都是以前年度記過(guò)帳的
解決方案:若該單據(jù)確已在以前年度記過(guò)帳,執(zhí)行以下語(yǔ)句即可: update rdrecord set caccounter=‘吳真‘ where id in SELECT rdrecord.id FROM Warehouse INNER JOIN Rd_Style RIGHT JOIN RdRecord ON Rd_Style.cRdCode = RdRecord.cRdCode ON Warehouse.cWhCode = RdRecord.cWhCode INNER JOIN RdRecords ON RdRecord.ID = RdRecords.ID INNER JOIN Inventory ON RdRecords.cInvCode = Inventory.cInvCodeleft join dispatchlists on rdrecords.idlsid=dispatchlists.idlsid left join dispatchlist on dispatchlists.dlid=dispatchlist.dlid left join salebillvouchs sales1 on dispatchlists.idlsid=sales1.idlsid left join salebillvouch sale1 on sales1.sbvid=sale1.sbvid left join salebillvouchs sales2 on rdrecords.isbsid=sales2.autoid left join salebillvouch sale2 on sales2.sbvid=sale2.sbvid Where IsnullRdRecords.iQuantity,0<>0 And RdRecord.cAccounter IS NULL and sale1.caccounter is null and sale2.caccounter is null and sale1.cinvalider is null and sale2.cinvalider is null and isnullrdrecord.cbustype,‘‘<>‘委托代銷‘ and cMonth is null or rightcMonth,2<2 and rdrecord.cVouchType<>‘33‘ and not rdrecord.cVouchType=‘32‘ or rdrecord.cvouchtype=‘34‘ and ISNULLSALES1.IDLSID,0=0 AND ISNULLRDRECORDS.ISBSID,‘‘=‘‘ and RdRecord.cVouchType=‘32‘ and not rdrecords.isbsid is null OR not sales1.autoid is null or RdRecord.cVouchType=‘34‘ and RdRecord.caccounter is null and RdRecord.dDate <= ‘2004-02-29‘