Add summary fields to EkaerHistory and grid display
Added ShippingDate and Partner fields to EkaerHistory with ToonDescription metadata. Introduced SetSummary method in FruitBankEkaerService and interface for setting these fields. Updated EkaerHistoryMapping with a future-use Comment property. Extended FullProcessModel for tests. Displayed new fields in GridEkaerHistory.razor as read-only columns.
This commit is contained in:
parent
973c8030d2
commit
3cf18efd99
|
|
@ -66,6 +66,12 @@ public sealed class FruitBankEkaerService : IFruitBankEkaerService
|
||||||
public EkaerObligationResult EvaluateObligation(OrderDto order)
|
public EkaerObligationResult EvaluateObligation(OrderDto order)
|
||||||
=> EkaerReportability.Evaluate(_mapper.ToConsignment(order, _settings.Company), _settings);
|
=> EkaerReportability.Evaluate(_mapper.ToConsignment(order, _settings.Company), _settings);
|
||||||
|
|
||||||
|
public void SetSummary(EkaerHistory history, DateTime? shippingDate, string? partner)
|
||||||
|
{
|
||||||
|
history.ShippingDate = shippingDate;
|
||||||
|
history.Partner = partner;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Config-kapu: külföldi (nem HUF) feladónál az árfolyam kötelező — különben a leképezés ELŐTT
|
/// <summary>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). <c>null</c> = rendben, mehet a generálás.</summary>
|
/// ValidationError (nincs félrevezető XML). <c>null</c> = rendben, mehet a generálás.</summary>
|
||||||
private EkaerHistory? TryConfigError(EkaerHistory ekaerHistory, string? currency)
|
private EkaerHistory? TryConfigError(EkaerHistory ekaerHistory, string? currency)
|
||||||
|
|
|
||||||
|
|
@ -45,4 +45,9 @@ public interface IFruitBankEkaerService
|
||||||
|
|
||||||
/// <summary>Eldönti egy kimenő rendelés EKÁER-kötelezettségét (ugyanaz a logika, a rendelés tételeire).</summary>
|
/// <summary>Eldönti egy kimenő rendelés EKÁER-kötelezettségét (ugyanaz a logika, a rendelés tételeire).</summary>
|
||||||
EkaerObligationResult EvaluateObligation(OrderDto order);
|
EkaerObligationResult EvaluateObligation(OrderDto order);
|
||||||
|
|
||||||
|
/// <summary>Beállítja a deklaráció (<see cref="EkaerHistory"/>) összegző mezőit (DB-mentes): <c>ShippingDate</c> + <c>Partner</c>.
|
||||||
|
/// 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.</summary>
|
||||||
|
void SetSummary(EkaerHistory history, DateTime? shippingDate, string? partner);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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).")]
|
[ToonDescription(Purpose = "Direction of the goods movement: false = incoming shipment (Shipping), true = outgoing delivery (Order).")]
|
||||||
public bool IsOutgoing { get; set; }
|
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).")]
|
[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; }
|
public int StatusId { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.")]
|
[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; }
|
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)]
|
[Association(ThisKey = nameof(EkaerHistoryId), OtherKey = nameof(EkaerHistory.Id), CanBeNull = true)]
|
||||||
public EkaerHistory? EkaerHistory { get; set; }
|
public EkaerHistory? EkaerHistory { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ public class FullProcessModel
|
||||||
public List<OrderDto> Orders { get; set; }
|
public List<OrderDto> Orders { get; set; }
|
||||||
public List<PreOrder> PreOrders { get; set; }
|
public List<PreOrder> PreOrders { get; set; }
|
||||||
public List<StockTaking> StockTakings { get; set; }
|
public List<StockTaking> StockTakings { get; set; }
|
||||||
|
public List<EkaerHistory> EkaerHistories { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@
|
||||||
}
|
}
|
||||||
</CellDisplayTemplate>
|
</CellDisplayTemplate>
|
||||||
</DxGridDataColumn>
|
</DxGridDataColumn>
|
||||||
|
<DxGridDataColumn FieldName="@nameof(EkaerHistory.ShippingDate)" Caption="Dátum" DisplayFormat="yyyy.MM.dd" ReadOnly="true" />
|
||||||
|
<DxGridDataColumn FieldName="@nameof(EkaerHistory.Partner)" Caption="Partner" ReadOnly="true" />
|
||||||
<DxGridDataColumn FieldName="@nameof(EkaerHistory.IsOutgoing)" Caption="Kimenő?" ReadOnly="true" />
|
<DxGridDataColumn FieldName="@nameof(EkaerHistory.IsOutgoing)" Caption="Kimenő?" ReadOnly="true" />
|
||||||
@* A kézi NAV-beadás fázisában a Status / EKÁER szám / SentDate kézzel szerkeszthető. *@
|
@* A kézi NAV-beadás fázisában a Status / EKÁER szám / SentDate kézzel szerkeszthető. *@
|
||||||
<DxGridDataColumn FieldName="@nameof(EkaerHistory.Status)" />
|
<DxGridDataColumn FieldName="@nameof(EkaerHistory.Status)" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue