在存货做12月的期未处理时提示 :尚有单据为部分记账状态,不能进行12月的期未处理?
解决过程:
1、检查未发现有未记账的单据,也不存在已经暂估未进行结算处理的单据。在技术支持网上也搜索了一些办法:1、检查一下RdRecord/RdRecords表的dKeepDate记账日期、cAccounter记账人是否有异常
2、检查是否发票中有部分记录是退补型的记录,这部分记录本来是不需要记账的,但是其记账需要记账标志被错误的置成1了,系统校验的时候会报错,可以尝试用以下语句检查:
SELECT *
FROM SaleBillVouchs
WHERE iTB=1 AND bcosting=1
如果以上语句有记录,则说明存在问题,需要修改,可用如下语句修改:
UPDATE SaleBillVouchs
SET bcosting=0
WHERE iTB=1 AND bcosting=1
包括的年结的PPT上面也有这样的问题解析。
3、数据库跟踪,无发现明显错误提示。
你的语句有错误把,暂估的是采购结算表有问题,而你的语句是更新销售发票的,应该是:
select * from pursettlevouchs where baccount=0
update pursettlevouchs
set bAccount=1
from ((rdrecord inner join rdrecords on rdrecord.id=rdrecords.id)
left join pursettlevouchs on rdrecords.autoid=pursettlevouchs.irdsid)
where (not rdrecord.caccounter is null)
and pursettlevouchs.bAccount=0
and isnull(rdrecords.iquantity,0)=isnull(rdrecords.isquantity,0)
执行以下语句看有无记录(872跟踪而来),尤其注意折扣属性的存货:
select Top 1 A.AutoID from Rdrecords A
Inner Join RdRecords B On A.ID = B.ID
Inner Join RdRecord C On A.ID = C.ID
Where IsNull(A.cBAccounter, N'') = N'' And IsNull(B.cBAccounter, N'') <> N''
And ((IsNull(C.bPuFirst,0)=0 And IsNull(C.bIsSTQc,0)=0 )Or IsNull(C.bIAFirst,0)=1) And A.bCosting = 1 And B.bCosting = 1 And IsNull(A.iQuantity,0) <> 0 And IsNull(B.iQuantity,0) <> 0
AND exists (Select cinvcode From IA_PerdealInventory where IA_PerdealInventory.cinvcode=A.cinvcode OR IA_PerdealInventory.cinvcode=B.cinvcode)
AND exists (select cwhdepcode from Ia_PerDealWhDep where Ia_PerDealWhDep.cwhdepcode=C.cWhCode)
go
select Top 1 A.AutoID from Pu_T_VmiUsedVouchs A
Inner Join Pu_T_VmiUsedVouchs B On A.ID = B.ID
Inner Join Pu_T_VmiUsedVouch C On A.ID = C.ID
Where IsNull(A.cBAccounter, N'') = N'' And IsNull(B.cBAccounter, N'') <> N''
And (IsNull(C.bPuFirst,0)=0 Or IsNull(C.bIAFirst,0)=1) And A.bCosting = 1 And B.bCosting = 1
AND exists (Select cinvcode From IA_PerdealInventory where IA_PerdealInventory.cinvcode=A.cinvcode OR IA_PerdealInventory.cinvcode=B.cinvcode)
AND exists (select cwhdepcode from Ia_PerDealWhDep where Ia_PerDealWhDep.cwhdepcode=A.cWhCode)
AND isnull(C.cVerify,N'')<>N''
go
select Top 1 A.AutoID from Dispatchlists A
INNER join dispatchlist on dispatchlist.DLID = A.DLID
Inner Join Dispatchlists B On A.DLID = B.DLID
Where IsNull(A.cBAccounter, N'') = N'' And IsNull(B.cBAccounter, N'') <> N''
And A.bCosting = 1 And B.bCosting = 1
AND exists (Select cinvcode From IA_PerdealInventory where IA_PerdealInventory.cinvcode=A.cinvcode OR IA_PerdealInventory.cinvcode=B.cinvcode)
AND exists (select cwhdepcode from Ia_PerDealWhDep where Ia_PerDealWhDep.cwhdepcode=A.cWhCode)
AND isnull(dispatchlist.cVerifier,N'')<>N''
go
select Top 1 A.AutoID from SaleBillVouchs A
inner join salebillvouch on A.SBVID=salebillvouch.SBVID
Inner Join SaleBillVouchs B On A.SBVID = B.SBVID
Where IsNull(A.cBAccounter, N'') = N'' And IsNull(B.cBAccounter, N'') <> N''
And A.bCosting = 1 And B.bCosting = 1
AND exists (Select cinvcode From IA_PerdealInventory where IA_PerdealInventory.cinvcode=A.cinvcode OR IA_PerdealInventory.cinvcode=B.cinvcode)
AND exists (select cwhdepcode from Ia_PerDealWhDep where Ia_PerDealWhDep.cwhdepcode=A.cWhCode OR Ia_PerDealWhDep.cwhdepcode=B.cWhCode)
AND ISNULL(salebillvouch.cchecker,N'')<>N''
go
select Top 1 A.PBVID As AutoID from PurBillVouchs A
Inner Join PurBillVouchs B On A.PBVID = B.PBVID
Inner Join PurBillVouch C On A.PBVID = C.PBVID
Where IsNull(A.cBAccounter, N'') = N'' And IsNull(B.cBAccounter, N'') <> N''
And C.cBusType = N'直运采购' And A.bCosting = 1 And B.bCosting = 1
AND exists (Select cinvcode From IA_PerdealInventory where IA_PerdealInventory.cinvcode=A.cinvcode OR IA_PerdealInventory.cinvcode=B.cinvcode)
AND isnull(C.cpbvverifier,N'')<>N''
go
select Top 1 A.AutoID from JustInVouchs A
Inner Join JustInVouchs B On A.cJVCode = B.cJVCode
Inner Join JustInVouch C On A.cJVCode = C.cJVCode
Where IsNull(A.cBAccounter, N'') = N'' And IsNull(B.cBAccounter, N'') <> N''
AND exists (Select cinvcode From IA_PerdealInventory where IA_PerdealInventory.cinvcode=A.cinvcode OR IA_PerdealInventory.cinvcode=B.cinvcode)
AND exists (select cwhdepcode from Ia_PerDealWhDep where Ia_PerDealWhDep.cwhdepcode=C.cWhCode)
go
select Top 1 A.AutoID from v_ex_invoicedetailIA A
inner join v_ex_invoiceIA on A.id=v_ex_invoiceIA.id
Inner Join v_ex_invoicedetailIA B On A.ID = B.ID
Where IsNull(A.cBAccounter, N'') = N'' And IsNull(B.cBAccounter, N'') <> N''
And A.bCosting = 1 And B.bCosting = 1
AND exists (Select cinvcode From IA_PerdealInventory where IA_PerdealInventory.cinvcode=A.cinvcode or IA_PerdealInventory.cinvcode=B.cinvcode)
AND isnull(v_ex_invoiceIA.cverifier,N'')<>N''
go
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/669660/viewspace-741766/
,如需转载,请注明出处,否则将追究法律责任。