update modello dati x prodItem child

This commit is contained in:
2025-11-19 18:58:31 +01:00
parent 9232d1db9c
commit 85e2dfe821
3 changed files with 24 additions and 7 deletions
@@ -20,7 +20,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// <summary>
/// Riga Ordine da cui scaturisce
/// </summary>
public int OrderRowID { get; set; }
public int OrderRowID { get; set; } = 0;
/// <summary>
/// CodArticolo (opzionale) numerico
@@ -33,9 +33,10 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
public string ExtItemCode { get; set; } = "";
/// <summary>
/// Batch di produzione cui è correlato
/// Batch di produzione cui è correlato (può essere nullo inizialmente e poi variato)
/// </summary>
public int ProductionBatchID { get; set; } = 0;
public int? ProductionBatchID { get; set; }
#if false
/// <summary>
/// Cod Fornitore (opzionale)
@@ -62,7 +63,13 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// </summary>
public string UM { get; set; } = "#";
#endif
/// <summary>
/// Etichetta dell'item
/// </summary>
public string ProdLabel
{
get => $"PT{ProdItemID:X8}";
}
/// <summary>
/// Navigazione OrderRow
@@ -74,7 +81,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// Navigazione Batch Produzione
/// </summary>
[ForeignKey("ProductionBatchID")]
public virtual ProductionBatchModel ProductionBatchNav { get; set; } = null!;
public virtual ProductionBatchModel? ProductionBatchNav { get; set; }
}
}
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using EgwCoreLib.Lux.Data.DbModel.Production;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static EgwCoreLib.Lux.Core.Enums;
@@ -129,7 +130,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
[NotMapped]
public double NumProdItems
{
get => OrderRowNav?.Sum(x => x.ProdItemQty) ?? 0;
get => OrderRowNav?.Sum(x => x.ProdItemQtyTot) ?? 0;
}
/// <summary>
@@ -190,5 +191,6 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
/// Navigazione alle righe ordine
/// </summary>
public virtual ICollection<OrderRowModel> OrderRowNav { get; set; } = new List<OrderRowModel>();
}
}
@@ -177,6 +177,14 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
/// </summary>
public int ProdItemQty { get; set; } = 0;
/// <summary>
/// Quantità degli item da produrre per PEZZO (es parti del serramento, singole parti BTL...)
/// </summary>
public double ProdItemQtyTot
{
get => Qty * ProdItemQty;
}
/// <summary>
/// Riferimento JobID Ciclo corrente (tra quelli ammissibili dato ItemJCD)
/// </summary>