This commit is contained in:
+7
-1
@@ -145,7 +145,13 @@ namespace Elwig {
|
||||
var list = new List<IScale>();
|
||||
foreach (var s in Config.Scales) {
|
||||
try {
|
||||
list.Add(Scale.FromConfig(s));
|
||||
var scale = Scale.FromConfig(s);
|
||||
if (scale is ICommandScale cmd) {
|
||||
try {
|
||||
await cmd.SetDateAndTime(DateTime.Now);
|
||||
} catch { }
|
||||
}
|
||||
list.Add(scale);
|
||||
} catch (Exception exc) {
|
||||
list.Add(new InvalidScale(s.Id));
|
||||
if (s.Required)
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace Elwig.Documents {
|
||||
if (info.Date != null || info.Time != null)
|
||||
weighing.Add(Normal(" \u2013 "));
|
||||
if (info.Time != null)
|
||||
weighing.Add(Normal($"{info.Time:HH:mm}"));
|
||||
weighing.Add(Normal($"{info.Time:HH:mm:ss}"));
|
||||
if (info.Date != null)
|
||||
weighing.Add(Normal($", {info.Date:dd.MM.yyyy}"));
|
||||
if (info.Gross != null && info.Tare != null && info.Net != null) {
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Elwig.Helpers.Weighing {
|
||||
/// <returns><[GrossWeight-TaraWeight=]NetWeight/WeighingId/Date/Time></returns>
|
||||
public override readonly string ToString() {
|
||||
var w = NetWeight != null ? (GrossWeight != null && TareWeight != null ? $"{GrossWeight}-{TareWeight}=" : "") + $"{NetWeight}kg" : "";
|
||||
return $"<{w}/{WeighingId}/{Date:yyyy-MM-dd}/{Time:HH:mm}>";
|
||||
return $"<{w}/{WeighingId}/{Date:yyyy-MM-dd}/{Time:HH:mm:ss}>";
|
||||
}
|
||||
|
||||
public readonly JsonObject ToJson() {
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Tests.UnitTests.DocumentTests {
|
||||
1 Grüner Veltliner Qualitätswein 73 15,0 3 219
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Matzner Hügel / Hohenruppersdorf / KG Hohenruppersdorf
|
||||
Waage/Terminal: ?/1, ID: 321 – 09:02, 01.10.2020
|
||||
Waage/Terminal: ?/1, ID: 321 – 09:02:46, 01.10.2020
|
||||
Brutto: 3 219 kg – Tara: 0 kg – Netto: 3 219 kg – gerebelt gewogen
|
||||
"""));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user