Use integer as penalty_amount
This commit is contained in:
@ -1,3 +1,4 @@
|
|||||||
|
using Elwig.Helpers;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
@ -26,12 +27,12 @@ namespace Elwig.Models {
|
|||||||
public int? MaxKgPerHa { get; set; }
|
public int? MaxKgPerHa { get; set; }
|
||||||
|
|
||||||
[Column("penalty_amount")]
|
[Column("penalty_amount")]
|
||||||
public double? PenaltyAmoutValue { get; set; }
|
public long? PenaltyAmoutValue { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public decimal? PenaltyAmount {
|
public decimal? PenaltyAmount {
|
||||||
get => PenaltyAmoutValue != null ? (decimal)PenaltyAmoutValue : null;
|
get => PenaltyAmoutValue != null ? Utils.DecFromDb(PenaltyAmoutValue.Value, 4) : null;
|
||||||
set => PenaltyAmoutValue = value != null ? (double)value : null;
|
set => PenaltyAmoutValue = value != null ? Utils.DecToDb(value.Value, 4) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ForeignKey("SortId")]
|
[ForeignKey("SortId")]
|
||||||
|
@ -18,6 +18,6 @@ namespace Elwig.Models {
|
|||||||
public long? OneEuroValue { get; private set; }
|
public long? OneEuroValue { get; private set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public decimal? OneEuro => OneEuroValue != null ? Utils.DecFromDb((long)OneEuroValue, 6) : null;
|
public decimal? OneEuro => OneEuroValue != null ? Utils.DecFromDb(OneEuroValue.Value, 6) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,10 +24,10 @@ namespace Elwig.Models {
|
|||||||
[NotMapped]
|
[NotMapped]
|
||||||
public decimal? Abs {
|
public decimal? Abs {
|
||||||
get {
|
get {
|
||||||
return AbsValue != null ? Season.DecFromDb((long)AbsValue) : null;
|
return AbsValue != null ? Season.DecFromDb(AbsValue.Value) : null;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
AbsValue = value != null ? Season.DecToDb((decimal)value) : null;
|
AbsValue = value != null ? Season.DecToDb(value.Value) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace Elwig.Windows {
|
|||||||
private string? ManualWeighingReason = null;
|
private string? ManualWeighingReason = null;
|
||||||
private string? ScaleId = null;
|
private string? ScaleId = null;
|
||||||
private string? WeighingId = null;
|
private string? WeighingId = null;
|
||||||
private Button[] WeighingButtons;
|
private readonly Button[] WeighingButtons;
|
||||||
|
|
||||||
public DeliveryAdminWindow(bool receipt = false) {
|
public DeliveryAdminWindow(bool receipt = false) {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
Reference in New Issue
Block a user