diff --git a/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/StockSignalREndpointServer.cs b/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/StockSignalREndpointServer.cs index 093ed4d..39d6250 100644 --- a/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/StockSignalREndpointServer.cs +++ b/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Controllers/StockSignalREndpointServer.cs @@ -4,6 +4,7 @@ using AyCode.Services.SignalRs; using DevExpress.Data.Helpers; using FruitBank.Common.Entities; using FruitBank.Common.Enums; +using FruitBank.Common.Interfaces; using FruitBank.Common.Server.Interfaces; using FruitBank.Common.Server.Services.SignalRs; using FruitBank.Common.SignalRs; @@ -66,6 +67,12 @@ public class StockSignalREndpointServer(StockTakingDbContext ctx, SignalRSendToC foreach (var productDto in productDtos) { + //if (productDto.StockQuantity < 0 && productDto.IncomingQuantity > 0) + //{ + // _logger.Info($"Beszállítás alatt lévő 'virtuális' készlet, nem leltározzuk! product: [#{productDto.Id}] {productDto.Name}; StockQuantity: {productDto.StockQuantity}; IncomingQuantity: {productDto.IncomingQuantity}"); + // continue; + //} + var stockTakingItem = new StockTakingItem { StockTakingId = stockTaking.Id, diff --git a/Nop.Plugin.Misc.AIPlugin/Domains/DataLayer/StockTakingDbContext.cs b/Nop.Plugin.Misc.AIPlugin/Domains/DataLayer/StockTakingDbContext.cs index c86e951..bfc82e3 100644 --- a/Nop.Plugin.Misc.AIPlugin/Domains/DataLayer/StockTakingDbContext.cs +++ b/Nop.Plugin.Misc.AIPlugin/Domains/DataLayer/StockTakingDbContext.cs @@ -96,11 +96,11 @@ public class StockTakingDbContext : MgDbContextBase, { count++; - //await _fruitBankDbContext.UpdateStockQuantityAndWeightAsync(stockTakingItem.Product!, stockTakingItem.QuantityDiff, - // $"Leltár által módosítva! stockTakingId: #{stockTaking.Id}, stockTakingItemId: #{stockTakingItem.Id}", - // stockTakingItem.NetWeightDiff); + await _fruitBankDbContext.UpdateStockQuantityAndWeightAsync(stockTakingItem.Product!, stockTakingItem.QuantityDiff, + $"Leltár által módosítva! stockTakingId: #{stockTaking.Id}, stockTakingItemId: #{stockTakingItem.Id}", + stockTakingItem.NetWeightDiff); - Logger.Info($"CloseStockTaking.UpdateStockQuantityAndWeightAsync; {stockTakingItem.Product}; qntDiff: {stockTakingItem.QuantityDiff} db; netWeightDiff: {stockTakingItem.NetWeightDiff} kg"); + Logger.Debug($"CloseStockTaking.UpdateStockQuantityAndWeightAsync; {stockTakingItem.Product}; qntDiff: {stockTakingItem.QuantityDiff} db; netWeightDiff: {stockTakingItem.NetWeightDiff} kg"); } stockTaking.IsClosed = true;