Compare commits
14
Commits
522970f341
...
v1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8745286860 | ||
|
|
321d22eb60 | ||
|
|
e8c159831e | ||
|
|
1d54bd749a | ||
|
|
cbda6d6563 | ||
|
|
6ed8c0e231 | ||
|
|
59ea707007 | ||
|
|
0cce15a8f6 | ||
|
|
5f200fbeef | ||
|
|
d4f6b5beb9 | ||
|
|
7119e515e2 | ||
|
|
7ad0612170 | ||
|
|
9aa467d9f0 | ||
|
|
d53dc968de |
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Logof_Client;
|
namespace Logof_Client;
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ namespace Logof_Client;
|
|||||||
public static class SchemaMigration
|
public static class SchemaMigration
|
||||||
{
|
{
|
||||||
// Current schema version - increment when you make breaking changes
|
// Current schema version - increment when you make breaking changes
|
||||||
public const int CURRENT_SCHEMA_VERSION = 3;
|
public const int CURRENT_SCHEMA_VERSION = 4;
|
||||||
|
|
||||||
// Dictionary of migration functions, keyed by the version they migrate TO
|
// Dictionary of migration functions, keyed by the version they migrate TO
|
||||||
private static readonly Dictionary<int, Func<JObject, JObject>> Migrations = new()
|
private static readonly Dictionary<int, Func<JObject, JObject>> Migrations = new()
|
||||||
@@ -22,7 +23,7 @@ public static class SchemaMigration
|
|||||||
// { 2, MigrateV1ToV2 },
|
// { 2, MigrateV1ToV2 },
|
||||||
|
|
||||||
// Example: Migration from v2 to v3
|
// Example: Migration from v2 to v3
|
||||||
// { 3, MigrateV2ToV3 },
|
{ 4, MigrateV3ToV4 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -93,12 +94,12 @@ public static class SchemaMigration
|
|||||||
/// Example migration function: from v2 to v3.
|
/// Example migration function: from v2 to v3.
|
||||||
/// Add a new required field with a default value.
|
/// Add a new required field with a default value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static JObject MigrateV2ToV3(JObject obj)
|
private static JObject MigrateV3ToV4(JObject obj)
|
||||||
{
|
{
|
||||||
// Example: Add a new field that didn't exist before
|
// Example: Add a new field that didn't exist before
|
||||||
if (!obj.ContainsKey("new_required_field"))
|
if (!obj.ContainsKey("moduleConfig"))
|
||||||
{
|
{
|
||||||
obj["new_required_field"] = "default_value";
|
obj["moduleConfig"] = JToken.FromObject(new ModuleConfig());
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
@@ -19,6 +20,8 @@ public class Settings
|
|||||||
public Customers customers = new();
|
public Customers customers = new();
|
||||||
public PdfExportSettings pdfExport { get; set; } = new();
|
public PdfExportSettings pdfExport { get; set; } = new();
|
||||||
|
|
||||||
|
public ModuleConfig moduleConfig { get; set; } = new ModuleConfig();
|
||||||
|
|
||||||
public Settings()
|
public Settings()
|
||||||
{
|
{
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -70,6 +73,29 @@ public class Settings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ModuleConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Contains enabled modules and whether it's password-protected or not (non-existing-feature but soon)
|
||||||
|
/// </summary>
|
||||||
|
public List<(LCModule, bool)> EnabledModules = new();
|
||||||
|
public ModuleConfig()
|
||||||
|
{
|
||||||
|
EnabledModules = new List<(LCModule,bool)>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum LCModule
|
||||||
|
{
|
||||||
|
Addressmanagement,
|
||||||
|
Pricemanagement,
|
||||||
|
Wiki,
|
||||||
|
Staffmanagement,
|
||||||
|
UnifiedEndpointManagement,
|
||||||
|
Financemanagement
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class PdfExportSettings
|
public class PdfExportSettings
|
||||||
{
|
{
|
||||||
public double cellPaddingTopMm { get; set; } = 4;
|
public double cellPaddingTopMm { get; set; } = 4;
|
||||||
|
|||||||
+72
-8
@@ -6,7 +6,7 @@
|
|||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
MinWidth="1000" MinHeight="600" IsVisible="False"
|
MinWidth="1000" MinHeight="600" IsVisible="False"
|
||||||
x:Class="Logof_Client.MainWindow" WindowState="Maximized" Icon="assets/icon.ico"
|
x:Class="Logof_Client.MainWindow" WindowState="Maximized" Icon="assets/icon.ico"
|
||||||
Title="Logof Client">
|
Title="Logofclient">
|
||||||
<Border>
|
<Border>
|
||||||
<Grid RowDefinitions="30,*">
|
<Grid RowDefinitions="30,*">
|
||||||
<Menu Background="#50888888">
|
<Menu Background="#50888888">
|
||||||
@@ -21,8 +21,45 @@
|
|||||||
<MenuItem Header="Über" x:Name="MnuAbout" Click="MnuAbout_OnClick" />
|
<MenuItem Header="Über" x:Name="MnuAbout" Click="MnuAbout_OnClick" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
<TabControl Grid.Row="1">
|
<TabControl Grid.Row="1" x:Name="TcMain">
|
||||||
<TabItem>
|
<TabItem x:Name="Home">
|
||||||
|
<TabItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="House" Width="32" Height="32" Size="32" />
|
||||||
|
<!-- <Label FontSize="20" Content="Addressverwaltung" VerticalContentAlignment="Center" /> -->
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem.Header>
|
||||||
|
<Grid RowDefinitions="3*,*,100">
|
||||||
|
<StackPanel Orientation="Vertical" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" > <!-- ColumnDefinitions="*,*" -->
|
||||||
|
<Label Content="Welcome to Logofclient!" HorizontalAlignment="Center" FontSize="32" ></Label>
|
||||||
|
<Label Content="Version 1.0.1" FontSize="16" HorizontalAlignment="Center"></Label>
|
||||||
|
<!-- <Image Source="assets/calc_man.png" MaxHeight="350" VerticalAlignment="Center" HorizontalAlignment="Center" /> -->
|
||||||
|
</StackPanel>
|
||||||
|
<Grid Grid.Row="1" Margin="20" IsVisible="True" x:Name="GrdHMCalcMan">
|
||||||
|
<Image Source="assets/calc_man.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
|
</Grid>
|
||||||
|
<!-- <Grid ColumnDefinitions="*,*,*" Grid.Row="1"> -->
|
||||||
|
<StackPanel Grid.Row="2" Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center"
|
||||||
|
Margin="0,0,5,0">
|
||||||
|
<Button Width="250" HorizontalContentAlignment="Center"
|
||||||
|
Margin="0,0,0,10" IsEnabled="True" VerticalAlignment="Stretch"
|
||||||
|
x:Name="BtnAdmgmt" Click="BtnAdmgmt_OnClick">
|
||||||
|
<StackPanel Orientation="Vertical">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="MapPinHouse" Width="36" Height="36" />
|
||||||
|
<Label Content="Addressverwaltung" VerticalContentAlignment="Center" FontSize="15"
|
||||||
|
FontWeight="Bold" />
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock TextWrapping="Wrap" FontSize="9" Text="Strukturierte Verwaltung von Adressen für Pressepost-Printmailings inkl. Erstellung von Bundleitzetteln." HorizontalAlignment="Stretch" TextAlignment="Left"></TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
<!-- </Grid> -->
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem IsVisible="False" x:Name="Addressmanagement">
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="MapPinHouse" Width="32" Height="32" Size="32" />
|
<LucideIcon Kind="MapPinHouse" Width="32" Height="32" Size="32" />
|
||||||
@@ -79,6 +116,14 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</MenuItem.Header>
|
</MenuItem.Header>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
<MenuItem x:Name="MnIAdSetView" Click="MnIAdSetView_OnClick">
|
||||||
|
<MenuItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="Eye" Width="12" Height="12" Size="12" />
|
||||||
|
<Label Content="Anzeigen" VerticalContentAlignment="Center" />
|
||||||
|
</StackPanel>
|
||||||
|
</MenuItem.Header>
|
||||||
|
</MenuItem>
|
||||||
<MenuItem x:Name="MnIAdSetDelete" Click="MnIAdSetDelete_OnClick" IsEnabled="True">
|
<MenuItem x:Name="MnIAdSetDelete" Click="MnIAdSetDelete_OnClick" IsEnabled="True">
|
||||||
<MenuItem.Header>
|
<MenuItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
@@ -288,7 +333,7 @@
|
|||||||
<Label Grid.Column="0" Content="Zellenrand rechts (mm)"></Label>
|
<Label Grid.Column="0" Content="Zellenrand rechts (mm)"></Label>
|
||||||
<NumericUpDown Grid.Column="1" x:Name="NudExpMargCellPaddingRight" Minimum="0" Maximum="20" Value="5"></NumericUpDown>
|
<NumericUpDown Grid.Column="1" x:Name="NudExpMargCellPaddingRight" Minimum="0" Maximum="20" Value="5"></NumericUpDown>
|
||||||
</Grid>
|
</Grid>
|
||||||
<CheckBox Content="Laufzettel erstellen" x:Name="CbExpRnsEnable"></CheckBox>
|
<CheckBox Content="Bundleitzettel erstellen" x:Name="CbExpRnsEnable"></CheckBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Grid.Column="1" Orientation="Vertical" Spacing="10">
|
<StackPanel Grid.Column="1" Orientation="Vertical" Spacing="10">
|
||||||
@@ -388,7 +433,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem IsEnabled="False">
|
<TabItem IsEnabled="False" IsVisible="False" x:Name="Staffmanagement">
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="Users" Width="32" Height="32" Size="32" />
|
<LucideIcon Kind="Users" Width="32" Height="32" Size="32" />
|
||||||
@@ -396,7 +441,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem IsEnabled="False">
|
<TabItem IsEnabled="False" IsVisible="False" x:Name="Financemanagement">
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="BadgeEuro" Width="32" Height="32" Size="32" />
|
<LucideIcon Kind="BadgeEuro" Width="32" Height="32" Size="32" />
|
||||||
@@ -404,7 +449,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem IsEnabled="False">
|
<TabItem IsEnabled="False" IsVisible="False" x:Name="Pricemanagement">
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="ReceiptEuro" Width="32" Height="32" Size="32" />
|
<LucideIcon Kind="ReceiptEuro" Width="32" Height="32" Size="32" />
|
||||||
@@ -412,7 +457,15 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem IsEnabled="True">
|
<TabItem IsEnabled="False" IsVisible="False" x:Name="UnifiedEndpointManagement">
|
||||||
|
<TabItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="MonitorCog" Width="32" Height="32" Size="32" />
|
||||||
|
<Label FontSize="20" Content="UEM" VerticalContentAlignment="Center" />
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem.Header>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem IsEnabled="True" IsVisible="False" x:Name="Wiki">
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<LucideIcon Kind="LibraryBig" Width="32" Height="32" Size="32" />
|
<LucideIcon Kind="LibraryBig" Width="32" Height="32" Size="32" />
|
||||||
@@ -532,6 +585,17 @@
|
|||||||
<!-- </Grid> -->
|
<!-- </Grid> -->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem>
|
||||||
|
<TabItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="Puzzle" Width="16" Height="16" Size="16" />
|
||||||
|
<Label FontSize="16" Content="Module" VerticalContentAlignment="Center" />
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem.Header>
|
||||||
|
<StackPanel Orientation="Vertical" Spacing="10" x:Name="StpSettingsModules">
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
<TabItem>
|
<TabItem>
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
|||||||
+106
-1
@@ -85,8 +85,92 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
Logger.Log($"Error while doing wiki stuff: {ex.Message}", Logger.LogType.Error);
|
Logger.Log($"Error while doing wiki stuff: {ex.Message}", Logger.LogType.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach(var module in Enum.GetValues<LCModule>())
|
||||||
|
{
|
||||||
|
CheckBox b = new CheckBox
|
||||||
|
{
|
||||||
|
IsChecked = false
|
||||||
|
};
|
||||||
|
b.Click += (object sender, RoutedEventArgs e) => {
|
||||||
|
RenewModuleSettings(module, b.IsChecked);
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach(var conf in Settings._instance.moduleConfig.EnabledModules)
|
||||||
|
{
|
||||||
|
if(conf.Item1 == module)
|
||||||
|
{
|
||||||
|
b.IsChecked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label l = new Label()
|
||||||
|
{
|
||||||
|
Content = module.ToString(),
|
||||||
|
};
|
||||||
|
StpSettingsModules.Children.Add(new StackPanel()
|
||||||
|
{
|
||||||
|
Orientation = Avalonia.Layout.Orientation.Horizontal,
|
||||||
|
Children = {b,l}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(var conf in Settings._instance.moduleConfig.EnabledModules)
|
||||||
|
{
|
||||||
|
Logger.Log($"Enabling module: {conf.Item1}");
|
||||||
|
switch (conf.Item1)
|
||||||
|
{
|
||||||
|
case LCModule.Addressmanagement:
|
||||||
|
Addressmanagement.IsVisible = true;
|
||||||
|
break;
|
||||||
|
case LCModule.Pricemanagement:
|
||||||
|
Pricemanagement.IsVisible = true;
|
||||||
|
break;
|
||||||
|
case LCModule.Staffmanagement:
|
||||||
|
Staffmanagement.IsVisible = true;
|
||||||
|
break;
|
||||||
|
case LCModule.Financemanagement:
|
||||||
|
Financemanagement.IsVisible = true;
|
||||||
|
break;
|
||||||
|
case LCModule.Wiki:
|
||||||
|
Wiki.IsVisible = true;
|
||||||
|
break;
|
||||||
|
case LCModule.UnifiedEndpointManagement:
|
||||||
|
UnifiedEndpointManagement.IsVisible = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Log($"Error while applying module configuration: {ex.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RenewModuleSettings(LCModule value, bool? enabled = true)
|
||||||
|
{
|
||||||
|
if (enabled == true)
|
||||||
|
{
|
||||||
|
Settings._instance.moduleConfig.EnabledModules.Add((value,false));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
int index = -1;
|
||||||
|
foreach(var conf in Settings._instance.moduleConfig.EnabledModules)
|
||||||
|
{
|
||||||
|
if(conf.Item1 == value)
|
||||||
|
{
|
||||||
|
index = Settings._instance.moduleConfig.EnabledModules.IndexOf(conf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(index != -1)
|
||||||
|
Settings._instance.moduleConfig.EnabledModules.RemoveAt(index);
|
||||||
|
}
|
||||||
|
Settings.Save();
|
||||||
|
}
|
||||||
private async void StartAddressCheck(int addresSetID)
|
private async void StartAddressCheck(int addresSetID)
|
||||||
{
|
{
|
||||||
var progressWindow = new ProgressWindow();
|
var progressWindow = new ProgressWindow();
|
||||||
@@ -910,6 +994,7 @@ public partial class MainWindow : Window
|
|||||||
NudExpMargFontSize.Value = (decimal)options.fontSize;
|
NudExpMargFontSize.Value = (decimal)options.fontSize;
|
||||||
NudExpMargSmallFontSize.Value = (decimal)options.smallFontSize;
|
NudExpMargSmallFontSize.Value = (decimal)options.smallFontSize;
|
||||||
CbExpRnsPvSt.IsChecked = options.rsPvSt;
|
CbExpRnsPvSt.IsChecked = options.rsPvSt;
|
||||||
|
CbExpRnsEnable.IsChecked = options.exportRunningSheets;
|
||||||
|
|
||||||
TbExpRnsKNrAbs.Text = options.rsKNrAbs;
|
TbExpRnsKNrAbs.Text = options.rsKNrAbs;
|
||||||
TbExpRnsKNrEmp.Text = options.rsKNrEmp;
|
TbExpRnsKNrEmp.Text = options.rsKNrEmp;
|
||||||
@@ -956,8 +1041,10 @@ public partial class MainWindow : Window
|
|||||||
rsBundGew = TbExpRnsBundGew.Text,
|
rsBundGew = TbExpRnsBundGew.Text,
|
||||||
rsPalNr = ReadInt(NudExpRnsPalNr, 1),
|
rsPalNr = ReadInt(NudExpRnsPalNr, 1),
|
||||||
rsBundNrPal = ReadInt(NudExpRnsBundNrPal, 20),
|
rsBundNrPal = ReadInt(NudExpRnsBundNrPal, 20),
|
||||||
|
rsNumGrouped = ReadInt(NudExpRnsPlzcount, 25),
|
||||||
|
|
||||||
rsPvSt = CbExpRnsPvSt.IsChecked.Value
|
rsPvSt = CbExpRnsPvSt.IsChecked.Value,
|
||||||
|
exportRunningSheets = CbExpRnsEnable.IsChecked.Value
|
||||||
};
|
};
|
||||||
|
|
||||||
Settings.Save();
|
Settings.Save();
|
||||||
@@ -1377,4 +1464,22 @@ public partial class MainWindow : Window
|
|||||||
BtnCombineAddressSetSortUp.IsEnabled = true;
|
BtnCombineAddressSetSortUp.IsEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void MnIAdSetView_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (LstCustomerAdressSets.SelectedItems.Count > 0)
|
||||||
|
{
|
||||||
|
var preview = new PreviewWindow((LstCustomerAdressSets.SelectedItems[0] as KasAddressList).KasPersons);
|
||||||
|
preview.Show();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnAdmgmt_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (Addressmanagement.IsVisible && Addressmanagement.IsVisible)
|
||||||
|
{
|
||||||
|
TcMain.SelectedIndex = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+250
-64
@@ -3,100 +3,286 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" Icon="assets/icon.ico"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" Icon="assets/icon.ico"
|
||||||
xmlns:local="using:Logof_Client"
|
xmlns:local="using:Logof_Client" Closing="Window_OnClosing"
|
||||||
x:Class="Logof_Client.PreviewWindow"
|
x:Class="Logof_Client.PreviewWindow"
|
||||||
Title="Datensätze bearbeiten" x:DataType="local:PreviewWindow">
|
Title="Datensätze bearbeiten" x:DataType="local:PreviewWindow">
|
||||||
<Grid Grid.ColumnDefinitions="*">
|
<Grid ColumnDefinitions="*,400"
|
||||||
<ScrollViewer Grid.Column="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
Margin="10">
|
||||||
<DataGrid x:Name="AddressGrid"
|
|
||||||
ItemsSource="{Binding Addresses}"
|
|
||||||
AutoGenerateColumns="False"
|
|
||||||
IsReadOnly="False"
|
|
||||||
SelectionMode="Extended"
|
|
||||||
GridLinesVisibility="All">
|
|
||||||
|
|
||||||
<DataGrid.Columns>
|
<!-- Adressliste -->
|
||||||
|
<ListBox Grid.Column="0"
|
||||||
|
x:Name="AddressList"
|
||||||
|
ItemsSource="{Binding Addresses}"
|
||||||
|
SelectedItem="{Binding SelectedAddress}"
|
||||||
|
SelectionMode="Single">
|
||||||
|
|
||||||
<DataGridTextColumn Header="ID"
|
<ListBox.ItemsPanel>
|
||||||
Binding="{Binding id}"
|
<ItemsPanelTemplate>
|
||||||
IsReadOnly="True" />
|
<VirtualizingStackPanel />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
|
||||||
<DataGridTextColumn Header="RefSID"
|
<ListBox.ItemTemplate>
|
||||||
Binding="{Binding refsid}" />
|
<DataTemplate>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Anrede"
|
<Grid ColumnDefinitions="70,150,180,250,80,180,150"
|
||||||
Binding="{Binding anrede}" />
|
Height="32">
|
||||||
|
|
||||||
<DataGridTextColumn Header="Titel"
|
<TextBlock Grid.Column="0"
|
||||||
Binding="{Binding titel}" />
|
Text="{Binding id}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Vorname"
|
<TextBlock Grid.Column="1"
|
||||||
Binding="{Binding vorname}" />
|
Text="{Binding vorname}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Adel"
|
<TextBlock Grid.Column="2"
|
||||||
Binding="{Binding adel}" />
|
Text="{Binding name}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name"
|
<TextBlock Grid.Column="3"
|
||||||
Binding="{Binding name}" />
|
Text="{Binding strasse}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Namenszusatz"
|
<TextBlock Grid.Column="4"
|
||||||
Binding="{Binding namezus}" />
|
Text="{Binding plz}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Anredzusatz"
|
<TextBlock Grid.Column="5"
|
||||||
Binding="{Binding anredzus}" />
|
Text="{Binding ort}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Straße"
|
<TextBlock Grid.Column="6"
|
||||||
Binding="{Binding strasse}" />
|
Text="{Binding land}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Straße 2"
|
</Grid>
|
||||||
Binding="{Binding strasse2}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="PLZ"
|
</DataTemplate>
|
||||||
Binding="{Binding plz}" />
|
</ListBox.ItemTemplate>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Ort"
|
</ListBox>
|
||||||
Binding="{Binding ort}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Land"
|
|
||||||
Binding="{Binding land}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="PPLZ"
|
<!-- Editor -->
|
||||||
Binding="{Binding pplz}" />
|
<ScrollViewer Grid.Column="1"
|
||||||
|
Margin="15,0,0,0">
|
||||||
|
|
||||||
<DataGridTextColumn Header="Postfach"
|
<StackPanel Spacing="6">
|
||||||
Binding="{Binding postfach}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 1"
|
<TextBlock Text="Adresse bearbeiten"
|
||||||
Binding="{Binding name1}" />
|
FontSize="20"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Margin="0,0,0,10"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 2"
|
|
||||||
Binding="{Binding name2}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 3"
|
<Grid ColumnDefinitions="120,*"
|
||||||
Binding="{Binding name3}" />
|
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" RowSpacing="4">
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 4"
|
<TextBlock Grid.Row="0"
|
||||||
Binding="{Binding name4}" />
|
Text="ID"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.id}"
|
||||||
|
IsReadOnly="True" IsEnabled="False"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 5"
|
|
||||||
Binding="{Binding name5}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Funktion"
|
<TextBlock Grid.Row="1"
|
||||||
Binding="{Binding funktion}" />
|
Text="RefSID"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.refsid}"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Funktion 2"
|
|
||||||
Binding="{Binding funktion2}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Abteilung"
|
<TextBlock Grid.Row="2"
|
||||||
Binding="{Binding abteilung}" />
|
Text="Anrede"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="2"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.anrede}"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Funktion AD"
|
|
||||||
Binding="{Binding funktionad}" />
|
|
||||||
|
|
||||||
</DataGrid.Columns>
|
<TextBlock Grid.Row="3"
|
||||||
|
Text="Titel"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.titel}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="4"
|
||||||
|
Text="Vorname"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="4"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.vorname}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="5"
|
||||||
|
Text="Adel"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="5"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.adel}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="6"
|
||||||
|
Text="Name"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="6"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="7"
|
||||||
|
Text="Namenszusatz"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="7"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.namezus}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="8"
|
||||||
|
Text="Anredzusatz"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="8"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.anredzus}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="9"
|
||||||
|
Text="Straße"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="9"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.strasse}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="10"
|
||||||
|
Text="Straße 2"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="10"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.strasse2}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="11"
|
||||||
|
Text="PLZ"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="11"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.plz}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="12"
|
||||||
|
Text="Ort"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="12"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.ort}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="13"
|
||||||
|
Text="Land"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="13"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.land}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="14"
|
||||||
|
Text="PPLZ"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="14"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.pplz}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="15"
|
||||||
|
Text="Postfach"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="15"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.postfach}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="16"
|
||||||
|
Text="Name 1"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="16"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name1}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="17"
|
||||||
|
Text="Name 2"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="17"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name2}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="18"
|
||||||
|
Text="Name 3"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="18"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name3}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="19"
|
||||||
|
Text="Name 4"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="19"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name4}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="20"
|
||||||
|
Text="Name 5"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="20"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name5}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="21"
|
||||||
|
Text="Funktion"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="21"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.funktion}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="22"
|
||||||
|
Text="Funktion 2"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="22"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.funktion2}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="23"
|
||||||
|
Text="Abteilung"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="23"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.abteilung}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="24"
|
||||||
|
Text="Funktion AD"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="24"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.funktionad}"/>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</DataGrid>
|
|
||||||
<!-- <StackPanel x:Name="StkResults" Orientation="Vertical" Margin="10" /> -->
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
+22
-3
@@ -16,6 +16,23 @@ using System.Runtime.CompilerServices;
|
|||||||
|
|
||||||
public partial class PreviewWindow : Window, INotifyPropertyChanged
|
public partial class PreviewWindow : Window, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
public ObservableCollection<KasPerson> Addresses { get; }
|
||||||
|
|
||||||
|
private KasPerson? _selectedAddress;
|
||||||
|
|
||||||
|
public KasPerson? SelectedAddress
|
||||||
|
{
|
||||||
|
get => _selectedAddress;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_selectedAddress = value;
|
||||||
|
PropertyChanged?.Invoke(
|
||||||
|
this,
|
||||||
|
new PropertyChangedEventArgs(nameof(SelectedAddress)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
|
|
||||||
public PreviewWindow(IEnumerable<KasPerson> addresses)
|
public PreviewWindow(IEnumerable<KasPerson> addresses)
|
||||||
{
|
{
|
||||||
@@ -25,9 +42,11 @@ public partial class PreviewWindow : Window, INotifyPropertyChanged
|
|||||||
|
|
||||||
DataContext = this;
|
DataContext = this;
|
||||||
}
|
}
|
||||||
public ObservableCollection<KasPerson> Addresses { get; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void Window_OnClosing(object? sender, WindowClosingEventArgs e)
|
||||||
|
{
|
||||||
|
Settings.Save();
|
||||||
|
Global.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+76
-65
@@ -121,17 +121,18 @@ public class PdfBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// national addresses
|
// national addresses
|
||||||
for (var i = 0; i < addressSet.KasPersons.Count; i++)
|
foreach (var person in addressSet.KasPersons
|
||||||
|
.Where(person => person.IsGermany())
|
||||||
|
.OrderBy(person => person.used_plz))
|
||||||
{
|
{
|
||||||
string senderLineID = senderLine;
|
string senderLineID = senderLine;
|
||||||
if (!addressSet.KasPersons[i].IsGermany()) continue;
|
var addr = AddressCreator.CreateFinalMarkdownString(person.id);
|
||||||
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
|
||||||
if (string.IsNullOrWhiteSpace(addr)) continue;
|
if (string.IsNullOrWhiteSpace(addr)) continue;
|
||||||
if (pvst)
|
if (pvst)
|
||||||
senderLineID += $"</font6>**PvSt, DP AG, Entgelt bezahlt, ZKZ {Settings._instance.pdfExport.rsZKZ}**\n<font6>";
|
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 (person.refsid != null || person.refsid != 0)
|
||||||
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
senderLineID += $"ID: {person.refsid}\n</font6>";
|
||||||
else
|
else
|
||||||
senderLineID += "\n</font6>";
|
senderLineID += "\n</font6>";
|
||||||
if (!string.IsNullOrEmpty(senderLineID))
|
if (!string.IsNullOrEmpty(senderLineID))
|
||||||
@@ -141,17 +142,19 @@ public class PdfBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// international addresses
|
// international addresses
|
||||||
for (var i = 0; i < addressSet.KasPersons.Count; i++)
|
foreach (var person in addressSet.KasPersons
|
||||||
|
.Where(person => !person.IsGermany())
|
||||||
|
.OrderBy(person => person.land)
|
||||||
|
.ThenBy(person => person.used_plz))
|
||||||
{
|
{
|
||||||
string senderLineID = senderLine;
|
string senderLineID = senderLine;
|
||||||
if (addressSet.KasPersons[i].IsGermany()) continue;
|
var addr = AddressCreator.CreateFinalMarkdownString(person.id);
|
||||||
var addr = AddressCreator.CreateFinalMarkdownString(addressSet.KasPersons[i].id);
|
|
||||||
if (string.IsNullOrWhiteSpace(addr)) continue;
|
if (string.IsNullOrWhiteSpace(addr)) continue;
|
||||||
if (pvst)
|
if (pvst)
|
||||||
senderLineID += $"</font6>**PvSt, DP AG, Entgelt bezahlt, ZKZ {Settings._instance.pdfExport.rsZKZ}**\n<font6>";
|
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 (person.refsid != null || person.refsid != 0)
|
||||||
senderLineID += $"ID: {addressSet.KasPersons[i].refsid}\n</font6>";
|
senderLineID += $"ID: {person.refsid}\n</font6>";
|
||||||
else
|
else
|
||||||
senderLineID += "\n</font6>";
|
senderLineID += "\n</font6>";
|
||||||
if (!string.IsNullOrEmpty(senderLineID))
|
if (!string.IsNullOrEmpty(senderLineID))
|
||||||
@@ -656,13 +659,13 @@ public class PdfBuilder
|
|||||||
{
|
{
|
||||||
path = path.Substring(0, path.Length - 4);
|
path = path.Substring(0, path.Length - 4);
|
||||||
international_path = path;
|
international_path = path;
|
||||||
path = path + "-Laufzettel.pdf";
|
path = path + "-Leitzettel.pdf";
|
||||||
international_path = international_path + "-Laufzettel-International.pdf";
|
international_path = international_path + "-Leitzettel-International.pdf";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path = path + "-Laufzettel.pdf";
|
path = path + "-Leitzettel.pdf";
|
||||||
international_path = international_path + "-Laufzettel-International.pdf";
|
international_path = international_path + "-Leitzettel-International.pdf";
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateGermanyRunningSheets(setID, path);
|
CreateGermanyRunningSheets(setID, path);
|
||||||
@@ -674,7 +677,7 @@ public class PdfBuilder
|
|||||||
{
|
{
|
||||||
KasAddressList list = Settings._instance.addressSets.GetAddressSetByID(setID);
|
KasAddressList list = Settings._instance.addressSets.GetAddressSetByID(setID);
|
||||||
var document = new PdfDocument();
|
var document = new PdfDocument();
|
||||||
document.Info.Title = $"Laufzettel für {list.Name}";
|
document.Info.Title = $"Leitzettel für {list.Name}";
|
||||||
document.Info.Subject = "powered by logofclient";
|
document.Info.Subject = "powered by logofclient";
|
||||||
document.Info.Author = "logofclient";
|
document.Info.Author = "logofclient";
|
||||||
|
|
||||||
@@ -709,12 +712,14 @@ public class PdfBuilder
|
|||||||
var fontBig = new XFont("Arial", 30, XFontStyleEx.Bold);
|
var fontBig = new XFont("Arial", 30, XFontStyleEx.Bold);
|
||||||
|
|
||||||
int firstIndex = pageIndex * 2;
|
int firstIndex = pageIndex * 2;
|
||||||
int palletNumber =
|
int? palletNumber = null;
|
||||||
Settings._instance.pdfExport.rsPalNr +
|
int? bundleOnPallet = null;
|
||||||
(firstIndex / Settings._instance.pdfExport.rsBundNrPal);
|
if (Settings._instance.pdfExport.rsBundNrPal > 0)
|
||||||
|
{
|
||||||
int bundleOnPallet =
|
palletNumber = Settings._instance.pdfExport.rsPalNr +
|
||||||
(firstIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
(firstIndex / Settings._instance.pdfExport.rsBundNrPal);
|
||||||
|
bundleOnPallet = (firstIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
DrawGermanyRunningSheet(
|
DrawGermanyRunningSheet(
|
||||||
gfx,
|
gfx,
|
||||||
@@ -735,12 +740,14 @@ public class PdfBuilder
|
|||||||
|
|
||||||
int secondIndex = firstIndex + 1;
|
int secondIndex = firstIndex + 1;
|
||||||
|
|
||||||
int palletNumber2 =
|
int? palletNumber2 = null;
|
||||||
Settings._instance.pdfExport.rsPalNr +
|
int? bundleOnPallet2 = null;
|
||||||
(secondIndex / Settings._instance.pdfExport.rsBundNrPal);
|
if (Settings._instance.pdfExport.rsBundNrPal > 0)
|
||||||
|
{
|
||||||
int bundleOnPallet2 =
|
palletNumber2 = Settings._instance.pdfExport.rsPalNr +
|
||||||
(secondIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
(secondIndex / Settings._instance.pdfExport.rsBundNrPal);
|
||||||
|
bundleOnPallet2 = (secondIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (firstIndex + 1 < grouped_nums.Count)
|
if (firstIndex + 1 < grouped_nums.Count)
|
||||||
{
|
{
|
||||||
@@ -766,7 +773,7 @@ public class PdfBuilder
|
|||||||
document.Save(path);
|
document.Save(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawGermanyRunningSheet(XGraphics gfx, double x, double y, double w, double h, KasAddressList list, dynamic result, List<(int,string,string,string,int)> grouped_nums, XFont fontLabel, XFont fontText, XFont fontBig, int pal_nr, int bundleOnPallet, int totalBundleNumber)
|
private void DrawGermanyRunningSheet(XGraphics gfx, double x, double y, double w, double h, KasAddressList list, dynamic result, List<(int,string,string,string,int)> grouped_nums, XFont fontLabel, XFont fontText, XFont fontBig, int? pal_nr, int? bundleOnPallet, int totalBundleNumber)
|
||||||
{
|
{
|
||||||
double line = 1.0;
|
double line = 1.0;
|
||||||
|
|
||||||
@@ -914,20 +921,20 @@ public class PdfBuilder
|
|||||||
new XRect(valueX, blY1 + 4, valueW, 14),
|
new XRect(valueX, blY1 + 4, valueW, 14),
|
||||||
XStringFormats.TopRight);
|
XStringFormats.TopRight);
|
||||||
|
|
||||||
if (options.rsBundNrPal == null) goto nopal;
|
if (options.rsBundNrPal > 0)
|
||||||
gfx.DrawString(pal_nr.ToString(), fontText, XBrushes.Black,
|
{
|
||||||
new XRect(valueX, blY3 + 4, valueW, 14),
|
gfx.DrawString(pal_nr?.ToString() ?? string.Empty, fontText, XBrushes.Black,
|
||||||
XStringFormats.TopRight);
|
new XRect(valueX, blY3 + 4, valueW, 14),
|
||||||
|
XStringFormats.TopRight);
|
||||||
|
|
||||||
|
gfx.DrawString(
|
||||||
|
$"{bundleOnPallet}/{options.rsBundNrPal}",
|
||||||
|
fontText,
|
||||||
|
XBrushes.Black,
|
||||||
|
new XRect(valueX, blY4 + 4, valueW, 14),
|
||||||
|
XStringFormats.TopRight);
|
||||||
|
}
|
||||||
|
|
||||||
gfx.DrawString(
|
|
||||||
$"{bundleOnPallet}/{Settings._instance.pdfExport.rsBundNrPal}",
|
|
||||||
fontText,
|
|
||||||
XBrushes.Black,
|
|
||||||
new XRect(valueX, blY4 + 4, valueW, 14),
|
|
||||||
XStringFormats.TopRight);
|
|
||||||
|
|
||||||
nopal:
|
|
||||||
gfx.DrawString(
|
gfx.DrawString(
|
||||||
$"{totalBundleNumber}/{grouped_nums.Count}",
|
$"{totalBundleNumber}/{grouped_nums.Count}",
|
||||||
fontText,
|
fontText,
|
||||||
@@ -984,12 +991,14 @@ public class PdfBuilder
|
|||||||
|
|
||||||
int firstIndex = pageIndex * 2;
|
int firstIndex = pageIndex * 2;
|
||||||
|
|
||||||
int palletNumber =
|
int? palletNumber = null;
|
||||||
Settings._instance.pdfExport.rsPalNr +
|
int? bundleOnPallet = null;
|
||||||
(firstIndex / Settings._instance.pdfExport.rsBundNrPal);
|
if (Settings._instance.pdfExport.rsBundNrPal > 0)
|
||||||
|
{
|
||||||
int bundleOnPallet =
|
palletNumber = Settings._instance.pdfExport.rsPalNr +
|
||||||
(firstIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
(firstIndex / Settings._instance.pdfExport.rsBundNrPal);
|
||||||
|
bundleOnPallet = (firstIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1014,12 +1023,14 @@ public class PdfBuilder
|
|||||||
{
|
{
|
||||||
int secondIndex = firstIndex + 1;
|
int secondIndex = firstIndex + 1;
|
||||||
|
|
||||||
int palletNumber2 =
|
int? palletNumber2 = null;
|
||||||
Settings._instance.pdfExport.rsPalNr +
|
int? bundleOnPallet2 = null;
|
||||||
(secondIndex / Settings._instance.pdfExport.rsBundNrPal);
|
if (Settings._instance.pdfExport.rsBundNrPal > 0)
|
||||||
|
{
|
||||||
int bundleOnPallet2 =
|
palletNumber2 = Settings._instance.pdfExport.rsPalNr +
|
||||||
(secondIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
(secondIndex / Settings._instance.pdfExport.rsBundNrPal);
|
||||||
|
bundleOnPallet2 = (secondIndex % Settings._instance.pdfExport.rsBundNrPal) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
DrawInternationalRunningSheet(
|
DrawInternationalRunningSheet(
|
||||||
gfx,
|
gfx,
|
||||||
@@ -1042,7 +1053,7 @@ public class PdfBuilder
|
|||||||
|
|
||||||
document.Save(path);
|
document.Save(path);
|
||||||
}
|
}
|
||||||
private void DrawInternationalRunningSheet(XGraphics gfx, double x, double y, double w, double h, KasAddressList list, dynamic result, List<(int,string,string,string,int)> grouped_nums, XFont fontLabel, XFont fontText, XFont fontBig, int pal_nr, int bundleOnPallet, int totalBundleNumber, string category = "ECONOMY Non-EU")
|
private void DrawInternationalRunningSheet(XGraphics gfx, double x, double y, double w, double h, KasAddressList list, dynamic result, List<(int,string,string,string,int)> grouped_nums, XFont fontLabel, XFont fontText, XFont fontBig, int? pal_nr, int? bundleOnPallet, int totalBundleNumber, string category = "ECONOMY Non-EU")
|
||||||
{
|
{
|
||||||
double line = 1.0;
|
double line = 1.0;
|
||||||
|
|
||||||
@@ -1194,20 +1205,20 @@ public class PdfBuilder
|
|||||||
new XRect(valueX, blY2 + 4, valueW, 14),
|
new XRect(valueX, blY2 + 4, valueW, 14),
|
||||||
XStringFormats.TopRight);
|
XStringFormats.TopRight);
|
||||||
|
|
||||||
if (options.rsBundNrPal == 0) goto nopal;
|
if (options.rsBundNrPal > 0)
|
||||||
gfx.DrawString(pal_nr.ToString(), fontText, XBrushes.Black,
|
{
|
||||||
new XRect(valueX, blY3 + 4, valueW, 14),
|
gfx.DrawString(pal_nr?.ToString() ?? string.Empty, fontText, XBrushes.Black,
|
||||||
XStringFormats.TopRight);
|
new XRect(valueX, blY3 + 4, valueW, 14),
|
||||||
|
XStringFormats.TopRight);
|
||||||
|
|
||||||
|
gfx.DrawString(
|
||||||
|
$"{bundleOnPallet}/{options.rsBundNrPal}",
|
||||||
|
fontText,
|
||||||
|
XBrushes.Black,
|
||||||
|
new XRect(valueX, blY4 + 4, valueW, 14),
|
||||||
|
XStringFormats.TopRight);
|
||||||
|
}
|
||||||
|
|
||||||
gfx.DrawString(
|
|
||||||
$"{bundleOnPallet}/{Settings._instance.pdfExport.rsBundNrPal}",
|
|
||||||
fontText,
|
|
||||||
XBrushes.Black,
|
|
||||||
new XRect(valueX, blY4 + 4, valueW, 14),
|
|
||||||
XStringFormats.TopRight);
|
|
||||||
|
|
||||||
nopal:
|
|
||||||
gfx.DrawString(
|
gfx.DrawString(
|
||||||
$"{totalBundleNumber}/{grouped_nums.Count}",
|
$"{totalBundleNumber}/{grouped_nums.Count}",
|
||||||
fontText,
|
fontText,
|
||||||
|
|||||||
Reference in New Issue
Block a user