Compare commits
2 Commits
4cd7ef85a1
...
23db4de1ee
| Author | SHA1 | Date | |
|---|---|---|---|
| 23db4de1ee | |||
| 9e5f709d42 |
@@ -100,6 +100,12 @@
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">Davon abgewertet:</td>
|
||||
<td colspan="2" class="number">@($"{Model.Data.Rows.Where(p => p.IsDepreciated).Sum(p => p.Weight):N0}")</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@Raw(BusinessDocument.PrintSortenaufteilung(Model.MemberStats))
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Elwig.Helpers {
|
||||
public static class AppDbUpdater {
|
||||
|
||||
// Don't forget to update value in Tests/fetch-resources.bat!
|
||||
public static readonly int RequiredSchemaVersion = 36;
|
||||
public static readonly int RequiredSchemaVersion = 37;
|
||||
|
||||
private static int VersionOffset = 0;
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace Elwig.Models.Dtos {
|
||||
public string? Attribute;
|
||||
public string? Cultivation;
|
||||
public string QualityLevel;
|
||||
public bool IsDepreciated;
|
||||
public (double Oe, double Kmw) Gradation;
|
||||
public string[] Modifiers;
|
||||
public int Weight;
|
||||
@@ -89,17 +90,15 @@ namespace Elwig.Models.Dtos {
|
||||
Attribute = p.Attribute?.Name;
|
||||
Cultivation = p.Cultivation?.Name;
|
||||
QualityLevel = p.Quality.Name;
|
||||
IsDepreciated = p.QualId == "WEI";
|
||||
Gradation = (p.Oe, p.Kmw);
|
||||
Modifiers = p.Modifiers
|
||||
.Select(m => m.Name)
|
||||
.ToArray();
|
||||
Modifiers = [.. p.Modifiers.Select(m => m.Name)];
|
||||
Weight = p.Weight;
|
||||
IsNetWeight = p.IsNetWeight;
|
||||
Buckets = p.Buckets
|
||||
Buckets = [.. p.Buckets
|
||||
.Where(b => b.Value > 0)
|
||||
.OrderByDescending(b => b.BktNr)
|
||||
.Select(b => (b.Discr == "_" ? "ungeb." : $"geb. {p.SortId}{b.Discr}", b.Value))
|
||||
.ToArray();
|
||||
.Select(b => (b.Discr == "_" ? "ungeb." : $"geb. {p.SortId}{b.Discr}", b.Value))];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
-- schema version 34 to 35
|
||||
|
||||
UPDATE client_parameter SET value = '0' WHERE param = 'ENABLE_TIME_TRIGGERS';
|
||||
ALTER TABLE delivery_part ADD COLUMN unloading TEXT DEFAULT NULL;
|
||||
UPDATE delivery_part SET unloading = 'pumped' WHERE lesewagen;
|
||||
UPDATE delivery_part SET unloading = 'box' WHERE (SELECT zwstid IN ('H','S') FROM delivery d WHERE (d.year, d.did) = (delivery_part.year, delivery_part.did));
|
||||
ALTER TABLE delivery_part DROP COLUMN lesewagen;
|
||||
UPDATE client_parameter SET value = '1' WHERE param = 'ENABLE_TIME_TRIGGERS';
|
||||
|
||||
12
Elwig/Resources/Sql/36-37.sql
Normal file
12
Elwig/Resources/Sql/36-37.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- schema version 36 to 37
|
||||
|
||||
UPDATE client_parameter SET value = '0' WHERE param = 'ENABLE_TIME_TRIGGERS';
|
||||
|
||||
-- fix old deliveries
|
||||
UPDATE delivery SET xtime = NULL, mtime = ctime WHERE year <= 2022 AND mtime >= 1768521600 AND mtime < 1772323200;
|
||||
UPDATE delivery_part SET xtime = NULL, mtime = ctime WHERE year <= 2022 AND mtime >= 1768521600 AND mtime < 1772323200;
|
||||
-- clear xtime at one laptop to force updates from this one
|
||||
UPDATE delivery SET xtime = NULL WHERE year >= 2023 AND xtime >= 1771200000 AND xtime < 1771286400;
|
||||
UPDATE delivery_part SET xtime = NULL WHERE year >= 2023 AND xtime >= 1771200000 AND xtime < 1771286400;
|
||||
|
||||
UPDATE client_parameter SET value = '1' WHERE param = 'ENABLE_TIME_TRIGGERS';
|
||||
Reference in New Issue
Block a user