Update globale datamodels

This commit is contained in:
Samuele Locatelli
2025-09-19 18:54:17 +02:00
parent 0b4bc732de
commit ff946dc1ba
45 changed files with 6313 additions and 1349 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
using EgwCoreLib.Lux.Data.DbModel.Identity;
using EgwCoreLib.Lux.Data.Data.DbModel.Admin;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;
@@ -1,6 +1,5 @@
using EgwCoreLib.Lux.Core.RestPayload;
using EgwCoreLib.Lux.Data.DbModel;
using EgwCoreLib.Lux.Data.DbModel.General;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using EgwCoreLib.Lux.Data.DbModel.Sales;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
@@ -8,6 +7,7 @@ using Newtonsoft.Json;
using NLog;
using NLog.LayoutRenderers;
using static EgwCoreLib.Lux.Core.Enums;
using EgwCoreLib.Lux.Data.DbModel.Items;
namespace EgwCoreLib.Lux.Data.Controllers
{
@@ -952,7 +952,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
// salvo BOM...
string itemBom = JsonConvert.SerializeObject(newBomList);
currRec.ItemBOM = itemBom;
currRec.Cost = totCost;
currRec.BomCost = totCost;
currRec.BomOk = numElems == numGroupOk;
currRec.ItemOk = numElems == numItemOk;
dbCtx.Entry(currRec).State = EntityState.Modified;
@@ -1064,7 +1064,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
// salvo BOM...
string itemBom = JsonConvert.SerializeObject(bomList);
currRec.ItemBOM = itemBom;
currRec.Cost = totCost;
currRec.BomCost = totCost;
currRec.BomOk = numElems == numGroupOk;
currRec.ItemOk = numElems == numItemOk;
dbCtx.Entry(currRec).State = EntityState.Modified;
@@ -1124,7 +1124,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
// salvo BOM...
string itemBom = JsonConvert.SerializeObject(bomList);
currRec.ItemBOM = itemBom;
currRec.Cost = totCost;
currRec.BomCost = totCost;
currRec.BomOk = numElems == numGroupOk;
currRec.ItemOk = numElems == numItemOk;
dbCtx.Entry(currRec).State = EntityState.Modified;
@@ -1211,13 +1211,13 @@ namespace EgwCoreLib.Lux.Data.Controllers
{
numItemOk++;
item.ItemID = recCost.ItemID;
//item.PriceEff = recCost.Cost * (1 + recCost.Margin);
//item.PriceEff = recCost.BomCost * (1 + recCost.Margin);
item.PriceEff = recCost.Cost;
// se selezione esatta sovrascrivo altri valori
if (selExact)
{
item.ItemCode = recCost.ExtItemCode;
//item.DescriptionCode = recCost.Description;
//item.DescriptionCode = recCost.Name;
}
}
else
+19 -7
View File
@@ -1,8 +1,8 @@
using EgwCoreLib.Lux.Data.DbModel;
using EgwCoreLib.Lux.Data.DbModel.General;
using EgwCoreLib.Lux.Data.DbModel.Identity;
using EgwCoreLib.Lux.Data.DbModel.Cost;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using EgwCoreLib.Lux.Data.DbModel.Production;
using EgwCoreLib.Lux.Data.DbModel.Sales;
using EgwCoreLib.Lux.Data.DbModel.Task;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using NLog;
@@ -11,6 +11,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EgwCoreLib.Lux.Data.DbModel.Stock;
using EgwCoreLib.Lux.Data.DbModel.Items;
namespace EgwCoreLib.Lux.Data
{
@@ -48,7 +50,7 @@ namespace EgwCoreLib.Lux.Data
public virtual DbSet<ItemGroupModel> DbSetItemGroup { get; set; }
public virtual DbSet<ItemModel> DbSetItem { get; set; }
public virtual DbSet<SellingItemModel> DbSetSellItem { get; set; }
public virtual DbSet<TagsModel> DbSetRole { get; set; }
public virtual DbSet<TagsModel> DbSetTags { get; set; }
public virtual DbSet<CustomerModel> DbSetCustomer { get; set; }
public virtual DbSet<DealerModel> DbSetDealer { get; set; }
public virtual DbSet<SupplierModel> DbSetSupplier { get; set; }
@@ -59,11 +61,11 @@ namespace EgwCoreLib.Lux.Data
public virtual DbSet<ResourceModel> DbSetResource { get; set; }
public virtual DbSet<PhaseModel> DbSetPhase { get; set; }
public virtual DbSet<JobModel> DbSetJob { get; set; }
public virtual DbSet<JobRowModel> DbSetJobRow { get; set; }
public virtual DbSet<JobRowItemModel> DbSetJobRowItem { get; set; }
public virtual DbSet<JobStepModel> DbSetJobRow { get; set; }
public virtual DbSet<JobStepItemModel> DbSetJobRowItem { get; set; }
public virtual DbSet<ProductionBatchModel> DbSetProdBatch { get; set; }
public virtual DbSet<ProductionItemModel> DbSetProdItem { get; set; }
public virtual DbSet<ProductionItemRowModel> DbSetProdItemRow { get; set; }
public virtual DbSet<ProductionItemStepModel> DbSetProdItemRow { get; set; }
public virtual DbSet<StockStatusModel> DbSetStockStatus { get; set; }
public virtual DbSet<MovTypeModel> DbSetMovType { get; set; }
public virtual DbSet<StockMovModel> DbSetStockMov { get; set; }
@@ -81,12 +83,22 @@ namespace EgwCoreLib.Lux.Data
string connString = DbConfig.CONNECTION_STRING;
if (string.IsNullOrEmpty(connString))
{
#if DEBUG
connString = "Server=mdb.ufficio;port=3306;database=Lux_000_dev;uid=lux_user;pwd=Egal_pwd!;sslmode=None;";
#else
connString = "Server=mdb.ufficio;port=3306;database=Lux_000;uid=lux_user;pwd=Egal_pwd!;sslmode=None;";
#endif
}
if (!optionsBuilder.IsConfigured)
{
var serverVersion = ServerVersion.AutoDetect(connString);
optionsBuilder.UseMySql(connString, serverVersion);
// verificare setup componente
#if false
optionsBuilder
.UseMySql(connString, serverVersion)
.UseSnakeCaseNamingConvention(); // via EFCore.NamingConventions
#endif
}
}
+5 -1
View File
@@ -74,8 +74,12 @@ namespace EgwCoreLib.Lux.Data
DATABASE_NAME = $"Lux_{nKey}";
DATABASE_USER = $"user_{nKey}";
DATABASE_PWD = $"pwd_{sKey}";
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
// stringa admin con utente root egalware...
#if DEBUG
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME}_dev;uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
#else
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
#endif
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;sslmode=None";
}
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel.Identity
namespace EgwCoreLib.Lux.Data.Data.DbModel.Admin
{
/// <summary>
/// Tabella dei USER di MySql
@@ -0,0 +1,42 @@
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.Cost
{
/// <summary>
/// Rappresenta la definizione di un Driver Risorsa da convertire in WorkOur (driver di ResourceModel)
/// </summary>
[Table("cost_driver")]
public class CostDriverModel
{
[Key]
public int CostDriverID { get; set; }
/// <summary>
/// Nome driver
/// e.g. "WorkHour"
/// </summary>
public string Name { get; set; } = "";
/// <summary>
/// Nome dell'UM
/// e.g. "hour", "meter"
/// </summary>
public string Unit { get; set; } = "";
/// <summary>
/// Descrizione driver
/// e.g. "WorkHour"
/// </summary>
public string Descript { get; set; } = "";
}
}
@@ -0,0 +1,149 @@
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.Cost
{
/// <summary>
/// Risorsa / Centro di Costo, con costi / Hourly
/// </summary>
[Table("cost_resource")]
public class ResourceModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int ResourceID { get; set; }
/// <summary>
/// Nome/Descrizione
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// ID del driver di costo impiegato, tipicamente 1 = WorkHour
/// </summary>
public int CostDriverID { get; set; }
/// <summary>
/// Valore di riferimento del CostDriver per il calcolo dell'importo unitario della risorsa
/// Se è basato su WorkHour diventa il budget annuale della risorsa disponibile
/// Tipicamente le Ore di impiego a buget risorsa, es 220gg x 8h
/// </summary>
public decimal CostDriverBudget { get; set; } = 1;
/// <summary>
/// Costo totale (rif al CostDriverBudget) componente FIXED (macchinari) della risorsa (ove applicabile), comprendendo
/// - ammortamenti
/// - costi di manutenzione ordinaria
/// - costi di manutenzione straordinaria (se stimabili, in periodo post ammortamento)
/// </summary>
public decimal FixedCost { get; set; } = 0;
/// <summary>
/// Costo totale (rif al CostDriverBudget) componente variabile (tipicamente Energia)
/// nb: stima basata sul (costo medio energia aziendale) * consumo effettivo (se disponibile), altrimenti (stima potenza media impiegata) * (ore di impiego stimate)
/// </summary>
public decimal VariableCost { get; set; } = 0;
/// <summary>
/// Costo della componente HR sulla gestione impianto (rif al CostDriverBudget)
/// </summary>
public decimal LaborCost { get; set; } = 0;
/// <summary>
/// Costi di OverHead (rif al CostDriverBudget) da ribaltare su risorsa (tipicamente struttura)
/// </summary>
public decimal OverHeadCost { get; set; } = 0;
/// <summary>
/// Costo di overhead (come % on top del resto)
/// </summary>
public decimal OverHeadPerc { get; set; } = 0.15M;
/// <summary>
/// EBT ovvero marginalità minima garantita on top del resto dei costi e OH
/// </summary>
public decimal EBTPerc { get; set; } = 0.1M;
/// <summary>
/// Margine sul prezzo ovvero valore da potersi eventualmente scontare
/// </summary>
public decimal PriceMargin { get; set; } = 0.2M;
/// <summary>
/// Costo Netto la risorsa su base CostDriver
/// </summary>
[NotMapped]
private decimal BaseNetCost
{
get => CostDriverBudget == 0 ? 0 : (FixedCost + VariableCost + OverHeadCost) / CostDriverBudget;
}
/// <summary>
/// Costo RockBottom Risorsa su base CostDriver
/// </summary>
[NotMapped]
public decimal BaseRockBottomCost
{
get => BaseNetCost * (1 + OverHeadPerc) * (1 + EBTPerc);
}
/// <summary>
/// Prezzo comprensivo di margine di ricarico massimo scontabile (sul RockBottom)
/// </summary>
[NotMapped]
public decimal BasePrice
{
get => BaseRockBottomCost * (1 + PriceMargin);
}
/// <summary>
/// Navigazione Driver costo
/// </summary>
[ForeignKey("CostDriverID")]
public virtual CostDriverModel DriverNav { get; set; } = null!;
#if false
/// <summary>
/// Indica gli asset/cespiti
/// </summary>
public bool IsAsset { get; set; } = false;
/// <summary>
/// Indica che è un operatore umano
/// </summary>
public bool IsHuman { get; set; } = false;
/// <summary>
/// Costo fisso risorsa per UM tipo ammortamento
/// </summary>
public double UnitCostFix { get; set; } = 0;
/// <summary>
/// Unità di misura della risorsa tipo fisso/ammortamento
/// </summary>
public string UmFix { get; set; } = "";
/// <summary>
/// Costo unitario risorsa per UM tipo consumabili
/// </summary>
public double UnitCostProp { get; set; } = 0;
/// <summary>
/// Unità di misura della risorsa
/// </summary>
public string UmProp { get; set; } = string.Empty;
#endif
}
}
@@ -6,12 +6,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Items
{ // <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("RegItemGroup")]
[Table("item_group")]
public class ItemGroupModel
{
@@ -2,13 +2,13 @@
using System.ComponentModel.DataAnnotations.Schema;
using static EgwCoreLib.Lux.Core.Enums;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Items
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("RegItem")]
[Table("item_item")]
public class ItemModel
{
/// <summary>
@@ -85,7 +85,7 @@ namespace EgwCoreLib.Lux.Data.DbModel
[NotMapped]
public bool IsOkQty
{
get => QtyMax > 0 && (QtyMax - QtyMin) > 0;
get => QtyMax > 0 && QtyMax - QtyMin > 0;
}
/// <summary>
@@ -117,7 +117,7 @@ namespace EgwCoreLib.Lux.Data.DbModel
[NotMapped]
public bool IsProtected
{
get => this.ItemType == EgwCoreLib.Lux.Core.Enums.ItemClassType.Bom;
get => ItemType == ItemClassType.Bom;
}
/// <summary>
@@ -1,14 +1,14 @@
using EgwCoreLib.Lux.Data.DbModel.Production;
using EgwCoreLib.Lux.Data.DbModel.Task;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Items
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("SellingItem")]
[Table("item_selling_item")]
public class SellingItemModel
{
/// <summary>
@@ -68,9 +68,10 @@ namespace EgwCoreLib.Lux.Data.DbModel
public string SerStruct { get; set; } = "";
/// <summary>
/// Json contenente la serializzazione delle fasi previste per la stima dei tempi e costi in formato SerializedPhasePreview; potrebbe contenere anche altre info accessorie x definire dati logistico/gestionali
/// Elenco StepDTO (Fasi) per la stima tempi / costi
/// potrebbe contenere anche altre info accessorie x definire dati logistico/gestionali
/// </summary>
public string ItemSPP { get; set; } = "";
public string ItemSteps { get; set; } = "";
/// <summary>
/// Navigazione Job/Cicli
@@ -6,13 +6,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Items
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("RegSupplier")]
[Table("item_supplier")]
public class SupplierModel
{
/// <summary>
@@ -1,26 +0,0 @@
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;
namespace EgwCoreLib.Lux.Data.DbModel.Production
{
[Table("JobList")]
public class JobModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int JobID { get; set; }
/// <summary>
/// Descrizione del ciclo
/// </summary>
public string Description { get; set; } = "";
}
}
@@ -1,71 +0,0 @@
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.Production
{
[Table("JobRowList")]
public class JobRowModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int JobRowID { get; set; }
/// <summary>
/// Ciclo di appartenenza
/// </summary>
public int JobID { get; set; }
/// <summary>
/// Indice della fase all'interno del Job
/// </summary>
public int Index { get; set; } = 0;
/// <summary>
/// ID della fase realizzata
/// </summary>
public int PhaseID { get; set; }
/// <summary>
/// ID dellaa risorsa impiegata
/// </summary>
public int ResourceID { get; set; }
/// <summary>
/// Descrizione della fase del Job
/// </summary>
public string Description { get; set; } = "";
/// <summary>
/// Margine percentuale standard
/// </summary>
public double Qty { get; set; } = 1;
/// <summary>
/// Navigazione Job/Cicli
/// </summary>
[ForeignKey("JobID")]
public virtual JobModel JobNav { get; set; } = null!;
/// <summary>
/// Navigazione Job/Cicli
/// </summary>
[ForeignKey("PhaseID")]
public virtual PhaseModel PhaseNav { get; set; } = null!;
/// <summary>
/// Navigazione Job/Cicli
/// </summary>
[ForeignKey("ResourceID")]
public virtual ResourceModel ResourceNav { get; set; } = null!;
}
}
@@ -7,7 +7,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("ProductionBatch")]
[Table("production_batch")]
public class ProductionBatchModel
{
/// <summary>
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using EgwCoreLib.Lux.Data.DbModel.Sales;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace EgwCoreLib.Lux.Data.DbModel.Production
@@ -7,7 +8,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("ProductionItem")]
[Table("production_item")]
public class ProductionItemModel
{
/// <summary>
@@ -1,4 +1,6 @@
using System;
using EgwCoreLib.Lux.Data.DbModel.Cost;
using EgwCoreLib.Lux.Data.DbModel.Task;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -12,16 +14,16 @@ using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel.Production
{
/// <summary>
/// Tabella delel effettiva righe della fgasi di lavorazione x ogni item da produrre
/// Tabella delle fasi di lavorazione x ogni item da produrre
/// </summary>
[Table("ProductionItemRowList")]
public class ProductionItemRowModel
[Table("production_item_step")]
public class ProductionItemStepModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int ProdItemRowID { get; set; }
public int ProdItemStepID { get; set; }
/// <summary>
/// Item di appartenenza
@@ -1,59 +0,0 @@
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
{
[Table("RegResource")]
public class ResourceModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int ResourceID { get; set; }
/// <summary>
/// Descrizione
/// </summary>
public string Description { get; set; } = "";
/// <summary>
/// Indica gli assec/cespiti
/// </summary>
public bool IsAsset { get; set; } = false;
/// <summary>
/// Indica che è un operatore umano
/// </summary>
public bool IsHuman { get; set; } = false;
/// <summary>
/// Costo fisso risorsa per UM tipo ammortamento
/// </summary>
public double UnitCostFix { get; set; } = 0;
/// <summary>
/// Unità di misura della risorsa tipo fisso/ammortamento
/// </summary>
public string UmFix { get; set; } = "";
/// <summary>
/// Costo unitario risorsa per UM tipo consumabili
/// </summary>
public double UnitCostProp { get; set; } = 0;
/// <summary>
/// Unità di misura della risorsa
/// </summary>
public string UmProp { get; set; } = "";
}
}
@@ -6,13 +6,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Sales
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("RegCustomer")]
[Table("sales_customer")]
public class CustomerModel
{
/// <summary>
@@ -6,13 +6,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Sales
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("RegDealer")]
[Table("sales_dealer")]
public class DealerModel
{
/// <summary>
@@ -14,7 +14,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("Offer")]
[Table("sales_offer")]
public class OfferModel
{
/// <summary>
@@ -98,7 +98,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
[NotMapped]
public double TotalCost
{
get => OfferRowNav?.Sum(x => x.Cost) ?? 0;
get => OfferRowNav?.Sum(x => x.BomCost) ?? 0;
}
#if false
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using EgwCoreLib.Lux.Data.DbModel.Items;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -13,7 +14,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("OfferRowList")]
[Table("sales_offer_row")]
public class OfferRowModel
{
/// <summary>
@@ -57,19 +58,74 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
public int SellingItemID { get; set; }
/// <summary>
/// Costo (standard / senza listini)
/// </summary>
public double Cost { get; set; } = 0;
/// <summary>
/// Margine percentuale standard
/// Quantità della risorsa
/// </summary>
public double Qty { get; set; } = 1;
/// <summary>
/// Costo dei componeti BOM (RockBottom)
/// </summary>
public double BomCost { get; set; } = 0;
/// <summary>
/// Prezzo dei componeti BOM (scontabile)
/// </summary>
public double BomPrice { get; set; } = 0;
/// <summary>
/// Costo produzione Fase/Step (RockBottom)
/// </summary>
public double StepCost { get; set; } = 0;
/// <summary>
/// Prezzo produzione Fase/Step (scontabile)
/// </summary>
public double StepPrice { get; set; } = 0;
/// <summary>
/// Costo Totale Risorsa (BOM + Fase)
/// </summary>
[NotMapped]
public double UnitCost
{
get => BomCost + StepCost;
}
/// <summary>
/// Costo Totale Risorsa (BOM + Fase)
/// </summary>
[NotMapped]
public double UnitPrice
{
get => BomPrice + StepPrice;
}
/// <summary>
/// Sconto massimo applicabile
/// </summary>
[NotMapped]
public double MaxDiscount
{
get => (UnitCost > 0 && UnitPrice > UnitCost) ? (UnitPrice - UnitCost) / UnitPrice : 0;
}
/// <summary>
/// Costo Totale risorsa
/// </summary>
[NotMapped]
public double TotalCost
{
get => Qty * Cost;
get => UnitCost * Qty;
}
/// <summary>
/// Costo Totale risorsa
/// </summary>
[NotMapped]
public double TotalPrice
{
get => UnitPrice * Qty;
}
/// <summary>
@@ -78,9 +134,10 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
public string SerStruct { get; set; } = "";
/// <summary>
/// Json contenente la serializzazione delle fasi previste per la stima dei tempi e costi in formato SerializedPhasePreview; potrebbe contenere anche altre info accessorie x definire dati logistico/gestionali
/// Elenco StepDTO (Fasi) per la stima tempi / costi
/// potrebbe contenere anche altre info accessorie x definire dati logistico/gestionali
/// </summary>
public string ItemSPP { get; set; } = "";
public string ItemSteps { get; set; } = "";
/// <summary>
/// BOM serializzata per la produzione dell'item
@@ -1,5 +1,4 @@
using EgwCoreLib.Lux.Data.DbModel.Sales;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -9,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using static EgwCoreLib.Lux.Core.Enums;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Sales
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
@@ -18,7 +17,7 @@ namespace EgwCoreLib.Lux.Data.DbModel
/// <summary>
/// Classe degli ordini commerciali
/// </summary>
[Table("Order")]
[Table("sales_order")]
public class OrderModel
{
/// <summary>
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using EgwCoreLib.Lux.Data.DbModel.Items;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -7,13 +8,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Sales
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("OrderRowList")]
[Table("sales_order_row")]
public class OrderRowModel
{
/// <summary>
@@ -47,19 +48,74 @@ namespace EgwCoreLib.Lux.Data.DbModel
public int SellingItemID { get; set; }
/// <summary>
/// Costo (standard / senza listini)
/// Costo dei componeti BOM (RockBottom)
/// </summary>
public double Cost { get; set; } = 0;
public double BomCost { get; set; } = 0;
/// <summary>
/// Margine percentuale standard
/// </summary>
public double Qty { get; set; } = 1;
/// <summary>
/// Prezzo dei componeti BOM (scontabile)
/// </summary>
public double BomPrice { get; set; } = 0;
/// <summary>
/// Costo produzione Fase/Step (RockBottom)
/// </summary>
public double StepCost { get; set; } = 0;
/// <summary>
/// Prezzo produzione Fase/Step (scontabile)
/// </summary>
public double StepPrice { get; set; } = 0;
/// <summary>
/// Costo Totale Risorsa (BOM + Fase)
/// </summary>
[NotMapped]
public double UnitCost
{
get => BomCost + StepCost;
}
/// <summary>
/// Costo Totale Risorsa (BOM + Fase)
/// </summary>
[NotMapped]
public double UnitPrice
{
get => BomPrice + StepPrice;
}
/// <summary>
/// Sconto massimo applicabile
/// </summary>
[NotMapped]
public double MaxDiscount
{
get => (UnitCost > 0 && UnitPrice > UnitCost) ? (UnitPrice - UnitCost) / UnitPrice : 0;
}
/// <summary>
/// Costo Totale risorsa
/// </summary>
[NotMapped]
public double TotalCost
{
get => Qty * Cost;
get => UnitCost * Qty;
}
/// <summary>
/// Costo Totale risorsa
/// </summary>
[NotMapped]
public double TotalPrice
{
get => UnitPrice * Qty;
}
/// <summary>
@@ -68,9 +124,10 @@ namespace EgwCoreLib.Lux.Data.DbModel
public string SerStruct { get; set; } = "";
/// <summary>
/// Json contenente la serializzazione delle fasi previste per la stima dei tempi e costi in formato SerializedPhasePreview; potrebbe contenere anche altre info accessorie x definire dati logistico/gestionali
/// Elenco StepDTO (Fasi) per la stima tempi / costi
/// potrebbe contenere anche altre info accessorie x definire dati logistico/gestionali
/// </summary>
public string ItemSPP { get; set; } = "";
public string ItemSteps { get; set; } = "";
/// <summary>
/// Note libere
@@ -1,4 +1,5 @@
using System;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -6,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Stock
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
@@ -14,7 +15,7 @@ namespace EgwCoreLib.Lux.Data.DbModel
/// <summary>
/// Tabella dei movimenti degli item in giacenza
/// </summary>
[Table("StockMov")]
[Table("stock_mov")]
public class StockMovModel
{
/// <summary>
@@ -39,7 +40,7 @@ namespace EgwCoreLib.Lux.Data.DbModel
public DateTime DtMod { get; set; } = DateTime.Now;
/// <summary>
/// Qty movimento registrato (delta +/-)
/// ProductivityRate movimento registrato (delta +/-)
/// </summary>
public double QtyRec { get; set; } = 0;
@@ -1,4 +1,5 @@
using System;
using EgwCoreLib.Lux.Data.DbModel.Items;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -6,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Stock
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
@@ -15,7 +16,7 @@ namespace EgwCoreLib.Lux.Data.DbModel
/// Tabelal delle giacenze di magazzino
/// </summary>
[Table("StockStatus")]
[Table("stock_status")]
public class StockStatusModel
{
/// <summary>
@@ -30,7 +31,7 @@ namespace EgwCoreLib.Lux.Data.DbModel
public int ItemID { get; set; } = 0;
/// <summary>
/// Qty in giacenza
/// ProductivityRate in giacenza
/// </summary>
public double QtyAvail { get; set; } = 0;
@@ -0,0 +1,35 @@
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.Task
{
/// <summary>
/// Definizione macro dei Cicli di Lavoro / Job
/// </summary>
[Table("task_job")]
public class JobModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int JobID { get; set; }
/// <summary>
/// Descrizione del ciclo di lavoro
/// </summary>
public string Description { get; set; } = "";
/// <summary>
/// Navigation verso JobStep
/// </summary>
public virtual ICollection<JobStepModel> JobStepNav { get; set; } = new List<JobStepModel>();
}
}
@@ -1,29 +1,25 @@
using System;
using System.Collections.Generic;
using EgwCoreLib.Lux.Data.DbModel.Items;
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.Production
namespace EgwCoreLib.Lux.Data.DbModel.Task
{
[Table("JobRowItemList")]
public class JobRowItemModel
[Table("task_job_step_item")]
public class JobStepItemModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int JobRowItemID { get; set; }
public int JobStepItemID { get; set; }
/// <summary>
/// Fase del Ciclo di appartenenza
/// </summary>
public int JobRowID { get; set; }
public int JobStepID { get; set; }
/// <summary>
/// Indice della fase all'interno del Job
@@ -48,8 +44,8 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// <summary>
/// Navigazione su fasi ciclo
/// </summary>
[ForeignKey("JobRowID")]
public virtual JobRowModel JobRowNav { get; set; } = null!;
[ForeignKey("JobStepID")]
public virtual JobStepModel JobStepNav { get; set; } = null!;
/// <summary>
/// Navigazione su Items
@@ -0,0 +1,116 @@
using EgwCoreLib.Lux.Data.DbModel.Cost;
using EgwCoreLib.Lux.Data.DbModel.Task;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace EgwCoreLib.Lux.Data.DbModel.Task
{
/// <summary>
/// Routing dei cicli di lavoro, con riferimento a risorse e fasi
/// </summary>
[Table("task_job_step")]
public class JobStepModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int JobStepID { get; set; }
/// <summary>
/// Ciclo di appartenenza
/// </summary>
public int JobID { get; set; }
/// <summary>
/// Indice della fase all'interno del Job
/// </summary>
public int Index { get; set; } = 0;
/// <summary>
/// ID del driver di costo impiegato
/// </summary>
public int CostDriverID { get; set; }
/// <summary>
/// ID della fase realizzata
/// </summary>
public int PhaseID { get; set; }
/// <summary>
/// ID della risorsa impiegata
/// </summary>
public int ResourceID { get; set; }
/// <summary>
/// Descrizione della fase del Job
/// </summary>
public string Description { get; set; } = "";
/// <summary>
/// Rapporto produttività tra CostDriver Step e CostDriver Risorsa (es: m/h)
/// </summary>
public decimal ProductivityRate { get; set; } = 1;
/// <summary>
/// Costo RockBottom Fase (step) di produzione
/// sulla base del costo della risorsa, della produttività e della quantità impiegata
/// </summary>
/// <param name="quantity">Quantità risorsa impiegata</param>
/// <returns></returns>
public decimal RockBottomCost(decimal quantity)
{
decimal stepCost = 0;
var unitRequired = quantity / ProductivityRate;
if (ResourceNav != null)
{
stepCost = ResourceNav.BaseRockBottomCost * quantity;
}
return stepCost;
}
/// <summary>
/// Prezzo calcolato per Fase (step) di produzione
/// sulla base del costo RockBottom + marginalità standard
/// </summary>
/// <param name="quantity">Quantità risorsa impiegata</param>
/// <returns></returns>
public decimal RockBottomPrice(decimal quantity)
{
decimal stepCost = 0;
var unitRequired = quantity / ProductivityRate;
if (ResourceNav != null)
{
stepCost = ResourceNav.BasePrice * quantity;
}
return stepCost;
}
/// <summary>
/// Navigazione Job/Cicli
/// </summary>
[ForeignKey("JobID")]
public virtual JobModel JobNav { get; set; } = null!;
/// <summary>
/// Navigazione Driver costo
/// </summary>
[ForeignKey("CostDriverID")]
public virtual CostDriverModel DriverNav { get; set; } = null!;
/// <summary>
/// Navigazione Fasi
/// </summary>
[ForeignKey("PhaseID")]
public virtual PhaseModel PhaseNav { get; set; } = null!;
/// <summary>
/// Navigazione Risorse
/// </summary>
[ForeignKey("ResourceID")]
public virtual ResourceModel ResourceNav { get; set; } = null!;
}
}
@@ -9,10 +9,12 @@ using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace EgwCoreLib.Lux.Data.DbModel.Production
namespace EgwCoreLib.Lux.Data.DbModel.Task
{
[Table("RegPhase")]
/// <summary>
/// Fase di lavorazione / ProductionStage
/// </summary>
[Table("task_phase")]
public class PhaseModel
{
/// <summary>
@@ -25,7 +27,5 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// Descrizione
/// </summary>
public string Description { get; set; } = "";
}
}
@@ -6,13 +6,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel.General
namespace EgwCoreLib.Lux.Data.DbModel.Utils
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("Counter")]
[Table("utils_counter")]
public class CounterModel
{
/// <summary>
@@ -4,10 +4,10 @@ using System.ComponentModel.DataAnnotations.Schema;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace EgwCoreLib.Lux.Data.DbModel.General
namespace EgwCoreLib.Lux.Data.DbModel.Utils
{
[Table("GenClass")]
[Table("utils_gen_class")]
public class GenClassModel
{
/// <summary>
@@ -4,10 +4,10 @@ using System.ComponentModel.DataAnnotations.Schema;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace EgwCoreLib.Lux.Data.DbModel.General
namespace EgwCoreLib.Lux.Data.DbModel.Utils
{
[Table("GenValue")]
[Table("utils_gen_value")]
public class GenValueModel
{
/// <summary>
@@ -6,12 +6,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel
namespace EgwCoreLib.Lux.Data.DbModel.Utils
{ // <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("RegMovType")]
[Table("utils_mov_type")]
public class MovTypeModel
{
@@ -6,13 +6,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.DbModel.Identity
namespace EgwCoreLib.Lux.Data.DbModel.Utils
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("RegTags")]
[Table("utils_tags")]
public class TagsModel
{
/// <summary>
@@ -17,6 +17,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="DbModel\Cost\Enums.cs" />
<Compile Remove="Services\ExternalMessageProcessor.cs" />
<Compile Remove="Services\RedisSubscriberServiceOld.cs" />
</ItemGroup>
@@ -48,8 +49,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="DbModel\Items\" />
<Folder Include="DbModel\Costing\" />
<Folder Include="Migrations\" />
</ItemGroup>
@@ -156,7 +156,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<string>("CodGroup")
.HasColumnType("varchar(255)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -199,10 +199,10 @@ namespace EgwCoreLib.Lux.Data.Migrations
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -445,7 +445,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -468,13 +468,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowItemModel", b =>
{
b.Property<int>("JobRowItemID")
b.Property<int>("JobStepItemID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobRowItemID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobStepItemID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -484,17 +484,17 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ItemID")
.HasColumnType("int");
b.Property<int>("JobRowID")
b.Property<int>("JobStepID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.HasKey("JobRowItemID");
b.HasKey("JobStepItemID");
b.HasIndex("ItemID");
b.HasIndex("JobRowID");
b.HasIndex("JobStepID");
b.ToTable("JobRowItemList");
@@ -530,13 +530,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowModel", b =>
{
b.Property<int>("JobRowID")
b.Property<int>("JobStepID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobRowID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobStepID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -549,13 +549,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("PhaseID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("ResourceID")
.HasColumnType("int");
b.HasKey("JobRowID");
b.HasKey("JobStepID");
b.HasIndex("JobID");
@@ -623,7 +623,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<string>("MovCod")
.HasColumnType("varchar(255)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -678,7 +678,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("DealerID")
.HasColumnType("int");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -739,7 +739,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<bool>("BomOk")
.HasColumnType("tinyint(1)");
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Environment")
@@ -756,7 +756,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<bool>("ItemOk")
.HasColumnType("tinyint(1)");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -774,7 +774,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
.IsRequired()
.HasColumnType("longtext");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("RowNum")
@@ -869,7 +869,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("DealerID")
.HasColumnType("int");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -916,13 +916,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("OrderRowID"));
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<DateTime>("Inserted")
.HasColumnType("datetime(6)");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -936,7 +936,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("OrderID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("RowNum")
@@ -966,7 +966,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("PhaseID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1021,7 +1021,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1065,11 +1065,11 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.ProductionItemRowModel", b =>
{
b.Property<int>("ProdItemRowID")
b.Property<int>("ProdItemStepID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProdItemRowID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProdItemStepID"));
b.Property<DateTime?>("DateEnd")
.HasColumnType("datetime(6)");
@@ -1077,7 +1077,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1090,7 +1090,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ProdItemID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("ResourceID")
@@ -1099,7 +1099,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<double>("WorkTime")
.HasColumnType("double");
b.HasKey("ProdItemRowID");
b.HasKey("ProdItemStepID");
b.HasIndex("PhaseID");
@@ -1118,7 +1118,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ResourceID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1234,10 +1234,10 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SellingItemID"));
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1251,7 +1251,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ItemCode")
.HasColumnType("int");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -1699,7 +1699,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("TagID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1754,15 +1754,15 @@ namespace EgwCoreLib.Lux.Data.Migrations
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("EgwCoreLib.Lux.Data.DbModel.JobRowModel", "JobRowNav")
b.HasOne("EgwCoreLib.Lux.Data.DbModel.JobRowModel", "JobStepNav")
.WithMany()
.HasForeignKey("JobRowID")
.HasForeignKey("JobStepID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("ItemNav");
b.Navigation("JobRowNav");
b.Navigation("JobStepNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowModel", b =>
@@ -491,7 +491,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
name: "FK_JobRowItemList_JobRowList_JobRowID",
column: x => x.JobRowID,
principalTable: "JobRowList",
principalColumn: "JobRowID",
principalColumn: "JobStepID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_JobRowItemList_RegItem_ItemID",
@@ -652,7 +652,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "JobList",
columns: new[] { "JobID", "Description" },
columns: new[] { "JobID", "Name" },
values: new object[,]
{
{ 1, "Rivendita / servizi" },
@@ -681,7 +681,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "RegItemGroup",
columns: new[] { "CodGroup", "Description" },
columns: new[] { "CodGroup", "Name" },
values: new object[,]
{
{ "WindowGlass", "Vetri serramento" },
@@ -692,7 +692,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "RegMovType",
columns: new[] { "MovCod", "Description" },
columns: new[] { "MovCod", "Name" },
values: new object[,]
{
{ "CAR", "Carico a magazzino" },
@@ -705,7 +705,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "RegPhase",
columns: new[] { "PhaseID", "Description" },
columns: new[] { "PhaseID", "Name" },
values: new object[,]
{
{ 1, "Taglio tronchetti" },
@@ -718,7 +718,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "RegResource",
columns: new[] { "ResourceID", "Description", "IsAsset", "IsHuman", "UmFix", "UmProp", "UnitCostFix", "UnitCostProp" },
columns: new[] { "ResourceID", "Name", "IsAsset", "IsHuman", "UmFix", "UmProp", "UnitCostFix", "UnitCostProp" },
values: new object[,]
{
{ 1, "Sezionatrice", true, false, "€/h", "", 15.0, 0.0 },
@@ -742,7 +742,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "RegTags",
columns: new[] { "TagID", "Description" },
columns: new[] { "TagID", "Name" },
values: new object[,]
{
{ 1, "Tag 01" },
@@ -754,7 +754,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "JobRowList",
columns: new[] { "JobRowID", "Description", "Index", "JobID", "PhaseID", "Qty", "ResourceID" },
columns: new[] { "JobStepID", "Name", "Index", "JobID", "PhaseID", "ProductivityRate", "ResourceID" },
values: new object[,]
{
{ 1, "", 1, 2, 1, 1.0, 1 },
@@ -766,12 +766,12 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "Offer",
columns: new[] { "OfferID", "CustomerID", "DealerID", "Description", "Inserted", "Modified", "OffertState", "RefNum", "RefRev", "RefYear", "ValidUntil" },
columns: new[] { "OfferID", "CustomerID", "DealerID", "Name", "Inserted", "Modified", "OffertState", "RefNum", "RefRev", "RefYear", "ValidUntil" },
values: new object[] { 1, 2, 2, "Offerta per tre serramenti", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4215), new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4216), 0, 1, 1, 2024, new DateTime(2025, 9, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4212) });
migrationBuilder.InsertData(
table: "RegItem",
columns: new[] { "ItemID", "CodGroup", "Cost", "Description", "ExtItemCode", "IsService", "ItemCode", "ItemType", "Margin", "QtyMax", "QtyMin", "SupplCode", "UM" },
columns: new[] { "ItemID", "CodGroup", "BomCost", "Name", "ExtItemCode", "IsService", "ItemCode", "ItemType", "Margin", "QtyMax", "QtyMin", "SupplCode", "UM" },
values: new object[,]
{
{ 1, "WindowTrunk", 20.0, "BARRA-60x80 generica", "", false, 1001, 1, 0.29999999999999999, 0.0, 0.0, "BARR.001", "#" },
@@ -790,7 +790,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "SellingItem",
columns: new[] { "SellingItemID", "Cost", "Description", "ExtItemCode", "IsService", "ItemCode", "ItemSPP", "JobID", "Margin", "SerStruct", "SupplCode", "UM" },
columns: new[] { "SellingItemID", "BomCost", "Name", "ExtItemCode", "IsService", "ItemCode", "ItemSteps", "JobID", "Margin", "SerStruct", "SupplCode", "UM" },
values: new object[,]
{
{ 1, 820.0, "Finestra anta Singola", "", false, 0, "", 2, 0.20000000000000001, "", "", "#" },
@@ -800,7 +800,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "JobRowItemList",
columns: new[] { "JobRowItemID", "Description", "Index", "ItemID", "JobRowID", "Qty" },
columns: new[] { "JobStepItemID", "Name", "Index", "ItemID", "JobStepID", "ProductivityRate" },
values: new object[,]
{
{ 1, "Grezzo legno abete", 1, 1, 1, 1.0 },
@@ -810,7 +810,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "OfferRowList",
columns: new[] { "OfferRowID", "BomOk", "Cost", "Environment", "Inserted", "ItemBOM", "ItemOk", "ItemSPP", "Modified", "Note", "OfferID", "OfferRowUID", "Qty", "RowNum", "SellingItemID", "SerStruct" },
columns: new[] { "OfferRowID", "BomOk", "BomCost", "Environment", "Inserted", "ItemBOM", "ItemOk", "ItemSteps", "Modified", "Note", "OfferID", "OfferRowUID", "ProductivityRate", "RowNum", "SellingItemID", "SerStruct" },
values: new object[,]
{
{ 1, true, 950.0, "WINDOW", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4243), "", true, "{}", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4245), "Finestra anta singola 2025", 1, "OFF0000000001", 3.0, 1, 1, "{}" },
@@ -860,7 +860,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.CreateIndex(
name: "IX_JobRowItemList_JobRowID",
table: "JobRowItemList",
column: "JobRowID");
column: "JobStepID");
migrationBuilder.CreateIndex(
name: "IX_JobRowList_JobID",
@@ -156,7 +156,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<string>("CodGroup")
.HasColumnType("varchar(255)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -199,10 +199,10 @@ namespace EgwCoreLib.Lux.Data.Migrations
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -460,7 +460,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -483,13 +483,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowItemModel", b =>
{
b.Property<int>("JobRowItemID")
b.Property<int>("JobStepItemID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobRowItemID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobStepItemID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -499,17 +499,17 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ItemID")
.HasColumnType("int");
b.Property<int>("JobRowID")
b.Property<int>("JobStepID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.HasKey("JobRowItemID");
b.HasKey("JobStepItemID");
b.HasIndex("ItemID");
b.HasIndex("JobRowID");
b.HasIndex("JobStepID");
b.ToTable("JobRowItemList");
@@ -545,13 +545,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowModel", b =>
{
b.Property<int>("JobRowID")
b.Property<int>("JobStepID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobRowID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobStepID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -564,13 +564,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("PhaseID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("ResourceID")
.HasColumnType("int");
b.HasKey("JobRowID");
b.HasKey("JobStepID");
b.HasIndex("JobID");
@@ -638,7 +638,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<string>("MovCod")
.HasColumnType("varchar(255)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -693,7 +693,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("DealerID")
.HasColumnType("int");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -754,7 +754,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<bool>("BomOk")
.HasColumnType("tinyint(1)");
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Environment")
@@ -771,7 +771,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<bool>("ItemOk")
.HasColumnType("tinyint(1)");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -789,7 +789,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
.IsRequired()
.HasColumnType("longtext");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("RowNum")
@@ -884,7 +884,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("DealerID")
.HasColumnType("int");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -931,13 +931,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("OrderRowID"));
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<DateTime>("Inserted")
.HasColumnType("datetime(6)");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -951,7 +951,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("OrderID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("RowNum")
@@ -981,7 +981,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("PhaseID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1036,7 +1036,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1080,11 +1080,11 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.ProductionItemRowModel", b =>
{
b.Property<int>("ProdItemRowID")
b.Property<int>("ProdItemStepID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProdItemRowID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProdItemStepID"));
b.Property<DateTime?>("DateEnd")
.HasColumnType("datetime(6)");
@@ -1092,7 +1092,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1105,7 +1105,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ProdItemID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("ResourceID")
@@ -1114,7 +1114,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<double>("WorkTime")
.HasColumnType("double");
b.HasKey("ProdItemRowID");
b.HasKey("ProdItemStepID");
b.HasIndex("PhaseID");
@@ -1133,7 +1133,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ResourceID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1249,10 +1249,10 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SellingItemID"));
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1266,7 +1266,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ItemCode")
.HasColumnType("int");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -1714,7 +1714,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("TagID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1769,15 +1769,15 @@ namespace EgwCoreLib.Lux.Data.Migrations
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("EgwCoreLib.Lux.Data.DbModel.JobRowModel", "JobRowNav")
b.HasOne("EgwCoreLib.Lux.Data.DbModel.JobRowModel", "JobStepNav")
.WithMany()
.HasForeignKey("JobRowID")
.HasForeignKey("JobStepID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("ItemNav");
b.Navigation("JobRowNav");
b.Navigation("JobStepNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowModel", b =>
@@ -156,7 +156,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<string>("ClassCod")
.HasColumnType("varchar(255)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -252,7 +252,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<string>("CodGroup")
.HasColumnType("varchar(255)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -295,10 +295,10 @@ namespace EgwCoreLib.Lux.Data.Migrations
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -556,7 +556,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -579,13 +579,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowItemModel", b =>
{
b.Property<int>("JobRowItemID")
b.Property<int>("JobStepItemID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobRowItemID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobStepItemID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -595,17 +595,17 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ItemID")
.HasColumnType("int");
b.Property<int>("JobRowID")
b.Property<int>("JobStepID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.HasKey("JobRowItemID");
b.HasKey("JobStepItemID");
b.HasIndex("ItemID");
b.HasIndex("JobRowID");
b.HasIndex("JobStepID");
b.ToTable("JobRowItemList");
@@ -641,13 +641,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowModel", b =>
{
b.Property<int>("JobRowID")
b.Property<int>("JobStepID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobRowID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("JobStepID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -660,13 +660,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("PhaseID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("ResourceID")
.HasColumnType("int");
b.HasKey("JobRowID");
b.HasKey("JobStepID");
b.HasIndex("JobID");
@@ -734,7 +734,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<string>("MovCod")
.HasColumnType("varchar(255)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -789,7 +789,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("DealerID")
.HasColumnType("int");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -850,7 +850,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<bool>("BomOk")
.HasColumnType("tinyint(1)");
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Environment")
@@ -867,7 +867,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<bool>("ItemOk")
.HasColumnType("tinyint(1)");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -885,7 +885,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
.IsRequired()
.HasColumnType("longtext");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("RowNum")
@@ -980,7 +980,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("DealerID")
.HasColumnType("int");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1027,13 +1027,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("OrderRowID"));
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<DateTime>("Inserted")
.HasColumnType("datetime(6)");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -1047,7 +1047,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("OrderID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("RowNum")
@@ -1077,7 +1077,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("PhaseID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1132,7 +1132,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1176,11 +1176,11 @@ namespace EgwCoreLib.Lux.Data.Migrations
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.ProductionItemRowModel", b =>
{
b.Property<int>("ProdItemRowID")
b.Property<int>("ProdItemStepID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProdItemRowID"));
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProdItemStepID"));
b.Property<DateTime?>("DateEnd")
.HasColumnType("datetime(6)");
@@ -1188,7 +1188,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1201,7 +1201,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ProdItemID")
.HasColumnType("int");
b.Property<double>("Qty")
b.Property<double>("ProductivityRate")
.HasColumnType("double");
b.Property<int>("ResourceID")
@@ -1210,7 +1210,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<double>("WorkTime")
.HasColumnType("double");
b.HasKey("ProdItemRowID");
b.HasKey("ProdItemStepID");
b.HasIndex("PhaseID");
@@ -1229,7 +1229,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ResourceID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1345,10 +1345,10 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SellingItemID"));
b.Property<double>("Cost")
b.Property<double>("BomCost")
.HasColumnType("double");
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1362,7 +1362,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ItemCode")
.HasColumnType("int");
b.Property<string>("ItemSPP")
b.Property<string>("ItemSteps")
.IsRequired()
.HasColumnType("longtext");
@@ -1810,7 +1810,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("TagID"));
b.Property<string>("Description")
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@@ -1876,15 +1876,15 @@ namespace EgwCoreLib.Lux.Data.Migrations
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("EgwCoreLib.Lux.Data.DbModel.JobRowModel", "JobRowNav")
b.HasOne("EgwCoreLib.Lux.Data.DbModel.JobRowModel", "JobStepNav")
.WithMany()
.HasForeignKey("JobRowID")
.HasForeignKey("JobStepID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("ItemNav");
b.Navigation("JobRowNav");
b.Navigation("JobStepNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.JobRowModel", b =>
@@ -55,7 +55,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
migrationBuilder.InsertData(
table: "GenClass",
columns: new[] { "ClassCod", "Description" },
columns: new[] { "ClassCod", "Name" },
values: new object[,]
{
{ "WoodCol", "Elenco Colori Legno" },
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+39 -30
View File
@@ -1,14 +1,15 @@
using EgwCoreLib.Lux.Data.DbModel;
using EgwCoreLib.Lux.Data.DbModel.General;
using EgwCoreLib.Lux.Data.DbModel.Identity;
using EgwCoreLib.Lux.Data.DbModel.Production;
using EgwCoreLib.Lux.Data.DbModel.Cost;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using EgwCoreLib.Lux.Data.DbModel.Sales;
using EgwCoreLib.Lux.Data.DbModel.Task;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EgwCoreLib.Lux.Data.DbModel.Stock;
using EgwCoreLib.Lux.Data.DbModel.Items;
namespace EgwCoreLib.Lux.Data
{
@@ -153,15 +154,23 @@ namespace EgwCoreLib.Lux.Data
new StockMovModel { StockMovID = 10, StockStatusId = 10, QtyRec = 1, MovCod = "CAR", UserId = "samuele.locatelli@egalware.com", Note = "DEMO" }
);
// init cost drivers
modelBuilder.Entity<CostDriverModel>().HasData(
// Risorsa principale di calcolo produttività/costi
new CostDriverModel() { CostDriverID = 1, Name = "WorkHour", Unit = "h", Descript = "Ore lavorate per step/fase"},
new CostDriverModel() { CostDriverID = 2, Name = "Meter", Unit = "m", Descript = "Metri prodotti per step/fase" },
new CostDriverModel() { CostDriverID = 3, Name = "Unit", Unit = "#", Descript = "Numero unità prodotte (lavorate) per step/fase" }
);
// inizializzazione risorse
modelBuilder.Entity<ResourceModel>().HasData(
new ResourceModel { ResourceID = 1, Description = "Sezionatrice", IsAsset = true, IsHuman = false, UnitCostFix = 15, UmFix = "€/h" },
new ResourceModel { ResourceID = 2, Description = "Linea SAOMAD WoodPecker Just 3500", IsAsset = true, IsHuman = false, UnitCostFix = 240, UmFix = "€/h", UnitCostProp = 1.9, UmProp = "€/m" },
new ResourceModel { ResourceID = 3, Description = "Linea Pantografo", IsAsset = true, IsHuman = false, UnitCostFix = 90, UmFix = "€/h", UnitCostProp = 5.9, UmProp = "€/m" },
new ResourceModel { ResourceID = 4, Description = "Stazione Verniciatura", IsAsset = true, IsHuman = false, UnitCostFix = 40, UmFix = "€/h", UnitCostProp = 1.9, UmProp = "€/m" },
new ResourceModel { ResourceID = 5, Description = "Verniciatura Manuale", IsAsset = false, IsHuman = true, UnitCostFix = 10, UmFix = "€/h", UnitCostProp = 1.9, UmProp = "€/m" },
new ResourceModel { ResourceID = 6, Description = "Montaggio Manuale", IsAsset = false, IsHuman = true, UnitCostProp = 40, UmProp = "€/h" },
new ResourceModel { ResourceID = 7, Description = "Installatore", IsAsset = false, IsHuman = true, UnitCostProp = 40, UmProp = "€/h" }
new ResourceModel { ResourceID = 1, Name = "Sezionatrice", FixedCost = 12000, VariableCost=6000 , OverHeadCost= 5000, CostDriverID = 1 , CostDriverBudget= 220*4, LaborCost=30, OverHeadPerc=0.15M, EBTPerc=0.15M },
new ResourceModel { ResourceID = 2, Name = "Linea SAOMAD WoodPecker Just 3500", FixedCost = 100000, VariableCost = 30000, OverHeadCost = 15000, CostDriverID = 1, CostDriverBudget = 220 * 8, LaborCost = 40, OverHeadPerc = 0.15M, EBTPerc = 0.15M },
new ResourceModel { ResourceID = 3, Name = "Linea Pantografo", FixedCost = 24000, VariableCost = 6000, OverHeadCost = 5000, CostDriverID = 1, CostDriverBudget = 220 * 8, LaborCost = 35, OverHeadPerc = 0.15M, EBTPerc = 0.15M },
new ResourceModel { ResourceID = 4, Name = "Stazione Verniciatura", FixedCost = 24000, VariableCost = 6000, OverHeadCost = 3000, CostDriverID = 1, CostDriverBudget = 220 * 4, LaborCost = 30, OverHeadPerc = 0.15M, EBTPerc = 0.15M },
new ResourceModel { ResourceID = 5, Name = "Verniciatura Manuale", FixedCost = 6000, VariableCost = 2000, OverHeadCost = 3000, CostDriverID = 1, CostDriverBudget = 220 * 1, LaborCost = 30, OverHeadPerc = 0.15M, EBTPerc = 0.15M },
new ResourceModel { ResourceID = 6, Name = "Montaggio Manuale", FixedCost = 500, VariableCost = 500, OverHeadCost = 500, CostDriverID = 1, CostDriverBudget = 220 * 8 * 2, LaborCost = 30, OverHeadPerc = 0.15M, EBTPerc = 0.15M },
new ResourceModel { ResourceID = 7, Name = "Installatore", FixedCost = 0, VariableCost = 3000, OverHeadCost = 0, CostDriverID = 1, CostDriverBudget = 220 * 8 * 2, LaborCost = 40, OverHeadPerc = 0.15M, EBTPerc = 0.15M }
);
// inizializzazione fasi
@@ -179,33 +188,33 @@ namespace EgwCoreLib.Lux.Data
modelBuilder.Entity<JobModel>().HasData(
new JobModel { JobID = 1, Description = "Rivendita / servizi" },
new JobModel { JobID = 2, Description = "Serramento Completo Legno su linea Saomad e installatore interno" }//,
//new JobModel { JobID = 2, Description = "Serramento Completo Legno/Alluminio" },
//new JobModel { JobID = 3, Description = "Persiana Legno" },
//new JobModel { JobID = 4, Description = "restauro Persiana Esistente" }
//new JobModel { JobID = 2, Name = "Serramento Completo Legno/Alluminio" },
//new JobModel { JobID = 3, Name = "Persiana Legno" },
//new JobModel { JobID = 4, Name = "restauro Persiana Esistente" }
);
// init righe ciclo (fasi di ciclo)
modelBuilder.Entity<JobRowModel>().HasData(
modelBuilder.Entity<JobStepModel>().HasData(
// per fare 1 finestra singola/semplice taglio 4 tronchetti telaio + 4 tronchetti finestra, considero 1 perché mi arriva dal sistema preventivo/motore
new JobRowModel { JobRowID = 1, JobID = 2, Index = 1, PhaseID = 1, Qty = 1, ResourceID = 1 },
new JobStepModel { JobStepID = 1, JobID = 2, Index = 1, CostDriverID = 3, PhaseID = 1, ProductivityRate = 1, ResourceID = 1 },
// taglio profilo su linea saomad, considero 1 perché mi arriva dal sistema preventivo/motore
new JobRowModel { JobRowID = 2, JobID = 2, Index = 2, PhaseID = 2, Qty = 1, ResourceID = 2 },
new JobStepModel { JobStepID = 2, JobID = 2, Index = 2, CostDriverID = 2, PhaseID = 2, ProductivityRate = 1, ResourceID = 2 },
// verniciatura automatica, considero 1 perché mi arriva dal sistema preventivo/motore
new JobRowModel { JobRowID = 3, JobID = 2, Index = 3, PhaseID = 3, Qty = 1, ResourceID = 4 },
new JobStepModel { JobStepID = 3, JobID = 2, Index = 3, CostDriverID = 3, PhaseID = 3, ProductivityRate = 1, ResourceID = 4 },
// assemblaggio
new JobRowModel { JobRowID = 4, JobID = 2, Index = 4, PhaseID = 4, Qty = 1, ResourceID = 6 },
new JobStepModel { JobStepID = 4, JobID = 2, Index = 4, CostDriverID = 3, PhaseID = 4, ProductivityRate = 1, ResourceID = 6 },
// installazione
new JobRowModel { JobRowID = 5, JobID = 2, Index = 5, PhaseID = 6, Qty = 1, ResourceID = 7 }
new JobStepModel { JobStepID = 5, JobID = 2, Index = 5, CostDriverID = 3, PhaseID = 6, ProductivityRate = 1, ResourceID = 7 }
);
// init item righe ciclo (articoli + prodotti delle fasi del ciclo)
modelBuilder.Entity<JobRowItemModel>().HasData(
modelBuilder.Entity<JobStepItemModel>().HasData(
// eventuale scarto del materiale tra grezzo e finito--> porta ad un numero >1 (QUI NON USATO, ho il valore calcolato dal motore)
new JobRowItemModel { JobRowItemID = 1, JobRowID = 1, Index = 1, ItemID = 1, Qty = 1, Description = "Grezzo legno abete" },
new JobStepItemModel { JobStepItemID = 1, JobStepID = 1, Index = 1, ItemID = 1, Qty = 1, Description = "Grezzo legno abete" },
// 1/10 litro di vernice per metro lineare prodotto
new JobRowItemModel { JobRowItemID = 2, JobRowID = 3, Index = 2, ItemID = 8, Qty = 0.1, Description = "Vernice trasparente standard 1L" },
new JobStepItemModel { JobStepItemID = 2, JobStepID = 3, Index = 2, ItemID = 8, Qty = 0.1, Description = "Vernice trasparente standard 1L" },
// uso un KIT intero (vs specifico n prodotti singoli) x questo modello; se dal preventivo arrivano n pezzi spcifici, qui li esplodiamo
new JobRowItemModel { JobRowItemID = 3, JobRowID = 4, Index = 3, ItemID = 9, Qty = 1, Description = "Ferramenta AGB - rif. AGFD.00000.00000" }
new JobStepItemModel { JobStepItemID = 3, JobStepID = 4, Index = 3, ItemID = 9, Qty = 1, Description = "Ferramenta AGB - rif. AGFD.00000.00000" }
);
// inizializzazione dei valori di default x SellingItem
@@ -218,16 +227,16 @@ namespace EgwCoreLib.Lux.Data
// inizializzazione dei valori di default x Offer
modelBuilder.Entity<OfferModel>().HasData(
new OfferModel { OfferID = 1, RefYear = 2024, RefNum = 1, RefRev = 1, Description = "Offerta per tre serramenti", CustomerID = 2, DealerID = 2 }
//new OfferModel { OfferID = 2, RefYear = 2025, RefNum = 2, RefRev = 1, Description = "Offerta per un serramento + installazione", CustomerID = 1, DealerID = 1 },
//new OfferModel { OfferID = 3, RefYear = 2025, RefNum = 3, RefRev = 1, Description = "Offerta per tre serramenti", CustomerID = 2, DealerID = 1 },
//new OfferModel { OfferID = 5, RefYear = 2025, RefNum = 4, RefRev = 2, Description = "Offerta per cinque serramenti + installazione", CustomerID = 3, DealerID = 2 }
//new OfferModel { OfferID = 2, RefYear = 2025, RefNum = 2, RefRev = 1, Name = "Offerta per un serramento + installazione", CustomerID = 1, DealerID = 1 },
//new OfferModel { OfferID = 3, RefYear = 2025, RefNum = 3, RefRev = 1, Name = "Offerta per tre serramenti", CustomerID = 2, DealerID = 1 },
//new OfferModel { OfferID = 5, RefYear = 2025, RefNum = 4, RefRev = 2, Name = "Offerta per cinque serramenti + installazione", CustomerID = 3, DealerID = 2 }
);
// inizializzazione dei valori di default x OfferRow
modelBuilder.Entity<OfferRowModel>().HasData(
new OfferRowModel { OfferRowID = 1, OfferID = 1, OfferRowUID = $"OFF{DateTime.Today:yy}0000000001", Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 950, SellingItemID = 1, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Finestra anta singola 2025", ItemSPP = "{}", BomOk = true, ItemOk = true },
new OfferRowModel { OfferRowID = 2, OfferID = 1, OfferRowUID = $"OFF{DateTime.Today:yy}0000000002", Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 160, SellingItemID = 2, Qty = 3, RowNum = 2, SerStruct = "{}", Note = "Persiana per Finestra anta singola 2025", ItemSPP = "{}", BomOk = true, ItemOk = true },
new OfferRowModel { OfferRowID = 3, OfferID = 1, OfferRowUID = $"OFF{DateTime.Today:yy}0000000003", Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 200, SellingItemID = 3, Qty = 3, RowNum = 3, SerStruct = "{}", Note = "Installazione serramento", ItemSPP = "{}", BomOk = true, ItemOk = true }
new OfferRowModel { OfferRowID = 1, OfferID = 1, OfferRowUID = $"OFF{DateTime.Today:yy}0000000001", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 950, SellingItemID = 1, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Finestra anta singola 2025", ItemSteps = "{}", BomOk = true, ItemOk = true },
new OfferRowModel { OfferRowID = 2, OfferID = 1, OfferRowUID = $"OFF{DateTime.Today:yy}0000000002", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 160, SellingItemID = 2, Qty = 3, RowNum = 2, SerStruct = "{}", Note = "Persiana per Finestra anta singola 2025", ItemSteps = "{}", BomOk = true, ItemOk = true },
new OfferRowModel { OfferRowID = 3, OfferID = 1, OfferRowUID = $"OFF{DateTime.Today:yy}0000000003", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 200, SellingItemID = 3, Qty = 3, RowNum = 3, SerStruct = "{}", Note = "Installazione serramento", ItemSteps = "{}", BomOk = true, ItemOk = true }
);
@@ -1,7 +1,6 @@
using EgwCoreLib.Lux.Core.RestPayload;
using EgwCoreLib.Lux.Data.Controllers;
using EgwCoreLib.Lux.Data.DbModel;
using EgwCoreLib.Lux.Data.DbModel.General;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using EgwCoreLib.Lux.Data.DbModel.Sales;
using EgwMultiEngineManager.Data;
using Microsoft.Extensions.Configuration;
@@ -17,6 +16,7 @@ using System.Text;
using System.Threading.Tasks;
using static EgwCoreLib.Lux.Core.Enums;
using static System.Runtime.InteropServices.JavaScript.JSType;
using EgwCoreLib.Lux.Data.DbModel.Items;
namespace EgwCoreLib.Lux.Data.Services
{