Browse Source

12合并 10小数点

Branch_PaiNaWeiSJob
shiqian.wang 3 months ago
parent
commit
c9c70eb04a
  1. 4
      ICSSoft.FromERP/SK/YERP_010_BOH.cs
  2. 4
      ICSSoft.FromERP/SK/YERP_010_EOH.cs
  3. 14
      ICSSoft.FromERP/SK/YERP_012.cs

4
ICSSoft.FromERP/SK/YERP_010_BOH.cs

@ -130,8 +130,8 @@ namespace ICSSoft.FromERP
a.cInvCode ITEM_CD,
cBatch PRDT_BTCH_NO,
'BOH' STCK_TYPE_CD,
a.iQuantity STCK_QTY,
a.iQuantity * ABS(ISNULL(d.STCK_VALUE_CNW,0)) STCK_VALUE_CNY,
CAST(a.iQuantity as decimal(10,3)) STCK_QTY,
CAST(a.iQuantity * ABS(ISNULL(d.STCK_VALUE_CNW,0)) as decimal(10,3)) STCK_VALUE_CNY,
(case when cInvStd is null then null else (CASE WHEN ISNUMERIC(left(cinvstd,3)) = 1 THEN REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,3),'') ELSE (CASE WHEN ISNUMERIC(left(cinvstd,2)) = 1
THEN REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,2),'') ELSE (CASE WHEN ISNUMERIC(left(cinvstd,1)) = 1
THEN REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,1),'') ELSE '' END) END) END) end) STCK_UOM,

4
ICSSoft.FromERP/SK/YERP_010_EOH.cs

@ -93,8 +93,8 @@ namespace ICSSoft.FromERP
a.cInvCode ITEM_CD,c.cInvName,
cBatchia PRDT_BTCH_NO,
'EOH' STCK_TYPE_CD,
SUM(ISNULL(a.iAInQuantity,0)) - SUM(ISNULL(a.iAOutQuantity,0)) STCK_QTY,
SUM(ISNULL(iAInPrice,0)) - SUM(ISNULL(iAOutPrice,0)) STCK_VALUE_CNY,
CAST(SUM(ISNULL(a.iAInQuantity,0)) - SUM(ISNULL(a.iAOutQuantity,0)) as decimal(10,3)) STCK_QTY,
CAST(SUM(ISNULL(iAInPrice,0)) - SUM(ISNULL(iAOutPrice,0)) as decimal(10,3)) STCK_VALUE_CNY,
(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,

14
ICSSoft.FromERP/SK/YERP_012.cs

@ -71,9 +71,11 @@ namespace ICSSoft.FromERP
var beginPeriod = "2023-06-01";// Dates.AddMonths(-1).AddDays(-Dates.Day + 1).ToString("yyyy-MM-dd");//"2023-06-01";
var endPeriod = "2023-07-01";// Dates.AddDays(-Dates.Day + 1).ToString("yyyy-MM-dd");//"2023-07-01";
string sqls = @"select
convert(nvarchar(10),getdate(),112) IF_STD_DATE,
IF_STD_DATE,INVOICE_DATE,ITEM_CD,ITEM_NM,SKU_PAYMT_QTY_UOM,SALES_SITE_CD,SALES_SITE_NM,CREATE_BY,COUNT(*) OVER (PARTITION BY getdate()) GEN_ROW_CNT
,SUM(SKU_PAYMT_QTY) SKU_PAYMT_QTY,SUM(PAYMT_PRICE) PAYMT_PRICE
from (
select convert(nvarchar(10),getdate(),112) IF_STD_DATE,
convert(nvarchar(10),a.dDate,111) INVOICE_DATE,
dDate ACNTNG_DATE,
b.cInvCode ITEM_CD,
c.cInvName ITEM_NM,
CAST(iQuantity AS INT) SKU_PAYMT_QTY,
@ -83,14 +85,14 @@ namespace ICSSoft.FromERP
dcreatesystime CREATE_DTTM,
b.iNatSum PAYMT_PRICE,
cMaker CREATE_BY,
dmodifysystime MODIFY_DTTM,
cmodifier MODIFY_BY,
COUNT(*) OVER (PARTITION BY getdate()) GEN_ROW_CNT
dmodifysystime MODIFY_DTTM
from dbo.SO_SOMain a left join dbo.SO_SODetails b on a.ID=b.ID
left join dbo.Inventory c on b.cInvCode=c.cInvCode
left join dbo.ComputationUnit d on c.cComUnitCode=d.cComunitCode
left join dbo.Customer e on a.cCusCode=e.cCusCode
WHERE 1 = 1 and dcreatesystime > '{0}' and dcreatesystime < '{1}'";//
WHERE 1 = 1 and dcreatesystime >= '{0}' and dcreatesystime < '{1}'
) a
group by IF_STD_DATE,INVOICE_DATE,ITEM_CD,ITEM_NM,SKU_PAYMT_QTY_UOM,SALES_SITE_CD,SALES_SITE_NM,CREATE_BY";//
sqls = string.Format(sqls, beginPeriod, endPeriod);
log.Info("YERP_012 sql:" + sqls);

Loading…
Cancel
Save