Weighing: Do not ignore gross and tare weight and show it on DeliveryNote
All checks were successful
Test / Run tests (push) Successful in 2m45s
All checks were successful
Test / Run tests (push) Successful in 2m45s
This commit is contained in:
@ -26,7 +26,7 @@ namespace Tests.DocumentTests {
|
||||
1 Grüner Veltliner Qualitätswein 73 15,0 3 219
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Matzner Hügel / Hohenruppersdorf / KG Hohenruppersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
});
|
||||
}
|
||||
@ -53,13 +53,13 @@ namespace Tests.DocumentTests {
|
||||
1 Grüner Veltliner Qualitätswein 82 16,7 4 002
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Matzner Hügel / Hohenruppersdorf / KG Hohenruppersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("""
|
||||
2 Grüner Veltliner Qualitätswein 75 15,3 481
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Matzner Hügel / Hohenruppersdorf / KG Hohenruppersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("Gesamt: 81 16,5 4 483"));
|
||||
});
|
||||
@ -86,19 +86,19 @@ namespace Tests.DocumentTests {
|
||||
1 Grüner Veltliner Qualitätswein 75 15,4 2 561
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Matzner Hügel / Hohenruppersdorf / KG Hohenruppersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("""
|
||||
2 Grüner Veltliner Kabinett Kabinett 87 17,6 3 129
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Matzner Hügel / Hohenruppersdorf / KG Hohenruppersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("""
|
||||
3 Grüner Veltliner Qualitätswein 79 16,1 1 280
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Matzner Hügel / Hohenruppersdorf / KG Hohenruppersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("Gesamt: 81 16,5 6 970"));
|
||||
});
|
||||
@ -126,14 +126,14 @@ namespace Tests.DocumentTests {
|
||||
Bewirtschaftung: Bio (AT-BIO-302)
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Wolkersdorfer Hochleithen / Wolkersdorf im Weinviertel / KG Wolkersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("""
|
||||
2 Grüner Veltliner Qualitätswein 75 15,4 2 134
|
||||
Bewirtschaftung: Bio (AT-BIO-302)
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Wolkersdorfer Hochleithen / Wolkersdorf im Weinviertel / KG Wolkersdorf
|
||||
Waage: ?, ID: ? (netto/gerebelt gewogen)
|
||||
Waage: ?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("Gesamt: 78 15,9 5 332"));
|
||||
});
|
||||
|
@ -40,7 +40,7 @@ INSERT INTO delivery (mgnr, year, did, date, time, zwstid, lnr) VALUES
|
||||
(101, 2020, 1, '2020-10-01', NULL, 'X', 1),
|
||||
(101, 2020, 2, '2020-10-01', NULL, 'X', 2),
|
||||
(101, 2020, 3, '2020-10-01', NULL, 'X', 3);
|
||||
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, net_weight, manual_weighing, spl_check, scale_id, weighing_id, weighing_reason) VALUES
|
||||
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, net_weight, manual_weighing, spl_check, scale_id, weighing_data, weighing_reason) VALUES
|
||||
(2020, 1, 1, 'GV', 'K', NULL, 4000, 17, 'KAB', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
(2020, 1, 2, 'GV', NULL, NULL, 4000, 16, 'QUW', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
(2020, 2, 1, 'GV', NULL, 'B', 4000, 15, 'QUW', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
@ -55,7 +55,7 @@ INSERT INTO delivery (mgnr, year, did, date, time, zwstid, lnr) VALUES
|
||||
(101, 2021, 1, '2021-10-01', NULL, 'X', 1),
|
||||
(101, 2021, 2, '2021-10-01', NULL, 'X', 2),
|
||||
(101, 2021, 3, '2021-10-01', NULL, 'X', 3);
|
||||
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, gebunden, net_weight, manual_weighing, spl_check, scale_id, weighing_id, weighing_reason) VALUES
|
||||
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, gebunden, net_weight, manual_weighing, spl_check, scale_id, weighing_data, weighing_reason) VALUES
|
||||
(2021, 1, 1, 'GV', 'K', NULL, 4000, 17, 'KAB', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
(2021, 1, 2, 'GV', NULL, NULL, 4000, 16, 'QUW', 'WLNO', 06109, FALSE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
(2021, 2, 1, 'GV', NULL, 'B', 4000, 15, 'QUW', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
|
@ -27,7 +27,7 @@ INSERT INTO delivery (mgnr, year, did, date, time, zwstid, lnr) VALUES
|
||||
(104, 2020, 11, '2020-10-03', '14:39:22', 'X', 2),
|
||||
(104, 2020, 12, '2020-10-03', '15:15:41', 'X', 3);
|
||||
|
||||
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, net_weight, manual_weighing, spl_check, scale_id, weighing_id, weighing_reason) VALUES
|
||||
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, net_weight, manual_weighing, spl_check, scale_id, weighing_data, weighing_reason) VALUES
|
||||
(2020, 1, 1, 'GV', NULL, NULL, 3219, 15.0, 'QUW', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
(2020, 2, 1, 'GV', 'K', NULL, 2987, 17.5, 'KAB', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
(2020, 2, 2, 'GV', 'K', NULL, 1873, 17.7, 'KAB', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||
|
@ -37,8 +37,8 @@ namespace Tests.WeighingTests {
|
||||
await Task.Delay(100);
|
||||
Assert.That(res, Is.Not.Null);
|
||||
Assert.That(res, Is.EqualTo(new WeighingResult {
|
||||
Weight = 2345, WeighingId = "1",
|
||||
FullWeighingId = $"2020-09-28/1",
|
||||
NetWeight = 2345,
|
||||
WeighingId = "1", FullWeighingId = $"2020-09-28/1",
|
||||
Date = new DateOnly(2020, 9, 28), Time = new TimeOnly(9, 8),
|
||||
}));
|
||||
|
||||
@ -46,9 +46,8 @@ namespace Tests.WeighingTests {
|
||||
await Task.Delay(100);
|
||||
Assert.That(res, Is.Not.Null);
|
||||
Assert.That(res, Is.EqualTo(new WeighingResult {
|
||||
Weight = 4215,
|
||||
WeighingId = "2",
|
||||
FullWeighingId = $"2020-09-28/2",
|
||||
NetWeight = 4215,
|
||||
WeighingId = "2", FullWeighingId = $"2020-09-28/2",
|
||||
Date = new DateOnly(2020, 9, 28),
|
||||
Time = new TimeOnly(9, 8),
|
||||
}));
|
||||
|
@ -30,15 +30,18 @@ namespace Tests.WeighingTests {
|
||||
public async Task Test_01_CurrentWeight() {
|
||||
Mock.Weight = 1235;
|
||||
Assert.That(await Scale!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1235, Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
GrossWeight = 1235, TareWeight = 0, NetWeight = 1235,
|
||||
Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
}));
|
||||
Mock.Weight = 1240;
|
||||
Assert.That(await Scale!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1240, Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
GrossWeight = 1240, TareWeight = 0, NetWeight = 1240,
|
||||
Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
}));
|
||||
Mock.Weight = 1245;
|
||||
Assert.That(await Scale!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1245, Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
GrossWeight = 1245, TareWeight = 0, NetWeight = 1245,
|
||||
Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
}));
|
||||
}
|
||||
|
||||
@ -46,20 +49,20 @@ namespace Tests.WeighingTests {
|
||||
public async Task Test_02_Normal() {
|
||||
Mock.Weight = 1235;
|
||||
Assert.That(await Scale!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1235, WeighingId = "1",
|
||||
FullWeighingId = $"2020-10-17/1",
|
||||
GrossWeight = 1235, TareWeight = 0, NetWeight = 1235,
|
||||
WeighingId = "1", FullWeighingId = $"2020-10-17/1",
|
||||
Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
}));
|
||||
Mock.Weight = 3335;
|
||||
Assert.That(await Scale!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 3335, WeighingId = "2",
|
||||
FullWeighingId = $"2020-10-17/2",
|
||||
GrossWeight = 3335, TareWeight = 0, NetWeight = 3335,
|
||||
WeighingId = "2", FullWeighingId = $"2020-10-17/2",
|
||||
Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
}));
|
||||
Mock.Weight = 6420;
|
||||
Assert.That(await Scale!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 6420, WeighingId = "3",
|
||||
FullWeighingId = $"2020-10-17/3",
|
||||
GrossWeight = 6420, TareWeight = 0, NetWeight = 6420,
|
||||
WeighingId = "3", FullWeighingId = $"2020-10-17/3",
|
||||
Date = new DateOnly(2020, 10, 17), Time = new TimeOnly(14, 23),
|
||||
}));
|
||||
}
|
||||
|
@ -30,15 +30,18 @@ namespace Tests.WeighingTests {
|
||||
public async Task Test_01_CurrentWeight() {
|
||||
Mock.Weight = 1234;
|
||||
Assert.That(await Scale!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1234, Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
GrossWeight = 1234, TareWeight = 0, NetWeight = 1234,
|
||||
Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
}));
|
||||
Mock.Weight = 1235;
|
||||
Assert.That(await Scale!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1235, Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
GrossWeight = 1235, TareWeight = 0, NetWeight = 1235,
|
||||
Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
}));
|
||||
Mock.Weight = 1236;
|
||||
Assert.That(await Scale!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1236, Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
GrossWeight = 1236, TareWeight = 0, NetWeight = 1236,
|
||||
Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
}));
|
||||
}
|
||||
|
||||
@ -46,20 +49,20 @@ namespace Tests.WeighingTests {
|
||||
public async Task Test_02_Normal() {
|
||||
Mock.Weight = 1234;
|
||||
Assert.That(await Scale!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1234, WeighingId = "1",
|
||||
FullWeighingId = $"2020-10-15/1",
|
||||
GrossWeight = 1234, TareWeight = 0, NetWeight = 1234,
|
||||
WeighingId = "1", FullWeighingId = $"2020-10-15/1",
|
||||
Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
}));
|
||||
Mock.Weight = 3333;
|
||||
Assert.That(await Scale!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 3333, WeighingId = "2",
|
||||
FullWeighingId = $"2020-10-15/2",
|
||||
GrossWeight = 3333, TareWeight = 0, NetWeight = 3333,
|
||||
WeighingId = "2", FullWeighingId = $"2020-10-15/2",
|
||||
Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
}));
|
||||
Mock.Weight = 4321;
|
||||
Assert.That(await Scale!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 4321, WeighingId = "3",
|
||||
FullWeighingId = $"2020-10-15/3",
|
||||
GrossWeight = 4321, TareWeight = 0, NetWeight = 4321,
|
||||
WeighingId = "3", FullWeighingId = $"2020-10-15/3",
|
||||
Date = new DateOnly(2020, 10, 15), Time = new TimeOnly(12, 34),
|
||||
}));
|
||||
}
|
||||
|
@ -78,19 +78,23 @@ namespace Tests.WeighingTests {
|
||||
public async Task Test_01_CurrentWeight() {
|
||||
MockA.Weight = 1234;
|
||||
Assert.That(await ScaleA!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1234, Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
GrossWeight = 1234, TareWeight = 0, NetWeight = 1234,
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
MockB.Weight = 3456;
|
||||
Assert.That(await ScaleB!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 3456, Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
GrossWeight = 3456, TareWeight = 0, NetWeight = 3456,
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
MockA.Weight = 1236;
|
||||
Assert.That(await ScaleA!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1236, Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
GrossWeight = 1236, TareWeight = 0, NetWeight = 1236,
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
MockB.Weight = 3457;
|
||||
Assert.That(await ScaleB!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 3457, Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
GrossWeight = 3457, TareWeight = 0, NetWeight = 3457,
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
}
|
||||
|
||||
@ -98,26 +102,26 @@ namespace Tests.WeighingTests {
|
||||
public async Task Test_02_Normal() {
|
||||
MockA.Weight = 1234;
|
||||
Assert.That(await ScaleA!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 1234, WeighingId = "1",
|
||||
FullWeighingId = $"2020-10-08/1",
|
||||
GrossWeight = 1234, TareWeight = 0, NetWeight = 1234,
|
||||
WeighingId = "1", FullWeighingId = $"2020-10-08/1",
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
MockB.Weight = 3456;
|
||||
Assert.That(await ScaleB!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 3456, WeighingId = "1",
|
||||
FullWeighingId = $"2020-10-08/1",
|
||||
GrossWeight = 3456, TareWeight = 0, NetWeight = 3456,
|
||||
WeighingId = "1", FullWeighingId = $"2020-10-08/1",
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
MockA.Weight = 4321;
|
||||
Assert.That(await ScaleA!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 4321, WeighingId = "2",
|
||||
FullWeighingId = $"2020-10-08/2",
|
||||
GrossWeight = 4321, TareWeight = 0, NetWeight = 4321,
|
||||
WeighingId = "2", FullWeighingId = $"2020-10-08/2",
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
MockB.Weight = 3333;
|
||||
Assert.That(await ScaleB!.Weigh(), Is.EqualTo(new WeighingResult {
|
||||
Weight = 3333, WeighingId = "2",
|
||||
FullWeighingId = $"2020-10-08/2",
|
||||
GrossWeight = 3333, TareWeight = 0, NetWeight = 3333,
|
||||
WeighingId = "2", FullWeighingId = $"2020-10-08/2",
|
||||
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
|
||||
}));
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=24" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=25" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
|
Reference in New Issue
Block a user