|
|
@ -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 |
|
|
|