Models: Update Payment models

This commit is contained in:
lorenz.stechauner committed 2024-01-05 09:53:05 +01:00
1 parent eb46955b3b
commit ba55692cbe
3 files changed
+15 -10

No files matched your search

+10 -5
View File
@@ -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; }