Compare commits
2 Commits
6bcb2fb406
...
ff3bd5cea5
| Author | SHA1 | Date | |
|---|---|---|---|
| ff3bd5cea5 | |||
| 116d88d3d6 |
@@ -108,19 +108,19 @@ namespace Elwig.Helpers.Export {
|
|||||||
<style:paragraph-properties fo:text-align="center"/>
|
<style:paragraph-properties fo:text-align="center"/>
|
||||||
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
||||||
</style:style>
|
</style:style>
|
||||||
<number:number-style style:name="NN0"><number:number number:decimal-places="0" number:min-decimal-places="0" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN0"><number:number number:decimal-places="0" number:min-decimal-places="0" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N0" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN0"/>
|
<style:style style:name="N0" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN0"/>
|
||||||
<number:number-style style:name="NN1"><number:number number:decimal-places="1" number:min-decimal-places="1" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN1"><number:number number:decimal-places="1" number:min-decimal-places="1" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N1" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN1"/>
|
<style:style style:name="N1" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN1"/>
|
||||||
<number:number-style style:name="NN2"><number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN2"><number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N2" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN2"/>
|
<style:style style:name="N2" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN2"/>
|
||||||
<number:number-style style:name="NN3"><number:number number:decimal-places="3" number:min-decimal-places="3" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN3"><number:number number:decimal-places="3" number:min-decimal-places="3" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N3" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN3"/>
|
<style:style style:name="N3" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN3"/>
|
||||||
<number:number-style style:name="NN4"><number:number number:decimal-places="4" number:min-decimal-places="4" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN4"><number:number number:decimal-places="4" number:min-decimal-places="4" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N4" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN4"/>
|
<style:style style:name="N4" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN4"/>
|
||||||
<number:number-style style:name="NN5"><number:number number:decimal-places="5" number:min-decimal-places="5" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN5"><number:number number:decimal-places="5" number:min-decimal-places="5" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N5" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN5"/>
|
<style:style style:name="N5" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN5"/>
|
||||||
<number:number-style style:name="NN6"><number:number number:decimal-places="6" number:min-decimal-places="6" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN6"><number:number number:decimal-places="6" number:min-decimal-places="6" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N6" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN6"/>
|
<style:style style:name="N6" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN6"/>
|
||||||
</office:automatic-styles>
|
</office:automatic-styles>
|
||||||
<office:body>
|
<office:body>
|
||||||
@@ -262,13 +262,14 @@ namespace Elwig.Helpers.Export {
|
|||||||
string c;
|
string c;
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
c = $"<{ct}{add}/>";
|
c = $"<{ct}{add}/>";
|
||||||
} else if (data is float || data is double || data is byte || data is char ||
|
} else if (data is decimal || data is float || data is double || data is byte || data is char ||
|
||||||
data is short || data is ushort || data is int || data is uint || data is long || data is ulong) {
|
data is short || data is ushort || data is int || data is uint || data is long || data is ulong) {
|
||||||
double v = double.Parse(data?.ToString() ?? "0"); // use default culture for ToString and Parse()!
|
double v = double.Parse(data?.ToString() ?? "0"); // use default culture for ToString and Parse()!
|
||||||
if (units != null && units.Length > 0) {
|
if (units != null && units.Length > 0) {
|
||||||
int n = -1;
|
int n = -1;
|
||||||
switch (units[0]) {
|
switch (units[0]) {
|
||||||
case "%": n = 1; data = $"{v:N1}"; break;
|
case "%": n = 1; data = $"{v:N1}"; break;
|
||||||
|
case "€": n = 2; data = $"{v:N2}"; break;
|
||||||
case "°KMW": n = 1; data = $"{v:N1}"; break;
|
case "°KMW": n = 1; data = $"{v:N1}"; break;
|
||||||
case "°Oe": n = 0; data = $"{v:N0}"; break;
|
case "°Oe": n = 0; data = $"{v:N0}"; break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class DeliveryConfirmationDeliveryData : DataTable<DeliveryConfirmationDeliveryRow> {
|
public class DeliveryConfirmationDeliveryData : DataTable<DeliveryConfirmationDeliveryRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?, int)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("LsNr", "LsNr.", null, 26),
|
("LsNr", "LsNr.", null, 26),
|
||||||
("DPNr", "Pos.", null, 8),
|
("DPNr", "Pos.", null, 8),
|
||||||
("Variety", "Sorte", null, 40),
|
("Variety", "Sorte", null, 40),
|
||||||
@@ -17,7 +17,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
("Gradation", "Gradation", "°Oe|°KMW", 32),
|
("Gradation", "Gradation", "°Oe|°KMW", 32),
|
||||||
("Buckets", "Flächenbindung", "|kg", 36),
|
("Buckets", "Flächenbindung", "|kg", 36),
|
||||||
("Weight", "Gewicht", "kg", 16),
|
("Weight", "Gewicht", "kg", 16),
|
||||||
};
|
];
|
||||||
|
|
||||||
private readonly int MgNr;
|
private readonly int MgNr;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class MemberDeliveryPerVariantData : DataTable<MemberDeliveryPerVariantRow> {
|
public class MemberDeliveryPerVariantData : DataTable<MemberDeliveryPerVariantRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?, int)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("MgNr", "MgNr.", null, 12),
|
("MgNr", "MgNr.", null, 12),
|
||||||
("Name", "Name", null, 40),
|
("Name", "Name", null, 40),
|
||||||
("GivenName", "Vorname", null, 40),
|
("GivenName", "Vorname", null, 40),
|
||||||
@@ -20,7 +20,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
("Weights", "Geliefert", "kg", 22),
|
("Weights", "Geliefert", "kg", 22),
|
||||||
("Areas", "Fläche", "m²", 22),
|
("Areas", "Fläche", "m²", 22),
|
||||||
("Yields", "Ertrag", "kg/ha", 22),
|
("Yields", "Ertrag", "kg/ha", 22),
|
||||||
};
|
];
|
||||||
|
|
||||||
|
|
||||||
public MemberDeliveryPerVariantData(IEnumerable<MemberDeliveryPerVariantRow> rows, int year) :
|
public MemberDeliveryPerVariantData(IEnumerable<MemberDeliveryPerVariantRow> rows, int year) :
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class OverUnderDeliveryData : DataTable<OverUnderDeliveryRow> {
|
public class OverUnderDeliveryData : DataTable<OverUnderDeliveryRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?, int)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("MgNr", "MgNr.", null, 12),
|
("MgNr", "MgNr.", null, 12),
|
||||||
("Name", "Name", null, 40),
|
("Name", "Name", null, 40),
|
||||||
("GivenName", "Vorname", null, 40),
|
("GivenName", "Vorname", null, 40),
|
||||||
@@ -19,7 +19,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
("DeliveryRight", "Lieferrecht", "kg", 22),
|
("DeliveryRight", "Lieferrecht", "kg", 22),
|
||||||
("Weight", "Geliefert", "kg", 22),
|
("Weight", "Geliefert", "kg", 22),
|
||||||
("OverUnderDelivery", "Über-/Unterliefert", "kg|%", 34),
|
("OverUnderDelivery", "Über-/Unterliefert", "kg|%", 34),
|
||||||
};
|
];
|
||||||
|
|
||||||
public OverUnderDeliveryData(IEnumerable<OverUnderDeliveryRow> rows, int year) :
|
public OverUnderDeliveryData(IEnumerable<OverUnderDeliveryRow> rows, int year) :
|
||||||
base($"Über-Unterlieferungen", $"Über- und Unterlieferungen laut gezeichneten Geschäftsanteilen {year}", rows, FieldNames) {
|
base($"Über-Unterlieferungen", $"Über- und Unterlieferungen laut gezeichneten Geschäftsanteilen {year}", rows, FieldNames) {
|
||||||
|
|||||||
Reference in New Issue
Block a user