Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8745286860 | ||
|
|
321d22eb60 | ||
|
|
e8c159831e | ||
|
|
1d54bd749a | ||
|
|
cbda6d6563 |
@@ -1,166 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace Logof_Client;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Zentrale Datenbankverwaltung für Logof Client.
|
|
||||||
///
|
|
||||||
/// Zuständig für:
|
|
||||||
/// - PostgreSQL-Verbindung
|
|
||||||
/// - EF Core DbContext
|
|
||||||
/// - Datenbankmodelle
|
|
||||||
/// - Migrationen
|
|
||||||
/// - Verbindungstest
|
|
||||||
/// </summary>
|
|
||||||
public static class DatabseService
|
|
||||||
{
|
|
||||||
private static DbContextOptions<LogofDbContext>? _options;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initialisiert die Datenbankverbindung.
|
|
||||||
/// Sollte einmal beim Programmstart aufgerufen werden.
|
|
||||||
/// </summary>
|
|
||||||
public static void Initialize(string connectionString)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(connectionString))
|
|
||||||
throw new ArgumentException(
|
|
||||||
"Kein Datenbank-Connection-String angegeben.",
|
|
||||||
nameof(connectionString));
|
|
||||||
|
|
||||||
var builder = new DbContextOptionsBuilder<LogofDbContext>();
|
|
||||||
|
|
||||||
builder.UseNpgsql(connectionString);
|
|
||||||
|
|
||||||
_options = builder.Options;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Erstellt einen neuen DbContext.
|
|
||||||
/// </summary>
|
|
||||||
public static LogofDbContext GetContext()
|
|
||||||
{
|
|
||||||
if (_options == null)
|
|
||||||
throw new InvalidOperationException(
|
|
||||||
"DB wurde noch nicht initialisiert. " +
|
|
||||||
"Rufen Sie DB.Initialize(...) auf.");
|
|
||||||
|
|
||||||
return new LogofDbContext(_options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Testet die Verbindung zum Datenbankserver.
|
|
||||||
/// </summary>
|
|
||||||
public static async Task<bool> TestConnectionAsync()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await using var db = GetContext();
|
|
||||||
return await db.Database.CanConnectAsync();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Erstellt bzw. aktualisiert das Datenbankschema
|
|
||||||
/// anhand der vorhandenen EF-Core-Migrationen.
|
|
||||||
/// </summary>
|
|
||||||
public static async Task MigrateAsync()
|
|
||||||
{
|
|
||||||
await using var db = GetContext();
|
|
||||||
|
|
||||||
await db.Database.MigrateAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// DATABASE CONTEXT
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
public class LogofDbContext : DbContext
|
|
||||||
{
|
|
||||||
public DbSet<CustomerEx> Customers => Set<CustomerEx>();
|
|
||||||
|
|
||||||
public LogofDbContext(
|
|
||||||
DbContextOptions<LogofDbContext> options)
|
|
||||||
: base(options)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
base.OnModelCreating(modelBuilder);
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
|
||||||
// Customer
|
|
||||||
// --------------------------------------------------------------------
|
|
||||||
|
|
||||||
modelBuilder.Entity<CustomerEx>(entity =>
|
|
||||||
{
|
|
||||||
entity.ToTable("customers");
|
|
||||||
|
|
||||||
entity.HasKey(x => x.Id);
|
|
||||||
|
|
||||||
entity.Property(x => x.Id)
|
|
||||||
.ValueGeneratedOnAdd();
|
|
||||||
|
|
||||||
entity.Property(x => x.Name)
|
|
||||||
.HasMaxLength(255)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
entity.Property(x => x.Description)
|
|
||||||
.HasMaxLength(4000);
|
|
||||||
|
|
||||||
entity.Property(x => x.SenderAddress)
|
|
||||||
.HasMaxLength(4000);
|
|
||||||
|
|
||||||
entity.Property(x => x.Separator)
|
|
||||||
.HasMaxLength(1)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
// Optimistic Concurrency
|
|
||||||
entity.Property(x => x.Version)
|
|
||||||
.IsConcurrencyToken();
|
|
||||||
|
|
||||||
entity.Property(x => x.CreatedAt)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
entity.Property(x => x.UpdatedAt)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// DATABASE MODELS
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
public class CustomerEx
|
|
||||||
{
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
public string Name { get; set; } = "";
|
|
||||||
|
|
||||||
public string Description { get; set; } = "";
|
|
||||||
|
|
||||||
public string SenderAddress { get; set; } = "";
|
|
||||||
|
|
||||||
public char Separator { get; set; } = ',';
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Wird bei jeder Änderung erhöht.
|
|
||||||
/// Verhindert, dass zwei Benutzer sich gegenseitig
|
|
||||||
/// Änderungen überschreiben.
|
|
||||||
/// </summary>
|
|
||||||
public long Version { get; set; } = 1;
|
|
||||||
|
|
||||||
public DateTime CreatedAt { get; set; }
|
|
||||||
|
|
||||||
public DateTime UpdatedAt { get; set; }
|
|
||||||
}
|
|
||||||
+1
-4
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
@@ -24,9 +24,6 @@
|
|||||||
<PackageReference Include="Markdown.Avalonia" Version="11.0.3" />
|
<PackageReference Include="Markdown.Avalonia" Version="11.0.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||||
<PackageReference Include="PdfSharp" Version="6.1.1" />
|
<PackageReference Include="PdfSharp" Version="6.1.1" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.12" />
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12" />
|
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
+38
-1
@@ -21,7 +21,44 @@
|
|||||||
<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 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 IsVisible="False" x:Name="Addressmanagement">
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
|||||||
+12
-1
@@ -994,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;
|
||||||
@@ -1040,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();
|
||||||
@@ -1471,4 +1474,12 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BtnAdmgmt_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (Addressmanagement.IsVisible && Addressmanagement.IsVisible)
|
||||||
|
{
|
||||||
|
TcMain.SelectedIndex = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+73
-62
@@ -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))
|
||||||
@@ -194,7 +197,7 @@ public class PdfBuilder
|
|||||||
{
|
{
|
||||||
if (addresses == null || addresses.Count == 0)
|
if (addresses == null || addresses.Count == 0)
|
||||||
throw new ArgumentException("Addresses array cannot be null or empty");
|
throw new ArgumentException("Addresses array cannot be null or empty");
|
||||||
|
|
||||||
var document = new PdfDocument();
|
var document = new PdfDocument();
|
||||||
|
|
||||||
var addressIndex = 0;
|
var addressIndex = 0;
|
||||||
@@ -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(
|
||||||
gfx.DrawString(
|
$"{bundleOnPallet}/{options.rsBundNrPal}",
|
||||||
$"{bundleOnPallet}/{Settings._instance.pdfExport.rsBundNrPal}",
|
fontText,
|
||||||
fontText,
|
XBrushes.Black,
|
||||||
XBrushes.Black,
|
new XRect(valueX, blY4 + 4, valueW, 14),
|
||||||
new XRect(valueX, blY4 + 4, valueW, 14),
|
XStringFormats.TopRight);
|
||||||
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