[feat:] pvst-integration (logo missing, will be in the next commits)
This commit is contained in:
@@ -69,7 +69,7 @@ public class PdfExportSettings
|
|||||||
public double smallFontSize { get; set; } = 6;
|
public double smallFontSize { get; set; } = 6;
|
||||||
public bool exportRunningSheets { get; set; } = true;
|
public bool exportRunningSheets { get; set; } = true;
|
||||||
public int rsNumGrouped { get; set; } = 25;
|
public int rsNumGrouped { get; set; } = 25;
|
||||||
public int rsPlzStartpoint { get; set; } = 2;
|
public bool rsPvSt { get; set; } = true;
|
||||||
|
|
||||||
public string rsKNrAbs { get; set; } = "";
|
public string rsKNrAbs { get; set; } = "";
|
||||||
public string rsKNrEmp { get; set; } = "";
|
public string rsKNrEmp { get; set; } = "";
|
||||||
|
|||||||
+1
-4
@@ -314,10 +314,7 @@
|
|||||||
<Label Grid.Column="0" Content="Schriftgröße (klein)"></Label>
|
<Label Grid.Column="0" Content="Schriftgröße (klein)"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudExpMargSmallFontSize" Minimum="3" Maximum="30" Value="6"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudExpMargSmallFontSize" Minimum="3" Maximum="30" Value="6"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid ColumnDefinitions="*,*">
|
<CheckBox Content="PvSt" IsChecked="True" x:Name="CbExpRnsPvSt"></CheckBox>
|
||||||
<Label Grid.Column="0" Content="Gruppierpunkt"></Label>
|
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudExpRnsPlzStartpoint" Minimum="1" Maximum="10" Value="2"></NumericUpDown>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid ColumnDefinitions="*,*" ColumnSpacing="20" Margin="10,10,10,0">
|
<Grid ColumnDefinitions="*,*" ColumnSpacing="20" Margin="10,10,10,0">
|
||||||
|
|||||||
+6
-2
@@ -888,7 +888,7 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
builder.CreateAddressLabelPdfFromAddressSetWithPlaceholder(
|
builder.CreateAddressLabelPdfFromAddressSetWithPlaceholder(
|
||||||
((KasAddressList)LstCustomerAdressSets.SelectedItem).ID,
|
((KasAddressList)LstCustomerAdressSets.SelectedItem).ID,
|
||||||
"Company Logo/Info",
|
"Company Logo/Info", Settings._instance.pdfExport.rsPvSt,
|
||||||
filePath
|
filePath
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -931,11 +931,13 @@ public partial class MainWindow : Window
|
|||||||
TbExpMargMarginBottom.Value = (decimal)options.pageMarginBottomMm;
|
TbExpMargMarginBottom.Value = (decimal)options.pageMarginBottomMm;
|
||||||
TbExpMargMarginLeft.Value = (decimal)options.pageMarginLeftMm;
|
TbExpMargMarginLeft.Value = (decimal)options.pageMarginLeftMm;
|
||||||
TbExpMargMarginRight.Value = (decimal)options.pageMarginRightMm;
|
TbExpMargMarginRight.Value = (decimal)options.pageMarginRightMm;
|
||||||
|
NudExpRnsPlzcount.Value = options.rsNumGrouped;
|
||||||
|
|
||||||
TbExpMargRowsPerPage.Value = options.rowsPerPage;
|
TbExpMargRowsPerPage.Value = options.rowsPerPage;
|
||||||
NudExpMargColumnsPerPage.Value = options.columnsPerPage;
|
NudExpMargColumnsPerPage.Value = options.columnsPerPage;
|
||||||
NudExpMargFontSize.Value = (decimal)options.fontSize;
|
NudExpMargFontSize.Value = (decimal)options.fontSize;
|
||||||
NudExpMargSmallFontSize.Value = (decimal)options.smallFontSize;
|
NudExpMargSmallFontSize.Value = (decimal)options.smallFontSize;
|
||||||
|
CbExpRnsPvSt.IsChecked = options.rsPvSt;
|
||||||
|
|
||||||
TbExpRnsKNrAbs.Text = options.rsKNrAbs;
|
TbExpRnsKNrAbs.Text = options.rsKNrAbs;
|
||||||
TbExpRnsKNrEmp.Text = options.rsKNrEmp;
|
TbExpRnsKNrEmp.Text = options.rsKNrEmp;
|
||||||
@@ -981,7 +983,9 @@ public partial class MainWindow : Window
|
|||||||
rsAMANr = TbExpRnsAMANr.Text,
|
rsAMANr = TbExpRnsAMANr.Text,
|
||||||
rsBundGew = TbExpRnsBundGew.Text,
|
rsBundGew = TbExpRnsBundGew.Text,
|
||||||
rsPalNr = ReadInt(NudExpRnsPalNr, 1),
|
rsPalNr = ReadInt(NudExpRnsPalNr, 1),
|
||||||
rsBundNrPal = ReadInt(NudExpRnsBundNrPal, 20)
|
rsBundNrPal = ReadInt(NudExpRnsBundNrPal, 20),
|
||||||
|
|
||||||
|
rsPvSt = CbExpRnsPvSt.IsChecked.Value
|
||||||
};
|
};
|
||||||
|
|
||||||
Settings.Save();
|
Settings.Save();
|
||||||
|
|||||||
+9
-3
@@ -94,7 +94,7 @@ public class PdfBuilder
|
|||||||
/// <param name="addressSetId">The ID of the AddressSet to use</param>
|
/// <param name="addressSetId">The ID of the AddressSet to use</param>
|
||||||
/// <param name="placeholderText">Text for the first cell (top-left)</param>
|
/// <param name="placeholderText">Text for the first cell (top-left)</param>
|
||||||
/// <param name="outputPath">Path where the PDF should be saved</param>
|
/// <param name="outputPath">Path where the PDF should be saved</param>
|
||||||
public void CreateAddressLabelPdfFromAddressSetWithPlaceholder(int addressSetId, string placeholderText,
|
public void CreateAddressLabelPdfFromAddressSetWithPlaceholder(int addressSetId, string placeholderText, bool pvst,
|
||||||
string outputPath)
|
string outputPath)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -138,6 +138,9 @@ public class PdfBuilder
|
|||||||
if (!addressSet.KasPersons[i].IsGermany()) continue;
|
if (!addressSet.KasPersons[i].IsGermany()) continue;
|
||||||
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
||||||
if (string.IsNullOrWhiteSpace(addr)) continue;
|
if (string.IsNullOrWhiteSpace(addr)) continue;
|
||||||
|
if (pvst)
|
||||||
|
senderLineID += $"</font6>**PvSt, DP AG, Entgelt bezahlt, ZKZ {Settings._instance.pdfExport.rsZKZ}**\n<font6>";
|
||||||
|
|
||||||
if (addressSet.KasPersons[i].refsid != null || addressSet.KasPersons[i].refsid != 0)
|
if (addressSet.KasPersons[i].refsid != null || addressSet.KasPersons[i].refsid != 0)
|
||||||
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
||||||
else
|
else
|
||||||
@@ -155,6 +158,9 @@ public class PdfBuilder
|
|||||||
if (addressSet.KasPersons[i].IsGermany()) continue;
|
if (addressSet.KasPersons[i].IsGermany()) continue;
|
||||||
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
||||||
if (string.IsNullOrWhiteSpace(addr)) continue;
|
if (string.IsNullOrWhiteSpace(addr)) continue;
|
||||||
|
if (pvst)
|
||||||
|
senderLineID += $"</font6>**PvSt, DP AG, Entgelt bezahlt, ZKZ {Settings._instance.pdfExport.rsZKZ}**\n<font6>";
|
||||||
|
|
||||||
if (addressSet.KasPersons[i].refsid != null || addressSet.KasPersons[i].refsid != 0)
|
if (addressSet.KasPersons[i].refsid != null || addressSet.KasPersons[i].refsid != 0)
|
||||||
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
||||||
else
|
else
|
||||||
@@ -458,7 +464,7 @@ public class PdfBuilder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return max > 0 ? max * 0.8 : _regularFont.GetHeight();
|
return max > 0 ? max * 0.88 : _regularFont.GetHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<List<TextRun>> WrapRunsToLines(XGraphics gfx, List<TextToken> tokens, double maxWidth)
|
private List<List<TextRun>> WrapRunsToLines(XGraphics gfx, List<TextToken> tokens, double maxWidth)
|
||||||
@@ -1246,7 +1252,7 @@ public class PdfBuilder
|
|||||||
public List<(int, string, string, string, int)> GroupAddresses(int setID)
|
public List<(int, string, string, string, int)> GroupAddresses(int setID)
|
||||||
{
|
{
|
||||||
int grpcount = Settings._instance.pdfExport.rsNumGrouped; // Amount of addresses per group
|
int grpcount = Settings._instance.pdfExport.rsNumGrouped; // Amount of addresses per group
|
||||||
int stpoint = Settings._instance.pdfExport.rsPlzStartpoint; // group starting point (first n characters of the plz)
|
int stpoint = 2; // group starting point (first n characters of the plz)
|
||||||
KasAddressList list = Settings._instance.addressSets.GetAddressSetByID(setID);
|
KasAddressList list = Settings._instance.addressSets.GetAddressSetByID(setID);
|
||||||
if (list == null)
|
if (list == null)
|
||||||
throw new Exception("AddressSet nicht gefunden");
|
throw new Exception("AddressSet nicht gefunden");
|
||||||
|
|||||||
Reference in New Issue
Block a user