diff --git a/FruitBank.Common.Server/Services/Ekaer/FruitBankEkaerService.cs b/FruitBank.Common.Server/Services/Ekaer/FruitBankEkaerService.cs index f0175bbf..23f266a0 100644 --- a/FruitBank.Common.Server/Services/Ekaer/FruitBankEkaerService.cs +++ b/FruitBank.Common.Server/Services/Ekaer/FruitBankEkaerService.cs @@ -66,6 +66,12 @@ public sealed class FruitBankEkaerService : IFruitBankEkaerService public EkaerObligationResult EvaluateObligation(OrderDto order) => EkaerReportability.Evaluate(_mapper.ToConsignment(order, _settings.Company), _settings); + public void SetSummary(EkaerHistory history, DateTime? shippingDate, string? partner) + { + history.ShippingDate = shippingDate; + history.Partner = partner; + } + /// Config-kapu: külföldi (nem HUF) feladónál az árfolyam kötelező — különben a leképezés ELŐTT /// ValidationError (nincs félrevezető XML). null = rendben, mehet a generálás. private EkaerHistory? TryConfigError(EkaerHistory ekaerHistory, string? currency) diff --git a/FruitBank.Common.Server/Services/Ekaer/IFruitBankEkaerService.cs b/FruitBank.Common.Server/Services/Ekaer/IFruitBankEkaerService.cs index 929d2107..a6f9619f 100644 --- a/FruitBank.Common.Server/Services/Ekaer/IFruitBankEkaerService.cs +++ b/FruitBank.Common.Server/Services/Ekaer/IFruitBankEkaerService.cs @@ -45,4 +45,9 @@ public interface IFruitBankEkaerService /// Eldönti egy kimenő rendelés EKÁER-kötelezettségét (ugyanaz a logika, a rendelés tételeire). EkaerObligationResult EvaluateObligation(OrderDto order); + + /// Beállítja a deklaráció () összegző mezőit (DB-mentes): ShippingDate + Partner. + /// A csoporton belül invariánsak; a forrás-kinyerés (bejövő: doc.ShippingDate + Partner.Name; kimenő: order.DateOfReceipt + + /// Customer.Company) a hívóé. Fallback NINCS — null/üres marad, ha hiányzik. + void SetSummary(EkaerHistory history, DateTime? shippingDate, string? partner); } diff --git a/FruitBank.Common/Entities/EkaerHistory.cs b/FruitBank.Common/Entities/EkaerHistory.cs index 47a3060f..e9a9e26b 100644 --- a/FruitBank.Common/Entities/EkaerHistory.cs +++ b/FruitBank.Common/Entities/EkaerHistory.cs @@ -19,6 +19,12 @@ public sealed class EkaerHistory: MgEntityBase, ITimeStampInfo [ToonDescription(Purpose = "Direction of the goods movement: false = incoming shipment (Shipping), true = outgoing delivery (Order).")] public bool IsOutgoing { get; set; } + [ToonDescription(Purpose = "Declaration-level date snapshot (group-invariant): inbound = the ShippingDocument's ShippingDate, outbound = the Order's DateOfReceipt. Set at create, refreshed on Generate. NO fallback — null if missing (the data gap is visible in the grid).")] + public DateTime? ShippingDate { get; set; } + + [ToonDescription(Purpose = "Declaration-level other-party name snapshot (group-invariant): inbound = the supplier Partner.Name, outbound = the buyer Customer.Company. Set at create, refreshed on Generate. NO fallback — null/empty if missing.")] + public string? Partner { get; set; } + [ToonDescription(Purpose = "Lifecycle state of the declaration, stored as int (see EkaerStatus): 0 Pending (auto-created, not yet generated), 1 Generated (tradeCard XML produced and valid), 2 ValidationError (generation produced errors, see ErrorText), 3 Sent (accepted by NAV, EkaerNumber filled), 4 SendError (NAV call failed, see ErrorText).")] public int StatusId { get; set; } diff --git a/FruitBank.Common/Entities/EkaerHistoryMapping.cs b/FruitBank.Common/Entities/EkaerHistoryMapping.cs index 27fc7b00..614fd7e4 100644 --- a/FruitBank.Common/Entities/EkaerHistoryMapping.cs +++ b/FruitBank.Common/Entities/EkaerHistoryMapping.cs @@ -18,6 +18,9 @@ public sealed class EkaerHistoryMapping : MgEntityBase, ITimeStampInfo [ToonDescription(Purpose = "Id of the covered source entity: ShippingDocument.Id when the parent EkaerHistory.IsOutgoing is false, Order id when true.")] public int ForeignKey { get; set; } + [ToonDescription(Purpose = "Reserved for future PER-DOCUMENT detail. Currently NOT populated — the declaration-level summary (date + other party), being group-invariant, lives on EkaerHistory.ShippingDate + EkaerHistory.Partner instead. The column is kept for later document-specific notes.")] + public string? Comment { get; set; } + [Association(ThisKey = nameof(EkaerHistoryId), OtherKey = nameof(EkaerHistory.Id), CanBeNull = true)] public EkaerHistory? EkaerHistory { get; set; } diff --git a/FruitBankHybrid.Shared.Tests/ToonTests.cs b/FruitBankHybrid.Shared.Tests/ToonTests.cs index fa8609e4..7e0223aa 100644 --- a/FruitBankHybrid.Shared.Tests/ToonTests.cs +++ b/FruitBankHybrid.Shared.Tests/ToonTests.cs @@ -88,6 +88,7 @@ public class FullProcessModel public List Orders { get; set; } public List PreOrders { get; set; } public List StockTakings { get; set; } + public List EkaerHistories { get; set; } } [TestClass] diff --git a/FruitBankHybrid.Shared/Components/Grids/Ekaers/GridEkaerHistory.razor b/FruitBankHybrid.Shared/Components/Grids/Ekaers/GridEkaerHistory.razor index a5d62d52..e3f7e648 100644 --- a/FruitBankHybrid.Shared/Components/Grids/Ekaers/GridEkaerHistory.razor +++ b/FruitBankHybrid.Shared/Components/Grids/Ekaers/GridEkaerHistory.razor @@ -49,6 +49,8 @@ } + + @* A kézi NAV-beadás fázisában a Status / EKÁER szám / SentDate kézzel szerkeszthető. *@