DeliveryAdminWindow: Add button to correct tare
This commit is contained in:
@@ -124,7 +124,7 @@ namespace Elwig.Models.Entities {
|
||||
[Column("weighing_data")]
|
||||
public string? WeighingData { get; set; }
|
||||
[NotMapped]
|
||||
public (string? ScaleId, string? Id, int? Gross, int? Tare, int? Net, DateOnly? Date, TimeOnly? Time) WeighingInfo {
|
||||
public (string? ScaleId, string? Id, int? Gross, int? Tare, int? TareCorrection, int? Net, DateOnly? Date, TimeOnly? Time) WeighingInfo {
|
||||
get {
|
||||
try {
|
||||
var obj = JsonNode.Parse(WeighingData!)!.AsObject();
|
||||
@@ -133,12 +133,13 @@ namespace Elwig.Models.Entities {
|
||||
obj["id"]?.AsValue().GetValue<string>(),
|
||||
obj["gross_weight"]?.AsValue().GetValue<int>(),
|
||||
obj["tare_weight"]?.AsValue().GetValue<int>(),
|
||||
obj["tare_correction"]?.AsValue().GetValue<int>(),
|
||||
obj["net_weight"]?.AsValue().GetValue<int>(),
|
||||
DateOnly.TryParseExact(obj["date"]?.AsValue().GetValue<string>(), "yyyy-MM-dd", out var d) ? d : null,
|
||||
TimeOnly.TryParseExact(obj["time"]?.AsValue().GetValue<string>(), ["HH:mm:ss", "HH:mm"], out var t) ? t : null
|
||||
);
|
||||
} catch {
|
||||
return (null, null, null, null, null, null, null);
|
||||
return (null, null, null, null, null, null, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user