diff --git a/Elwig/Documents/BusinessDocument.css b/Elwig/Documents/BusinessDocument.css index d587406..8151408 100644 --- a/Elwig/Documents/BusinessDocument.css +++ b/Elwig/Documents/BusinessDocument.css @@ -119,6 +119,11 @@ main h1 { font-size: 10pt; } +.main-wrapper p.custom { + white-space: pre-wrap; + break-inside: avoid; +} + .main-wrapper .hidden { break-before: avoid; } diff --git a/Elwig/Documents/CreditNote.cs b/Elwig/Documents/CreditNote.cs index 37001a9..9691f54 100644 --- a/Elwig/Documents/CreditNote.cs +++ b/Elwig/Documents/CreditNote.cs @@ -50,7 +50,7 @@ namespace Elwig.Documents { $"Überw. am{p.Variant.TransferDate:dd.MM.yyyy}" + $"Datum/Zeit{p.Credit?.ModifiedTimestamp:dd.MM.yyyy} / {p.Credit?.ModifiedTimestamp:HH:mm}" + $""; - Text = App.Client.TextDeliveryNote; + Text = App.Client.TextCreditNote; DocumentId = $"Tr.-Gutschr. " + (p.Credit != null ? $"{p.Credit.Year}/{p.Credit.TgNr:000}" : p.MgNr); CurrencySymbol = season.Currency.Symbol ?? season.Currency.Code; Precision = season.Precision; diff --git a/Elwig/Documents/CreditNote.cshtml b/Elwig/Documents/CreditNote.cshtml index 2510115..d73d23e 100644 --- a/Elwig/Documents/CreditNote.cshtml +++ b/Elwig/Documents/CreditNote.cshtml @@ -158,4 +158,10 @@ } +

Überweisung erfolgt auf Konto @(Elwig.Helpers.Utils.FormatIban(Model.Member.Iban ?? "-")).

+
+ @if (Model.Text != null) { +

@Model.Text

+ } +
diff --git a/Elwig/Documents/DeliveryConfirmation.cshtml b/Elwig/Documents/DeliveryConfirmation.cshtml index 1d47772..2aabaa5 100644 --- a/Elwig/Documents/DeliveryConfirmation.cshtml +++ b/Elwig/Documents/DeliveryConfirmation.cshtml @@ -92,9 +92,9 @@ @Raw(BusinessDocument.PrintSortenaufteilung(Model.MemberBuckets)) @Raw(Model.PrintBucketTable(Model.Season, Model.MemberBuckets, includePayment: true)) -
+
@if (Model.Text != null) { -

@Model.Text

+

@Model.Text

}
diff --git a/Elwig/Helpers/ClientParameters.cs b/Elwig/Helpers/ClientParameters.cs index 586b505..fdd6686 100644 --- a/Elwig/Helpers/ClientParameters.cs +++ b/Elwig/Helpers/ClientParameters.cs @@ -60,6 +60,7 @@ namespace Elwig.Helpers { public string? TextDeliveryNote; public string? TextDeliveryConfirmation; + public string? TextCreditNote; public ClientParameters(AppDbContext ctx) : this(ctx.ClientParameters.ToDictionary(e => e.Param, e => e.Value)) { } @@ -99,6 +100,8 @@ namespace Elwig.Helpers { if (TextDeliveryNote == "") TextDeliveryNote = null; TextDeliveryConfirmation = parameters.GetValueOrDefault("TEXT_DELIVERYCONFIRMATION"); if (TextDeliveryConfirmation == "") TextDeliveryConfirmation = null; + TextCreditNote = parameters.GetValueOrDefault("TEXT_CREDITNOTE"); + if (TextCreditNote == "") TextCreditNote = null; } catch { throw new KeyNotFoundException(); } @@ -133,6 +136,7 @@ namespace Elwig.Helpers { ("DOCUMENT_SENDER", Sender2), ("TEXT_DELIVERYNOTE", TextDeliveryNote), ("TEXT_DELIVERYCONFIRMATION", TextDeliveryConfirmation), + ("TEXT_CREDITNOTE", TextCreditNote), }; } diff --git a/Elwig/Helpers/Utils.cs b/Elwig/Helpers/Utils.cs index 9f15a60..cb625a8 100644 --- a/Elwig/Helpers/Utils.cs +++ b/Elwig/Helpers/Utils.cs @@ -163,7 +163,7 @@ namespace Elwig.Helpers { } public static string FormatIban(string iban) { - return Regex.Replace(iban, ".{4}", "$0 "); + return Regex.Replace(iban.Trim(), ".{4}", "$0 ").Trim(); } public static void RunBackground(string title, Func a) { diff --git a/Elwig/Windows/BaseDataWindow.xaml b/Elwig/Windows/BaseDataWindow.xaml index 5640694..c819c2c 100644 --- a/Elwig/Windows/BaseDataWindow.xaml +++ b/Elwig/Windows/BaseDataWindow.xaml @@ -535,15 +535,18 @@ - - - - + + + + + diff --git a/Elwig/Windows/BaseDataWindow.xaml.cs b/Elwig/Windows/BaseDataWindow.xaml.cs index 4a11df1..8ced44d 100644 --- a/Elwig/Windows/BaseDataWindow.xaml.cs +++ b/Elwig/Windows/BaseDataWindow.xaml.cs @@ -12,11 +12,11 @@ namespace Elwig.Windows { public BaseDataWindow() { InitializeComponent(); - RequiredInputs = new Control[] { + RequiredInputs = [ ClientNameInput, ClientNameTypeInput, ClientNameTokenInput, ClientNameShortInput, ClientAddressInput, ClientPlzInput, ClientOrtInput, - }; - ExemptInputs = new Control[] { + ]; + ExemptInputs = [ ClientNameFull, BranchIdInput, BranchNameInput, BranchPlzInput, BranchOrtInput, BranchAddressInput, BranchPhoneNrInput, BranchFaxNrInput, BranchMobileNrInput, @@ -30,7 +30,7 @@ namespace Elwig.Windows { SeasonMinKgPerBsInput.TextBox, SeasonMaxKgPerBsInput.TextBox, SeasonBsValueInput.TextBox, SeasonPenaltyPerKgInput.TextBox, SeasonPenaltyInput.TextBox, SeasonPenaltyNoneInput.TextBox, SeasonModifierIdInput, SeasonModifierNameInput, SeasonModifierRelInput.TextBox, SeasonModifierAbsInput.TextBox, - }; + ]; WineAttributeFillLowerInput.Visibility = Visibility.Hidden; WineAttributeFillLowerLabel.Visibility = Visibility.Hidden; } @@ -297,6 +297,7 @@ namespace Elwig.Windows { case 3: ModeDeliveryNoteFull.IsChecked = true; break; } TextElementDeliveryConfirmation.Text = p.TextDeliveryConfirmation; + TextElementCreditNote.Text = p.TextCreditNote; FinishInputFilling(); } @@ -322,6 +323,7 @@ namespace Elwig.Windows { p.TextDeliveryNote = TextElementDeliveryNote.Text.Length > 0 ? TextElementDeliveryNote.Text : null; p.ModeDeliveryNoteStats = (ModeDeliveryNoteNone.IsChecked == true) ? 0 : (ModeDeliveryNoteGaOnly.IsChecked == true) ? 1 : (ModeDeliveryNoteShort.IsChecked == true) ? 2 : (ModeDeliveryNoteFull.IsChecked == true) ? 3 : 2; p.TextDeliveryConfirmation = TextElementDeliveryConfirmation.Text.Length > 0 ? TextElementDeliveryConfirmation.Text : null; + p.TextCreditNote = TextElementCreditNote.Text.Length > 0 ? TextElementCreditNote.Text : null; await p.UpdateValues(); }