Update modello dati x gestione costing + drivers

This commit is contained in:
Samuele Locatelli
2025-10-24 18:31:20 +02:00
parent e2c83a3313
commit 7327ea1a8f
12 changed files with 256 additions and 70 deletions
@@ -1,19 +1,12 @@
using EgwCoreLib.Lux.Data.DbModel.Items;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace EgwCoreLib.Lux.Data.DbModel.Sales
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("sales_order_row")]
public class OrderRowModel
{
@@ -29,10 +22,22 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
public int OrderID { get; set; }
/// <summary>
/// Riga Ordine
/// Riga Ordine (per ordinamento)
/// </summary>
public int RowNum { get; set; } = 0;
/// <summary>
/// Environment della richiesta
/// </summary>
public EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS Envir { get; set; } = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
/// <summary>
/// Campo salvato dell'UID da codice DataMatrix calcolato
/// inizia per SOR = SalesOfferRow
/// </summary>
public string OrderRowUID { get; set; } = "POR.25.0123ABCD";
/// <summary>
/// Codice calcolato Ordine ANNO.NUMERO
/// inizia per PO = PurchaseOrder
@@ -40,7 +45,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
[NotMapped]
public string OrderRowCode
{
get => $"PO{OrderRowID:000000}.{RowNum:000}";
get => $"POR.{Inserted:yy}.{OrderRowID:X8}";
}
/// <summary>
@@ -48,16 +53,16 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
/// </summary>
public int? SellingItemID { get; set; }
/// <summary>
/// Quantità della risorsa
/// </summary>
public double Qty { get; set; } = 1;
/// <summary>
/// Costo dei componeti BOM (RockBottom)
/// </summary>
public double BomCost { get; set; } = 0;
/// <summary>
/// Margine percentuale standard
/// </summary>
public double Qty { get; set; } = 1;
/// <summary>
/// Prezzo dei componeti BOM (scontabile)
/// </summary>
@@ -74,6 +79,17 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
/// </summary>
public double StepPrice { get; set; } = 0;
/// <summary>
/// LeadTime puro (tempo di lavorazione): somma dei LeadTime da ItemSteps
/// </summary>
public double StepLeadTime { get; set; } = 0;
/// <summary>
/// FlowTime totale (tempo di attraversamento): somma dei FlowTime da ItemSteps
/// </summary>
public double StepFlowTime { get; set; } = 0;
/// <summary>
/// Costo Totale Risorsa (BOM + Fase)
/// </summary>
@@ -125,11 +141,46 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
public string SerStruct { get; set; } = "";
/// <summary>
/// Elenco StepDTO (Fasi) per la stima tempi / costi
/// potrebbe contenere anche altre info accessorie x definire dati logistico/gestionali
/// Nomi risorsa file associato alla riga offerta (es per BTL)
/// URI come risorsa dentro folder offerta/riga-offerta/guid
/// </summary>
public string FileResource { get; set; } = "";
/// <summary>
/// Nomi file originale associato alla riga offerta (es per BTL)
/// </summary>
public string FileName { get; set; } = "";
/// <summary>
/// Dimensione del file (per visualizzazione rapida)
/// </summary>
public long FileSize { get; set; } = 0;
/// <summary>
/// BOM serializzata per la produzione dell'item
/// </summary>
public string ItemBOM { get; set; } = "";
/// <summary>
/// Lista dei Job Cost Drivers calcolati dall'engine (necessari x calcolo Steps)
/// </summary>
public string ItemJCD { get; set; } = "";
/// <summary>
/// Elenco StepDTO (Fasi Costificate, sommabili) per la stima tempi / costi
/// </summary>
public string ItemSteps { get; set; } = "";
/// <summary>
/// Validazione dati BOM (Inteso come gruppi tutti trovati/esistenti)
/// </summary>
public bool BomOk { get; set; } = false;
/// <summary>
/// Validazione livello item per Costo e range dimensione
/// </summary>
public bool ItemOk { get; set; } = false;
/// <summary>
/// Note libere
/// </summary>
@@ -154,6 +205,16 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
/// </summary>
public DateTime Modified { get; set; } = DateTime.Now;
/// <summary>
/// Indica che è in attesa aggiornamento BOM
/// </summary>
public bool AwaitBom { get; set; } = false;
/// <summary>
/// Indica che è in attesa aggiornamento Price
/// </summary>
public bool AwaitPrice { get; set; } = false;
/// <summary>
/// Navigazione Order
/// </summary>