[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 bool exportRunningSheets { get; set; } = true;
|
||||
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 rsKNrEmp { get; set; } = "";
|
||||
|
||||
+1
-4
@@ -314,10 +314,7 @@
|
||||
<Label Grid.Column="0" Content="Schriftgröße (klein)"></Label>
|
||||
<NumericUpDown Grid.Column="1" x:Name="NudExpMargSmallFontSize" Minimum="3" Maximum="30" Value="6"></NumericUpDown>
|
||||
</Grid>
|
||||
<Grid ColumnDefinitions="*,*">
|
||||
<Label Grid.Column="0" Content="Gruppierpunkt"></Label>
|
||||
<NumericUpDown Grid.Column="1" x:Name="NudExpRnsPlzStartpoint" Minimum="1" Maximum="10" Value="2"></NumericUpDown>
|
||||
</Grid>
|
||||
<CheckBox Content="PvSt" IsChecked="True" x:Name="CbExpRnsPvSt"></CheckBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid ColumnDefinitions="*,*" ColumnSpacing="20" Margin="10,10,10,0">
|
||||
|
||||
+6
-2
@@ -888,7 +888,7 @@ public partial class MainWindow : Window
|
||||
|
||||
builder.CreateAddressLabelPdfFromAddressSetWithPlaceholder(
|
||||
((KasAddressList)LstCustomerAdressSets.SelectedItem).ID,
|
||||
"Company Logo/Info",
|
||||
"Company Logo/Info", Settings._instance.pdfExport.rsPvSt,
|
||||
filePath
|
||||
);
|
||||
|
||||
@@ -931,11 +931,13 @@ public partial class MainWindow : Window
|
||||
TbExpMargMarginBottom.Value = (decimal)options.pageMarginBottomMm;
|
||||
TbExpMargMarginLeft.Value = (decimal)options.pageMarginLeftMm;
|
||||
TbExpMargMarginRight.Value = (decimal)options.pageMarginRightMm;
|
||||
NudExpRnsPlzcount.Value = options.rsNumGrouped;
|
||||
|
||||
TbExpMargRowsPerPage.Value = options.rowsPerPage;
|
||||
NudExpMargColumnsPerPage.Value = options.columnsPerPage;
|
||||
NudExpMargFontSize.Value = (decimal)options.fontSize;
|
||||
NudExpMargSmallFontSize.Value = (decimal)options.smallFontSize;
|
||||
CbExpRnsPvSt.IsChecked = options.rsPvSt;
|
||||
|
||||
TbExpRnsKNrAbs.Text = options.rsKNrAbs;
|
||||
TbExpRnsKNrEmp.Text = options.rsKNrEmp;
|
||||
@@ -981,7 +983,9 @@ public partial class MainWindow : Window
|
||||
rsAMANr = TbExpRnsAMANr.Text,
|
||||
rsBundGew = TbExpRnsBundGew.Text,
|
||||
rsPalNr = ReadInt(NudExpRnsPalNr, 1),
|
||||
rsBundNrPal = ReadInt(NudExpRnsBundNrPal, 20)
|
||||
rsBundNrPal = ReadInt(NudExpRnsBundNrPal, 20),
|
||||
|
||||
rsPvSt = CbExpRnsPvSt.IsChecked.Value
|
||||
};
|
||||
|
||||
Settings.Save();
|
||||
|
||||
+9
-3
@@ -94,7 +94,7 @@ public class PdfBuilder
|
||||
/// <param name="addressSetId">The ID of the AddressSet to use</param>
|
||||
/// <param name="placeholderText">Text for the first cell (top-left)</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)
|
||||
{
|
||||
try
|
||||
@@ -138,6 +138,9 @@ public class PdfBuilder
|
||||
if (!addressSet.KasPersons[i].IsGermany()) continue;
|
||||
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
||||
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)
|
||||
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
||||
else
|
||||
@@ -155,6 +158,9 @@ public class PdfBuilder
|
||||
if (addressSet.KasPersons[i].IsGermany()) continue;
|
||||
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
||||
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)
|
||||
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
||||
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)
|
||||
@@ -1246,7 +1252,7 @@ public class PdfBuilder
|
||||
public List<(int, string, string, string, int)> GroupAddresses(int setID)
|
||||
{
|
||||
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);
|
||||
if (list == null)
|
||||
throw new Exception("AddressSet nicht gefunden");
|
||||
|
||||
Reference in New Issue
Block a user