ERP SQL Server
2021/9/4 19:09:13
本文主要是介绍ERP SQL Server,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1、 表头:单据编号;日期;审核日期;制单人;审核人 表体:物料代码;物料名称;规格型号;订单数量;入库关联数量;出库关联数量 审核人(用户),审核时间在审核时自动更新 发布到前台供应链,仓储管理下
审核日期关联添加锁定,多级审核关联审核日期
完成截图
2、 打印功能点:原材料打印 按k3物料打印,只显示启用批次管理和保质期管理的物料; 打印样式:100*85;二维码包含条码信息;一维码包含物料代码;明文显示物料代码,物料名称,打印数量,批次号,保质期,条码信息;排版随意
原材料打印 数据源sql
Select t.FNumber as '物料代码', t.FName as '物料名称', t.FModel as '规格型号',t.Fhelpcode '助记码', case when isnull(t.FBatchManager,0)=0 then null else Right(Convert(varchar(10),getdate(),112),6) end as '批次号', case when isnull(t.FISKFPeriod,0)=0 then null else Convert(datetime, Convert(varchar(10),getdate(),23)) end as '生产日期', Cast(t.FBatchAppendQty As Decimal(28,4)) as '包装数量', t1.FName as '计量单位',t.FSecCoefficient '换算率', getdate() as '当前日期',Right(Convert(varchar(10),getdate(),112),6) as '日期', t.FItemID as '物料内码',case when isnull(t.FISKFPeriod,0)=0 then 0 else cast( t.FKFPeriod as int) end as '有效期', cast(0 as bit) as '是否VMI', '' as '辅助属性',0 as '辅助属性内码',t1.FMeasureUnitID as '计量单位内码', t3.fitemid as'仓库内码',t4.FSPID as '仓位内码',cast(0 as int) as '是否在库', '' as '名称',0 as '内码',t.FAuxClassID '辅助属性类别','0' 文本 from t_icitem t left join t_MeasureUnit t1 on t1.FItemID=t.FUnitID left join t_stock t3 (nolock) on t.FDefaultLoc=t3.fitemid left join t_StockPlace t4 (nolock)on t4.FSPID =t.FSPID where t.FDeleted=0 and t.FBatchManager=1 and t.FISKFPeriod=1
出现fcode冲突 是因为自定义格式重复了
完成截图
(按行订单分录匹配)
Select u.FBillNo '订单号',Convert(varchar(10),u.fdate,112) '订单日期',v.FIndex As '订单分录',v.fid '订单内码', t.FNumber '物料代码',t.FName '物料名称',FModel '规格型号', case when isnull(t.FBatchManager,0)=0 then null else Right(Convert(varchar(10),getdate(),112),6) end As '批次号', case when isnull(t.FISKFPeriod,0)=0 then null else Convert(datetime , Convert(varchar(10),getdate(),23)) end as '生产日期', v.FQty-v.SQty '应收数量',t1.FName '计量单位',t.FSecCoefficient '换算率', Cast(t.FBatchAppendQty As Decimal(28,4)) '包装数量', isnull(t5.fydqty,0) as '已打数量',v.FQty-isnull(t5.fydqty,0)'可打数量', case when isnull(t.FISKFPeriod,0)=0 then 0 else cast(FKFPeriod as int) end as '有效期', '' as '辅助属性',t.FAuxClassID '辅助属性类别',cast(0 as int) as '是否在库', getdate() As '当前日期',Right(Convert(varchar(10),getdate(),112),6) As '日期', u.FiD '单据内码',v.Fbase '物料内码',0 '源单分录',0 '源单内码', cast(t2.FItemID as varchar(50)) '供应商内码', 0 as '辅助属性内码',t1.FMeasureUnitID as '计量单位内码', t3.fitemid as'仓库内码',t4.FSPID as '仓位内码',0 as'内码',u.fdate GYS订单日期 From t_BOS200000001 u (nolock) Inner Join t_BOS200000001Entry2 v (nolock) On u.FID = v.FID Left Join t_icitem t (nolock)On t.FItemID = v.fbase Left Join t_MeasureUnit t1 (nolock) On t.FUnitID = t1.FMeasureUnitID Left Join t_supplier t2 (nolock) On v.fbase = t2.FItemID left join t_stock t3 (nolock) on t.FDefaultLoc=t3.fitemid left join t_StockPlace t4 (nolock)on t4.FSPID =t.FSPID left join (SELECT FInterID,FEntryID, SUM(flabelqty) AS fydqty FROM BR_CodeInfo (nolock) WHERE ISNULL(FStatus,0) = 0 and FNumber='089' GROUP BY FInterID, FEntryID) t5 on t5.finterid=v.fid and t5.fentryid=v.fentryid where 1=1 and t.FBatchManager=1 and t.FISKFPeriod=1 and v.FQty-v.SQty>0
打印样式
原材料打印
这篇关于ERP SQL Server的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-08Docker下的SqlServer发布订阅启用
- 2023-06-05Docker安装MS SQL Server并使用Navicat远程连接
- 2023-05-25深入浅出 SQL Server CDC 数据同步
- 2023-05-12通过空间占用和执行计划了解SQL Server的行存储索引
- 2023-04-24以SQLserver为例的Dapper详细讲解
- 2022-11-30SQL server高级函数查询
- 2022-11-26SQL SERVER数据库服务器CPU不能全部利用原因分析
- 2022-11-21SQL Server 时间算差值/常用函数
- 2022-11-20调试Archery连接SQL Server提示驱动错误
- 2022-10-22SQL Server 完整、差异备份+完整、差异还原(详细讲解,规避错误)