diff --git a/Elwig/Models/Entities/PaymentDeliveryPart.cs b/Elwig/Models/Entities/PaymentDeliveryPart.cs index d2852ef..ab9eb42 100644 --- a/Elwig/Models/Entities/PaymentDeliveryPart.cs +++ b/Elwig/Models/Entities/PaymentDeliveryPart.cs @@ -16,6 +16,14 @@ namespace Elwig.Models.Entities { [Column("avnr")] public int AvNr { get; set; } + [Column("net_amount")] + public long NetAmountValue { get; set; } + [NotMapped] + public decimal NetAmount { + get => Variant.Season.DecFromDb(NetAmountValue); + set => NetAmountValue = Variant.Season.DecToDb(value); + } + [Column("mod_abs")] public long ModAbsValue { get; set; } [NotMapped] @@ -33,12 +41,9 @@ namespace Elwig.Models.Entities { } [Column("amount")] - public long? AmountValue { get; set; } + public long AmountValue { get; private set; } [NotMapped] - public decimal? Amount { - get => AmountValue != null ? Variant.Season.DecFromDb(AmountValue.Value) : null; - set => AmountValue = value != null ? Variant.Season.DecToDb(value.Value) : null; - } + public decimal Amount => Variant.Season.DecFromDb(AmountValue); [ForeignKey("Year, AvNr")] public virtual PaymentVar Variant { get; private set; } diff --git a/Elwig/Models/Entities/PaymentMember.cs b/Elwig/Models/Entities/PaymentMember.cs index 3bda987..d16d6c4 100644 --- a/Elwig/Models/Entities/PaymentMember.cs +++ b/Elwig/Models/Entities/PaymentMember.cs @@ -39,12 +39,9 @@ namespace Elwig.Models.Entities { } [Column("amount")] - public long AmountValue { get; set; } + public long AmountValue { get; private set; } [NotMapped] - public decimal Amount { - get => Variant.Season.DecFromDb(AmountValue); - set => AmountValue = Variant.Season.DecToDb(value); - } + public decimal Amount => Variant.Season.DecFromDb(AmountValue); [ForeignKey("Year, AvNr")] public virtual PaymentVar Variant { get; private set; } diff --git a/Elwig/Models/Entities/PaymentVar.cs b/Elwig/Models/Entities/PaymentVar.cs index 3e14733..505236c 100644 --- a/Elwig/Models/Entities/PaymentVar.cs +++ b/Elwig/Models/Entities/PaymentVar.cs @@ -51,6 +51,9 @@ namespace Elwig.Models.Entities { [InverseProperty("Variant")] public virtual ISet MemberPayments { get; private set; } + [InverseProperty("Variant")] + public virtual ISet DeliveryPartPayments { get; private set; } + [InverseProperty("Variant")] public virtual ISet Credits { get; private set; } }