From 99b3ad633ccd4ae6dcf201bf81df723455a96dbc Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Thu, 18 Sep 2025 11:00:54 -0500 Subject: [PATCH] fix(materials): changes for consuming peices vs units --- server/services/sqlServer/querys/ocp/mainMaterial.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/services/sqlServer/querys/ocp/mainMaterial.ts b/server/services/sqlServer/querys/ocp/mainMaterial.ts index 7fcc646..13e5476 100644 --- a/server/services/sqlServer/querys/ocp/mainMaterial.ts +++ b/server/services/sqlServer/querys/ocp/mainMaterial.ts @@ -52,7 +52,7 @@ MaterialHumanReadableId ,x.EffectiveConsumption as consumption -- this is how much was consummed via cmd 112 ,x.TotalDemand as totalDemand -- the total demand needed to finish the lot out - ,case when cp.Pieces >= 0.001 then (lot.TotalProducedQuantity+1) * cp.Pieces else + ,case when cp.Pieces >= 0.001 then (lot.TotalProducedLoadingUnits+1) * cp.Pieces else (a.Weight *((case when cp.Percentage is null then 80 else cp.Percentage end) / 100) * ((lot.TotalProducedLoadingUnits+1) * p.LoadingUnitPieces)) / 1000 end totalNeeded ,case when IsMainMaterial = 1 then @@ -134,8 +134,7 @@ group by IdArtikelVarianten,ArtikelVariantenBez ) as l on l.IdArtikelVarianten = MaterialHumanReadableId -where lot.ProductionLotHumanReadableId = @lot and - MaterialDescription NOT LIKE '%nopal%' +where lot.ProductionLotHumanReadableId = @lot and MaterialDescription not like '%nopal%' and MaterialDescription NOT LIKE '%bb%' and MaterialDescription NOT LIKE '%mcg%' `;