Browse Source

update

Branch_PaiNaWeiSJob
shiqian.wang 2 weeks ago
parent
commit
696270fb06
  1. 2
      ICSSoft.FromERP/SK/YERP_010_BOH.cs
  2. 8
      ICSSoft.FromERP/SK/YERP_010_EOH.cs

2
ICSSoft.FromERP/SK/YERP_010_BOH.cs

@ -140,7 +140,7 @@ namespace ICSSoft.FromERP
from CurrentStock a
left join dbo.Inventory c on a.cInvCode=c.cInvCode
left join #STCK_VALUE_CNW d on a.cWhCode = d.cWhCode and a.cInvCode = d.cInvCode and RowIndex = 1
where 1 = 1 and iQuantity > 0
where 1 = 1 and iQuantity > 0 and ISNULL(d.STCK_VALUE_CNW,0) > 0
Drop Table #STCK_VALUE_CNW_ListMonth
Drop Table #STCK_VALUE_CNW_thisMonth

8
ICSSoft.FromERP/SK/YERP_010_EOH.cs

@ -86,8 +86,7 @@ namespace ICSSoft.FromERP
var lastMonth = "2024-01-01";// Dates.AddDays(-Dates.Day + 1).ToString("yyyy-MM-dd");//"2024-01-01";
// 月库存统计:每个月14号,查询上月截止到月末的库存数据累计数量和金额 因为期初数量本来就是统计历史收发数量,所以期初数量+收发数量 = 收发数量总和,金额同理
string sqls = @"
select * from (select cWhCode,a.cInvCode,convert(nvarchar(10),getdate(),112) IF_STD_DATE,
select *,COUNT(*) OVER (PARTITION BY getdate()) GEN_ROW_CNT from (select cWhCode,a.cInvCode,convert(nvarchar(10),getdate(),112) IF_STD_DATE,
convert(nvarchar(10),getdate(),112) STCK_STD_DATE,
a.cWhCode WRHS_CD,
a.cInvCode ITEM_CD,c.cInvName,
@ -98,13 +97,12 @@ namespace ICSSoft.FromERP
(case when cInvStd is null then null else (CASE WHEN ISNUMERIC(left(cinvstd,3)) = 1 THEN UPPER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,3),'')) ELSE (CASE WHEN ISNUMERIC(left(cinvstd,2)) = 1
THEN UPPER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,2),'')) ELSE (CASE WHEN ISNUMERIC(left(cinvstd,1)) = 1
THEN UPPER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,1),'')) ELSE '' END) END) END) end) STCK_UOM,
cInvStd PACK_MIN_QTY,
COUNT(*) OVER (PARTITION BY getdate()) GEN_ROW_CNT
cInvStd PACK_MIN_QTY
from IA_Subsidiary a
left join dbo.Inventory c on a.cInvCode=c.cInvCode
where a.dKeepDate < N'{0}' and a.cVouType<> N'33' and ISNULL(a.iMonth,0)<>0 and ISNULL(a.cBatchia,'') != ''
group by a.cInvCode,a.cWhCode,a.cBatchia,c.cInvName,c.cinvstd) a
where STCK_QTY > 0";
where STCK_QTY > 0 and STCK_VALUE_CNY > 0";
sqls = string.Format(sqls, lastMonth);
log.Info("YERP_010 sql:" + sqls);

Loading…
Cancel
Save