diff --git a/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj b/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj
index 4f572545..c4bb068e 100644
--- a/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj
+++ b/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj
@@ -21,8 +21,8 @@
-
-
+
+
diff --git a/EgwCoreLib.Lux.Core/RestPayload/BomItemDTO.cs b/EgwCoreLib.Lux.Core/RestPayload/BomItemDTO.cs
index cda63b13..f93b8437 100644
--- a/EgwCoreLib.Lux.Core/RestPayload/BomItemDTO.cs
+++ b/EgwCoreLib.Lux.Core/RestPayload/BomItemDTO.cs
@@ -12,6 +12,7 @@ namespace EgwCoreLib.Lux.Core.RestPayload
public string ClassCode { get; set; } = "";
public string DescriptionCode { get; set; } = "";
public string ItemCode { get; set; } = "";
+
///
/// Quantità articolo (anche frazionaria) x calcolo moltiplicativo
///
@@ -25,7 +26,17 @@ namespace EgwCoreLib.Lux.Core.RestPayload
///
public double PriceEff { get; set; } = 0;
public int ItemID { get; set; } = 0;
+
+ ///
+ /// Numero Item
+ ///
public int ItemQty { get; set; } = 0;
+
+ ///
+ /// Volume relativo (m3)
+ ///
+ public double Volume { get; set; } = 0;
+
///
/// Importo calcolato come prezzo x quantitÃ
///
diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
index bdb8f7f6..1f9dd2e2 100644
--- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
+++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs
@@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using NLog;
+using System.Globalization;
using static EgwCoreLib.Lux.Core.Enums;
namespace EgwCoreLib.Lux.Data.Controllers
@@ -1026,6 +1027,134 @@ namespace EgwCoreLib.Lux.Data.Controllers
return dbResult;
}
+ ///
+ /// Esegue un mass update dei valori di margine, qtyMax, costo di un set di dati ricevuto
+ ///
+ /// Elenco items da aggiornare
+ /// Costo standard (al volume m3)
+ /// Margine da impostare per tutti
+ /// Valore qty max da impostare per tutti
+ /// Valore UM da impostare per tutti
+ /// Valore di arrotondamento richiesto (0 = non arrotondo)
+ /// Valore di scala da unità in ingresso x unità di costo (mm x mm x m --> m3)
+ ///
+ ///
+ internal async Task ItemMassUpdate(List list2upd, double setCost, double defMargin, double defQtyMax, string defUM, int roundVal, double scaleFactor)
+ {
+ bool answ = false;
+ if (list2upd == null || !list2upd.Any())
+ return answ;
+
+ //using (DataLayerContext dbCtx = new DataLayerContext(_config))
+ using (DataLayerContext dbCtx = new DataLayerContext())
+ {
+ try
+ {
+ // Validate input
+ if (setCost <= 0)
+ throw new ArgumentException("setCost must be greater than 0.");
+
+ // Step 1: Extract width and height from ExtItemCode
+ var itemUpdates = new List();
+
+ foreach (var item in list2upd)
+ {
+ if (string.IsNullOrWhiteSpace(item.ItemCode))
+ continue;
+
+ // Try to parse ExtItemCode: "Pine-200.0x360.0"
+ if (!item.ItemCode.Contains("-") || !item.ItemCode.Contains("x"))
+ {
+ // Skip invalid format
+ continue;
+ }
+
+ // Split by "-" to get prefix and number part
+ var parts = item.ItemCode.Split('-', 2);
+ if (parts.Length < 2)
+ {
+ continue;
+ }
+
+ string numberPart = parts[1]; // e.g. "200.0x360.0"
+
+ // Split by "x" to get width and height
+ var widthHeight = numberPart.Split('x', 2);
+ if (widthHeight.Length < 2)
+ {
+ continue;
+ }
+
+ if (!double.TryParse(widthHeight[0], NumberStyles.Any, CultureInfo.InvariantCulture, out double width) ||
+ !double.TryParse(widthHeight[1], NumberStyles.Any, CultureInfo.InvariantCulture, out double height))
+ {
+ continue;
+ }
+
+ // Step 2: Calculate Cost using formula:
+ // Cost = setCost / 1,000,000 * width * height
+ double calculatedCost = (setCost / scaleFactor) * width * height;
+ // if requested do round ceiling
+ if (roundVal > 0)
+ {
+ calculatedCost = Math.Ceiling(calculatedCost / roundVal) * roundVal;
+ }
+
+ // Optional: you can also apply margin to cost if needed, but you said "Cost = ..."
+ // So we're just computing it based on width/height
+
+ // Step 4: Create a new ItemModel with updated values
+ var updatedItem = new ItemModel
+ {
+ ItemID = item.ItemID,
+ ExtItemCode = item.ItemCode, // keep original
+ Cost = calculatedCost,
+ Margin = defMargin,
+ QtyMax = defQtyMax,
+ UM = defUM
+ };
+
+ itemUpdates.Add(updatedItem);
+ }
+
+ // Step 5: Update database using EF Core (EF Core doesn't support "update" on entire list directly)
+ // We'll use .UpdateRange() or a raw update via .Where() and .SetProperty()
+
+ // ✅ Use EF Core's Update method (for bulk update)
+ if (itemUpdates.Any())
+ {
+ // Update only the ones that exist in the DB
+ var existingItems = await dbCtx.DbSetItem
+ .Where(i => itemUpdates.Select(ui => ui.ItemID).Contains(i.ItemID))
+ .ToListAsync();
+
+ if (existingItems.Any())
+ {
+ // Update existing records using EF Core's Update method
+ foreach (var updatedItem in itemUpdates)
+ {
+ var existing = existingItems.FirstOrDefault(i => i.ItemID == updatedItem.ItemID);
+ if (existing != null)
+ {
+ // Update only the fields we're setting
+ existing.Cost = updatedItem.Cost;
+ existing.Margin = updatedItem.Margin;
+ existing.QtyMax = updatedItem.QtyMax;
+ }
+ }
+
+ await dbCtx.SaveChangesAsync();
+ }
+ }
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione durante ItemMassUpdate{Environment.NewLine}{exc}");
+ }
+ }
+ return answ;
+ }
+
internal bool ItemUpsert(ItemModel newRec)
{
bool answ = false;
@@ -1126,11 +1255,15 @@ namespace EgwCoreLib.Lux.Data.Controllers
{
try
{
+ // Controllo ed inserisco eventuali gruppi mancanti
+ UpdateCodGroup(bomList);
+
// prendo solo elementi a prezzo 0 da salvare sul DB
var item2save = bomList
.Where(x => x.Price == 0)
.ToList();
List listInserted = new List();
+
// ciclo x ogni elemento della BOM, cercando x gruppo e ExtItemCode
foreach (var item in item2save)
{
@@ -1142,7 +1275,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
// se nullo --> verifico x inserire!!!
if (currRec == null)
{
- // verifico NON sia tra gli items già in fase di inserimento
+ // verifico NON sia tra gli list2upd già in fase di inserimento
if (!listInserted.Any(x => x.CodGroup == item.ClassCode && x.ExtItemCode == item.ItemCode))
{
ItemModel newRec = new ItemModel()
@@ -1497,37 +1630,6 @@ namespace EgwCoreLib.Lux.Data.Controllers
return answ;
}
-#if false
- ///
- /// Elenco item Child da ID Parent (per sostituzione)
- ///
- /// ID parent (valido quindi >0)
- ///
- internal List ItemGetChild(int ItemIdParent)
- {
- List dbResult = new List();
- if (ItemIdParent > 0)
- {
- //using (DataLayerContext dbCtx = new DataLayerContext(configuration))
- using (DataLayerContext dbCtx = new DataLayerContext())
- {
- try
- {
- dbResult = dbCtx
- .DbSetItem
- .Where(x => x.ItemID == ItemIdParent || x.ItemIDParent == ItemIdParent)
- .ToList();
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione durante ItemGetChild{Environment.NewLine}{exc}");
- }
- }
- }
- return dbResult;
- }
-#endif
-
///
/// Upsert record
///
@@ -1622,6 +1724,35 @@ namespace EgwCoreLib.Lux.Data.Controllers
return dbResult;
}
+#if false
+ ///
+ /// Ritorna direttamente 1 riga offerta
+ ///
+ ///
+ ///
+ internal OfferRowModel? OfferRowGetByOfferRowID(int offerRowID)
+ {
+ OfferRowModel? dbResult = null;
+ //using (DataLayerContext dbCtx = new DataLayerContext(_config))
+ using (DataLayerContext dbCtx = new DataLayerContext())
+ {
+ try
+ {
+ dbResult = dbCtx
+ .DbSetOfferRow
+ .Where(x => x.OfferRowID == offerRowID)
+ .Include(s => s.SellingItemNav)
+ .FirstOrDefault();
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione durante OfferRowGetByOfferRowID{Environment.NewLine}{exc}");
+ }
+ }
+ return dbResult;
+ }
+#endif
+
///
/// Elimina riga e sposta eventuali righe successive...
///
@@ -1808,6 +1939,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
currRec.FileName = updRec.FileName;
currRec.FileResource = updRec.FileResource;
currRec.FileSize = updRec.FileSize;
+ currRec.SerStruct = updRec.SerStruct;
dbCtx.Entry(currRec).State = EntityState.Modified;
}
@@ -2232,8 +2364,74 @@ namespace EgwCoreLib.Lux.Data.Controllers
return answ;
}
+ internal bool UpdateCodGroup(List bomList)
+ {
+ bool answ = false;
+ //using (DataLayerContext dbCtx = new DataLayerContext(_config))
+ using (DataLayerContext dbCtx = new DataLayerContext())
+ {
+ // in primis calcolo i distinct dei CodGroup x eventuale insert preventivo
+ List distCodGroups = bomList
+ .Select(i => i.ClassCode)
+ .Distinct()
+ .Where(c => !string.IsNullOrWhiteSpace(c))
+ .ToList();
+
+ // recupero l'elenco degli itemGroup gestiti
+ var itemGroupList = dbCtx
+ .DbSetItemGroup
+ .ToList();
+ // elenco da inserire...
+ var codGroupsToInsert = distCodGroups
+ .Where(x => !itemGroupList.Any(i => i.CodGroup == x))
+ .Select(x => new ItemGroupModel() { CodGroup = x, Description = x })
+ .ToList();
+ // se ci sono inserisco!
+ if (codGroupsToInsert != null && codGroupsToInsert.Count > 0)
+ {
+ dbCtx
+ .DbSetItemGroup
+ .AddRange(codGroupsToInsert);
+ // salvo...
+ dbCtx.SaveChanges();
+ }
+ }
+ return answ;
+ }
+
#endregion Internal Methods
+#if false
+ ///
+ /// Elenco item Child da ID Parent (per sostituzione)
+ ///
+ /// ID parent (valido quindi >0)
+ ///
+ internal List ItemGetChild(int ItemIdParent)
+ {
+ List dbResult = new List();
+ if (ItemIdParent > 0)
+ {
+ //using (DataLayerContext dbCtx = new DataLayerContext(configuration))
+ using (DataLayerContext dbCtx = new DataLayerContext())
+ {
+ try
+ {
+ dbResult = dbCtx
+ .DbSetItem
+ .Where(x => x.ItemID == ItemIdParent || x.ItemIDParent == ItemIdParent)
+ .ToList();
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione durante ItemGetChild{Environment.NewLine}{exc}");
+ }
+ }
+ }
+ return dbResult;
+ }
+#endif
+
#region Private Fields
private static IConfiguration _configuration;
@@ -2254,8 +2452,8 @@ namespace EgwCoreLib.Lux.Data.Controllers
/// Lista BOM precedente da confrontare x scelta alternativi
/// Costo netto componenti BOM calcolato
/// Prezzo complessivo calcolato (con aggiunta marginalità )
- /// Controllo coerenza calcoli sui gruppi items
- /// Controllo coerenza calcoli su num items
+ /// Controllo coerenza calcoli sui gruppi list2upd
+ /// Controllo coerenza calcoli su num list2upd
private static void validateBom(List itemGroupList, List bomGenList, ref List bomList, List? bomListPrev, ref double totCost, ref double totPrice, ref int numGroupOk, ref int numItemOk)
{
double margin = 0;
diff --git a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj
index 72990480..b76f5d2b 100644
--- a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj
+++ b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj
@@ -27,7 +27,7 @@
-
+
diff --git a/EgwCoreLib.Lux.Data/Migrations/20251105181045_AddGroupBeam.Designer.cs b/EgwCoreLib.Lux.Data/Migrations/20251105181045_AddGroupBeam.Designer.cs
new file mode 100644
index 00000000..508534db
--- /dev/null
+++ b/EgwCoreLib.Lux.Data/Migrations/20251105181045_AddGroupBeam.Designer.cs
@@ -0,0 +1,3508 @@
+//
+using System;
+using EgwCoreLib.Lux.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace EgwCoreLib.Lux.Data.Migrations
+{
+ [DbContext(typeof(DataLayerContext))]
+ [Migration("20251105181045_AddGroupBeam")]
+ partial class AddGroupBeam
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.21")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Config.EnvirParamModel", b =>
+ {
+ b.Property("EnvirID")
+ .HasColumnType("int");
+
+ b.Property("SerStrucKey")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("EnvirID");
+
+ b.ToTable("conf_envir");
+
+ b.HasData(
+ new
+ {
+ EnvirID = 1,
+ SerStrucKey = "SerializedData"
+ },
+ new
+ {
+ EnvirID = 2,
+ SerStrucKey = "SerializedData"
+ },
+ new
+ {
+ EnvirID = 4,
+ SerStrucKey = "SerializedData"
+ },
+ new
+ {
+ EnvirID = 3,
+ SerStrucKey = "SerializedData"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Config.GlassModel", b =>
+ {
+ b.Property("GlassID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("GlassID"));
+
+ b.Property("Code")
+ .HasColumnType("longtext");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("Thickness")
+ .HasColumnType("double");
+
+ b.HasKey("GlassID");
+
+ b.ToTable("conf_glass");
+
+ b.HasData(
+ new
+ {
+ GlassID = 1,
+ Code = "0001",
+ Description = "Vetro BE 2S 4/12/4",
+ Thickness = 20.0
+ },
+ new
+ {
+ GlassID = 2,
+ Code = "0002",
+ Description = "Vetro BE 2S 4/16/4",
+ Thickness = 24.0
+ },
+ new
+ {
+ GlassID = 3,
+ Code = "0003",
+ Description = "Vetro BE 3S 4/12/4/12/4",
+ Thickness = 36.0
+ },
+ new
+ {
+ GlassID = 4,
+ Code = "0004",
+ Description = "Vetro BE 3S 4/16/4/16/4",
+ Thickness = 44.0
+ },
+ new
+ {
+ GlassID = 5,
+ Code = "0005",
+ Description = "Vetro BE 2S 4T/12/4T",
+ Thickness = 20.0
+ },
+ new
+ {
+ GlassID = 6,
+ Code = "0006",
+ Description = "Vetro BE 2S 4T/16/4T",
+ Thickness = 24.0
+ },
+ new
+ {
+ GlassID = 7,
+ Code = "0007",
+ Description = "Vetro BE 3S 4T/12/4T/12/4T",
+ Thickness = 36.0
+ },
+ new
+ {
+ GlassID = 8,
+ Code = "0008",
+ Description = "Vetro BE 3S 4T/16/4T/16/4T",
+ Thickness = 44.0
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Config.ProfileModel", b =>
+ {
+ b.Property("ProfileID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProfileID"));
+
+ b.Property("Code")
+ .HasColumnType("longtext");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("Thickness")
+ .HasColumnType("double");
+
+ b.HasKey("ProfileID");
+
+ b.ToTable("conf_profile");
+
+ b.HasData(
+ new
+ {
+ ProfileID = 1,
+ Code = "0001",
+ Description = "Profilo60",
+ Thickness = 60.0
+ },
+ new
+ {
+ ProfileID = 2,
+ Code = "0002",
+ Description = "Profilo78",
+ Thickness = 78.0
+ },
+ new
+ {
+ ProfileID = 3,
+ Code = "0003",
+ Description = "Profilo90",
+ Thickness = 90.0
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Config.WoodModel", b =>
+ {
+ b.Property("WoodID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("WoodID"));
+
+ b.Property("Code")
+ .HasColumnType("longtext");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("Type")
+ .HasColumnType("int");
+
+ b.HasKey("WoodID");
+
+ b.ToTable("conf_wood");
+
+ b.HasData(
+ new
+ {
+ WoodID = 1,
+ Code = "0001",
+ Description = "Abete",
+ Type = 1
+ },
+ new
+ {
+ WoodID = 2,
+ Code = "0002",
+ Description = "Acero",
+ Type = 1
+ },
+ new
+ {
+ WoodID = 3,
+ Code = "0003",
+ Description = "Pino",
+ Type = 2
+ },
+ new
+ {
+ WoodID = 4,
+ Code = "0004",
+ Description = "Tek",
+ Type = 3
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Cost.CostDriverModel", b =>
+ {
+ b.Property("CostDriverID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CostDriverID"));
+
+ b.Property("Descript")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Unit")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("CostDriverID");
+
+ b.ToTable("cost_driver");
+
+ b.HasData(
+ new
+ {
+ CostDriverID = 1,
+ Descript = "Ore lavorate per step/fase",
+ Name = "WorkHour",
+ Unit = "h"
+ },
+ new
+ {
+ CostDriverID = 2,
+ Descript = "Metri prodotti per step/fase",
+ Name = "Meter",
+ Unit = "m"
+ },
+ new
+ {
+ CostDriverID = 3,
+ Descript = "Numero unità prodotte (lavorate) per step/fase",
+ Name = "Unit",
+ Unit = "#"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Cost.ResourceModel", b =>
+ {
+ b.Property("ResourceID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ResourceID"));
+
+ b.Property("CodResource")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("CostDriverBudget")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("CostDriverID")
+ .HasColumnType("int");
+
+ b.Property("EBTPerc")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("FixedCost")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("LaborCost")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("OverHeadCost")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("OverHeadPerc")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("PriceMargin")
+ .HasColumnType("decimal(65,30)");
+
+ b.Property("VariableCost")
+ .HasColumnType("decimal(65,30)");
+
+ b.HasKey("ResourceID");
+
+ b.HasIndex("CostDriverID");
+
+ b.ToTable("cost_resource");
+
+ b.HasData(
+ new
+ {
+ ResourceID = 1,
+ CodResource = "0000",
+ CostDriverBudget = 1m,
+ CostDriverID = 3,
+ EBTPerc = 0.15m,
+ FixedCost = 50m,
+ LaborCost = 100m,
+ Name = "Item Generico",
+ OverHeadCost = 100m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 50m
+ },
+ new
+ {
+ ResourceID = 2,
+ CodResource = "0010",
+ CostDriverBudget = 2200m,
+ CostDriverID = 3,
+ EBTPerc = 0.15m,
+ FixedCost = 200000m,
+ LaborCost = 200000m,
+ Name = "Serramento (media annua globale)",
+ OverHeadCost = 100000m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 200000m
+ },
+ new
+ {
+ ResourceID = 3,
+ CodResource = "0110",
+ CostDriverBudget = 880m,
+ CostDriverID = 1,
+ EBTPerc = 0.15m,
+ FixedCost = 12000m,
+ LaborCost = 30m,
+ Name = "Sezionatrice",
+ OverHeadCost = 5000m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 6000m
+ },
+ new
+ {
+ ResourceID = 4,
+ CodResource = "0120.01",
+ CostDriverBudget = 1760m,
+ CostDriverID = 1,
+ EBTPerc = 0.15m,
+ FixedCost = 100000m,
+ LaborCost = 40m,
+ Name = "Linea SAOMAD WoodPecker Just 3500",
+ OverHeadCost = 15000m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 30000m
+ },
+ new
+ {
+ ResourceID = 5,
+ CodResource = "0120.02",
+ CostDriverBudget = 1760m,
+ CostDriverID = 1,
+ EBTPerc = 0.15m,
+ FixedCost = 24000m,
+ LaborCost = 35m,
+ Name = "Linea Pantografo",
+ OverHeadCost = 5000m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 6000m
+ },
+ new
+ {
+ ResourceID = 6,
+ CodResource = "0130.01",
+ CostDriverBudget = 880m,
+ CostDriverID = 1,
+ EBTPerc = 0.15m,
+ FixedCost = 24000m,
+ LaborCost = 30m,
+ Name = "Stazione Verniciatura",
+ OverHeadCost = 3000m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 6000m
+ },
+ new
+ {
+ ResourceID = 7,
+ CodResource = "0130.02",
+ CostDriverBudget = 220m,
+ CostDriverID = 1,
+ EBTPerc = 0.15m,
+ FixedCost = 6000m,
+ LaborCost = 30m,
+ Name = "Verniciatura Manuale",
+ OverHeadCost = 3000m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 2000m
+ },
+ new
+ {
+ ResourceID = 8,
+ CodResource = "0140",
+ CostDriverBudget = 3520m,
+ CostDriverID = 1,
+ EBTPerc = 0.15m,
+ FixedCost = 500m,
+ LaborCost = 30m,
+ Name = "Montaggio Manuale",
+ OverHeadCost = 500m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 500m
+ },
+ new
+ {
+ ResourceID = 9,
+ CodResource = "0150",
+ CostDriverBudget = 3520m,
+ CostDriverID = 1,
+ EBTPerc = 0.15m,
+ FixedCost = 0m,
+ LaborCost = 40m,
+ Name = "Installatore",
+ OverHeadCost = 0m,
+ OverHeadPerc = 0.15m,
+ PriceMargin = 0.2m,
+ VariableCost = 3000m
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Items.ItemGroupModel", b =>
+ {
+ b.Property("CodGroup")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("CodGroup");
+
+ b.ToTable("item_group");
+
+ b.HasData(
+ new
+ {
+ CodGroup = "BeamTrunk",
+ Description = "Barre legno per lavorazione Travi"
+ },
+ new
+ {
+ CodGroup = "WindowTrunk",
+ Description = "Barre legno per lavorazione Finestre"
+ },
+ new
+ {
+ CodGroup = "WindowGlass",
+ Description = "Vetri serramento"
+ },
+ new
+ {
+ CodGroup = "WindowVarnish",
+ Description = "Vernici per legno"
+ },
+ new
+ {
+ CodGroup = "WindowHardware",
+ Description = "Ferramenta serramento"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Items.ItemModel", b =>
+ {
+ b.Property("ItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ItemID"));
+
+ b.Property("CodGroup")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Cost")
+ .HasColumnType("double");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ExtItemCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("IsService")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemCode")
+ .HasColumnType("int");
+
+ b.Property("ItemIDParent")
+ .HasColumnType("int");
+
+ b.Property("ItemType")
+ .HasColumnType("int");
+
+ b.Property("Margin")
+ .HasColumnType("double");
+
+ b.Property("QtyMax")
+ .HasColumnType("double");
+
+ b.Property("QtyMin")
+ .HasColumnType("double");
+
+ b.Property("SupplCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("UM")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("ItemID");
+
+ b.HasIndex("CodGroup");
+
+ b.ToTable("item_item");
+
+ b.HasData(
+ new
+ {
+ ItemID = 1,
+ CodGroup = "WindowTrunk",
+ Cost = 20.0,
+ Description = "BARRA-60x80 generica",
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 1001,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.29999999999999999,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "BARR.001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 2,
+ CodGroup = "WindowTrunk",
+ Cost = 16.5,
+ Description = "Barra 60x80, lunghezza 12m",
+ ExtItemCode = "BARRA-60x80x12000",
+ IsService = false,
+ ItemCode = 1002,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20999999999999999,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "ABC.00123.12000",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 3,
+ CodGroup = "WindowTrunk",
+ Cost = 17.5,
+ Description = "Barra 60x80, lunghezza 8m",
+ ExtItemCode = "BARRA-60x80x8000",
+ IsService = false,
+ ItemCode = 1003,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.22,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "ABC.00123.8000",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 4,
+ CodGroup = "WindowTrunk",
+ Cost = 15.5,
+ Description = "Barra 60x80, lunghezza 16m",
+ ExtItemCode = "BARRA-60x80x16000",
+ IsService = false,
+ ItemCode = 1004,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20000000000000001,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "ABC.00123.16000",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 5,
+ CodGroup = "WindowGlass",
+ Cost = 300.0,
+ Description = "Vetro triplo, basso indice termico, 800x1000",
+ ExtItemCode = "VETRO-3L-THERMO-800x1000",
+ IsService = false,
+ ItemCode = 2001,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20000000000000001,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "V3T.800.1000",
+ UM = "m2"
+ },
+ new
+ {
+ ItemID = 6,
+ CodGroup = "WindowGlass",
+ Cost = 200.0,
+ Description = "Vetro doppio, 800x1000",
+ ExtItemCode = "VETRO-2L-800x1000",
+ IsService = false,
+ ItemCode = 2002,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.14999999999999999,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "V2.800.1000",
+ UM = "m2"
+ },
+ new
+ {
+ ItemID = 7,
+ CodGroup = "WindowGlass",
+ Cost = 250.0,
+ Description = "Vetro triplo, 800x1000",
+ ExtItemCode = "VETRO-3L-800x1000",
+ IsService = false,
+ ItemCode = 2003,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.17999999999999999,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "V3.800.1000",
+ UM = "m2"
+ },
+ new
+ {
+ ItemID = 8,
+ CodGroup = "WindowVarnish",
+ Cost = 20.0,
+ Description = "Vernice trasparente",
+ ExtItemCode = "VERN-TRASP",
+ IsService = false,
+ ItemCode = 3001,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20000000000000001,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "VT.STD",
+ UM = "l"
+ },
+ new
+ {
+ ItemID = 9,
+ CodGroup = "WindowHardware",
+ Cost = 65.0,
+ Description = "Kit standard completo AGB tipo 001",
+ ExtItemCode = "KIT-001",
+ IsService = false,
+ ItemCode = 5001,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20000000000000001,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "AGB-KIT-001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 10,
+ CodGroup = "WindowHardware",
+ Cost = 10.0,
+ Description = "Cerniera AGB tipo 001",
+ ExtItemCode = "CERN-001",
+ IsService = false,
+ ItemCode = 5002,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20000000000000001,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "AGB-CERN-001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 11,
+ CodGroup = "WindowHardware",
+ Cost = 15.0,
+ Description = "Serratura AGB tipo 001",
+ ExtItemCode = "SERR-001",
+ IsService = false,
+ ItemCode = 5003,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20000000000000001,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "AGB-SERR-001",
+ UM = "#"
+ },
+ new
+ {
+ ItemID = 12,
+ CodGroup = "WindowHardware",
+ Cost = 25.0,
+ Description = "Maniglia AGB tipo 001",
+ ExtItemCode = "MAN-001",
+ IsService = false,
+ ItemCode = 5004,
+ ItemIDParent = 0,
+ ItemType = 1,
+ Margin = 0.20000000000000001,
+ QtyMax = 0.0,
+ QtyMin = 0.0,
+ SupplCode = "AGB-MAN-001",
+ UM = "#"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Items.SellingItemModel", b =>
+ {
+ b.Property("SellingItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SellingItemID"));
+
+ b.Property("Cost")
+ .HasColumnType("double");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Envir")
+ .HasColumnType("int");
+
+ b.Property("ExtItemCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("IsService")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemCode")
+ .HasColumnType("int");
+
+ b.Property("ItemSteps")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("JobID")
+ .HasColumnType("int");
+
+ b.Property("Margin")
+ .HasColumnType("double");
+
+ b.Property("SerStruct")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("SupplCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("UM")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("SellingItemID");
+
+ b.HasIndex("JobID");
+
+ b.ToTable("item_selling_item");
+
+ b.HasData(
+ new
+ {
+ SellingItemID = 1,
+ Cost = 500.0,
+ Description = "Finestra Anta Singola",
+ Envir = 1,
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSteps = "",
+ JobID = 2,
+ Margin = 0.20000000000000001,
+ SerStruct = "{\"ProfilePath\": \"Profilo78\",\"Material\": \"Pino\",\"ColorMaterial\": \"Black\",\"Glass\": \"Vetro BE 2S 4T/16/4T\",\"AreaList\": [{\"Shape\": \"RECTANGLE\",\"DimensionList\": [{\"Index\": 1,\"Name\": \"Width\",\"Value\": 800.0},{\"Index\": 2,\"Name\": \"Height\",\"Value\": 1200.0}],\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"BottomRail\": false,\"BottomRailQty\": 0,\"GroupId\": 1,\"AreaList\": [{\"IsSashVertical\": true,\"SashList\": [{\"SashId\": 1,\"OpeningType\": \"TILTTURN_LEFT\",\"HasHandle\": true,\"Dimension\": 100.0}],\"SashType\": \"NULL\",\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"Hardware\": \"000635\",\"HwOptionList\": [{\"Name\": \"Entrata\",\"Value\": \"15\"},{\"Name\": \"LavManigliaPassante\",\"Value\": \"false\"},{\"Name\": \"PosizioneForoCilindro\",\"Value\": \"sotto\"},{\"Name\": \"Deviatore\",\"Value\": \"false\"},{\"Name\": \"ModelloCilindro\",\"Value\": \"c999\"},{\"Name\": \"LavCilindroPassante\",\"Value\": \"false\"},{\"Name\": \"HMan\",\"Value\": \"400\"}],\"GroupId\": 2,\"AreaList\": [{\"FillType\": \"GLASS\",\"GroupId\": 3,\"AreaList\": [],\"AreaType\": \"FILL\"}],\"AreaType\": \"SASH\"}],\"AreaType\": \"FRAME\"}]}",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 2,
+ Cost = 300.0,
+ Description = "Finestra Vetro Fisso ",
+ Envir = 1,
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSteps = "",
+ JobID = 2,
+ Margin = 0.20000000000000001,
+ SerStruct = "{\"ProfilePath\": \"Profilo78\",\"Material\": \"Pino\",\"ColorMaterial\": \"Black\",\"Glass\": \"Vetro BE 2S 4T/16/4T\",\"AreaList\": [{\"Shape\": \"RECTANGLE\",\"DimensionList\": [{\"Index\": 1,\"Name\": \"Width\",\"Value\": 800.0},{\"Index\": 2,\"Name\": \"Height\",\"Value\": 1200.0}],\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"BottomRail\": false,\"BottomRailQty\": 0,\"GroupId\": 1,\"AreaList\": [{\"IsSashVertical\": true,\"SashList\": [{\"SashId\": 1,\"OpeningType\": \"TILTTURN_LEFT\",\"HasHandle\": true,\"Dimension\": 100.0}],\"SashType\": \"NULL\",\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"Hardware\": \"000635\",\"HwOptionList\": [{\"Name\": \"Entrata\",\"Value\": \"15\"},{\"Name\": \"LavManigliaPassante\",\"Value\": \"false\"},{\"Name\": \"PosizioneForoCilindro\",\"Value\": \"sotto\"},{\"Name\": \"Deviatore\",\"Value\": \"false\"},{\"Name\": \"ModelloCilindro\",\"Value\": \"c999\"},{\"Name\": \"LavCilindroPassante\",\"Value\": \"false\"},{\"Name\": \"HMan\",\"Value\": \"400\"}],\"GroupId\": 2,\"AreaList\": [{\"FillType\": \"GLASS\",\"GroupId\": 3,\"AreaList\": [],\"AreaType\": \"FILL\"}],\"AreaType\": \"SASH\"}],\"AreaType\": \"FRAME\"}]}",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 3,
+ Cost = 150.0,
+ Description = "Persiana anta singola",
+ Envir = 1,
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSteps = "",
+ JobID = 1,
+ Margin = 0.10000000000000001,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 4,
+ Cost = 200.0,
+ Description = "Installazione",
+ Envir = 1,
+ ExtItemCode = "",
+ IsService = true,
+ ItemCode = 0,
+ ItemSteps = "",
+ JobID = 1,
+ Margin = 0.29999999999999999,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 5,
+ Cost = 1000.0,
+ Description = "Trave lamellare",
+ Envir = 2,
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSteps = "",
+ JobID = 3,
+ Margin = 0.29999999999999999,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 6,
+ Cost = 500.0,
+ Description = "Cabinet",
+ Envir = 4,
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSteps = "",
+ JobID = 4,
+ Margin = 0.29999999999999999,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ },
+ new
+ {
+ SellingItemID = 7,
+ Cost = 2000.0,
+ Description = "Parete",
+ Envir = 3,
+ ExtItemCode = "",
+ IsService = false,
+ ItemCode = 0,
+ ItemSteps = "",
+ JobID = 5,
+ Margin = 0.29999999999999999,
+ SerStruct = "",
+ SupplCode = "",
+ UM = "#"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Items.SupplierModel", b =>
+ {
+ b.Property("SupplierID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SupplierID"));
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("SupplierID");
+
+ b.ToTable("item_supplier");
+
+ b.HasData(
+ new
+ {
+ SupplierID = 1,
+ CompanyName = "Company One",
+ FirstName = "Supplier A",
+ LastName = "Egalware",
+ VAT = "7294857103879254"
+ },
+ new
+ {
+ SupplierID = 2,
+ CompanyName = "Company Two",
+ FirstName = "Supplier B",
+ LastName = "User",
+ VAT = "7294857103879254"
+ },
+ new
+ {
+ SupplierID = 3,
+ CompanyName = "Company Two",
+ FirstName = "Supplier C",
+ LastName = "User Test",
+ VAT = "7294857103879254"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Production.ProductionBatchModel", b =>
+ {
+ b.Property("ProductionBatchID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProductionBatchID"));
+
+ b.Property("DateEnd")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("DueDate")
+ .HasColumnType("datetime(6)");
+
+ b.HasKey("ProductionBatchID");
+
+ b.ToTable("production_batch");
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Production.ProductionItemModel", b =>
+ {
+ b.Property("ProdItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProdItemID"));
+
+ b.Property("ExtItemCode")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ItemCode")
+ .HasColumnType("int");
+
+ b.Property("OrderRowID")
+ .HasColumnType("int");
+
+ b.Property("ProductionBatchID")
+ .HasColumnType("int");
+
+ b.HasKey("ProdItemID");
+
+ b.HasIndex("OrderRowID");
+
+ b.HasIndex("ProductionBatchID");
+
+ b.ToTable("production_item");
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Production.ProductionItemStepModel", b =>
+ {
+ b.Property("ProdItemStepID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("ProdItemStepID"));
+
+ b.Property("DateEnd")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DateStart")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Index")
+ .HasColumnType("int");
+
+ b.Property("PhaseID")
+ .HasColumnType("int");
+
+ b.Property("ProdItemID")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.Property("ResourceID")
+ .HasColumnType("int");
+
+ b.Property("WorkTime")
+ .HasColumnType("double");
+
+ b.HasKey("ProdItemStepID");
+
+ b.HasIndex("PhaseID");
+
+ b.HasIndex("ProdItemID");
+
+ b.HasIndex("ResourceID");
+
+ b.ToTable("production_item_step");
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Sales.CustomerModel", b =>
+ {
+ b.Property("CustomerID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("CustomerID"));
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("CustomerID");
+
+ b.ToTable("sales_customer");
+
+ b.HasData(
+ new
+ {
+ CustomerID = 1,
+ CompanyName = "",
+ FirstName = "Customer A",
+ LastName = "Egalware",
+ VAT = "1234567890123456"
+ },
+ new
+ {
+ CustomerID = 2,
+ CompanyName = "",
+ FirstName = "Customer B",
+ LastName = "User",
+ VAT = "1234567890123456"
+ },
+ new
+ {
+ CustomerID = 3,
+ CompanyName = "",
+ FirstName = "Customer C",
+ LastName = "User Test",
+ VAT = "1234567890123456"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Sales.DealerModel", b =>
+ {
+ b.Property("DealerID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("DealerID"));
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("VAT")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("DealerID");
+
+ b.ToTable("sales_dealer");
+
+ b.HasData(
+ new
+ {
+ DealerID = 1,
+ CompanyName = "Company First",
+ FirstName = "Dealer A",
+ LastName = "Egalware",
+ VAT = "9587362514671527"
+ },
+ new
+ {
+ DealerID = 2,
+ CompanyName = "Company First",
+ FirstName = "Dealer B",
+ LastName = "User",
+ VAT = "9587362514671527"
+ },
+ new
+ {
+ DealerID = 3,
+ CompanyName = "Company Second",
+ FirstName = "Dealer C",
+ LastName = "User Test",
+ VAT = "9587362514671527"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Sales.OfferModel", b =>
+ {
+ b.Property("OfferID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OfferID"));
+
+ b.Property("ConsNote")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("CustomerID")
+ .HasColumnType("int");
+
+ b.Property("DealerID")
+ .HasColumnType("int");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("DictPresel")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Discount")
+ .HasColumnType("double");
+
+ b.Property("DueDateProm")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DueDateReq")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Envir")
+ .HasColumnType("int");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("OffertState")
+ .HasColumnType("int");
+
+ b.Property("RefNum")
+ .HasColumnType("int");
+
+ b.Property("RefRev")
+ .HasColumnType("int");
+
+ b.Property("RefYear")
+ .HasColumnType("int");
+
+ b.Property("ValidUntil")
+ .HasColumnType("datetime(6)");
+
+ b.HasKey("OfferID");
+
+ b.HasIndex("CustomerID");
+
+ b.HasIndex("DealerID");
+
+ b.ToTable("sales_offer");
+
+ b.HasData(
+ new
+ {
+ OfferID = 1,
+ ConsNote = "",
+ CustomerID = 2,
+ DealerID = 2,
+ Description = "Offerta per tre serramenti",
+ DictPresel = "",
+ Discount = 0.0,
+ DueDateProm = new DateTime(2026, 1, 4, 0, 0, 0, 0, DateTimeKind.Local),
+ DueDateReq = new DateTime(2025, 12, 5, 0, 0, 0, 0, DateTimeKind.Local),
+ Envir = 1,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9801),
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9803),
+ OffertState = 0,
+ RefNum = 1,
+ RefRev = 1,
+ RefYear = 2024,
+ ValidUntil = new DateTime(2025, 12, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9799)
+ },
+ new
+ {
+ OfferID = 2,
+ ConsNote = "",
+ CustomerID = 2,
+ DealerID = 2,
+ Description = "Offerta BEAM",
+ DictPresel = "",
+ Discount = 0.0,
+ DueDateProm = new DateTime(2026, 1, 4, 0, 0, 0, 0, DateTimeKind.Local),
+ DueDateReq = new DateTime(2025, 12, 5, 0, 0, 0, 0, DateTimeKind.Local),
+ Envir = 2,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9818),
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9819),
+ OffertState = 0,
+ RefNum = 2,
+ RefRev = 1,
+ RefYear = 2024,
+ ValidUntil = new DateTime(2025, 12, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9817)
+ },
+ new
+ {
+ OfferID = 3,
+ ConsNote = "",
+ CustomerID = 2,
+ DealerID = 2,
+ Description = "Offerta Cabinet",
+ DictPresel = "",
+ Discount = 0.0,
+ DueDateProm = new DateTime(2026, 1, 4, 0, 0, 0, 0, DateTimeKind.Local),
+ DueDateReq = new DateTime(2025, 12, 5, 0, 0, 0, 0, DateTimeKind.Local),
+ Envir = 4,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9828),
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9830),
+ OffertState = 0,
+ RefNum = 3,
+ RefRev = 1,
+ RefYear = 2024,
+ ValidUntil = new DateTime(2025, 12, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9827)
+ },
+ new
+ {
+ OfferID = 4,
+ ConsNote = "",
+ CustomerID = 2,
+ DealerID = 2,
+ Description = "Offerta Wall",
+ DictPresel = "",
+ Discount = 0.0,
+ DueDateProm = new DateTime(2026, 1, 4, 0, 0, 0, 0, DateTimeKind.Local),
+ DueDateReq = new DateTime(2025, 12, 5, 0, 0, 0, 0, DateTimeKind.Local),
+ Envir = 3,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9838),
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9840),
+ OffertState = 0,
+ RefNum = 4,
+ RefRev = 1,
+ RefYear = 2024,
+ ValidUntil = new DateTime(2025, 12, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9837)
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Sales.OfferRowModel", b =>
+ {
+ b.Property("OfferRowID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OfferRowID"));
+
+ b.Property("AwaitBom")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AwaitPrice")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("BomCost")
+ .HasColumnType("double");
+
+ b.Property("BomOk")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("BomPrice")
+ .HasColumnType("double");
+
+ b.Property("Envir")
+ .HasColumnType("int");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FileResource")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ItemBOM")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ItemJCD")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ItemOk")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemSteps")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("OfferID")
+ .HasColumnType("int");
+
+ b.Property("OfferRowUID")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.Property("RowNum")
+ .HasColumnType("int");
+
+ b.Property("SellingItemID")
+ .HasColumnType("int");
+
+ b.Property("SerStruct")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("StepCost")
+ .HasColumnType("double");
+
+ b.Property("StepFlowTime")
+ .HasColumnType("double");
+
+ b.Property("StepLeadTime")
+ .HasColumnType("double");
+
+ b.Property("StepPrice")
+ .HasColumnType("double");
+
+ b.HasKey("OfferRowID");
+
+ b.HasIndex("OfferID");
+
+ b.HasIndex("SellingItemID");
+
+ b.ToTable("sales_offer_row");
+
+ b.HasData(
+ new
+ {
+ OfferRowID = 2,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 900.0,
+ BomOk = true,
+ BomPrice = 950.0,
+ Envir = 1,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9951),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9953),
+ Note = "Finestra Anta Singola 2025",
+ OfferID = 1,
+ OfferRowUID = "SOR.25.00000002",
+ Qty = 3.0,
+ RowNum = 1,
+ SellingItemID = 1,
+ SerStruct = "{\"ProfilePath\": \"Profilo78\",\"Material\": \"Pino\",\"ColorMaterial\": \"Black\",\"Glass\": \"Vetro BE 2S 4T/16/4T\",\"AreaList\": [{\"Shape\": \"RECTANGLE\",\"DimensionList\": [{\"Index\": 1,\"Name\": \"Width\",\"Value\": 800.0},{\"Index\": 2,\"Name\": \"Height\",\"Value\": 1200.0}],\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"BottomRail\": false,\"BottomRailQty\": 0,\"GroupId\": 1,\"AreaList\": [{\"IsSashVertical\": true,\"SashList\": [{\"SashId\": 1,\"OpeningType\": \"TILTTURN_LEFT\",\"HasHandle\": true,\"Dimension\": 100.0}],\"SashType\": \"NULL\",\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"Hardware\": \"000635\",\"HwOptionList\": [{\"Name\": \"Entrata\",\"Value\": \"15\"},{\"Name\": \"LavManigliaPassante\",\"Value\": \"false\"},{\"Name\": \"PosizioneForoCilindro\",\"Value\": \"sotto\"},{\"Name\": \"Deviatore\",\"Value\": \"false\"},{\"Name\": \"ModelloCilindro\",\"Value\": \"c999\"},{\"Name\": \"LavCilindroPassante\",\"Value\": \"false\"},{\"Name\": \"HMan\",\"Value\": \"400\"}],\"GroupId\": 2,\"AreaList\": [{\"FillType\": \"GLASS\",\"GroupId\": 3,\"AreaList\": [],\"AreaType\": \"FILL\"}],\"AreaType\": \"SASH\"}],\"AreaType\": \"FRAME\"}]}",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 1,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 900.0,
+ BomOk = true,
+ BomPrice = 950.0,
+ Envir = 1,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9967),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9969),
+ Note = "Finestra Vetro Fisso 2025",
+ OfferID = 1,
+ OfferRowUID = "SOR.25.00000001",
+ Qty = 3.0,
+ RowNum = 2,
+ SellingItemID = 2,
+ SerStruct = "{\"ProfilePath\": \"Profilo78\",\"Material\": \"Pino\",\"ColorMaterial\": \"Black\",\"Glass\": \"Vetro BE 2S 4T/16/4T\",\"AreaList\": [{\"Shape\": \"RECTANGLE\",\"DimensionList\": [{\"Index\": 1,\"Name\": \"Width\",\"Value\": 800.0},{\"Index\": 2,\"Name\": \"Height\",\"Value\": 1200.0}],\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"BottomRail\": false,\"BottomRailQty\": 0,\"GroupId\": 1,\"AreaList\": [{\"IsSashVertical\": true,\"SashList\": [{\"SashId\": 1,\"OpeningType\": \"TILTTURN_LEFT\",\"HasHandle\": true,\"Dimension\": 100.0}],\"SashType\": \"NULL\",\"JointList\": [{\"Index\": 1,\"JointType\": \"FULL_H\"},{\"Index\": 2,\"JointType\": \"FULL_H\"},{\"Index\": 3,\"JointType\": \"FULL_H\"},{\"Index\": 4,\"JointType\": \"FULL_H\"}],\"Hardware\": \"000635\",\"HwOptionList\": [{\"Name\": \"Entrata\",\"Value\": \"15\"},{\"Name\": \"LavManigliaPassante\",\"Value\": \"false\"},{\"Name\": \"PosizioneForoCilindro\",\"Value\": \"sotto\"},{\"Name\": \"Deviatore\",\"Value\": \"false\"},{\"Name\": \"ModelloCilindro\",\"Value\": \"c999\"},{\"Name\": \"LavCilindroPassante\",\"Value\": \"false\"},{\"Name\": \"HMan\",\"Value\": \"400\"}],\"GroupId\": 2,\"AreaList\": [{\"FillType\": \"GLASS\",\"GroupId\": 3,\"AreaList\": [],\"AreaType\": \"FILL\"}],\"AreaType\": \"SASH\"}],\"AreaType\": \"FRAME\"}]}",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 3,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 160.0,
+ BomOk = true,
+ BomPrice = 200.0,
+ Envir = 1,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9980),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9982),
+ Note = "Persiana per Finestra anta singola 2025",
+ OfferID = 1,
+ OfferRowUID = "SOR.25.00000003",
+ Qty = 3.0,
+ RowNum = 3,
+ SellingItemID = 3,
+ SerStruct = "{}",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 4,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 200.0,
+ BomOk = true,
+ BomPrice = 250.0,
+ Envir = 1,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9993),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 390, DateTimeKind.Local).AddTicks(9995),
+ Note = "Installazione serramento",
+ OfferID = 1,
+ OfferRowUID = "SOR.25.00000004",
+ Qty = 3.0,
+ RowNum = 4,
+ SellingItemID = 4,
+ SerStruct = "{}",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 5,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 800.0,
+ BomOk = true,
+ BomPrice = 1150.0,
+ Envir = 2,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(29),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(30),
+ Note = "Demo file 01",
+ OfferID = 2,
+ OfferRowUID = "SOR.25.00000005",
+ Qty = 10.0,
+ RowNum = 1,
+ SellingItemID = 5,
+ SerStruct = "",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 6,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 600.0,
+ BomOk = true,
+ BomPrice = 950.0,
+ Envir = 2,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(42),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(43),
+ Note = "Demo file 02",
+ OfferID = 2,
+ OfferRowUID = "SOR.25.00000006",
+ Qty = 4.0,
+ RowNum = 1,
+ SellingItemID = 5,
+ SerStruct = "",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 7,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 200.0,
+ BomOk = true,
+ BomPrice = 250.0,
+ Envir = 3,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(73),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(75),
+ Note = "Demo file 01",
+ OfferID = 3,
+ OfferRowUID = "SOR.25.00000007",
+ Qty = 4.0,
+ RowNum = 1,
+ SellingItemID = 6,
+ SerStruct = "",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 8,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 50.0,
+ BomOk = true,
+ BomPrice = 80.0,
+ Envir = 3,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(86),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(88),
+ Note = "Demo file 02",
+ OfferID = 3,
+ OfferRowUID = "SOR.25.00000008",
+ Qty = 12.0,
+ RowNum = 1,
+ SellingItemID = 6,
+ SerStruct = "",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 9,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 800.0,
+ BomOk = true,
+ BomPrice = 1150.0,
+ Envir = 4,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(116),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(118),
+ Note = "Demo file 01",
+ OfferID = 4,
+ OfferRowUID = "SOR.25.00000009",
+ Qty = 6.0,
+ RowNum = 1,
+ SellingItemID = 7,
+ SerStruct = "",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ },
+ new
+ {
+ OfferRowID = 10,
+ AwaitBom = false,
+ AwaitPrice = false,
+ BomCost = 600.0,
+ BomOk = true,
+ BomPrice = 950.0,
+ Envir = 4,
+ FileName = "",
+ FileResource = "",
+ FileSize = 0L,
+ Inserted = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(130),
+ ItemBOM = "",
+ ItemJCD = "",
+ ItemOk = true,
+ ItemSteps = "{}",
+ Modified = new DateTime(2025, 11, 5, 19, 10, 44, 391, DateTimeKind.Local).AddTicks(131),
+ Note = "Demo file 02",
+ OfferID = 4,
+ OfferRowUID = "SOR.25.0000000A",
+ Qty = 4.0,
+ RowNum = 1,
+ SellingItemID = 7,
+ SerStruct = "",
+ StepCost = 0.0,
+ StepFlowTime = 0.0,
+ StepLeadTime = 0.0,
+ StepPrice = 0.0
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Sales.OrderModel", b =>
+ {
+ b.Property("OrderID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OrderID"));
+
+ b.Property("ConsNote")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("CustomerID")
+ .HasColumnType("int");
+
+ b.Property("DealerID")
+ .HasColumnType("int");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("DictPresel")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Discount")
+ .HasColumnType("double");
+
+ b.Property("DueDateProm")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DueDateReq")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Envir")
+ .HasColumnType("int");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("OfferID")
+ .HasColumnType("int");
+
+ b.Property("OrderState")
+ .HasColumnType("int");
+
+ b.Property("RefNum")
+ .HasColumnType("int");
+
+ b.Property("RefRev")
+ .HasColumnType("int");
+
+ b.Property("RefYear")
+ .HasColumnType("int");
+
+ b.Property("ValidUntil")
+ .HasColumnType("datetime(6)");
+
+ b.HasKey("OrderID");
+
+ b.HasIndex("CustomerID");
+
+ b.HasIndex("DealerID");
+
+ b.HasIndex("OfferID");
+
+ b.ToTable("sales_order");
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Sales.OrderRowModel", b =>
+ {
+ b.Property("OrderRowID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("OrderRowID"));
+
+ b.Property("AwaitBom")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AwaitPrice")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("BomCost")
+ .HasColumnType("double");
+
+ b.Property("BomOk")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("BomPrice")
+ .HasColumnType("double");
+
+ b.Property("Envir")
+ .HasColumnType("int");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FileResource")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("Inserted")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ItemBOM")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ItemJCD")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ItemOk")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemSteps")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Modified")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("OrderID")
+ .HasColumnType("int");
+
+ b.Property("OrderRowUID")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Qty")
+ .HasColumnType("double");
+
+ b.Property("RowNum")
+ .HasColumnType("int");
+
+ b.Property("SellingItemID")
+ .HasColumnType("int");
+
+ b.Property("SerStruct")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("StepCost")
+ .HasColumnType("double");
+
+ b.Property("StepFlowTime")
+ .HasColumnType("double");
+
+ b.Property("StepLeadTime")
+ .HasColumnType("double");
+
+ b.Property("StepPrice")
+ .HasColumnType("double");
+
+ b.HasKey("OrderRowID");
+
+ b.HasIndex("OrderID");
+
+ b.HasIndex("SellingItemID");
+
+ b.ToTable("sales_order_row");
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Stock.StockMovModel", b =>
+ {
+ b.Property("StockMovID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StockMovID"));
+
+ b.Property("CodDoc")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("DtCreate")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("timestamp")
+ .HasDefaultValueSql("CURRENT_TIMESTAMP");
+
+ b.Property("DtMod")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("timestamp")
+ .HasDefaultValueSql("CURRENT_TIMESTAMP");
+
+ MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("DtMod"));
+
+ b.Property("MovCod")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("QtyRec")
+ .HasColumnType("double");
+
+ b.Property("StockStatusId")
+ .HasColumnType("int");
+
+ b.Property("UnitVal")
+ .HasColumnType("double");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("StockMovID");
+
+ b.HasIndex("MovCod");
+
+ b.HasIndex("StockStatusId");
+
+ b.ToTable("stock_mov");
+
+ b.HasData(
+ new
+ {
+ StockMovID = 1,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2290),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2407),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 5.0,
+ StockStatusId = 1,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 2,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2410),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2412),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 8.0,
+ StockStatusId = 2,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 3,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2414),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2415),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 5.0,
+ StockStatusId = 3,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 4,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2418),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2419),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 4,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 5,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2421),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2423),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 10.0,
+ StockStatusId = 5,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 6,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2425),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2427),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 6,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 7,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2429),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2430),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 50.0,
+ StockStatusId = 7,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 8,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2432),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2434),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 8,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 9,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2436),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2437),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 9,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ },
+ new
+ {
+ StockMovID = 10,
+ CodDoc = "",
+ DtCreate = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2440),
+ DtMod = new DateTime(2025, 11, 5, 19, 10, 44, 387, DateTimeKind.Local).AddTicks(2441),
+ MovCod = "CAR",
+ Note = "DEMO",
+ QtyRec = 1.0,
+ StockStatusId = 10,
+ UnitVal = 0.0,
+ UserId = "samuele.locatelli@egalware.com"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Stock.StockStatusModel", b =>
+ {
+ b.Property("StockStatusId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("StockStatusId"));
+
+ b.Property("IsDeleted")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsRemn")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ItemID")
+ .HasColumnType("int");
+
+ b.Property("Location")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("QtyAvail")
+ .HasColumnType("double");
+
+ b.HasKey("StockStatusId");
+
+ b.HasIndex("ItemID");
+
+ b.ToTable("stock_status");
+
+ b.HasData(
+ new
+ {
+ StockStatusId = 1,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 1,
+ Location = "B001-001-003",
+ QtyAvail = 5.0
+ },
+ new
+ {
+ StockStatusId = 2,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 2,
+ Location = "B001-001-002",
+ QtyAvail = 8.0
+ },
+ new
+ {
+ StockStatusId = 3,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 3,
+ Location = "B001-001-001",
+ QtyAvail = 5.0
+ },
+ new
+ {
+ StockStatusId = 4,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 4,
+ Location = "V002-001-001",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 5,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 5,
+ Location = "V001-001-002",
+ QtyAvail = 10.0
+ },
+ new
+ {
+ StockStatusId = 6,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 6,
+ Location = "V001-001-003",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 7,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 8,
+ Location = "V001-001-003",
+ QtyAvail = 50.0
+ },
+ new
+ {
+ StockStatusId = 8,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 11,
+ Location = "S001-002-001",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 9,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 9,
+ Location = "S001-002-001",
+ QtyAvail = 1.0
+ },
+ new
+ {
+ StockStatusId = 10,
+ IsDeleted = false,
+ IsRemn = false,
+ ItemID = 10,
+ Location = "S001-001-001",
+ QtyAvail = 1.0
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobDriverConfigModel", b =>
+ {
+ b.Property("JobDriverConfID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("JobDriverConfID"));
+
+ b.Property("CostDriverID")
+ .HasColumnType("int");
+
+ b.Property("DefaultVal")
+ .HasColumnType("double");
+
+ b.Property("Intercept")
+ .HasColumnType("double");
+
+ b.Property("JobDriverID")
+ .HasColumnType("int");
+
+ b.Property("JobID")
+ .HasColumnType("int");
+
+ b.Property("Note")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Regress")
+ .HasColumnType("double");
+
+ b.HasKey("JobDriverConfID");
+
+ b.HasIndex("CostDriverID");
+
+ b.HasIndex("JobDriverID");
+
+ b.HasIndex("JobID");
+
+ b.ToTable("task_job_driver_config");
+
+ b.HasData(
+ new
+ {
+ JobDriverConfID = 1,
+ CostDriverID = 3,
+ DefaultVal = 1.0,
+ Intercept = 0.0,
+ JobDriverID = 3,
+ JobID = 6,
+ Note = "Numero prodotti",
+ Regress = 1.0
+ },
+ new
+ {
+ JobDriverConfID = 2,
+ CostDriverID = 3,
+ DefaultVal = 1.0,
+ Intercept = 0.0,
+ JobDriverID = 3,
+ JobID = 7,
+ Note = "Numero prodotti",
+ Regress = 1.0
+ },
+ new
+ {
+ JobDriverConfID = 3,
+ CostDriverID = 1,
+ DefaultVal = 5.0,
+ Intercept = 0.0,
+ JobDriverID = 1,
+ JobID = 7,
+ Note = "Ore Equivalenti",
+ Regress = 0.016666666666666666
+ },
+ new
+ {
+ JobDriverConfID = 4,
+ CostDriverID = 3,
+ DefaultVal = 1.0,
+ Intercept = 0.0,
+ JobDriverID = 3,
+ JobID = 2,
+ Note = "Numero prodotti",
+ Regress = 1.0
+ },
+ new
+ {
+ JobDriverConfID = 5,
+ CostDriverID = 1,
+ DefaultVal = 5.0,
+ Intercept = 0.0,
+ JobDriverID = 1,
+ JobID = 2,
+ Note = "Ore Equivalenti",
+ Regress = 0.016666666666666666
+ },
+ new
+ {
+ JobDriverConfID = 6,
+ CostDriverID = 1,
+ DefaultVal = 8.0,
+ Intercept = 0.0,
+ JobDriverID = 4,
+ JobID = 2,
+ Note = "Ore Extra per complex Articolo (1 min/pezzo)",
+ Regress = 0.016666666666666666
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobDriverModel", b =>
+ {
+ b.Property("JobDriverID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("JobDriverID"));
+
+ b.Property("Descript")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.HasKey("JobDriverID");
+
+ b.ToTable("task_job_driver");
+
+ b.HasData(
+ new
+ {
+ JobDriverID = 1,
+ Descript = "Tempo netto di lavorazione, in minuti",
+ Name = "LeadTime"
+ },
+ new
+ {
+ JobDriverID = 2,
+ Descript = "Tempo di attraversamento complessivo del processo, in giorni lavorativi",
+ Name = "FlowTime"
+ },
+ new
+ {
+ JobDriverID = 3,
+ Descript = "Numero Articoli/Prodotti",
+ Name = "NumArticoli"
+ },
+ new
+ {
+ JobDriverID = 4,
+ Descript = "Numero Items per Articolo",
+ Name = "NumItems"
+ },
+ new
+ {
+ JobDriverID = 5,
+ Descript = "Indice complex lavorazioni",
+ Name = "WorkCompScore"
+ },
+ new
+ {
+ JobDriverID = 6,
+ Descript = "Indice complex materiali",
+ Name = "MaterialCompScore"
+ },
+ new
+ {
+ JobDriverID = 7,
+ Descript = "Indice complex generale",
+ Name = "GeneralScore"
+ });
+ });
+
+ modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Task.JobStepItemModel", b =>
+ {
+ b.Property("JobStepItemID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("JobStepItemID"));
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("Index")
+ .HasColumnType("int");
+
+ b.Property