fix(inv query): error in improper placed , in the query

This commit is contained in:
2025-08-10 18:12:29 -05:00
parent 8d63f7f6b0
commit 397f1da595

View File

@@ -1,21 +1,22 @@
// this query pulls all the inventory except the inv locations.
export const totalInvNoRn = `
select x.idartikelVarianten as av,
ArtikelVariantenAlias as Alias,
select
x.idartikelVarianten as av,
x.ArtikelVariantenAlias as Alias
--x.Lfdnr as RunningNumber,
round(sum(EinlagerungsMengeVPKSum),0) as Total_Pallets,
sum(EinlagerungsMengeSum) as Total_PalletQTY,
round(sum(VerfuegbareMengeVPKSum),0) as Avalible_Pallets,
sum(VerfuegbareMengeSum) as Avaliable_PalletQTY,
sum(case when c.Description LIKE '%COA%' then GesperrteMengeVPKSum else 0 end) as COA_Pallets,
sum(case when c.Description LIKE '%COA%' then GesperrteMengeSum else 0 end) as COA_QTY,
sum(case when c.Description NOT LIKE '%COA%' or x.IdMainDefect = -1 then GesperrteMengeVPKSum else 0 end) as Held_Pallets,
sum(case when c.Description NOT LIKE '%COA%' or x.IdMainDefect = -1 then GesperrteMengeSum else 0 end) as Held_QTY
,round(sum(EinlagerungsMengeVPKSum),0) as Total_Pallets
,sum(EinlagerungsMengeSum) as Total_PalletQTY
,round(sum(VerfuegbareMengeVPKSum),0) as Avalible_Pallets
,sum(VerfuegbareMengeSum) as Avaliable_PalletQTY
,sum(case when c.Description LIKE '%COA%' then GesperrteMengeVPKSum else 0 end) as COA_Pallets
,sum(case when c.Description LIKE '%COA%' then GesperrteMengeSum else 0 end) as COA_QTY
,sum(case when c.Description NOT LIKE '%COA%' or x.IdMainDefect = -1 then GesperrteMengeVPKSum else 0 end) as Held_Pallets
,sum(case when c.Description NOT LIKE '%COA%' or x.IdMainDefect = -1 then GesperrteMengeSum else 0 end) as Held_QTY
,sum(case when x.WarenLagerLagerTyp = 8 then VerfuegbareMengeSum else 0 end) as Consigment
,IdProdPlanung as Lot
--,IdAdressen,
x.AdressBez
----,IdAdressen,
,x.AdressBez
--,*
from [AlplaPROD_test1].dbo.[V_LagerPositionenBarcodes] (nolock) x