Merge branch 'release/TestBom_01'

This commit is contained in:
2025-09-16 16:50:32 +02:00
7 changed files with 66 additions and 36 deletions
@@ -451,8 +451,12 @@ namespace EgwCoreLib.Lux.Data.Controllers
{
try
{
// prendo solo elementi a prezzo 0 da salvare sul DB
var item2save = bomList
.Where(x => x.Price == 0)
.ToList();
// ciclo x ogni elemento della BOM, cercando x gruppo e ExtItemCode
foreach (var item in bomList)
foreach (var item in item2save)
{
var currRec = dbCtx
.DbSetItem
@@ -602,26 +606,37 @@ namespace EgwCoreLib.Lux.Data.Controllers
{
numGroupOk++;
}
// cerco nella tab in memoria che ho precaricato il costo... cercando x dati di selezione + qtyRange
var recCost = bomGenList
.Where(x => x.CodGroup == item.ClassCode
&& x.ExtItemCode == item.ItemCode
&& item.Qty >= x.QtyMin
&& item.Qty < x.QtyMax)
.OrderByDescending(x => x.Cost)
.FirstOrDefault();
// se trovato valorizzo!
if (recCost != null)
// 2025.09.16: se il prezzo arriva dalla BOM calcolata uso quello...
if (item.Price > 0)
{
// conto l'item
numItemOk++;
item.ItemID = recCost.ItemID;
item.Price = recCost.Cost * (1 + recCost.Margin) * item.Qty;
// ...e aggiorno totale
totCost += item.Price;
}
else
{
item.ItemID = 0;
item.Price = 0;
// cerco nella tab in memoria che ho precaricato il costo... cercando x dati di selezione + qtyRange
var recCost = bomGenList
.Where(x => x.CodGroup == item.ClassCode
&& x.ExtItemCode == item.ItemCode
&& item.Qty >= x.QtyMin
&& item.Qty < x.QtyMax)
.OrderByDescending(x => x.Cost)
.FirstOrDefault();
// se trovato valorizzo!
if (recCost != null)
{
numItemOk++;
item.ItemID = recCost.ItemID;
item.Price = recCost.Cost * (1 + recCost.Margin) * item.Qty;
totCost += item.Price;
}
else
{
item.ItemID = 0;
item.Price = 0;
}
}
}
// salvo BOM...
@@ -689,27 +704,42 @@ namespace EgwCoreLib.Lux.Data.Controllers
{
numGroupOk++;
}
// cerco nella tab in memoria che ho precaricato il costo... cercando x dati di selezione + qtyRange
var recCost = bomGenList
.Where(x => x.CodGroup == item.ClassCode
&& x.ExtItemCode == item.ItemCode
&& item.Qty >= x.QtyMin
&& item.Qty < x.QtyMax)
.OrderByDescending(x => x.Cost)
.FirstOrDefault();
// se trovato valorizzo!
if (recCost != null)
// 2025.09.16: se il prezzo arriva dalla BOM calcolata uso quello...
if (item.Price > 0)
{
// resetto ItemID ma NON il prezzo
item.ItemID = 0;
// conto l'item
numItemOk++;
item.ItemID = recCost.ItemID;
item.Price = recCost.Cost * (1 + recCost.Margin) * item.Qty;
// ...e aggiorno totale
totCost += item.Price;
}
else
{
item.ItemID = 0;
item.Price = 0;
// cerco nella tab in memoria che ho precaricato il costo... cercando x dati di selezione + qtyRange
var recCost = bomGenList
.Where(x => x.CodGroup == item.ClassCode
&& x.ExtItemCode == item.ItemCode
&& item.Qty >= x.QtyMin
&& item.Qty < x.QtyMax)
.OrderByDescending(x => x.Cost)
.FirstOrDefault();
// se trovato valorizzo!
if (recCost != null)
{
numItemOk++;
item.ItemID = recCost.ItemID;
item.Price = recCost.Cost * (1 + recCost.Margin) * item.Qty;
totCost += item.Price;
}
else
{
item.ItemID = 0;
item.Price = 0;
}
}
}
// salvo BOM...
string itemBom = JsonConvert.SerializeObject(bomList);
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.9.2509.1615</Version>
<Version>0.9.2509.1616</Version>
</PropertyGroup>
<ItemGroup>
+2 -2
View File
@@ -7,7 +7,7 @@
},
"ServerConf": {
"BaseUrl": "/lux/srv/",
"PubChannel": "EgwDevEngineInput",
"SubChannel": "EgwDevEngineOutput"
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput"
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>0.9.2509.1615</Version>
<Version>0.9.2509.1616</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 0.9.2509.1615</h4>
<h4>Versione: 0.9.2509.1616</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2509.1615
0.9.2509.1616
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2509.1615</version>
<version>0.9.2509.1616</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>