diff --git a/ICSSoft.FromERP/SK/YERP_010_BOH.cs b/ICSSoft.FromERP/SK/YERP_010_BOH.cs index 72185b9..bce6564 100644 --- a/ICSSoft.FromERP/SK/YERP_010_BOH.cs +++ b/ICSSoft.FromERP/SK/YERP_010_BOH.cs @@ -132,9 +132,9 @@ namespace ICSSoft.FromERP 'BOH' STCK_TYPE_CD, 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, + (case when cInvStd is null then null else (CASE WHEN ISNUMERIC(left(cinvstd,3)) = 1 THEN LOWER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,3),'')) ELSE (CASE WHEN ISNUMERIC(left(cinvstd,2)) = 1 + THEN LOWER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,2),'')) ELSE (CASE WHEN ISNUMERIC(left(cinvstd,1)) = 1 + THEN LOWER(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 from CurrentStock a diff --git a/ICSSoft.FromERP/SK/YERP_010_EOH.cs b/ICSSoft.FromERP/SK/YERP_010_EOH.cs index 2a128f2..d07ed1c 100644 --- a/ICSSoft.FromERP/SK/YERP_010_EOH.cs +++ b/ICSSoft.FromERP/SK/YERP_010_EOH.cs @@ -94,9 +94,9 @@ namespace ICSSoft.FromERP 'EOH' STCK_TYPE_CD, 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, + (case when cInvStd is null then null else (CASE WHEN ISNUMERIC(left(cinvstd,3)) = 1 THEN LOWER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,3),'')) ELSE (CASE WHEN ISNUMERIC(left(cinvstd,2)) = 1 + THEN LOWER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,2),'')) ELSE (CASE WHEN ISNUMERIC(left(cinvstd,1)) = 1 + THEN LOWER(REPLACE(SUBSTRING(cinvstd, 1, CHARINDEX('/', cinvstd) - 1),left(cinvstd,1),'')) ELSE '' END) END) END) end) STCK_UOM, cInvStd PACK_MIN_QTY from IA_Subsidiary a left join dbo.Inventory c on a.cInvCode=c.cInvCode