找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
查看: 615|回复: 4

[求助] 存货年末结账提示不能插入NULL值

[复制链接]
发表于 2024-1-13 15:36:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
数据库追踪的语句到这里就停止了
Insert into IA_subsidiary (bRdFlag,dvoudate,dKeepDate,iYear,iMonth,cInvHead,cVouType,cWhCode,cInvCode,
iAInQuantity,iInCost,iAInPrice,cAccounter,cMaker,cPzID,cfree1,cfree2,cfree3,cfree4,cfree5,cfree6,cfree7,cfree8,cfree9,cfree10,cBatchIA,cDefine7)
SELECT 1,'2023-12-31','2024-01-01',2024 as iyear,0 as imonth,IA_Subsidiary_Pre.cInvHead, N'34' As cVouType, IA_Subsidiary_Pre.cWhCode,
IA_Subsidiary_Pre.cInvCode,
IA_Subsidiary_Pre.SumQ, cast(str(case when IA_Subsidiary_Pre.cValueType=N'计划价法' or IA_Subsidiary_Pre.cValueType=N'售价法' then InvCheckFreeIA870.fInvRCost else (case when IA_Subsidiary_Pre.SumQ<>0 then IA_Subsidiary_Pre.SumM/IA_Subsidiary_Pre.SumQ else 0 end) end,38,3) as float),
IA_Subsidiary_Pre.SumM,null,N'主管审核','0',
IA_Subsidiary_Pre.cfree1,IA_Subsidiary_Pre.cfree2,IA_Subsidiary_Pre.cfree3,IA_Subsidiary_Pre.cfree4,IA_Subsidiary_Pre.cfree5,IA_Subsidiary_Pre.cfree6,
IA_Subsidiary_Pre.cfree7,IA_Subsidiary_Pre.cfree8,IA_Subsidiary_Pre.cfree9,IA_Subsidiary_Pre.cfree10,cBatchIA,null
FROM (SELECT IA_Subsidiary.cWhCode,N'34' as cVouType,N'' as cDepCode,
IA_Subsidiary.cInvCode,IA_Subsidiary.cInvHead,1 as PZID,cfree1,cfree2,cfree3,cfree4,cfree5,cfree6,cfree7,cfree8,cfree9,cfree10,cBatchIA,
Warehouse.cWhvaluestyle as cvaluetype,bcheckfree1,bcheckfree2,bcheckfree3,bcheckfree4,bcheckfree5,bcheckfree6,bcheckfree7,bcheckfree8,bcheckfree9,bcheckfree10,
cast(str(Sum(IsNull(IA_Subsidiary.iAInQuantity,0)-IsNull(IA_Subsidiary.iAOutQuantity,0)),38,3) as float) AS SumQ,
Sum(Cast(ISNULL(IA_Subsidiary.iAInPrice,0)-ISNULL(IA_Subsidiary.iAOutPrice,0) As Decimal(38,2))) AS SumM
FROM IA_Subsidiary IA_Subsidiary with (nolock)
inner join warehouse warehouse with (nolock) on IA_Subsidiary.cwhcode=warehouse.cwhcode
inner join Inventory Inventory with (nolock) on IA_Subsidiary.cInvCode = Inventory.cInvCode
WHERE Warehouse.cWhvaluestyle<>N'个别计价法' and Warehouse.cWhvaluestyle<>N'先进先出法' and Warehouse.cWhvaluestyle<>N'后进先出法'
And IA_Subsidiary.iYear = 2023 AND (IA_Subsidiary.iMonth>0 or (IA_Subsidiary.iMonth=0 and IA_Subsidiary.cVouType=N'34'))
GROUP BY IA_Subsidiary.cWhCode,
IA_Subsidiary.cInvCode,IA_Subsidiary.cInvHead,cfree1,cfree2,cfree3,cfree4,cfree5,cfree6,cfree7,cfree8,cfree9,cfree10,cBatchIA,
Warehouse.cWhvaluestyle,bcheckfree1,bcheckfree2,bcheckfree3,bcheckfree4,bcheckfree5,bcheckfree6,bcheckfree7,bcheckfree8,bcheckfree9,bcheckfree10
having cast(Sum(IsNull(IA_Subsidiary.iAInQuantity,0)-IsNull(IA_Subsidiary.iAOutQuantity,0)) as decimal(38,3))<>0 or
cast(Sum(ISNULL(IA_Subsidiary.iAInPrice,0)-ISNULL(IA_Subsidiary.iAOutPrice,0)) as decimal(38,2))<>0
) IA_Subsidiary_Pre left join  InvCheckFreeIA870 InvCheckFreeIA870 with (nolock) on IA_Subsidiary_Pre.cinvcode=InvCheckFreeIA870.cinvcode
and (isnull(bcheckfree1,0)=0 or IA_Subsidiary_Pre.cfree1=InvCheckFreeIA870.cfree1) and (isnull(bcheckfree2,0)=0 or IA_Subsidiary_Pre.cfree2=InvCheckFreeIA870.cfree2)
and (isnull(bcheckfree3,0)=0 or IA_Subsidiary_Pre.cfree3=InvCheckFreeIA870.cfree3) and (isnull(bcheckfree4,0)=0 or IA_Subsidiary_Pre.cfree4=InvCheckFreeIA870.cfree4)
and (isnull(bcheckfree5,0)=0 or IA_Subsidiary_Pre.cfree5=InvCheckFreeIA870.cfree5) and (isnull(bcheckfree6,0)=0 or IA_Subsidiary_Pre.cfree6=InvCheckFreeIA870.cfree6)
and (isnull(bcheckfree7,0)=0 or IA_Subsidiary_Pre.cfree7=InvCheckFreeIA870.cfree7) and (isnull(bcheckfree8,0)=0 or IA_Subsidiary_Pre.cfree8=InvCheckFreeIA870.cfree8)
and (isnull(bcheckfree9,0)=0 or IA_Subsidiary_Pre.cfree9=InvCheckFreeIA870.cfree9) and (isnull(bcheckfree10,0)=0 or IA_Subsidiary_Pre.cfree10=InvCheckFreeIA870.cfree10)


-----------------------------------------------------------------------------------------------------*-----------------------------------------------------------------------------------------------
求助大神月末月末结账的提示:

微信图片_20240113153601.jpg
发表于 2024-1-15 08:20:59 | 显示全部楼层
学习一下
回复 点赞 拍砖

使用道具 举报

发表于 2024-1-17 09:47:31 | 显示全部楼层
查一下这个表的字段应该就可以找到问题。
回复 点赞 拍砖

使用道具 举报

发表于 2024-1-17 13:14:11 | 显示全部楼层
感谢分享
回复 点赞 拍砖

使用道具 举报

 楼主| 发表于 2024-1-19 15:09:40 | 显示全部楼层
已找到解决方法,数据库中IA_subsidiary表bRdFlag,和bMoneyFlag字段中的默认值为空,对应默认值为db.IA_Subsidiary_bMoneyFlag_D字段即可
回复 点赞 拍砖

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-11-23 08:56 , Processed in 0.058697 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表