From 5f85b75c22fad1db289edfbc53c3930fa74e66d4 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 13 Jul 2026 22:40:08 +0200 Subject: [PATCH] added improvements on set proces and minor other improvements --- Fuchs.Tests/Fuchs.Tests.csproj | 2 +- Fuchs.Tests/InvoiceOptionsTests.cs | 9 +- Fuchs.Tests/ProcessWebComServiceTests.cs | 16 +- .../Controllers/IntranetController.Banking.cs | 46 ++ .../IntranetController.Invoices2.cs | 10 +- Fuchs/Fuchs.csproj | 2 +- Fuchs/Services/IComService.cs | 2 +- Fuchs/Services/InvoiceDraftEditService.cs | 51 ++- Fuchs/Services/ProcessWebComService.cs | 34 +- Fuchs/Services/ProcessWebComSettings.cs | 3 + Fuchs/Services/ReminderDraftEditService.cs | 20 +- Fuchs/appsettings.json | 1 + Fuchs/code/FdsInvoiceData.cs | 8 +- Fuchs/code/FuchsPdf.cs | 416 +++++++++++------- Fuchs/code/InvoiceSetPricing.cs | 7 +- Fuchs/js/intranet/modules/fis.bam.js | 31 ++ Fuchs/js/intranet/modules/fis.bam_txt_de.js | 13 +- Fuchs/js/intranet/modules/fis.inv_shared.js | 108 ++++- Fuchs/js/intranet/modules/fis.inv_shared.scss | 18 + Fuchs/js/intranet/modules/fis.inv_txt_de.js | 14 +- Fuchs/js/intranet/modules/fis.req_txt_de.js | 2 + Fuchs/js/intranet/oci_basic.js | 10 +- Fuchs/js/intranet/oci_main.js | 2 + Fuchs/wwwroot/web/fis.bam.de.js | 44 +- Fuchs/wwwroot/web/fis.bam.de.min.js | 2 +- Fuchs/wwwroot/web/fis.inv.css | 17 + Fuchs/wwwroot/web/fis.inv.de.js | 124 +++++- Fuchs/wwwroot/web/fis.inv.de.min.js | 2 +- Fuchs/wwwroot/web/fis.inv.min.css | 2 +- Fuchs/wwwroot/web/fis.js | 12 +- Fuchs/wwwroot/web/fis.min.js | 2 +- Fuchs/wwwroot/web/fis.req.css | 17 + Fuchs/wwwroot/web/fis.req.de.js | 124 +++++- Fuchs/wwwroot/web/fis.req.de.min.js | 2 +- Fuchs/wwwroot/web/fis.req.min.css | 2 +- Fuchs/wwwroot/web/fisb.js | 10 +- Fuchs/wwwroot/web/fisb.min.js | 2 +- Fuchs/wwwroot/web/tools.js | 5 +- Fuchs_Database/FuchsDatabase.sqlproj | 3 + .../Stored Procedures/fds__createReminder.sql | 6 +- .../fds__getBankingtransaction_manual.sql | 24 + .../fds__getBankingtransaction_manual_1.sql | 25 ++ .../fds__getBankingtransfers_questionable.sql | 3 +- .../Stored Procedures/fds__getReminder.sql | 1 + .../Stored Procedures/fds__prepInvoice.sql | 21 +- .../fds__prepStorno_recreate.sql | 26 +- .../fds__setBankingtransaction_manual.sql | 64 +++ .../mfr__updt__companies.sql | 8 +- .../mfr__updt__serviceobjects.sql | 8 +- .../mfr__updt__servicerequests.sql | 18 +- .../mfr__updt__steplisttemplates.sql | 2 +- .../Stored Procedures/mfr__updt__steps.sql | 44 +- .../fds__tt__mfr_items+.sql | 29 ++ .../fds__tt__reminder_core.sql | 51 +-- MFR_RESTClient/MFR_RESTClient.csproj | 2 +- 55 files changed, 1170 insertions(+), 357 deletions(-) create mode 100644 Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual.sql create mode 100644 Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual_1.sql create mode 100644 Fuchs_Database/dbo/Stored Procedures/fds__setBankingtransaction_manual.sql create mode 100644 Fuchs_Database/dbo/User Defined Types/fds__tt__mfr_items+.sql diff --git a/Fuchs.Tests/Fuchs.Tests.csproj b/Fuchs.Tests/Fuchs.Tests.csproj index 1e28bd3..4a92f47 100644 --- a/Fuchs.Tests/Fuchs.Tests.csproj +++ b/Fuchs.Tests/Fuchs.Tests.csproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Fuchs.Tests/InvoiceOptionsTests.cs b/Fuchs.Tests/InvoiceOptionsTests.cs index d6f91c5..0d2d246 100644 --- a/Fuchs.Tests/InvoiceOptionsTests.cs +++ b/Fuchs.Tests/InvoiceOptionsTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Fuchs.intranet; @@ -31,8 +31,11 @@ public class InvoiceOptionsTests => Assert.Equal("", InvoiceOptionsFor(new { type = "r" })); [Fact] - public void DefaultSetPrice_OmitsToken() - => Assert.Equal("", InvoiceOptionsFor(new { type = "r", setmode = "setprice" })); + public void ExplicitDefaultSetPrice_EmitsToken() + // An explicit choice of the default mode must still be persisted — otherwise it is + // indistinguishable from an invoice that was never switched to set-pricing at all + // (the editor relies on this to hide the "Set-Preisanzeige" menu entry once chosen). + => Assert.Equal("setmode:setprice", InvoiceOptionsFor(new { type = "r", setmode = "setprice" })); [Theory] [InlineData("itemprices", "setmode:itemprices")] diff --git a/Fuchs.Tests/ProcessWebComServiceTests.cs b/Fuchs.Tests/ProcessWebComServiceTests.cs index ce94512..fbfeb77 100644 --- a/Fuchs.Tests/ProcessWebComServiceTests.cs +++ b/Fuchs.Tests/ProcessWebComServiceTests.cs @@ -141,7 +141,7 @@ public class ProcessWebComServiceTests Assert.True(result); Assert.Equal(1, handler.CallCount); var json = JObject.Parse(handler.LastRequestBody!); - Assert.Equal("dev-inbox@example.test", json["recipient"]!.ToString()); + Assert.Equal("dev-inbox@example.test", json["communication"]!["to"]!.ToString()); } [Fact] @@ -153,7 +153,7 @@ public class ProcessWebComServiceTests await svc.SendEmailAsync("inv_ov2", "Rechnung 123", "

hi

", "realcustomer@example.de", "Kunde"); var json = JObject.Parse(handler.LastRequestBody!); - string subject = json["subject"]!.ToString(); + string subject = json["communication"]!["subject"]!.ToString(); Assert.Contains("realcustomer@example.de", subject); Assert.Contains("Rechnung 123", subject); } @@ -169,7 +169,7 @@ public class ProcessWebComServiceTests Assert.True(result); Assert.Equal(1, handler.CallCount); var json = JObject.Parse(handler.LastRequestBody!); - Assert.Equal("dev-inbox@example.test", json["recipient"]!.ToString()); + Assert.Equal("dev-inbox@example.test", json["communication"]!["to"]!.ToString()); } [Fact] @@ -181,7 +181,7 @@ public class ProcessWebComServiceTests await svc.SendEmailAsync("inv_ov4", "Subject", "

hi

", "realcustomer@example.de", "Kunde"); var json = JObject.Parse(handler.LastRequestBody!); - Assert.Equal("realcustomer@example.de", json["recipient"]!.ToString()); + Assert.Equal("realcustomer@example.de", json["communication"]!["to"]!.ToString()); } // ── Override enforcement across every real appsettings*.json environment ─── @@ -194,9 +194,9 @@ public class ProcessWebComServiceTests // hand-typed literal - so a future edit that silently breaks the override key // or its value in any appsettings*.json file would fail this test. // - // Note: this API has a single "recipient" field - there is no distinct + // Note: this API has a single "communication.to" field - there is no distinct // to/cc/bcc concept anywhere in the codebase (see ProcessWebComService. - // SendEmailAsync / payload.recipient). "to/cc/bcc cleared" is therefore fully + // SendEmailAsync / communication.to). "to/cc/bcc cleared" is therefore fully // satisfied by asserting that field no longer carries the original recipient // once an override is configured. public static IEnumerable AppSettingsEnvironments() @@ -236,7 +236,7 @@ public class ProcessWebComServiceTests Assert.True(result); Assert.Equal(1, handler.CallCount); var json = JObject.Parse(handler.LastRequestBody!); - string sentRecipient = json["recipient"]!.ToString(); + string sentRecipient = json["communication"]!["to"]!.ToString(); if (!string.IsNullOrWhiteSpace(overrideRecipient)) { @@ -266,7 +266,7 @@ public class ProcessWebComServiceTests Assert.True(result); Assert.NotNull(handler.LastRequestBody); var json = JObject.Parse(handler.LastRequestBody!); - var att = (JArray)json["attachments"]!; + var att = (JArray)json["communication"]!["attachments"]!; Assert.Single(att); Assert.Equal("Rechnung.pdf", att[0]!["filename"]!.ToString()); Assert.Equal("application/pdf", att[0]!["mimeType"]!.ToString()); diff --git a/Fuchs/Controllers/IntranetController.Banking.cs b/Fuchs/Controllers/IntranetController.Banking.cs index f979740..292e16d 100644 --- a/Fuchs/Controllers/IntranetController.Banking.cs +++ b/Fuchs/Controllers/IntranetController.Banking.cs @@ -222,6 +222,52 @@ public partial class IntranetController : StatusCode(500, new { error = "not successful" }); } + case "man": + { + var pl = StdParamlist( + SQL_VarChar("@taID", Form("taID"), dbNull_IfEmpty: true), + SQL_Date("@ValueDate", Form("ValueDate")), + SQL_Decimal("@Amount", Form("Amount"), precision: 9, scale: 2), + SQL_NVarChar("@NameOfPayer", Form("NameOfPayer"), dbNull_IfEmpty: true), + SQL_VarChar("@SepaRemittanceInformation", Form("SepaRemittanceInformation"), dbNull_IfEmpty: true)); + await getSQLDatatable_async( + "EXECUTE [dbo].[fds__setBankingtransaction_manual] @taID, @ValueDate, @Amount, @NameOfPayer, @SepaRemittanceInformation, @authuser;", + _intranet.Intranet__SQLConnectionString, pl, + Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogInformation( + "Manual banking transaction upserted taID={TaID} user={User}", Form("taID"), UserAccountID); + return await JSONAsync(new { ok = true }); + } + + case "mget": + { + if (!HasForm("taid")) return BadRequest400(); + var pl = StdParamlist(SQL_VarChar("@taID", Form("taid"), dbNull_IfEmpty: true)); + var res = await getSQLDatatable_async( + "EXECUTE [dbo].[fds__getBankingtransaction_manual] @taID, @authuser;", + _intranet.Intranet__SQLConnectionString, pl, + Security: DbSec, options: SqlOpt(fn, id, code)); + return await JSONAsync(res.FirstRow.toObjectDictionary()); + } + + case "mdel": + { + if (!HasForm("taid")) return BadRequest400(); + var pl = StdParamlist( + SQL_VarChar("@taID", Form("taid"), dbNull_IfEmpty: true), + SQL_Date("@ValueDate", (string?)null), + SQL_Decimal("@Amount", (string?)null, precision: 9, scale: 2), + SQL_NVarChar("@NameOfPayer", null, dbNull_IfEmpty: true), + SQL_VarChar("@SepaRemittanceInformation", null, dbNull_IfEmpty: true)); + await getSQLDatatable_async( + "EXECUTE [dbo].[fds__setBankingtransaction_manual] @taID, @ValueDate, @Amount, @NameOfPayer, @SepaRemittanceInformation, @authuser;", + _intranet.Intranet__SQLConnectionString, pl, + Security: DbSec, options: SqlOpt(fn, id, code)); + _logger.LogInformation( + "Manual banking transaction deleted taID={TaID} user={User}", Form("taid"), UserAccountID); + return await JSONAsync(new { ok = true }); + } + case "vfi": { if (!HasForm("invid")) return BadRequest400(); diff --git a/Fuchs/Controllers/IntranetController.Invoices2.cs b/Fuchs/Controllers/IntranetController.Invoices2.cs index 041e34c..9d7ead3 100644 --- a/Fuchs/Controllers/IntranetController.Invoices2.cs +++ b/Fuchs/Controllers/IntranetController.Invoices2.cs @@ -78,9 +78,17 @@ public partial class IntranetController var ldic = BuildInvoiceRequestList(sqldset); var adminDic = sqldset.Table("admin").FirstRow.toObjectDictionary(); var invDic = sqldset.Table("inv").FirstRow.toObjectDictionary(); - bool has13b = invDic.nz("InvoiceOptions", "").Split(',').Contains("§13b"); + string invoiceOptions = invDic.nz("InvoiceOptions", ""); + bool has13b = invoiceOptions.Split(',').Contains("§13b"); if (has13b) adminDic["p13b"] = true; + // Carry the persisted set-pricing mode forward (see InvoiceSetPricing.cs / FdsInvoiceData.BuildInvoiceOptions): + // needed so the editor knows the invoice has already been explicitly switched to a set-display + // mode (including the default "setprice") and hides the "Set-Preisanzeige" menu entry accordingly. + string? setmodeToken = invoiceOptions.Split(',') + .FirstOrDefault(t => t.StartsWith("setmode:", StringComparison.OrdinalIgnoreCase)); + if (setmodeToken != null) + adminDic["setmode"] = setmodeToken["setmode:".Length..].Trim().ToLowerInvariant(); _logger.LogDebug("HandleInvoiceGet invoiceId={InvoiceId} requestCount={ReqCount} has13b={Has13b} user={User}", invoiceId, ldic.Count, has13b, UserAccountID); return await JSONAsync(new { admin = adminDic, inv = invDic, req = ldic }); diff --git a/Fuchs/Fuchs.csproj b/Fuchs/Fuchs.csproj index 4207fe6..9169063 100644 --- a/Fuchs/Fuchs.csproj +++ b/Fuchs/Fuchs.csproj @@ -38,7 +38,7 @@ - + diff --git a/Fuchs/Services/IComService.cs b/Fuchs/Services/IComService.cs index 5e5dd1f..d7880ad 100644 --- a/Fuchs/Services/IComService.cs +++ b/Fuchs/Services/IComService.cs @@ -2,7 +2,7 @@ /// /// Abstraction for outbound communication: email and SMS. -/// Backed by the ProcessWeb Mailer API (POST /api/mailer?fn=push_com). +/// Backed by the ProcessWeb Mailer API (POST {BaseUrl}/mailer/push_com). /// public interface IComService { diff --git a/Fuchs/Services/InvoiceDraftEditService.cs b/Fuchs/Services/InvoiceDraftEditService.cs index 323b824..c4ba38e 100644 --- a/Fuchs/Services/InvoiceDraftEditService.cs +++ b/Fuchs/Services/InvoiceDraftEditService.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using System.Text.RegularExpressions; using Fuchs.intranet; using Microsoft.Extensions.Logging; @@ -247,10 +247,53 @@ public sealed class InvoiceDraftEditService : IInvoiceDraftService block_net = session.Sums.NetByBlock }, validation = session.ValidationMessages.Select(v => new { field = v.Field, severity = v.Severity, message = v.Message }), - historyCount = session.History.Count + historyCount = session.History.Count, + notes = BuildNotes(session), + setDisplay = BuildSetDisplay(session) }; } + /// + /// Authoritative per-item set-pricing display flags (ADR 0006/set-pricing): for every block + /// that contains a "set" item, runs the same the PDF + /// uses (keyed by admin.setmode) and returns a flat map of item id → whether its + /// price/total should be shown and whether it is a set header. The online editor applies + /// this to the rendered rows so it always matches the PDF without duplicating the pricing + /// rules client-side. + /// + private static Dictionary BuildSetDisplay(InvoiceDraftSession session) + { + var result = new Dictionary(); + var mode = InvoiceSetPricing.ParseMode(Str(session.Admin["setmode"])); + foreach (var blockTok in session.Req) + { + if (blockTok is not JObject block || block["items"] is not JArray itemsArr) continue; + List>? items = itemsArr.ToObject>>(); + if (items == null || !InvoiceSetPricing.ContainsSets(items)) continue; + + foreach (var line in InvoiceSetPricing.Build(items, mode)) + { + if (string.IsNullOrEmpty(line.Id)) continue; + result[line.Id] = new { p = line.ShowPrice, h = line.IsSetHeader }; + } + } + return result; + } + + /// + /// Renders the backend-authoritative notice paragraphs (see ) + /// for the editor's read-only preview — the same text the PDF will show, generated from the + /// same builder, so the two can never drift apart. + /// + private IEnumerable BuildNotes(InvoiceDraftSession session) + { + var fds = BuildFdsData(session); + fds.InvoiceRegistration = SynthesizeRegistration(session); + bool p13b = AsBool(session.Admin["p13b"]); + return FuchsPdf.BuildInvoiceNotes(new FuchsPdf.FdsTextBlocks(), fds, p13b) + .Select(n => new { text = n.Text, style = n.Style }); + } + public IReadOnlyList GetHistory(string token) => _cache.Get(token)?.History ?? (IReadOnlyList)Array.Empty(); @@ -385,7 +428,9 @@ public sealed class InvoiceDraftEditService : IInvoiceDraftService var tokens = new List(); if (AsBool(session.Admin["p13b"])) tokens.Add("§13b"); string setmode = Str(session.Admin["setmode"]).Trim().ToLowerInvariant(); - if (setmode is "itemprices" or "setonly") tokens.Add("setmode:" + setmode); + // Mirrors FdsInvoiceData.BuildInvoiceOptions: persist any explicitly-chosen mode + // (including the default "setprice") so it is distinguishable from "never touched". + if (setmode is "setprice" or "itemprices" or "setonly") tokens.Add("setmode:" + setmode); return string.Join(",", tokens); } diff --git a/Fuchs/Services/ProcessWebComService.cs b/Fuchs/Services/ProcessWebComService.cs index 982a718..39a6e50 100644 --- a/Fuchs/Services/ProcessWebComService.cs +++ b/Fuchs/Services/ProcessWebComService.cs @@ -14,7 +14,7 @@ namespace Fuchs.Services; /// /// Outbound communication service backed by the ProcessWeb Mailer API -/// (POST https://api.processweb.de/api/mailer?fn=push_com). +/// (POST https://api.processweb.de/mailer/push_com). /// When ProcessWebComSettings.Enabled is false the service /// only logs the intended communication without calling the API. /// @@ -105,10 +105,9 @@ public class ProcessWebComService : IComService }) .ToArray(); - var payload = new + var communication = new { - comType = "email", - recipient = email, + to = email, subject, body, attachments = attachmentPayload @@ -117,7 +116,7 @@ public class ProcessWebComService : IComService _logger.LogDebug("SendEmailAsync ref={Reference} to={Email} attachments={Count}", reference, email, attachmentPayload.Length); - var (ok, responseBody) = await PostToApiAsync("push_com", payload); + var (ok, responseBody) = await PostToApiAsync(reference, "e", communication); if (ok) { success = true; @@ -166,14 +165,13 @@ public class ProcessWebComService : IComService try { - var payload = new + var communication = new { - comType = "sms", - recipient = mobile, - body = message + to = mobile, + body = message }; - var (ok, responseBody) = await PostToApiAsync("push_com", payload); + var (ok, responseBody) = await PostToApiAsync(mobile, "s", communication); if (ok) { FuchsTelemetry.SmsSent.Add(1); @@ -193,10 +191,20 @@ public class ProcessWebComService : IComService // ── Private helpers ──────────────────────────────────────────────────────── - private async Task<(bool ok, string body)> PostToApiAsync(string fn, object payload) + private async Task<(bool ok, string body)> PostToApiAsync(string reference, string comtype, object communication) { var client = _httpClientFactory.CreateClient("ProcessWebMailer"); - var json = JsonConvert.SerializeObject(payload); + + // The Mailer API expects a fixed envelope: { serverid, comtype, communication, reference }. + // "communication" carries the actual channel-specific payload (to/subject/body/attachments). + var payload = new + { + serverid = _settings.ServerId, + comtype, + communication, + reference + }; + var json = JsonConvert.SerializeObject(payload); var content = new StringContent(json, Encoding.UTF8, "application/json"); string credentials = Convert.ToBase64String( @@ -204,7 +212,7 @@ public class ProcessWebComService : IComService client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", credentials); - var response = await client.PostAsync($"{_settings.BaseUrl}/api/mailer?fn={fn}", content); + var response = await client.PostAsync($"{_settings.BaseUrl}/mailer/push_com", content); string responseBody = await response.Content.ReadAsStringAsync(); return (response.IsSuccessStatusCode, responseBody); } diff --git a/Fuchs/Services/ProcessWebComSettings.cs b/Fuchs/Services/ProcessWebComSettings.cs index a2cde25..2eba3ea 100644 --- a/Fuchs/Services/ProcessWebComSettings.cs +++ b/Fuchs/Services/ProcessWebComSettings.cs @@ -14,6 +14,9 @@ public class ProcessWebComSettings /// API token used for HTTP Basic authentication. public string Token { get; set; } = ""; + /// Server identifier assigned by ProcessWeb, sent as "serverid" in every push_com call. + public string ServerId { get; set; } = ""; + /// /// When false (default) the service is disabled and only logs the /// intended communication without actually calling the API. diff --git a/Fuchs/Services/ReminderDraftEditService.cs b/Fuchs/Services/ReminderDraftEditService.cs index 3a51d34..709678a 100644 --- a/Fuchs/Services/ReminderDraftEditService.cs +++ b/Fuchs/Services/ReminderDraftEditService.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using Fuchs.intranet; using Microsoft.Extensions.Logging; using MigraDoc.DocumentObjectModel; @@ -159,10 +159,24 @@ public sealed class ReminderDraftEditService : IReminderDraftService amount_open = session.Sums.AmountOpen }, validation = session.ValidationMessages.Select(v => new { field = v.Field, severity = v.Severity, message = v.Message }), - historyCount = session.History.Count + historyCount = session.History.Count, + notes = BuildNotes(session) }; } + /// + /// Renders the backend-authoritative intro/closing notice paragraphs (see + /// ) for the editor's read-only preview — the same + /// text the PDF will show, generated from the same builder, so the two can never drift apart. + /// + private object BuildNotes(ReminderDraftSession session) + { + var fds = BuildReminderData(session); + fds.ReminderRegistration = SynthesizeRegistration(session); + var (intro, closing) = FuchsPdf.BuildReminderNotes(new FuchsPdf.FdsTextBlocks(), fds); + return new { intro, closing }; + } + public IReadOnlyList GetHistory(string token) => _cache.Get(token)?.History ?? (IReadOnlyList)Array.Empty(); @@ -250,6 +264,8 @@ public sealed class ReminderDraftEditService : IReminderDraftService ["SendToAddress"] = Str(session.New["invoiceaddress"]), ["SendToEmail"] = Str(session.New["invoiceemail"]), ["InvoiceId"] = invoiceId, + ["amount"] = session.Sums.AmountTotal, + ["amount_payed"] = session.Sums.AmountPayed, ["amount_open"] = session.Sums.AmountOpen, ["PaymentTerm"] = Str(session.Rem["paymentterm"]), ["invoices"] = invoices, diff --git a/Fuchs/appsettings.json b/Fuchs/appsettings.json index d546cb8..d158d8b 100644 --- a/Fuchs/appsettings.json +++ b/Fuchs/appsettings.json @@ -44,6 +44,7 @@ "BaseUrl": "https://api.processweb.de", "AccountId": "82d87114-c8c3-4d33-95e5-4c781a9229ab", "Token": "MANAGED_BY_KEYVAULT", + "ServerId": "87AAB12E-29E0-47AB-8DD1-5F5D49B4AC2E", "Enabled": false }, "Email": { diff --git a/Fuchs/code/FdsInvoiceData.cs b/Fuchs/code/FdsInvoiceData.cs index 1b99afb..b7c1bc9 100644 --- a/Fuchs/code/FdsInvoiceData.cs +++ b/Fuchs/code/FdsInvoiceData.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using Microsoft.Data.SqlClient; using Newtonsoft.Json.Linq; using static OCORE.OCORE_dictionaries; @@ -171,7 +171,11 @@ public class FdsInvoiceData var tokens = new List(); if (Admin?.no("p13b", false) is true) tokens.Add("§13b"); string setmode = (Admin?.nz("setmode") ?? "").Trim().ToLowerInvariant(); - if (setmode is "itemprices" or "setonly") tokens.Add("setmode:" + setmode); + // Persist any explicitly-chosen mode, including the default "setprice" — otherwise an + // explicit user choice of the default is indistinguishable from an invoice that was never + // switched to set-pricing at all (needed so the editor can hide the "Set-Preisanzeige" + // menu entry once a mode has been chosen; see InvoiceDraftEditService.BuildInvoiceOptions). + if (setmode is "setprice" or "itemprices" or "setonly") tokens.Add("setmode:" + setmode); return string.Join(",", tokens); } diff --git a/Fuchs/code/FuchsPdf.cs b/Fuchs/code/FuchsPdf.cs index dab23eb..a2121e9 100644 --- a/Fuchs/code/FuchsPdf.cs +++ b/Fuchs/code/FuchsPdf.cs @@ -112,21 +112,40 @@ public static class FuchsPdf "Kreissparkasse D\u00fcsseldorf", "IBAN: DE52 3015 0200 0002 0914 78", "BIC: WELADED1KSD", "Stadtsparkasse D\u00fcsseldorf", "IBAN: DE76 3005 0110 0045 0148 00", "BIC: DUSSDEDDXXX" }; + // Reminder greeting/intro, keyed by the actual reminder type (f = Zahlungserinnerung, + // m = Mahnung, l = letzte außergerichtliche Mahnung) — the single source of truth for + // both the PDF (ApplyReminder) and the online editor (via BuildReminderNotes). public Dictionary ReminderTexts_before { get; } = new() { ["f"] = new[] { "Sehr geehrte Damen und Herren,", - "wir erlauben uns, Sie auf die nachfolgende offene Rechnung aufmerksam zu machen." + "ein Mahnschreiben sollte kurz, freundlich und erfolgreich sein. Kurz ist es, freundlich sowieso; ob es auch erfolgreich ist, h\u00e4ngt von Ihnen ab." }, - ["s"] = new[] { + ["m"] = new[] { "Sehr geehrte Damen und Herren,", - "trotz unserer Ersten Mahnung haben wir bis heute noch keinen Zahlungseingang feststellen k\u00f6nnen. " + - "Wir bitten Sie, den offenen Betrag inkl. der Mahnzinsen und Mahnkosten umgehend auf unser Konto zu \u00fcberweisen." + "nun m\u00fcssen wir Sie noch einmal anschreiben.", + "Wahrscheinlich haben Sie triftige Gr\u00fcnde daf\u00fcr, warum Sie die Zahlung unserer Forderung nicht vornehmen und auch nicht auf unsere Mahnung reagieren. Sollten wir dar\u00fcber nicht einmal sprechen?", + "Bitte nehmen Sie umgehend in dieser Sache mit uns Kontakt auf." }, - ["l"] = Array.Empty() + ["l"] = new[] { + "Sehr geehrte Damen und Herren,", + "Eine DRITTE MAHNUNG zu erhalten bereitet Ihnen bestimmt ebenso wenig Freude wie uns, sie zu verschicken. Leider haben wir auf unsere zweite Mahnung noch keine Antwort von Ihnen erhalten.", + "Wir bitten Sie, den offenen Betrag innerhalb der n\u00e4chsten 7 Werktage nach Erhalt dieses Schreibens zu begleichen. Nach Ablauf dieser Frist erfolgt keine weitere Mahnung mehr.", + "Sollte die Forderung bis dahin nicht beglichen sein, er\u00f6ffnen wir das gerichtliche Mahnverfahren. Sollten Sie die Rechnung inzwischen beglichen haben, so betrachten Sie bitte dieses Schreiben als gegenstandslos." + } + }; + + /// Extra closing sentence appended for reminder type m (Mahnung) — f's closing is generated + /// dynamically (amount/IBAN + "gegenstandslos"); l gets no extra closing note. + public Dictionary ReminderClosingExtra { get; } = new() + { + ["m"] = "Um Ihnen zus\u00e4tzliche Kosten f\u00fcr weitere Mahnungen zu ersparen, bitten wir Sie nunmehr um die \u00dcberweisung des noch zu zahlenden Gesamtbetrages inklusive der ggf. bereits f\u00e4lligen Mahnzinsen und Mahngeb\u00fchren innerhalb von einer Woche." }; } + /// One notice/explanatory paragraph, as rendered both in the PDF and the online editor. + public sealed record PdfNote(string Text, string Style = "InvoiceNotes"); + // ── Currency / parse helpers ─────────────────────────────────────────────── public static string Currency(object? input, string returnobject = "?") { @@ -529,7 +548,7 @@ public static class FuchsPdf ParagraphFormat ClonePf() { var pf = doc.Styles["Normal"]!.ParagraphFormat.Clone(); - pf.Borders.Distance = 3; + pf.Borders.Distance = 0; pf.Alignment = ParagraphAlignment.Left; return pf; } @@ -557,145 +576,21 @@ public static class FuchsPdf AddStyle(doc, "InvoiceNotes_ucb", "InvoiceNotes", s => s.Font = new Font(tgtFont, 9) { Bold = true }); } - // ── ApplyInvoice ────────────────────────────────────────────────────────── - public static void ApplyInvoice(Document doc, FdsTextBlocks tb, FdsInvoiceData inv, bool draft = false) + /// + /// Builds the ordered list of standard invoice notice paragraphs (ported from legacy + /// fuchs_fds_pdf.vb) — pure data, no MigraDoc dependency, so it can be reused by both + /// and the online editor's draft view-state (ADR: notice texts + /// are backend-authoritative — the editor renders exactly what the PDF will show). + /// + public static List BuildInvoiceNotes(FdsTextBlocks tb, FdsInvoiceData inv, bool p13b) { - string invoiceType = inv.InvoiceType; - bool p13b = inv.InvoiceRegistration?.getString("InvoiceOptions") - .Split(',').Contains("§13b") ?? false; - Apply_Invoice_Styles(doc); - - var sec = doc.Sections.Cast
().First(); - sec.PageSetup.RightMargin = cm(1.5); - - // Title - { - var p = sec.AddParagraph(); - p.Style = "SubjectBig"; - p.Format.SpaceBefore = cm(8.65); - p.AddText($"{inv.InvoiceTitle} Nr. {inv.InvoiceId}"); - p.Format.SpaceAfter = cm(0.5); - } - - // Provision location - if (inv.ProvisionLocation.Length > 0) - { - var p = sec.AddParagraph(); - p.Style = "AddressBox"; - p.Format.Font.Size = 10; - p.Format.LineSpacingRule = LineSpacingRule.Exactly; - p.Format.LineSpacing = 12; - p.AddFormattedText(tb.ProvisionLoc_Label, TextFormat.Bold); - p.AddLineBreak(); - foreach (string t in inv.ProvisionLocation) { p.AddText(t); p.AddLineBreak(); } - } - sec.AddParagraph().Format.SpaceBefore = cm(0.7); - - // Invoice items table - var tbl = sec.AddTable(); - tbl.Style = "Table"; - tbl.Format.SpaceBefore = mm(1); tbl.Format.SpaceAfter = mm(1); - tbl.Borders.Color = Colors.White; tbl.Borders.Width = 0.25; - tbl.Borders.Left.Width = 0.5; tbl.Borders.Right.Width = 0.5; - tbl.Rows.LeftIndent = 0; tbl.Rows.Height = cm(0.6); - tbl.Rows.HeightRule = RowHeightRule.AtLeast; - - double pageW = sec.PageSetup.PageWidth.Centimeter - - sec.PageSetup.LeftMargin.Centimeter - - sec.PageSetup.RightMargin.Centimeter; - double[] colWidths = { pageW * 0.06, pageW * 0.42, pageW * 0.12, pageW * 0.18, pageW * 0.22 }; - foreach (double w in colWidths) tbl.AddColumn(cm(w)); - - // Header row - string[] headers = { "Pos.", "Bezeichnung", "Menge", "Einzelpreis", "Gesamtpreis" }; - var hRow = tbl.AddRow(); - hRow.Shading = GrayShading(); - for (int i = 0; i < headers.Length; i++) - { - var p = hRow.Cells[i].AddParagraph(); p.Style = "TblCell_Head"; - p.AddFormattedText(headers[i], TextFormat.Bold); - hRow.Cells[i].Format.Alignment = i >= 2 ? ParagraphAlignment.Right : ParagraphAlignment.Left; - } - - // Data rows — grouped by service-request block (see FdsInvoiceData.InvoiceBlocks). - // Per the product decision the PDF must mirror the online editor exactly: each section - // prints its heading, every position shows its own price, and positions are numbered the - // same way the editor numbers them (every line except free-text/heading lines, including a - // set header). Set-display collapsing is honoured only for the explicit SetOnly mode; every - // other mode renders the items flat, so nothing is silently blanked or renumbered. - var setMode = InvoiceSetPricing.ModeFromInvoiceOptions(inv.InvoiceRegistration?.getString("InvoiceOptions")); - int pos = 0; - foreach (var block in inv.InvoiceBlocks) - { - if (!string.IsNullOrWhiteSpace(block.Heading)) - { - var hr = tbl.AddRow(); - hr.HeightRule = RowHeightRule.Auto; - hr.Cells[1].MergeRight = 3; // span Bezeichnung … Gesamtpreis - hr.Cells[1].AddParagraph().WithStyle("TblCell_RTitle").AddFormattedText(block.Heading, TextFormat.Bold); - } - - var lines = setMode == SetDisplayMode.SetOnly && InvoiceSetPricing.ContainsSets(block.Items) - ? InvoiceSetPricing.Build(block.Items, SetDisplayMode.SetOnly) // only this mode collapses members - : block.Items.Select(MapItemToLine).ToList(); // flat: faithful mirror of the editor - - foreach (var line in lines) - { - bool numbered = line.IsSetHeader || line.ShowPrice; // free-text/heading lines carry no number - var row = tbl.AddRow(); - row.HeightRule = RowHeightRule.Auto; - row.Cells[0].AddParagraph(numbered ? (++pos).ToString() : "").Style = "TblCell_Base"; - if (!string.IsNullOrEmpty(line.Title)) // skip the empty paragraph that added a blank line before free text - { - var titleCell = row.Cells[1].AddParagraph(); - titleCell.Style = "TblCell_RTitle"; - if (line.IsSetHeader) titleCell.AddFormattedText(line.Title, TextFormat.Bold); - else titleCell.AddText(line.Title); - } - if (!string.IsNullOrEmpty(line.Desc)) row.Cells[1].AddHtml($"
{line.Desc}
"); - row.Cells[2].AddParagraph(line.Qty).Style = "TblCell_Base"; - row.Cells[3].AddParagraph(line.ShowPrice ? Currency(line.PriceNet) : "").Style = "TblCell_Base"; - row.Cells[4].AddParagraph(line.ShowPrice ? Currency(line.TotalNet) : "").Style = "TblCell_RSum"; - row.Cells[2].Format.Alignment = ParagraphAlignment.Right; - row.Cells[3].Format.Alignment = ParagraphAlignment.Right; - row.Cells[4].Format.Alignment = ParagraphAlignment.Right; - } - } - - // Totals - void TotalRow(string label, string value, string style = "TblCell_TSum", bool topBorder = false) - { - var r = tbl.AddRow(); r.Shading = LightShading(); - if (topBorder) r.Borders.Top.Width = 0.5; - var lp = r.Cells[3].AddParagraph(); lp.Style = style; lp.AddText(label); - r.Cells[3].Format.Alignment = ParagraphAlignment.Left; - var vp = r.Cells[4].AddParagraph(); vp.Style = style; vp.AddText(value); - r.Cells[4].Format.Alignment = ParagraphAlignment.Right; - } - - ParseDec(inv.InvoiceRegistration?.getItem("InvoiceBalance_net"), out decimal netSum); - TotalRow("Nettobetrag:", Currency(netSum), "TblCell_TNet", topBorder: true); - - // VAT rows - foreach (var vr in inv.VatRows) - { - string pct = vr.Key; - ParseDec(vr.Value.no("vat_amount", 0), out decimal vatAmt); - TotalRow($"MwSt. {pct}%:", Currency(vatAmt), "TblCell_TVat"); - } - - ParseDec(inv.InvoiceRegistration?.getItem("InvoiceBalance"), out decimal gross); - TotalRow("Rechnungsbetrag:", Currency(gross), "TblCell_TSum"); - - - // ── Standard invoice notes (ported from legacy fuchs_fds_pdf.vb) ────────── - var reg = inv.InvoiceRegistration; + var notes = new List(); void Note(string text, string style = "InvoiceNotes") { - if (string.IsNullOrEmpty(text)) return; - var np = sec.AddParagraph(); np.Style = style; np.AddText(text); + if (!string.IsNullOrEmpty(text)) notes.Add(new PdfNote(text, style)); } + var reg = inv.InvoiceRegistration; ParseDec(reg?.getItem("InvoiceService"), out decimal invService); string serviceGross = Currency(reg?.getItem("InvoiceService")); @@ -772,8 +667,179 @@ public static class FuchsPdf "die Umwelt zu schützen. Deshalb konzentrieren wir uns auf die Aufforstung von Flächen."); Note("Wir bedanken uns herzlich für Ihren Auftrag."); + return notes; + } + + /// + /// Builds the reminder intro/closing notice paragraphs (greeting + closing bank/amount and + /// "gegenstandslos"/Mahnzinsen sentences), keyed by the actual reminder type. Pure data — no + /// MigraDoc dependency — reused by and the online editor's draft + /// view-state so the editor shows exactly what the PDF will show. + /// + public static (string[] Intro, string[] Closing) BuildReminderNotes(FdsTextBlocks tb, FdsReminderData rem) + { + string rtype = rem.ReminderType; + string[] intro = tb.ReminderTexts_before.TryGetValue(rtype, out var i) ? i : Array.Empty(); + + ParseDec(rem.ReminderRegistration?.getItem("amount_open"), out decimal openTotal); + string terms = TranslatePaymentTerm(rem.ReminderRegistration?.getString("PaymentTerm") ?? ""); + + var closing = new List(); + switch (rtype) + { + case "f": + closing.Add( + $"Bitte überweisen Sie den offenen Betrag von {Currency(openTotal)} innerhalb von {terms} auf unser Konto:\n" + + "IBAN: DE76\u00a03005\u00a00110\u00a00045\u00a00148\u00a000, BIC DUSSSDEDDXXX (Stadtsparkasse Düsseldorf)"); + closing.Add("Sollten Sie den Betrag bereits überwiesen haben, so bitten wir Sie, diese Zahlungserinnerung als gegenstandslos zu betrachten."); + break; + default: + if (tb.ReminderClosingExtra.TryGetValue(rtype, out var extra)) closing.Add(extra); + break; + } + return (intro, closing.ToArray()); + } + + // ── ApplyInvoice ────────────────────────────────────────────────────────── + public static void ApplyInvoice(Document doc, FdsTextBlocks tb, FdsInvoiceData inv, bool draft = false) + { + string invoiceType = inv.InvoiceType; + bool p13b = inv.InvoiceRegistration?.getString("InvoiceOptions") + .Split(',').Contains("§13b") ?? false; + Apply_Invoice_Styles(doc); + + var sec = doc.Sections.Cast
().First(); + sec.PageSetup.RightMargin = cm(1.5); + + // Title + { + var p = sec.AddParagraph(); + p.Style = "SubjectBig"; + p.Format.SpaceBefore = cm(8.65); + p.AddText($"{inv.InvoiceTitle} Nr. {inv.InvoiceId}"); + p.Format.SpaceAfter = cm(0.5); + } + + // Provision location + if (inv.ProvisionLocation.Length > 0) + { + var p = sec.AddParagraph(); + p.Style = "AddressBox"; + p.Format.Font.Size = 10; + p.Format.LineSpacingRule = LineSpacingRule.Exactly; + p.Format.LineSpacing = 12; + p.AddFormattedText(tb.ProvisionLoc_Label, TextFormat.Bold); + p.AddLineBreak(); + foreach (string t in inv.ProvisionLocation) { p.AddText(t); p.AddLineBreak(); } + } + sec.AddParagraph().Format.SpaceBefore = cm(0.7); + + // Invoice items table + var tbl = sec.AddTable(); + tbl.Style = "Table"; + tbl.Format.SpaceBefore = mm(1); tbl.Format.SpaceAfter = mm(1); + tbl.Borders.Color = Colors.White; tbl.Borders.Width = 0.25; + tbl.Borders.Left.Width = 0.5; tbl.Borders.Right.Width = 0.5; + tbl.Rows.LeftIndent = 0; tbl.Rows.Height = cm(0.6); + tbl.Rows.HeightRule = RowHeightRule.AtLeast; + + double pageW = sec.PageSetup.PageWidth.Centimeter + - sec.PageSetup.LeftMargin.Centimeter + - sec.PageSetup.RightMargin.Centimeter; + double[] colWidths = { pageW * 0.06, pageW * 0.42, pageW * 0.12, pageW * 0.18, pageW * 0.22 }; + foreach (double w in colWidths) tbl.AddColumn(cm(w)); + + // Header row + string[] headers = { "Pos.", "Bezeichnung", "Menge", "Einzelpreis", "Gesamtpreis" }; + var hRow = tbl.AddRow(); + hRow.Shading = GrayShading(); + for (int i = 0; i < headers.Length; i++) + { + var p = hRow.Cells[i].AddParagraph(); p.Style = "TblCell_Head"; + p.AddFormattedText(headers[i], TextFormat.Bold); + hRow.Cells[i].Format.Alignment = i >= 2 ? ParagraphAlignment.Right : ParagraphAlignment.Left; + } + + // Data rows — grouped by service-request block (see FdsInvoiceData.InvoiceBlocks). + // Each section prints its heading; positions are numbered the same way the editor numbers + // them (every line except free-text/heading lines, including a set header). The chosen + // set-display mode (see INVOICE_SET_PRICING.md) governs how "set" items and their members + // are shown: SetPrice (default) prices the set, blanks members; ItemPrices prices the + // members, blanks the set heading; SetOnly prices the set and drops the members entirely. + // Blocks without any set items are unaffected and always render flat. + var setMode = InvoiceSetPricing.ModeFromInvoiceOptions(inv.InvoiceRegistration?.getString("InvoiceOptions")); + int pos = 0; + foreach (var block in inv.InvoiceBlocks) + { + if (!string.IsNullOrWhiteSpace(block.Heading)) + { + var hr = tbl.AddRow(); + hr.HeightRule = RowHeightRule.Auto; + hr.Cells[1].MergeRight = 3; // span Bezeichnung … Gesamtpreis + hr.Cells[1].AddParagraph().WithStyle("TblCell_RTitle").AddFormattedText(block.Heading, TextFormat.Bold); + } + + var lines = InvoiceSetPricing.ContainsSets(block.Items) + ? InvoiceSetPricing.Build(block.Items, setMode) + : block.Items.Select(MapItemToLine).ToList(); // no sets: flat, faithful mirror of the editor + + foreach (var line in lines) + { + bool numbered = line.IsSetHeader || line.ShowPrice; // free-text/heading lines carry no number + var row = tbl.AddRow(); + row.HeightRule = RowHeightRule.Auto; + row.Cells[0].AddParagraph(numbered ? (++pos).ToString() : "").Style = "TblCell_Base"; + if (!string.IsNullOrEmpty(line.Title)) // skip the empty paragraph that added a blank line before free text + { + var titleCell = row.Cells[1].AddParagraph(); + titleCell.Style = "TblCell_RTitle"; + if (line.IsSetHeader) titleCell.AddFormattedText(line.Title, TextFormat.Bold); + else titleCell.AddText(line.Title); + } + if (!string.IsNullOrEmpty(line.Desc)) row.Cells[1].AddHtml($"
{line.Desc}
"); + row.Cells[2].AddParagraph(line.Qty).Style = "TblCell_Base"; + row.Cells[3].AddParagraph(line.ShowPrice ? Currency(line.PriceNet) : "").Style = "TblCell_Base"; + row.Cells[4].AddParagraph(line.ShowPrice ? Currency(line.TotalNet) : "").Style = "TblCell_RSum"; + row.Cells[2].Format.Alignment = ParagraphAlignment.Right; + row.Cells[3].Format.Alignment = ParagraphAlignment.Right; + row.Cells[4].Format.Alignment = ParagraphAlignment.Right; + } + } + + // Totals + void TotalRow(string label, string value, string style = "TblCell_TSum", bool topBorder = false) + { + var r = tbl.AddRow(); r.Shading = LightShading(); + if (topBorder) r.Borders.Top.Width = 0.5; + var lp = r.Cells[3].AddParagraph(); lp.Style = style; lp.AddText(label); + r.Cells[3].Format.Alignment = ParagraphAlignment.Left; + var vp = r.Cells[4].AddParagraph(); vp.Style = style; vp.AddText(value); + r.Cells[4].Format.Alignment = ParagraphAlignment.Right; + } + + ParseDec(inv.InvoiceRegistration?.getItem("InvoiceBalance_net"), out decimal netSum); + TotalRow("Nettobetrag:", Currency(netSum), "TblCell_TNet", topBorder: true); + + // VAT rows + foreach (var vr in inv.VatRows) + { + string pct = vr.Key; + ParseDec(vr.Value.no("vat_amount", 0), out decimal vatAmt); + TotalRow($"MwSt. {pct}%:", Currency(vatAmt), "TblCell_TVat"); + } + + ParseDec(inv.InvoiceRegistration?.getItem("InvoiceBalance"), out decimal gross); + TotalRow("Rechnungsbetrag:", Currency(gross), "TblCell_TSum"); + + + // ── Standard invoice notes (ported from legacy fuchs_fds_pdf.vb) ────────── + foreach (var note in BuildInvoiceNotes(tb, inv, p13b)) + { + var np = sec.AddParagraph(); np.Style = note.Style; np.AddText(note.Text); + } + // GiroCode payment QR (only on finalized invoices with a positive balance) - ParseDec(reg?.getItem("InvoiceBalance"), out decimal payAmount); + ParseDec(inv.InvoiceRegistration?.getItem("InvoiceBalance"), out decimal payAmount); if (!inv.IsDraft && payAmount > 0 && !string.IsNullOrWhiteSpace(inv.InvoiceId)) AddGirocode(sec, payAmount, $"{inv.InvoiceTitle.ne("Rechnung")} {inv.InvoiceId}"); } @@ -795,31 +861,37 @@ public static class FuchsPdf p.AddText(rem.ReminderTitle.ne("Zahlungserinnerung")); } + var (introLines, closingLines) = BuildReminderNotes(tb, rem); + // Opening text - if (tb.ReminderTexts_before.TryGetValue(rtype, out var intro)) + if (introLines.Length > 0) { var p = sec.AddParagraph(); p.Style = "BodyText"; p.Format.SpaceBefore = cm(0.5); - foreach (string line in intro) { p.AddText(line); p.AddLineBreak(); } + foreach (string line in introLines) { p.AddText(line); p.AddLineBreak(); } } + sec.AddParagraph().Format.SpaceBefore = cm(0.7); - // Reminder items table + // Reminder items table — mirrors the online editor's remHR columns exactly + // (Rechnung, vom, Rechnungsbetrag, bereits bezahlt, noch offen). var tbl = sec.AddTable(); tbl.Style = "Table"; + tbl.Format.SpaceBefore = mm(1); tbl.Format.SpaceAfter = mm(1); tbl.Borders.Color = Colors.White; tbl.Borders.Width = 0.25; + tbl.Borders.Left.Width = 0.5; tbl.Borders.Right.Width = 0.5; tbl.Rows.LeftIndent = 0; tbl.Rows.Height = cm(0.6); tbl.Rows.HeightRule = RowHeightRule.AtLeast; - tbl.Format.SpaceBefore = mm(4); double pageW = sec.PageSetup.PageWidth.Centimeter - sec.PageSetup.LeftMargin.Centimeter - sec.PageSetup.RightMargin.Centimeter; + tbl.AddColumn(cm(pageW * 0.20)); tbl.AddColumn(cm(pageW * 0.15)); - tbl.AddColumn(cm(pageW * 0.45)); - tbl.AddColumn(cm(pageW * 0.20)); - tbl.AddColumn(cm(pageW * 0.20)); + tbl.AddColumn(cm(pageW * 0.22)); + tbl.AddColumn(cm(pageW * 0.21)); + tbl.AddColumn(cm(pageW * 0.22)); - string[] headers = { "Datum", "Bezeichnung", "Betrag", "Offen" }; + string[] headers = { "Rechnung", "vom", "Rechnungsbetrag", "bereits bezahlt", "noch offen" }; var hRow = tbl.AddRow(); hRow.Shading = GrayShading(); for (int i = 0; i < headers.Length; i++) { @@ -828,33 +900,39 @@ public static class FuchsPdf hRow.Cells[i].Format.Alignment = i >= 2 ? ParagraphAlignment.Right : ParagraphAlignment.Left; } - foreach (var itm in rem.ReminderItems) - { - var row = tbl.AddRow(); row.HeightRule = RowHeightRule.Auto; - row.Cells[0].AddParagraph(itm.nz("InvoiceDate", "")); - row.Cells[1].AddParagraph(itm.nz("DocumentName", "").ne(itm.nz("InvoiceTitle", ""))); - row.Cells[2].AddParagraph(Currency(itm.no("InvoiceBalance", 0))); - row.Cells[3].AddParagraph(Currency(itm.no("amount_open", 0))); - row.Cells[2].Format.Alignment = ParagraphAlignment.Right; - row.Cells[3].Format.Alignment = ParagraphAlignment.Right; - } + ParseDec(rem.ReminderRegistration?.getItem("amount"), out decimal amountTotal); + ParseDec(rem.ReminderRegistration?.getItem("amount_payed"), out decimal amountPayed); + ParseDec(rem.ReminderRegistration?.getItem("amount_open"), out decimal openTotal); + string invoiceDate = rem.ReminderRegistration?.getString("InvoiceDate") is { Length: > 0 } d + && DateTime.TryParse(d, out var dd) ? dd.ToString("dd.MM.yy") : ""; + + var row = tbl.AddRow(); row.HeightRule = RowHeightRule.Auto; + row.Cells[0].AddParagraph(rem.InvoiceId); + row.Cells[1].AddParagraph(invoiceDate); + row.Cells[2].AddParagraph(Currency(amountTotal)); + row.Cells[3].AddParagraph(Currency(amountPayed)); + row.Cells[4].AddParagraph(Currency(openTotal)); + for (int i = 2; i <= 4; i++) row.Cells[i].Format.Alignment = ParagraphAlignment.Right; // Open total - ParseDec(rem.ReminderRegistration?.getItem("amount_open"), out decimal openTotal); var sumRow = tbl.AddRow(); sumRow.Shading = LightShading(); sumRow.Borders.Top.Width = 0.5; - sumRow.Cells[2].AddParagraph().AddFormattedText("Offener Betrag:", TextFormat.Bold); - var sv = sumRow.Cells[3].AddParagraph(); + sumRow.Cells[3].AddParagraph().AddFormattedText("Offener Betrag:", TextFormat.Bold); + var sv = sumRow.Cells[4].AddParagraph(); sv.AddFormattedText(Currency(openTotal), TextFormat.Bold); - sumRow.Cells[3].Format.Alignment = ParagraphAlignment.Right; + sumRow.Cells[4].Format.Alignment = ParagraphAlignment.Right; // Closing text + QR code - var closing = sec.AddParagraph(); closing.Style = "BodyText"; - closing.Format.SpaceBefore = cm(0.8); - string terms = TranslatePaymentTerm(rem.ReminderRegistration?.getString("PaymentTerm") ?? ""); - closing.AddText( - $"Bitte \u00fcberweisen Sie den offenen Betrag von {Currency(openTotal)} innerhalb von {terms} auf unser Konto:\n" + - "IBAN: DE76\u00a03005\u00a00110\u00a00045\u00a00148\u00a000, BIC DUSSSDEDDXXX (Stadtsparkasse D\u00fcsseldorf)"); + if (closingLines.Length > 0) + { + var closing = sec.AddParagraph(); closing.Style = "BodyText"; + closing.Format.SpaceBefore = cm(0.8); + for (int i = 0; i < closingLines.Length; i++) + { + if (i > 0) closing.AddLineBreak(); + closing.AddText(closingLines[i]); + } + } // GiroCode payment QR (only on finalized reminders with a positive open amount) if (!rem.IsDraft && openTotal > 0 && !string.IsNullOrWhiteSpace(rem.InvoiceId)) diff --git a/Fuchs/code/InvoiceSetPricing.cs b/Fuchs/code/InvoiceSetPricing.cs index d4da348..c8d993f 100644 --- a/Fuchs/code/InvoiceSetPricing.cs +++ b/Fuchs/code/InvoiceSetPricing.cs @@ -1,4 +1,4 @@ -using static OCORE.commons; +using static OCORE.commons; using static OCORE.OCORE_dictionaries; namespace Fuchs.intranet; @@ -22,6 +22,9 @@ public enum SetDisplayMode /// A resolved invoice display line (after applying the set display mode). public sealed class InvoiceSetLine { + /// The source item's id — lets callers (e.g. the online editor) map a resolved + /// display line back to the DOM row it should update. + public string Id { get; init; } = ""; public string Title { get; init; } = ""; public string Desc { get; init; } = ""; public string Qty { get; init; } = "1"; @@ -156,6 +159,7 @@ public static class InvoiceSetPricing private static InvoiceSetLine HeaderLine(Dictionary i, decimal setTotal, bool showPrice) => new() { + Id = i.nz("id", ""), Title = i.nz("title", ""), Desc = i.nz("desc", ""), Qty = i.nz("qty", "1"), @@ -171,6 +175,7 @@ public static class InvoiceSetPricing FuchsPdf.ParseDec(i.no("total_net", 0), out decimal total); return new InvoiceSetLine { + Id = i.nz("id", ""), Title = i.nz("title", ""), Desc = i.nz("desc", ""), Qty = i.nz("qty", "1"), diff --git a/Fuchs/js/intranet/modules/fis.bam.js b/Fuchs/js/intranet/modules/fis.bam.js index 486ba7e..8a8dc9a 100644 --- a/Fuchs/js/intranet/modules/fis.bam.js +++ b/Fuchs/js/intranet/modules/fis.bam.js @@ -36,11 +36,16 @@ let $bam = { let fds = bool(ix.fds, false), id = ix.taID, m = []; m.push({ lbl: $bct.smd, fnc: () => { $bam.smd(id); } }); m.push({ lbl: $bct.ati, fnc: () => { $bam.ati(id); } }); + if (bool(ix.IsManual, false) === true) { + m.push({ lbl: $bct.mbc, fnc: () => { $bam.mbc(id); } }); + m.push({ lbl: $bct.mbd, fnc: () => { $bam.mbd(id); } }); + } return $('#topbar').ocmsmenu(m); }, eM : (r, re, opt) => { let m = []; if ($fis.isAuth('fds_bam', 2) === true) { m.push({ lbl: $bct.upl, fnc: $bam.ubs}); + m.push({ lbl: $bct.mbe, fnc: $bam.mbe}); } if (bool(r, false) === true) { m.push({ lbl: $bct.rel, fnc: $bam.renderLst }); @@ -312,6 +317,32 @@ let $bam = { } } }); + }, mbe: () => { + $bam.manForm({}); + }, mbc: (taid) => { + $ocms.postXT({ + url: $ocms.url('bam/mget'), data: { taid: taid }, success: (dta) => { + $bam.manForm(dta || {}); + } + }); + }, mbd: (taid) => { + if (confirm($bct.mbdc)) { + $ocms.postXT({ + url: $ocms.url('bam/mdel'), data: { taid: taid }, success: () => { + $bam.renderLst(); + } + }); + } + }, manForm: (dta) => { + let flds = $bcol.man.clone().applyValues(dta || {}); + $ocms.dlgform(flds, { + title: (ne(dta.taID, '') !== '') ? $bct.mbc : $bct.mbe, + url: $ocms.url('bam/man'), + typedvalues: true, + success: () => { + $bam.renderLst(); + } + }); } } diff --git a/Fuchs/js/intranet/modules/fis.bam_txt_de.js b/Fuchs/js/intranet/modules/fis.bam_txt_de.js index b42e792..86a6808 100644 --- a/Fuchs/js/intranet/modules/fis.bam_txt_de.js +++ b/Fuchs/js/intranet/modules/fis.bam_txt_de.js @@ -18,10 +18,21 @@ }, in: 'Rechnungsnummer', bt: 'Buchungstexte', - bv: 'Buchungswert (volle €)' + bv: 'Buchungswert (volle €)', + mbe: 'Manuelle Buchung erfassen', + mbc: 'Manuelle Buchung ändern', + mbd: 'Manuelle Buchung löschen', + mbdc: 'Manuelle Buchung wirklich löschen?\nDieser Vorgang kann nicht rückgängig gemacht werden.' }; let $bcol = { + man: new fields_definition('Manuelle Buchung', 'Manuelle Buchungen', [ + { name: 'taID', type: 'hidden' }, + { name: 'ValueDate', label: 'Valuta', type: 'date', required: true }, + { name: 'Amount', label: 'Betrag', type: 'number', precision: '0.01', required: true }, + { name: 'NameOfPayer', label: 'Name', type: 'string' }, + { name: 'SepaRemittanceInformation', label: 'Verwendungszweck', type: 'string' } + ]), qtl: new fields_definition('Kontobericht', 'Kontoberichte', [ { name: 'InvoiceId', label: 'RechnungsNr', type: 'string' }, { name: 'ValueDate', label: 'Valuta', type: 'date' }, diff --git a/Fuchs/js/intranet/modules/fis.inv_shared.js b/Fuchs/js/intranet/modules/fis.inv_shared.js index 63dfc82..b278842 100644 --- a/Fuchs/js/intranet/modules/fis.inv_shared.js +++ b/Fuchs/js/intranet/modules/fis.inv_shared.js @@ -82,6 +82,11 @@ $inv.iMn = (ix) => { } return $('#topbar').ocmsmenu(m); } +/* Menu option CSV builder: 'setm' (Set-Preisanzeige) is only offered while the invoice has not + yet been explicitly switched to a set-display mode (admin.setmode empty/undefined) — once set, + changing it again is not supported (the user edits the line items directly instead); it + reappears only if 'Änderungen verwerfen' reverts to a DB state that was never switched. */ +$inv.emOpt = (admin) => 'iss,p13b,ctp' + (((admin || {}).setmode || '') === '' ? ',setm' : ''); $inv.eM = (r, re, opt) => { let m = []; if (booln(r, false) === true || booln(re, false) === true) { @@ -154,8 +159,24 @@ $inv.d = { let tbl = $inv.d.tbl(); if (tbl.length < 1) { return; } tbl.data('dver', state.version).data('serverSums', state.sums); $inv.d.footer(tbl, state.sums || {}, state.admin || {}); + $inv.d.notes(state.notes || []); $inv.d.validation(state.validation || []); $inv.d.applyPositions(tbl, state.req || []); + $inv.d.applySetDisplay(tbl, state.setDisplay || {}); + /* Keep the menu's "Set-Preisanzeige" entry in sync with the authoritative admin.setmode: + hides it right after a mode switch, and restores it if a discard reverted the draft to + a DB state that was never switched (ADR 0006 backend-authoritative refresh). */ + $inv.eM(false, true, $inv.emOpt(state.admin || {})); + }, + /* Renders the backend-authoritative notice paragraphs (ADR: notice texts are + backend-authoritative) exactly as FuchsPdf.BuildInvoiceNotes emits them for the PDF, + so the online editor always shows precisely what will be printed. */ + notes: function (notes) { + let frm = $inv.d.layout(); if (frm.length < 1) { return; } + let box = frm.children('.dnotes'); + if (box.length < 1) { box = $$.dc('dnotes'); frm.append(box); } + box.empty(); + (notes || []).forEach((n) => $$.dc('dnote').aC(n.style || 'InvoiceNotes').text(n.text)); }, /* Push the server's authoritative position numbers back onto the rendered rows so the online editor and the PDF preview always agree (the server numbers priced lines continuously; the @@ -167,6 +188,23 @@ $inv.d = { if (cell.length) { cell.text(co.p != null ? co.p : ''); } })); }, + /* Applies the backend-authoritative set-pricing display flags (see BuildSetDisplay / + InvoiceSetPricing) onto the rendered rows: blanks the price/total cells for lines the + server says should show no price (set members in SetPrice mode, the set header in + ItemPrices mode), and emphasises the set header line — so the online editor always + shows exactly what the PDF will print, without duplicating the pricing rules client-side. + Rows not present in the map (no set in that block, or standalone items) are left untouched. */ + applySetDisplay: function (tbl, setDisplay) { + tbl.find('tr.itm').each((i, tr) => { + let rw = $(tr), dta = rw.data() || {}, id = (dta.Id || '').toString(); + if (id === '' || !Object.prototype.hasOwnProperty.call(setDisplay, id)) { return; } + let flags = setDisplay[id] || {}; + rw.tC('sethdr', bool(flags.h, false)); + if (bool(flags.p, true) === false) { + rw.find('td.currency').text(''); + } + }); + }, /* Send one change to the server; the draftReady signal and this success both refresh. */ sync: function (delta) { let t = $inv.d.token(); if (t === '') { return; } @@ -354,8 +392,23 @@ $inv.rd = { let tbl = $inv.rd.tbl(); if (tbl.length < 1) { return; } tbl.data('rdver', state.version).data('serverSums', state.sums).data('remid', state.remid || ''); $inv.rd.footer(tbl, state.sums || {}); + $inv.rd.notes(state.notes || {}); $inv.rd.validation(state.validation || []); }, + /* Renders the backend-authoritative intro/closing notice paragraphs (ADR: notice texts + are backend-authoritative) exactly as FuchsPdf.BuildReminderNotes emits them for the + PDF, so the online editor always shows precisely what will be printed. */ + notes: function (notes) { + let frm = $inv.rd.layout(); if (frm.length < 1) { return; } + let rq = frm.find('.srq'); if (rq.length < 1) { return; } + rq.children('.dnote').remove(); + let intro = (notes || {}).intro || [], first = rq.children().first(); + intro.slice().reverse().forEach((t) => { + let p = $$[0]('p').aC('dnote intro').rwText(t); + if (first.length) { p.insertBefore(first); } else { p.appendTo(rq); } + }); + ((notes || {}).closing || []).forEach((t) => $$[0]('p').aC('dnote closing').rwText(t).appendTo(rq)); + }, /* Send one change to the server; the draftReady signal and this success both refresh. */ sync: function (delta) { let t = $inv.rd.token(); if (t === '') { return; } @@ -379,10 +432,13 @@ $inv.rd = { $inv.rd.sync({ Target: 'amount', Value: (amount != null ? amount : 0).toString() }); $inv.rd.sync({ Target: 'amount_payed', Value: (amount_payed != null ? amount_payed : 0).toString() }); }, - /* Render the open-amount footer from the server sums. */ + /* Render the open-amount footer from the server sums. Detail rows ($inv.rRemRw) have + 6 columns (aux, invoiceid, date, amount, amount_payed, open); span the label over the + 4 columns between aux and the open-amount column so the total lands in the same last + column as the per-invoice open amounts. */ footer: function (tbl, sums) { let ft = tbl.children('tfoot').empty(); - let tr = $$.tr(ft, { class: 'tsum' }).append([$$.tdc('aux'), $$.td({ colspan: 3 }).text('Offener Betrag')]); + let tr = $$.tr(ft, { class: 'tsum' }).append([$$.tdc('aux'), $$.td({ colspan: 4 }).text('Offener Betrag')]); $$.tdc('currency', tr, fnum(sums.amount_open || 0, $rct.cst)); }, validation: function (msgs) { @@ -625,7 +681,7 @@ $inv.ccInv = function (ev) { //normale rechnung rif.tbl.children('tbody').each($inv.bdysort); rif.tbl.trigger('fds.inv'); /* trigger calculations */ - $inv.eM(false, true, 'iss,p13b,setm,ctp'); + $inv.eM(false, true, $inv.emOpt(admin)); }, complete: () => { o.c.trigger('modal_close'); } @@ -770,7 +826,7 @@ $inv.cntInv = function (data) { //invoice continuation rif.tbl.children('tbody').each($inv.bdysort); rif.tbl.trigger('fds.inv'); /* trigger calculations */ - $inv.eM(false, true, 'iss,p13b,setm,ctp'); + $inv.eM(false, true, $inv.emOpt(response.admin)); }, complete: () => { o.c.trigger('modal_close'); } @@ -970,6 +1026,14 @@ $inv.rrw = function () { if (ph === false) { bc.unshift($$.dc('ibtn edit', { title: $rct.cP }).append(gi('pencil')).click(rw, $inv.eRow)); bc.push($$.dc('ibtn del', { title: $rct.dR }).append(gi('trash')).click(function (e) { if (confirm($rct.cD)) { rw.remove(); $inv.t_fds_inv(); } })); + /* "Auf Setpreis umstellen": only offered on a Set header item that is not yet + priced from its members (fds__prepInvoice's [SetItmId] is null exactly for a + Set header — either already set-priced, or not yet converted). Irreversible: + sets this row's price to the sum of its members (rows whose [SetItmId] equals + this row's id) and clears each member's price. */ + if ((dta.Type || '').toLowerCase() === 'set' && (dta.SetItmId || '') === '') { + bc.push($$.dc('ibtn tosetp', { title: $rct.toSetP }).append(gi('scale')).click(rw, $inv.toSetPrice)); + } } let axf = $$.dc('axf').append(bc); if (ph === true) { @@ -1015,6 +1079,36 @@ $inv.rrw = function () { rw.empty().attr('class', ph ? 'placeholder' : 'itm').aC(co.Typ).tC('hidenote', hn).append(tda); dta.co = co; }; +/* "Auf Setpreis umstellen" (see $inv.rrw): sets this Set-header row's price to the sum of + its member rows' totals (rows in the same block whose [SetItmId] equals this row's id, + the authoritative grouping from fds__prepInvoice), then clears each member's price so the + member items show without a price — matching the SetPrice presentation, but as an actual, + irreversible data change instead of a display-mode toggle (INVOICE_SET_PRICING.md's + setmode remains display-only and is unaffected by this). */ +$inv.toSetPrice = function (ev) { + let rw = ev.data, dta = rw.data(), id = (dta.Id || '').toString(); + if (id === '') { return; } + if (confirm($rct.toSetPc) === false) { return; } + let bdy = rw.closest('tbody'), members = bdy.find('tr.itm').filter(function () { + return (($(this).data('SetItmId') || '').toString()) === id; + }); + let sum_net_val = 0, sum_vat_val = 0, sum_svcnet_val = 0, sum_svcvat_val = 0; + members.each(function () { + let m = $(this).data(); + sum_net_val += (m.net_val || 0); + sum_vat_val += (m.vat_val || 0); + sum_svcnet_val += (m.svcnet_val || 0); + sum_svcvat_val += (m.svcvat_val || 0); + $.extend(m, { net: 0, net_val: 0, vat_val: 0, svcnet_val: 0, svcvat_val: 0, Discount: 0 }); + $inv.rrw.call($(this)); + }); + $.extend(dta, { + net: sum_net_val, quantityhours: 1, Discount: 0, + net_val: sum_net_val, vat_val: sum_vat_val, svcnet_val: sum_svcnet_val, svcvat_val: sum_svcvat_val + }); + $inv.rrw.call(rw); + $inv.t_fds_inv(); +}; $inv.invSumUpdate = function () { let tbl = $(this), ft = tbl.children('tfoot').empty(), p13b = bool((tbl.data().admin || {}).p13b || '', false); tbl.nextAll('.fnote').remove(); @@ -1541,7 +1635,10 @@ $inv.ccRem_s2 = function (id, sets) { //reminder creation //console.debug(response); let rem = response.rm || {}; let rq = $$.dc('srq', frm); - $ict.remt[rem.type].forEach(r => $$[0]('p').rwText(r).appendTo(rq)); + /* Intro/closing notice paragraphs are backend-authoritative (see $inv.rd.notes, + populated from FuchsPdf.BuildReminderNotes via rem/dstate after seeding below) — + they are appended/prepended into this same .srq container once the draft session + is open, so no client-side wording is constructed here. */ let rif = $$.tblset({ class: 'invi' }, rq); rif.ft = $$[0]('tfoot'); rif.tbl.data($.extend({ invid: rem.invid, new: {} }, response)); @@ -1549,7 +1646,6 @@ $inv.ccRem_s2 = function (id, sets) { //reminder creation $ict.remHR.forEach(h => $$.th(thr, h)); $inv.rRemRw.call($$.tr(rif.bdy), rif.tbl.data()); rif.ft.appendTo(rif.tbl); - $ict.remt2[rem.type].forEach(r => $$[0]('p').rwText(r).appendTo(rq)); let fm = (cls, txt, nme, hd, dta) => { let fr = $$.dc('inpfrm', frm).aC(cls).append(typeof hd === 'string' ? $$.dc('ahd', hd) : (hd > 0 ? $$.dc('ahd', $rct.frm[nme]) : null)), fc = $$.dc('content', fr).rwText(txt); diff --git a/Fuchs/js/intranet/modules/fis.inv_shared.scss b/Fuchs/js/intranet/modules/fis.inv_shared.scss index 27ae10e..9809a92 100644 --- a/Fuchs/js/intranet/modules/fis.inv_shared.scss +++ b/Fuchs/js/intranet/modules/fis.inv_shared.scss @@ -62,6 +62,18 @@ height: auto; cursor: pointer; + .content { + color: #000; + } + + .content:empty::before { + content: '-'; + min-width: 5rem; + height: 1rem; + display: block; + position: absolute; + } + &:hover { div.axf { display: block; @@ -232,6 +244,12 @@ border-color: #FFF; border-top: 1.5px solid #000; } + + /* Set-pricing display (see InvoiceSetPricing / $inv.d.applySetDisplay): the set + header line is emphasised the same way the PDF renders it (bold title). */ + &.sethdr td.txt { + font-weight: bold; + } } > tfoot > tr { diff --git a/Fuchs/js/intranet/modules/fis.inv_txt_de.js b/Fuchs/js/intranet/modules/fis.inv_txt_de.js index 3f34986..173472e 100644 --- a/Fuchs/js/intranet/modules/fis.inv_txt_de.js +++ b/Fuchs/js/intranet/modules/fis.inv_txt_de.js @@ -63,16 +63,10 @@ rovlh: 'Übersicht der bisherigen Mahnungen', rovl: ['Betreff', 'Betrag', 'Betrag gezahlt', 'fertiggestellt am'], remHR: ['Rechnung', 'vom', 'Rechnungsbetrag', 'bereits bezahlt', 'noch offen'], - remt: { - f: ['Sehr geehrte Damen und Herren,', 'ein Mahnschreiben sollte kurz, freundlich und erfolgreich sein. Kurz ist es, freundlich sowieso; ob es auch erfolgreich ist, hängt von Ihnen ab.'] - , m: ['Sehr geehrte Damen und Herren,', 'nun müssen wir Sie noch einmal anschreiben.', 'Wahrscheinlich haben Sie triftige Gründe dafür, warum Sie die Zahlung unserer Forderung nicht vornehmen und auch nicht auf unsere Mahnung reagieren. Sollten wir darüber nicht einmal sprechen?', 'Bitte nehmen Sie umgehend in dieser Sache mit uns Kontakt auf.'] - , l: ['Sehr geehrte Damen und Herren,', 'Eine DRITTE MAHNUNG zu erhalten bereitet Ihnen bestimmt ebenso wenig Freude wie uns, sie zu verschicken. Leider haben wir auf unsere zweite Mahnung noch keine Antwort von Ihnen erhalten.", "Wir bitten Sie, den offenen Betrag innerhalb der nächsten 7 Werktage nach Erhalt dieses Schreibens zu begleichen. Nach Ablauf dieser Frist erfolgt keine weitere Mahnung mehr.', 'Sollte die Forderung bis dahin nicht beglichen sein, eröffnen wir das gerichtliche Mahnverfahren. Sollten Sie die Rechnung inzwischen beglichen haben, so betrachten Sie bitte dieses Schreiben als gegenstandslos.'] - }, - remt2: { - f: ['Wir bitten Sie, den noch offenen Rechnungsbetrag innerhalb einer Woche auf unser Konto zu überweisen.', 'Sollten Sie den Betrag bereits überwiesen haben, so bitten wir Sie, diese Zahlungserinnerung als gegenstandslos zu betrachten.'] - , m: ['Um Ihnen zusätzliche Kosten für weitere Mahnungen zu ersparen, bitten wir Sie nunmehr um die Überweisung des noch zu zahlenden Gesamtbetrages inklusive der ggf. bereits fälligen Mahnzinsen und Mahngebühren innerhalb von einer Woche.'] - , l: [] - }, payi: { account: 'Konto', name: 'Zahler', text: 'Verw.Zweck', InvoiceID: 'Rechnung', amount: 'Betrag', date: 'Datum', manual: 'Typ'} + // Reminder intro/closing notice texts are backend-authoritative (see FuchsPdf.BuildReminderNotes / + // $inv.rd.notes) — no client-side copies here. + translatePaymentTerm: (pt) => (pt || '').replace('wd', ' Werktagen').replace('d', ' Tagen').replace('wk', ' Wochen') || '10 Tagen' + , payi: { account: 'Konto', name: 'Zahler', text: 'Verw.Zweck', InvoiceID: 'Rechnung', amount: 'Betrag', date: 'Datum', manual: 'Typ'} }, $invcol = { datev: new fields_definition('Rechnung', 'Rechnungen', [ { name: 'Umsatz (ohne Soll/Haben-Kz)', label: 'Umsatz (ohne Soll/Haben-Kz)', type: 'string' }, diff --git a/Fuchs/js/intranet/modules/fis.req_txt_de.js b/Fuchs/js/intranet/modules/fis.req_txt_de.js index a207693..1b15f7b 100644 --- a/Fuchs/js/intranet/modules/fis.req_txt_de.js +++ b/Fuchs/js/intranet/modules/fis.req_txt_de.js @@ -34,6 +34,8 @@ svcPart: 'Service-Anteil', vat: 'Umsatzsteuer', combP: 'Positionen zusammenfassen', + toSetP: 'Auf Setpreis umstellen (Positionen ohne Preis)', + toSetPc: 'Der Set-Preis wird auf die Summe seiner Positionen gesetzt und die Positionen selbst verlieren ihren Preis. Das ist nicht rückgängig zu machen (der Betrag kann danach nur noch manuell geändert werden). Fortfahren?', iSum: 'Zwischensumme', dtRel: 'Freigegeben am: ', dtCr: 'Erstellt am: ', diff --git a/Fuchs/js/intranet/oci_basic.js b/Fuchs/js/intranet/oci_basic.js index d826cd1..4c0ec25 100644 --- a/Fuchs/js/intranet/oci_basic.js +++ b/Fuchs/js/intranet/oci_basic.js @@ -660,16 +660,16 @@ $ocms.vbl_send = function (ev) { } else { val = null; } - } else if (type === 'number' && typedvalues === true ) { - let v; + } else if ((type === 'number' || dtf[0] === 'float' || dtf[0] === 'integer') && typedvalues === true) { + let v, raw = String(val).replace(',', '.'); if (dtf[0] === 'integer') { - v = parseInt(val); + v = parseInt(raw); } else { - v = parseFloat(val); + v = parseFloat(raw); } val = isNaN(v) ? val : v; } - if (req === true && ((val || '') === '' || (val.match(pattern) === null))) { + if (req === true && ((val === '' || val === null || typeof val === 'undefined') || (typeof val === 'string' && val.match(pattern) === null))) { if (cat === false && bool(checkvalidity, false) === true) { e.setCustomValidity(t.nza('ocms-nvnote', $ocms.t.inv || 'Invalid field')); } val = null; } else if (cat=== false && bool(checkvalidity, false) === true) { diff --git a/Fuchs/js/intranet/oci_main.js b/Fuchs/js/intranet/oci_main.js index 25c007a..daf2271 100644 --- a/Fuchs/js/intranet/oci_main.js +++ b/Fuchs/js/intranet/oci_main.js @@ -441,6 +441,8 @@ break; case 'number': f.pattern = ne(f.pattern, '[-+]?[0-9]*[.,]?[0-9]*'); + inp.attr('type', 'text'); + inp.attr('inputmode', 'decimal'); inp.attr('step', f.precision || 'any'); inp.attr('data-format', 'float'); break; diff --git a/Fuchs/wwwroot/web/fis.bam.de.js b/Fuchs/wwwroot/web/fis.bam.de.js index 23b8969..bed80c5 100644 --- a/Fuchs/wwwroot/web/fis.bam.de.js +++ b/Fuchs/wwwroot/web/fis.bam.de.js @@ -18,10 +18,21 @@ let $bct = { }, in: 'Rechnungsnummer', bt: 'Buchungstexte', - bv: 'Buchungswert (volle €)' + bv: 'Buchungswert (volle €)', + mbe: 'Manuelle Buchung erfassen', + mbc: 'Manuelle Buchung ändern', + mbd: 'Manuelle Buchung löschen', + mbdc: 'Manuelle Buchung wirklich löschen?\nDieser Vorgang kann nicht rückgängig gemacht werden.' }; let $bcol = { + man: new fields_definition('Manuelle Buchung', 'Manuelle Buchungen', [ + { name: 'taID', type: 'hidden' }, + { name: 'ValueDate', label: 'Valuta', type: 'date', required: true }, + { name: 'Amount', label: 'Betrag', type: 'number', precision: '0.01', required: true }, + { name: 'NameOfPayer', label: 'Name', type: 'string' }, + { name: 'SepaRemittanceInformation', label: 'Verwendungszweck', type: 'string' } + ]), qtl: new fields_definition('Kontobericht', 'Kontoberichte', [ { name: 'InvoiceId', label: 'RechnungsNr', type: 'string' }, { name: 'ValueDate', label: 'Valuta', type: 'date' }, @@ -77,11 +88,16 @@ let $bam = { let fds = bool(ix.fds, false), id = ix.taID, m = []; m.push({ lbl: $bct.smd, fnc: () => { $bam.smd(id); } }); m.push({ lbl: $bct.ati, fnc: () => { $bam.ati(id); } }); + if (bool(ix.IsManual, false) === true) { + m.push({ lbl: $bct.mbc, fnc: () => { $bam.mbc(id); } }); + m.push({ lbl: $bct.mbd, fnc: () => { $bam.mbd(id); } }); + } return $('#topbar').ocmsmenu(m); }, eM : (r, re, opt) => { let m = []; if ($fis.isAuth('fds_bam', 2) === true) { m.push({ lbl: $bct.upl, fnc: $bam.ubs}); + m.push({ lbl: $bct.mbe, fnc: $bam.mbe}); } if (bool(r, false) === true) { m.push({ lbl: $bct.rel, fnc: $bam.renderLst }); @@ -353,6 +369,32 @@ let $bam = { } } }); + }, mbe: () => { + $bam.manForm({}); + }, mbc: (taid) => { + $ocms.postXT({ + url: $ocms.url('bam/mget'), data: { taid: taid }, success: (dta) => { + $bam.manForm(dta || {}); + } + }); + }, mbd: (taid) => { + if (confirm($bct.mbdc)) { + $ocms.postXT({ + url: $ocms.url('bam/mdel'), data: { taid: taid }, success: () => { + $bam.renderLst(); + } + }); + } + }, manForm: (dta) => { + let flds = $bcol.man.clone().applyValues(dta || {}); + $ocms.dlgform(flds, { + title: (ne(dta.taID, '') !== '') ? $bct.mbc : $bct.mbe, + url: $ocms.url('bam/man'), + typedvalues: true, + success: () => { + $bam.renderLst(); + } + }); } } diff --git a/Fuchs/wwwroot/web/fis.bam.de.min.js b/Fuchs/wwwroot/web/fis.bam.de.min.js index 7be85c1..d4f518e 100644 --- a/Fuchs/wwwroot/web/fis.bam.de.min.js +++ b/Fuchs/wwwroot/web/fis.bam.de.min.js @@ -1 +1 @@ -let $bct={wk:"Woche",nd:"Keine Daten gefunden.",h:"Uhr",mdl:"BankBuchungen",upl:"BuchungsExport hochladen",rel:"Neu Laden",smd:"Buchung als erledigt markieren",smdc:"Buchung wirklich als erledigt markieren?\nDie Buchung wird nicht mehr in den auffälligen Buchungen angezeigt.",ati:"Buchung einer Rechnung zuordnen",ni:"Es wurden keine Rechnungen mit dieser ID gefunden.",ino:"Rechnungsnummer",fi:"Folgende Rechnungen wurden gefunden",atic:"Buchung wirklich der Rechnung {0} zuordnen?",dqb:"Auffällige Zahlungen anzeigen",iov:{all:"Buchungsübersicht (alle)","":"Buchungsübersicht"},in:"Rechnungsnummer",bt:"Buchungstexte",bv:"Buchungswert (volle €)"},$bcol={qtl:new fields_definition("Kontobericht","Kontoberichte",[{name:"InvoiceId",label:"RechnungsNr",type:"string"},{name:"ValueDate",label:"Valuta",type:"date"},{name:"InvoiceBalance",label:"Rechnungsbetrag",type:"string"},{name:"IsCanceled",label:"Storno",type:"bool"},{name:"Amount",label:"Gutschrift",type:"string"},{name:"Skonto",label:"Skonto ?",type:"bool"},{name:"Deviation",label:"Abweichung [%]",type:"bool"},{name:"AccountNumberOfPayer",label:"IBAN",type:"string"},{name:"NameOfPayer",label:"Name",type:"string"},{name:"SepaRemittanceInformation",label:"Verwendungszweck",type:"string"},{name:"EndToEndReference",label:"Referenz",type:"string"}]),bsu:new fields_definition("Kontobericht","Kontoberichte",[{name:"bsu",label:"Export der Buchungen",type:"file",required:!0,prop:{multiple:!0}}])},gi=(e,t)=>$$.sc(`glyphicon glyphicon-${e}`).aC(t),$bam={init2:function(e,t){e=e||"bam",t=t||{},$ocms.getScript([],(function(){$bam.init3(e,t)}))},init3:async function(e,t){$fis.cf(!0);let n=$fis.lf(!0);$bam.eM(),$("#activemodule").text($bct.mdl),await $fis.prepAuth("fds_bam,fds_inv,fds_reminder");let a=[(async()=>{!0===$fis.isAuth("fds_bam",1)&&($bam.prepLst(""),n.aC("fix"))})(),(async()=>{!0===$fis.isAuth("fds_bam",1)&&$bam.renderLst(!1)})(),new Promise(((e,t)=>{}))];await Promise.all(a)},iMn:e=>{bool(e.fds,!1);let t=e.taID,n=[];return n.push({lbl:$bct.smd,fnc:()=>{$bam.smd(t)}}),n.push({lbl:$bct.ati,fnc:()=>{$bam.ati(t)}}),$("#topbar").ocmsmenu(n)},eM:(e,t,n)=>{let a=[];return!0===$fis.isAuth("fds_bam",2)&&a.push({lbl:$bct.upl,fnc:$bam.ubs}),!0===bool(e,!1)&&a.push({lbl:$bct.rel,fnc:$bam.renderLst}),$("#topbar").ocmsmenu(a)},prepLst:function(e){let t=new Date,n=$fis.lf(!0).ldng(1),a=new Date("2021-01-01");$fis.frm_list().IN((function(){}));$$.i({placeholder:$bct.in}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$bam.renderbt("i:"+n,"s"),t.val(""))})),$$.i({placeholder:$bct.bt}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$bam.renderbt("b:"+n,"s"),t.val(""))})),$$.i({placeholder:$bct.bv}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$bam.renderbt(`v:${n}`,"s"),t.val(""))})),$$.dc("mth oreq",n).text($bct.dqb).click((function(e){let t=$(this);e.stopPropagation(),t.siblings().rC("selected"),!0===t.is(".selected")&&(t.tC("selected"),$bam.renderLst(!1)),t.aC("selected")}));n.append("
");let l=$$.dc("mthl",n),i=t.getFullYear(),c=t.getMonth()+1;for(let t=a.getFullYear();t<=i;t++){let n=$$.dc("yr").prependTo(l).text(`${$bct.iov[e]} - ${t.toString()}`).toggleClass("selected",t===i);n.click({yr:t},(function(e){e.stopPropagation(),n.siblings().rC("selected"),n.aC("selected")}));let s=$$.dc("mfrm",n);for(let n=0;n<(t!==i?12:c);n++){a=new Date(t,n,1);let l=$$.dc("mth").prependTo(s).text(`${$bct.iov[e]} - ${fdt(a,"MMM yyyy")}`);l.click({yr:t,mt:n},(function(e){if(e.stopPropagation(),l.siblings().rC("selected"),!0===l.is(".selected")){l.tC("selected");let t=fdt(new Date(e.data.yr,e.data.mt,1),"yy-MM-dd");$bam.renderbt(t,"m")}l.aC("selected")}));let i=getMonday(a),c=new Date(a);c.setMonth(c.getMonth()+1),c.setDate(0),c=getMonday(c);let d=$$.dc("wfrm",l);for(;i<=c;){let e=$$.dc("wk",d).text(`${$bct.wk||"W"} ${fdt(i,"dd.MM.yy")}`);e.click({rd:new Date(i)},(function(t){t.stopPropagation();let n=fdt(t.data.rd,"yy-MM-dd");$bam.renderbt(n,"w"),l.siblings().rC("selected").find(".wk").rC("selected"),l.aC("selected").find(".wk").rC("selected"),e.aC("selected")})),i.setDate(i.getDate()+7)}}}n.ldng(0)},renderbt:function(e,t){let n=$fis.frm_list().ldng(1),a=$$.dc("invfrm",n).aC("md"+t),l=$fis.lf();$ocms.postXT({url:$ocms.url("bam/btl"),data:{mode:t,tgt:e},success:e=>{l.rC("fix").aC("hd"),$$.dc("ovhd",a).append($$.s(e.admin.title)).appendIf($$.sc("note",e.admin.note),""!==ne(e.admin.note,""));let t=$$.tblset({},a),n=$bcol.qtl,i=$$.tr(t.hd);$$.th(i);$.each(n.fields||[],((e,t)=>{$$.th(i).text(t.label),"vat"===t.name&&$$.th(i)}));let c=!1;$.each(e.bank||[],((e,a)=>{let i=$$.tr(t.bdy).tC("alt",c);i.click((function(){l.rC("fix").aC("hd"),i.tC("selected").siblings().rC("selected").find("td.av").rC("av"),i.find("td.av").rC("av")}));$$.td(i,{class:"raux"});$.each(n.fields||[],((e,t)=>{let n=$$.td(i).aC(t.dtype),l=a[t.name];if("function"==typeof t.dfnc)t.dfnc.call(n,l,a);else switch(t.type||""){case"date":n.text(fdt(a[t.name],"dd.MM.yy"));break;case"datetime":n.text(fdt(a[t.name]));break;case"html":n.append($$.dc("ctw").html(l)),n.append($$.dc("ttip").html(l));break;default:n.text(a[t.name])}switch(typeof t.title){case"function":t.title.call(n,a);break;case"string":n.attr("title",cs.title)}}))}))},complete:()=>{n.ldng(0)}})},renderLst:function(){let e=$fis.frm_list(!0,!0).ldng(1),t=$$.dc("bamfrm",e).aC("mdl"),n=$fis.lf();$bam.eM(!0),$ocms.postXT({url:$ocms.url("bam/qtl"),data:{mode:"l"},success:e=>{n.rC("fix").aC("hd"),$$.dc("ovhd",t).append($$.s(e.admin.title)).appendIf($$.sc("note",e.admin.note),""!==ne(e.admin.note,""));let a=$$.tblset({},t),l=$bcol.qtl,i=$$.tr(a.hd);$$.th(i);$.each(l.fields||[],((e,t)=>{$$.th(i).text(t.label)})),$.each(e.bs||[],((e,t)=>{let i=$$.tr(a.bdy,{id:`bt${t.taID}`});i.click((function(){n.rC("fix").aC("hd"),i.toggleClass("selected").siblings().rC("selected").find("td.av").rC("av"),i.find("td.av").rC("av"),!0===i.is(".selected")?$bam.iMn(t):$bam.eM(!0)}));$$.td(i,{class:"raux"});$.each(l.fields||[],((e,n)=>{let a=$$.td(i).aC(n.dtype);"select"===(n.type||"")?a.text((n.url||{})[t[n.name]]||""):a.text(t[n.name])}))}))},complete:()=>{e.ldng(0)}})},ubs:function(){$ocms.dlgform($bcol.bsu,{title:$bcol.bsu.label_sng||"",submit:function(e){var t=$(this).ldng(1),n=new FormData;let a=t.find(':input[name="bsu"]');a.length>0&&a[0].files.length>0?($.each(a[0].files,(function(e,t){n.append("bsu",t)})),$ocms.postXT({url:$ocms.url("bam/up"),data:n,success:function(e){t.trigger("modal_close")},error:function(){alert($t.l17)},complete:function(){t.ldng(0),$bam.renderLst()},timeout:0})):(options.success.call(this,n),t.trigger("modal_close"))},typedvalues:!0})},smd:e=>{confirm($bct.smdc)&&$ocms.postXT({url:$ocms.url("bam/smd"),data:{taid:e},success:t=>{$(`#bt${e}`).aC("mdone")}})},ati:e=>{let t=$$.dc("form"),n=$$.dc("form-body",t),a=$$.dc("form-group",n),l=($$.lbl($bct.ino,{for:"rno"}).appendTo(a),$$.i({id:"rno",placeholder:"Rechnungs-Nummer"}).appendTo(a)),i=$$.dc("rfrm bam",n);l.change((function(e){$ocms.postXT({url:$ocms.url("bam/vfi"),data:{invid:l.val()},success:e=>{i.empty(),e.length>0?($$.dc("nfo",i,$bct.fi),$.each(e,(function(e,t){let n=$$.dc("rinv",i,t.InvoiceId).data("inv",t).click((function(e){$(this).addClass("selected").siblings(".rinv").removeClass("selected")}));$$.dc("invsta",n).rwText(t.SendToAddress)}))):i.text($bct.ni)}})})),$ocms.dlg(t,{title:$bct.ati,size:[500,700],confirm:function(t){let n=$(this),a=n.find(".rinv.selected:first");if(1===a.length){let t=a.data("inv")||{};confirm(string($bct.atic,[t.InvoiceId]))&&$ocms.postXT({url:$ocms.url("bam/ati"),data:{taid:e,iid:t.Id},success:t=>{$(`#bt${e}`).aC("mdone"),n.trigger("modal_close")}})}}})}},$$bam={init2:$bam.init2,auth:{}};export default $$bam; \ No newline at end of file +let $bct={wk:"Woche",nd:"Keine Daten gefunden.",h:"Uhr",mdl:"BankBuchungen",upl:"BuchungsExport hochladen",rel:"Neu Laden",smd:"Buchung als erledigt markieren",smdc:"Buchung wirklich als erledigt markieren?\nDie Buchung wird nicht mehr in den auffälligen Buchungen angezeigt.",ati:"Buchung einer Rechnung zuordnen",ni:"Es wurden keine Rechnungen mit dieser ID gefunden.",ino:"Rechnungsnummer",fi:"Folgende Rechnungen wurden gefunden",atic:"Buchung wirklich der Rechnung {0} zuordnen?",dqb:"Auffällige Zahlungen anzeigen",iov:{all:"Buchungsübersicht (alle)","":"Buchungsübersicht"},in:"Rechnungsnummer",bt:"Buchungstexte",bv:"Buchungswert (volle €)",mbe:"Manuelle Buchung erfassen",mbc:"Manuelle Buchung ändern",mbd:"Manuelle Buchung löschen",mbdc:"Manuelle Buchung wirklich löschen?\nDieser Vorgang kann nicht rückgängig gemacht werden."},$bcol={man:new fields_definition("Manuelle Buchung","Manuelle Buchungen",[{name:"taID",type:"hidden"},{name:"ValueDate",label:"Valuta",type:"date",required:!0},{name:"Amount",label:"Betrag",type:"number",precision:"0.01",required:!0},{name:"NameOfPayer",label:"Name",type:"string"},{name:"SepaRemittanceInformation",label:"Verwendungszweck",type:"string"}]),qtl:new fields_definition("Kontobericht","Kontoberichte",[{name:"InvoiceId",label:"RechnungsNr",type:"string"},{name:"ValueDate",label:"Valuta",type:"date"},{name:"InvoiceBalance",label:"Rechnungsbetrag",type:"string"},{name:"IsCanceled",label:"Storno",type:"bool"},{name:"Amount",label:"Gutschrift",type:"string"},{name:"Skonto",label:"Skonto ?",type:"bool"},{name:"Deviation",label:"Abweichung [%]",type:"bool"},{name:"AccountNumberOfPayer",label:"IBAN",type:"string"},{name:"NameOfPayer",label:"Name",type:"string"},{name:"SepaRemittanceInformation",label:"Verwendungszweck",type:"string"},{name:"EndToEndReference",label:"Referenz",type:"string"}]),bsu:new fields_definition("Kontobericht","Kontoberichte",[{name:"bsu",label:"Export der Buchungen",type:"file",required:!0,prop:{multiple:!0}}])},gi=(e,t)=>$$.sc(`glyphicon glyphicon-${e}`).aC(t),$bam={init2:function(e,t){e=e||"bam",t=t||{},$ocms.getScript([],(function(){$bam.init3(e,t)}))},init3:async function(e,t){$fis.cf(!0);let n=$fis.lf(!0);$bam.eM(),$("#activemodule").text($bct.mdl),await $fis.prepAuth("fds_bam,fds_inv,fds_reminder");let a=[(async()=>{!0===$fis.isAuth("fds_bam",1)&&($bam.prepLst(""),n.aC("fix"))})(),(async()=>{!0===$fis.isAuth("fds_bam",1)&&$bam.renderLst(!1)})(),new Promise(((e,t)=>{}))];await Promise.all(a)},iMn:e=>{bool(e.fds,!1);let t=e.taID,n=[];return n.push({lbl:$bct.smd,fnc:()=>{$bam.smd(t)}}),n.push({lbl:$bct.ati,fnc:()=>{$bam.ati(t)}}),!0===bool(e.IsManual,!1)&&(n.push({lbl:$bct.mbc,fnc:()=>{$bam.mbc(t)}}),n.push({lbl:$bct.mbd,fnc:()=>{$bam.mbd(t)}})),$("#topbar").ocmsmenu(n)},eM:(e,t,n)=>{let a=[];return!0===$fis.isAuth("fds_bam",2)&&(a.push({lbl:$bct.upl,fnc:$bam.ubs}),a.push({lbl:$bct.mbe,fnc:$bam.mbe})),!0===bool(e,!1)&&a.push({lbl:$bct.rel,fnc:$bam.renderLst}),$("#topbar").ocmsmenu(a)},prepLst:function(e){let t=new Date,n=$fis.lf(!0).ldng(1),a=new Date("2021-01-01");$fis.frm_list().IN((function(){}));$$.i({placeholder:$bct.in}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$bam.renderbt("i:"+n,"s"),t.val(""))})),$$.i({placeholder:$bct.bt}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$bam.renderbt("b:"+n,"s"),t.val(""))})),$$.i({placeholder:$bct.bv}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$bam.renderbt(`v:${n}`,"s"),t.val(""))})),$$.dc("mth oreq",n).text($bct.dqb).click((function(e){let t=$(this);e.stopPropagation(),t.siblings().rC("selected"),!0===t.is(".selected")&&(t.tC("selected"),$bam.renderLst(!1)),t.aC("selected")}));n.append("
");let l=$$.dc("mthl",n),c=t.getFullYear(),i=t.getMonth()+1;for(let t=a.getFullYear();t<=c;t++){let n=$$.dc("yr").prependTo(l).text(`${$bct.iov[e]} - ${t.toString()}`).toggleClass("selected",t===c);n.click({yr:t},(function(e){e.stopPropagation(),n.siblings().rC("selected"),n.aC("selected")}));let s=$$.dc("mfrm",n);for(let n=0;n<(t!==c?12:i);n++){a=new Date(t,n,1);let l=$$.dc("mth").prependTo(s).text(`${$bct.iov[e]} - ${fdt(a,"MMM yyyy")}`);l.click({yr:t,mt:n},(function(e){if(e.stopPropagation(),l.siblings().rC("selected"),!0===l.is(".selected")){l.tC("selected");let t=fdt(new Date(e.data.yr,e.data.mt,1),"yy-MM-dd");$bam.renderbt(t,"m")}l.aC("selected")}));let c=getMonday(a),i=new Date(a);i.setMonth(i.getMonth()+1),i.setDate(0),i=getMonday(i);let d=$$.dc("wfrm",l);for(;c<=i;){let e=$$.dc("wk",d).text(`${$bct.wk||"W"} ${fdt(c,"dd.MM.yy")}`);e.click({rd:new Date(c)},(function(t){t.stopPropagation();let n=fdt(t.data.rd,"yy-MM-dd");$bam.renderbt(n,"w"),l.siblings().rC("selected").find(".wk").rC("selected"),l.aC("selected").find(".wk").rC("selected"),e.aC("selected")})),c.setDate(c.getDate()+7)}}}n.ldng(0)},renderbt:function(e,t){let n=$fis.frm_list().ldng(1),a=$$.dc("invfrm",n).aC("md"+t),l=$fis.lf();$ocms.postXT({url:$ocms.url("bam/btl"),data:{mode:t,tgt:e},success:e=>{l.rC("fix").aC("hd"),$$.dc("ovhd",a).append($$.s(e.admin.title)).appendIf($$.sc("note",e.admin.note),""!==ne(e.admin.note,""));let t=$$.tblset({},a),n=$bcol.qtl,c=$$.tr(t.hd);$$.th(c);$.each(n.fields||[],((e,t)=>{$$.th(c).text(t.label),"vat"===t.name&&$$.th(c)}));let i=!1;$.each(e.bank||[],((e,a)=>{let c=$$.tr(t.bdy).tC("alt",i);c.click((function(){l.rC("fix").aC("hd"),c.tC("selected").siblings().rC("selected").find("td.av").rC("av"),c.find("td.av").rC("av")}));$$.td(c,{class:"raux"});$.each(n.fields||[],((e,t)=>{let n=$$.td(c).aC(t.dtype),l=a[t.name];if("function"==typeof t.dfnc)t.dfnc.call(n,l,a);else switch(t.type||""){case"date":n.text(fdt(a[t.name],"dd.MM.yy"));break;case"datetime":n.text(fdt(a[t.name]));break;case"html":n.append($$.dc("ctw").html(l)),n.append($$.dc("ttip").html(l));break;default:n.text(a[t.name])}switch(typeof t.title){case"function":t.title.call(n,a);break;case"string":n.attr("title",cs.title)}}))}))},complete:()=>{n.ldng(0)}})},renderLst:function(){let e=$fis.frm_list(!0,!0).ldng(1),t=$$.dc("bamfrm",e).aC("mdl"),n=$fis.lf();$bam.eM(!0),$ocms.postXT({url:$ocms.url("bam/qtl"),data:{mode:"l"},success:e=>{n.rC("fix").aC("hd"),$$.dc("ovhd",t).append($$.s(e.admin.title)).appendIf($$.sc("note",e.admin.note),""!==ne(e.admin.note,""));let a=$$.tblset({},t),l=$bcol.qtl,c=$$.tr(a.hd);$$.th(c);$.each(l.fields||[],((e,t)=>{$$.th(c).text(t.label)})),$.each(e.bs||[],((e,t)=>{let c=$$.tr(a.bdy,{id:`bt${t.taID}`});c.click((function(){n.rC("fix").aC("hd"),c.toggleClass("selected").siblings().rC("selected").find("td.av").rC("av"),c.find("td.av").rC("av"),!0===c.is(".selected")?$bam.iMn(t):$bam.eM(!0)}));$$.td(c,{class:"raux"});$.each(l.fields||[],((e,n)=>{let a=$$.td(c).aC(n.dtype);"select"===(n.type||"")?a.text((n.url||{})[t[n.name]]||""):a.text(t[n.name])}))}))},complete:()=>{e.ldng(0)}})},ubs:function(){$ocms.dlgform($bcol.bsu,{title:$bcol.bsu.label_sng||"",submit:function(e){var t=$(this).ldng(1),n=new FormData;let a=t.find(':input[name="bsu"]');a.length>0&&a[0].files.length>0?($.each(a[0].files,(function(e,t){n.append("bsu",t)})),$ocms.postXT({url:$ocms.url("bam/up"),data:n,success:function(e){t.trigger("modal_close")},error:function(){alert($t.l17)},complete:function(){t.ldng(0),$bam.renderLst()},timeout:0})):(options.success.call(this,n),t.trigger("modal_close"))},typedvalues:!0})},smd:e=>{confirm($bct.smdc)&&$ocms.postXT({url:$ocms.url("bam/smd"),data:{taid:e},success:t=>{$(`#bt${e}`).aC("mdone")}})},ati:e=>{let t=$$.dc("form"),n=$$.dc("form-body",t),a=$$.dc("form-group",n),l=($$.lbl($bct.ino,{for:"rno"}).appendTo(a),$$.i({id:"rno",placeholder:"Rechnungs-Nummer"}).appendTo(a)),c=$$.dc("rfrm bam",n);l.change((function(e){$ocms.postXT({url:$ocms.url("bam/vfi"),data:{invid:l.val()},success:e=>{c.empty(),e.length>0?($$.dc("nfo",c,$bct.fi),$.each(e,(function(e,t){let n=$$.dc("rinv",c,t.InvoiceId).data("inv",t).click((function(e){$(this).addClass("selected").siblings(".rinv").removeClass("selected")}));$$.dc("invsta",n).rwText(t.SendToAddress)}))):c.text($bct.ni)}})})),$ocms.dlg(t,{title:$bct.ati,size:[500,700],confirm:function(t){let n=$(this),a=n.find(".rinv.selected:first");if(1===a.length){let t=a.data("inv")||{};confirm(string($bct.atic,[t.InvoiceId]))&&$ocms.postXT({url:$ocms.url("bam/ati"),data:{taid:e,iid:t.Id},success:t=>{$(`#bt${e}`).aC("mdone"),n.trigger("modal_close")}})}}})},mbe:()=>{$bam.manForm({})},mbc:e=>{$ocms.postXT({url:$ocms.url("bam/mget"),data:{taid:e},success:e=>{$bam.manForm(e||{})}})},mbd:e=>{confirm($bct.mbdc)&&$ocms.postXT({url:$ocms.url("bam/mdel"),data:{taid:e},success:()=>{$bam.renderLst()}})},manForm:e=>{let t=$bcol.man.clone().applyValues(e||{});$ocms.dlgform(t,{title:""!==ne(e.taID,"")?$bct.mbc:$bct.mbe,url:$ocms.url("bam/man"),typedvalues:!0,success:()=>{$bam.renderLst()}})}},$$bam={init2:$bam.init2,auth:{}};export default $$bam; \ No newline at end of file diff --git a/Fuchs/wwwroot/web/fis.inv.css b/Fuchs/wwwroot/web/fis.inv.css index 114ad1c..b31e3cd 100644 --- a/Fuchs/wwwroot/web/fis.inv.css +++ b/Fuchs/wwwroot/web/fis.inv.css @@ -156,6 +156,16 @@ table.if td.num { height: auto; cursor: pointer; } +.edit_frm .invoice_layout .emailfrm .content { + color: #000; +} +.edit_frm .invoice_layout .emailfrm .content:empty::before { + content: "-"; + min-width: 5rem; + height: 1rem; + display: block; + position: absolute; +} .edit_frm .invoice_layout .emailfrm:hover div.axf { display: block; } @@ -285,6 +295,13 @@ table.if td.num { border-color: #FFF; border-top: 1.5px solid #000; } +.edit_frm .invoice_layout table.invi > tbody > tr { + /* Set-pricing display (see InvoiceSetPricing / $inv.d.applySetDisplay): the set + header line is emphasised the same way the PDF renders it (bold title). */ +} +.edit_frm .invoice_layout table.invi > tbody > tr.sethdr td.txt { + font-weight: bold; +} .edit_frm .invoice_layout table.invi th.currency, .edit_frm .invoice_layout table.invi th.num, .edit_frm .invoice_layout table.invi td.currency, .edit_frm .invoice_layout table.invi td.num { text-align: right; white-space: nowrap; diff --git a/Fuchs/wwwroot/web/fis.inv.de.js b/Fuchs/wwwroot/web/fis.inv.de.js index c67871c..a6d3108 100644 --- a/Fuchs/wwwroot/web/fis.inv.de.js +++ b/Fuchs/wwwroot/web/fis.inv.de.js @@ -34,6 +34,8 @@ let $rct = { svcPart: 'Service-Anteil', vat: 'Umsatzsteuer', combP: 'Positionen zusammenfassen', + toSetP: 'Auf Setpreis umstellen (Positionen ohne Preis)', + toSetPc: 'Der Set-Preis wird auf die Summe seiner Positionen gesetzt und die Positionen selbst verlieren ihren Preis. Das ist nicht rückgängig zu machen (der Betrag kann danach nur noch manuell geändert werden). Fortfahren?', iSum: 'Zwischensumme', dtRel: 'Freigegeben am: ', dtCr: 'Erstellt am: ', @@ -169,16 +171,10 @@ let $ict = { rovlh: 'Übersicht der bisherigen Mahnungen', rovl: ['Betreff', 'Betrag', 'Betrag gezahlt', 'fertiggestellt am'], remHR: ['Rechnung', 'vom', 'Rechnungsbetrag', 'bereits bezahlt', 'noch offen'], - remt: { - f: ['Sehr geehrte Damen und Herren,', 'ein Mahnschreiben sollte kurz, freundlich und erfolgreich sein. Kurz ist es, freundlich sowieso; ob es auch erfolgreich ist, hängt von Ihnen ab.'] - , m: ['Sehr geehrte Damen und Herren,', 'nun müssen wir Sie noch einmal anschreiben.', 'Wahrscheinlich haben Sie triftige Gründe dafür, warum Sie die Zahlung unserer Forderung nicht vornehmen und auch nicht auf unsere Mahnung reagieren. Sollten wir darüber nicht einmal sprechen?', 'Bitte nehmen Sie umgehend in dieser Sache mit uns Kontakt auf.'] - , l: ['Sehr geehrte Damen und Herren,', 'Eine DRITTE MAHNUNG zu erhalten bereitet Ihnen bestimmt ebenso wenig Freude wie uns, sie zu verschicken. Leider haben wir auf unsere zweite Mahnung noch keine Antwort von Ihnen erhalten.", "Wir bitten Sie, den offenen Betrag innerhalb der nächsten 7 Werktage nach Erhalt dieses Schreibens zu begleichen. Nach Ablauf dieser Frist erfolgt keine weitere Mahnung mehr.', 'Sollte die Forderung bis dahin nicht beglichen sein, eröffnen wir das gerichtliche Mahnverfahren. Sollten Sie die Rechnung inzwischen beglichen haben, so betrachten Sie bitte dieses Schreiben als gegenstandslos.'] - }, - remt2: { - f: ['Wir bitten Sie, den noch offenen Rechnungsbetrag innerhalb einer Woche auf unser Konto zu überweisen.', 'Sollten Sie den Betrag bereits überwiesen haben, so bitten wir Sie, diese Zahlungserinnerung als gegenstandslos zu betrachten.'] - , m: ['Um Ihnen zusätzliche Kosten für weitere Mahnungen zu ersparen, bitten wir Sie nunmehr um die Überweisung des noch zu zahlenden Gesamtbetrages inklusive der ggf. bereits fälligen Mahnzinsen und Mahngebühren innerhalb von einer Woche.'] - , l: [] - }, payi: { account: 'Konto', name: 'Zahler', text: 'Verw.Zweck', InvoiceID: 'Rechnung', amount: 'Betrag', date: 'Datum', manual: 'Typ'} + // Reminder intro/closing notice texts are backend-authoritative (see FuchsPdf.BuildReminderNotes / + // $inv.rd.notes) — no client-side copies here. + translatePaymentTerm: (pt) => (pt || '').replace('wd', ' Werktagen').replace('d', ' Tagen').replace('wk', ' Wochen') || '10 Tagen' + , payi: { account: 'Konto', name: 'Zahler', text: 'Verw.Zweck', InvoiceID: 'Rechnung', amount: 'Betrag', date: 'Datum', manual: 'Typ'} }, $invcol = { datev: new fields_definition('Rechnung', 'Rechnungen', [ { name: 'Umsatz (ohne Soll/Haben-Kz)', label: 'Umsatz (ohne Soll/Haben-Kz)', type: 'string' }, @@ -629,6 +625,11 @@ $inv.iMn = (ix) => { } return $('#topbar').ocmsmenu(m); } +/* Menu option CSV builder: 'setm' (Set-Preisanzeige) is only offered while the invoice has not + yet been explicitly switched to a set-display mode (admin.setmode empty/undefined) — once set, + changing it again is not supported (the user edits the line items directly instead); it + reappears only if 'Änderungen verwerfen' reverts to a DB state that was never switched. */ +$inv.emOpt = (admin) => 'iss,p13b,ctp' + (((admin || {}).setmode || '') === '' ? ',setm' : ''); $inv.eM = (r, re, opt) => { let m = []; if (booln(r, false) === true || booln(re, false) === true) { @@ -701,8 +702,24 @@ $inv.d = { let tbl = $inv.d.tbl(); if (tbl.length < 1) { return; } tbl.data('dver', state.version).data('serverSums', state.sums); $inv.d.footer(tbl, state.sums || {}, state.admin || {}); + $inv.d.notes(state.notes || []); $inv.d.validation(state.validation || []); $inv.d.applyPositions(tbl, state.req || []); + $inv.d.applySetDisplay(tbl, state.setDisplay || {}); + /* Keep the menu's "Set-Preisanzeige" entry in sync with the authoritative admin.setmode: + hides it right after a mode switch, and restores it if a discard reverted the draft to + a DB state that was never switched (ADR 0006 backend-authoritative refresh). */ + $inv.eM(false, true, $inv.emOpt(state.admin || {})); + }, + /* Renders the backend-authoritative notice paragraphs (ADR: notice texts are + backend-authoritative) exactly as FuchsPdf.BuildInvoiceNotes emits them for the PDF, + so the online editor always shows precisely what will be printed. */ + notes: function (notes) { + let frm = $inv.d.layout(); if (frm.length < 1) { return; } + let box = frm.children('.dnotes'); + if (box.length < 1) { box = $$.dc('dnotes'); frm.append(box); } + box.empty(); + (notes || []).forEach((n) => $$.dc('dnote').aC(n.style || 'InvoiceNotes').text(n.text)); }, /* Push the server's authoritative position numbers back onto the rendered rows so the online editor and the PDF preview always agree (the server numbers priced lines continuously; the @@ -714,6 +731,23 @@ $inv.d = { if (cell.length) { cell.text(co.p != null ? co.p : ''); } })); }, + /* Applies the backend-authoritative set-pricing display flags (see BuildSetDisplay / + InvoiceSetPricing) onto the rendered rows: blanks the price/total cells for lines the + server says should show no price (set members in SetPrice mode, the set header in + ItemPrices mode), and emphasises the set header line — so the online editor always + shows exactly what the PDF will print, without duplicating the pricing rules client-side. + Rows not present in the map (no set in that block, or standalone items) are left untouched. */ + applySetDisplay: function (tbl, setDisplay) { + tbl.find('tr.itm').each((i, tr) => { + let rw = $(tr), dta = rw.data() || {}, id = (dta.Id || '').toString(); + if (id === '' || !Object.prototype.hasOwnProperty.call(setDisplay, id)) { return; } + let flags = setDisplay[id] || {}; + rw.tC('sethdr', bool(flags.h, false)); + if (bool(flags.p, true) === false) { + rw.find('td.currency').text(''); + } + }); + }, /* Send one change to the server; the draftReady signal and this success both refresh. */ sync: function (delta) { let t = $inv.d.token(); if (t === '') { return; } @@ -901,8 +935,23 @@ $inv.rd = { let tbl = $inv.rd.tbl(); if (tbl.length < 1) { return; } tbl.data('rdver', state.version).data('serverSums', state.sums).data('remid', state.remid || ''); $inv.rd.footer(tbl, state.sums || {}); + $inv.rd.notes(state.notes || {}); $inv.rd.validation(state.validation || []); }, + /* Renders the backend-authoritative intro/closing notice paragraphs (ADR: notice texts + are backend-authoritative) exactly as FuchsPdf.BuildReminderNotes emits them for the + PDF, so the online editor always shows precisely what will be printed. */ + notes: function (notes) { + let frm = $inv.rd.layout(); if (frm.length < 1) { return; } + let rq = frm.find('.srq'); if (rq.length < 1) { return; } + rq.children('.dnote').remove(); + let intro = (notes || {}).intro || [], first = rq.children().first(); + intro.slice().reverse().forEach((t) => { + let p = $$[0]('p').aC('dnote intro').rwText(t); + if (first.length) { p.insertBefore(first); } else { p.appendTo(rq); } + }); + ((notes || {}).closing || []).forEach((t) => $$[0]('p').aC('dnote closing').rwText(t).appendTo(rq)); + }, /* Send one change to the server; the draftReady signal and this success both refresh. */ sync: function (delta) { let t = $inv.rd.token(); if (t === '') { return; } @@ -926,10 +975,13 @@ $inv.rd = { $inv.rd.sync({ Target: 'amount', Value: (amount != null ? amount : 0).toString() }); $inv.rd.sync({ Target: 'amount_payed', Value: (amount_payed != null ? amount_payed : 0).toString() }); }, - /* Render the open-amount footer from the server sums. */ + /* Render the open-amount footer from the server sums. Detail rows ($inv.rRemRw) have + 6 columns (aux, invoiceid, date, amount, amount_payed, open); span the label over the + 4 columns between aux and the open-amount column so the total lands in the same last + column as the per-invoice open amounts. */ footer: function (tbl, sums) { let ft = tbl.children('tfoot').empty(); - let tr = $$.tr(ft, { class: 'tsum' }).append([$$.tdc('aux'), $$.td({ colspan: 3 }).text('Offener Betrag')]); + let tr = $$.tr(ft, { class: 'tsum' }).append([$$.tdc('aux'), $$.td({ colspan: 4 }).text('Offener Betrag')]); $$.tdc('currency', tr, fnum(sums.amount_open || 0, $rct.cst)); }, validation: function (msgs) { @@ -1172,7 +1224,7 @@ $inv.ccInv = function (ev) { //normale rechnung rif.tbl.children('tbody').each($inv.bdysort); rif.tbl.trigger('fds.inv'); /* trigger calculations */ - $inv.eM(false, true, 'iss,p13b,setm,ctp'); + $inv.eM(false, true, $inv.emOpt(admin)); }, complete: () => { o.c.trigger('modal_close'); } @@ -1317,7 +1369,7 @@ $inv.cntInv = function (data) { //invoice continuation rif.tbl.children('tbody').each($inv.bdysort); rif.tbl.trigger('fds.inv'); /* trigger calculations */ - $inv.eM(false, true, 'iss,p13b,setm,ctp'); + $inv.eM(false, true, $inv.emOpt(response.admin)); }, complete: () => { o.c.trigger('modal_close'); } @@ -1517,6 +1569,14 @@ $inv.rrw = function () { if (ph === false) { bc.unshift($$.dc('ibtn edit', { title: $rct.cP }).append(gi('pencil')).click(rw, $inv.eRow)); bc.push($$.dc('ibtn del', { title: $rct.dR }).append(gi('trash')).click(function (e) { if (confirm($rct.cD)) { rw.remove(); $inv.t_fds_inv(); } })); + /* "Auf Setpreis umstellen": only offered on a Set header item that is not yet + priced from its members (fds__prepInvoice's [SetItmId] is null exactly for a + Set header — either already set-priced, or not yet converted). Irreversible: + sets this row's price to the sum of its members (rows whose [SetItmId] equals + this row's id) and clears each member's price. */ + if ((dta.Type || '').toLowerCase() === 'set' && (dta.SetItmId || '') === '') { + bc.push($$.dc('ibtn tosetp', { title: $rct.toSetP }).append(gi('scale')).click(rw, $inv.toSetPrice)); + } } let axf = $$.dc('axf').append(bc); if (ph === true) { @@ -1562,6 +1622,36 @@ $inv.rrw = function () { rw.empty().attr('class', ph ? 'placeholder' : 'itm').aC(co.Typ).tC('hidenote', hn).append(tda); dta.co = co; }; +/* "Auf Setpreis umstellen" (see $inv.rrw): sets this Set-header row's price to the sum of + its member rows' totals (rows in the same block whose [SetItmId] equals this row's id, + the authoritative grouping from fds__prepInvoice), then clears each member's price so the + member items show without a price — matching the SetPrice presentation, but as an actual, + irreversible data change instead of a display-mode toggle (INVOICE_SET_PRICING.md's + setmode remains display-only and is unaffected by this). */ +$inv.toSetPrice = function (ev) { + let rw = ev.data, dta = rw.data(), id = (dta.Id || '').toString(); + if (id === '') { return; } + if (confirm($rct.toSetPc) === false) { return; } + let bdy = rw.closest('tbody'), members = bdy.find('tr.itm').filter(function () { + return (($(this).data('SetItmId') || '').toString()) === id; + }); + let sum_net_val = 0, sum_vat_val = 0, sum_svcnet_val = 0, sum_svcvat_val = 0; + members.each(function () { + let m = $(this).data(); + sum_net_val += (m.net_val || 0); + sum_vat_val += (m.vat_val || 0); + sum_svcnet_val += (m.svcnet_val || 0); + sum_svcvat_val += (m.svcvat_val || 0); + $.extend(m, { net: 0, net_val: 0, vat_val: 0, svcnet_val: 0, svcvat_val: 0, Discount: 0 }); + $inv.rrw.call($(this)); + }); + $.extend(dta, { + net: sum_net_val, quantityhours: 1, Discount: 0, + net_val: sum_net_val, vat_val: sum_vat_val, svcnet_val: sum_svcnet_val, svcvat_val: sum_svcvat_val + }); + $inv.rrw.call(rw); + $inv.t_fds_inv(); +}; $inv.invSumUpdate = function () { let tbl = $(this), ft = tbl.children('tfoot').empty(), p13b = bool((tbl.data().admin || {}).p13b || '', false); tbl.nextAll('.fnote').remove(); @@ -2088,7 +2178,10 @@ $inv.ccRem_s2 = function (id, sets) { //reminder creation //console.debug(response); let rem = response.rm || {}; let rq = $$.dc('srq', frm); - $ict.remt[rem.type].forEach(r => $$[0]('p').rwText(r).appendTo(rq)); + /* Intro/closing notice paragraphs are backend-authoritative (see $inv.rd.notes, + populated from FuchsPdf.BuildReminderNotes via rem/dstate after seeding below) — + they are appended/prepended into this same .srq container once the draft session + is open, so no client-side wording is constructed here. */ let rif = $$.tblset({ class: 'invi' }, rq); rif.ft = $$[0]('tfoot'); rif.tbl.data($.extend({ invid: rem.invid, new: {} }, response)); @@ -2096,7 +2189,6 @@ $inv.ccRem_s2 = function (id, sets) { //reminder creation $ict.remHR.forEach(h => $$.th(thr, h)); $inv.rRemRw.call($$.tr(rif.bdy), rif.tbl.data()); rif.ft.appendTo(rif.tbl); - $ict.remt2[rem.type].forEach(r => $$[0]('p').rwText(r).appendTo(rq)); let fm = (cls, txt, nme, hd, dta) => { let fr = $$.dc('inpfrm', frm).aC(cls).append(typeof hd === 'string' ? $$.dc('ahd', hd) : (hd > 0 ? $$.dc('ahd', $rct.frm[nme]) : null)), fc = $$.dc('content', fr).rwText(txt); diff --git a/Fuchs/wwwroot/web/fis.inv.de.min.js b/Fuchs/wwwroot/web/fis.inv.de.min.js index 594facd..e437160 100644 --- a/Fuchs/wwwroot/web/fis.inv.de.min.js +++ b/Fuchs/wwwroot/web/fis.inv.de.min.js @@ -1 +1 @@ -let $rct={mdl:"Aufträge",or:"offene Aufträge",orr:"offene Aufträge (4 W)",rn:"Auftragsnummer",iov:{all:"Auftragsübersicht (alle)","":"Auftragsübersicht"},wk:"Woche",nd:"Keine Daten gefunden.",h:"Uhr",rq1:"Auftragsdaten werden von MFR abgerufen.\nDer Vorgang kann bis zu 90Sek dauern.",rq2:"Auftragsdaten werden geladen",rq1f:"Die Auftragsdaten von MFR konnten nicht oder nicht schnell genug abgerufen werde.\nMöchten Sie mit den bestehenden Daten trotzdem weitermachen?",note1:"Im Bruttobetrag sind {0} Lohnkosten enthalten (netto {1}). Die darin enthaltene Umsatzsteuer beträgt {2}.",note2:"Bitte beachten Sie, nach §14 Abs. 1 Umsatzsteuergesetz ist diese Rechnung ein Zahlungsbeleg oder eine andere beweiskräftige Unterlage für 2 Jahre nach Ablauf des Kalenderjahres der Ausstellung dieser Rechnung aufzubewahren, soweit nicht aufgrund anderer gesetzlicher Regelungen andere ggf.längere Aufbewahrungsfristen gelten.",note3:"Privathaushalten erstattet das Finanzamt bis zu {0} des Arbeitslohns mit der nächsten Steuererklärung.",note4:"Für bereits erbrachte Arbeiten, Dienstleistungen, Materiallieferungen und getätigte Bestellvorgänge zum oben genannten Bauvorhaben, die sich aus dem mit Ihnen geschlossenen Vertrag ergeben, stellen wir Ihnen vertragsgemäß unsere Akontozahlung in Rechnung. Eine Endabrechnung erhalten Sie als Schlussrechnung nach Abschluss des gesamten Bauvorhabens. Das Ausführungsdatum entnehmen Sie bitte dem Schlusstext dieser Rechnung. Wir danken Ihnen herzlich für das entgegengebrachte Vertrauen und bitten Sie um kurzfristigen Ausgleich der Akontorechnung.",note13b:"Gem. §13b Umsatzsteuergesetz unterliegen Sie der Steuerschuldnerschaft des Leistungsempfängers zur Umsatzsteuer aus dieser Rechnung mit einem Steuersatz von 19%.",crI:"Rechnung erstellen",crII:"Abschlagsrechnung erstellen",dII:"Für eine Abschlagsrechnung darf nur ein Auftrag gewählt werden.",dnS:"Für eine Rechnung muss mindestens ein Auftrag gewählt werden.",inv:"Rechnung",invs:"Rechnungen",req:"Auftrag",provP:"Leistungszeitraum",provD:"Leistungsdatum",cP:"Position ändern",iRb:"Zeile darunter einfügen",dR:"Zeile löschen",sV:"USt festlegen",cD:"Löschen?",mR:"Zeile verschieben",svcPart:"Service-Anteil",vat:"Umsatzsteuer",combP:"Positionen zusammenfassen",iSum:"Zwischensumme",dtRel:"Freigegeben am: ",dtCr:"Erstellt am: ",rqV:"USt des Auftrags?",cthd:"wirklich aus-/einblenden ?",cst:{style:"currency",currency:"EUR"},sts:{IsWorkDone:"Arbeiten erledigt",Closed:"Auftrag geschlossen",SubcontractorPendingConfirmation:"Warten auf Bestätigung (Unterauftrag)",Scheduled:"Geplant",OfferIsRejected:"Angebot abgelehnt",OfferIsSend:"Offen (Angebot versandt)",CollaborationWaitingConfirmation:"Warten auf Bestätigung (Zusammenarbeit)",Released:"Freigegeben",OfferIsConfirmed:"Bestätigt",InProgress:"In Bearbeitung",ReadyForScheduling:"Zur Planung",Created:"Erstellt",Rejected:"Abgebrochen",Invoiced:"Rechnung gestellt","-":"-"},invHR:["Pos.","Menge","Artikelbezeichnung","VK","Summe"],frm:{invoiceaddress:"Adresse",loc:"Leistungsort / Lieferadresse",invoiceemail:"Email"}},$rcol={req:new fields_definition("Auftrag","Aufträge",[{name:"tags",label:"",type:"string",dfnc:function(e,t){""!==(e||"")&&($(this).aC("tags"),e.split(",").forEach((e=>{""!==e&&$(this).append($$.sc("tag "+e.replace(" ","_").replace("/","_").toLowerCase(),e))})))}},{name:"DateOfCreation",label:"Datum",type:"date",title:function(e){$(this).attr("title",$rct.dtCr+fdt(e.DateOfCreation).ne("-")+" \n"+$rct.dtRel+fdt(e.DateReleased).ne("-"))}},{name:"CustomerName",label:"Kunde (Firma)",type:"string"},{name:"Name",label:"Auftragsname",type:"string"},{name:"ExternalId",label:"Auftragsnummer",type:"string"},{name:"ParentExtenalId",label:"PAuftrag",type:"string"},{name:"InvoiceId",label:"RNummer",type:"string",dfnc:function(e,t){$(this).rwText(e," ").find("span").each((function(){$(this).aC("cla").click({id:$(this).text()},$inv.jdbn)}))}},{name:"State",label:"Status",type:"string"},{name:"WorkDoneAt",label:"Erledigt am",type:"date"},{name:"Description",label:"Beschreibung",type:"html"}]),itm:new fields_definition("Auftragsposition","Auftragspositionen",[{name:"NameOrNumber",label:"Bezeichnung",type:"string"},{name:"Type",label:"Typ",type:"select",required:!0,value:"Text",url:[{value:"Text",label:"Text"},{value:"Equipment",label:"Ausrüstung"},{value:"Material",label:"Material"},{value:"Service",label:"Arbeitsleistung"}],change:function(e){$req.quantChange.call(this,e)}},{name:"quantityhours",label:"Anzahl / Menge",type:"number",precision:"0.01",value:1,change:function(e){$inv.quantChange.call(this,e)}},{name:"UnitString",label:"Einheit",type:"select",url:["LFDM","Stck","Std.","QM","AW","Pauschal"],change:function(e){$inv.quantChange.call(this,e)}},{name:"net",label:"EinzelPreis netto",type:"number",precision:"0.01",value:0,change:function(e){$inv.quantChange.call(this,e)}},{name:"net_val",label:"GesamtPreis netto",type:"number",precision:"0.01",value:0},{name:"vat_val",label:"GesamtPreis USt",type:"number",precision:"0.01",value:0},{name:"svcnet_val",label:"Arbeitslohn netto",type:"number",precision:"0.01",value:0},{name:"svcvat_val",label:"Arbeitslohn USt",type:"number",precision:"0.01",value:0},{name:"net_pos",label:"Netto",type:"string"},{name:"bo_pos",label:"Brutto",type:"string"},{name:"vat",label:"USt",type:"string",value:"19,0%",change:function(e){$inv.quantChange.call(this,e)}},{name:"Note",label:"Details",type:"html",tinymce:!0}])},$ict={mdl:"Rechnungen",iov:{all:"Rechnungen (alle)","":"Rechnungen (nur fertige)","#d":"Rechnungen (nur Entwürfe)","#u":"Rechnungen (nur unbezahlt)","#r":"Rechnungen (nur angemahnt)","#a":"Rechnungen (nur Akonto)","#c":"Rechnungen (nur Storno)","#ru":"Rechnungen (nur angemahnt + unbez.)"},uba:", gesamter Zeitraum)",req:"Auftrag",inv:"Rechnung",rem:"Mahnung",in:"Rechnungsnummer",cc:"Kunde",wk:"Woche",nd:"Keine Daten gefunden.",dl:"Herunterladen",ed:"Bearbeiten",ced:"Bearbeitung fortsetzen",sItm:"Einzelheiten anzeigen",sPay:"Zahlungen anzeigen",cdI:"Entwurf der Rechnung löschen?",rel:"Neu Laden",relm:"Bitte laden Sie Liste manuell neu, um die Änderungen zu sehen.",dsp:"Rechnung anzeigen",storno:"Storno-Rechnung erstellen",credit:"Gutschrift erstellen",remd:"Mahnung erstellen",remdt:"Mahnung erstellen zur Rechnung {0}",remlst:"Mahnungen anzeigen",remdsp:"Mahnung anzeigen",remres:"Mahnung erneut senden",remresc:"Mahnung {0} wirklich erneut senden?",remresr:"Mahnung {0} wurde erfolgreich versandt.",setpyd:"Bezahlt markieren",cpyd:"Rechnung wirklich als bezahlt markieren?",setupd:"Bezahlt-Markierung aufheben",cupd:"Bezahlt-Markierung wirklich aufheben?",ivE:"Die Email-Adresse ist vermutlich nicht gültig.",ivEc:"\nMöchten Sie fortfahren?",pna:"Diese Seite ist in der Vorschau nicht verfügbar",tpe:"Die Anzahl von {0} Seiten wird aktuell nicht unterstützt",eis:"Der Rechnungsentwurf konnte nicht gespeichert werden.",iss:"Zwischenstand speichern.",p13b:"USt -> §13b",setm:"Set-Preisanzeige",setmo:{setprice:"Set mit Preis – Positionen ohne Preis",itemprices:"Positionen mit Preis – Set als Überschrift",setonly:"Nur Set mit Preis – Positionen ausgeblendet"},ctp:"Ansprechpartner festlegen",mfr:"Von MFR neu abrufen",rq1:"Auftragsdaten werden von MFR abgerufen.\nDer Vorgang kann bis zu 90Sek dauern.",rq2:"Auftragsdaten werden geladen",iq1:"Rechnungsdaten werden von MFR abgerufen.\nDer Vorgang kann bis zu 90Sek dauern.",iq2:"Rechnungsdaten werden geladen",sis:"Rechnung als versandt markieren",srs:"Mahnung als versandt markieren",sisc:"Rechnung wirklich als versandt markieren?",srsc:"Mahnung wirklich als versandt markieren?",iSt:{dft:"Entwurf",uns:"nicht versandt",pyd:"bezahlt",cc:"storniert",op:"offen",due:"fällig",ovd:"überfällig",rem:"angemahnt"},rSt:["","Überfällig","2. Mahnung","3. Stufe"],pSt:{a:"Vollst.",p:"Teilz."},ivT:{i:"AbschlagsR.",f:"SchlussR",r:"Rechnung",c:"StornoR."},rovlh:"Übersicht der bisherigen Mahnungen",rovl:["Betreff","Betrag","Betrag gezahlt","fertiggestellt am"],remHR:["Rechnung","vom","Rechnungsbetrag","bereits bezahlt","noch offen"],remt:{f:["Sehr geehrte Damen und Herren,","ein Mahnschreiben sollte kurz, freundlich und erfolgreich sein. Kurz ist es, freundlich sowieso; ob es auch erfolgreich ist, hängt von Ihnen ab."],m:["Sehr geehrte Damen und Herren,","nun müssen wir Sie noch einmal anschreiben.","Wahrscheinlich haben Sie triftige Gründe dafür, warum Sie die Zahlung unserer Forderung nicht vornehmen und auch nicht auf unsere Mahnung reagieren. Sollten wir darüber nicht einmal sprechen?","Bitte nehmen Sie umgehend in dieser Sache mit uns Kontakt auf."],l:["Sehr geehrte Damen und Herren,",'Eine DRITTE MAHNUNG zu erhalten bereitet Ihnen bestimmt ebenso wenig Freude wie uns, sie zu verschicken. Leider haben wir auf unsere zweite Mahnung noch keine Antwort von Ihnen erhalten.", "Wir bitten Sie, den offenen Betrag innerhalb der nächsten 7 Werktage nach Erhalt dieses Schreibens zu begleichen. Nach Ablauf dieser Frist erfolgt keine weitere Mahnung mehr.',"Sollte die Forderung bis dahin nicht beglichen sein, eröffnen wir das gerichtliche Mahnverfahren. Sollten Sie die Rechnung inzwischen beglichen haben, so betrachten Sie bitte dieses Schreiben als gegenstandslos."]},remt2:{f:["Wir bitten Sie, den noch offenen Rechnungsbetrag innerhalb einer Woche auf unser Konto zu überweisen.","Sollten Sie den Betrag bereits überwiesen haben, so bitten wir Sie, diese Zahlungserinnerung als gegenstandslos zu betrachten."],m:["Um Ihnen zusätzliche Kosten für weitere Mahnungen zu ersparen, bitten wir Sie nunmehr um die Überweisung des noch zu zahlenden Gesamtbetrages inklusive der ggf. bereits fälligen Mahnzinsen und Mahngebühren innerhalb von einer Woche."],l:[]},payi:{account:"Konto",name:"Zahler",text:"Verw.Zweck",InvoiceID:"Rechnung",amount:"Betrag",date:"Datum",manual:"Typ"}},$invcol={datev:new fields_definition("Rechnung","Rechnungen",[{name:"Umsatz (ohne Soll/Haben-Kz)",label:"Umsatz (ohne Soll/Haben-Kz)",type:"string"},{name:"vf",label:"vf",type:"string"},{name:"Soll/Haben-Kennzeichen",label:"Soll/Haben-Kennzeichen",type:"string"},{name:"Konto",label:"Konto",type:"string"},{name:"Gegenkonto",label:"Gegenkonto",type:"string"},{name:"BU-Schlüssel",label:"BU-Schlüssel",type:"string"},{name:"Belegdatum",label:"Belegdatum",type:"string"},{name:"Belegfeld 1",label:"Belegfeld 1",type:"string"},{name:"Belegfeld 2",label:"Belegfeld 2",type:"string"},{name:"Buchungstext",label:"Buchungstext",type:"string"}]),inv:new fields_definition("Rechnung","Rechnungen",[{name:"invstatus",label:"Status",type:"select",url:$ict.iSt},{name:"balance",label:"Umsatz",type:"string",dtype:"currency"},{name:"CustomerName",label:"Kunde",type:"string"},{name:"InvoiceId",label:"RNummer",type:"string"},{name:"InvoiceType",label:"Typ",type:"select",url:$ict.ivT},{name:"request",label:"Auftrag",type:"string",dtype:"num"},{name:"vat",label:"MwSt",type:"string",dtype:"num"},{name:"deb_cred",label:"Soll/Haben",type:"string"},{name:"customer",label:"Konto",type:"string",dtype:"num"},{name:"contra_account",label:"Gegenkonto",type:"string",dtype:"num"},{name:"Belegdatum",label:"Belegdatum",type:"date"},{name:"reminderstatus",label:"MahnStatus",type:"select",url:$ict.rSt},{name:"reminder",label:"# Mahnungen",type:"integer"},{name:"Buchungstext",label:"Buchungstext",type:"string"},{name:"Payment",label:"Zahlung",type:"string"}]),rem:new fields_definition("Zahlungserinnerung","Zahlungserinnerung",[{name:"amount",label:"Rechnungsbetrag",type:"number",precision:"0.01",value:1},{name:"amount_payed",label:"bereits bezahlt",type:"number",precision:"0.01",value:1}]),rem2:new fields_definition("Zahlungserinnerung","Zahlungserinnerung",[{name:"DocumentName",label:"Name",type:"string"},{name:"subject",label:"Betreff",type:"string"},{name:"DateSent",label:"Versanddatum",type:"date"},{name:"status",label:"Status",type:"string"},{name:"amount_open",label:"offener Betrag",type:"number",precision:"0.01"},{name:"InvoiceId",label:"RNummer",type:"string"}]),rid:new fields_definition("Zahlungserinnerung","Zahlungserinnerung",[{name:"type",label:"Typ",type:"select",url:[["f","einfache Zahlungserinnerung"],["m","Mahnung"],["l","letzte Mahnung"]],required:!0},{name:"level",label:"Stufe",type:"select",url:[["1","Stufe 1"],["2","Stufe 2"],["3","Stufe 3"],["4","Stufe 4"],["5","Stufe 5"],["6","Stufe 6"]],required:!0}]),ctp:new fields_definition("Ansprechpartner","Ansprechpartner",[{name:"name",label:"Name",type:"string"},{name:"email",label:"Email",type:"string"}])},gi=(e,t)=>$$.sc("glyphicon glyphicon-"+e).aC(t),$inv={init2:function(e,t){e=e||"inv",t=t||{},$ocms.getScript([],(function(){$inv.init3(e,t)}))},init3:async function(e,t){$fis.cf(!0);let n=$fis.lf(!0);$("#topbar").ocmsmenu([]),$("#activemodule").text($ict.mdl);let i=[(async()=>{await $fis.getAuth("fds_inv")>0&&($inv.prepLst(""),n.aC("fix"))})(),new Promise(((e,t)=>{$fis.prepAuth(["fds_reminder"])}))];await Promise.all(i)},prepLst:function(e){let t=new Date,n=$fis.lf(!0).ldng(1),i=new Date("2021-01-01");$fis.frm_list().IN((function(){}));let a=[];$.each($ict.iov,((e,t)=>{a.push({lbl:t,fnc:()=>{$inv.prepLst(e),n.aC("fix")}})})),$fis.lfm().ocmsmenu([{lbl:"Filter",itm:a}]);$$.i({placeholder:$ict.in}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$inv.renderinv("i:"+n,"s","all"),t.val(""))})),$$.i({placeholder:$ict.cc}).appendTo($$.dc("mth ivc",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>=3&&(t.parent().aC("selected"),$inv.renderinv("c:"+n,"s","all"),t.val(""))}));"#"===e.substr(0,1)&&$$.dc("mth extra",n).text($ict.iov[e].replace(")",$ict.uba)).click((function(t){let n=$(this);if(t.stopPropagation(),n.siblings().rC("selected"),!0===n.is(".selected")){n.toggleClass("selected");let t=fdt(new Date,"yy-MM-dd");$inv.renderinv(t,"a",e)}n.aC("selected")})),n.append("
");let r=$$.dc("mthl",n),l=t.getFullYear(),s=t.getMonth()+1;for(let t=i.getFullYear();t<=l;t++){let n=$$.dc("yr").prependTo(r).text($ict.iov[e]+" - "+t.toString()).toggleClass("selected",t===l);n.click({yr:t},(function(e){e.stopPropagation(),n.siblings().rC("selected"),n.aC("selected")}));let a=$$.dc("mfrm",n);for(let n=0;n<(t!==l?12:s);n++){i=new Date(t,n,1);let r=$$.dc("mth").prependTo(a).text($ict.iov[e]+" - "+fdt(i,"MMM yyyy"));if(r.click({yr:t,mt:n},(function(t){if(t.stopPropagation(),r.siblings().rC("selected"),!0===r.is(".selected")){r.toggleClass("selected");let n=fdt(new Date(t.data.yr,t.data.mt,1),"yy-MM-dd");$inv.renderinv(n,"m",e)}r.aC("selected")})),""===e){$$.dc("mthdl",r).append(gi("compressed","ico")).click({yr:t,mt:n},(function(e){e.stopPropagation();let t=fdt(new Date(e.data.yr,e.data.mt,1),"yy-MM-dd");$inv.downloadzip(t,"m")}))}let l=getMonday(i),s=new Date(i);s.setMonth(s.getMonth()+1),s.setDate(0),s=getMonday(s);let d=$$.dc("wfrm",r);for(;l<=s;){let t=$$.dc("wk",d).text(($ict.wk||"W")+" "+fdt(l,"dd.MM.yy"));t.click({rd:new Date(l)},(function(n){n.stopPropagation();let i=fdt(n.data.rd,"yy-MM-dd");$inv.renderinv(i,"w",e),r.siblings().rC("selected").find(".wk").rC("selected"),r.aC("selected").find(".wk").rC("selected"),t.aC("selected")})),$$.dc("wkdl",t).append(gi("compressed","ico")).click({rd:new Date(l)},(function(e){e.stopPropagation();let t=fdt(e.data.rd,"yy-MM-dd");$inv.downloadzip(t,"w")})),l.setDate(l.getDate()+7)}}}n.ldng(0)},rerenderinv:function(){let e=$("#contentframe .invfrm:first");if(e.length>0){let t=e.data("sets")||{};t.mode&&$inv.renderinv(t.tgt,t.mode,t.includes)}},renderinv:function(e,t,n){let i=$fis.frm_list(!0,!0).ldng(1),a=$$.dc("invfrm",i).aC("md"+t).data("sets",$.extend({},{tgt:e,mode:t,includes:n})),r=$fis.lf();$ocms.postXT({url:$ocms.url("inv/invl"),data:{mode:t,tgt:e,includes:n},success:i=>{r.rC("fix").aC("hd"),$$.dc("ovhd",a).text(i.admin.title);let l=$$.tblset({},a),s=$invcol.inv,d=$$.tr(l.hd);$$.th(d);$.each(s.fields||[],((e,t)=>{$$.th(d).text(t.label),"vat"===t.name&&$$.th(d)})),$.each(i.invoices||[],((d,c)=>{let o=$$.tr(l.bdy);o.click((function(){r.rC("fix").aC("hd"),o.toggleClass("selected").siblings().rC("selected").find("td.av").rC("av"),o.find("td.av").rC("av"),!0===o.is(".selected")?$inv.iMn(c):$inv.eM()}));let u=$$.td(o,{class:"raux"});c.hasFile?($$.dc("idl ilbtn",u,{title:$ict.dl+"\n"+c.DocumentName}).append(gi("save-file","ico")).click({id:c.Id},$inv.downloadinv),$$.dc("idl ilbtn",u,{title:$ict.dsp+"\n"+c.DocumentName}).append(gi("eye-open","ico")).click({id:c.Id,typ:"inv"},$inv.jdisp)):!1===c.isFinal&&!0===$fis.isAuth("fds_inv",2)&&$$.dc("idl ilbtn",u,{title:$ict.ed}).append(gi("edit","ico")).click({id:c.Id},$inv.doContInv),$$.dc("iitm ilbtn",u,{title:$ict.sItm}).append(gi("list","ico")).click({id:c.Id},$inv.showitm),$$.dc("iitm ilbtn",u,{title:$ict.sPay}).append(gi("euro","ico")).click({id:c.Id},$inv.showpay),$.each(s.fields||[],((r,l)=>{let s,d,u=$$.td(o).aC(l.dtype);switch("select"===(l.type||"")?u.text((l.url||{})[c[l.name]]||""):u.text(c[l.name]),l.name||""){case"vat":s=$$.sel().appendTo($$.td(o,{class:"vsel"})),d=(i.admin.ust_options||"19,0%;16,0%;0,0%").split(";"),$.each(d,((e,t)=>{$$.opt(t,t).appendTo(s)})),s.click((function(e){e.stopPropagation()})).val(c[l.name]).change().change({frm:a,tgt:e,mode:t,id:c.Id,td:u,includes:n},$inv.setvat),u.toggleClass("hl",c[l.name].substr(0,2)!==d[0].substr(0,2)).click((function(e){e.stopPropagation(),$(this).toggleClass("av")}));break;case"balance":u.aC("sh_"+(c.SollHaben||"").toLowerCase());break;case"invstatus":case"reminderstatus":u.aC(("invstatus"===l.name?"is_":"rs_")+c[l.name])}}))}))},complete:()=>{i.ldng(0)}})},setvat:function(e){let t=$(this),n=e.data||{};$ocms.postXT({url:$ocms.url("inv/setvat"),data:{id:n.id,val:t.val()},success:e=>{n.td.rC("av"),$inv.renderinv(n.tgt,n.mode,n.includes)}})},downloadzip:function(e,t){$(this).empty();window.open($ocms.url("inv/datevzip?mode="+t+"&tgt="+encodeURIComponent(e)),"_blank")},showitm:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&$ocms.postXT({url:$ocms.url("inv/rqi"),data:{id:e.data.id},success:e=>{let t=$$.dc("rfrm");(e.requests||[]).length<1?t.text($ict.nd):$.each(e.requests||[],(function(e,n){let i=$$.dc("srq",t);$$.dc("nme",i).text(n.name);let a=$$.tblset({class:"if"},i);$.each(n.items||[],((e,t)=>{let n=$$.tr({id:"itm"+t.Id}).appendTo(a.bdy);$$.td(n).text(t.NameOrNumber),$$.td(n).text(t.Type),$$.td(n).aC("currency").text(t.net_pos),$$.td(n).aC("currency").text(t.bo_pos),$$.td(n).aC("num").text(t.vat)}))})),$ocms.dlg(t,{width:1e3})}})},showpay:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&$ocms.postXT({url:$ocms.url("inv/pyi"),data:{id:e.data.id},success:e=>{let t=$$.dc("rfrm");if((e.payments||[]).length<1)t.text($ict.nd);else{let n=$$.tblset({class:"if"},t),i=$$.tr(n.hd);$.each(["date","account","name","text","InvoiceID","amount","manual"],((e,t)=>{$$.th(i,$ict.payi[t])})),$.each(e.payments,((e,t)=>{let i=$$.tr({id:"itm"+t.banking_uid}).appendTo(n.bdy);$$.td(i).aC("date").text(t.date),$$.td(i).text(t.account),$$.td(i).text(t.name),$$.td(i).text(t.text),$$.td(i).text(t.InvoiceID),$$.td(i).aC("currency").text(t.amount),$$.td(i).text(t.manual)}))}$ocms.dlg(t,{width:1e3,title:"Übersicht der Zahlungen"})}})},downloadinv:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&window.open($ocms.url("inv/rdoc?id="+e.data.id),"_blank")},doContInv:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&$inv.cntInv({id:e.data.id})}},$$inv={init2:$inv.init2,auth:{}};export default $$inv;$inv.cInv=function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&!1!==$fis.isAuth("fds_inv",2)&&$inv.cInv2({id:e.data.id})},$inv.rMn=e=>{let t=[{lbl:$ict.req,itm:[]}];return!0===bool(e,!1)&&!0===$fis.isAuth("fds_inv",2)&&Array.prototype.push.apply(t[0].itm,[{lbl:$rct.crI,fnc:$inv.ccInv,data:{typ:"r"}},{lbl:$rct.crII,fnc:$inv.ccInv,data:{typ:"i"}}]),t.push({lbl:$ict.rel,fnc:$inv.rReload}),$("#topbar").ocmsmenu(t)},$inv.iMnr=e=>{let t=booln(e.isFinal,!0),n=e.Id,i=booln(e.fds,!1),a=[{glyph:"glyphicon-menu-left",fnc:()=>{$fis.frm_edit().remove()}},{lbl:$ict.inv,itm:[]},{lbl:$ict.rem,itm:[]}];return!1===t&&!0===$fis.isAuth("fds_inv",2)?a[1].itm.push({lbl:$ict.ced,fnc:$inv.clCntInv}):!0===$fis.isAuth("fds_inv",1)&&a[1].itm.push({lbl:$ict.dsp,fnc:()=>$inv.disp(n,"inv")}),!0===i&&!0===t&&!0===$fis.isAuth("fds_inv",2)&&(a[1].itm.push({lbl:$ict.storno,fnc:()=>$inv.storno(n,i)}),a[1].itm.push({lbl:$ict.credit,fnc:()=>$inv.credit(n,i)})),!0===t&&!0===$fis.isAuth("fds_reminder",2)&&(a[2].itm.push({lbl:$ict.remd,fnc:()=>$inv.ccRem(n,e.InvoiceId)}),a[2].itm.push({lbl:$ict.remlst,fnc:()=>$inv.dspRem(n)})),!0===t&&!0===$fis.isAuth("fds_reminder",2)&&!1===booln(e.IsSent,!1)&&a[2].itm.push({lbl:$ict.srs,fnc:()=>$inv.srs(n)}),a.push({lbl:$ict.rel,fnc:$inv.rReload}),$("#topbar").ocmsmenu(a)},$inv.iMn=e=>{let t=booln(e.isFinal,!0),n=e.Id,i=booln(e.fds,!1),a=[{glyph:"glyphicon-menu-left",fnc:()=>{$fis.frm_edit().remove()}},{lbl:$ict.inv,itm:[]},{lbl:$ict.rem,itm:[]}];return!1===t&&!0===$fis.isAuth("fds_inv",2)?a[1].itm.push({lbl:$ict.ced,fnc:()=>{$inv.cntInv({id:n})}}):!0===$fis.isAuth("fds_inv",1)&&a[1].itm.push({lbl:$ict.dsp,fnc:()=>$inv.disp(n,"inv")}),!0===$fis.isAuth("fds_inv",2)&&(a[1].itm.push({lbl:$ict.storno,fnc:()=>$inv.storno(n,i)}),a[1].itm.push({lbl:$ict.credit,fnc:()=>$inv.credit(n,i)})),!0===t&&!1===booln(e.IsPayed,!1)?(!0===$fis.isAuth("fds_reminder",2)&&a[2].itm.push({lbl:$ict.remd,fnc:()=>$inv.ccRem(n,e.InvoiceId)}),!0===$fis.isAuth("fds_inv",2)&&a[1].itm.push({lbl:$ict.setpyd,fnc:()=>$inv.setPyd(n)})):!0===t&&!0===booln(e.IsPayed,!1)&&"m"===(e.PaymentStatus||"")&&!0===$fis.isAuth("fds_inv",2)&&a[1].itm.push({lbl:$ict.setupd,fnc:()=>$inv.setUpd(n)}),!0===$fis.isAuth("fds_reminder",2)&&a[2].itm.push({lbl:$ict.remlst,fnc:()=>$inv.dspRem(n)}),!0===t&&!0===$fis.isAuth("fds_inv",2)&&!1===booln(e.IsSent,!1)&&a[1].itm.push({lbl:$ict.sis,fnc:()=>$inv.sis(n)}),!1===i&&a[1].itm.push({lbl:$ict.mfr,fnc:()=>$inv.mfrrel(n)}),$("#topbar").ocmsmenu(a)},$inv.eM=(e,t,n)=>{let i=[];return!0!==booln(e,!1)&&!0!==booln(t,!1)||i.push({glyph:"glyphicon-menu-left",fnc:()=>{$fis.lf(!0),$fis.frm_edit().remove()}}),!0===(n||"").split(",").includes("iss")&&i.push({lbl:$ict.iss,fnc:$inv.ssave}),!0===(n||"").split(",").includes("ctp")&&i.push({lbl:$ict.ctp,fnc:$inv.sctp}),!0===(n||"").split(",").includes("p13b")&&i.push({lbl:$ict.p13b,fnc:$inv.sp13b}),!0===(n||"").split(",").includes("setm")&&i.push({lbl:$ict.setm,fnc:$inv.ssetmode}),!0===(n||"").split(",").includes("iss")&&(i.push({lbl:"Änderungshistorie",fnc:()=>$inv.d.history()}),i.push({lbl:"Änderungen verwerfen",fnc:()=>$inv.d.discard()})),!0===booln(e,!1)&&i.push({lbl:$ict.rel,fnc:$inv.rReload}),$("#topbar").ocmsmenu(i)},$inv.d={tbl:()=>$("div.invoice_layout table.invi"),layout:()=>$("div.invoice_layout"),token:function(){return $inv.d.tbl().data("dtoken")||""},hashes:function(){let e=$inv.d.tbl().data("bai")||[],t={};return $.each(e,((e,n)=>{t[(n.Id||"").toString()]=JSON.stringify(n)})),t},seed:function(e){let t=$inv.d.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dopen"),data:{payload:JSON.stringify(e)},success:e=>{$inv.d.tbl().data("dtoken",e.token).data("dver",e.version).data("dhashes",$inv.d.hashes()).data("dorder",$inv.d.order()),$fis.draft.bind(e.token,{onReady:()=>$inv.d.refresh(),onExpiring:e=>$inv.d.warnExpiry(e),onClosed:e=>$inv.d.closed(e)}),$inv.d.refresh()},error:()=>{t.rC("freeze")},complete:()=>{$inv.d.tbl().removeData("dseeding")}})},refresh:function(e){let t=$inv.d.token();""!==t&&$ocms.postXT({url:$ocms.url("inv/dstate"),data:{token:t},success:t=>{$inv.d.applyState(t),"function"==typeof e&&e(t)},error:e=>{e&&410===e.status&&$inv.d.closed("expired")},complete:()=>{$inv.d.layout().rC("freeze")}})},applyState:function(e){let t=$inv.d.tbl();t.length<1||(t.data("dver",e.version).data("serverSums",e.sums),$inv.d.footer(t,e.sums||{},e.admin||{}),$inv.d.validation(e.validation||[]),$inv.d.applyPositions(t,e.req||[]))},applyPositions:function(e,t){(t||[]).forEach((t=>(t&&t.itm||[]).forEach((t=>{if(!t||""===(t.id||""))return;let n=e.find("#itm"+t.id+" td.keep").first();n.length&&n.text(null!=t.p?t.p:"")}))))},sync:function(e){let t=$inv.d.token();""!==t&&($inv.d.layout().aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dpatch"),data:{token:t,delta:JSON.stringify(e)},success:()=>{$inv.d.refresh()},error:e=>{$inv.d.layout().rC("freeze"),e&&410===e.status&&$inv.d.closed("expired")}}))},order:function(){return($inv.d.tbl().data("bai")||[]).map((e=>(e.Id||"").toString()))},syncChanged:function(e){if(""===$inv.d.token())return;let t=e.data("bai")||[],n=e.data("dhashes")||{},i={},a=[],r=[];$.each(t,((e,t)=>{let r=(t.Id||"").toString(),l=JSON.stringify(t);i[r]=l,n[r]!==l&&a.push(t)})),$.each(n,(e=>{void 0===i[e]&&r.push(e)}));let l=$inv.d.order(),s=e.data("dorder")||[];e.data("dhashes",i).data("dorder",l),a.forEach((e=>$inv.d.sync({Target:"block.replace",Ref:(e.Id||"").toString(),Value:e}))),r.forEach((e=>$inv.d.sync({Target:"block.remove",Ref:e}))),s.length===l.length&&s.slice().sort().join(",")===l.slice().sort().join(",")&&s.join(",")!==l.join(",")&&$inv.d.sync({Target:"block.order",Value:l})},syncField:function(e,t){if(""===$inv.d.token())return;let n={invoicetitle:"title",invoiceaddress:"address",invoiceemail:"email",loc:"provisionlocation",provisionlocation:"provisionlocation",provisionperiod:"provisionperiod"}[e];n&&$inv.d.sync({Target:n,Value:t})},footer:function(e,t,n){let i=e.children("tfoot").empty();e.nextAll(".fnote").remove();let a=bool(n.p13b,!1),r=(e,t,n)=>$$.tdc("currency",$$.tr(i,{class:n||"tsum"}).append([$$.tdc("aux"),$$.td({colspan:4}).text(e)]),fnum(t,$rct.cst)),l=t=>$$.dc("fnote").insertAfter(e).rwText(t);r("Netto",t.total_net||0),!1===a&&$.each(t.vat||{},((e,t)=>r($rct.vat+" "+e+"%",t,"tvat"))),r("Summe",t.total_gross||0);let s=n.type||"";"i"===s?(l($rct.note2),l($rct.note4)):"c"===s?l($rct.note2):(l(string($rct.note3,[fnum(((t.service_net||0)+(t.service_vat||0))*(n.tax_servicerefund||0),$rct.cst)])).aC("ntax"),l($rct.note2),l(string($rct.note1,[fnum((t.service_net||0)+(t.service_vat||0),$rct.cst),fnum(t.service_net||0,$rct.cst),fnum(t.service_vat||0,$rct.cst)]))),!0===a&&l($rct.note13b)},validation:function(e){let t=$("div.invoice_layout");if(t.length<1)return;let n=t.children(".dvalidation");n.length<1&&(n=$$.dc("dvalidation"),t.prepend(n)),n.empty().tC("hidden",(e||[]).length<1),$.each(e||[],((e,t)=>$$.dc("dvmsg",n).aC(t.severity).text(t.message)))},preview:function(){let e=$inv.d.token();if(""===e)return;let t=$inv.d.layout(),n=($inv.d.tbl().data("new")||{}).invoiceemail||"";!1===$fis.ValidateEmail(n)&&!1===bool(confirm($ict.ivE+$ict.ivEc),!1)||(t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dpreview"),data:{token:e},success:n=>{t.rC("freeze");let i=$$.dc("imagecollection pdfpreview"),a=Math.round(.88*vh()),r=n.total;r>10&&$$.dc("note warn",i).text($ict.tpe),$.each(n.img||[],((e,t)=>{$$.dc("pdfp",i).append($$.img(t).css("max-height",(a-rpx(6)).toString()+"px"))}));for(let e=(n.img||[]).length+1;e<=r;e++)$$.dc("pdfp ph",i).append($$.dc("note",$ict.pna));$ocms.dlg(i,{size:[a,Math.round(.88*vw())],zindex:50,form:!1,button:$rct.crI,confirm:function(n){let i=$(this);t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dsave"),data:{token:e},success:e=>{$ocms.postXT({url:$ocms.url("req/sconf"),data:{id:e.invid},success:t=>{i.trigger("modal_close"),!0===t.hasFile&&window.open($ocms.url("req/idoc")+"?id="+e.invid,"_blank"),$inv.d.close(),$ocms.init("req"),$inv.rReload()},error:()=>{alert($t.f1),i.trigger("modal_close")},complete:()=>{t.rC("freeze")}})},error:()=>{t.rC("freeze"),alert($ict.eis)}})},cancel:function(e){confirm($ict.cdI)&&($inv.d.close(),$inv.rReload())}})},error:()=>{t.rC("freeze"),alert($ict.eis)}}))},save:function(){let e=$inv.d.token();if(""===e)return;let t=$inv.d.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dsave"),data:{token:e},success:e=>{$inv.d.tbl().data("invid",e.invid)},error:()=>{alert($ict.eis)},complete:()=>{t.rC("freeze")}})},history:function(){let e=$inv.d.token();""!==e&&$ocms.postXT({url:$ocms.url("inv/dhistory"),data:{token:e},success:e=>{let t=$$.dc("dhist");if((e.history||[]).length<1)$$.dc("note",t).text("Noch keine Änderungen erfasst.");else{let n=$$.tblset({class:"invtbl fullwidth"},t);$$.tr(n.hd).append([$$.th().text("Zeit"),$$.th().text("Feld"),$$.th().text("Alt"),$$.th().text("Neu")]),$.each(e.history,((e,t)=>$$.tr(n.bdy).append([$$.tdc("keep",fdt(t.timestamp)),$$.td().text(t.target),$$.td().text(t.oldValue),$$.td().text(t.newValue)])))}$ocms.dlg(t,{width:800,form:!1})}})},discard:function(){let e=$inv.d.tbl().data("invid")||"";""!==e?!1!==confirm("Alle Änderungen verwerfen und den zuletzt gespeicherten Stand neu laden?")&&($inv.d.close(),$inv.cntInv({id:e})):alert("Es wurde noch kein Zwischenstand gespeichert, der wiederhergestellt werden könnte.")},warnExpiry:function(e){let t=Math.max(1,Math.round((e||0)/60));$fis.notifications.push({severity:"info",title:"Entwurf läuft ab",message:"Der Rechnungsentwurf läuft in etwa "+t+" Minute(n) ab. Bitte zwischenspeichern, sonst gehen die Änderungen verloren."})},closed:function(e){let t=$inv.d.token();$inv.d.tbl().removeData("dtoken"),""!==t&&$fis.draft.release(t),$fis.frm_edit().remove(),$fis.lf(!0),$fis.notifications.push({severity:"error",title:"Entwurf geschlossen",message:"expired"===e?"Der Rechnungsentwurf ist wegen Inaktivität abgelaufen. Nicht gespeicherte Änderungen sind verloren.":"Der Rechnungsentwurf wurde geschlossen."});try{$inv.rReload()}catch(e){}},close:function(){let e=$inv.d.token();""!==e&&($ocms.postXT({url:$ocms.url("inv/dclose"),data:{token:e}}),$fis.draft.release(e)),$inv.d.tbl().removeData("dtoken")}},$inv.rd={tbl:()=>$("div.invoice_layout table.invi"),layout:()=>$("div.invoice_layout"),token:function(){return $inv.rd.tbl().data("rdtoken")||""},seed:function(e){let t=$inv.rd.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dopen"),data:{payload:JSON.stringify(e)},success:e=>{$inv.rd.tbl().data("rdtoken",e.token).data("rdver",e.version),$fis.draft.bind(e.token,{onReady:()=>$inv.rd.refresh(),onExpiring:e=>$inv.rd.warnExpiry(e),onClosed:e=>$inv.rd.closed(e)}),$inv.rd.refresh()},error:()=>{t.rC("freeze")}})},refresh:function(e){let t=$inv.rd.token();""!==t&&$ocms.postXT({url:$ocms.url("rem/dstate"),data:{token:t},success:t=>{$inv.rd.applyState(t),"function"==typeof e&&e(t)},error:e=>{e&&410===e.status&&$inv.rd.closed("expired")},complete:()=>{$inv.rd.layout().rC("freeze")}})},applyState:function(e){let t=$inv.rd.tbl();t.length<1||(t.data("rdver",e.version).data("serverSums",e.sums).data("remid",e.remid||""),$inv.rd.footer(t,e.sums||{}),$inv.rd.validation(e.validation||[]))},sync:function(e){let t=$inv.rd.token();""!==t&&($inv.rd.layout().aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dpatch"),data:{token:t,delta:JSON.stringify(e)},success:()=>{$inv.rd.refresh()},error:e=>{$inv.rd.layout().rC("freeze"),e&&410===e.status&&$inv.rd.closed("expired")}}))},syncField:function(e,t){if(""===$inv.rd.token())return;let n={subject:"subject",invoiceaddress:"address",invoiceemail:"email",text:"text"}[e];n&&$inv.rd.sync({Target:n,Value:t})},syncAmount:function(e,t){""!==$inv.rd.token()&&($inv.rd.sync({Target:"amount",Value:(null!=e?e:0).toString()}),$inv.rd.sync({Target:"amount_payed",Value:(null!=t?t:0).toString()}))},footer:function(e,t){let n=e.children("tfoot").empty(),i=$$.tr(n,{class:"tsum"}).append([$$.tdc("aux"),$$.td({colspan:3}).text("Offener Betrag")]);$$.tdc("currency",i,fnum(t.amount_open||0,$rct.cst))},validation:function(e){let t=$inv.rd.layout();if(t.length<1)return;let n=t.children(".dvalidation");n.length<1&&(n=$$.dc("dvalidation"),t.prepend(n)),n.empty().tC("hidden",(e||[]).length<1),$.each(e||[],((e,t)=>$$.dc("dvmsg",n).aC(t.severity).text(t.message)))},preview:function(){let e=$inv.rd.token();if(""===e)return;let t=$inv.rd.layout(),n=($inv.rd.tbl().data("new")||{}).invoiceemail||"";!1===$fis.ValidateEmail(n)&&!1===bool(confirm($ict.ivE+$ict.ivEc),!1)||(t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dpreview"),data:{token:e},success:n=>{t.rC("freeze");let i=$$.dc("imagecollection pdfpreview"),a=Math.round(.88*vh());$.each(n.img||[],((e,t)=>{$$.dc("pdfp",i).append($$.img(t).css("max-height",(a-rpx(6)).toString()+"px"))})),$ocms.dlg(i,{size:[a,Math.round(.88*vw())],zindex:50,form:!1,button:$ict.remd,confirm:function(n){let i=$(this);t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dsave"),data:{token:e},success:e=>{$ocms.postXT({url:$ocms.url("rem/conf"),data:{id:e.remid},success:()=>{i.trigger("modal_close"),window.open($ocms.url("rem/idoc")+"?id="+e.remid,"_blank"),$inv.rd.close(),$ocms.init("req"),$inv.rReload()},error:()=>{alert($t.f1),i.trigger("modal_close")},complete:()=>{t.rC("freeze")}})},error:()=>{t.rC("freeze"),alert($t.f1)}})},cancel:function(e){confirm($ict.cdI)&&($inv.rd.close(),$inv.rReload())}})},error:()=>{t.rC("freeze"),alert($t.f1)}}))},save:function(){let e=$inv.rd.token();if(""===e)return;let t=$inv.rd.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dsave"),data:{token:e},success:e=>{$inv.rd.tbl().data("remid",e.remid)},error:()=>{alert($t.f1)},complete:()=>{t.rC("freeze")}})},history:function(){let e=$inv.rd.token();""!==e&&$ocms.postXT({url:$ocms.url("rem/dhistory"),data:{token:e},success:e=>{let t=$$.dc("dhist");if((e.history||[]).length<1)$$.dc("note",t).text("Noch keine Änderungen erfasst.");else{let n=$$.tblset({class:"invtbl fullwidth"},t);$$.tr(n.hd).append([$$.th().text("Zeit"),$$.th().text("Feld"),$$.th().text("Alt"),$$.th().text("Neu")]),$.each(e.history,((e,t)=>$$.tr(n.bdy).append([$$.tdc("keep",fdt(t.timestamp)),$$.td().text(t.target),$$.td().text(t.oldValue),$$.td().text(t.newValue)])))}$ocms.dlg(t,{width:800,form:!1})}})},warnExpiry:function(e){let t=Math.max(1,Math.round((e||0)/60));$fis.notifications.push({severity:"info",title:"Entwurf läuft ab",message:"Der Mahnentwurf läuft in etwa "+t+" Minute(n) ab. Bitte zwischenspeichern, sonst gehen die Änderungen verloren."})},closed:function(e){let t=$inv.rd.token();$inv.rd.tbl().removeData("rdtoken"),""!==t&&$fis.draft.release(t),$fis.frm_edit().remove(),$fis.lf(!0),$fis.notifications.push({severity:"error",title:"Entwurf geschlossen",message:"expired"===e?"Der Mahnentwurf ist wegen Inaktivität abgelaufen. Nicht gespeicherte Änderungen sind verloren.":"Der Mahnentwurf wurde geschlossen."});try{$inv.rReload()}catch(e){}},close:function(){let e=$inv.rd.token();""!==e&&($ocms.postXT({url:$ocms.url("rem/dclose"),data:{token:e}}),$fis.draft.release(e)),$inv.rd.tbl().removeData("rdtoken")}},$inv.cInv2=function(e){let t=$$.dc("rfrm").ldng(1),n=$ocms.dlg(t,{width:1e3});n&&n.ft.rwText($rct.rq1);let i=()=>{$ocms.postXT({url:$ocms.url("req/get"),timeout:60,data:{id:e.id,mode:"r"},success:t=>{t.admin=t.admin||{};let n=$fis.lf(!0).aC("fix").rC("hd");if($fis.frm_edit().IN(),$inv.eM(!0,!0),(t.requests||[]).length<1)n.aC("fix").text($rct.nd);else{$$.dc("lh",n,$rct.mdl);let i=$$.d(),a=$$.ul({class:"rql"}).data({search:e.id,parent:t.admin.parent}).appendTo(n),r={},l=$rcol.req.lbl();$.each(t.requests||[],(function(e,t){let n=$$.li({class:"cli rli"}).data($.extend({},t)).appendTo(a),s=$$.dc("lihd",n).addClass(t.state);!0===booln(t.open,!1)&&s.append($$.sc("cbox").click((()=>{n.tC("checked"),i.find("li").rC("checked"),!0===n.is(".checked")?$inv.rMn(t.open):$inv.eM(!0)}))),s.append([$$.sc("eid",t.ExternalId),$$.sc("nme",t.Name)]),$$.dc("lidt",n).append([$$.dc("rqs").append([$$.s(l.State+": "),$$.s($rct.sts[t.State||"-"])]),$$.dc("ivn").append([$$.s(l.InvoiceId+": "),$$.s(t.InvoiceId||"- -")]),$$.dc("wda").append([$$.s(l.WorkDoneAt+": "),$$.s(fdt(t.WorkDoneAt,"dd.MM.yyyy"))])]),r[t.Id]=n})),(t.inv||[]).length>0&&($$.dc("lh",n,$rct.invs),i=$$.ul({class:"ivl"}).appendTo(n),$.each(t.inv||[],((e,t)=>{let n=$$.li({class:"cli ili"}).data($.extend({},t)).appendTo(i),r=$$.dc("lihd",n).addClass(t.invstatus);!1===booln(t.isFinal,!0)?r.append($$.sc("cbox").click((()=>{""!==(t.Id||"")&&(n.tC("checked").siblings().rC("checked"),a.find("li").rC("checked"),!0===n.is(".checked")?$inv.iMnr(t):$inv.eM(!0))}))):["","dft"].indexOf(t.invstatus)<0&&r.append($$.sc("dli").click((function(){$inv.disp(t.Id,"inv")}))),r.append($$.sc("nme",t.DocumentName||t.Id)),$$.dc("lidt",n).append([$$.dc("wda").append([$$.s(fdt(t.DateCreated,"dd.MM.yyyy"))]),$$.d().text($ict.iSt[t.invstatus]||t.invstatus)])})))}},complete:()=>{n&&n.c.trigger("modal_close")}})};$ocms.postXT({url:$ocms.url("req/pget"),timeout:90,data:{id:e.id},success:e=>{n&&n.ft.rwText($rct.rq2),i()},error:()=>{confirm($rct.rq1f)?(n&&n.ft.rwText($rct.rq2),i()):n&&n.c.trigger("modal_close")}})},$inv.ccInv=function(e){let t=(e.data||{}).typ||"r",n=$fis.lf(),i=n.children("ul.rql"),a=i.data("parent"),r=[];if(i.find("li.rli.checked").each((function(){r.push($(this).data("Id"))})),r.length<1)return void alert($rct.dnS);if("i"===t&&r.length>1)return void alert($rct.dII);let l=$fis.frm_edit(),s=$$.dc("invoice_layout",l).append($$.dc("btn sprev").click($inv.sprev)),d=$fis.cf().width()>s.width()+n.width()+20;n.tC("fix",d).tC("hd",!d),$inv.eM(!1,!0);let c=$$.dc("rfrm").ldng(1),o=$ocms.dlg(c,{width:1e3});o.ft.rwText($rct.rq2),$ocms.postXT({url:$ocms.url("req/iget"),timeout:60,data:{id:a,mode:"ful",typ:t,sel:r.join(",")},success:e=>{let t=$$.dc("srq",s),n=$$.tblset({class:"invi"},t);n.bdy.remove(),n.ft=$$[0]("tfoot"),e.admin=e.admin||{},e.admin.p13b=bool(e.admin.p13b||"",!0===((e.inv||{}).InvoiceOptions||"").split(",").includes("§13b")),n.tbl.data($.extend({new:{},sms:{},itm:{}},{admin:e.admin,companies:e.companies,locations:e.locations}));let i=$$.tr(n.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(i,e))),n.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.requests||[],(function(t,i){if(0!==(i.Id||0)){let t=$inv.worknotes(i);i.text="i"===e.admin.type?$rct.req+jine([i.ExternalId,i.Name],": ").eine(" ",""):jine([jine([fdt(i.WorkDoneAt,"dd.MM.yy"),i.ExternalId]," - "+$rct.req+" "),t.ne(i.Name)],": \n");let a=$$.tbody(n.tbl).data($.extend({},i));$inv.rendersrq.call(a)}}));let a=$$.tr($$.tbody(n.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(a),n.ft.appendTo(n.tbl);let r,l,d=e.admin||{},c=(e,t,i,a,r)=>{let l=$$.dc("inpfrm",s).aC(e).append("string"==typeof a?$$.dc("ahd",a):a>0?$$.dc("ahd",$rct.frm[i]):null),d=$$.dc("content",l).rwText(t);$$.dc("axf",l).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:d,nme:i,change:e=>{n.tbl.data("new")[i]=e}},r),$inv.eHtml)),n.tbl.data("new")[i]=t};c("tfrm",d.invoicetitle,"invoicetitle",0,null),c("adrfrm",d.invoiceaddress,"invoiceaddress",0,null),c("locfrm","","loc",1,{list:deepCopy(e.locations),lbl:"ref",property:"address"}),c("emailfrm",d.invoiceemail,"invoiceemail",0,null),$$.dc("sndfrm",s).append($$.dc("content").text(d.sender)),d.provisionend&&(l=d.provisionstart?$rct.provP:$rct.provD,r=d.provisionstart?fdt(d.provisionstart,"dd.MM.yyyy")+" - "+fdt(d.provisionend,"dd.MM.yyyy"):fdt(d.provisionend,"dd.MM.yyyy")),c("admfrm",r,"provisionperiod",l,1),n.tbl.data("new").CustomValues=d.CustomValues||"",$$.dc("inpfrm ctpfrm",s).text(jObj(d.CustomValues,"contactName")),n.tbl.children("tbody").each($inv.bdysort),n.tbl.trigger("fds.inv"),$inv.eM(!1,!0,"iss,p13b,setm,ctp")},complete:()=>{o.c.trigger("modal_close")}})},$inv.ccStInv=function(e){let t=e.data||{},n=$fis.lf(),i=t.id,a=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.sprev)),r=$fis.cf().width()>a.width()+n.width()+20;n.tC("fix",r).tC("hd",!r),$inv.eM(!1,!0);let l=$$.dc("rfrm").ldng(1),s=$ocms.dlg(l,{width:1e3});s.ft.rwText($ict.iq1),$ocms.postXT({url:$ocms.url("inv/pget"),timeout:90,data:{id:t.id},success:e=>{s&&s.ft.rwText($ict.iq2),$ocms.postXT({url:$ocms.url("inv/icget"),timeout:60,data:{id:i},success:e=>{let t=$$.dc("srq",a),n=$$.tblset({class:"invi"},t);n.bdy.remove(),n.ft=$$[0]("tfoot"),e.admin=e.admin||{},e.admin.p13b=bool(e.admin.p13b||"",!0===((e.inv||{}).InvoiceOptions||"").split(",").includes("§13b")),n.tbl.data($.extend({new:{},sms:{},itm:{}},{admin:e.admin,companies:e.companies,locations:e.locations}));let i=$$.tr(n.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(i,e))),n.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.requests||[],(function(t,i){if(0!==(i.Id||0)){let t=$inv.worknotes(i);i.text="i"===e.admin.type?$rct.req+jine([i.ExternalId,i.Name],": ").eine(" ",""):jine([fdt(i.WorkDoneAt,"dd.MM.yy")+t.ne(i.Name)],": ");let a=$$.tbody(n.tbl).data($.extend({},i));$inv.rendersrq.call(a)}}));let r=$$.tr($$.tbody(n.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(r),n.ft.appendTo(n.tbl);let l,s,d=e.admin||{},c=(e,t,i,r,l)=>{let s=$$.dc("inpfrm",a).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),d=$$.dc("content",s).rwText(t);$$.dc("axf",s).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:d,nme:i,change:e=>{n.tbl.data("new")[i]=e}},l),$inv.eHtml)),n.tbl.data("new")[i]=t};c("tfrm",d.invoicetitle,"invoicetitle",0,null),c("adrfrm",d.invoiceaddress,"invoiceaddress",0,null),c("locfrm",d.provisionlocation,"loc",1,{list:deepCopy(e.locations),lbl:"ref",property:"address"}),c("emailfrm",d.invoiceemail,"invoiceemail",0,null),$$.dc("sndfrm",a).append($$.dc("content").text(d.sender)),d.provisionend&&(s=d.provisionstart?$rct.provP:$rct.provD,l=d.provisionstart?fdt(d.provisionstart,"dd.MM.yyyy")+" - "+fdt(d.provisionend,"dd.MM.yyyy"):fdt(d.provisionend,"dd.MM.yyyy")),c("admfrm",l,"provisionperiod",s,1),n.tbl.data("new").CustomValues=d.CustomValues||"",$$.dc("inpfrm ctpfrm",a).text(jObj(d.CustomValues,"contactName")),n.tbl.children("tbody").each($inv.bdysort),n.tbl.trigger("fds.inv")},complete:()=>{s.c.trigger("modal_close")}})},error:()=>{s&&s.c.trigger("modal_close")}})},$inv.clCntInv=function(e){let t=$fis.lf(!1),n=[];t.find("li.ili.checked").each((function(){n.push($(this).data("Id"))})),1===n.length&&$inv.cntInv({id:n[0]})},$inv.cntInv=function(e){e=e||{};$fis.lf(!1).rC("fix").aC("hd");let t=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.sedit));$inv.eM(!1,!0);let n=$$.dc("rfrm").ldng(1),i=$ocms.dlg(n,{width:1e3});i.ft.rwText($rct.rq2),$ocms.postXT({url:$ocms.url("inv/get"),timeout:60,data:{id:e.id},success:e=>{e.admin=e.admin||{};let n=e.inv||{},i=$$.dc("srq",t),a=$$.tblset({class:"invi"},i);a.bdy.remove(),a.ft=$$[0]("tfoot"),a.tbl.data($.extend({invid:n.Id,new:{},sms:{},itm:{},bai:[]},e));let r=$$.tr(a.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(r,e))),a.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.req||[],(function(e,t){let n=$$.tbody(a.tbl).data($.extend({},t));$inv.rendersrq.call(n)}));let l=$$.tr($$.tbody(a.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(l),a.ft.appendTo(a.tbl);let s=(e,n,i,r,l)=>{let s=$$.dc("inpfrm",t).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),d=$$.dc("content",s).rwText(n);$$.dc("axf",s).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:d,nme:i,change:e=>{a.tbl.data("new")[i]=e}},l),$inv.eHtml)),a.tbl.data("new")[i]=n};s("tfrm",n.InvoiceTitle,"invoicetitle",0,null),s("adrfrm",n.SendToAddress,"invoiceaddress",0,null),s("locfrm",n.ProvisionLocation,"loc",1,null),s("emailfrm",n.SendToEmail,"invoiceemail",0,null),$$.dc("sndfrm",t).append($$.dc("content").text(e.admin.sender)),s("admfrm",n.ProvisionPeriod,"provisionperiod",!0===(n.ProvisionPeriod||"").includes("-")?$rct.provP:$rct.provD,1),a.tbl.data("new").CustomValues=n.CustomValues||"",$$.dc("inpfrm ctpfrm",t).text(jObj(n.CustomValues,"contactName")),a.tbl.children("tbody").each($inv.bdysort),a.tbl.trigger("fds.inv"),$inv.eM(!1,!0,"iss,p13b,setm,ctp")},complete:()=>{i.c.trigger("modal_close")}})},$inv.cSt=function(e){e=e||{};let t=$fis.lf(),n=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.sedit)),i=$fis.cf().width()>n.width()+t.width()+20;t.tC("fix",i).tC("hd",!i),$inv.eM(!1,!0);let a=$$.dc("rfrm").ldng(1),r=$ocms.dlg(a,{width:1e3});r.ft.rwText($ict.iq1),$ocms.postXT({url:$ocms.url("inv/pget"),data:{id:e.id},success:t=>{r&&r.ft.rwText($ict.iq2),$ocms.postXT({url:$ocms.url("inv/storno"),data:{id:e.id,mode:e.mode},success:e=>{e.admin=e.admin||{},e.admin.p13b=bool(e.admin.p13b||"",!0===((e.inv||{}).InvoiceOptions||"").split(",").includes("§13b"));let t=e.inv||{},i=$$.dc("srq",n),a=$$.tblset({class:"invi"},i);a.bdy.remove(),a.ft=$$[0]("tfoot"),a.tbl.data($.extend({invid:t.Id,new:{},sms:{},itm:{},bai:[]},e));let r=$$.tr(a.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(r,e))),a.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.req||[],(function(e,t){let n=$$.tbody(a.tbl).data($.extend({},t));$inv.rendersrq.call(n)}));let l=$$.tr($$.tbody(a.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(l),a.ft.appendTo(a.tbl);let s=(e,t,i,r,l)=>{let s=$$.dc("inpfrm",n).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),d=$$.dc("content",s).rwText(t);$$.dc("axf",s).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:d,nme:i,change:e=>{a.tbl.data("new")[i]=e}},l),$inv.eHtml)),a.tbl.data("new")[i]=t};s("tfrm",t.InvoiceTitle,"invoicetitle",0,null),s("adrfrm",t.SendToAddress,"invoiceaddress",0,null),s("locfrm",t.ProvisionLocation,"loc",1,null),s("emailfrm",t.SendToEmail,"invoiceemail",0,null),$$.dc("sndfrm",n).append($$.dc("content").text(e.admin.sender)),s("admfrm",t.ProvisionPeriod,"provisionperiod",!0===(t.ProvisionPeriod||"").includes("-")?$rct.provP:$rct.provD,1),a.tbl.data("new").CustomValues=t.CustomValues||"",$$.dc("inpfrm ctpfrm",n).text(jObj(t.CustomValues,"contactName")),a.tbl.children("tbody").each($inv.bdysort),a.tbl.trigger("fds.inv")},complete:()=>{r.c.trigger("modal_close")}})},error:()=>{r&&r.c.trigger("modal_close")}})},$inv.eHtml=function(e){let t=$(this),n=e.data instanceof jQuery?e.data:e.data.t,i=["invoiceemail","provisionperiod","invoicetitle"].includes(e.data.nme),a=i?[{name:"txt",label:"Text",type:"text",value:n.text()}]:[{name:"txt",label:"Text",type:"html",value:n.html(),tinymce:!0,attr:{style:"height: 300px"}}],r=e.data.change||null,l={title:t.data("dialog")||"",success:function(t){i?n.text(t.txt||""):n.html(t.txt),"function"==typeof r&&r(t.txt),$inv.d.syncField(e.data.nme,i?t.txt||"":t.txt),$inv.rd.syncField(e.data.nme,i?t.txt||"":t.txt)},tinymce:{valid_elements:"br",hidemenu:!0,hidetoolbar:!0}};if(Array.isArray(e.data.list)){let t=$$.dc("lstfrm");$.each(e.data.list,((n,i)=>{let a=$$.dc("li",t).append(""!==(e.data.lbl||"")?$$.dc("lbl").rwText(i[e.data.lbl]):null);$$.dc("adr",a).rwText(i[e.data.property]).data("val",i[e.data.property]).click((function(){let e=$(this),t=e.closest(".modal-body").find(':input[name="txt"]');t.is(".tinymce")?tinymce.get(t.attr("id")).setContent($$.s().rwText(e.data("val")).html()):"TEXTAREA"===t.prop("tagName")?t.val(e.data("val")).change():t.rwText(e.data("val"))}))})),l.addcontent=t}$ocms.dlgform(a,l)},$inv.setVat=function(e){$(this);let t=e.data,n=prompt($rct.rqV);n&&(n=parseFloat(n.replace("%","")),n>1&&(n*=.01),!1===isNaN(n)&&(t.siblings(".itm").each((function(){let e=$(this).data();e.vat=fnum(n,{style:"percent"}).replace(" ",""),(e.net_val||0)>0&&(e.vat_val=e.net_val*n),(e.svcnet_val||0)>0&&(e.svcvat_val=e.svcnet_val*n)})),$inv.t_fds_inv()))},$inv.inRow=function(e){let t=$(this),n=e.data,i={},a=$rcol.itm.clone(["SortOrder","NameOrNumber","Type","quantityhours","UnitString","net","svcnet_val","svcvat_val","net_val","vat_val","vat","Note"]),r="N"+(65536*(1+Math.random())||0).toString(16).substr(6),l=$$.tr({id:"itm_"+r.toString(),class:"itm"});$ocms.dlgform(a,{title:t.data("dialog")||"",success:function(e){l.data($.extend({Id:r},i,e)),$inv.rrw.call(l),l.insertAfter(n),$inv.t_fds_inv()},typedvalues:!0})},$inv.eRow=function(e){let t=$(this),n=e.data,i=n.data()||{},a=["SortOrder","NameOrNumber","Type","quantityhours","UnitString","net","svcnet_val","svcvat_val","net_val","vat_val","vat","Note"];i.id||""!==(i.Type||"")||a.unshift("Type");let r=$rcol.itm.clone(a).applyValues(i);r.set("Type","hidden","type"),$inv.eRw.call(t,n,i,r)},$inv.eRw=function(e,t,n){let i=$(this);$ocms.dlgform(n,{title:i.data("dialog")||"",success:function(n){let i={};""===(t.Id||"")&&(i.Id="N"+(65536*(1+Math.random())||0).toString(16).substr(6),e.attr("id","itm_"+i.Id.toString())),i.quantity=((n.quantityhours||"").toString()+" "+(n.UnitString||"").toString()).trimEnd(),e.data($.extend({},t,n,i)),console.debug("eRw success %o",e.data()),$inv.rrw.call(e),$inv.t_fds_inv()},typedvalues:!0})},$inv.bdysort=(e,t)=>{$(t).Sortable({dragItem:!1,dragHandleClass:"ico",parentident:"tr",onend:()=>{$inv.t_fds_inv()}})},$inv.rrw=function(){let e=$(this),t=e.data(),n={},i=e.is(".placeholder"),a=e.is(".hidenote"),r=e=>$$.d().append(e).html(),l=[$$.dc("ibtn insb",{title:$rct.iRb}).append(gi("indent-left")).click(e,$inv.inRow)];!1===i&&(l.unshift($$.dc("ibtn edit",{title:$rct.cP}).append(gi("pencil")).click(e,$inv.eRow)),l.push($$.dc("ibtn del",{title:$rct.dR}).append(gi("trash")).click((function(t){confirm($rct.cD)&&(e.remove(),$inv.t_fds_inv())}))));let s=$$.dc("axf").append(l);!0===i?n={id:"",typ:"placeholder"}:!0===e.is(".itm.osum")?n={invrqid:t.InvRqId,id:"osum"+e.index(),typ:"osum",p:"",q:null,t:r(t.tbl.tbl),tt:null,v:null,vt:t.net_val,vs:t.svcnet_val,vat:t.vat,vv:t.vat_val,vsv:t.svcvat_val,det:!1}:(n={invrqid:t.InvRqId,id:t.Id||"",typ:t.Type||"other",p:"",q:null,t:"",tt:null,v:null,vt:t.net_val,vs:t.svcnet_val,vat:t.vat,vv:t.vat_val,vsv:t.svcvat_val,det:""!==(t.Note||"")&&!1===a},$$.dc("ibtn ico move",s,{title:$rct.mR}),n.p=t.position||t.SortOrder||"",""===n.id?n.t="":["Text","Title"].includes(n.typ)&&0===(t.net_val||0)?n.t=t.htmltext||("#"!==(t.NameOrNumber||"").substr(0,1)?r($$[0]("p").text(t.NameOrNumber)):"")+(t.Note||""):(n.tt=n.det?"":$$.s(t.Note||"").text(),n.q=t.quantity||fnum(t.quantityhours)+" "+(t.UnitString||""),n.t=t.htmltext||(n.det?r($$.s(t.NameOrNumber||""))+r($$.dc("desc").html(t.Note)):r($$.s(t.NameOrNumber||""))),n.v=t.net,n.vt=t.net_val)),""!==(t.Note||"")&&$$.dc("ibtn add",s).append(gi("object-align-left")).click((function(t){$inv.rrw.call(e.tC("hidenote"))}));let d=[$$.tdc("aux").append(s),$$.tdc("keep").text(n.p)];""===n.id?d.push($$.td(e,{colspan:4}).append(n.t)):(Array.prototype.push.apply(d,n.q?[$$.tdc("keep").text(n.q)]:[]),Array.prototype.push.apply(d,[$$.tdc("txt",{colspan:n.q?1:2,title:n.tt}).append(n.t),$$.tdc("currency").text(fnum(n.v,$rct.cst)),$$.tdc("currency inetval").text(fnum(n.vt,$rct.cst)).attr("title",$rct.svcPart+": "+fnum(n.vs,$rct.cst))])),e.empty().attr("class",i?"placeholder":"itm").aC(n.Typ).tC("hidenote",a).append(d),t.co=n},$inv.invSumUpdate=function(){let e=$(this),t=e.children("tfoot").empty(),n=bool((e.data().admin||{}).p13b||"",!1);e.nextAll(".fnote").remove();let i={ttn:0,ttb:0,ttvat:0,tscn:0,tscvat:0,vat:{},itmnet:{}},a=[],r=(e,n,i)=>$$.tdc("currency",$$.tr(t,{class:i||"tsum"}).append([$$.tdc("aux"),$$.td({colspan:4}).text(e)]),fnum(n,$rct.cst)),l=t=>$$.dc("fnote").insertAfter(e).rwText(t),s=e.children("tbody");s.each(((e,t)=>{let n=$(t),r=n.data()||{},l=[],s=[],d=null,c=0,o=n.find("tr.itm"),u=0;n.tC("empty",o.length<1),o.each(((e,t)=>{let n=$(t).data()||{};!function(e,t,n){t.tscn+=e.svcnet_val||0,t.tscvat+=e.svcvat_val||0,t.ttn+=e.net_val||0,t.ttvat+=e.vat_val||0,t.ttb+=(e.net_val||0)+(e.vat_val||0),""!==(e.vat||"")&&(t.vat[e.vat]=(t.vat[e.vat]||0)+(e.vat_val||0))}(n,i,r.Id),c+=n.net_val||0,l.push(n.co);let a=$inv.itemToContract(n);"set"===a.type&&""!==a.id?d=a.id:null!==d&&""!==(a.id||"")&&(a.setId=d),s.push(a),(void 0===n.SortOrder||null===n.SortOrder?-1:n.SortOrder)>-1&&(!1===["text","title"].includes((n.Type||"other").toLowerCase())&&u++,n.SortOrder=0,n.position=u,$inv.rrw.call(t))})),n.find("tr.isum > td.isumval").text(fnum(c,$rct.cst)),a.push({Id:r.Id,nme:r.Name,text:r.text,itm:l,items:s,netval:c})}));let d=e.find("tbody:not(.empty)").length;s.find("tr.isum").tC("hidden",d<2),r("Netto",i.ttn),!1===n?$.each(i.vat,((e,t)=>{r($rct.vat+" "+e,t,"tvat")})):i.ttb=i.ttn,r("Summe",i.ttb);let c=e.data().admin.type;"i"===c?(l($rct.note2),l($rct.note4)):"c"===c?l($rct.note2):(l(string($rct.note3,[fnum((i.tscn+i.tscvat)*(e.data().admin.tax_servicerefund||0),$rct.cst)])).aC("ntax"),l($rct.note2),l(string($rct.note1,[fnum(i.tscn+i.tscvat,$rct.cst),fnum(i.tscn,$rct.cst),fnum(i.tscvat,$rct.cst)]))),!0===n&&l($rct.note13b),e.data("sms",i),e.data("bai",a),""===(e.data("dtoken")||"")&&!1===bool(e.data("dseeding"),!1)&&null!=(e.data("admin")||{}).type&&(e.data("dseeding",!0),$inv.d.seed($.extend($inv.invcPayload(e.data()),{invid:e.data("invid")||""})))},$inv.worknotes=function(e){let t="";return e.steps.forEach(((e,n)=>{let i;try{i=JSON.parse(e.Data||{}).fields||[]}catch(e){console.debug(e),i=[]}!0!==Array.isArray(i||"")&&(i="object"==typeof i&&!0===Array.isArray(i.field||"")?i.field:[]),i.forEach(((e,n)=>{"Ausgeführte Arbeiten"===e.name&&(t=e.result||"")}))})),t},$inv.rendersrq=function(){let e=$(this).empty(),t=e.is(".onesum"),n=e.data(),i=$$.tr(e,{id:"srq"+n.Id}).aC("title nosort"),a=($rcol.itm.lbl(),$$.dc("axf").appendTo($$.tdc("aux",i)));$$.dc("ibtn osum",a,{title:$rct.combP}).append(gi("euro")).click((function(t){e.tC("onesum"),$inv.rendersrq.call(e),$inv.t_fds_inv()})),$$.dc("ibtn setvat",a,{title:$rct.sV}).append(gi("gbp")).click(i,$inv.setVat),$$.dc("ibtn insb",a,{title:$rct.iRb}).append(gi("indent-left")).click(i,$inv.inRow);let r,l=$$.sc("text",n.text),s=($$.td(i,{colspan:t?4:5}).append(l),["net_val","vat_val","svcnet_val","svcvat_val","net"]);if($$.dc("ibtn edit",a).data("dialog",$rcol.req.lbl().Name).append(gi("pencil")).click({t:l,change:e=>{n.text=e,$inv.t_fds_inv()}},$inv.eHtml),t&&($$.tdc("currency isumval",i),r={Id:n.Id.toString()+"_osum",net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0},r.tbl=$$.tblset({class:"stbl"})),$.each(n.items||[],((n,i)=>{let a,l={Id:i.Id,net_val:i.net_val||0,vat_val:i.vat_val||0,svcnet_val:0,svcvat_val:0,net:i.net||0,Note:i.Note||""};if("service"===i.Type.toLowerCase())l.svcnet_val=i.net_val||0,l.svcvat_val=i.vat_val||0;t?(a=$$.tr(r.tbl.bdy,{id:"itm"+i.Id,class:"sitm"}).aC(i.Type),"Text"===i.Type||"Title"===i.Type?$$.td(a,{colspan:2}).html(i.htmltext||i.Note):($$.tdc("keep",a).text(i.quantity||((i.quantityhours||0)>0?fnum(i.quantityhours)+(i.UnitString||"").eine(" ",""):"")),i.htmltext?$$.tdc("txt",a).html(i.htmltext):$$.tdc("txt",a).text(i.NameOrNumber).attr("title",i.Note)),$.each(s,((e,t)=>{r[t]+=l[t]})),a.data(l)):($.extend(l,i),a=$$.tr(e,{id:"itm"+i.Id,class:"itm"}),a.data(l),$inv.rrw.call(a))})),t){let t=$$.tr(e,{id:"itmsq"+n.Id,class:"itm osum"}).data(r);$inv.rrw.call(t)}else{let t=$$.tr(e).aC("isum nosort");$$.tdc("aux",t),$$.td(t,{colspan:4}).text($rct.iSum),$$.tdc("currency isumval",t)}},$inv.t_fds_inv=()=>{let e=$("div.invoice_layout table.invi");e.trigger("fds.inv"),""!==(e.data("dtoken")||"")&&$inv.d.syncChanged(e)},$inv.sedit=()=>{$inv.sprev(!0)},$inv.jdisp=function(e){e.stopPropagation(),e.data.id&&$inv.disp(e.data.id,e.data.typ||"")},$inv.disp=(e,t)=>{let n="";switch(t){case"inv":n="inv/rdoc";break;case"rem":n="rem/rdoc"}""!==n&&$ocms.postXT({url:$ocms.url(n),data:{id:e||"",typ:"img"},success:e=>{let t=$$.dc("imagecollection pdfpreview"),n=Math.round(.88*vh());e.id;$.each(e.img||[],(function(e,i){$$.dc("pdfp",t).append($$.img(i).css("max-height",(n-rpx(6)).toString()+"px"))})),$ocms.dlg(t,{size:[n,Math.round(.88*vw())],zindex_min:50,form:!1,exclusive:!1})}})},$inv.jdbn=function(e){$ocms.postXT({url:$ocms.url("inv/rdocn"),data:{name:e.data.id||"",typ:"img"},success:e=>{let t=$$.dc("imagecollection pdfpreview"),n=Math.round(.88*vh());e.id;$.each(e.img||[],(function(e,i){$$.dc("pdfp",t).append($$.img(i).css("max-height",(n-rpx(6)).toString()+"px"))})),$ocms.dlg(t,{size:[n,Math.round(.88*vw())],zindex:50,form:!1})}})},$inv.sp13b=()=>{var e=$("div.invoice_layout").find("table.invi"),t=e.data();t.admin.p13b=!0,!1===(t.inv.InvoiceOptions||"").split(",").includes("§13b")&&(t.inv.InvoiceOptions+=",§13b"),e.trigger("fds.inv"),$inv.d.sync({Target:"p13b",Value:t.admin.p13b})},$inv.itemToContract=function(e){let t=((e=e||{}).Type||"").toString().toLowerCase(),n={id:(e.Id||"").toString(),type:t,title:"",desc:"",qty:"",price_net:"",total_net:e.net_val||0,vat:e.vat||""};var i;return e.co&&"osum"===e.co.typ?(n.desc=e.co.t||"",n.total_net=e.net_val||0):["text","title"].includes(t)&&0===(e.net_val||0)?(n.desc=e.htmltext||("#"!==(e.NameOrNumber||"").substr(0,1)?(i=$$[0]("p").text(e.NameOrNumber||""),$$.d().append(i).html()):"")+(e.Note||""),n.total_net=""):(e.htmltext?n.desc=e.htmltext:(n.title=e.NameOrNumber||"",n.desc=e.Note||""),n.qty=e.quantity||(0!==(e.quantityhours||0)?fnum(e.quantityhours)+(e.UnitString?" "+e.UnitString:""):""),n.price_net=e.net||0,n.total_net=e.net_val||0),n},$inv.ssetmode=()=>{let e=$("div.invoice_layout").find("table.invi").data();e.admin=e.admin||{};let t,n=e.admin.setmode||"setprice",i=e=>$$.dc("btn",$ict.setmo[e]).tC("selected",n===e).click((()=>{t.c.trigger("modal_close"),$inv.setSetmode(e)})),a=$$.dc("choicefrm").append([i("setprice"),i("itemprices"),i("setonly")]);t=$ocms.dlg(a,{width:800})},$inv.setSetmode=e=>{let t=$("div.invoice_layout").find("table.invi").data();t.admin=t.admin||{},t.admin.setmode=e,t.inv=t.inv||{};let n=(t.inv.InvoiceOptions||"").split(",").filter((e=>""!==e&&0!==e.indexOf("setmode:")));e&&"setprice"!==e&&n.push("setmode:"+e),t.inv.InvoiceOptions=n.join(","),$inv.d.sync({Target:"setmode",Value:e})},$inv.sctp=()=>{let e=$invcol.ctp;$ocms.dlgform(e,{title:$ict.ctp,success:function(e){var t=$("div.invoice_layout"),n=t.find("table.invi").data();let i={};void 0!==n.new&&"{"===(n.new.CustomValues||"").substr(0,1)&&(i=JSON.parse(n.inv.CustomValues)),i.contactName=e.name,i.contactEmail=e.email,n.new.CustomValues=JSON.stringify(i),t.find(".ctpfrm").text(ne(e.name,e.email)),$inv.d.sync({Target:"contact",Value:{name:e.name,email:e.email}})},typedvalues:!0})},$inv.invcPayload=function(e){let t=(e=e||{}).sms||{},n=$.extend({},e.new),i=$.extend({},e.admin);return n.total_net=t.ttn||0,n.total_gross=t.ttb||0,n.title=null!=n.invoicetitle?n.invoicetitle:n.title||"",n.provisionlocation=null!=n.loc?n.loc:n.provisionlocation||"",n.paymentterm=null!=i.paymentterms?i.paymentterms:n.paymentterm||"",i.customerid=null!=i.customerid?i.customerid:i.CustomerId,{admin:i,req:e.bai,sms:e.sms,new:n}},$inv.ssave=()=>{$inv.d.save()},$inv.sprev=e=>{$inv.d.preview()},$inv.rReload=()=>{try{let e=$("#listframe ul.rql:first").data();$inv.cInv2({id:e.search})}catch(e){}},$inv.quantChange=function(e){let t=$(this).closest("form"),n={},i=e=>parseFloat(e.toString().replace("%","").replace(",",".")),a=e=>e.toFixed(2);t.find(":input").each(((e,t)=>{n[$(t).attr("name")]=$(t)}));let r=parseInt(n.quantityhours.val()||"0"),l=i(n.net.val()||"0"),s=.01*i(n.vat.val());r>0&&l>0&&(n.net_val.val(a(r*l)),n.vat_val.val(a(r*l*s)),["Service"].includes(n.Type.val())&&(n.svcnet_val.val(a(r*l)),n.svcvat_val.val(a(r*l*s))))},$inv.storno=function(e,t){let n,i=$$.dc("choicefrm").append([$$.dc("btn","Storno ohne Details").click({id:e,mode:"simple"},(e=>{n.c.trigger("modal_close"),$inv.cSt(e.data)})),$$.dc("btn","Storno mit neuer Rechnung").click({id:e},(e=>{n.c.trigger("modal_close"),$inv.ccStInv(e)})),$$.dc("btn","Storno mit best. Rechnung").tC("inactive",!1===bool(t,!1)).click({id:e,mode:"copy"},(e=>{!0===bool(t,!1)&&(n.c.trigger("modal_close"),$inv.cSt(e.data))}))]);n=$ocms.dlg(i,{width:1e3})},$inv.credit=function(e,t){let n,i=$$.dc("choicefrm").append([$$.dc("btn","Gutschrift").click({id:e,mode:"credit"},(e=>{n.c.trigger("modal_close"),$inv.cSt(e.data)}))]);n=$ocms.dlg(i,{width:1e3})},$inv.setPyd=function(e){confirm($ict.cpyd)&&$ocms.postXT({url:$ocms.url("inv/setpyd"),timeout:60,data:{id:e},success:e=>{alert($ict.relm)},error:()=>{alert($t.f1)}})},$inv.setUpd=function(e){confirm($ict.cupd)&&$ocms.postXT({url:$ocms.url("inv/setupd"),timeout:60,data:{id:e},success:e=>{alert($ict.relm)},error:()=>{alert($t.f1)}})},$inv.resendRem=function(e){e.stopPropagation(),e.data.id&&confirm(string($ict.remresc,[e.data.name]))&&$ocms.postXT({url:$ocms.url("rem/resend"),timeout:60,data:{id:e.data.id},success:t=>{alert(string($ict.remresr,[e.data.name]))},error:()=>{alert($t.f1)}})},$inv.dspRem=function(e){let t=$$.dc("rfrm").ldng(1),n=$ocms.dlg(t,{width:1e3});n.ft.rwText($rct.rq2),$ocms.postXT({url:$ocms.url("inv/getrem"),timeout:60,data:{id:e,drafts:!1},success:e=>{n.ft.empty();let i=$$.tblset({class:"invtbl"},t.empty()),a=$invcol.rem2,r=$$.tr(i.hd);$$.th(r);$.each(a.fields||[],((e,t)=>{$$.th(r).text(t.label)}));let l=!1;$.each(e,((e,t)=>{l=!l;let n=$$.tr(i.bdy).tC("alt",l),r=$$.td(n);n.click((function(){n.tC("selected").siblings().rC("selected")})),!0===bool(t.hasFile,!1)&&($$.dc("idl ilbtn",r,{title:$ict.dl+"\n"+t.DocumentName}).append(gi("save-file","ico")).click({id:t.Id},$inv.downloadrem),$$.dc("idl ilbtn",r,{title:$ict.remdsp+"\n"+t.DocumentName}).append(gi("eye-open","ico")).click({id:t.Id,typ:"rem"},$inv.jdisp),$$.dc("idl ilbtn",r,{title:$ict.remres+"\n"+t.DocumentName}).append(gi("refresh","ico")).click({id:t.Id,typ:"rem",name:t.DocumentName},$inv.resendRem)),$.each(a.fields||[],((e,i)=>{let a=$$.td(n).aC(i.dtype),r=t[i.name];if("function"==typeof i.dfnc)i.dfnc.call(a,r,t);else switch(i.type||""){case"date":a.text(fdt(t[i.name],"dd.MM.yy"));break;case"datetime":a.text(fdt(t[i.name]));break;case"html":a.append($$.dc("ctw").html(r)),a.append($$.dc("ttip").html(r));break;default:a.text(t[i.name])}if("InvoiceId"===(i.name||""))a.aC("keep");switch(typeof i.title){case"function":i.title.call(a,t);break;case"string":a.attr("title",cs.title)}}))}))},error:()=>{t.empty(),n.ft.rwText($t.f1)},complete:()=>{t.ldng(0)}})},$inv.ccRem=function(e,t){$(this);$ocms.postXT({url:$ocms.url("rem/lrem"),timeout:60,data:{id:e},success:n=>{let i=$invcol.rid.clone();i.applyValues(n.ov);let a=$$.dc("ac"),r=$$.tblset({class:"fullgrid fullwidth"},a);if((n.lst||[]).length>0){$$.d({style:"margin: 1.5rem 0 1rem 0;font-size: 110%;text-decoration: underline;"}).prependTo(a).text($ict.rovlh);let e=$$.tr(r.hd);$ict.rovl.forEach(((t,n)=>$$.th(e,t))),$.each(n.lst,((e,t)=>{$$.tr(r.bdy).append([$$.tdc("keep",t.subject),$$.tdc("currency",fnum(t.amount,$rct.cst)),$$.tdc("currency",fnum(t.amount_payed,$rct.cst)),$$.tdc("keep",fdt(t.DateFinalized,"dd.MM.yy"))])}))}else $$.td($$.tr(r.bdy),$ict.nd);$ocms.dlgform(i,{addcontent:a,title:string($ict.remdt,[t||"?"]),success:function(t){$inv.ccRem_s2(e,t)},typedvalues:!0})}})},$inv.rRemRw=function(e){let t=$(this),n=e.rm||{};t.empty().data({invoiceid:n.invoiceid,invoicedate:n.invoicedate,amount:n.amount,amount_payed:n.amount_payed});let i=$$.dc("axf").append($$.dc("ibtn edit",{title:$rct.cP}).append(gi("pencil")).click(t,$inv.eRowR));t.append([$$.tdc("aux").append(i),$$.tdc("keep",n.invoiceid),$$.tdc("keep",fdt(n.invoicedate,"dd.MM.yy")),$$.tdc("currency",fnum(n.amount,$rct.cst)),$$.tdc("currency",fnum(n.amount_payed,$rct.cst)),$$.tdc("currency",fnum(n.amount-n.amount_payed,$rct.cst))])},$inv.eRowR=function(e){let t=$(this),n=e.data,i=n.data()||{},a=$invcol.rem.clone().applyValues(i);$ocms.dlgform(a,{title:t.data("dialog")||"",success:function(e){let i=t.closest("table"),a=i.data();$.extend(a.rm,e),i.data(a),$inv.rRemRw.call(n,a),$inv.rd.syncAmount(a.rm.amount,a.rm.amount_payed)},typedvalues:!0})},$inv.ccRem_s2=function(e,t){$fis.lf(!1).rC("fix").aC("hd");let n=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.rprev));$inv.eM(!1,!0);$$.dc("rfrm").ldng(1);$ocms.postXT({url:$ocms.url("rem/get"),timeout:60,data:$.extend({id:e},t),success:e=>{let t=e.rm||{},i=$$.dc("srq",n);$ict.remt[t.type].forEach((e=>$$[0]("p").rwText(e).appendTo(i)));let a=$$.tblset({class:"invi"},i);a.ft=$$[0]("tfoot"),a.tbl.data($.extend({invid:t.invid,new:{}},e));let r=$$.tr(a.hd).aC("shd").append([$$.th().aC("aux")]);$ict.remHR.forEach((e=>$$.th(r,e))),$inv.rRemRw.call($$.tr(a.bdy),a.tbl.data()),a.ft.appendTo(a.tbl),$ict.remt2[t.type].forEach((e=>$$[0]("p").rwText(e).appendTo(i)));let l=(e,t,i,r,l)=>{let s=$$.dc("inpfrm",n).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),d=$$.dc("content",s).rwText(t);$$.dc("axf",s).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:d,nme:i,change:e=>{a.tbl.data("new")[i]=e}},l),$inv.eHtml)),a.tbl.data("new")[i]=t};l("tfrm",t.subject,"subject",0,null),l("adrfrm",t.invoiceaddress,"invoiceaddress",0,null),l("emailfrm",t.invoiceemail,"invoiceemail",0,null),$$.dc("sndfrm",n).append($$.dc("content").text(t.sender)),a.tbl.children("tbody").each($inv.bdysort),a.tbl.trigger("fds.inv");let s=a.tbl.data("new");s.amount=t.amount,s.amount_payed=t.amount_payed,$inv.rd.seed({rem:{invid:t.invid,type:t.type,invoiceid:t.invoiceid,invoicedate:t.invoicedate},new:s})},complete:()=>{}})},$inv.rprev=()=>{$inv.rd.preview()},$inv.sis=e=>{confirm($ict.sisc)&&$ocms.postXT({url:$ocms.url("inv/sis"),data:{id:e||""},success:e=>{}})},$inv.srs=e=>{confirm($ict.srsc)&&$ocms.postXT({url:$ocms.url("rem/srs"),data:{id:e||""},success:e=>{}})},$inv.mfrrel=e=>{$("#contentframe").ldng(),$ocms.postXT({url:$ocms.url("inv/mfrrel"),data:{id:e||""},success:e=>{$inv.rerenderinv()},complete:()=>{$("#contentframe").ldng(0)}})}; \ No newline at end of file +let $rct={mdl:"Aufträge",or:"offene Aufträge",orr:"offene Aufträge (4 W)",rn:"Auftragsnummer",iov:{all:"Auftragsübersicht (alle)","":"Auftragsübersicht"},wk:"Woche",nd:"Keine Daten gefunden.",h:"Uhr",rq1:"Auftragsdaten werden von MFR abgerufen.\nDer Vorgang kann bis zu 90Sek dauern.",rq2:"Auftragsdaten werden geladen",rq1f:"Die Auftragsdaten von MFR konnten nicht oder nicht schnell genug abgerufen werde.\nMöchten Sie mit den bestehenden Daten trotzdem weitermachen?",note1:"Im Bruttobetrag sind {0} Lohnkosten enthalten (netto {1}). Die darin enthaltene Umsatzsteuer beträgt {2}.",note2:"Bitte beachten Sie, nach §14 Abs. 1 Umsatzsteuergesetz ist diese Rechnung ein Zahlungsbeleg oder eine andere beweiskräftige Unterlage für 2 Jahre nach Ablauf des Kalenderjahres der Ausstellung dieser Rechnung aufzubewahren, soweit nicht aufgrund anderer gesetzlicher Regelungen andere ggf.längere Aufbewahrungsfristen gelten.",note3:"Privathaushalten erstattet das Finanzamt bis zu {0} des Arbeitslohns mit der nächsten Steuererklärung.",note4:"Für bereits erbrachte Arbeiten, Dienstleistungen, Materiallieferungen und getätigte Bestellvorgänge zum oben genannten Bauvorhaben, die sich aus dem mit Ihnen geschlossenen Vertrag ergeben, stellen wir Ihnen vertragsgemäß unsere Akontozahlung in Rechnung. Eine Endabrechnung erhalten Sie als Schlussrechnung nach Abschluss des gesamten Bauvorhabens. Das Ausführungsdatum entnehmen Sie bitte dem Schlusstext dieser Rechnung. Wir danken Ihnen herzlich für das entgegengebrachte Vertrauen und bitten Sie um kurzfristigen Ausgleich der Akontorechnung.",note13b:"Gem. §13b Umsatzsteuergesetz unterliegen Sie der Steuerschuldnerschaft des Leistungsempfängers zur Umsatzsteuer aus dieser Rechnung mit einem Steuersatz von 19%.",crI:"Rechnung erstellen",crII:"Abschlagsrechnung erstellen",dII:"Für eine Abschlagsrechnung darf nur ein Auftrag gewählt werden.",dnS:"Für eine Rechnung muss mindestens ein Auftrag gewählt werden.",inv:"Rechnung",invs:"Rechnungen",req:"Auftrag",provP:"Leistungszeitraum",provD:"Leistungsdatum",cP:"Position ändern",iRb:"Zeile darunter einfügen",dR:"Zeile löschen",sV:"USt festlegen",cD:"Löschen?",mR:"Zeile verschieben",svcPart:"Service-Anteil",vat:"Umsatzsteuer",combP:"Positionen zusammenfassen",toSetP:"Auf Setpreis umstellen (Positionen ohne Preis)",toSetPc:"Der Set-Preis wird auf die Summe seiner Positionen gesetzt und die Positionen selbst verlieren ihren Preis. Das ist nicht rückgängig zu machen (der Betrag kann danach nur noch manuell geändert werden). Fortfahren?",iSum:"Zwischensumme",dtRel:"Freigegeben am: ",dtCr:"Erstellt am: ",rqV:"USt des Auftrags?",cthd:"wirklich aus-/einblenden ?",cst:{style:"currency",currency:"EUR"},sts:{IsWorkDone:"Arbeiten erledigt",Closed:"Auftrag geschlossen",SubcontractorPendingConfirmation:"Warten auf Bestätigung (Unterauftrag)",Scheduled:"Geplant",OfferIsRejected:"Angebot abgelehnt",OfferIsSend:"Offen (Angebot versandt)",CollaborationWaitingConfirmation:"Warten auf Bestätigung (Zusammenarbeit)",Released:"Freigegeben",OfferIsConfirmed:"Bestätigt",InProgress:"In Bearbeitung",ReadyForScheduling:"Zur Planung",Created:"Erstellt",Rejected:"Abgebrochen",Invoiced:"Rechnung gestellt","-":"-"},invHR:["Pos.","Menge","Artikelbezeichnung","VK","Summe"],frm:{invoiceaddress:"Adresse",loc:"Leistungsort / Lieferadresse",invoiceemail:"Email"}},$rcol={req:new fields_definition("Auftrag","Aufträge",[{name:"tags",label:"",type:"string",dfnc:function(e,t){""!==(e||"")&&($(this).aC("tags"),e.split(",").forEach((e=>{""!==e&&$(this).append($$.sc("tag "+e.replace(" ","_").replace("/","_").toLowerCase(),e))})))}},{name:"DateOfCreation",label:"Datum",type:"date",title:function(e){$(this).attr("title",$rct.dtCr+fdt(e.DateOfCreation).ne("-")+" \n"+$rct.dtRel+fdt(e.DateReleased).ne("-"))}},{name:"CustomerName",label:"Kunde (Firma)",type:"string"},{name:"Name",label:"Auftragsname",type:"string"},{name:"ExternalId",label:"Auftragsnummer",type:"string"},{name:"ParentExtenalId",label:"PAuftrag",type:"string"},{name:"InvoiceId",label:"RNummer",type:"string",dfnc:function(e,t){$(this).rwText(e," ").find("span").each((function(){$(this).aC("cla").click({id:$(this).text()},$inv.jdbn)}))}},{name:"State",label:"Status",type:"string"},{name:"WorkDoneAt",label:"Erledigt am",type:"date"},{name:"Description",label:"Beschreibung",type:"html"}]),itm:new fields_definition("Auftragsposition","Auftragspositionen",[{name:"NameOrNumber",label:"Bezeichnung",type:"string"},{name:"Type",label:"Typ",type:"select",required:!0,value:"Text",url:[{value:"Text",label:"Text"},{value:"Equipment",label:"Ausrüstung"},{value:"Material",label:"Material"},{value:"Service",label:"Arbeitsleistung"}],change:function(e){$req.quantChange.call(this,e)}},{name:"quantityhours",label:"Anzahl / Menge",type:"number",precision:"0.01",value:1,change:function(e){$inv.quantChange.call(this,e)}},{name:"UnitString",label:"Einheit",type:"select",url:["LFDM","Stck","Std.","QM","AW","Pauschal"],change:function(e){$inv.quantChange.call(this,e)}},{name:"net",label:"EinzelPreis netto",type:"number",precision:"0.01",value:0,change:function(e){$inv.quantChange.call(this,e)}},{name:"net_val",label:"GesamtPreis netto",type:"number",precision:"0.01",value:0},{name:"vat_val",label:"GesamtPreis USt",type:"number",precision:"0.01",value:0},{name:"svcnet_val",label:"Arbeitslohn netto",type:"number",precision:"0.01",value:0},{name:"svcvat_val",label:"Arbeitslohn USt",type:"number",precision:"0.01",value:0},{name:"net_pos",label:"Netto",type:"string"},{name:"bo_pos",label:"Brutto",type:"string"},{name:"vat",label:"USt",type:"string",value:"19,0%",change:function(e){$inv.quantChange.call(this,e)}},{name:"Note",label:"Details",type:"html",tinymce:!0}])},$ict={mdl:"Rechnungen",iov:{all:"Rechnungen (alle)","":"Rechnungen (nur fertige)","#d":"Rechnungen (nur Entwürfe)","#u":"Rechnungen (nur unbezahlt)","#r":"Rechnungen (nur angemahnt)","#a":"Rechnungen (nur Akonto)","#c":"Rechnungen (nur Storno)","#ru":"Rechnungen (nur angemahnt + unbez.)"},uba:", gesamter Zeitraum)",req:"Auftrag",inv:"Rechnung",rem:"Mahnung",in:"Rechnungsnummer",cc:"Kunde",wk:"Woche",nd:"Keine Daten gefunden.",dl:"Herunterladen",ed:"Bearbeiten",ced:"Bearbeitung fortsetzen",sItm:"Einzelheiten anzeigen",sPay:"Zahlungen anzeigen",cdI:"Entwurf der Rechnung löschen?",rel:"Neu Laden",relm:"Bitte laden Sie Liste manuell neu, um die Änderungen zu sehen.",dsp:"Rechnung anzeigen",storno:"Storno-Rechnung erstellen",credit:"Gutschrift erstellen",remd:"Mahnung erstellen",remdt:"Mahnung erstellen zur Rechnung {0}",remlst:"Mahnungen anzeigen",remdsp:"Mahnung anzeigen",remres:"Mahnung erneut senden",remresc:"Mahnung {0} wirklich erneut senden?",remresr:"Mahnung {0} wurde erfolgreich versandt.",setpyd:"Bezahlt markieren",cpyd:"Rechnung wirklich als bezahlt markieren?",setupd:"Bezahlt-Markierung aufheben",cupd:"Bezahlt-Markierung wirklich aufheben?",ivE:"Die Email-Adresse ist vermutlich nicht gültig.",ivEc:"\nMöchten Sie fortfahren?",pna:"Diese Seite ist in der Vorschau nicht verfügbar",tpe:"Die Anzahl von {0} Seiten wird aktuell nicht unterstützt",eis:"Der Rechnungsentwurf konnte nicht gespeichert werden.",iss:"Zwischenstand speichern.",p13b:"USt -> §13b",setm:"Set-Preisanzeige",setmo:{setprice:"Set mit Preis – Positionen ohne Preis",itemprices:"Positionen mit Preis – Set als Überschrift",setonly:"Nur Set mit Preis – Positionen ausgeblendet"},ctp:"Ansprechpartner festlegen",mfr:"Von MFR neu abrufen",rq1:"Auftragsdaten werden von MFR abgerufen.\nDer Vorgang kann bis zu 90Sek dauern.",rq2:"Auftragsdaten werden geladen",iq1:"Rechnungsdaten werden von MFR abgerufen.\nDer Vorgang kann bis zu 90Sek dauern.",iq2:"Rechnungsdaten werden geladen",sis:"Rechnung als versandt markieren",srs:"Mahnung als versandt markieren",sisc:"Rechnung wirklich als versandt markieren?",srsc:"Mahnung wirklich als versandt markieren?",iSt:{dft:"Entwurf",uns:"nicht versandt",pyd:"bezahlt",cc:"storniert",op:"offen",due:"fällig",ovd:"überfällig",rem:"angemahnt"},rSt:["","Überfällig","2. Mahnung","3. Stufe"],pSt:{a:"Vollst.",p:"Teilz."},ivT:{i:"AbschlagsR.",f:"SchlussR",r:"Rechnung",c:"StornoR."},rovlh:"Übersicht der bisherigen Mahnungen",rovl:["Betreff","Betrag","Betrag gezahlt","fertiggestellt am"],remHR:["Rechnung","vom","Rechnungsbetrag","bereits bezahlt","noch offen"],translatePaymentTerm:e=>(e||"").replace("wd"," Werktagen").replace("d"," Tagen").replace("wk"," Wochen")||"10 Tagen",payi:{account:"Konto",name:"Zahler",text:"Verw.Zweck",InvoiceID:"Rechnung",amount:"Betrag",date:"Datum",manual:"Typ"}},$invcol={datev:new fields_definition("Rechnung","Rechnungen",[{name:"Umsatz (ohne Soll/Haben-Kz)",label:"Umsatz (ohne Soll/Haben-Kz)",type:"string"},{name:"vf",label:"vf",type:"string"},{name:"Soll/Haben-Kennzeichen",label:"Soll/Haben-Kennzeichen",type:"string"},{name:"Konto",label:"Konto",type:"string"},{name:"Gegenkonto",label:"Gegenkonto",type:"string"},{name:"BU-Schlüssel",label:"BU-Schlüssel",type:"string"},{name:"Belegdatum",label:"Belegdatum",type:"string"},{name:"Belegfeld 1",label:"Belegfeld 1",type:"string"},{name:"Belegfeld 2",label:"Belegfeld 2",type:"string"},{name:"Buchungstext",label:"Buchungstext",type:"string"}]),inv:new fields_definition("Rechnung","Rechnungen",[{name:"invstatus",label:"Status",type:"select",url:$ict.iSt},{name:"balance",label:"Umsatz",type:"string",dtype:"currency"},{name:"CustomerName",label:"Kunde",type:"string"},{name:"InvoiceId",label:"RNummer",type:"string"},{name:"InvoiceType",label:"Typ",type:"select",url:$ict.ivT},{name:"request",label:"Auftrag",type:"string",dtype:"num"},{name:"vat",label:"MwSt",type:"string",dtype:"num"},{name:"deb_cred",label:"Soll/Haben",type:"string"},{name:"customer",label:"Konto",type:"string",dtype:"num"},{name:"contra_account",label:"Gegenkonto",type:"string",dtype:"num"},{name:"Belegdatum",label:"Belegdatum",type:"date"},{name:"reminderstatus",label:"MahnStatus",type:"select",url:$ict.rSt},{name:"reminder",label:"# Mahnungen",type:"integer"},{name:"Buchungstext",label:"Buchungstext",type:"string"},{name:"Payment",label:"Zahlung",type:"string"}]),rem:new fields_definition("Zahlungserinnerung","Zahlungserinnerung",[{name:"amount",label:"Rechnungsbetrag",type:"number",precision:"0.01",value:1},{name:"amount_payed",label:"bereits bezahlt",type:"number",precision:"0.01",value:1}]),rem2:new fields_definition("Zahlungserinnerung","Zahlungserinnerung",[{name:"DocumentName",label:"Name",type:"string"},{name:"subject",label:"Betreff",type:"string"},{name:"DateSent",label:"Versanddatum",type:"date"},{name:"status",label:"Status",type:"string"},{name:"amount_open",label:"offener Betrag",type:"number",precision:"0.01"},{name:"InvoiceId",label:"RNummer",type:"string"}]),rid:new fields_definition("Zahlungserinnerung","Zahlungserinnerung",[{name:"type",label:"Typ",type:"select",url:[["f","einfache Zahlungserinnerung"],["m","Mahnung"],["l","letzte Mahnung"]],required:!0},{name:"level",label:"Stufe",type:"select",url:[["1","Stufe 1"],["2","Stufe 2"],["3","Stufe 3"],["4","Stufe 4"],["5","Stufe 5"],["6","Stufe 6"]],required:!0}]),ctp:new fields_definition("Ansprechpartner","Ansprechpartner",[{name:"name",label:"Name",type:"string"},{name:"email",label:"Email",type:"string"}])},gi=(e,t)=>$$.sc("glyphicon glyphicon-"+e).aC(t),$inv={init2:function(e,t){e=e||"inv",t=t||{},$ocms.getScript([],(function(){$inv.init3(e,t)}))},init3:async function(e,t){$fis.cf(!0);let n=$fis.lf(!0);$("#topbar").ocmsmenu([]),$("#activemodule").text($ict.mdl);let i=[(async()=>{await $fis.getAuth("fds_inv")>0&&($inv.prepLst(""),n.aC("fix"))})(),new Promise(((e,t)=>{$fis.prepAuth(["fds_reminder"])}))];await Promise.all(i)},prepLst:function(e){let t=new Date,n=$fis.lf(!0).ldng(1),i=new Date("2021-01-01");$fis.frm_list().IN((function(){}));let a=[];$.each($ict.iov,((e,t)=>{a.push({lbl:t,fnc:()=>{$inv.prepLst(e),n.aC("fix")}})})),$fis.lfm().ocmsmenu([{lbl:"Filter",itm:a}]);$$.i({placeholder:$ict.in}).appendTo($$.dc("mth ivn",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>3&&(t.parent().aC("selected"),$inv.renderinv("i:"+n,"s","all"),t.val(""))})),$$.i({placeholder:$ict.cc}).appendTo($$.dc("mth ivc",n)).enterKey((function(e){let t=$(this),n=t.val()||"";e.stopPropagation(),t.parent().siblings().rC("selected"),n.length>=3&&(t.parent().aC("selected"),$inv.renderinv("c:"+n,"s","all"),t.val(""))}));"#"===e.substr(0,1)&&$$.dc("mth extra",n).text($ict.iov[e].replace(")",$ict.uba)).click((function(t){let n=$(this);if(t.stopPropagation(),n.siblings().rC("selected"),!0===n.is(".selected")){n.toggleClass("selected");let t=fdt(new Date,"yy-MM-dd");$inv.renderinv(t,"a",e)}n.aC("selected")})),n.append("
");let r=$$.dc("mthl",n),l=t.getFullYear(),d=t.getMonth()+1;for(let t=i.getFullYear();t<=l;t++){let n=$$.dc("yr").prependTo(r).text($ict.iov[e]+" - "+t.toString()).toggleClass("selected",t===l);n.click({yr:t},(function(e){e.stopPropagation(),n.siblings().rC("selected"),n.aC("selected")}));let a=$$.dc("mfrm",n);for(let n=0;n<(t!==l?12:d);n++){i=new Date(t,n,1);let r=$$.dc("mth").prependTo(a).text($ict.iov[e]+" - "+fdt(i,"MMM yyyy"));if(r.click({yr:t,mt:n},(function(t){if(t.stopPropagation(),r.siblings().rC("selected"),!0===r.is(".selected")){r.toggleClass("selected");let n=fdt(new Date(t.data.yr,t.data.mt,1),"yy-MM-dd");$inv.renderinv(n,"m",e)}r.aC("selected")})),""===e){$$.dc("mthdl",r).append(gi("compressed","ico")).click({yr:t,mt:n},(function(e){e.stopPropagation();let t=fdt(new Date(e.data.yr,e.data.mt,1),"yy-MM-dd");$inv.downloadzip(t,"m")}))}let l=getMonday(i),d=new Date(i);d.setMonth(d.getMonth()+1),d.setDate(0),d=getMonday(d);let s=$$.dc("wfrm",r);for(;l<=d;){let t=$$.dc("wk",s).text(($ict.wk||"W")+" "+fdt(l,"dd.MM.yy"));t.click({rd:new Date(l)},(function(n){n.stopPropagation();let i=fdt(n.data.rd,"yy-MM-dd");$inv.renderinv(i,"w",e),r.siblings().rC("selected").find(".wk").rC("selected"),r.aC("selected").find(".wk").rC("selected"),t.aC("selected")})),$$.dc("wkdl",t).append(gi("compressed","ico")).click({rd:new Date(l)},(function(e){e.stopPropagation();let t=fdt(e.data.rd,"yy-MM-dd");$inv.downloadzip(t,"w")})),l.setDate(l.getDate()+7)}}}n.ldng(0)},rerenderinv:function(){let e=$("#contentframe .invfrm:first");if(e.length>0){let t=e.data("sets")||{};t.mode&&$inv.renderinv(t.tgt,t.mode,t.includes)}},renderinv:function(e,t,n){let i=$fis.frm_list(!0,!0).ldng(1),a=$$.dc("invfrm",i).aC("md"+t).data("sets",$.extend({},{tgt:e,mode:t,includes:n})),r=$fis.lf();$ocms.postXT({url:$ocms.url("inv/invl"),data:{mode:t,tgt:e,includes:n},success:i=>{r.rC("fix").aC("hd"),$$.dc("ovhd",a).text(i.admin.title);let l=$$.tblset({},a),d=$invcol.inv,s=$$.tr(l.hd);$$.th(s);$.each(d.fields||[],((e,t)=>{$$.th(s).text(t.label),"vat"===t.name&&$$.th(s)})),$.each(i.invoices||[],((s,c)=>{let o=$$.tr(l.bdy);o.click((function(){r.rC("fix").aC("hd"),o.toggleClass("selected").siblings().rC("selected").find("td.av").rC("av"),o.find("td.av").rC("av"),!0===o.is(".selected")?$inv.iMn(c):$inv.eM()}));let u=$$.td(o,{class:"raux"});c.hasFile?($$.dc("idl ilbtn",u,{title:$ict.dl+"\n"+c.DocumentName}).append(gi("save-file","ico")).click({id:c.Id},$inv.downloadinv),$$.dc("idl ilbtn",u,{title:$ict.dsp+"\n"+c.DocumentName}).append(gi("eye-open","ico")).click({id:c.Id,typ:"inv"},$inv.jdisp)):!1===c.isFinal&&!0===$fis.isAuth("fds_inv",2)&&$$.dc("idl ilbtn",u,{title:$ict.ed}).append(gi("edit","ico")).click({id:c.Id},$inv.doContInv),$$.dc("iitm ilbtn",u,{title:$ict.sItm}).append(gi("list","ico")).click({id:c.Id},$inv.showitm),$$.dc("iitm ilbtn",u,{title:$ict.sPay}).append(gi("euro","ico")).click({id:c.Id},$inv.showpay),$.each(d.fields||[],((r,l)=>{let d,s,u=$$.td(o).aC(l.dtype);switch("select"===(l.type||"")?u.text((l.url||{})[c[l.name]]||""):u.text(c[l.name]),l.name||""){case"vat":d=$$.sel().appendTo($$.td(o,{class:"vsel"})),s=(i.admin.ust_options||"19,0%;16,0%;0,0%").split(";"),$.each(s,((e,t)=>{$$.opt(t,t).appendTo(d)})),d.click((function(e){e.stopPropagation()})).val(c[l.name]).change().change({frm:a,tgt:e,mode:t,id:c.Id,td:u,includes:n},$inv.setvat),u.toggleClass("hl",c[l.name].substr(0,2)!==s[0].substr(0,2)).click((function(e){e.stopPropagation(),$(this).toggleClass("av")}));break;case"balance":u.aC("sh_"+(c.SollHaben||"").toLowerCase());break;case"invstatus":case"reminderstatus":u.aC(("invstatus"===l.name?"is_":"rs_")+c[l.name])}}))}))},complete:()=>{i.ldng(0)}})},setvat:function(e){let t=$(this),n=e.data||{};$ocms.postXT({url:$ocms.url("inv/setvat"),data:{id:n.id,val:t.val()},success:e=>{n.td.rC("av"),$inv.renderinv(n.tgt,n.mode,n.includes)}})},downloadzip:function(e,t){$(this).empty();window.open($ocms.url("inv/datevzip?mode="+t+"&tgt="+encodeURIComponent(e)),"_blank")},showitm:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&$ocms.postXT({url:$ocms.url("inv/rqi"),data:{id:e.data.id},success:e=>{let t=$$.dc("rfrm");(e.requests||[]).length<1?t.text($ict.nd):$.each(e.requests||[],(function(e,n){let i=$$.dc("srq",t);$$.dc("nme",i).text(n.name);let a=$$.tblset({class:"if"},i);$.each(n.items||[],((e,t)=>{let n=$$.tr({id:"itm"+t.Id}).appendTo(a.bdy);$$.td(n).text(t.NameOrNumber),$$.td(n).text(t.Type),$$.td(n).aC("currency").text(t.net_pos),$$.td(n).aC("currency").text(t.bo_pos),$$.td(n).aC("num").text(t.vat)}))})),$ocms.dlg(t,{width:1e3})}})},showpay:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&$ocms.postXT({url:$ocms.url("inv/pyi"),data:{id:e.data.id},success:e=>{let t=$$.dc("rfrm");if((e.payments||[]).length<1)t.text($ict.nd);else{let n=$$.tblset({class:"if"},t),i=$$.tr(n.hd);$.each(["date","account","name","text","InvoiceID","amount","manual"],((e,t)=>{$$.th(i,$ict.payi[t])})),$.each(e.payments,((e,t)=>{let i=$$.tr({id:"itm"+t.banking_uid}).appendTo(n.bdy);$$.td(i).aC("date").text(t.date),$$.td(i).text(t.account),$$.td(i).text(t.name),$$.td(i).text(t.text),$$.td(i).text(t.InvoiceID),$$.td(i).aC("currency").text(t.amount),$$.td(i).text(t.manual)}))}$ocms.dlg(t,{width:1e3,title:"Übersicht der Zahlungen"})}})},downloadinv:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&window.open($ocms.url("inv/rdoc?id="+e.data.id),"_blank")},doContInv:function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&$inv.cntInv({id:e.data.id})}},$$inv={init2:$inv.init2,auth:{}};export default $$inv;$inv.cInv=function(e){let t=$(this).closest("tr");e.stopPropagation(),!1!==t.is(".selected")&&!1!==$fis.isAuth("fds_inv",2)&&$inv.cInv2({id:e.data.id})},$inv.rMn=e=>{let t=[{lbl:$ict.req,itm:[]}];return!0===bool(e,!1)&&!0===$fis.isAuth("fds_inv",2)&&Array.prototype.push.apply(t[0].itm,[{lbl:$rct.crI,fnc:$inv.ccInv,data:{typ:"r"}},{lbl:$rct.crII,fnc:$inv.ccInv,data:{typ:"i"}}]),t.push({lbl:$ict.rel,fnc:$inv.rReload}),$("#topbar").ocmsmenu(t)},$inv.iMnr=e=>{let t=booln(e.isFinal,!0),n=e.Id,i=booln(e.fds,!1),a=[{glyph:"glyphicon-menu-left",fnc:()=>{$fis.frm_edit().remove()}},{lbl:$ict.inv,itm:[]},{lbl:$ict.rem,itm:[]}];return!1===t&&!0===$fis.isAuth("fds_inv",2)?a[1].itm.push({lbl:$ict.ced,fnc:$inv.clCntInv}):!0===$fis.isAuth("fds_inv",1)&&a[1].itm.push({lbl:$ict.dsp,fnc:()=>$inv.disp(n,"inv")}),!0===i&&!0===t&&!0===$fis.isAuth("fds_inv",2)&&(a[1].itm.push({lbl:$ict.storno,fnc:()=>$inv.storno(n,i)}),a[1].itm.push({lbl:$ict.credit,fnc:()=>$inv.credit(n,i)})),!0===t&&!0===$fis.isAuth("fds_reminder",2)&&(a[2].itm.push({lbl:$ict.remd,fnc:()=>$inv.ccRem(n,e.InvoiceId)}),a[2].itm.push({lbl:$ict.remlst,fnc:()=>$inv.dspRem(n)})),!0===t&&!0===$fis.isAuth("fds_reminder",2)&&!1===booln(e.IsSent,!1)&&a[2].itm.push({lbl:$ict.srs,fnc:()=>$inv.srs(n)}),a.push({lbl:$ict.rel,fnc:$inv.rReload}),$("#topbar").ocmsmenu(a)},$inv.iMn=e=>{let t=booln(e.isFinal,!0),n=e.Id,i=booln(e.fds,!1),a=[{glyph:"glyphicon-menu-left",fnc:()=>{$fis.frm_edit().remove()}},{lbl:$ict.inv,itm:[]},{lbl:$ict.rem,itm:[]}];return!1===t&&!0===$fis.isAuth("fds_inv",2)?a[1].itm.push({lbl:$ict.ced,fnc:()=>{$inv.cntInv({id:n})}}):!0===$fis.isAuth("fds_inv",1)&&a[1].itm.push({lbl:$ict.dsp,fnc:()=>$inv.disp(n,"inv")}),!0===$fis.isAuth("fds_inv",2)&&(a[1].itm.push({lbl:$ict.storno,fnc:()=>$inv.storno(n,i)}),a[1].itm.push({lbl:$ict.credit,fnc:()=>$inv.credit(n,i)})),!0===t&&!1===booln(e.IsPayed,!1)?(!0===$fis.isAuth("fds_reminder",2)&&a[2].itm.push({lbl:$ict.remd,fnc:()=>$inv.ccRem(n,e.InvoiceId)}),!0===$fis.isAuth("fds_inv",2)&&a[1].itm.push({lbl:$ict.setpyd,fnc:()=>$inv.setPyd(n)})):!0===t&&!0===booln(e.IsPayed,!1)&&"m"===(e.PaymentStatus||"")&&!0===$fis.isAuth("fds_inv",2)&&a[1].itm.push({lbl:$ict.setupd,fnc:()=>$inv.setUpd(n)}),!0===$fis.isAuth("fds_reminder",2)&&a[2].itm.push({lbl:$ict.remlst,fnc:()=>$inv.dspRem(n)}),!0===t&&!0===$fis.isAuth("fds_inv",2)&&!1===booln(e.IsSent,!1)&&a[1].itm.push({lbl:$ict.sis,fnc:()=>$inv.sis(n)}),!1===i&&a[1].itm.push({lbl:$ict.mfr,fnc:()=>$inv.mfrrel(n)}),$("#topbar").ocmsmenu(a)},$inv.emOpt=e=>"iss,p13b,ctp"+(""===((e||{}).setmode||"")?",setm":""),$inv.eM=(e,t,n)=>{let i=[];return!0!==booln(e,!1)&&!0!==booln(t,!1)||i.push({glyph:"glyphicon-menu-left",fnc:()=>{$fis.lf(!0),$fis.frm_edit().remove()}}),!0===(n||"").split(",").includes("iss")&&i.push({lbl:$ict.iss,fnc:$inv.ssave}),!0===(n||"").split(",").includes("ctp")&&i.push({lbl:$ict.ctp,fnc:$inv.sctp}),!0===(n||"").split(",").includes("p13b")&&i.push({lbl:$ict.p13b,fnc:$inv.sp13b}),!0===(n||"").split(",").includes("setm")&&i.push({lbl:$ict.setm,fnc:$inv.ssetmode}),!0===(n||"").split(",").includes("iss")&&(i.push({lbl:"Änderungshistorie",fnc:()=>$inv.d.history()}),i.push({lbl:"Änderungen verwerfen",fnc:()=>$inv.d.discard()})),!0===booln(e,!1)&&i.push({lbl:$ict.rel,fnc:$inv.rReload}),$("#topbar").ocmsmenu(i)},$inv.d={tbl:()=>$("div.invoice_layout table.invi"),layout:()=>$("div.invoice_layout"),token:function(){return $inv.d.tbl().data("dtoken")||""},hashes:function(){let e=$inv.d.tbl().data("bai")||[],t={};return $.each(e,((e,n)=>{t[(n.Id||"").toString()]=JSON.stringify(n)})),t},seed:function(e){let t=$inv.d.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dopen"),data:{payload:JSON.stringify(e)},success:e=>{$inv.d.tbl().data("dtoken",e.token).data("dver",e.version).data("dhashes",$inv.d.hashes()).data("dorder",$inv.d.order()),$fis.draft.bind(e.token,{onReady:()=>$inv.d.refresh(),onExpiring:e=>$inv.d.warnExpiry(e),onClosed:e=>$inv.d.closed(e)}),$inv.d.refresh()},error:()=>{t.rC("freeze")},complete:()=>{$inv.d.tbl().removeData("dseeding")}})},refresh:function(e){let t=$inv.d.token();""!==t&&$ocms.postXT({url:$ocms.url("inv/dstate"),data:{token:t},success:t=>{$inv.d.applyState(t),"function"==typeof e&&e(t)},error:e=>{e&&410===e.status&&$inv.d.closed("expired")},complete:()=>{$inv.d.layout().rC("freeze")}})},applyState:function(e){let t=$inv.d.tbl();t.length<1||(t.data("dver",e.version).data("serverSums",e.sums),$inv.d.footer(t,e.sums||{},e.admin||{}),$inv.d.notes(e.notes||[]),$inv.d.validation(e.validation||[]),$inv.d.applyPositions(t,e.req||[]),$inv.d.applySetDisplay(t,e.setDisplay||{}),$inv.eM(!1,!0,$inv.emOpt(e.admin||{})))},notes:function(e){let t=$inv.d.layout();if(t.length<1)return;let n=t.children(".dnotes");n.length<1&&(n=$$.dc("dnotes"),t.append(n)),n.empty(),(e||[]).forEach((e=>$$.dc("dnote").aC(e.style||"InvoiceNotes").text(e.text)))},applyPositions:function(e,t){(t||[]).forEach((t=>(t&&t.itm||[]).forEach((t=>{if(!t||""===(t.id||""))return;let n=e.find("#itm"+t.id+" td.keep").first();n.length&&n.text(null!=t.p?t.p:"")}))))},applySetDisplay:function(e,t){e.find("tr.itm").each(((e,n)=>{let i=$(n),a=((i.data()||{}).Id||"").toString();if(""===a||!Object.prototype.hasOwnProperty.call(t,a))return;let r=t[a]||{};i.tC("sethdr",bool(r.h,!1)),!1===bool(r.p,!0)&&i.find("td.currency").text("")}))},sync:function(e){let t=$inv.d.token();""!==t&&($inv.d.layout().aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dpatch"),data:{token:t,delta:JSON.stringify(e)},success:()=>{$inv.d.refresh()},error:e=>{$inv.d.layout().rC("freeze"),e&&410===e.status&&$inv.d.closed("expired")}}))},order:function(){return($inv.d.tbl().data("bai")||[]).map((e=>(e.Id||"").toString()))},syncChanged:function(e){if(""===$inv.d.token())return;let t=e.data("bai")||[],n=e.data("dhashes")||{},i={},a=[],r=[];$.each(t,((e,t)=>{let r=(t.Id||"").toString(),l=JSON.stringify(t);i[r]=l,n[r]!==l&&a.push(t)})),$.each(n,(e=>{void 0===i[e]&&r.push(e)}));let l=$inv.d.order(),d=e.data("dorder")||[];e.data("dhashes",i).data("dorder",l),a.forEach((e=>$inv.d.sync({Target:"block.replace",Ref:(e.Id||"").toString(),Value:e}))),r.forEach((e=>$inv.d.sync({Target:"block.remove",Ref:e}))),d.length===l.length&&d.slice().sort().join(",")===l.slice().sort().join(",")&&d.join(",")!==l.join(",")&&$inv.d.sync({Target:"block.order",Value:l})},syncField:function(e,t){if(""===$inv.d.token())return;let n={invoicetitle:"title",invoiceaddress:"address",invoiceemail:"email",loc:"provisionlocation",provisionlocation:"provisionlocation",provisionperiod:"provisionperiod"}[e];n&&$inv.d.sync({Target:n,Value:t})},footer:function(e,t,n){let i=e.children("tfoot").empty();e.nextAll(".fnote").remove();let a=bool(n.p13b,!1),r=(e,t,n)=>$$.tdc("currency",$$.tr(i,{class:n||"tsum"}).append([$$.tdc("aux"),$$.td({colspan:4}).text(e)]),fnum(t,$rct.cst)),l=t=>$$.dc("fnote").insertAfter(e).rwText(t);r("Netto",t.total_net||0),!1===a&&$.each(t.vat||{},((e,t)=>r($rct.vat+" "+e+"%",t,"tvat"))),r("Summe",t.total_gross||0);let d=n.type||"";"i"===d?(l($rct.note2),l($rct.note4)):"c"===d?l($rct.note2):(l(string($rct.note3,[fnum(((t.service_net||0)+(t.service_vat||0))*(n.tax_servicerefund||0),$rct.cst)])).aC("ntax"),l($rct.note2),l(string($rct.note1,[fnum((t.service_net||0)+(t.service_vat||0),$rct.cst),fnum(t.service_net||0,$rct.cst),fnum(t.service_vat||0,$rct.cst)]))),!0===a&&l($rct.note13b)},validation:function(e){let t=$("div.invoice_layout");if(t.length<1)return;let n=t.children(".dvalidation");n.length<1&&(n=$$.dc("dvalidation"),t.prepend(n)),n.empty().tC("hidden",(e||[]).length<1),$.each(e||[],((e,t)=>$$.dc("dvmsg",n).aC(t.severity).text(t.message)))},preview:function(){let e=$inv.d.token();if(""===e)return;let t=$inv.d.layout(),n=($inv.d.tbl().data("new")||{}).invoiceemail||"";!1===$fis.ValidateEmail(n)&&!1===bool(confirm($ict.ivE+$ict.ivEc),!1)||(t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dpreview"),data:{token:e},success:n=>{t.rC("freeze");let i=$$.dc("imagecollection pdfpreview"),a=Math.round(.88*vh()),r=n.total;r>10&&$$.dc("note warn",i).text($ict.tpe),$.each(n.img||[],((e,t)=>{$$.dc("pdfp",i).append($$.img(t).css("max-height",(a-rpx(6)).toString()+"px"))}));for(let e=(n.img||[]).length+1;e<=r;e++)$$.dc("pdfp ph",i).append($$.dc("note",$ict.pna));$ocms.dlg(i,{size:[a,Math.round(.88*vw())],zindex:50,form:!1,button:$rct.crI,confirm:function(n){let i=$(this);t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dsave"),data:{token:e},success:e=>{$ocms.postXT({url:$ocms.url("req/sconf"),data:{id:e.invid},success:t=>{i.trigger("modal_close"),!0===t.hasFile&&window.open($ocms.url("req/idoc")+"?id="+e.invid,"_blank"),$inv.d.close(),$ocms.init("req"),$inv.rReload()},error:()=>{alert($t.f1),i.trigger("modal_close")},complete:()=>{t.rC("freeze")}})},error:()=>{t.rC("freeze"),alert($ict.eis)}})},cancel:function(e){confirm($ict.cdI)&&($inv.d.close(),$inv.rReload())}})},error:()=>{t.rC("freeze"),alert($ict.eis)}}))},save:function(){let e=$inv.d.token();if(""===e)return;let t=$inv.d.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("inv/dsave"),data:{token:e},success:e=>{$inv.d.tbl().data("invid",e.invid)},error:()=>{alert($ict.eis)},complete:()=>{t.rC("freeze")}})},history:function(){let e=$inv.d.token();""!==e&&$ocms.postXT({url:$ocms.url("inv/dhistory"),data:{token:e},success:e=>{let t=$$.dc("dhist");if((e.history||[]).length<1)$$.dc("note",t).text("Noch keine Änderungen erfasst.");else{let n=$$.tblset({class:"invtbl fullwidth"},t);$$.tr(n.hd).append([$$.th().text("Zeit"),$$.th().text("Feld"),$$.th().text("Alt"),$$.th().text("Neu")]),$.each(e.history,((e,t)=>$$.tr(n.bdy).append([$$.tdc("keep",fdt(t.timestamp)),$$.td().text(t.target),$$.td().text(t.oldValue),$$.td().text(t.newValue)])))}$ocms.dlg(t,{width:800,form:!1})}})},discard:function(){let e=$inv.d.tbl().data("invid")||"";""!==e?!1!==confirm("Alle Änderungen verwerfen und den zuletzt gespeicherten Stand neu laden?")&&($inv.d.close(),$inv.cntInv({id:e})):alert("Es wurde noch kein Zwischenstand gespeichert, der wiederhergestellt werden könnte.")},warnExpiry:function(e){let t=Math.max(1,Math.round((e||0)/60));$fis.notifications.push({severity:"info",title:"Entwurf läuft ab",message:"Der Rechnungsentwurf läuft in etwa "+t+" Minute(n) ab. Bitte zwischenspeichern, sonst gehen die Änderungen verloren."})},closed:function(e){let t=$inv.d.token();$inv.d.tbl().removeData("dtoken"),""!==t&&$fis.draft.release(t),$fis.frm_edit().remove(),$fis.lf(!0),$fis.notifications.push({severity:"error",title:"Entwurf geschlossen",message:"expired"===e?"Der Rechnungsentwurf ist wegen Inaktivität abgelaufen. Nicht gespeicherte Änderungen sind verloren.":"Der Rechnungsentwurf wurde geschlossen."});try{$inv.rReload()}catch(e){}},close:function(){let e=$inv.d.token();""!==e&&($ocms.postXT({url:$ocms.url("inv/dclose"),data:{token:e}}),$fis.draft.release(e)),$inv.d.tbl().removeData("dtoken")}},$inv.rd={tbl:()=>$("div.invoice_layout table.invi"),layout:()=>$("div.invoice_layout"),token:function(){return $inv.rd.tbl().data("rdtoken")||""},seed:function(e){let t=$inv.rd.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dopen"),data:{payload:JSON.stringify(e)},success:e=>{$inv.rd.tbl().data("rdtoken",e.token).data("rdver",e.version),$fis.draft.bind(e.token,{onReady:()=>$inv.rd.refresh(),onExpiring:e=>$inv.rd.warnExpiry(e),onClosed:e=>$inv.rd.closed(e)}),$inv.rd.refresh()},error:()=>{t.rC("freeze")}})},refresh:function(e){let t=$inv.rd.token();""!==t&&$ocms.postXT({url:$ocms.url("rem/dstate"),data:{token:t},success:t=>{$inv.rd.applyState(t),"function"==typeof e&&e(t)},error:e=>{e&&410===e.status&&$inv.rd.closed("expired")},complete:()=>{$inv.rd.layout().rC("freeze")}})},applyState:function(e){let t=$inv.rd.tbl();t.length<1||(t.data("rdver",e.version).data("serverSums",e.sums).data("remid",e.remid||""),$inv.rd.footer(t,e.sums||{}),$inv.rd.notes(e.notes||{}),$inv.rd.validation(e.validation||[]))},notes:function(e){let t=$inv.rd.layout();if(t.length<1)return;let n=t.find(".srq");if(n.length<1)return;n.children(".dnote").remove();let i=(e||{}).intro||[],a=n.children().first();i.slice().reverse().forEach((e=>{let t=$$[0]("p").aC("dnote intro").rwText(e);a.length?t.insertBefore(a):t.appendTo(n)})),((e||{}).closing||[]).forEach((e=>$$[0]("p").aC("dnote closing").rwText(e).appendTo(n)))},sync:function(e){let t=$inv.rd.token();""!==t&&($inv.rd.layout().aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dpatch"),data:{token:t,delta:JSON.stringify(e)},success:()=>{$inv.rd.refresh()},error:e=>{$inv.rd.layout().rC("freeze"),e&&410===e.status&&$inv.rd.closed("expired")}}))},syncField:function(e,t){if(""===$inv.rd.token())return;let n={subject:"subject",invoiceaddress:"address",invoiceemail:"email",text:"text"}[e];n&&$inv.rd.sync({Target:n,Value:t})},syncAmount:function(e,t){""!==$inv.rd.token()&&($inv.rd.sync({Target:"amount",Value:(null!=e?e:0).toString()}),$inv.rd.sync({Target:"amount_payed",Value:(null!=t?t:0).toString()}))},footer:function(e,t){let n=e.children("tfoot").empty(),i=$$.tr(n,{class:"tsum"}).append([$$.tdc("aux"),$$.td({colspan:4}).text("Offener Betrag")]);$$.tdc("currency",i,fnum(t.amount_open||0,$rct.cst))},validation:function(e){let t=$inv.rd.layout();if(t.length<1)return;let n=t.children(".dvalidation");n.length<1&&(n=$$.dc("dvalidation"),t.prepend(n)),n.empty().tC("hidden",(e||[]).length<1),$.each(e||[],((e,t)=>$$.dc("dvmsg",n).aC(t.severity).text(t.message)))},preview:function(){let e=$inv.rd.token();if(""===e)return;let t=$inv.rd.layout(),n=($inv.rd.tbl().data("new")||{}).invoiceemail||"";!1===$fis.ValidateEmail(n)&&!1===bool(confirm($ict.ivE+$ict.ivEc),!1)||(t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dpreview"),data:{token:e},success:n=>{t.rC("freeze");let i=$$.dc("imagecollection pdfpreview"),a=Math.round(.88*vh());$.each(n.img||[],((e,t)=>{$$.dc("pdfp",i).append($$.img(t).css("max-height",(a-rpx(6)).toString()+"px"))})),$ocms.dlg(i,{size:[a,Math.round(.88*vw())],zindex:50,form:!1,button:$ict.remd,confirm:function(n){let i=$(this);t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dsave"),data:{token:e},success:e=>{$ocms.postXT({url:$ocms.url("rem/conf"),data:{id:e.remid},success:()=>{i.trigger("modal_close"),window.open($ocms.url("rem/idoc")+"?id="+e.remid,"_blank"),$inv.rd.close(),$ocms.init("req"),$inv.rReload()},error:()=>{alert($t.f1),i.trigger("modal_close")},complete:()=>{t.rC("freeze")}})},error:()=>{t.rC("freeze"),alert($t.f1)}})},cancel:function(e){confirm($ict.cdI)&&($inv.rd.close(),$inv.rReload())}})},error:()=>{t.rC("freeze"),alert($t.f1)}}))},save:function(){let e=$inv.rd.token();if(""===e)return;let t=$inv.rd.layout();t.aC("freeze"),$ocms.postXT({url:$ocms.url("rem/dsave"),data:{token:e},success:e=>{$inv.rd.tbl().data("remid",e.remid)},error:()=>{alert($t.f1)},complete:()=>{t.rC("freeze")}})},history:function(){let e=$inv.rd.token();""!==e&&$ocms.postXT({url:$ocms.url("rem/dhistory"),data:{token:e},success:e=>{let t=$$.dc("dhist");if((e.history||[]).length<1)$$.dc("note",t).text("Noch keine Änderungen erfasst.");else{let n=$$.tblset({class:"invtbl fullwidth"},t);$$.tr(n.hd).append([$$.th().text("Zeit"),$$.th().text("Feld"),$$.th().text("Alt"),$$.th().text("Neu")]),$.each(e.history,((e,t)=>$$.tr(n.bdy).append([$$.tdc("keep",fdt(t.timestamp)),$$.td().text(t.target),$$.td().text(t.oldValue),$$.td().text(t.newValue)])))}$ocms.dlg(t,{width:800,form:!1})}})},warnExpiry:function(e){let t=Math.max(1,Math.round((e||0)/60));$fis.notifications.push({severity:"info",title:"Entwurf läuft ab",message:"Der Mahnentwurf läuft in etwa "+t+" Minute(n) ab. Bitte zwischenspeichern, sonst gehen die Änderungen verloren."})},closed:function(e){let t=$inv.rd.token();$inv.rd.tbl().removeData("rdtoken"),""!==t&&$fis.draft.release(t),$fis.frm_edit().remove(),$fis.lf(!0),$fis.notifications.push({severity:"error",title:"Entwurf geschlossen",message:"expired"===e?"Der Mahnentwurf ist wegen Inaktivität abgelaufen. Nicht gespeicherte Änderungen sind verloren.":"Der Mahnentwurf wurde geschlossen."});try{$inv.rReload()}catch(e){}},close:function(){let e=$inv.rd.token();""!==e&&($ocms.postXT({url:$ocms.url("rem/dclose"),data:{token:e}}),$fis.draft.release(e)),$inv.rd.tbl().removeData("rdtoken")}},$inv.cInv2=function(e){let t=$$.dc("rfrm").ldng(1),n=$ocms.dlg(t,{width:1e3});n&&n.ft.rwText($rct.rq1);let i=()=>{$ocms.postXT({url:$ocms.url("req/get"),timeout:60,data:{id:e.id,mode:"r"},success:t=>{t.admin=t.admin||{};let n=$fis.lf(!0).aC("fix").rC("hd");if($fis.frm_edit().IN(),$inv.eM(!0,!0),(t.requests||[]).length<1)n.aC("fix").text($rct.nd);else{$$.dc("lh",n,$rct.mdl);let i=$$.d(),a=$$.ul({class:"rql"}).data({search:e.id,parent:t.admin.parent}).appendTo(n),r={},l=$rcol.req.lbl();$.each(t.requests||[],(function(e,t){let n=$$.li({class:"cli rli"}).data($.extend({},t)).appendTo(a),d=$$.dc("lihd",n).addClass(t.state);!0===booln(t.open,!1)&&d.append($$.sc("cbox").click((()=>{n.tC("checked"),i.find("li").rC("checked"),!0===n.is(".checked")?$inv.rMn(t.open):$inv.eM(!0)}))),d.append([$$.sc("eid",t.ExternalId),$$.sc("nme",t.Name)]),$$.dc("lidt",n).append([$$.dc("rqs").append([$$.s(l.State+": "),$$.s($rct.sts[t.State||"-"])]),$$.dc("ivn").append([$$.s(l.InvoiceId+": "),$$.s(t.InvoiceId||"- -")]),$$.dc("wda").append([$$.s(l.WorkDoneAt+": "),$$.s(fdt(t.WorkDoneAt,"dd.MM.yyyy"))])]),r[t.Id]=n})),(t.inv||[]).length>0&&($$.dc("lh",n,$rct.invs),i=$$.ul({class:"ivl"}).appendTo(n),$.each(t.inv||[],((e,t)=>{let n=$$.li({class:"cli ili"}).data($.extend({},t)).appendTo(i),r=$$.dc("lihd",n).addClass(t.invstatus);!1===booln(t.isFinal,!0)?r.append($$.sc("cbox").click((()=>{""!==(t.Id||"")&&(n.tC("checked").siblings().rC("checked"),a.find("li").rC("checked"),!0===n.is(".checked")?$inv.iMnr(t):$inv.eM(!0))}))):["","dft"].indexOf(t.invstatus)<0&&r.append($$.sc("dli").click((function(){$inv.disp(t.Id,"inv")}))),r.append($$.sc("nme",t.DocumentName||t.Id)),$$.dc("lidt",n).append([$$.dc("wda").append([$$.s(fdt(t.DateCreated,"dd.MM.yyyy"))]),$$.d().text($ict.iSt[t.invstatus]||t.invstatus)])})))}},complete:()=>{n&&n.c.trigger("modal_close")}})};$ocms.postXT({url:$ocms.url("req/pget"),timeout:90,data:{id:e.id},success:e=>{n&&n.ft.rwText($rct.rq2),i()},error:()=>{confirm($rct.rq1f)?(n&&n.ft.rwText($rct.rq2),i()):n&&n.c.trigger("modal_close")}})},$inv.ccInv=function(e){let t=(e.data||{}).typ||"r",n=$fis.lf(),i=n.children("ul.rql"),a=i.data("parent"),r=[];if(i.find("li.rli.checked").each((function(){r.push($(this).data("Id"))})),r.length<1)return void alert($rct.dnS);if("i"===t&&r.length>1)return void alert($rct.dII);let l=$fis.frm_edit(),d=$$.dc("invoice_layout",l).append($$.dc("btn sprev").click($inv.sprev)),s=$fis.cf().width()>d.width()+n.width()+20;n.tC("fix",s).tC("hd",!s),$inv.eM(!1,!0);let c=$$.dc("rfrm").ldng(1),o=$ocms.dlg(c,{width:1e3});o.ft.rwText($rct.rq2),$ocms.postXT({url:$ocms.url("req/iget"),timeout:60,data:{id:a,mode:"ful",typ:t,sel:r.join(",")},success:e=>{let t=$$.dc("srq",d),n=$$.tblset({class:"invi"},t);n.bdy.remove(),n.ft=$$[0]("tfoot"),e.admin=e.admin||{},e.admin.p13b=bool(e.admin.p13b||"",!0===((e.inv||{}).InvoiceOptions||"").split(",").includes("§13b")),n.tbl.data($.extend({new:{},sms:{},itm:{}},{admin:e.admin,companies:e.companies,locations:e.locations}));let i=$$.tr(n.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(i,e))),n.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.requests||[],(function(t,i){if(0!==(i.Id||0)){let t=$inv.worknotes(i);i.text="i"===e.admin.type?$rct.req+jine([i.ExternalId,i.Name],": ").eine(" ",""):jine([jine([fdt(i.WorkDoneAt,"dd.MM.yy"),i.ExternalId]," - "+$rct.req+" "),t.ne(i.Name)],": \n");let a=$$.tbody(n.tbl).data($.extend({},i));$inv.rendersrq.call(a)}}));let a=$$.tr($$.tbody(n.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(a),n.ft.appendTo(n.tbl);let r,l,s=e.admin||{},c=(e,t,i,a,r)=>{let l=$$.dc("inpfrm",d).aC(e).append("string"==typeof a?$$.dc("ahd",a):a>0?$$.dc("ahd",$rct.frm[i]):null),s=$$.dc("content",l).rwText(t);$$.dc("axf",l).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:s,nme:i,change:e=>{n.tbl.data("new")[i]=e}},r),$inv.eHtml)),n.tbl.data("new")[i]=t};c("tfrm",s.invoicetitle,"invoicetitle",0,null),c("adrfrm",s.invoiceaddress,"invoiceaddress",0,null),c("locfrm","","loc",1,{list:deepCopy(e.locations),lbl:"ref",property:"address"}),c("emailfrm",s.invoiceemail,"invoiceemail",0,null),$$.dc("sndfrm",d).append($$.dc("content").text(s.sender)),s.provisionend&&(l=s.provisionstart?$rct.provP:$rct.provD,r=s.provisionstart?fdt(s.provisionstart,"dd.MM.yyyy")+" - "+fdt(s.provisionend,"dd.MM.yyyy"):fdt(s.provisionend,"dd.MM.yyyy")),c("admfrm",r,"provisionperiod",l,1),n.tbl.data("new").CustomValues=s.CustomValues||"",$$.dc("inpfrm ctpfrm",d).text(jObj(s.CustomValues,"contactName")),n.tbl.children("tbody").each($inv.bdysort),n.tbl.trigger("fds.inv"),$inv.eM(!1,!0,$inv.emOpt(s))},complete:()=>{o.c.trigger("modal_close")}})},$inv.ccStInv=function(e){let t=e.data||{},n=$fis.lf(),i=t.id,a=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.sprev)),r=$fis.cf().width()>a.width()+n.width()+20;n.tC("fix",r).tC("hd",!r),$inv.eM(!1,!0);let l=$$.dc("rfrm").ldng(1),d=$ocms.dlg(l,{width:1e3});d.ft.rwText($ict.iq1),$ocms.postXT({url:$ocms.url("inv/pget"),timeout:90,data:{id:t.id},success:e=>{d&&d.ft.rwText($ict.iq2),$ocms.postXT({url:$ocms.url("inv/icget"),timeout:60,data:{id:i},success:e=>{let t=$$.dc("srq",a),n=$$.tblset({class:"invi"},t);n.bdy.remove(),n.ft=$$[0]("tfoot"),e.admin=e.admin||{},e.admin.p13b=bool(e.admin.p13b||"",!0===((e.inv||{}).InvoiceOptions||"").split(",").includes("§13b")),n.tbl.data($.extend({new:{},sms:{},itm:{}},{admin:e.admin,companies:e.companies,locations:e.locations}));let i=$$.tr(n.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(i,e))),n.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.requests||[],(function(t,i){if(0!==(i.Id||0)){let t=$inv.worknotes(i);i.text="i"===e.admin.type?$rct.req+jine([i.ExternalId,i.Name],": ").eine(" ",""):jine([fdt(i.WorkDoneAt,"dd.MM.yy")+t.ne(i.Name)],": ");let a=$$.tbody(n.tbl).data($.extend({},i));$inv.rendersrq.call(a)}}));let r=$$.tr($$.tbody(n.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(r),n.ft.appendTo(n.tbl);let l,d,s=e.admin||{},c=(e,t,i,r,l)=>{let d=$$.dc("inpfrm",a).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),s=$$.dc("content",d).rwText(t);$$.dc("axf",d).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:s,nme:i,change:e=>{n.tbl.data("new")[i]=e}},l),$inv.eHtml)),n.tbl.data("new")[i]=t};c("tfrm",s.invoicetitle,"invoicetitle",0,null),c("adrfrm",s.invoiceaddress,"invoiceaddress",0,null),c("locfrm",s.provisionlocation,"loc",1,{list:deepCopy(e.locations),lbl:"ref",property:"address"}),c("emailfrm",s.invoiceemail,"invoiceemail",0,null),$$.dc("sndfrm",a).append($$.dc("content").text(s.sender)),s.provisionend&&(d=s.provisionstart?$rct.provP:$rct.provD,l=s.provisionstart?fdt(s.provisionstart,"dd.MM.yyyy")+" - "+fdt(s.provisionend,"dd.MM.yyyy"):fdt(s.provisionend,"dd.MM.yyyy")),c("admfrm",l,"provisionperiod",d,1),n.tbl.data("new").CustomValues=s.CustomValues||"",$$.dc("inpfrm ctpfrm",a).text(jObj(s.CustomValues,"contactName")),n.tbl.children("tbody").each($inv.bdysort),n.tbl.trigger("fds.inv")},complete:()=>{d.c.trigger("modal_close")}})},error:()=>{d&&d.c.trigger("modal_close")}})},$inv.clCntInv=function(e){let t=$fis.lf(!1),n=[];t.find("li.ili.checked").each((function(){n.push($(this).data("Id"))})),1===n.length&&$inv.cntInv({id:n[0]})},$inv.cntInv=function(e){e=e||{};$fis.lf(!1).rC("fix").aC("hd");let t=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.sedit));$inv.eM(!1,!0);let n=$$.dc("rfrm").ldng(1),i=$ocms.dlg(n,{width:1e3});i.ft.rwText($rct.rq2),$ocms.postXT({url:$ocms.url("inv/get"),timeout:60,data:{id:e.id},success:e=>{e.admin=e.admin||{};let n=e.inv||{},i=$$.dc("srq",t),a=$$.tblset({class:"invi"},i);a.bdy.remove(),a.ft=$$[0]("tfoot"),a.tbl.data($.extend({invid:n.Id,new:{},sms:{},itm:{},bai:[]},e));let r=$$.tr(a.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(r,e))),a.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.req||[],(function(e,t){let n=$$.tbody(a.tbl).data($.extend({},t));$inv.rendersrq.call(n)}));let l=$$.tr($$.tbody(a.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(l),a.ft.appendTo(a.tbl);let d=(e,n,i,r,l)=>{let d=$$.dc("inpfrm",t).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),s=$$.dc("content",d).rwText(n);$$.dc("axf",d).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:s,nme:i,change:e=>{a.tbl.data("new")[i]=e}},l),$inv.eHtml)),a.tbl.data("new")[i]=n};d("tfrm",n.InvoiceTitle,"invoicetitle",0,null),d("adrfrm",n.SendToAddress,"invoiceaddress",0,null),d("locfrm",n.ProvisionLocation,"loc",1,null),d("emailfrm",n.SendToEmail,"invoiceemail",0,null),$$.dc("sndfrm",t).append($$.dc("content").text(e.admin.sender)),d("admfrm",n.ProvisionPeriod,"provisionperiod",!0===(n.ProvisionPeriod||"").includes("-")?$rct.provP:$rct.provD,1),a.tbl.data("new").CustomValues=n.CustomValues||"",$$.dc("inpfrm ctpfrm",t).text(jObj(n.CustomValues,"contactName")),a.tbl.children("tbody").each($inv.bdysort),a.tbl.trigger("fds.inv"),$inv.eM(!1,!0,$inv.emOpt(e.admin))},complete:()=>{i.c.trigger("modal_close")}})},$inv.cSt=function(e){e=e||{};let t=$fis.lf(),n=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.sedit)),i=$fis.cf().width()>n.width()+t.width()+20;t.tC("fix",i).tC("hd",!i),$inv.eM(!1,!0);let a=$$.dc("rfrm").ldng(1),r=$ocms.dlg(a,{width:1e3});r.ft.rwText($ict.iq1),$ocms.postXT({url:$ocms.url("inv/pget"),data:{id:e.id},success:t=>{r&&r.ft.rwText($ict.iq2),$ocms.postXT({url:$ocms.url("inv/storno"),data:{id:e.id,mode:e.mode},success:e=>{e.admin=e.admin||{},e.admin.p13b=bool(e.admin.p13b||"",!0===((e.inv||{}).InvoiceOptions||"").split(",").includes("§13b"));let t=e.inv||{},i=$$.dc("srq",n),a=$$.tblset({class:"invi"},i);a.bdy.remove(),a.ft=$$[0]("tfoot"),a.tbl.data($.extend({invid:t.Id,new:{},sms:{},itm:{},bai:[]},e));let r=$$.tr(a.hd).aC("shd").append([$$.th().aC("aux")]);$rct.invHR.forEach((e=>$$.th(r,e))),a.tbl.on("fds.inv",$inv.invSumUpdate),$.each(e.req||[],(function(e,t){let n=$$.tbody(a.tbl).data($.extend({},t));$inv.rendersrq.call(n)}));let l=$$.tr($$.tbody(a.tbl),{class:"placeholder"}).data({net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0});$inv.rrw.call(l),a.ft.appendTo(a.tbl);let d=(e,t,i,r,l)=>{let d=$$.dc("inpfrm",n).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),s=$$.dc("content",d).rwText(t);$$.dc("axf",d).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:s,nme:i,change:e=>{a.tbl.data("new")[i]=e}},l),$inv.eHtml)),a.tbl.data("new")[i]=t};d("tfrm",t.InvoiceTitle,"invoicetitle",0,null),d("adrfrm",t.SendToAddress,"invoiceaddress",0,null),d("locfrm",t.ProvisionLocation,"loc",1,null),d("emailfrm",t.SendToEmail,"invoiceemail",0,null),$$.dc("sndfrm",n).append($$.dc("content").text(e.admin.sender)),d("admfrm",t.ProvisionPeriod,"provisionperiod",!0===(t.ProvisionPeriod||"").includes("-")?$rct.provP:$rct.provD,1),a.tbl.data("new").CustomValues=t.CustomValues||"",$$.dc("inpfrm ctpfrm",n).text(jObj(t.CustomValues,"contactName")),a.tbl.children("tbody").each($inv.bdysort),a.tbl.trigger("fds.inv")},complete:()=>{r.c.trigger("modal_close")}})},error:()=>{r&&r.c.trigger("modal_close")}})},$inv.eHtml=function(e){let t=$(this),n=e.data instanceof jQuery?e.data:e.data.t,i=["invoiceemail","provisionperiod","invoicetitle"].includes(e.data.nme),a=i?[{name:"txt",label:"Text",type:"text",value:n.text()}]:[{name:"txt",label:"Text",type:"html",value:n.html(),tinymce:!0,attr:{style:"height: 300px"}}],r=e.data.change||null,l={title:t.data("dialog")||"",success:function(t){i?n.text(t.txt||""):n.html(t.txt),"function"==typeof r&&r(t.txt),$inv.d.syncField(e.data.nme,i?t.txt||"":t.txt),$inv.rd.syncField(e.data.nme,i?t.txt||"":t.txt)},tinymce:{valid_elements:"br",hidemenu:!0,hidetoolbar:!0}};if(Array.isArray(e.data.list)){let t=$$.dc("lstfrm");$.each(e.data.list,((n,i)=>{let a=$$.dc("li",t).append(""!==(e.data.lbl||"")?$$.dc("lbl").rwText(i[e.data.lbl]):null);$$.dc("adr",a).rwText(i[e.data.property]).data("val",i[e.data.property]).click((function(){let e=$(this),t=e.closest(".modal-body").find(':input[name="txt"]');t.is(".tinymce")?tinymce.get(t.attr("id")).setContent($$.s().rwText(e.data("val")).html()):"TEXTAREA"===t.prop("tagName")?t.val(e.data("val")).change():t.rwText(e.data("val"))}))})),l.addcontent=t}$ocms.dlgform(a,l)},$inv.setVat=function(e){$(this);let t=e.data,n=prompt($rct.rqV);n&&(n=parseFloat(n.replace("%","")),n>1&&(n*=.01),!1===isNaN(n)&&(t.siblings(".itm").each((function(){let e=$(this).data();e.vat=fnum(n,{style:"percent"}).replace(" ",""),(e.net_val||0)>0&&(e.vat_val=e.net_val*n),(e.svcnet_val||0)>0&&(e.svcvat_val=e.svcnet_val*n)})),$inv.t_fds_inv()))},$inv.inRow=function(e){let t=$(this),n=e.data,i={},a=$rcol.itm.clone(["SortOrder","NameOrNumber","Type","quantityhours","UnitString","net","svcnet_val","svcvat_val","net_val","vat_val","vat","Note"]),r="N"+(65536*(1+Math.random())||0).toString(16).substr(6),l=$$.tr({id:"itm_"+r.toString(),class:"itm"});$ocms.dlgform(a,{title:t.data("dialog")||"",success:function(e){l.data($.extend({Id:r},i,e)),$inv.rrw.call(l),l.insertAfter(n),$inv.t_fds_inv()},typedvalues:!0})},$inv.eRow=function(e){let t=$(this),n=e.data,i=n.data()||{},a=["SortOrder","NameOrNumber","Type","quantityhours","UnitString","net","svcnet_val","svcvat_val","net_val","vat_val","vat","Note"];i.id||""!==(i.Type||"")||a.unshift("Type");let r=$rcol.itm.clone(a).applyValues(i);r.set("Type","hidden","type"),$inv.eRw.call(t,n,i,r)},$inv.eRw=function(e,t,n){let i=$(this);$ocms.dlgform(n,{title:i.data("dialog")||"",success:function(n){let i={};""===(t.Id||"")&&(i.Id="N"+(65536*(1+Math.random())||0).toString(16).substr(6),e.attr("id","itm_"+i.Id.toString())),i.quantity=((n.quantityhours||"").toString()+" "+(n.UnitString||"").toString()).trimEnd(),e.data($.extend({},t,n,i)),console.debug("eRw success %o",e.data()),$inv.rrw.call(e),$inv.t_fds_inv()},typedvalues:!0})},$inv.bdysort=(e,t)=>{$(t).Sortable({dragItem:!1,dragHandleClass:"ico",parentident:"tr",onend:()=>{$inv.t_fds_inv()}})},$inv.rrw=function(){let e=$(this),t=e.data(),n={},i=e.is(".placeholder"),a=e.is(".hidenote"),r=e=>$$.d().append(e).html(),l=[$$.dc("ibtn insb",{title:$rct.iRb}).append(gi("indent-left")).click(e,$inv.inRow)];!1===i&&(l.unshift($$.dc("ibtn edit",{title:$rct.cP}).append(gi("pencil")).click(e,$inv.eRow)),l.push($$.dc("ibtn del",{title:$rct.dR}).append(gi("trash")).click((function(t){confirm($rct.cD)&&(e.remove(),$inv.t_fds_inv())}))),"set"===(t.Type||"").toLowerCase()&&""===(t.SetItmId||"")&&l.push($$.dc("ibtn tosetp",{title:$rct.toSetP}).append(gi("scale")).click(e,$inv.toSetPrice)));let d=$$.dc("axf").append(l);!0===i?n={id:"",typ:"placeholder"}:!0===e.is(".itm.osum")?n={invrqid:t.InvRqId,id:"osum"+e.index(),typ:"osum",p:"",q:null,t:r(t.tbl.tbl),tt:null,v:null,vt:t.net_val,vs:t.svcnet_val,vat:t.vat,vv:t.vat_val,vsv:t.svcvat_val,det:!1}:(n={invrqid:t.InvRqId,id:t.Id||"",typ:t.Type||"other",p:"",q:null,t:"",tt:null,v:null,vt:t.net_val,vs:t.svcnet_val,vat:t.vat,vv:t.vat_val,vsv:t.svcvat_val,det:""!==(t.Note||"")&&!1===a},$$.dc("ibtn ico move",d,{title:$rct.mR}),n.p=t.position||t.SortOrder||"",""===n.id?n.t="":["Text","Title"].includes(n.typ)&&0===(t.net_val||0)?n.t=t.htmltext||("#"!==(t.NameOrNumber||"").substr(0,1)?r($$[0]("p").text(t.NameOrNumber)):"")+(t.Note||""):(n.tt=n.det?"":$$.s(t.Note||"").text(),n.q=t.quantity||fnum(t.quantityhours)+" "+(t.UnitString||""),n.t=t.htmltext||(n.det?r($$.s(t.NameOrNumber||""))+r($$.dc("desc").html(t.Note)):r($$.s(t.NameOrNumber||""))),n.v=t.net,n.vt=t.net_val)),""!==(t.Note||"")&&$$.dc("ibtn add",d).append(gi("object-align-left")).click((function(t){$inv.rrw.call(e.tC("hidenote"))}));let s=[$$.tdc("aux").append(d),$$.tdc("keep").text(n.p)];""===n.id?s.push($$.td(e,{colspan:4}).append(n.t)):(Array.prototype.push.apply(s,n.q?[$$.tdc("keep").text(n.q)]:[]),Array.prototype.push.apply(s,[$$.tdc("txt",{colspan:n.q?1:2,title:n.tt}).append(n.t),$$.tdc("currency").text(fnum(n.v,$rct.cst)),$$.tdc("currency inetval").text(fnum(n.vt,$rct.cst)).attr("title",$rct.svcPart+": "+fnum(n.vs,$rct.cst))])),e.empty().attr("class",i?"placeholder":"itm").aC(n.Typ).tC("hidenote",a).append(s),t.co=n},$inv.toSetPrice=function(e){let t=e.data,n=t.data(),i=(n.Id||"").toString();if(""===i)return;if(!1===confirm($rct.toSetPc))return;let a=t.closest("tbody").find("tr.itm").filter((function(){return($(this).data("SetItmId")||"").toString()===i})),r=0,l=0,d=0,s=0;a.each((function(){let e=$(this).data();r+=e.net_val||0,l+=e.vat_val||0,d+=e.svcnet_val||0,s+=e.svcvat_val||0,$.extend(e,{net:0,net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,Discount:0}),$inv.rrw.call($(this))})),$.extend(n,{net:r,quantityhours:1,Discount:0,net_val:r,vat_val:l,svcnet_val:d,svcvat_val:s}),$inv.rrw.call(t),$inv.t_fds_inv()},$inv.invSumUpdate=function(){let e=$(this),t=e.children("tfoot").empty(),n=bool((e.data().admin||{}).p13b||"",!1);e.nextAll(".fnote").remove();let i={ttn:0,ttb:0,ttvat:0,tscn:0,tscvat:0,vat:{},itmnet:{}},a=[],r=(e,n,i)=>$$.tdc("currency",$$.tr(t,{class:i||"tsum"}).append([$$.tdc("aux"),$$.td({colspan:4}).text(e)]),fnum(n,$rct.cst)),l=t=>$$.dc("fnote").insertAfter(e).rwText(t),d=e.children("tbody");d.each(((e,t)=>{let n=$(t),r=n.data()||{},l=[],d=[],s=null,c=0,o=n.find("tr.itm"),u=0;n.tC("empty",o.length<1),o.each(((e,t)=>{let n=$(t).data()||{};!function(e,t,n){t.tscn+=e.svcnet_val||0,t.tscvat+=e.svcvat_val||0,t.ttn+=e.net_val||0,t.ttvat+=e.vat_val||0,t.ttb+=(e.net_val||0)+(e.vat_val||0),""!==(e.vat||"")&&(t.vat[e.vat]=(t.vat[e.vat]||0)+(e.vat_val||0))}(n,i,r.Id),c+=n.net_val||0,l.push(n.co);let a=$inv.itemToContract(n);"set"===a.type&&""!==a.id?s=a.id:null!==s&&""!==(a.id||"")&&(a.setId=s),d.push(a),(void 0===n.SortOrder||null===n.SortOrder?-1:n.SortOrder)>-1&&(!1===["text","title"].includes((n.Type||"other").toLowerCase())&&u++,n.SortOrder=0,n.position=u,$inv.rrw.call(t))})),n.find("tr.isum > td.isumval").text(fnum(c,$rct.cst)),a.push({Id:r.Id,nme:r.Name,text:r.text,itm:l,items:d,netval:c})}));let s=e.find("tbody:not(.empty)").length;d.find("tr.isum").tC("hidden",s<2),r("Netto",i.ttn),!1===n?$.each(i.vat,((e,t)=>{r($rct.vat+" "+e,t,"tvat")})):i.ttb=i.ttn,r("Summe",i.ttb);let c=e.data().admin.type;"i"===c?(l($rct.note2),l($rct.note4)):"c"===c?l($rct.note2):(l(string($rct.note3,[fnum((i.tscn+i.tscvat)*(e.data().admin.tax_servicerefund||0),$rct.cst)])).aC("ntax"),l($rct.note2),l(string($rct.note1,[fnum(i.tscn+i.tscvat,$rct.cst),fnum(i.tscn,$rct.cst),fnum(i.tscvat,$rct.cst)]))),!0===n&&l($rct.note13b),e.data("sms",i),e.data("bai",a),""===(e.data("dtoken")||"")&&!1===bool(e.data("dseeding"),!1)&&null!=(e.data("admin")||{}).type&&(e.data("dseeding",!0),$inv.d.seed($.extend($inv.invcPayload(e.data()),{invid:e.data("invid")||""})))},$inv.worknotes=function(e){let t="";return e.steps.forEach(((e,n)=>{let i;try{i=JSON.parse(e.Data||{}).fields||[]}catch(e){console.debug(e),i=[]}!0!==Array.isArray(i||"")&&(i="object"==typeof i&&!0===Array.isArray(i.field||"")?i.field:[]),i.forEach(((e,n)=>{"Ausgeführte Arbeiten"===e.name&&(t=e.result||"")}))})),t},$inv.rendersrq=function(){let e=$(this).empty(),t=e.is(".onesum"),n=e.data(),i=$$.tr(e,{id:"srq"+n.Id}).aC("title nosort"),a=($rcol.itm.lbl(),$$.dc("axf").appendTo($$.tdc("aux",i)));$$.dc("ibtn osum",a,{title:$rct.combP}).append(gi("euro")).click((function(t){e.tC("onesum"),$inv.rendersrq.call(e),$inv.t_fds_inv()})),$$.dc("ibtn setvat",a,{title:$rct.sV}).append(gi("gbp")).click(i,$inv.setVat),$$.dc("ibtn insb",a,{title:$rct.iRb}).append(gi("indent-left")).click(i,$inv.inRow);let r,l=$$.sc("text",n.text),d=($$.td(i,{colspan:t?4:5}).append(l),["net_val","vat_val","svcnet_val","svcvat_val","net"]);if($$.dc("ibtn edit",a).data("dialog",$rcol.req.lbl().Name).append(gi("pencil")).click({t:l,change:e=>{n.text=e,$inv.t_fds_inv()}},$inv.eHtml),t&&($$.tdc("currency isumval",i),r={Id:n.Id.toString()+"_osum",net_val:0,vat_val:0,svcnet_val:0,svcvat_val:0,net:0},r.tbl=$$.tblset({class:"stbl"})),$.each(n.items||[],((n,i)=>{let a,l={Id:i.Id,net_val:i.net_val||0,vat_val:i.vat_val||0,svcnet_val:0,svcvat_val:0,net:i.net||0,Note:i.Note||""};if("service"===i.Type.toLowerCase())l.svcnet_val=i.net_val||0,l.svcvat_val=i.vat_val||0;t?(a=$$.tr(r.tbl.bdy,{id:"itm"+i.Id,class:"sitm"}).aC(i.Type),"Text"===i.Type||"Title"===i.Type?$$.td(a,{colspan:2}).html(i.htmltext||i.Note):($$.tdc("keep",a).text(i.quantity||((i.quantityhours||0)>0?fnum(i.quantityhours)+(i.UnitString||"").eine(" ",""):"")),i.htmltext?$$.tdc("txt",a).html(i.htmltext):$$.tdc("txt",a).text(i.NameOrNumber).attr("title",i.Note)),$.each(d,((e,t)=>{r[t]+=l[t]})),a.data(l)):($.extend(l,i),a=$$.tr(e,{id:"itm"+i.Id,class:"itm"}),a.data(l),$inv.rrw.call(a))})),t){let t=$$.tr(e,{id:"itmsq"+n.Id,class:"itm osum"}).data(r);$inv.rrw.call(t)}else{let t=$$.tr(e).aC("isum nosort");$$.tdc("aux",t),$$.td(t,{colspan:4}).text($rct.iSum),$$.tdc("currency isumval",t)}},$inv.t_fds_inv=()=>{let e=$("div.invoice_layout table.invi");e.trigger("fds.inv"),""!==(e.data("dtoken")||"")&&$inv.d.syncChanged(e)},$inv.sedit=()=>{$inv.sprev(!0)},$inv.jdisp=function(e){e.stopPropagation(),e.data.id&&$inv.disp(e.data.id,e.data.typ||"")},$inv.disp=(e,t)=>{let n="";switch(t){case"inv":n="inv/rdoc";break;case"rem":n="rem/rdoc"}""!==n&&$ocms.postXT({url:$ocms.url(n),data:{id:e||"",typ:"img"},success:e=>{let t=$$.dc("imagecollection pdfpreview"),n=Math.round(.88*vh());e.id;$.each(e.img||[],(function(e,i){$$.dc("pdfp",t).append($$.img(i).css("max-height",(n-rpx(6)).toString()+"px"))})),$ocms.dlg(t,{size:[n,Math.round(.88*vw())],zindex_min:50,form:!1,exclusive:!1})}})},$inv.jdbn=function(e){$ocms.postXT({url:$ocms.url("inv/rdocn"),data:{name:e.data.id||"",typ:"img"},success:e=>{let t=$$.dc("imagecollection pdfpreview"),n=Math.round(.88*vh());e.id;$.each(e.img||[],(function(e,i){$$.dc("pdfp",t).append($$.img(i).css("max-height",(n-rpx(6)).toString()+"px"))})),$ocms.dlg(t,{size:[n,Math.round(.88*vw())],zindex:50,form:!1})}})},$inv.sp13b=()=>{var e=$("div.invoice_layout").find("table.invi"),t=e.data();t.admin.p13b=!0,!1===(t.inv.InvoiceOptions||"").split(",").includes("§13b")&&(t.inv.InvoiceOptions+=",§13b"),e.trigger("fds.inv"),$inv.d.sync({Target:"p13b",Value:t.admin.p13b})},$inv.itemToContract=function(e){let t=((e=e||{}).Type||"").toString().toLowerCase(),n={id:(e.Id||"").toString(),type:t,title:"",desc:"",qty:"",price_net:"",total_net:e.net_val||0,vat:e.vat||""};var i;return e.co&&"osum"===e.co.typ?(n.desc=e.co.t||"",n.total_net=e.net_val||0):["text","title"].includes(t)&&0===(e.net_val||0)?(n.desc=e.htmltext||("#"!==(e.NameOrNumber||"").substr(0,1)?(i=$$[0]("p").text(e.NameOrNumber||""),$$.d().append(i).html()):"")+(e.Note||""),n.total_net=""):(e.htmltext?n.desc=e.htmltext:(n.title=e.NameOrNumber||"",n.desc=e.Note||""),n.qty=e.quantity||(0!==(e.quantityhours||0)?fnum(e.quantityhours)+(e.UnitString?" "+e.UnitString:""):""),n.price_net=e.net||0,n.total_net=e.net_val||0),n},$inv.ssetmode=()=>{let e=$("div.invoice_layout").find("table.invi").data();e.admin=e.admin||{};let t,n=e.admin.setmode||"setprice",i=e=>$$.dc("btn",$ict.setmo[e]).tC("selected",n===e).click((()=>{t.c.trigger("modal_close"),$inv.setSetmode(e)})),a=$$.dc("choicefrm").append([i("setprice"),i("itemprices"),i("setonly")]);t=$ocms.dlg(a,{width:800})},$inv.setSetmode=e=>{let t=$("div.invoice_layout").find("table.invi").data();t.admin=t.admin||{},t.admin.setmode=e,t.inv=t.inv||{};let n=(t.inv.InvoiceOptions||"").split(",").filter((e=>""!==e&&0!==e.indexOf("setmode:")));e&&"setprice"!==e&&n.push("setmode:"+e),t.inv.InvoiceOptions=n.join(","),$inv.d.sync({Target:"setmode",Value:e})},$inv.sctp=()=>{let e=$invcol.ctp;$ocms.dlgform(e,{title:$ict.ctp,success:function(e){var t=$("div.invoice_layout"),n=t.find("table.invi").data();let i={};void 0!==n.new&&"{"===(n.new.CustomValues||"").substr(0,1)&&(i=JSON.parse(n.inv.CustomValues)),i.contactName=e.name,i.contactEmail=e.email,n.new.CustomValues=JSON.stringify(i),t.find(".ctpfrm").text(ne(e.name,e.email)),$inv.d.sync({Target:"contact",Value:{name:e.name,email:e.email}})},typedvalues:!0})},$inv.invcPayload=function(e){let t=(e=e||{}).sms||{},n=$.extend({},e.new),i=$.extend({},e.admin);return n.total_net=t.ttn||0,n.total_gross=t.ttb||0,n.title=null!=n.invoicetitle?n.invoicetitle:n.title||"",n.provisionlocation=null!=n.loc?n.loc:n.provisionlocation||"",n.paymentterm=null!=i.paymentterms?i.paymentterms:n.paymentterm||"",i.customerid=null!=i.customerid?i.customerid:i.CustomerId,{admin:i,req:e.bai,sms:e.sms,new:n}},$inv.ssave=()=>{$inv.d.save()},$inv.sprev=e=>{$inv.d.preview()},$inv.rReload=()=>{try{let e=$("#listframe ul.rql:first").data();$inv.cInv2({id:e.search})}catch(e){}},$inv.quantChange=function(e){let t=$(this).closest("form"),n={},i=e=>parseFloat(e.toString().replace("%","").replace(",",".")),a=e=>e.toFixed(2);t.find(":input").each(((e,t)=>{n[$(t).attr("name")]=$(t)}));let r=parseInt(n.quantityhours.val()||"0"),l=i(n.net.val()||"0"),d=.01*i(n.vat.val());r>0&&l>0&&(n.net_val.val(a(r*l)),n.vat_val.val(a(r*l*d)),["Service"].includes(n.Type.val())&&(n.svcnet_val.val(a(r*l)),n.svcvat_val.val(a(r*l*d))))},$inv.storno=function(e,t){let n,i=$$.dc("choicefrm").append([$$.dc("btn","Storno ohne Details").click({id:e,mode:"simple"},(e=>{n.c.trigger("modal_close"),$inv.cSt(e.data)})),$$.dc("btn","Storno mit neuer Rechnung").click({id:e},(e=>{n.c.trigger("modal_close"),$inv.ccStInv(e)})),$$.dc("btn","Storno mit best. Rechnung").tC("inactive",!1===bool(t,!1)).click({id:e,mode:"copy"},(e=>{!0===bool(t,!1)&&(n.c.trigger("modal_close"),$inv.cSt(e.data))}))]);n=$ocms.dlg(i,{width:1e3})},$inv.credit=function(e,t){let n,i=$$.dc("choicefrm").append([$$.dc("btn","Gutschrift").click({id:e,mode:"credit"},(e=>{n.c.trigger("modal_close"),$inv.cSt(e.data)}))]);n=$ocms.dlg(i,{width:1e3})},$inv.setPyd=function(e){confirm($ict.cpyd)&&$ocms.postXT({url:$ocms.url("inv/setpyd"),timeout:60,data:{id:e},success:e=>{alert($ict.relm)},error:()=>{alert($t.f1)}})},$inv.setUpd=function(e){confirm($ict.cupd)&&$ocms.postXT({url:$ocms.url("inv/setupd"),timeout:60,data:{id:e},success:e=>{alert($ict.relm)},error:()=>{alert($t.f1)}})},$inv.resendRem=function(e){e.stopPropagation(),e.data.id&&confirm(string($ict.remresc,[e.data.name]))&&$ocms.postXT({url:$ocms.url("rem/resend"),timeout:60,data:{id:e.data.id},success:t=>{alert(string($ict.remresr,[e.data.name]))},error:()=>{alert($t.f1)}})},$inv.dspRem=function(e){let t=$$.dc("rfrm").ldng(1),n=$ocms.dlg(t,{width:1e3});n.ft.rwText($rct.rq2),$ocms.postXT({url:$ocms.url("inv/getrem"),timeout:60,data:{id:e,drafts:!1},success:e=>{n.ft.empty();let i=$$.tblset({class:"invtbl"},t.empty()),a=$invcol.rem2,r=$$.tr(i.hd);$$.th(r);$.each(a.fields||[],((e,t)=>{$$.th(r).text(t.label)}));let l=!1;$.each(e,((e,t)=>{l=!l;let n=$$.tr(i.bdy).tC("alt",l),r=$$.td(n);n.click((function(){n.tC("selected").siblings().rC("selected")})),!0===bool(t.hasFile,!1)&&($$.dc("idl ilbtn",r,{title:$ict.dl+"\n"+t.DocumentName}).append(gi("save-file","ico")).click({id:t.Id},$inv.downloadrem),$$.dc("idl ilbtn",r,{title:$ict.remdsp+"\n"+t.DocumentName}).append(gi("eye-open","ico")).click({id:t.Id,typ:"rem"},$inv.jdisp),$$.dc("idl ilbtn",r,{title:$ict.remres+"\n"+t.DocumentName}).append(gi("refresh","ico")).click({id:t.Id,typ:"rem",name:t.DocumentName},$inv.resendRem)),$.each(a.fields||[],((e,i)=>{let a=$$.td(n).aC(i.dtype),r=t[i.name];if("function"==typeof i.dfnc)i.dfnc.call(a,r,t);else switch(i.type||""){case"date":a.text(fdt(t[i.name],"dd.MM.yy"));break;case"datetime":a.text(fdt(t[i.name]));break;case"html":a.append($$.dc("ctw").html(r)),a.append($$.dc("ttip").html(r));break;default:a.text(t[i.name])}if("InvoiceId"===(i.name||""))a.aC("keep");switch(typeof i.title){case"function":i.title.call(a,t);break;case"string":a.attr("title",cs.title)}}))}))},error:()=>{t.empty(),n.ft.rwText($t.f1)},complete:()=>{t.ldng(0)}})},$inv.ccRem=function(e,t){$(this);$ocms.postXT({url:$ocms.url("rem/lrem"),timeout:60,data:{id:e},success:n=>{let i=$invcol.rid.clone();i.applyValues(n.ov);let a=$$.dc("ac"),r=$$.tblset({class:"fullgrid fullwidth"},a);if((n.lst||[]).length>0){$$.d({style:"margin: 1.5rem 0 1rem 0;font-size: 110%;text-decoration: underline;"}).prependTo(a).text($ict.rovlh);let e=$$.tr(r.hd);$ict.rovl.forEach(((t,n)=>$$.th(e,t))),$.each(n.lst,((e,t)=>{$$.tr(r.bdy).append([$$.tdc("keep",t.subject),$$.tdc("currency",fnum(t.amount,$rct.cst)),$$.tdc("currency",fnum(t.amount_payed,$rct.cst)),$$.tdc("keep",fdt(t.DateFinalized,"dd.MM.yy"))])}))}else $$.td($$.tr(r.bdy),$ict.nd);$ocms.dlgform(i,{addcontent:a,title:string($ict.remdt,[t||"?"]),success:function(t){$inv.ccRem_s2(e,t)},typedvalues:!0})}})},$inv.rRemRw=function(e){let t=$(this),n=e.rm||{};t.empty().data({invoiceid:n.invoiceid,invoicedate:n.invoicedate,amount:n.amount,amount_payed:n.amount_payed});let i=$$.dc("axf").append($$.dc("ibtn edit",{title:$rct.cP}).append(gi("pencil")).click(t,$inv.eRowR));t.append([$$.tdc("aux").append(i),$$.tdc("keep",n.invoiceid),$$.tdc("keep",fdt(n.invoicedate,"dd.MM.yy")),$$.tdc("currency",fnum(n.amount,$rct.cst)),$$.tdc("currency",fnum(n.amount_payed,$rct.cst)),$$.tdc("currency",fnum(n.amount-n.amount_payed,$rct.cst))])},$inv.eRowR=function(e){let t=$(this),n=e.data,i=n.data()||{},a=$invcol.rem.clone().applyValues(i);$ocms.dlgform(a,{title:t.data("dialog")||"",success:function(e){let i=t.closest("table"),a=i.data();$.extend(a.rm,e),i.data(a),$inv.rRemRw.call(n,a),$inv.rd.syncAmount(a.rm.amount,a.rm.amount_payed)},typedvalues:!0})},$inv.ccRem_s2=function(e,t){$fis.lf(!1).rC("fix").aC("hd");let n=$$.dc("invoice_layout",$fis.frm_edit()).append($$.dc("btn sprev").click($inv.rprev));$inv.eM(!1,!0);$$.dc("rfrm").ldng(1);$ocms.postXT({url:$ocms.url("rem/get"),timeout:60,data:$.extend({id:e},t),success:e=>{let t=e.rm||{},i=$$.dc("srq",n),a=$$.tblset({class:"invi"},i);a.ft=$$[0]("tfoot"),a.tbl.data($.extend({invid:t.invid,new:{}},e));let r=$$.tr(a.hd).aC("shd").append([$$.th().aC("aux")]);$ict.remHR.forEach((e=>$$.th(r,e))),$inv.rRemRw.call($$.tr(a.bdy),a.tbl.data()),a.ft.appendTo(a.tbl);let l=(e,t,i,r,l)=>{let d=$$.dc("inpfrm",n).aC(e).append("string"==typeof r?$$.dc("ahd",r):r>0?$$.dc("ahd",$rct.frm[i]):null),s=$$.dc("content",d).rwText(t);$$.dc("axf",d).append($$.dc("ibtn edit").data("dialog",$rct.frm[i]).append(gi("pencil")).click($.extend({t:s,nme:i,change:e=>{a.tbl.data("new")[i]=e}},l),$inv.eHtml)),a.tbl.data("new")[i]=t};l("tfrm",t.subject,"subject",0,null),l("adrfrm",t.invoiceaddress,"invoiceaddress",0,null),l("emailfrm",t.invoiceemail,"invoiceemail",0,null),$$.dc("sndfrm",n).append($$.dc("content").text(t.sender)),a.tbl.children("tbody").each($inv.bdysort),a.tbl.trigger("fds.inv");let d=a.tbl.data("new");d.amount=t.amount,d.amount_payed=t.amount_payed,$inv.rd.seed({rem:{invid:t.invid,type:t.type,invoiceid:t.invoiceid,invoicedate:t.invoicedate},new:d})},complete:()=>{}})},$inv.rprev=()=>{$inv.rd.preview()},$inv.sis=e=>{confirm($ict.sisc)&&$ocms.postXT({url:$ocms.url("inv/sis"),data:{id:e||""},success:e=>{}})},$inv.srs=e=>{confirm($ict.srsc)&&$ocms.postXT({url:$ocms.url("rem/srs"),data:{id:e||""},success:e=>{}})},$inv.mfrrel=e=>{$("#contentframe").ldng(),$ocms.postXT({url:$ocms.url("inv/mfrrel"),data:{id:e||""},success:e=>{$inv.rerenderinv()},complete:()=>{$("#contentframe").ldng(0)}})}; \ No newline at end of file diff --git a/Fuchs/wwwroot/web/fis.inv.min.css b/Fuchs/wwwroot/web/fis.inv.min.css index 64f4e05..dbcbcb5 100644 --- a/Fuchs/wwwroot/web/fis.inv.min.css +++ b/Fuchs/wwwroot/web/fis.inv.min.css @@ -1 +1 @@ -.invfrm>table td.sh_s,table.invtbl td.sh_s{color:#bf4b06}.invfrm>table td.is_cc,table.invtbl td.is_cc{background-color:#777!important;color:#fff!important}.invfrm>table td.is_pyd,table.invtbl td.is_pyd{color:#60cc08}.invfrm>table td.is_due,table.invtbl td.is_due{background-color:#f2f23f!important}.invfrm>table td.is_ovd,table.invtbl td.is_ovd{background-color:#de4e09!important}.invfrm>table td.is_rem,table.invtbl td.is_rem{background-color:#ce1900!important}.invfrm>table td.av,table.invtbl td.av{border:2px solid red}.invfrm>table td.av+td.vsel select,table.invtbl td.av+td.vsel select{display:block}.rfrm{min-width:200px;min-height:200px}table.if{border-collapse:collapse;margin:1rem 0;background:#fff}table.if tr:nth-child(2n+1) td{background-color:#f9f9f9}table.if tr.title td{background-color:#56a532;color:#fff}table.if tr.title td .eid{font-weight:700;margin:0 1rem 0 .5rem;font-size:140%}table.if tr.title td .nme{font-size:110%}table.if tr.shd td{font-style:italic;color:#bbb;background-color:#fff!important;font-size:90%}table.if td,table.if th{padding:.2rem .35rem;border:1px solid #ddd}table.if td.currency{text-align:right;white-space:nowrap}table.if td.num{white-space:nowrap}.pdfpreview .pdfp.ph>.note{background:#fff;display:inline-block;padding:3rem;margin:.2rem 0}@keyframes fis_spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}.edit_frm .invoice_layout{margin:2rem 2rem 2rem auto;width:50rem;border:1px solid #eee;padding:25.5rem 3rem 3rem;box-shadow:4px 4px 9px rgba(50,50,50,.3);position:relative}.edit_frm .invoice_layout .axf{font-size:1rem;display:none;position:absolute;right:100%;height:100%;min-height:1.5rem;min-width:2rem;background:#f0ffe2;border:1px solid #ccc;border-top-left-radius:.2rem;border-bottom-left-radius:.2rem;top:0;width:auto;max-height:1.5rem;overflow:hidden;padding:.1rem}.edit_frm .invoice_layout .axf>.ibtn{cursor:pointer;height:100%;width:1.5rem;display:inline-block;position:relative}.edit_frm .invoice_layout .sndfrm{position:absolute;font-size:.7rem;color:#727272;top:4.7rem;left:3rem;width:auto;height:auto;user-select:none}.edit_frm .invoice_layout .emailfrm{position:absolute;font-size:.7rem;top:.5rem;left:.5rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .emailfrm:hover div.axf{display:block}.edit_frm .invoice_layout .admfrm{position:absolute;right:3rem;top:9rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .admfrm .ahd{display:block;color:#727272;margin:0 0 .2rem}.edit_frm .invoice_layout .admfrm .content{color:#000}.edit_frm .invoice_layout .admfrm .content:empty::before{content:"-";min-width:5rem;height:1rem;display:block;position:absolute}.edit_frm .invoice_layout .admfrm:hover div.axf{display:block}.edit_frm .invoice_layout .ctpfrm{position:absolute;right:3rem;top:14rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .ctpfrm .ahd{display:block;color:#727272;margin:0 0 .2rem}.edit_frm .invoice_layout .ctpfrm .content{color:#000}.edit_frm .invoice_layout .ctpfrm .content:empty::before{content:"-";min-width:5rem;height:1rem;display:block;position:absolute}.edit_frm .invoice_layout .ctpfrm:hover div.axf{display:block}.edit_frm .invoice_layout .adrfrm{position:absolute;left:3rem;top:6rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .adrfrm:hover div.axf{display:block}.edit_frm .invoice_layout .locfrm{position:absolute;left:3rem;top:18.5rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .locfrm .ahd{display:block;color:#727272;margin:0 0 .2rem}.edit_frm .invoice_layout .locfrm .content:empty::before{content:"-";min-width:5rem;height:1rem;display:block;position:absolute}.edit_frm .invoice_layout .locfrm:hover div.axf{display:block}.edit_frm .invoice_layout .tfrm,.edit_frm .invoice_layout>div.title{position:absolute;left:3rem;top:15rem;font-size:2rem;cursor:pointer}.edit_frm .invoice_layout .tfrm:hover div.axf,.edit_frm .invoice_layout>div.title:hover div.axf{display:block}.edit_frm .invoice_layout div.fnote{margin:1rem 0}.edit_frm .invoice_layout p+table.invi,.edit_frm .invoice_layout table.invi+p{margin-top:2.5rem}.edit_frm .invoice_layout table.invi{border-collapse:separate;border-spacing:0;border-color:#fff;width:100%;max-width:100%}.edit_frm .invoice_layout table.invi>tbody>tr.hidden{display:none}.edit_frm .invoice_layout table.invi>tbody>tr:nth-child(2n+1) td{background-color:#fbfbfb;border-color:#fbfbfb}.edit_frm .invoice_layout table.invi>tbody>tr.title>td{background:#fff;border-color:#fff;border-top:1.5px solid #000}.edit_frm .invoice_layout table.invi td.currency,.edit_frm .invoice_layout table.invi td.num,.edit_frm .invoice_layout table.invi th.currency,.edit_frm .invoice_layout table.invi th.num{text-align:right;white-space:nowrap}.edit_frm .invoice_layout table.invi td.keep,.edit_frm .invoice_layout table.invi th.keep{white-space:nowrap}.edit_frm .invoice_layout table.invi table.stbl td,.edit_frm .invoice_layout table.invi table.stbl th{padding:.3rem .5rem}.edit_frm .invoice_layout table.invi table.stbl td:first-child,.edit_frm .invoice_layout table.invi table.stbl th:first-child{padding-left:0}.edit_frm .invoice_layout table.invi table.stbl td:last-child,.edit_frm .invoice_layout table.invi table.stbl th:last-child{padding-right:0}.edit_frm .invoice_layout table.invi>tbody>tr>td,.edit_frm .invoice_layout table.invi>tbody>tr>th,.edit_frm .invoice_layout table.invi>tfoot>tr>td,.edit_frm .invoice_layout table.invi>tfoot>tr>th,.edit_frm .invoice_layout table.invi>thead>tr>td,.edit_frm .invoice_layout table.invi>thead>tr>th,.edit_frm .invoice_layout table.invi>tr>td,.edit_frm .invoice_layout table.invi>tr>th{border-width:1px;padding:.3rem .5rem;border-left:none!important;border-right:none!important}.edit_frm .invoice_layout table.invi>tbody>tr>td.aux,.edit_frm .invoice_layout table.invi>tbody>tr>th.aux,.edit_frm .invoice_layout table.invi>tfoot>tr>td.aux,.edit_frm .invoice_layout table.invi>tfoot>tr>th.aux,.edit_frm .invoice_layout table.invi>thead>tr>td.aux,.edit_frm .invoice_layout table.invi>thead>tr>th.aux,.edit_frm .invoice_layout table.invi>tr>td.aux,.edit_frm .invoice_layout table.invi>tr>th.aux{width:0;max-width:0;min-width:0;position:relative;padding:0}.edit_frm .invoice_layout table.invi>tbody>tr>th,.edit_frm .invoice_layout table.invi>tfoot>tr>th,.edit_frm .invoice_layout table.invi>thead>tr>th,.edit_frm .invoice_layout table.invi>tr>th{text-align:left;font-weight:300;background-color:#fff;border-color:#fff;font-size:.8rem;font-style:italic;border-top-style:none;border-bottom-style:none}.edit_frm .invoice_layout table.invi>tbody>tr>td,.edit_frm .invoice_layout table.invi>tfoot>tr>td,.edit_frm .invoice_layout table.invi>thead>tr>td,.edit_frm .invoice_layout table.invi>tr>td{vertical-align:top;font-weight:400;background-color:#f8f8f8;border-color:#f8f8f8;border-top-style:solid;border-bottom-style:solid;user-select:none}.edit_frm .invoice_layout table.invi>tbody>tr:hover>td.aux>.axf,.edit_frm .invoice_layout table.invi>tfoot>tr:hover>td.aux>.axf,.edit_frm .invoice_layout table.invi>thead>tr:hover>td.aux>.axf,.edit_frm .invoice_layout table.invi>tr:hover>td.aux>.axf{display:inline-flex}.edit_frm .invoice_layout table.invi>tbody>tr.isum>td,.edit_frm .invoice_layout table.invi>tfoot>tr.isum>td,.edit_frm .invoice_layout table.invi>thead>tr.isum>td,.edit_frm .invoice_layout table.invi>tr.isum>td{border-top:1px solid #000;background:#fff}.edit_frm .invoice_layout table.invi>tbody>tr.sep>td,.edit_frm .invoice_layout table.invi>tfoot>tr.sep>td,.edit_frm .invoice_layout table.invi>thead>tr.sep>td,.edit_frm .invoice_layout table.invi>tr.sep>td{background:#fff}.edit_frm .invoice_layout table.invi>tbody>tr.tsum td,.edit_frm .invoice_layout table.invi>tfoot>tr.tsum td,.edit_frm .invoice_layout table.invi>thead>tr.tsum td,.edit_frm .invoice_layout table.invi>tr.tsum td{font-weight:600;border-top:1px solid #000;border-bottom:1px solid #000}.edit_frm .invoice_layout table.invi .sortable>tr>td.aux .ico.move{background:url(data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAzMiAzMiIgaWQ9IkxheWVyXzQiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48Zz48cG9seWdvbiBmaWxsPSJub25lIiBwb2ludHM9IjE2LDMxIDgsMTggMjQsMTggICAgICIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iI0RERERERCIvPjxwb2x5Z29uIGZpbGw9Im5vbmUiIHBvaW50cz0iMTYsMSA4LDE0IDI0LDE0ICAgICAiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2U9IiNEREREREQiLz48L2c+PC9zdmc+) center center/contain no-repeat border-box}.edit_frm .invoice_layout table.invi .sortable>tr>td.aux .ico.move:hover{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIGlkPSJMYXllcl80IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGc+PHBvbHlnb24gZmlsbD0ibm9uZSIgcG9pbnRzPSIxNiwzMSA4LDE4IDI0LDE4ICAgICAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2Utd2lkdGg9IjIiLz48cG9seWdvbiBmaWxsPSJub25lIiBwb2ludHM9IjE2LDEgOCwxNCAyNCwxNCAgICAgIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9nPjwvc3ZnPg==)}.edit_frm .invoice_layout table.invi .sortable>tr.sortactive>td.ico{cursor:move}.edit_frm .invoice_layout .btn{background:url("") center center/contain no-repeat content-box #fff;position:absolute;top:.2rem;right:.2rem;height:3rem;width:3rem;padding:.1rem;z-index:11}.edit_frm .invoice_layout .btn.sprev{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAaz0lEQVR4nO2caVAbd97neSbObPJs7VE7z4vU82Krdp+t2qmt3apnNhObIzanwfjKZBJPJpXJU45rbGcSH4mvCZM4g08yPjC2s/gCJjG2sfEB2BhkA+ISoPtAal3dUnerW/fRkgAnYbLz3RfQHQHCHHby7Ivpqk9JdLcE+vh//H6//1/OyPjb8bfj/6sDwI8IgnjBarX+T4fD8dKpU6fyPv744w379+//zYEDB0pVKlUWSZI/M5vN/8Rx3PP/2n/vEx2NjY3PbNmy5dny8vIls9HY2PjMnj17/u1HH330X48dO/bazp07q3ft2jV05MgR75kzZ5I1NTXfNDQ0/OXmzZvf1tfXj1+4cOHRsWPHIp988ol9+/btt0+cOLH74MGDL77//vs/aWxsfKa8vPxHjY2Nz8yH8vLyH80HAH83F4sStGHDhv+QkZHxv5977rmCFPJElixZkveTn/zkX4qKii7v2LGDOnfu3JhMJvvr8PAwSJIETdNgWRYcx8HL8+A4DgzDgKIo2O12qFQq3Lhx4y+HDx8Ov/HGG50//elPy5577rmC559/PnvJkiXzISuVZ599NvPZZ59dloalc/DSCy+88D8UCsW/W5CgjRs3/seXXnrps9raWu+1a9f4a9eu8Q0NDXx9fT1/5MgRfvPmzd7y8vJke3v7XwmCAMuy8PI8PCwLN02DpChYHU6YrHYYrXZYbA44nE5QLhcYhgHn8YDnOFAUBbVajbq6um/ef//9wIcffshdunTJc+3aNe7q1avctWvXZtDQ0OARuX79uuf69eue1HOp5+fixo0bnhMnTpgbGhoKF9yCiouLz/M8j5GREYyOjsLn8+HGjRs4c+YMWlpaYLPZwHMcPCwLu5OE0mhBm9KAqz1q1HWqcKlThfMdKpx7qMLFDhVqOlX4Uq5C84AOfToTjIQVbrcbnMcDhmGgVCpRV1eH6upq6PV66feOjIzMyujo6JyMjY3NyqNHj6B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uHz5cn92dvbhl156KbRixQqsW7cOr7766hRRxcXFyM/PtzQ2NubOW85sglJnK/EPEQThieQ8bvqfjxzxGz2iIHFbXXNzs2nPnj3LADzzq1/96t2f//znkqRf/vKXePXVV7Fy5Urk5eWZFywnnaDp2XiqoPlk43PJmU9cNJsc8bnL5YLf70d7ezv1hz/8YaX4WQAs2bBhw5YXX3zRl52djfz8fKxYsQK5ubmmRclJFcTzvFQIm08XW2zG/rgAcraxZzo0TUMul/Offvrpa9P/XyAAS44cOVJaXFx8tbi4uKukpORsY2PjPy9KzuQb/l1BQcHh7u7uvyiVyvGhoaHxwcFBiYGBgXGtVjuu0WjG+/v7Jfr6+sb7+vrGe3t7x3t7e8d7enokuru7x7u7u8flcvm4XC4f7+rqGu/q6hrv7Owc7+zsHO/o6Bjv6OgYf/jwocSDBw/GHzx4MC6TycZlMtl4e3t7WmQy2V+uX78eOHjw4L8A+NFsn4vjuOc5jvtPAH68aDnisXHjxp++995769Kxfft2idnueVps3bp1TjZv3ry+rKwsB8CzT/zB/3b87Xgqx/8D2eEtvSevT9MAAAAASUVORK5CYII=)}.edit_frm .invoice_layout .btn.sdoc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAfGUlEQVR4nO2bZ1Dcd5qgtTOeWfuuLs59mLoPV3W7V3VTV7d1O+u1JCQroICCZdleW/Z4LM3KPluSlaNHcpQsFCwhBAooECQBAkQQUdCIDA10Aw3ddM450xHweJi5fe4DdA8gULTn7sP8q55quvtPQz+87/t73x//njPnL8dfjv+vDuBHSqXy5yqV6n9qtdqXzp8/v/Szzz7b8MUXX2w8duzYGrFYnKDX638pl8v/1m63v/D/+vd9pqO4uPjHW7Zs+cnRo0efm43i4uIfHzx48F8fPnz4b86cOfPmnj17Mvbv39994sQJ54ULF6JZWVm/Lyws/ENJSckf8/Lyxq5du/btmTNnhj7//HPNrl27ylJSUg58/fXXL+7YseNnxcXFPz569OiPiouLf/w4HD169EePA/B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X4LkNGzZsefHFF10LFiwgMTGRxYsXs2TJEtlTyZksyOFwxDfCHifFnnZif1gDOVvtmY7ZbKa5udnx5Zdfvjn9YwXAcydOnFiTlJR0OykpqWnVqlUXi4uL//6p5Ey84F8tW7YsuaWl5Q8ikWisu7t7rKurK05nZ+dYX1/fWG9v71hHR0ec9vb2sfb29rG2traxtra2sdbW1jgtLS1jLS0tY83NzWPNzc1jTU1NY01NTWONjY1jjY2NYw0NDWMNDQ1j9+/fj1NfXz9WX18/JhAIxgQCwVhdXd2MCASCPxQVFXm+/vrr3wA/mu192e32F+x2+38EfvrUcmLH5s2bf7F9+/ZXZ2LXrl1xZjvn+2Lr1q2P5KOPPlp/5MiRhcBPnvmN/+X4y/G9HP8XQHLbNqTL5PYAAAAASUVORK5CYII=)}.edit_frm .invoice_layout.freeze::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(50,50,50,.3);user-select:none;cursor:wait;z-index:10;pointer-events:none}.edit_frm .invoice_layout.freeze::before tr:hover>td.aux>.axf{display:inline-flex}.edit_frm .invoice_layout.freeze::after{content:"";position:absolute;top:50%;left:50%;width:3rem;height:3rem;margin:-1.5rem 0 0 -1.5rem;border:.4rem solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;z-index:11;pointer-events:none;animation:.8s linear infinite fis_spin}.edit_frm .invoice_layout .dvalidation{margin:0 0 1rem}.edit_frm .invoice_layout .dvalidation.hidden{display:none}.edit_frm .invoice_layout .dvalidation .dvmsg{padding:.4rem .7rem;margin:.25rem 0;border-radius:.2rem;font-size:.9rem;border-left:4px solid #999;background:#f5f5f5}.edit_frm .invoice_layout .dvalidation .dvmsg.error{border-left-color:#c0392b;background:#fdecea;color:#922}.edit_frm .invoice_layout .dvalidation .dvmsg.warning{border-left-color:#e0a800;background:#fff8e1;color:#7a5c00}.edit_frm .invoice_layout .dvalidation .dvmsg.info{border-left-color:#3498db;background:#eaf4fb;color:#1c5a82}.dhist .invtbl{width:100%}.dhist td,.dhist th{padding:.3rem .6rem;text-align:left;vertical-align:top}.dhist tbody tr:nth-child(even){background:#fafafa}.modal-body .lstfrm{display:block;position:relative}.modal-body .lstfrm .li{display:inline-block;background-color:#fff;border:1px solid #e0e0e0;padding:1.7rem .5rem .5rem;border-radius:.2rem;cursor:pointer;position:relative;margin:0 .5rem .5rem 0;box-shadow:1px 1px 3px rgba(50,50,50,.1)}.modal-body .lstfrm .li .lbl{position:absolute;background:#727272;color:#fff;font-size:.8rem;left:0;top:0;right:0;padding:.2rem;border-top-left-radius:inherit;border-top-right-radius:inherit} \ No newline at end of file +.invfrm>table td.sh_s,table.invtbl td.sh_s{color:#bf4b06}.invfrm>table td.is_cc,table.invtbl td.is_cc{background-color:#777!important;color:#fff!important}.invfrm>table td.is_pyd,table.invtbl td.is_pyd{color:#60cc08}.invfrm>table td.is_due,table.invtbl td.is_due{background-color:#f2f23f!important}.invfrm>table td.is_ovd,table.invtbl td.is_ovd{background-color:#de4e09!important}.invfrm>table td.is_rem,table.invtbl td.is_rem{background-color:#ce1900!important}.invfrm>table td.av,table.invtbl td.av{border:2px solid red}.invfrm>table td.av+td.vsel select,table.invtbl td.av+td.vsel select{display:block}.rfrm{min-width:200px;min-height:200px}table.if{border-collapse:collapse;margin:1rem 0;background:#fff}table.if tr:nth-child(2n+1) td{background-color:#f9f9f9}table.if tr.title td{background-color:#56a532;color:#fff}table.if tr.title td .eid{font-weight:700;margin:0 1rem 0 .5rem;font-size:140%}table.if tr.title td .nme{font-size:110%}table.if tr.shd td{font-style:italic;color:#bbb;background-color:#fff!important;font-size:90%}table.if td,table.if th{padding:.2rem .35rem;border:1px solid #ddd}table.if td.currency{text-align:right;white-space:nowrap}table.if td.num{white-space:nowrap}.pdfpreview .pdfp.ph>.note{background:#fff;display:inline-block;padding:3rem;margin:.2rem 0}@keyframes fis_spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}.edit_frm .invoice_layout{margin:2rem 2rem 2rem auto;width:50rem;border:1px solid #eee;padding:25.5rem 3rem 3rem;box-shadow:4px 4px 9px rgba(50,50,50,.3);position:relative}.edit_frm .invoice_layout .axf{font-size:1rem;display:none;position:absolute;right:100%;height:100%;min-height:1.5rem;min-width:2rem;background:#f0ffe2;border:1px solid #ccc;border-top-left-radius:.2rem;border-bottom-left-radius:.2rem;top:0;width:auto;max-height:1.5rem;overflow:hidden;padding:.1rem}.edit_frm .invoice_layout .axf>.ibtn{cursor:pointer;height:100%;width:1.5rem;display:inline-block;position:relative}.edit_frm .invoice_layout .sndfrm{position:absolute;font-size:.7rem;color:#727272;top:4.7rem;left:3rem;width:auto;height:auto;user-select:none}.edit_frm .invoice_layout .emailfrm{position:absolute;font-size:.7rem;top:.5rem;left:.5rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .emailfrm .content{color:#000}.edit_frm .invoice_layout .emailfrm .content:empty::before{content:"-";min-width:5rem;height:1rem;display:block;position:absolute}.edit_frm .invoice_layout .emailfrm:hover div.axf{display:block}.edit_frm .invoice_layout .admfrm{position:absolute;right:3rem;top:9rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .admfrm .ahd{display:block;color:#727272;margin:0 0 .2rem}.edit_frm .invoice_layout .admfrm .content{color:#000}.edit_frm .invoice_layout .admfrm .content:empty::before{content:"-";min-width:5rem;height:1rem;display:block;position:absolute}.edit_frm .invoice_layout .admfrm:hover div.axf{display:block}.edit_frm .invoice_layout .ctpfrm{position:absolute;right:3rem;top:14rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .ctpfrm .ahd{display:block;color:#727272;margin:0 0 .2rem}.edit_frm .invoice_layout .ctpfrm .content{color:#000}.edit_frm .invoice_layout .ctpfrm .content:empty::before{content:"-";min-width:5rem;height:1rem;display:block;position:absolute}.edit_frm .invoice_layout .ctpfrm:hover div.axf{display:block}.edit_frm .invoice_layout .adrfrm{position:absolute;left:3rem;top:6rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .adrfrm:hover div.axf{display:block}.edit_frm .invoice_layout .locfrm{position:absolute;left:3rem;top:18.5rem;width:auto;height:auto;cursor:pointer}.edit_frm .invoice_layout .locfrm .ahd{display:block;color:#727272;margin:0 0 .2rem}.edit_frm .invoice_layout .locfrm .content:empty::before{content:"-";min-width:5rem;height:1rem;display:block;position:absolute}.edit_frm .invoice_layout .locfrm:hover div.axf{display:block}.edit_frm .invoice_layout .tfrm,.edit_frm .invoice_layout>div.title{position:absolute;left:3rem;top:15rem;font-size:2rem;cursor:pointer}.edit_frm .invoice_layout .tfrm:hover div.axf,.edit_frm .invoice_layout>div.title:hover div.axf{display:block}.edit_frm .invoice_layout div.fnote{margin:1rem 0}.edit_frm .invoice_layout p+table.invi,.edit_frm .invoice_layout table.invi+p{margin-top:2.5rem}.edit_frm .invoice_layout table.invi{border-collapse:separate;border-spacing:0;border-color:#fff;width:100%;max-width:100%}.edit_frm .invoice_layout table.invi>tbody>tr.hidden{display:none}.edit_frm .invoice_layout table.invi>tbody>tr:nth-child(2n+1) td{background-color:#fbfbfb;border-color:#fbfbfb}.edit_frm .invoice_layout table.invi>tbody>tr.title>td{background:#fff;border-color:#fff;border-top:1.5px solid #000}.edit_frm .invoice_layout table.invi>tbody>tr.sethdr td.txt{font-weight:700}.edit_frm .invoice_layout table.invi td.currency,.edit_frm .invoice_layout table.invi td.num,.edit_frm .invoice_layout table.invi th.currency,.edit_frm .invoice_layout table.invi th.num{text-align:right;white-space:nowrap}.edit_frm .invoice_layout table.invi td.keep,.edit_frm .invoice_layout table.invi th.keep{white-space:nowrap}.edit_frm .invoice_layout table.invi table.stbl td,.edit_frm .invoice_layout table.invi table.stbl th{padding:.3rem .5rem}.edit_frm .invoice_layout table.invi table.stbl td:first-child,.edit_frm .invoice_layout table.invi table.stbl th:first-child{padding-left:0}.edit_frm .invoice_layout table.invi table.stbl td:last-child,.edit_frm .invoice_layout table.invi table.stbl th:last-child{padding-right:0}.edit_frm .invoice_layout table.invi>tbody>tr>td,.edit_frm .invoice_layout table.invi>tbody>tr>th,.edit_frm .invoice_layout table.invi>tfoot>tr>td,.edit_frm .invoice_layout table.invi>tfoot>tr>th,.edit_frm .invoice_layout table.invi>thead>tr>td,.edit_frm .invoice_layout table.invi>thead>tr>th,.edit_frm .invoice_layout table.invi>tr>td,.edit_frm .invoice_layout table.invi>tr>th{border-width:1px;padding:.3rem .5rem;border-left:none!important;border-right:none!important}.edit_frm .invoice_layout table.invi>tbody>tr>td.aux,.edit_frm .invoice_layout table.invi>tbody>tr>th.aux,.edit_frm .invoice_layout table.invi>tfoot>tr>td.aux,.edit_frm .invoice_layout table.invi>tfoot>tr>th.aux,.edit_frm .invoice_layout table.invi>thead>tr>td.aux,.edit_frm .invoice_layout table.invi>thead>tr>th.aux,.edit_frm .invoice_layout table.invi>tr>td.aux,.edit_frm .invoice_layout table.invi>tr>th.aux{width:0;max-width:0;min-width:0;position:relative;padding:0}.edit_frm .invoice_layout table.invi>tbody>tr>th,.edit_frm .invoice_layout table.invi>tfoot>tr>th,.edit_frm .invoice_layout table.invi>thead>tr>th,.edit_frm .invoice_layout table.invi>tr>th{text-align:left;font-weight:300;background-color:#fff;border-color:#fff;font-size:.8rem;font-style:italic;border-top-style:none;border-bottom-style:none}.edit_frm .invoice_layout table.invi>tbody>tr>td,.edit_frm .invoice_layout table.invi>tfoot>tr>td,.edit_frm .invoice_layout table.invi>thead>tr>td,.edit_frm .invoice_layout table.invi>tr>td{vertical-align:top;font-weight:400;background-color:#f8f8f8;border-color:#f8f8f8;border-top-style:solid;border-bottom-style:solid;user-select:none}.edit_frm .invoice_layout table.invi>tbody>tr:hover>td.aux>.axf,.edit_frm .invoice_layout table.invi>tfoot>tr:hover>td.aux>.axf,.edit_frm .invoice_layout table.invi>thead>tr:hover>td.aux>.axf,.edit_frm .invoice_layout table.invi>tr:hover>td.aux>.axf{display:inline-flex}.edit_frm .invoice_layout table.invi>tbody>tr.isum>td,.edit_frm .invoice_layout table.invi>tfoot>tr.isum>td,.edit_frm .invoice_layout table.invi>thead>tr.isum>td,.edit_frm .invoice_layout table.invi>tr.isum>td{border-top:1px solid #000;background:#fff}.edit_frm .invoice_layout table.invi>tbody>tr.sep>td,.edit_frm .invoice_layout table.invi>tfoot>tr.sep>td,.edit_frm .invoice_layout table.invi>thead>tr.sep>td,.edit_frm .invoice_layout table.invi>tr.sep>td{background:#fff}.edit_frm .invoice_layout table.invi>tbody>tr.tsum td,.edit_frm .invoice_layout table.invi>tfoot>tr.tsum td,.edit_frm .invoice_layout table.invi>thead>tr.tsum td,.edit_frm .invoice_layout table.invi>tr.tsum td{font-weight:600;border-top:1px solid #000;border-bottom:1px solid #000}.edit_frm .invoice_layout table.invi .sortable>tr>td.aux .ico.move{background:url(data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAzMiAzMiIgaWQ9IkxheWVyXzQiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48Zz48cG9seWdvbiBmaWxsPSJub25lIiBwb2ludHM9IjE2LDMxIDgsMTggMjQsMTggICAgICIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iI0RERERERCIvPjxwb2x5Z29uIGZpbGw9Im5vbmUiIHBvaW50cz0iMTYsMSA4LDE0IDI0LDE0ICAgICAiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2U9IiNEREREREQiLz48L2c+PC9zdmc+) center center/contain no-repeat border-box}.edit_frm .invoice_layout table.invi .sortable>tr>td.aux .ico.move:hover{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIGlkPSJMYXllcl80IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGc+PHBvbHlnb24gZmlsbD0ibm9uZSIgcG9pbnRzPSIxNiwzMSA4LDE4IDI0LDE4ICAgICAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2Utd2lkdGg9IjIiLz48cG9seWdvbiBmaWxsPSJub25lIiBwb2ludHM9IjE2LDEgOCwxNCAyNCwxNCAgICAgIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9nPjwvc3ZnPg==)}.edit_frm .invoice_layout table.invi .sortable>tr.sortactive>td.ico{cursor:move}.edit_frm .invoice_layout .btn{background:url("") center center/contain no-repeat content-box #fff;position:absolute;top:.2rem;right:.2rem;height:3rem;width:3rem;padding:.1rem;z-index:11}.edit_frm .invoice_layout .btn.sprev{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAaz0lEQVR4nO2caVAbd97neSbObPJs7VE7z4vU82Krdp+t2qmt3apnNhObIzanwfjKZBJPJpXJU45rbGcSH4mvCZM4g08yPjC2s/gCJjG2sfEB2BhkA+ISoPtAal3dUnerW/fRkgAnYbLz3RfQHQHCHHby7Ivpqk9JdLcE+vh//H6//1/OyPjb8bfj/6sDwI8IgnjBarX+T4fD8dKpU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oaHxwcFBiYGBgXGtVjuu0WjG+/v7Jfr6+sb7+vrGe3t7x3t7e8d7enokuru7x7u7u8flcvm4XC4f7+rqGu/q6hrv7Owc7+zsHO/o6Bjv6OgYf/jwocSDBw/GHzx4MC6TycZlMtl4e3t7WmQy2V+uX78eOHjw4L8A+NFsn4vjuOc5jvtPAH68aDnisXHjxp++995769Kxfft2idnueVps3bp1TjZv3ry+rKwsB8CzT/zB/3b87Xgqx/8D2eEtvSevT9MAAAAASUVORK5CYII=)}.edit_frm .invoice_layout .btn.sdoc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAfGUlEQVR4nO2bZ1Dcd5qgtTOeWfuuLs59mLoPV3W7V3VTV7d1O+u1JCQroICCZdleW/Z4LM3KPluSlaNHcpQsFCwhBAooECQBAkQQUdCIDA10Aw3ddM450xHweJi5fe4DdA8gULTn7sP8q55quvtPQz+87/t73x//njPnL8dfjv+vDuBHSqXy5yqV6n9qtdqXzp8/v/Szzz7b8MUXX2w8duzYGrFYnKDX638pl8v/1m63v/D/+vd9pqO4uPjHW7Zs+cnRo0efm43i4uIfHzx48F8fPnz4b86cOfPmnj17Mvbv39994sQJ54ULF6JZWVm/Lyws/ENJSckf8/Lyxq5du/btmTNnhj7//HPNrl27ylJSUg58/fXXL+7YseNnxcXFPz569OiPiouLf/w4HD169EePA/BXj+KpBG3YsOHfzZkz5x+ef/75ZZNYGuO5555b+rOf/ew3K1asyN29e7fhypUrowKB4F8GBwfR6/WYzWasVit2ux2nw4HdbsdisWAwGNBoNIjFYu7cufOH5ORk/zvvvNP4i1/84sjzzz+/7IUXXljw3HPPPQ4JMV544YWEF154Yf5PfvKTeTMw9xG89POf//x/CIXCf/NEgjZv3vzvX3rppdPZ2dnOgoICR0FBgaOwsNCRl5fnOHHihOOjjz5yHj16NFpXV/cvSqUSq9WK0+HAZrViMpvRGwyotDpkKg1SlQaFWotWp8NgNGKxWLDbbDjsdgwGAz09PeTk5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LH5s2bf7F9+/ZXZ2LXrl1xZjvn+2Lr1q2P5KOPPlp/5MiRhcBPnvmN/+X4y/G9HP8XQHLbNqTL5PYAAAAASUVORK5CYII=)}.edit_frm .invoice_layout.freeze::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(50,50,50,.3);user-select:none;cursor:wait;z-index:10;pointer-events:none}.edit_frm .invoice_layout.freeze::before tr:hover>td.aux>.axf{display:inline-flex}.edit_frm .invoice_layout.freeze::after{content:"";position:absolute;top:50%;left:50%;width:3rem;height:3rem;margin:-1.5rem 0 0 -1.5rem;border:.4rem solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;z-index:11;pointer-events:none;animation:.8s linear infinite fis_spin}.edit_frm .invoice_layout .dvalidation{margin:0 0 1rem}.edit_frm .invoice_layout .dvalidation.hidden{display:none}.edit_frm .invoice_layout .dvalidation .dvmsg{padding:.4rem .7rem;margin:.25rem 0;border-radius:.2rem;font-size:.9rem;border-left:4px solid #999;background:#f5f5f5}.edit_frm .invoice_layout .dvalidation .dvmsg.error{border-left-color:#c0392b;background:#fdecea;color:#922}.edit_frm .invoice_layout .dvalidation .dvmsg.warning{border-left-color:#e0a800;background:#fff8e1;color:#7a5c00}.edit_frm .invoice_layout .dvalidation .dvmsg.info{border-left-color:#3498db;background:#eaf4fb;color:#1c5a82}.dhist .invtbl{width:100%}.dhist td,.dhist th{padding:.3rem .6rem;text-align:left;vertical-align:top}.dhist tbody tr:nth-child(even){background:#fafafa}.modal-body .lstfrm{display:block;position:relative}.modal-body .lstfrm .li{display:inline-block;background-color:#fff;border:1px solid #e0e0e0;padding:1.7rem .5rem .5rem;border-radius:.2rem;cursor:pointer;position:relative;margin:0 .5rem .5rem 0;box-shadow:1px 1px 3px rgba(50,50,50,.1)}.modal-body .lstfrm .li .lbl{position:absolute;background:#727272;color:#fff;font-size:.8rem;left:0;top:0;right:0;padding:.2rem;border-top-left-radius:inherit;border-top-right-radius:inherit} \ No newline at end of file diff --git a/Fuchs/wwwroot/web/fis.js b/Fuchs/wwwroot/web/fis.js index 8654a22..771051e 100644 --- a/Fuchs/wwwroot/web/fis.js +++ b/Fuchs/wwwroot/web/fis.js @@ -897,16 +897,16 @@ $ocms.vbl_send = function (ev) { } else { val = null; } - } else if (type === 'number' && typedvalues === true ) { - let v; + } else if ((type === 'number' || dtf[0] === 'float' || dtf[0] === 'integer') && typedvalues === true) { + let v, raw = String(val).replace(',', '.'); if (dtf[0] === 'integer') { - v = parseInt(val); + v = parseInt(raw); } else { - v = parseFloat(val); + v = parseFloat(raw); } val = isNaN(v) ? val : v; } - if (req === true && ((val || '') === '' || (val.match(pattern) === null))) { + if (req === true && ((val === '' || val === null || typeof val === 'undefined') || (typeof val === 'string' && val.match(pattern) === null))) { if (cat === false && bool(checkvalidity, false) === true) { e.setCustomValidity(t.nza('ocms-nvnote', $ocms.t.inv || 'Invalid field')); } val = null; } else if (cat=== false && bool(checkvalidity, false) === true) { @@ -2220,6 +2220,8 @@ class NumArray extends Array { break; case 'number': f.pattern = ne(f.pattern, '[-+]?[0-9]*[.,]?[0-9]*'); + inp.attr('type', 'text'); + inp.attr('inputmode', 'decimal'); inp.attr('step', f.precision || 'any'); inp.attr('data-format', 'float'); break; diff --git a/Fuchs/wwwroot/web/fis.min.js b/Fuchs/wwwroot/web/fis.min.js index 9b88169..bdb74a6 100644 --- a/Fuchs/wwwroot/web/fis.min.js +++ b/Fuchs/wwwroot/web/fis.min.js @@ -1,4 +1,4 @@ var t,e,$t={lng:"de-DE",dn:["So","Mo","Di","Mi","Do","Fr","Sa"],mn:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],ma:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],datepattern:"(0[1-9]|1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}",datetimepattern:"(0[1-9]|1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}\\s([0-5][0-9]):([0-5][0-9])",dateplaceholder:"dd.MM.yyyy",datetimeplaceholder:"dd.MM.yyyy HH:mm",dateformat:"dd.MM.yyyy",datetimeformat:"dd.MM.yyyy HH:mm",f1:"Der Server hat einen Fehler gemeldet: \n",f2:"Bitte versuchen Sie es erneut.",m0:"Diese Internet-Seite benötigt einen html5-kompatiblen Browser.",m0b:"Unterstützt werden bspw: Internet Explorer ab Version 10, Firefox ab Version 31, Chrome ab Version 31, Safari ab Version 7, Opera ab Version 27",m1:"Dieser Datensatz ist momentan von jemand anderem zur Bearbeitung gesperrt.",m2:"Diese Funktion ist zur Zeit nicht verfügbar",t1:"Eingabe erforderlich.",t2:"Eingabe ist nicht erforderlich.",true:"Ja",false:"Nein",alert:"Hinweis",confirm:"Bestätigen",open:"Öffnen","not implemented":"Diese Funktion in zur Zeit noch nicht verfügbar.",l0:"Anmeldung",l1:"Email / Anmeldename",l2:"Email-Adresse / Anmeldename",l3:"Passwort",l4:"Benutzer",l5:"Wird vom System ermittelt...",l6:"Anmelden",l7:"Passwort vergessen?",l7a:'Die "Passwort vergessen"-Funktion läuft in zwei Schritten ab:\n \nIm ersten Schritt wird eine SMS mit einem Code an die hinterlegte Mobilfunk-Nummer versandt.\nIm zweiten Schritt geben Sie bitte diesen Code in das Formular ein und übermitteln es erneut.\n \nIn beiden Schritten wird aus Sicherheitsgründen kein Fehler angezeigt und auch dann ein erfolgreicher Versand bestätigt, wenn die Kombination aus Email-Adresse und Nachname nicht gefunden wurde und/oder der code falsch ist.',l8:"Keinen Account?",l9:"Anmeldenamen der Email-Adresse wurde nicht erkannt.",l10:"Nachname",l11:"Email-Adresse",l12:"Passwort zusenden",l13:"Das Passwort wurde erfolgreich verschickt",l14:"Das Passwort konnte nicht verschickt werden",l15:"Sie sind nicht berechtigt, diese Funktion auszuführen.",l16:"Sie müssen zunächst einen Account angeben.",l17:"Die Kombination aus Anmeldenamen und Passwort konnte nicht bestätigt werden.",l18:"Es gibt ein Problem mit dem Formular.\nEs kann momentan nicht verarbeitet und versendet werden.",name:"Name",submit:"Senden",cancel:"Abbrechen",noop:"Diese Funktion is noch nicht verfügar."};t=self,e=()=>(()=>{var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"t",{value:!0})};var e,n={};t.r(n),t.d(n,{AbortError:()=>r,DefaultHttpClient:()=>D,HttpClient:()=>h,HttpError:()=>i,HttpResponse:()=>d,HttpTransportType:()=>U,HubConnection:()=>O,HubConnectionBuilder:()=>tt,HubConnectionState:()=>j,JsonHubProtocol:()=>K,LogLevel:()=>e,MessageType:()=>N,NullLogger:()=>p,Subject:()=>q,TimeoutError:()=>o,TransferFormat:()=>B,VERSION:()=>f});class i extends Error{constructor(t,e){const n=new.target.prototype;super(`${t}: Status code '${e}'`),this.statusCode=e,this.__proto__=n}}class o extends Error{constructor(t="A timeout occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class r extends Error{constructor(t="An abort occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class s extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="UnsupportedTransportError",this.__proto__=n}}class a extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="DisabledTransportError",this.__proto__=n}}class c extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="FailedToStartTransportError",this.__proto__=n}}class l extends Error{constructor(t){const e=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=e}}class u extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.innerErrors=e,this.__proto__=n}}class d{constructor(t,e,n){this.statusCode=t,this.statusText=e,this.content=n}}class h{get(t,e){return this.send({...e,method:"GET",url:t})}post(t,e){return this.send({...e,method:"POST",url:t})}delete(t,e){return this.send({...e,method:"DELETE",url:t})}getCookieString(t){return""}}!function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"}(e||(e={}));class p{constructor(){}log(t,e){}}p.instance=new p;const f="10.0.0";class m{static isRequired(t,e){if(null==t)throw new Error(`The '${e}' argument is required.`)}static isNotEmpty(t,e){if(!t||t.match(/^\s*$/))throw new Error(`The '${e}' argument should not be empty.`)}static isIn(t,e,n){if(!(t in e))throw new Error(`Unknown ${n} value: ${t}.`)}}class g{static get isBrowser(){return!g.isNode&&"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return!g.isNode&&"object"==typeof self&&"importScripts"in self}static get isReactNative(){return!g.isNode&&"object"==typeof window&&void 0===window.document}static get isNode(){return"undefined"!=typeof process&&process.release&&"node"===process.release.name}}function y(t,e){let n="";return v(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${function(t){const e=new Uint8Array(t);let n="";return e.forEach((t=>{n+=`0x${t<16?"0":""}${t.toString(16)} `})),n.substring(0,n.length-1)}(t)}'`)):"string"==typeof t&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function v(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}async function b(t,n,i,o,r,s){const a={},[c,l]=C();a[c]=l,t.log(e.Trace,`(${n} transport) sending data. ${y(r,s.logMessageContent)}.`);const u=v(r)?"arraybuffer":"text",d=await i.post(o,{content:r,headers:{...a,...s.headers},responseType:u,timeout:s.timeout,withCredentials:s.withCredentials});t.log(e.Trace,`(${n} transport) request complete. Response status: ${d.statusCode}.`)}class ${constructor(t,e){this.i=t,this.h=e}dispose(){const t=this.i.observers.indexOf(this.h);t>-1&&this.i.observers.splice(t,1),0===this.i.observers.length&&this.i.cancelCallback&&this.i.cancelCallback().catch((t=>{}))}}class w{constructor(t){this.l=t,this.out=console}log(t,n){if(t>=this.l){const i=`[${(new Date).toISOString()}] ${e[t]}: ${n}`;switch(t){case e.Critical:case e.Error:this.out.error(i);break;case e.Warning:this.out.warn(i);break;case e.Information:this.out.info(i);break;default:this.out.log(i)}}}}function C(){let t="X-SignalR-User-Agent";return g.isNode&&(t="User-Agent"),[t,S(f,x(),g.isNode?"NodeJS":"Browser",_())]}function S(t,e,n,i){let o="Microsoft SignalR/";const r=t.split(".");return o+=`${r[0]}.${r[1]}`,o+=` (${t}; `,o+=e&&""!==e?`${e}; `:"Unknown OS; ",o+=`${n}`,o+=i?`; ${i}`:"; Unknown Runtime Version",o+=")",o}function x(){if(!g.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function _(){if(g.isNode)return process.versions.node}function T(t){return t.stack?t.stack:t.message?t.message:`${t}`}class E extends h{constructor(e){if(super(),this.u=e,"undefined"==typeof fetch||g.isNode){const t=require;this.p=new(t("tough-cookie").CookieJar),"undefined"==typeof fetch?this.m=t("node-fetch"):this.m=fetch,this.m=t("fetch-cookie")(this.m,this.p)}else this.m=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t.g)return t.g;throw new Error("could not find global")}());if("undefined"==typeof AbortController){const t=require;this.v=t("abort-controller")}else this.v=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new r;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const n=new this.v;let s;t.abortSignal&&(t.abortSignal.onabort=()=>{n.abort(),s=new r});let a,c=null;if(t.timeout){const i=t.timeout;c=setTimeout((()=>{n.abort(),this.u.log(e.Warning,"Timeout from HTTP request."),s=new o}),i)}""===t.content&&(t.content=void 0),t.content&&(t.headers=t.headers||{},v(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{a=await this.m(t.url,{body:t.content,cache:"no-cache",credentials:!0===t.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(t){if(s)throw s;throw this.u.log(e.Warning,`Error from HTTP request. ${t}.`),t}finally{c&&clearTimeout(c),t.abortSignal&&(t.abortSignal.onabort=null)}if(!a.ok){const t=await k(a,"text");throw new i(t||a.statusText,a.status)}const l=k(a,t.responseType),u=await l;return new d(a.status,a.statusText,u)}getCookieString(t){let e="";return g.isNode&&this.p&&this.p.getCookies(t,((t,n)=>e=n.join("; "))),e}}function k(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class I extends h{constructor(t){super(),this.u=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new r):t.method?t.url?new Promise(((n,s)=>{const a=new XMLHttpRequest;a.open(t.method,t.url,!0),a.withCredentials=void 0===t.withCredentials||t.withCredentials,a.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===t.content&&(t.content=void 0),t.content&&(v(t.content)?a.setRequestHeader("Content-Type","application/octet-stream"):a.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const c=t.headers;c&&Object.keys(c).forEach((t=>{a.setRequestHeader(t,c[t])})),t.responseType&&(a.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{a.abort(),s(new r)}),t.timeout&&(a.timeout=t.timeout),a.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),a.status>=200&&a.status<300?n(new d(a.status,a.statusText,a.response||a.responseText)):s(new i(a.response||a.responseText||a.statusText,a.status))},a.onerror=()=>{this.u.log(e.Warning,`Error from HTTP request. ${a.status}: ${a.statusText}.`),s(new i(a.statusText,a.status))},a.ontimeout=()=>{this.u.log(e.Warning,"Timeout from HTTP request."),s(new o)},a.send(t.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class D extends h{constructor(t){if(super(),"undefined"!=typeof fetch||g.isNode)this.$=new E(t);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this.$=new I(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new r):t.method?t.url?this.$.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this.$.getCookieString(t)}}class A{static write(t){return`${t}${A.RecordSeparator}`}static parse(t){if(t[t.length-1]!==A.RecordSeparator)throw new Error("Message is incomplete.");const e=t.split(A.RecordSeparator);return e.pop(),e}}A.RecordSeparatorCode=30,A.RecordSeparator=String.fromCharCode(A.RecordSeparatorCode);class P{writeHandshakeRequest(t){return A.write(JSON.stringify(t))}parseHandshakeResponse(t){let e,n;if(v(t)){const i=new Uint8Array(t),o=i.indexOf(A.RecordSeparatorCode);if(-1===o)throw new Error("Message is incomplete.");const r=o+1;e=String.fromCharCode.apply(null,Array.prototype.slice.call(i.slice(0,r))),n=i.byteLength>r?i.slice(r).buffer:null}else{const i=t,o=i.indexOf(A.RecordSeparator);if(-1===o)throw new Error("Message is incomplete.");const r=o+1;e=i.substring(0,r),n=i.length>r?i.substring(r):null}const i=A.parse(e),o=JSON.parse(i[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[n,o]}}var N,j;!function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"}(N||(N={}));class q{constructor(){this.observers=[]}next(t){for(const e of this.observers)e.next(t)}error(t){for(const e of this.observers)e.error&&e.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new $(this,t)}}class M{constructor(t,e,n){this.C=1e5,this.S=[],this.k=0,this.P=!1,this.T=1,this.I=0,this._=0,this.H=!1,this.D=t,this.R=e,this.C=n}async A(t){const e=this.D.writeMessage(t);let n=Promise.resolve();if(this.U(t)){this.k++;let t=()=>{},i=()=>{};v(e)?this._+=e.byteLength:this._+=e.length,this._>=this.C&&(n=new Promise(((e,n)=>{t=e,i=n}))),this.S.push(new R(e,this.k,t,i))}try{this.H||await this.R.send(e)}catch{this.L()}await n}N(t){let e=-1;for(let n=0;nthis.T?this.R.stop(new Error("Sequence ID greater than amount of messages we've received.")):this.T=t.sequenceId}L(){this.H=!0,this.P=!0}async B(){const t=0!==this.S.length?this.S[0].q:this.k+1;await this.R.send(this.D.writeMessage({type:N.Sequence,sequenceId:t}));const e=this.S;for(const t of e)await this.R.send(t.M);this.H=!1}X(t){null!=t||(t=new Error("Unable to reconnect to server."));for(const e of this.S)e.J(t)}U(t){switch(t.type){case N.Invocation:case N.StreamItem:case N.Completion:case N.StreamInvocation:case N.CancelInvocation:return!0;case N.Close:case N.Sequence:case N.Ping:case N.Ack:return!1}}O(){void 0===this.V&&(this.V=setTimeout((async()=>{try{this.H||await this.R.send(this.D.writeMessage({type:N.Ack,sequenceId:this.I}))}catch{}clearTimeout(this.V),this.V=void 0}),1e3))}}class R{constructor(t,e,n,i){this.M=t,this.q=e,this.j=n,this.J=i}}!function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"}(j||(j={}));class O{static create(t,e,n,i,o,r,s){return new O(t,e,n,i,o,r,s)}constructor(t,n,i,o,r,s,a){this.K=0,this.G=()=>{this.u.log(e.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},m.isRequired(t,"connection"),m.isRequired(n,"logger"),m.isRequired(i,"protocol"),this.serverTimeoutInMilliseconds=null!=r?r:3e4,this.keepAliveIntervalInMilliseconds=null!=s?s:15e3,this.Y=null!=a?a:1e5,this.u=n,this.D=i,this.connection=t,this.Z=o,this.tt=new P,this.connection.onreceive=t=>this.et(t),this.connection.onclose=t=>this.st(t),this.it={},this.nt={},this.rt=[],this.ot=[],this.ht=[],this.ct=0,this.lt=!1,this.ut=j.Disconnected,this.dt=!1,this.ft=this.D.writeMessage({type:N.Ping})}get state(){return this.ut}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this.ut!==j.Disconnected&&this.ut!==j.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this.wt=this.gt(),this.wt}async gt(){if(this.ut!==j.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this.ut=j.Connecting,this.u.log(e.Debug,"Starting HubConnection.");try{await this.yt(),g.isBrowser&&window.document.addEventListener("freeze",this.G),this.ut=j.Connected,this.dt=!0,this.u.log(e.Debug,"HubConnection connected successfully.")}catch(t){return this.ut=j.Disconnected,this.u.log(e.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async yt(){this.vt=void 0,this.lt=!1;const t=new Promise(((t,e)=>{this.bt=t,this.Et=e}));await this.connection.start(this.D.transferFormat);try{let n=this.D.version;this.connection.features.reconnect||(n=1);const i={protocol:this.D.name,version:n};if(this.u.log(e.Debug,"Sending handshake request."),await this.$t(this.tt.writeHandshakeRequest(i)),this.u.log(e.Information,`Using HubProtocol '${this.D.name}'.`),this.Ct(),this.St(),this.kt(),await t,this.vt)throw this.vt;!!this.connection.features.reconnect&&(this.Pt=new M(this.D,this.connection,this.Y),this.connection.features.disconnected=this.Pt.L.bind(this.Pt),this.connection.features.resend=()=>{if(this.Pt)return this.Pt.B()}),this.connection.features.inherentKeepAlive||await this.$t(this.ft)}catch(t){throw this.u.log(e.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this.Ct(),this.Tt(),await this.connection.stop(t),t}}async stop(){const t=this.wt;this.connection.features.reconnect=!1,this.It=this._t(),await this.It;try{await t}catch(t){}}_t(t){if(this.ut===j.Disconnected)return this.u.log(e.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this.ut===j.Disconnecting)return this.u.log(e.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this.It;const n=this.ut;return this.ut=j.Disconnecting,this.u.log(e.Debug,"Stopping HubConnection."),this.Ht?(this.u.log(e.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.Ht),this.Ht=void 0,this.Dt(),Promise.resolve()):(n===j.Connected&&this.Rt(),this.Ct(),this.Tt(),this.vt=t||new r("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async Rt(){try{await this.xt(this.At())}catch{}}stream(t,...e){const[n,i]=this.Ut(e),o=this.Lt(t,e,i);let r;const s=new q;return s.cancelCallback=()=>{const t=this.Nt(o.invocationId);return delete this.it[o.invocationId],r.then((()=>this.xt(t)))},this.it[o.invocationId]=(t,e)=>{e?s.error(e):t&&(t.type===N.Completion?t.error?s.error(new Error(t.error)):s.complete():s.next(t.item))},r=this.xt(o).catch((t=>{s.error(t),delete this.it[o.invocationId]})),this.qt(n,r),s}$t(t){return this.kt(),this.connection.send(t)}xt(t){return this.Pt?this.Pt.A(t):this.$t(this.D.writeMessage(t))}send(t,...e){const[n,i]=this.Ut(e),o=this.xt(this.Mt(t,e,!0,i));return this.qt(n,o),o}invoke(t,...e){const[n,i]=this.Ut(e),o=this.Mt(t,e,!1,i);return new Promise(((t,e)=>{this.it[o.invocationId]=(n,i)=>{i?e(i):n&&(n.type===N.Completion?n.error?e(new Error(n.error)):t(n.result):e(new Error(`Unexpected message type: ${n.type}`)))};const i=this.xt(o).catch((t=>{e(t),delete this.it[o.invocationId]}));this.qt(n,i)}))}on(t,e){t&&e&&(t=t.toLowerCase(),this.nt[t]||(this.nt[t]=[]),-1===this.nt[t].indexOf(e)&&this.nt[t].push(e))}off(t,e){if(!t)return;t=t.toLowerCase();const n=this.nt[t];if(n)if(e){const i=n.indexOf(e);-1!==i&&(n.splice(i,1),0===n.length&&delete this.nt[t])}else delete this.nt[t]}onclose(t){t&&this.rt.push(t)}onreconnecting(t){t&&this.ot.push(t)}onreconnected(t){t&&this.ht.push(t)}et(t){if(this.Ct(),this.lt||(t=this.jt(t),this.lt=!0),t){const n=this.D.parseMessages(t,this.u);for(const i of n)if(!this.Pt||this.Pt.W(i))switch(i.type){case N.Invocation:this.Wt(i).catch((t=>{this.u.log(e.Error,`Invoke client method threw error: ${T(t)}`)}));break;case N.StreamItem:case N.Completion:{const n=this.it[i.invocationId];if(n){i.type===N.Completion&&delete this.it[i.invocationId];try{n(i)}catch(t){this.u.log(e.Error,`Stream callback threw error: ${T(t)}`)}}break}case N.Ping:break;case N.Close:{this.u.log(e.Information,"Close message received from server.");const t=i.error?new Error("Server returned an error on close: "+i.error):void 0;!0===i.allowReconnect?this.connection.stop(t):this.It=this._t(t);break}case N.Ack:this.Pt&&this.Pt.N(i);break;case N.Sequence:this.Pt&&this.Pt.F(i);break;default:this.u.log(e.Warning,`Invalid message type: ${i.type}.`)}}this.St()}jt(t){let n,i;try{[i,n]=this.tt.parseHandshakeResponse(t)}catch(t){const n="Error parsing handshake response: "+t;this.u.log(e.Error,n);const i=new Error(n);throw this.Et(i),i}if(n.error){const t="Server returned handshake error: "+n.error;this.u.log(e.Error,t);const i=new Error(t);throw this.Et(i),i}return this.u.log(e.Debug,"Server handshake complete."),this.bt(),i}kt(){this.connection.features.inherentKeepAlive||(this.K=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this.Tt())}St(){if(!this.connection.features||!this.connection.features.inherentKeepAlive){this.Ot=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds);let t=this.K-(new Date).getTime();if(t<0)return void(this.ut===j.Connected&&this.Ft());void 0===this.Bt&&(t<0&&(t=0),this.Bt=setTimeout((async()=>{this.ut===j.Connected&&await this.Ft()}),t))}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async Wt(t){const n=t.target.toLowerCase(),i=this.nt[n];if(!i)return this.u.log(e.Warning,`No client method with the name '${n}' found.`),void(t.invocationId&&(this.u.log(e.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),await this.xt(this.Xt(t.invocationId,"Client didn't provide a result.",null))));const o=i.slice(),r=!!t.invocationId;let s,a,c;for(const i of o)try{const o=s;s=await i.apply(this,t.arguments),r&&s&&o&&(this.u.log(e.Error,`Multiple results provided for '${n}'. Sending error to server.`),c=this.Xt(t.invocationId,"Client provided multiple results.",null)),a=void 0}catch(t){a=t,this.u.log(e.Error,`A callback for the method '${n}' threw error '${t}'.`)}c?await this.xt(c):r?(a?c=this.Xt(t.invocationId,`${a}`,null):void 0!==s?c=this.Xt(t.invocationId,null,s):(this.u.log(e.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),c=this.Xt(t.invocationId,"Client didn't provide a result.",null)),await this.xt(c)):s&&this.u.log(e.Error,`Result given for '${n}' method but server is not expecting a result.`)}st(t){this.u.log(e.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this.ut}.`),this.vt=this.vt||t||new r("The underlying connection was closed before the hub handshake could complete."),this.bt&&this.bt(),this.Jt(t||new Error("Invocation canceled due to the underlying connection being closed.")),this.Ct(),this.Tt(),this.ut===j.Disconnecting?this.Dt(t):this.ut===j.Connected&&this.Z?this.zt(t):this.ut===j.Connected&&this.Dt(t)}Dt(t){if(this.dt){this.ut=j.Disconnected,this.dt=!1,this.Pt&&(this.Pt.X(null!=t?t:new Error("Connection closed.")),this.Pt=void 0),g.isBrowser&&window.document.removeEventListener("freeze",this.G);try{this.rt.forEach((e=>e.apply(this,[t])))}catch(n){this.u.log(e.Error,`An onclose callback called with error '${t}' threw error '${n}'.`)}}}async zt(t){const n=Date.now();let i=0,o=void 0!==t?t:new Error("Attempting to reconnect due to a unknown error."),r=this.Vt(i,0,o);if(null===r)return this.u.log(e.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this.Dt(t);if(this.ut=j.Reconnecting,t?this.u.log(e.Information,`Connection reconnecting because of error '${t}'.`):this.u.log(e.Information,"Connection reconnecting."),0!==this.ot.length){try{this.ot.forEach((e=>e.apply(this,[t])))}catch(n){this.u.log(e.Error,`An onreconnecting callback called with error '${t}' threw error '${n}'.`)}if(this.ut!==j.Reconnecting)return void this.u.log(e.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==r;){if(this.u.log(e.Information,`Reconnect attempt number ${i+1} will start in ${r} ms.`),await new Promise((t=>{this.Ht=setTimeout(t,r)})),this.Ht=void 0,this.ut!==j.Reconnecting)return void this.u.log(e.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this.yt(),this.ut=j.Connected,this.u.log(e.Information,"HubConnection reconnected successfully."),0!==this.ht.length)try{this.ht.forEach((t=>t.apply(this,[this.connection.connectionId])))}catch(t){this.u.log(e.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${t}'.`)}return}catch(t){if(this.u.log(e.Information,`Reconnect attempt failed because of error '${t}'.`),this.ut!==j.Reconnecting)return this.u.log(e.Debug,`Connection moved to the '${this.ut}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this.ut===j.Disconnecting&&this.Dt());i++,o=t instanceof Error?t:new Error(t.toString()),r=this.Vt(i,Date.now()-n,o)}}this.u.log(e.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${i} failed attempts. Connection disconnecting.`),this.Dt()}Vt(t,n,i){try{return this.Z.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:t,retryReason:i})}catch(i){return this.u.log(e.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${n}) threw error '${i}'.`),null}}Jt(t){const n=this.it;this.it={},Object.keys(n).forEach((i=>{const o=n[i];try{o(null,t)}catch(n){this.u.log(e.Error,`Stream 'error' callback called with '${t}' threw error: ${T(n)}`)}}))}Tt(){this.Bt&&(clearTimeout(this.Bt),this.Bt=void 0)}Ct(){this.Ot&&clearTimeout(this.Ot)}Mt(t,e,n,i){if(n)return 0!==i.length?{target:t,arguments:e,streamIds:i,type:N.Invocation}:{target:t,arguments:e,type:N.Invocation};{const n=this.ct;return this.ct++,0!==i.length?{target:t,arguments:e,invocationId:n.toString(),streamIds:i,type:N.Invocation}:{target:t,arguments:e,invocationId:n.toString(),type:N.Invocation}}}qt(t,e){if(0!==t.length){e||(e=Promise.resolve());for(const n in t)t[n].subscribe({complete:()=>{e=e.then((()=>this.xt(this.Xt(n))))},error:t=>{let i;i=t instanceof Error?t.message:t&&t.toString?t.toString():"Unknown error",e=e.then((()=>this.xt(this.Xt(n,i))))},next:t=>{e=e.then((()=>this.xt(this.Kt(n,t))))}})}}Ut(t){const e=[],n=[];for(let i=0;i0)&&(e=!1,this.te=await this.Zt()),this.ee(t);const n=await this.Yt.send(t);return e&&401===n.statusCode&&this.Zt?(this.te=await this.Zt(),this.ee(t),await this.Yt.send(t)):n}ee(t){t.headers||(t.headers={}),this.te?t.headers[z.Authorization]=`Bearer ${this.te}`:this.Zt&&t.headers[z.Authorization]&&delete t.headers[z.Authorization]}getCookieString(t){return this.Yt.getCookieString(t)}}var U,B;!function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"}(U||(U={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(B||(B={}));class W{constructor(){this.se=!1,this.onabort=null}abort(){this.se||(this.se=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this.se}}class X{get pollAborted(){return this.ie.aborted}constructor(t,e,n){this.$=t,this.u=e,this.ie=new W,this.ne=n,this.re=!1,this.onreceive=null,this.onclose=null}async connect(t,n){if(m.isRequired(t,"url"),m.isRequired(n,"transferFormat"),m.isIn(n,B,"transferFormat"),this.oe=t,this.u.log(e.Trace,"(LongPolling transport) Connecting."),n===B.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[o,r]=C(),s={[o]:r,...this.ne.headers},a={abortSignal:this.ie.signal,headers:s,timeout:1e5,withCredentials:this.ne.withCredentials};n===B.Binary&&(a.responseType="arraybuffer");const c=`${t}&_=${Date.now()}`;this.u.log(e.Trace,`(LongPolling transport) polling: ${c}.`);const l=await this.$.get(c,a);200!==l.statusCode?(this.u.log(e.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this.he=new i(l.statusText||"",l.statusCode),this.re=!1):this.re=!0,this.ce=this.ae(this.oe,a)}async ae(t,n){try{for(;this.re;)try{const o=`${t}&_=${Date.now()}`;this.u.log(e.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this.$.get(o,n);204===r.statusCode?(this.u.log(e.Information,"(LongPolling transport) Poll terminated by server."),this.re=!1):200!==r.statusCode?(this.u.log(e.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this.he=new i(r.statusText||"",r.statusCode),this.re=!1):r.content?(this.u.log(e.Trace,`(LongPolling transport) data received. ${y(r.content,this.ne.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this.u.log(e.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(t){this.re?t instanceof o?this.u.log(e.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.he=t,this.re=!1):this.u.log(e.Trace,`(LongPolling transport) Poll errored after shutdown: ${t.message}`)}}finally{this.u.log(e.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.le()}}async send(t){return this.re?b(this.u,"LongPolling",this.$,this.oe,t,this.ne):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this.u.log(e.Trace,"(LongPolling transport) Stopping polling."),this.re=!1,this.ie.abort();try{await this.ce,this.u.log(e.Trace,`(LongPolling transport) sending DELETE request to ${this.oe}.`);const t={},[n,o]=C();t[n]=o;const r={headers:{...t,...this.ne.headers},timeout:this.ne.timeout,withCredentials:this.ne.withCredentials};let s;try{await this.$.delete(this.oe,r)}catch(t){s=t}s?s instanceof i&&(404===s.statusCode?this.u.log(e.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this.u.log(e.Trace,`(LongPolling transport) Error sending a DELETE request: ${s}`)):this.u.log(e.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this.u.log(e.Trace,"(LongPolling transport) Stop finished."),this.le()}}le(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this.he&&(t+=" Error: "+this.he),this.u.log(e.Trace,t),this.onclose(this.he)}}}class V{constructor(t,e,n,i){this.$=t,this.te=e,this.u=n,this.ne=i,this.onreceive=null,this.onclose=null}async connect(t,n){return m.isRequired(t,"url"),m.isRequired(n,"transferFormat"),m.isIn(n,B,"transferFormat"),this.u.log(e.Trace,"(SSE transport) Connecting."),this.oe=t,this.te&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this.te)}`),new Promise(((i,o)=>{let r,s=!1;if(n===B.Text){if(g.isBrowser||g.isWebWorker)r=new this.ne.EventSource(t,{withCredentials:this.ne.withCredentials});else{const e=this.$.getCookieString(t),n={};n.Cookie=e;const[i,o]=C();n[i]=o,r=new this.ne.EventSource(t,{withCredentials:this.ne.withCredentials,headers:{...n,...this.ne.headers}})}try{r.onmessage=t=>{if(this.onreceive)try{this.u.log(e.Trace,`(SSE transport) data received. ${y(t.data,this.ne.logMessageContent)}.`),this.onreceive(t.data)}catch(t){return void this.ue(t)}},r.onerror=t=>{s?this.ue():o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this.u.log(e.Information,`SSE connected to ${this.oe}`),this.de=r,s=!0,i()}}catch(t){return void o(t)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(t){return this.de?b(this.u,"SSE",this.$,this.oe,t,this.ne):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this.ue(),Promise.resolve()}ue(t){this.de&&(this.de.close(),this.de=void 0,this.onclose&&this.onclose(t))}}class J{constructor(t,e,n,i,o,r){this.u=n,this.Zt=e,this.fe=i,this.pe=o,this.$=t,this.onreceive=null,this.onclose=null,this.we=r}async connect(t,n){let i;return m.isRequired(t,"url"),m.isRequired(n,"transferFormat"),m.isIn(n,B,"transferFormat"),this.u.log(e.Trace,"(WebSockets transport) Connecting."),this.Zt&&(i=await this.Zt()),new Promise(((o,r)=>{let s;t=t.replace(/^http/,"ws");const a=this.$.getCookieString(t);let c=!1;if(g.isNode||g.isReactNative){const e={},[n,o]=C();e[n]=o,i&&(e[z.Authorization]=`Bearer ${i}`),a&&(e[z.Cookie]=a),s=new this.pe(t,void 0,{headers:{...e,...this.we}})}else i&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(i)}`);s||(s=new this.pe(t)),n===B.Binary&&(s.binaryType="arraybuffer"),s.onopen=n=>{this.u.log(e.Information,`WebSocket connected to ${t}.`),this.ge=s,c=!0,o()},s.onerror=t=>{let n=null;n="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"There was an error with the transport",this.u.log(e.Information,`(WebSockets transport) ${n}.`)},s.onmessage=t=>{if(this.u.log(e.Trace,`(WebSockets transport) data received. ${y(t.data,this.fe)}.`),this.onreceive)try{this.onreceive(t.data)}catch(t){return void this.ue(t)}},s.onclose=t=>{if(c)this.ue(t);else{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",r(new Error(e))}}}))}send(t){return this.ge&&this.ge.readyState===this.pe.OPEN?(this.u.log(e.Trace,`(WebSockets transport) sending data. ${y(t,this.fe)}.`),this.ge.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this.ge&&this.ue(void 0),Promise.resolve()}ue(t){this.ge&&(this.ge.onclose=()=>{},this.ge.onmessage=()=>{},this.ge.onerror=()=>{},this.ge.close(),this.ge=void 0),this.u.log(e.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this.me(t)||!1!==t.wasClean&&1e3===t.code?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}me(t){return t&&"boolean"==typeof t.wasClean&&"number"==typeof t.code}}class Z{constructor(t,n={}){var i;if(this.ye=()=>{},this.features={},this.ve=1,m.isRequired(t,"url"),this.u=void 0===(i=n.logger)?new w(e.Information):null===i?p.instance:void 0!==i.log?i:new w(i),this.baseUrl=this.be(t),(n=n||{}).logMessageContent=void 0!==n.logMessageContent&&n.logMessageContent,"boolean"!=typeof n.withCredentials&&void 0!==n.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=void 0===n.withCredentials||n.withCredentials,n.timeout=void 0===n.timeout?1e5:n.timeout;let o=null,r=null;if(g.isNode){const t=require;o=t("ws"),r=t("eventsource")}g.isNode||"undefined"==typeof WebSocket||n.WebSocket?g.isNode&&!n.WebSocket&&o&&(n.WebSocket=o):n.WebSocket=WebSocket,g.isNode||"undefined"==typeof EventSource||n.EventSource?g.isNode&&!n.EventSource&&void 0!==r&&(n.EventSource=r):n.EventSource=EventSource,this.$=new F(n.httpClient||new D(this.u),n.accessTokenFactory),this.ut="Disconnected",this.dt=!1,this.ne=n,this.onreceive=null,this.onclose=null}async start(t){if(t=t||B.Binary,m.isIn(t,B,"transferFormat"),this.u.log(e.Debug,`Starting connection with transfer format '${B[t]}'.`),"Disconnected"!==this.ut)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this.ut="Connecting",this.Ee=this.yt(t),await this.Ee,"Disconnecting"===this.ut){const t="Failed to start the HttpConnection before stop() was called.";return this.u.log(e.Error,t),await this.It,Promise.reject(new r(t))}if("Connected"!==this.ut){const t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this.u.log(e.Error,t),Promise.reject(new r(t))}this.dt=!0}send(t){return"Connected"!==this.ut?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.$e||(this.$e=new Y(this.transport)),this.$e.send(t))}async stop(t){return"Disconnected"===this.ut?(this.u.log(e.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this.ut?(this.u.log(e.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this.It):(this.ut="Disconnecting",this.It=new Promise((t=>{this.ye=t})),await this._t(t),void await this.It)}async _t(t){this.Ce=t;try{await this.Ee}catch(t){}if(this.transport){try{await this.transport.stop()}catch(t){this.u.log(e.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this.Se()}this.transport=void 0}else this.u.log(e.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async yt(t){let n=this.baseUrl;this.Zt=this.ne.accessTokenFactory,this.$.Zt=this.Zt;try{if(this.ne.skipNegotiation){if(this.ne.transport!==U.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this.ke(U.WebSockets),await this.Pe(n,t)}else{let e=null,i=0;do{if(e=await this.Te(n),"Disconnecting"===this.ut||"Disconnected"===this.ut)throw new r("The connection was stopped during negotiation.");if(e.error)throw new Error(e.error);if(e.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(e.url&&(n=e.url),e.accessToken){const t=e.accessToken;this.Zt=()=>t,this.$.te=t,this.$.Zt=void 0}i++}while(e.url&&i<100);if(100===i&&e.url)throw new Error("Negotiate redirection limit exceeded.");await this.Ie(n,this.ne.transport,e,t)}this.transport instanceof X&&(this.features.inherentKeepAlive=!0),"Connecting"===this.ut&&(this.u.log(e.Debug,"The HttpConnection connected successfully."),this.ut="Connected")}catch(t){return this.u.log(e.Error,"Failed to start the connection: "+t),this.ut="Disconnected",this.transport=void 0,this.ye(),Promise.reject(t)}}async Te(t){const n={},[o,r]=C();n[o]=r;const s=this._e(t);this.u.log(e.Debug,`Sending negotiation request: ${s}.`);try{const t=await this.$.post(s,{content:"",headers:{...n,...this.ne.headers},timeout:this.ne.timeout,withCredentials:this.ne.withCredentials});if(200!==t.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${t.statusCode}'`));const e=JSON.parse(t.content);return(!e.negotiateVersion||e.negotiateVersion<1)&&(e.connectionToken=e.connectionId),e.useStatefulReconnect&&!0!==this.ne.He?Promise.reject(new l("Client didn't negotiate Stateful Reconnect but the server did.")):e}catch(t){let n="Failed to complete negotiation with the server: "+t;return t instanceof i&&404===t.statusCode&&(n+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this.u.log(e.Error,n),Promise.reject(new l(n))}}De(t,e){return e?t+(-1===t.indexOf("?")?"?":"&")+`id=${e}`:t}async Ie(t,n,i,o){let s=this.De(t,i.connectionToken);if(this.Re(n))return this.u.log(e.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this.Pe(s,o),void(this.connectionId=i.connectionId);const a=[],l=i.availableTransports||[];let d=i;for(const i of l){const l=this.xe(i,n,o,!0===(null==d?void 0:d.useStatefulReconnect));if(l instanceof Error)a.push(`${i.transport} failed:`),a.push(l);else if(this.Re(l)){if(this.transport=l,!d){try{d=await this.Te(t)}catch(t){return Promise.reject(t)}s=this.De(t,d.connectionToken)}try{return await this.Pe(s,o),void(this.connectionId=d.connectionId)}catch(t){if(this.u.log(e.Error,`Failed to start the transport '${i.transport}': ${t}`),d=void 0,a.push(new c(`${i.transport} failed: ${t}`,U[i.transport])),"Connecting"!==this.ut){const t="Failed to select transport before stop() was called.";return this.u.log(e.Debug,t),Promise.reject(new r(t))}}}}return a.length>0?Promise.reject(new u(`Unable to connect to the server with any of the available transports. ${a.join(" ")}`,a)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}ke(t){switch(t){case U.WebSockets:if(!this.ne.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new J(this.$,this.Zt,this.u,this.ne.logMessageContent,this.ne.WebSocket,this.ne.headers||{});case U.ServerSentEvents:if(!this.ne.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new V(this.$,this.$.te,this.u,this.ne);case U.LongPolling:return new X(this.$,this.u,this.ne);default:throw new Error(`Unknown transport: ${t}.`)}}Pe(t,e){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async n=>{let i=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(t,e),await this.features.resend()}catch{i=!0}i&&this.Se(n)}else this.Se(n)}:this.transport.onclose=t=>this.Se(t),this.transport.connect(t,e)}xe(t,n,i,o){const r=U[t.transport];if(null==r)return this.u.log(e.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(t,e){return!t||!!(e&t)}(n,r))return this.u.log(e.Debug,`Skipping transport '${U[r]}' because it was disabled by the client.`),new a(`'${U[r]}' is disabled by the client.`,r);if(!(t.transferFormats.map((t=>B[t])).indexOf(i)>=0))return this.u.log(e.Debug,`Skipping transport '${U[r]}' because it does not support the requested transfer format '${B[i]}'.`),new Error(`'${U[r]}' does not support ${B[i]}.`);if(r===U.WebSockets&&!this.ne.WebSocket||r===U.ServerSentEvents&&!this.ne.EventSource)return this.u.log(e.Debug,`Skipping transport '${U[r]}' because it is not supported in your environment.'`),new s(`'${U[r]}' is not supported in your environment.`,r);this.u.log(e.Debug,`Selecting transport '${U[r]}'.`);try{return this.features.reconnect=r===U.WebSockets?o:void 0,this.ke(r)}catch(t){return t}}Re(t){return t&&"object"==typeof t&&"connect"in t}Se(t){if(this.u.log(e.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this.ut}.`),this.transport=void 0,t=this.Ce||t,this.Ce=void 0,"Disconnected"!==this.ut){if("Connecting"===this.ut)throw this.u.log(e.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this.ut&&this.ye(),t?this.u.log(e.Error,`Connection disconnected with error '${t}'.`):this.u.log(e.Information,"Connection disconnected."),this.$e&&(this.$e.stop().catch((t=>{this.u.log(e.Error,`TransportSendQueue.stop() threw error '${t}'.`)})),this.$e=void 0),this.connectionId=void 0,this.ut="Disconnected",this.dt){this.dt=!1;try{this.onclose&&this.onclose(t)}catch(n){this.u.log(e.Error,`HttpConnection.onclose(${t}) threw error '${n}'.`)}}}else this.u.log(e.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}be(t){if(0===t.lastIndexOf("https://",0)||0===t.lastIndexOf("http://",0))return t;if(!g.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const n=window.document.createElement("a");return n.href=t,this.u.log(e.Information,`Normalizing '${t}' to '${n.href}'.`),n.href}_e(t){const e=new URL(t);e.pathname.endsWith("/")?e.pathname+="negotiate":e.pathname+="/negotiate";const n=new URLSearchParams(e.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this.ve.toString()),n.has("useStatefulReconnect")?"true"===n.get("useStatefulReconnect")&&(this.ne.He=!0):!0===this.ne.He&&n.append("useStatefulReconnect","true"),e.search=n.toString(),e.toString()}}class Y{constructor(t){this.Ae=t,this.Ue=[],this.Le=!0,this.Ne=new Q,this.qe=new Q,this.Me=this.je()}send(t){return this.We(t),this.qe||(this.qe=new Q),this.qe.promise}stop(){return this.Le=!1,this.Ne.resolve(),this.Me}We(t){if(this.Ue.length&&typeof this.Ue[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this.Ue} but was of type ${typeof t}`);this.Ue.push(t),this.Ne.resolve()}async je(){for(;;){if(await this.Ne.promise,!this.Le){this.qe&&this.qe.reject("Connection stopped.");break}this.Ne=new Q;const t=this.qe;this.qe=void 0;const e="string"==typeof this.Ue[0]?this.Ue.join(""):Y.Oe(this.Ue);this.Ue.length=0;try{await this.Ae.send(e),t.resolve()}catch(e){t.reject(e)}}}static Oe(t){const e=t.map((t=>t.byteLength)).reduce(((t,e)=>t+e)),n=new Uint8Array(e);let i=0;for(const e of t)n.set(new Uint8Array(e),i),i+=e.byteLength;return n.buffer}}class Q{constructor(){this.promise=new Promise(((t,e)=>[this.j,this.Fe]=[t,e]))}resolve(){this.j()}reject(t){this.Fe(t)}}class K{constructor(){this.name="json",this.version=2,this.transferFormat=B.Text}parseMessages(t,n){if("string"!=typeof t)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];null===n&&(n=p.instance);const i=A.parse(t),o=[];for(const t of i){const i=JSON.parse(t);if("number"!=typeof i.type)throw new Error("Invalid payload.");switch(i.type){case N.Invocation:this.U(i);break;case N.StreamItem:this.Be(i);break;case N.Completion:this.Xe(i);break;case N.Ping:case N.Close:break;case N.Ack:this.Je(i);break;case N.Sequence:this.ze(i);break;default:n.log(e.Information,"Unknown message type '"+i.type+"' ignored.");continue}o.push(i)}return o}writeMessage(t){return A.write(JSON.stringify(t))}U(t){this.Ve(t.target,"Invalid payload for Invocation message."),void 0!==t.invocationId&&this.Ve(t.invocationId,"Invalid payload for Invocation message.")}Be(t){if(this.Ve(t.invocationId,"Invalid payload for StreamItem message."),void 0===t.item)throw new Error("Invalid payload for StreamItem message.")}Xe(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this.Ve(t.error,"Invalid payload for Completion message."),this.Ve(t.invocationId,"Invalid payload for Completion message.")}Je(t){if("number"!=typeof t.sequenceId)throw new Error("Invalid SequenceId for Ack message.")}ze(t){if("number"!=typeof t.sequenceId)throw new Error("Invalid SequenceId for Sequence message.")}Ve(t,e){if("string"!=typeof t||""===t)throw new Error(e)}}const G={trace:e.Trace,debug:e.Debug,info:e.Information,information:e.Information,warn:e.Warning,warning:e.Warning,error:e.Error,critical:e.Critical,none:e.None};class tt{configureLogging(t){if(m.isRequired(t,"logging"),void 0!==t.log)this.logger=t;else if("string"==typeof t){const e=function(t){const e=G[t.toLowerCase()];if(void 0!==e)return e;throw new Error(`Unknown log level: ${t}`)}(t);this.logger=new w(e)}else this.logger=new w(t);return this}withUrl(t,e){return m.isRequired(t,"url"),m.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions="object"==typeof e?{...this.httpConnectionOptions,...e}:{...this.httpConnectionOptions,transport:e},this}withHubProtocol(t){return m.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new L(t):this.reconnectPolicy=t:this.reconnectPolicy=new L,this}withServerTimeout(t){return m.isRequired(t,"milliseconds"),this.Ke=t,this}withKeepAliveInterval(t){return m.isRequired(t,"milliseconds"),this.Ge=t,this}withStatefulReconnect(t){return void 0===this.httpConnectionOptions&&(this.httpConnectionOptions={}),this.httpConnectionOptions.He=!0,this.Y=null==t?void 0:t.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(void 0===t.logger&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const e=new Z(this.url,t);return O.create(e,this.logger||p.instance,this.protocol||new K,this.reconnectPolicy,this.Ke,this.Ge,this.Y)}}return Uint8Array.prototype.indexOf||Object.defineProperty(Uint8Array.prototype,"indexOf",{value:Array.prototype.indexOf,writable:!0}),Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(t,e){return new Uint8Array(Array.prototype.slice.call(this,t,e))},writable:!0}),Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach,writable:!0}),n})(),"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.signalR=e():t.signalR=e(),$.extend($t,{t1:"Eingabe erforderlich",t2:"Bitte überprüfen Sie Ihre Eingaben im Formular.",b0:"Erstellt",b1:"Zuletzt geändert",b2:"von",t12:"Der Server hat einen Fehler zurückgegeben. Bitte versuchen Sie es erneut.",t17:"Eine Email mit einem Aktivierungs-Link wurde an deine Adresse versandt.",t18:"Ein Account mit deinem Namen existiert bereits. Dennoch erstellen?",t19:"Einträge sind entweder unngültig oder zu kurz.",t20:"Der Server hat einen Fehler gemeldet. Bitte versuch es erneut.",t21:"Der Zugang wurde nicht gefunden.",t30a:"Als erledigt markieren.",t30b:"Als unerledigt markieren.",t55:"Ein Email mit einem Aktivierungs-Link wurde an Ihre Adresse versandt.",t56:"Ein Zugang für diesen Namen besteht bereits. Trotzdem erstellen?",t57:"Ein bestehender Zugang wurde für diese Serie registriert.",t60:"Bitte geben Sie Email-Adresse an, die Sie hier hinterlegt haben.",t61:"Ihr Passwort wurde erfolgreich versandt.",t62:"Die angegebene Email-Adresse stimmt nicht mit der hier hinterlegten überein.",ov:"Persönliche Übersicht"});var $v={}; /*! loadCSS. [c]2020 Filament Group, Inc. MIT License */ /*! onloadCSS. (onload callback for loadCSS) [c]2017 Filament Group, Inc. MIT License */ -function onloadCSS(t,e){e=e||{};let n=function(e){return new Promise(((n,i)=>{t.addEventListener?e.addEventListener("load",newcb):t.attachEvent&&e.attachEvent("onload",newcb),"isApplicationInstalled"in navigator&&"onloadcssdefined"in t&&e.onloadcssdefined(newcb)}))};if(Array.isArray(t)){let i=t.length;Promise.all(t.map(n)).then((function(t){var n=t.reduce(((t,e)=>t+(!0===e?1:0)));!async function(t){!0===t&&"function"==typeof e.success?e.success():!0===t&&"object"==typeof e.success&&e.success instanceof Promise&&await e.success(),e.complete()}(i===n)}))}else n(t)}!function(t){"use strict";var e=function(e,n,i,o){var r,s=t.document,a=s.createElement("link");if(n)r=n;else{var c=(s.body||s.getElementsByTagName("head")[0]).childNodes;r=c[c.length-1]}var l=s.styleSheets;if(o)for(var u in o)o.hasOwnProperty(u)&&a.setAttribute(u,o[u]);a.rel="stylesheet",a.href=e,a.media="only x",function t(e){if(s.body)return e();setTimeout((function(){t(e)}))}((function(){r.parentNode.insertBefore(a,n?r:r.nextSibling)}));var d=function(t){for(var e=a.href,n=l.length;n--;)if(l[n].href===e)return t();setTimeout((function(){d(t)}))};function h(){a.addEventListener&&a.removeEventListener("load",h),a.media=i||"all"}return a.addEventListener&&a.addEventListener("load",h),a.onloadcssdefined=d,d(h),a};"undefined"!=typeof exports?exports.loadCSS=e:t.loadCSS=e}("undefined"!=typeof global?global:this);const isIE=/MSIE\/|Trident/gi.test(window.navigator.userAgent)||void 0!==window.document.documentMode,isfileapi=!!(window.File&&window.FileReader&&window.FileList&&window.Blob);var $ocms={auth:{},no:function(t){t.stopPropagation()},vmin:function(t){var e=$(window).width*(t||1),n=$(window).height*(t||1);return e($ocms.baseurl+"/"+(t||"")).replace(/\/\//,"/"),cexi:null};function deepCopy(t){var e,n,i;if("object"!=typeof t||null===t)return t;for(i in e=Array.isArray(t)?[]:{},t)n=t[i],e[i]=deepCopy(n);return e}function fields_definition(t,e,n){this.label_sng=!0===Array.isArray(t)?"":t||"",this.label_pl=!0===Array.isArray(t)?"":e||"",this.fields=!0===Array.isArray(t)?t:n||[],this.itm=function(t){for(var e=0;e0)for(var n=0;nt||"")).filter(((t,e)=>""!==t)).join(e)}function parseDt(t,e,n){t=(t||"").substr(0,e.length);var i=e,o=t.length>0&&e.split(";").some((function(e){for(var n,o=/[^yMdhms0-9]/gi,r=!0;null!==(n=o.exec(e));)r=r&&e.substr(n.index,1)===t.substr(n.index,1);var s=t.length===e.length&&r;return!0===s&&(i=e),s}));if(!0===o){for(var r,s=[0,0,0,0,0,0,0],a=/(mm{1,2}|dd{1,2}|MM{1,2}|(yy){2,4}|ss{1,2}|hh{1,2})(?!\w)/g;null!==(r=a.exec(i));)s["yMdhms".indexOf(r[0].substr(0,1))]=parseInt(("yy"===r[0]?"20":"")+t.substr(r.index,r[0].length))-("M"===r[0].substr(0,1)?1:0);var c=new(Function.prototype.bind.apply(Date,[null].concat(s)));return"string"==typeof n?fdt(c,n):c}return!1}function bool(t,e){return"boolean"==typeof t?t:"boolean"==typeof e&&e}function booln(t,e){return"boolean"==typeof t?t:"number"==typeof t?1===t:"boolean"==typeof e&&e}Date.prototype.isValid=function(){return!isNaN(this)},Date.prototype.format=function(t){return fdt(this,t)},Date.prototype.addDays=function(t){return this.setDate(this.getDate()+t),this},Date.prototype.isBetween=function(t,e){return this>t&&this section");$(window).scroll((function(e){let n=$(window).scrollTop(),i=$("body");i.toggleClass("unfocus",n>vh()-1.2*t),i.toggleClass("btb",n>.5*vh()-t)}))},$ocms.cf_reset=function(){return $("#contentframe").empty()},function(t){t.fn.scrollTo=function(e){if(t(this).length>0){var n=t(this).offset().top||0;n>0&&t("html, body").animate({scrollTop:n-hh()},2e3)}},t.fn.ldng=function(e){var n=!0;return"boolean"==typeof e?n=e:"number"==typeof e&&(n=e>0),t(this).toggleClass("loading",n)},"function"!=typeof t.noop&&(t.noop=function(){}),t.fn.hasAttr=function(e){var n=t(this).attr(e);return void 0!==n&&!1!==n},t.fn.parseCssPx=function(e){try{return parseFloat(t(this).css(e).replace("px","")||0)}catch(t){return 0}},t.max=function(t,e){return isNaN(t)&&isNaN(e)?null:isNaN(t)&&!isNaN(e)?e:!isNaN(e)&&isNaN(e)||t>=e?t:e},t.min=function(t,e){return isNaN(t)&&isNaN(e)?null:isNaN(t)&&!isNaN(e)?e:!isNaN(e)&&isNaN(e)||t<=e?t:e},t.lim=function(t,e){return isNaN(t)?null:isNaN(e)?t:e<=t?e:t},t.fn.enterKey=function(e){return this.each((function(){t(this).keypress((function(t){"13"===(t.keyCode?t.keyCode:t.which).toString()&&e.call(this,t)}))}))}}(jQuery),$ocms.defaultTimeout=3e4,$ocms.AjaxEX=function(t){var e=this;e.responseText=e.responseText||"";var n=e.getResponseHeader("x-ocms-code")||"";e.internalCode=""!==n&&!1===isNaN(n)?parseInt(n):-1,e.isInternal=e.internalCode>-1,e.internalText=decodeURIComponent((e.getResponseHeader("x-ocms-desc")||"").replace(/\+/g,"%20")||"");var i=e.internalText||t,o=e.internalCode||e.status;e.logtext=i+" ("+o+")"},$ocms.postXTS=function(t){$ocms.postXT.call(this,$.extend(t,{sync:!0}))},$ocms.postXT=function(t){if((t=t||{}).trycount=t.trycount||0,""!==(t.url||"")){t.url=-1!==t.url.indexOf("&yy=")?t.url:t.url.indexOf("?")>-1?t.url+"&yy="+(new Date).getTime():t.url+"?yy="+(new Date).getTime();var e=t.context||this;switch(t.context=e,t.retryLimit=t.retryLimit||0,t.timeout=t.timeout||$ocms.defaultTimeout,t.timeout<100&&(t.timeout=1e3*t.timeout),t.data=t.data||{},t.contentType=t.contentType||"multipart/form-data; charset=UTF-8",t.islogin="boolean"==typeof t.islogin&&t.islogin,t.contentType){case"":case"json":t.contentType="application/json; charset=utf-8";break;case"form":t.contentType="application/x-www-form-urlencoded; charset=UTF-8";break;case"multi":t.contentType="multipart/form-data";break;case"text":t.contentType="text/plain; charset=UTF-8"}if(t.form instanceof jQuery?(t.data=t.form.serializeObject(),t.contentType="form-data"):t.lzw instanceof jQuery&&(t.data.lzw=$.ccLZW(t.lzw.serializeAnything(!0)).join(",")),"multipart/form-data"!==t.contentType.substr(0,19)&&"form-data"!==t.contentType.substr(0,9)||t.data instanceof FormData!=!1)t.data instanceof FormData&&(t.contentType=!1,t.processData=!1);else{t.contentType=!1;var n=new FormData;$.each(t.files||[],(function(t,e){n.append("upload_file",e)})),$.each(t.data||{},(function(t,e){n.append(t,e)})),t.data=n,t.processData=!1}var i={type:t.method||"post",url:t.url,data:t.data,processData:"boolean"!=typeof t.processData||t.processData,contentType:t.contentType,cache:t.cache||!1,timeout:t.timeout,beforeSend:function(n){$(t.loading).ldng(),$("body").addClass("ldng"),"function"==typeof t.beforesend&&t.beforesend.apply(e,[n])},success:function(n,i,o){"false"===n||"not authorized"===n?("function"==typeof t.error&&t.error.apply(e,[o,i,n]),"function"==typeof $.status&&$.status(i+" - "+n)):"function"==typeof t.success&&t.success.apply(e,[n,i,o])},error:function(n,i,o){if($ocms.AjaxEX.call(n,i),-1===t.url.indexOf("doc.ashx")||-1!==t.url.indexOf("ftest")){if(401===n.status&&111===n.internalCode&&!1===t.islogin&&"function"==typeof $ocms.login.dlg)$ocms.login.dlg({ajo:t});else if("timeout"===i||302===n.status)return t.tryCount++,t.tryCount<=t.retryLimit?void $ocms.postXT(t):void 0;"function"==typeof t.error?t.error.apply(e,[n,i,o]):"function"==typeof $ocms.failure?$ocms.failure.apply(e,[n]):"function"==typeof $.status&&$.status("Server error: "+i+" - "+o)}},dataType:t.datatype||"json",complete:function(n,i){"function"==typeof t.complete&&t.complete.apply(e,[n,i]),$(t.loading).ldng(0),$("body").removeClass("ldng");let o=$("body > .timer");if(o.length>0){let t=new Date(n.getResponseHeader("ocms_cec")||""),e=new Date(n.getResponseHeader("ocms_cex")||"");if(t.isValid()&&e.isValid()){let n=new Date,i=Math.abs(e-t);n.setMilliseconds(n.getMilliseconds()+i),o.data({cex:n,ctt:i}),$ocms.cex_timer()}}},context:e,async:!0};"boolean"==typeof t.sync&&(i.async=!1===t.sync),!0==("boolean"==typeof t.contentType&&!1===t.contentType)&&(i.contentType=!1),$.ajax(i)}},$ocms.cex_timer=function(){$ocms.cexi||($ocms.cexi=setInterval($ocms.cex_timer,15e3));let t=$("body > .timer"),e=t.data("cex"),n=t.data("ctt"),i=new Date;if(e instanceof Date&&e.isValid()&&"number"==typeof n&&n>0&&e>i){let o=Math.abs(i-e)/n*100;t.css("width",o.toString()+"%"),o<98&&(!$ocms.cex_lp||Math.abs(i-$ocms.cex_lp)>6e5)&&$ocms.postXT({url:$ocms.url("ping"),success:()=>{$ocms.cex_lp=i},timeout:5e3,error:()=>{}})}},$ocms.vbl_send=function(t){var e=t.data||{};if(""!==(e.url||"")){var n=$("#contentframe form:first"),i={url:e.url,data:new FormData,success:function(t){"function"==typeof e.success?e.success(t):"string"==typeof e.success&&alert(e.success)},error:function(t,n,i){"function"==typeof e.error?e.error(i):"string"==typeof e.error&&alert(e.error)},complete:function(){n.ldng(0)}},o=!0;n.find("input").each((function(){var t=$(this),e=t.nza("name"),n=t.val(),r=$(this).prop("required")||!1;if(""!==e){var s=""!==n||!1===r;o=o&&s,!0===s?(i.data.append(e,n),t[0].setCustomValidity("")):""!==$(this).nza("ocms-nvnote")&&t[0].setCustomValidity($(this).nza("ocms-nvnote"))}})),!0===o&&(n.ldng(1),$ocms.postXT.call(this,i))}},function(t){t.fn.nza=function(e,n){var i=t(this).attr(e);return void 0!==i&&!1!==i?i:n||""},t.fn.serializeObject=function(e,n){var i=/\r?\n/g,o=/^(?:submit|button|image|reset|file)$/i,r=/^(?:input|select|textarea|keygen)/i,s=/^(?:checkbox|radio)$/i,a=bool((n=n||{}).typedvalues,!1),c={},l=t(this),u=l.find(':input:not([nosend],[type="file"])').addBack(":input"),d=!0;return t.each(u.not(".tinymce").get(),(function(n,l){var u=t(this),h=this,p=(this.type||"").toLowerCase(),f=u.prop("required")||!1;if(!0===(h.name&&!u.is(":disabled")&&r.test(h.nodeName)&&!o.test(p))){var m=u.val(),g=h.name,y=u.nza("data-format").split(":"),v=u.nza("pattern")||".*";if(!0===s.test(p)&&(m=h.checked?""!==m?m:"true":""),"date"===y[0].substr(0,4)&&y.length>1)"boolean"==typeof(m=parseDt(m,y.slice(1).join(":")))&&(m=null),null===m&&"date"===u.prop("type").substr(0,4)&&!1===isNaN(new Date(u.val()))&&(m=new Date(u.val())),m instanceof Date==!0&&"function"==typeof m.getMonth?!1===a&&(m=fdt(m,"date"===y[0]?"dts":"iso")):m=null;else if("number"===p&&!0===a){let t;t="integer"===y[0]?parseInt(m):parseFloat(m),m=isNaN(t)?m:t}if(!0!==f||""!==(m||"")&&null!==m.match(v)?!0===bool(e,!1)&&h.setCustomValidity(""):(!0===bool(e,!1)&&h.setCustomValidity(u.nza("ocms-nvnote",$ocms.t.inv||"Invalid field")),m=null),null!=m&&"string"==typeof m){let t=c[g];null!=t?Array.isArray(t)?t.push(m.replace(i,"\r\n")):c[g]=[t,m.replace(i,"\r\n")]:c[g]=m.replace(i,"\r\n")}else if(null!=m){let t=c[g];null!=t?Array.isArray(t)?t.push(m):c[g]=[t,m]:c[g]=m}else d=!1}})),u.filter(".tinymce").each((function(e,n){var i=t(this),o=((this.type||"").toLowerCase(),i.prop("required")||!1);try{var r=tinymce.get(t(n).attr("id"));if(r){var s=t(n).attr("name"),a=r.getContent();!1===o||""!==(a||"")?c[s]=a:d=!1}}catch(e){t.noop()}})),l.toggleClass("invalid",!d),d?c:null},t.fn.sendForm=function(e,n,i){var o=t(this);i=i||{};var r={url:e,success:function(t){if(i.response=t,"function"==typeof n)n(t);o.closest("div.modal").remove()},error:function(t,e,n){"function"==typeof i.error?i.error.call(this,t):$ocms.failure.call(this,t)},complete:function(){o.ldng(0),"function"==typeof i.complete&&i.complete.call(this,jqXHR)}},s=o.find('input[type="file"]');r.data=new FormData,s.length>0&&t.each(s[0].files,(function(t,e){r.data.append(t,e),r.data.append("file_lastmodified",$ocms.isodt(e.lastModifiedDate))}));var a=o.serializeObject();t.each(a||{},(function(t,e){r.data.append(t,e)})),o.ldng(),$ocms.postXT.call(this,r)},t.fn.checkValidity=function(){var e=t(this),n=!0;return e.each((function(t,e){n=n&&e.checkValidity()})),n},t.fn.wrap=function(e,n){var i=t(this),o=$$.dc(e).attr(n||{}).insertAfter(i);return i.append(o),o}}(jQuery),$ocms.logout=function(){$ocms.postXT({url:$ocms.url("logout"),complete:function(){window.location.reload()}})},$ocms.login={send:function(t){t.preventDefault();var e=$(this);if(!0===e.find("#dbtn-confirm").hasClass("disabled"))return!1;var n=e.serializeObject();return n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),""===ne(n.loginaccount)&&!0===bool($ocms.auth.accountrequired,!0)?(alert($t.l16),!1):($ocms.postXT({url:$ocms.url("login"),data:n,success:function(){window.location.reload()}}),!1)},uichange:function(){let t=$(this),e=t.closest("form"),n=bool($ocms.auth.accountrequired,!0),i=ne(e.find('[name="loginaccount"]').val(),$ocms.auth.account||$ocms.auth.requestedaccount||"");if(""!==i||!1===n){var o=e.find('[name="userlogin"]').empty().val(""),r=e.find('[name="username"]').empty().val(""),s=$("#dlg_userlogin_sel").empty().val(""),a=t.val()||"";if(!1===t.checkValidity()&&""===a)return;var c=t.closest("table").ldng();$ocms.postXT.call(this,{url:$ocms.url("auth"),data:{userinfo:a,account:i||""},success:function(t,e,n){if(1===t.length){var i=t[0];o.val(i.login).change().attr("required","").removeAttr("nosend"),r.val(i.name).change().attr("required","").show(),s.removeAttr("required").attr("nosend","").hide()}else t.length>0?(r.hide().removeAttr("required"),o.removeAttr("required").attr("nosend",""),0===s.length&&(s=$("").attr({name:"userlogin",size:t.length,id:"dlg_userlogin_sel",class:"form-control",required:""}).css({width:"100%","max-width":"100%",padding:"2px"}).insertAfter(r)),$.each(t,(function(t,e){var n=$("").attr({value:e.login,style:"padding-top: 2px; padding-bottom: 5px;","border-bottom":"1px solid #EEE;"}).text(e.name).appendTo(s);t%2==0&&n.css({"background-color":"#F9F9F9"})})),s.attr("required","").removeAttr("nosend")):(s.hide().attr("nosend",""),r.attr("required","").show(),o.attr("required","").removeAttr("nosend"),alert($t.l9))},error:function(t){$ocms.failure.call(this,t)},complete:function(){c.ldng(0)}})}else alert($t.l18)},sendpassword:function(t){var e=$(''),n=e.find(".form-body"),i=null;e.find("form").submit((function(t){t.preventDefault();var o=$(this).serializeObject(!0),r=null===i,s=r?"spwc":"spw";return $ocms.postXT.call(this,{url:$ocms.url(s),data:o,complete:function(){r?(n.append('
Ihnen wurde ein Code per SMS zugesandt.
Bitte tragen Sie den hier ein:
'),i=$('
').appendTo(n)):(alert($t.l13),e.remove())},error:()=>{}}),!1})),e.find(".modal-close").click((function(){e.remove()}));var o=[];$.each($t.l7a.split("\n"),((t,e)=>{Array.prototype.push.apply(o,[$("
"),$("").text(e)])})),e.find(".modal-note").append($('').text($t.alert)).append(o),e.appendTo("body"),setTimeout((function(){$(".modal").find('input[name="lastname"]').focus()}),600)}};var $$={s:function(t){return $("").text(t)},br:function(){return $("
")},sc:function(t,e){return $("").addClass(t).text(e)},td:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},th:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},tdc:function(t,e,n){return $$.td(e,n).addClass(t)},td2:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},td3:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},tdtr:function(t,e){var n=$$.tr().appendTo(e);return t instanceof jQuery==!0||"string"==typeof t?t.appendTo($$.td().appendTo(n)):!0===Array.isArray(t)&&$.each(t,(function(t,e){$(e).appendTo($$.td().appendTo(n))})),n},tr:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t&&n.attr(t),"object"==typeof e&&n.attr(e),n},trc:function(t,e){var n=$("").addClass(t);return e instanceof jQuery==!0?n.appendTo(e):"object"==typeof e&&n.attr(e),n},d:function(t){return $("
").attr(t||{})},dc:function(t,e,n,i){var o=$("
").addClass(t);return e instanceof jQuery==!0?o.appendTo(e):"object"==typeof e?o.attr(e):"function"==typeof e?o.click(e):"string"==typeof e&&o.text(e),"string"==typeof n?o.text(n):"object"==typeof n?o.attr(n):"function"==typeof n&&o.click(n),"string"==typeof i?o.text(i):"object"==typeof i?o.attr(i):"function"==typeof i&&o.click(i),o},df:function(t){return $("
 
").attr(t||{})},opt:function(t,e,n){var i=$("");return"string"==typeof t?i.attr("value",t):"object"==typeof t&&i.attr(t),"string"==typeof e?i.text(e):"object"==typeof e&&i.attr(e),"object"==typeof n&&i.attr(n),i},eOpt:function(t){var e=$('');return t&&e.attr("selected","selected"),e},tbl:function(t){return $("
").attr(t||{})},tblc:function(t){return $("
").addClass(t)},thead:function(t){let e=$("");return t instanceof jQuery&&e.prependTo(t),e},tbody:function(t){let e=$("");return t instanceof jQuery&&e.appendTo(t),e},tblset:function(t,e){let n=$$.tbl(t||{});return e instanceof jQuery&&e.append(n),{tbl:n,hd:$$.thead().appendTo(n),bdy:$$.tbody().appendTo(n)}},i:function(t){return $("").attr(t||{})},img:function(t,e){return $("").attr("src",t).attr(e||{})},sel:function(t){return $("").attr(t||{})},btn:function(t){return $("").attr(t||{})},a:function(t){return $("").attr(t||{})},li:function(t){return $("
  • ").attr(t||{})},ul:function(t){return $("
      ").attr(t||{})},nav:function(t){return $("").attr(t||{})},lbl:function(t,e){var n=$("");return"string"==typeof t&&n.text(t),"object"==typeof t?n.attr(t):"object"==typeof e&&n.attr(e),n},txt:function(t){return $("").attr(t||{})},0:function(t,e){return $("<"+t+">").attr(e||{})},bbtn:function(t,e){return $$.btn({type:"button",class:"btn"}).addClass(e).text(t)},svg:t=>$(document.createElementNS("http://www.w3.org/2000/svg",t))};function getMonday(t){var e=(t=new Date(t)).getDay(),n=t.getDate()-e+(0==e?-6:1);return new Date(t.setDate(n))}function $lf(t){var e=void 0===t?null:"number"==typeof t&&1!==t||"boolean"==typeof cl&&!1===t;return $("#listframe").tC("hd",e).is(".hd")}function $nuf(t){if(t&&t.stopPropagation(),!$(this).is(".disabled")){var e=function(t){t.removeClass("vis").find("li.dropdown").removeClass("open").removeClass("vis").attr("aria-expanded","false")},n=$(this).parent("li.dropdown");if(n.length>0){n.tC("open"),navs=!0===n.is(".open")?"true":"false",n.attr("aria-expanded",navs);var i=n.closest("nav");i.find("li.dropdown").not(n.parentsUntil("nav")).not(n).removeClass("open").attr("aria-expanded","false"),!1===n.is(".open")&&n.find("li.dropdown").removeClass("open").attr("aria-expanded","false"),e($("nav").not(i))}else e($("nav"))}}function $tbr(){return $lf(0),$("#topbar").ocmsmenu([])}function $lfr(){return $("#sidebar").empty(),$("#listframe").removeClass("fix").addClass("hd").empty()}function $cfr(){return $tbr(),$("#contentframe").empty()}function jObj(t,e){let n={};if("{"===(t||"").substr(0,1))try{n=JSON.parse(t)}catch(t){n={}}return n[e]||""}function string(t,e){var n,i=t||"";return $.each(e||[],(function(t,e){n=new RegExp("\\{"+t.toString()+"\\}","ig"),i=i.replace(n,e)})),i}function init_tooltip(t){var e=!0===("boolean"==typeof t&&t)&&"mouse";$("[title]").qtip({position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1}),$("div.tooltiptext").each((function(){$(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:$(this).clone()},position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden}})}))}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")},String.prototype.left=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.slice(0,e):""}return this.substring(0,t)},String.prototype.right=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.substring(this.length-e):""}return this.substring(this.length-t)},Array.prototype.move=function(t,e){if(e>=this.length)for(var n=e-this.length;1+n--;)this.push(void 0);return this.splice(e,0,this.splice(t,1)[0]),this},function(t){t.fn.appendToIf=function(e,n){var i=t(this),o="function"==typeof n?n(i):n;return!0===("boolean"!=typeof o||o)&&i.appendTo(e),i},t.fn.appendIf=function(e,n){var i=t(this),o="function"==typeof n?n(i):n;return!0===("boolean"!=typeof o||o)&&i.append(e),i},t.fn.rwText=function(e,n,i){var o=t(this).empty();i=t.extend({wrap:!0},i);var r=!0===Array.isArray(e)?e:(null==e?"":String(e)).split("\n");return t.each(r,(function(t,e){""!==(e||"")&&(t>0&&o.append($$.br()),o.append(!0===i.wrap?$$.s(e):e))})),n&&o.attr("title",n),o},t.fn.loadSel=function(e,n,i){if("SELECT"===t(this).prop("tagName").toUpperCase()){var o=t(this);$ocms.postXT.call(this,{url:e,data:n||{},success:function(e){t.each(e,(function(){o.append($$.opt(e.value,e.text))}))},complete:function(){o.ldng(0),"function"==typeof i&&i.call(o)}})}},t.fn.emptyWithEditors=function(e){var n=t(this);return n.find(":input.tinymce").each((function(e,n){try{var i=tinymce.get(t(n).attr("id"));i&&i.remove()}catch(e){t.noop()}})),n.empty()},t.fn.cssValue=function(t){if(this.length>0){var e=this.css(t)||"";if(""===e)return 0;var n=/(^[\d\.]*)(\D{1,3}$)/gi.exec(e);return null!==n?"rem"===n[2]?$ocms.rpx(parseFloat(n[1])):parseFloat(n[1]):!1===isNaN(e)?parseFloat(e):0}return 0},t.fn.veryInnerHeight=function(){let e=e=>t(this).cssValue(e);return t(this).innerHeight()-e("padding-top")-e("padding-bottom")},t.fn.veryInnerWidth=function(){let e=e=>t(this).cssValue(e);return t(this).innerWidth()-e("padding-left")-e("padding-right")},t.fn.marginWidth=function(){let e=e=>t(this).cssValue(e);return e("margin-left")+e("margin-right")},t.fn.marginHeight=function(){let e=e=>t(this).cssValue(e);return e("margin-top")+e("margin-bottom")},t.inArrayRegEx=function(e,n,i){var o="regexp"===t.type(e)?e:new RegExp(e);if(!n)return-1;for(var r=i=i||0;r7){i=e.split(","),o=(n||(t<0?"rgb(0,0,0)":"rgb(255,255,255)")).split(",");var c=a(i[0].slice(4)),l=a(i[1]),u=a(i[2]);return"rgb("+(s((a(o[0].slice(4))-c)*r)+c)+","+(s((a(o[1])-l)*r)+l)+","+(s((a(o[2])-u)*r)+u)+")"}var d=(i=a(e.slice(1),16))>>16,h=i>>8&255,p=255&i;return"#"+(16777216+65536*(s((((o=a((n||(t<0?"#000000":"#FFFFFF")).slice(1),16))>>16)-d)*r)+d)+256*(s(((o>>8&255)-h)*r)+h)+(s(((255&o)-p)*r)+p)).toString(16).slice(1)},t.fn.IN=function(e){return t(this).fadeIn(400,e),t(this)},t.fn.OUT=function(e){return t(this).fadeOut(400,e),t(this)},t.fn.tooltip=function(e,n){var i=!0===("boolean"==typeof e&&e)&&"mouse",o="boolean"==typeof n&&n,r=t(this);return r.each((function(){var e=o?t(this).find(".tooltiptext"):t(this).children(".tooltiptext");t(e).length>0?e.each((function(){var e=t(this);t(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:e.clone()},position:{target:i,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},show:{effect:!1},hide:{effect:!1}}),e.remove()})):t(this).qtip({position:{target:i,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1})})),r},t.fn.rC=function(e){return t(this).removeClass(e)},t.fn.aC=function(e){return t(this).addClass(e)},t.fn.tC=function(e,n){return t(this).toggleClass(e,n)}}(jQuery),function(t){t.fn.ocmsmenu=function(e,n){var i=t(this);return $ocms.menu.call(i,e,n),i},t.fn.activatemenu=function(){var e=t(this).filter("nav");return e.find("a").not(".on").addClass("on").click($nuf),e.find(".nav-btn").not(".on").addClass("on").click((function(e){e.stopPropagation();var n=t(this);t(n.attr("data-target")).tC(n.attr("data-toggle"))})),e}}(jQuery);class ObjectArray extends Array{isEmpty(){return 0===this[0].length}static get[Symbol.species](){return Array}filter(t){return"function"==typeof t?new ObjectArray(this[0].filter(t)):this}remove(t){if("function"!=typeof t)return this;{let e=this[0].findIndex(t);for(;e>-1;)this[0].splice(e),e=this[0].findIndex(t)}}sortBy(t){return"function"==typeof t&&this[0].sort(t),this}sortString(t){return this[0].sort(((e,n)=>{let i=(e[t]||"").toString().toUpperCase(),o=(n[t]||"").toString().toUpperCase();return console.debug(i.localeCompare(o)),i.localeCompare(o)})),this}sortNum(t){return this[0].sort(((e,n)=>{let i=e[t],o=n[t];return!0===isNaN(o)&&!1===isNaN(i)||io?1:0})),this}sum(t){return this[0].reduce(((e,n)=>e+(!0===isNaN(n[t])?0:n[t])),0)}groupBy(t){return this[0].reduce((function(e,n){let i=n[t];return e[i]||(e[i]=[]),e[i].push(n),e}),{})}each(t){if("function"==typeof t){let e=!1;this[0].forEach(((n,i,o)=>{if(!1===e){let r=t(n,i,o);"boolean"==typeof r&&!1===r&&(e=!0)}}))}}get toArray(){return this[0]}}class NumArray extends Array{sum(){return this.reduce(((t,e)=>t+e))}first(){return this[0]}last(){return this[this.length-1]}average(){return this.sum()/this.length}range(){let t=this.map((t=>t)).sort();return{min:t[0],max:t[this.length-1]}}static get[Symbol.species](){return Array}}$ocms.ocmsmenu=[{lbl:"",id:"m_home",ico:"glyphicon glyphicon-home",fnc:"init:home"},{fnc:"separator"}],function(t){t.multline=function(t){let e=t.split("\n"),n=$$.d();return $.each(e,((t,e)=>{n.append($$.s(e))})),n.html()},t.tooltip_hidden=function(t,e){$(this).remove(),e.rendered=!1},t.isJSONDateString=function(t){return"string"==typeof t&&/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(t)},t.failure=function(e){11110===(e.internalCode||-1)?t.login.dlg():alert($t.f1+"\n"+(e.internalText||""))},t.getScript=function(e,n){var i=[],o=[],r=function(t){return"string"==typeof t&&""!==(t||"")},s=function(t,e){!0===bool(e.condition,!0)&&(""!==(e.script||"")&&o.push({url:e.script,module:e.module||""}),!0===r(e.css||"")?i.push(e.css):!0===Array.isArray(e.css)&&Array.prototype.push.apply(i,e.css.filter(r)))};!0===r(e||"")?o.push(e):!0===Array.isArray(e)?$.each(e,s):"object"==typeof e&&""!==(e.script||"")&&s(0,e);let a=[];$.each(i,(function(t,e){""!==(e||"")&&a.push(loadCSS(e))}));let c=o.map((function(e,n){let i=e.url,r=e.module||"";if(""===r){let t=new Promise((function(t,e){try{!async function(){$.ajax({url:i,dataType:"script",success:function(){t(o)},error:function(){e(o)},timeout:3e4})}()}catch(t){console.debug(t.message+"%o",t)}}));return t}return t.loadmodule(r,i,e.alias)}));Promise.all(c).then(n)},t.loadmodule=function(e,n,i){let o=new Promise((function(o,r){!async function(){try{let s=(n.startsWith("/")||n.startsWith(".")?"":"/")+n;import(s).then((n=>{t[e]=n[i||"default"],o(e)})).catch((t=>{console.debug(t.message+"%o",t),r(e)}))}catch(t){console.debug(t.message+"%o",t)}}()}));return o},t.ocms_auth=function(e,n,i,o){!1===$.isPlainObject(t.auth.modules)&&(t.auth.modules={});var r=0;t.auth.modules[e+(i||"")]?((r=t.auth.modules[e+(i||"")])<2&&(i||"")===auth.guid&&(r=2),r>=(n||0)&&o(false)):t.postXT({url:t.url("auth"),data:{module:e,person_guid:i||""},success:function(s){r=s[e],t.auth.modules[e+(i||"")]=r,r<2&&(i||"")===t.auth.person_guid&&(r=2),r>=(n||0)&&o(false)},error:function(e){t.failure.call(this,e)}})},t.auth.locale="de",t.ocms_prepauth=function(e,n,i){t.postXT({url:t.url("auth"),data:{fn:"csv",modules:e,person_guid:n||""},success:function(e){t.ocms_regauth(e)},error:function(e){t.failure.call(this,e)},complete:function(){i()}})},t.ocms_regauth=function(t){$.each(t||{},(function(t,e){auth.modules[t]=parseInt(e)}))},t.init=function(e){var n="string"==typeof e?e:(e.data||{}).fn||"";""!==n&&("home"===n?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),t.ov.call($("#contentframe"))):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),t.postXT({url:t.url(n+"/auth"),success:function(e){void 0===t[n]&&(t[n]={}),t[n].auth=e,e.manage>0&&t.getScript({module:n,script:["web/imdl",n,t.auth.locale||"de","js"].join("."),css:["web/imdl",n,"css"].join("."),condition:"function"!=typeof t[n].init2},(function(){t[n].init2()}))},error:function(){$("#contentframe").empty()}})))},t.menuarray=function(t){this.array=[],this.sep=function(){this.length>0&&"separator"!==this.array[array.length-1].fnc&&this.push({fnc:"separator"})},this.push=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.push.apply(this.array,t):"object"==typeof t&&this.array.push(t),t)},this.unshift=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.unshift.apply(this.array,t):"object"==typeof t&&this.array.unshift(t),t)},this.push(t)},t.menu=function(e,n){e=e||[];var i=$(this).removeClass("vis");if(!0===bool(n,!0)&&!1===i.is("#mainmenu")&&i.empty(),!1===bool(n,!1)&&i.is("#sidebar,#topbar")&&(e.unshift({id:"sbctrl",glyph:"glyphicon-th-list",aclass:"fbtn",fnc:function(){$lf()}}),$lf(0)),0===(e||[]).length)i.empty().addClass("hd");else{i.removeClass("hd");var o=!0===i.is("nav")?i:i.children("nav");1!==o.length&&(o=$("").tC("nv",i.is("#sidebar")).tC("ctxt",i.is("#topbar")).appendTo(i));var r,s=$$.ul().appendTo(o),a=function(t,e){var n=$(this).addClass("dropdown submenu");t.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"}),""!==(e.ico||"")&&t.prepend($$.sc("ico "+e.ico));var i=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(n);$.each(e.itm||[],(function(t,e){r.call(i,e)}))},c=function(t){$(this).tC("disabled","boolean"==typeof t.disabled?t.disabled:"string"==typeof t.disabled&&"subs"===t.disabled&&0===(t.itm||[]).length)};r=function(e){var n,i=$$.li({id:e.id}).attr(e.attr||{}).addClass(e.lclass).appendTo($(this)),o="string"==typeof e.fnc&&""!==e.fnc?e.fnc.split(":")[0]:"";""!==o&&"init"!==o?i.attr("role",o).appendIf($$.s(e.lbl),""!==ne(e.lbl)):(n=$$.a({class:"on",role:"button"}).addClass(e.aclass).appendTo(i).append($$.s(e.lbl)),c.call(n,e),(e.itm||[]).length>0&&a.call(i,n,e),n.click($nuf),"function"==typeof e.fnc?n.click(e.data||{},e.fnc):"init"===o&&n.click($.extend({},e.data||{},{fn:e.fnc.split(":")[1]}),t.init))},$.each(e,(function(e,n){var i,o=$$.li({id:n.id}).attr(n.attr||{}).addClass(n.lclass),a="string"==typeof n.fnc&&""!==n.fnc?n.fnc.split(":")[0]:"";if(""!==a&&"init"!==a)o.attr("role",a).appendIf($$.s(n.lbl),""!==ne(n.lbl));else{if(i=$$.a({class:"on",role:"button"}).addClass(n.aclass).appendTo(o),c.call(i,n),""!==(n.lbl||"")&&i.append($$.s(n.lbl)),""!==(n.ico||"")&&i.prepend($$.sc("ico "+n.ico)),""!==(n.glyph||"")&&i.prepend($$.sc("glyphicon "+n.glyph)),(n.itm||[]).length>0){o.addClass("dropdown"),i.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"});var l=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(o);$.each(n.itm||[],(function(t,e){r.call(l,e)}))}(n.sel||[]).length>0||(i.click($nuf),"function"==typeof n.fnc?i.click(n.data||{},n.fnc):"init"===a&&i.click($.extend({},n.data||{},{fn:n.fnc.split(":")[1]}),t.init))}o.appendTo(s)})),o.activatemenu()}},t.easytbl=(t,e)=>{e=e||{};let n=$$.tbl().addClass(e.class).css("border-collapse","collapse"),i=($$.tbody(n),!0===bool(e.frame,!1)?{padding:"5px",border:"1px solid #727272"}:{});if(!0===Array.isArray(e.header)){let t=$$.thead(n);$.each(e.header,((n,o)=>$$.th(t).css(e.cellcss||i).rwText(o)))}else if(!0===bool(e.header,!1)&&(t||[]).length>0){let o=$$.thead(n);$.each(Object.keys(t[0]),((t,n)=>$$.th(o).css(e.cellcss||i).rwText(n)))}return $.each(t||[],((t,o)=>{let r=$$.tr();$.each(o,((t,n)=>{n=n||"";let o=$$.td(r).css(e.cellcss||i);n instanceof jQuery?o.append(n):"string"==typeof n&&("<"===n.substring(0,1)?o.append(n):o.text(n))})),n.append(r)})),n},t.dlgtbl=(e,n,i)=>{i=i||{};let o=t.easytbl(e,i);t.dlg(o,$.extend({title:n},i))},t.dlg=function(t,n){n=n||{};let i=$("body > .modal").length>0,o=t=>typeof n[t],r=t=>"function"===o(t);if(!0===bool(n.exclusive,!0)&&!0===i)return void alert($t.dbldlg||"Es ist bereits ein Dialog geöffnet");let s=$$.dc("modal",$("body")),a=$$.dc("modal-dialog",s);!1===isNaN(n.zindex)?s.css("zIndex",n.zindex):!0===i&&s.css("zIndex",parseInt($("body > .modal:last").cssValue("zIndex"))+200),!1===isNaN(n.zindex_min)&&s.cssValue("zIndex")').appendTo(d)),""!==ne(n.title)&&(c=$$.dc("modal-header",d),$("

      ").text(n.title).appendTo(c));let p=$$.dc("modal-body",d),f=$$.dc("modal-footer",d);t instanceof jQuery==!0&&p.append(t);let m=function(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation(),a.removeClass("in"),!0===r("closing")&&n.closing.call(d),p.hide().emptyWithEditors(),s.remove(),!0===r("close")&&n.close.call(d)};if(d.find(":input[required]").length>0&&($$.dc("note_required",f).append($$.sc("ind_required","*")).append($$.s($t.t1||"Eingabe erforderlich")),$$.dc("note_invalid",f).append($$.s($t.t2||"Bitte überprüfen Sie Ihre Eingaben im Formular."))),!0===r("cancel")){$$.bbtn(n.cancelbutton||"Abbrechen","cancel").attr({type:"button",role:"cancel"}).appendTo(f).click((function(t){n.cancel.call(d,t);t.stopPropagation(),m()}))}if(!0===r("confirm")){let t=$$.bbtn(n.button||"OK","confirm").attr({type:!0===bool(n.form,!1)?"submit":"button",role:"confirm"}).appendTo(f);!0===h?(d.submit((function(t){try{n.confirm.call(d,t)}finally{t.preventDefault()}return!1})),d.on("modal_submit",(function(){n.confirm.call(d,e)}))):(t.click((function(t){n.confirm.call(d,t);t.stopPropagation()})),d.on("modal_submit",(function(){t.click()})))}else!0===h&&d.submit((function(t){return t.preventDefault(),!1}));return d.on("modal_close",(function(){m()})),l.click(m),!0===r("opening")&&n.opening.call(d),a.addClass("in"),ne(n.mode).indexOf("maxbody")>-1&&p.css("min-height",(u.height()-c.outerHeight()-f.outerHeight()).toString()+"px"),!0===r("open")&&n.open.call(d),{hd:c,bdy:p,ft:f,ct:u,dlg:a,c:d}},t.mform=function(e){let n=$$.dc("form-body"),i=Array.isArray(e)?e:e instanceof fields_definition?e.fields:[];return $.each(i||[],(function(e,i){let o=i.type||"";if("ignore"===o)return!0;let r=$$.dc("form-group",n),s=i.id||"dlg_"+(i.name||"")+("html"===i.type?"_"+(65536*(1+Math.random())||0).toString(16).substr(9):""),a=$$.lbl(i.label||i.name,{for:s}).appendTo($$.dc("form-itm",r)),c=$$.dc("form-itm",r),l=$$.i({id:s,name:i.name,placeholder:i.placeholder,type:i.type});switch(o){case"email":i.pattern=ne(i.pattern,"[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$");break;case"url":i.pattern=ne(i.pattern,"https?://.+");break;case"number":i.pattern=ne(i.pattern,"[-+]?[0-9]*[.,]?[0-9]*"),l.attr("step",i.precision||"any"),l.attr("data-format","float");break;case"integer":case"int":i.pattern=ne(i.pattern,"[-+]?[0-9]*"),l.attr("type","number"),l.attr("data-format","integer");break;case"date":if(""!==ne(i.pattern,$t.datepattern)&&(i.pattern=ne(i.pattern,"("+$t.datepattern+")|([0-9]{4}.(0[1-9]|1[012]).(0[1-9]|1[0-9]|2[0-9]|3[01]))")),""!==ne(i.placeholder,$t.dateplaceholder)&&l.attr("placeholder",ne(i.placeholder,$t.dateplaceholder)),"string"==typeof i.value){var u=i.value.substr(0,10);i.value="date"!==l.prop("type")?fdt(u+"T00:00:00",ne(i.dateformat,$t.dateformat)):u}l.attr("data-format","date:"+ne(i.dateformat,$t.dateformat)+";yyyy-MM-dd");break;case"datetime":l.attr("type","datetime-local"),""!==ne(i.pattern,$t.datetimepattern)&&(i.pattern=ne(i.pattern,"("+$t.datetimepattern+")|([0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])\\s([0-5][0-9]):([0-5][0-9]))")),""!==ne(i.placeholder,$t.datetimeplaceholder)&&l.attr("placeholder",ne(i.placeholder,$t.datetimeplaceholder)),"string"==typeof i.value&&"T"===i.value.substr(10,1)&&(i.value="datetime"!==l.prop("type").substr(0,8)?fdt(i.value,ne(i.datetimeformat,$t.datetimeformat)):i.value),l.attr("data-format","datetime:"+ne(i.datetimeformat,$t.datetimeformat)+";yyyy-MM-dd HH:mm:ss");break;case"hidden":r.addClass("hd");break;case"html":case"text":l=$$.txt({id:s,name:i.name,placeholder:i.placeholder,type:i.type}),l.tC("tinymce","html"===i.type);break;case"bool":case"boolean":i.url=[{value:"true",label:($t||{}).true||"Yes"},{value:"false",label:($t||{}).false||"No"}],"boolean"==typeof i.value&&(i.value=i.value?"true":"false");case"select":l=$$.sel({id:s,name:i.name,type:i.type}),!1===bool(i.required,!1)&&$$.eOpt().appendTo(l);try{var d=function(t){!0===Array.isArray(t)&&$.each(t,(function(t,e){"string"==typeof e?$$.opt(e,e).appendTo(l):!0===Array.isArray(e)?$$.opt(e[0],e[1]).appendTo(l):"object"==typeof e&&$$.opt(e.value,e.label||e.text).appendTo(l)}))};!0===Array.isArray(i.url)?d(i.url):"function"==typeof i.url?i.url.call(l):"string"==typeof i.url&&t.postXT({url:i.url,success:d})}catch(t){$.noop()}break;default:""!==ne(i["max-length"])&&l.attr("max-length",i["max-length"])}""!==ne(i.pattern)&&l.attr("pattern",i.pattern),l.val(i.value).change(),l.change((function(){$(this)[0].setCustomValidity("")})),l.addClass("form-control").prop("required",bool(i.required,!1)).prop("readonly",bool(i.readonly,!1)).appendTo(c),!0===bool(i.required,!1)&&a.append($$.sc("ind_required","*")),"object"==typeof i.attr&&l.attr(i.attr),"object"==typeof i.prop&&l.prop(i.prop),"string"==typeof i.class&&l.addClass(i.class),"function"==typeof i.change&&(l.change(i.change),!0===bool(i.applychange,!1)&&void 0!==i.value&&l.change()),""!==(i.note||"")&&$$.dc("form-note",c).rwText(i.note),"function"==typeof i.complete&&i.complete.call(l)})),n},t.initMCE=function(t,e){t=$(t),e=e||{};try{let n={target:t[0],inline:!1,width:e.width||"100%",statusbar:!1,document_base_url:window.location.origin+"/",content_style:"ph:before {content: '«'; color: #BBB; font-style:italic; } ph:after {content: '»'; color: #BBB; font-style:italic; } ph { color: #AAA; font-style:italic; }",relative_urls:!1,remove_script_host:!1};!0===bool(e.hidemenu,!1)&&(n.menubar=!1,n.menu={}),!0===bool(e.hidetoolbar,!1)&&(n.toolbar=!1),$.extend(n,e||{}),tinymce.init(n)}catch(t){alert(t.message)}},t.dlgform=function(e,n){n=n||{};let i,o=$$.dc("frm").append(t.mform(e||[]).addClass("stacked"));n.addcontent instanceof jQuery&&o.append(n.addcontent),"function"==typeof n.submit?i=n.submit:"function"==typeof n.success&&(i=function(e){var i=$(this).ldng(1),o=$.extend({loginaccount:t.auth.account||""},i.serializeObject(bool(n.checkvalidity,!0),{typedvalues:bool(n.typedvalues,!1)}));""!==(n.url||"")?t.postXT({url:n.url,data:o,success:function(t){n.success.call(this,t),i.trigger("modal_close")},error:function(){alert($t.l17)},complete:function(){i.ldng(0)},timeout:6e4}):(n.success.call(this,o),i.trigger("modal_close"))});let r={form:!0,title:n.title||"",button:n.button||$t.submit,confirm:i,size:n.size||[500,600],open:function(){let e=$(this).find(".tinymce");e.length>0&&t.initMCE(e,n.tinymce||{})}};return t.dlg.call(this,o,r)},t.login.dlg=function(e){e=e||{};let n=[{name:"userinfo",label:$t.l1,type:"string",value:t.auth.login,change:t.login.uichange,required:!0},{name:"userlogin",type:"hidden",required:!0,value:t.auth.login},{name:"username",type:"string",label:$t.l4,required:!0,readonly:!0,placeholder:$t.l5,value:t.auth.fullname_rev},{name:"userpass",type:"password",label:$t.l3,required:!0,placeholder:$t.l3}];""===(t.auth.account||"")&&n.unshift({id:"dlg_loginaccount",name:"loginaccount",type:"string",required:!0,value:t.auth.account});let i=$$.dc("frm").append(t.mform(n).addClass("stacked")),o=t.dlg.call(this,i,{form:!0,title:$t.l0,button:$t.submit,confirm:function(n){var i=$(this).ldng(1),o=$.extend({loginaccount:t.auth.account||""},i.serializeObject());t.postXT({url:"/vt/login",data:o,success:function(n){""!==((n||{}).login||"")&&(i.trigger("modal_close"),t.auth=n,"object"==typeof e.ajo&&(e.ajo.islogin,$.ajax(e.ajo)))},error:function(){alert($t.l17)},complete:function(){i.ldng(0)},timeout:6e4})},size:[500,600]}),r=$$.dc("modal-content").css("height","auto").attr("novalidate","true").append($$.dc("modal-header").appendIf($("

      ").text(t.auth.accountname),""!==(t.auth.accountname||"")).append($("

      Vereinsmanager

      ")));o.dlg.prepend(r)},t.addNoEntryInfo=function(t){$(this).append($$.dc("noentryinfo").text(t||$t.t11))}}($ocms),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),function(t,e){var n,i;"object"==typeof window&&(window[t]=(n=function(t){var e=window,n=document.body,i=document.documentElement,o=Math.max(0,e.pageXOffset||i.scrollLeft||n.scrollLeft||0)-(i.clientLeft||0),r=Math.max(0,e.pageYOffset||i.scrollTop||n.scrollTop||0)-(i.clientTop||0);return{x:t?Math.max(0,t.pageX||t.clientX||0)-o:0,y:t?Math.max(0,t.pageY||t.clientY||0)-r:0}},(i=function(t,e){t&&t instanceof Element&&(this._container=t,this._options=e||{},this._clickItem=null,this._dragItem=null,this._showDragItem="boolean"!=typeof this._options.dragItem||!1!==this._options.dragItem,this._hovItem=null,this._sortLists=[],this._click={},this._dragging=!1,this._dragHandleClass=this._options.dragHandleClass||"",this._parentident=this._options.parentident||"",this._swapdone="function"==typeof this._options.swapdone?this._options.swapdone:null,this._onend="function"==typeof this._options.onend?this._options.onend:null,this._container.setAttribute("data-is-sortable",1),this._container.classList.add("sortable"),this._container.style.position="static",window.addEventListener("mousedown",this._onPress.bind(this),!0),window.addEventListener("touchstart",this._onPress.bind(this),!0),window.addEventListener("mouseup",this._onRelease.bind(this),!0),window.addEventListener("touchend",this._onRelease.bind(this),!0),window.addEventListener("mousemove",this._onMove.bind(this),!0),window.addEventListener("touchmove",this._onMove.bind(this),!0))}).prototype={constructor:i,toArray:function(t){t=t||"id";for(var e=[],n="",i=0;ii.left&&ei.top&&n-1)&&e.className.indexOf("nosort")<0)&&(t.preventDefault(),this._dragging=!0,this._click=n(t),this._makeDragItem(e),this._onMove(t),!0)}t&&!1===e.call(this,t.target)&&""!==this._parentident&&t.target.closest(this._parentident)&&e.call(this,t.target.closest(this._parentident))},_onRelease:function(t){var e=!0===this._dragging&&null!==this._clickItem;this._dragging=!1,this._trashDragItem(),e&&"function"==typeof this._onend&&this._onend()},_onMove:function(t){if(this._dragItem&&this._dragging){t.preventDefault();var e=n(t),i=this._container;!0===this._showDragItem&&this._moveItem(this._dragItem,e.x-this._click.x,e.y-this._click.y);for(var o=0;o0?a.mousedown(c).addClass("dctrl"):s.mousedown(c).addClass("dctrl"),t(this)}}(jQuery),$(document).ready((function(){$("html").click((function(t){$nuf()})),$("#listframe").click((function(t){t.stopPropagation(),$nuf()})),$("#mainmenu").ocmsmenu($ocms.ocmsmenu),$("#mainmenu").activatemenu()})),$.extend($t,{m_inv:"Rechnungen",m_req:"Aufträge",m_rep:"Berichte",m_todo:"ToDos",m_bcd:"BankBuchungen",rsp:"Passwort ändern",pnm:"Die Passwörter stimmen nicht überein",cps:"Das neue Passwort wurde gespeichert.",pwr:"Bitte wählen Sie ein starkes Passwort (min 8 Zeichen, davon jeweils min 2 Zahlen, kleine und große Buchstaben, Sonderzeichen sind optional).",smsc:"Sie beötigen für diese Funktion einen SMS-Code.\nSoll dieser nun versandt werden?",wdc:"Doppelt klicken, um die Box zu aktualisieren.",wdg:{}}),$t.rspf={sms:"Der SMS-Code konnte nicht bestätigt werden",valid:"Das alte Passwort ist nicht korrekt",requirements:"Das Passwort entspricht nicht den Anforderungen.\n"+$t.pwr},$fd={rsp:new fields_definition("","",[{name:"opw",label:"aktuelles Passwort",type:"password",required:!0,attr:{"auto-complete":"current-password"}},{name:"npw",label:"neues Passwort",type:"password",required:!0,pattern:"(.{6,})",attr:{"auto-complete":"new-password"}},{name:"npwc",label:"neues Passwort (Bestätigung)",type:"password",required:!0,attr:{"auto-complete":"new-password"},note:$t.pwr},{name:"code",label:"SMS-Code",type:"string",required:!0,attr:{"auto-complete":"one-time-code"}}])},$ocms.init=function(t){var e="string"==typeof t?t:(t.data||{}).fn||"";""!==e&&("home"===e?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),$fis.ov()):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),$ocms.postXT({url:$ocms.url(e+"/auth"),success:function(t){void 0===$ocms[e]&&($ocms[e]={}),$ocms[e].auth=t,t.manage>0&&$ocms.getScript({module:e,script:["/web/fis",e,$ocms.auth.locale||"de","js"].join("."),css:["/web/fis",e,"css"].join("."),condition:"function"!=typeof $ocms[e].init2},(function(){$ocms[e].init2()}))},error:function(){$("#contentframe").empty()}})))};var $fis={auth:{},db:function(){$("#mainmenu_activemodule").text($t.ov);let t=$(this).empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var i=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$ocms.wdg.call(i,{wdg:n})}))},loading:e})},ValidateEmail:function(t){return!!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)},cf:t=>{let e=$("#contentframe");return!0===bool(t,!1)&&e.empty().rC("hd"),e},lf:t=>{let e=$("#listframe");return!0===bool(t,!1)&&e.empty().aC("hd").rC("fix"),e},frm_edit:function(t){let e=$fis.cf(!1),n=e.children(".cfrm"),i=e.children(".edit_frm");return n.length<1?n=$$.dc("cfrm hd").prependTo(e):!0===bool(t,!1)&&n.empty(),i.length<1&&(i=$$.dc("edit_frm").insertAfter(n)),i.empty()},frm_list:function(t,e){let n=$fis.cf(!1),i=n.children(".cfrm"),o=n.children(".list_frm");return i.length<1?i=$$.dc("cfrm hd").prependTo(n):!0===bool(t,!1)&&i.empty(),!0===bool(e,!1)&&n.children(".edit_frm").remove(),o.length<1&&(o=$$.dc("list_frm").appendTo(n)),o.empty()},lfm:()=>{let t=$fis.lf(!1),e=t.children(".lfrm");return e.length<1&&(e=$$.dc("lfrm").prependTo(t)),e},getAuth:(t,e)=>new Promise(((n,i)=>{$fis.auth[t]&&!1===bool(e,!1)?n($fis.auth[t]||-1):$ocms.postXT({url:$ocms.url("auth"),data:{module:t},success:e=>{$fis.auth[t]=e.auth||-1,n($fis.auth[t]||-1)},error:()=>{i()}})})),prepAuth:t=>new Promise(((e,n)=>{$ocms.postXT({url:$ocms.url("auth"),data:{module:t,array:1},success:t=>{$.extend($fis.auth,t||{})},complete:()=>{e()}})})),isAuth:(t,e)=>($fis.auth[t]||-1)>=(e||1),resetPass:function(t,e){confirm($t.smsc)&&($ocms.postXT({url:$ocms.url("account/sms"),data:{fn:"pwc"}}),$ocms.dlgform($fd.rsp.clone(),{title:$t.rsp||"",submit:function(t){var e=$(this).ldng(1),n=$.extend({loginaccount:$ocms.auth.account||""},e.serializeObject(!0,{typedvalues:!0}));(n.npw||"")!==(n.npwc||"")?e.find('input[name="npw"]:first')[0].setCustomValidity($t.pnm):$ocms.postXT({url:$ocms.url("account/changepassword"),data:n,success:function(t){alert($t.cps),e.trigger("modal_close")},error:function(t){alert($t.rspf[t.getResponseHeader("x-ocms-std")])},complete:function(){e.ldng(0)},timeout:6e4})}}))},wdg:function(t){let e=$(this).empty();$ocms.postXT({url:$ocms.url("wdg/one"),data:{short_name:t.wdg},timeout:9e4,success:function(n,i,o){let r=t.wdg,s=n[r];if(!s)return void e.ldng(0);let a=$.inArrayRegEx("dblwidth",s.rendering_options)>-1,c=$.inArrayRegEx("tiny",s.rendering_options)>-1;e.toggleClass("dbl",a&&!c).toggleClass("tny",c);$$.dc("wdg_hd",e,{title:ne(s.description,$t.wdc)}).toggleClass("dbl",a).text(ne(s.name,t.wdg)).dblclick((function(t){t.stopPropagation(),$fis.wdg.call(e,{wdg:r})}));let l=$$.dc("wdg_cnt",e).toggleClass("dbl",a).hide(),u=$.inArrayRegEx("bgcolor",s.rendering_options);switch(u>-1&&l.css("backgroundColor",s.rendering_options[u].toString().right(":")),s.type){case"table":var d=$$.tblset({},l),h=$$.tr().appendTo(d.hd),p=$t.wdg[r.indexOf("wdg_ev_")>=0?"wdg_ev_":r]||{};$.each(s.columns,(function(t,e){var n=p[e]?p[e].label:e;$$.th().text(n).appendTo(h)})),$.each(s.data,(function(t,e){var n=$$.tr().appendTo(d.bdy);$.each(s.columns,(function(t,i){var o=$$.td().appendTo(n);e[i]instanceof Date||!0===$ocms.isJSONDateString(e[i])?o.text(fdt(e[i],$t.dateformat)):o.rwText(e[i])}))})),$.inArray("firstrow_bold",s.rendering_options)>-1&&h.nextAll("tr:first").css("font-weight","bold");break;case"ind":$$.dc("ind",l).addClass("sts_"+(s.data.status||"")).append([$$.dc("ind").text(s.data.value),$$.lbl(s.data.label)]);break;case"image_url":l.css("background","url('"+s.url+"') no-repeat center center transparent");break;case"image_base64":l.css("background","url('data:image/png;base64,"+s.image+"') no-repeat center center transparent");break;case"html":if(l.html(s.html),$.inArray("reload_10min",s.rendering_options)>-1){var f=l.find("iframe");setTimeout((function(){f.attr("src",(function(t,e){return e}))}),6e5)}}$.inArray("reload_30min",s.rendering_options)>-1&&"html"!==s.type&&setTimeout((function(){$fis.wdg.call(e,{wdg:r})}),18e5),l.slideDown(150)},error:function(t){e.slideUp(150),$fis.failure.call(this,t)},complete:function(){e.ldng(0)}})},ov:function(){$fis.lf(!0);let t=$("#contentframe").empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var i=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$fis.wdg.call(i,{wdg:n})}))},loading:e})}};$fis.notifications={connection:null,init:function(){"undefined"!=typeof signalR&&null===this.connection&&$ocms.auth.useraccount_id&&(this.ensureFrame(),this.connection=(new signalR.HubConnectionBuilder).withUrl("/notifications").withAutomaticReconnect().build(),this.connection.on("notification",(t=>{this.push(t)})),this.connection.onclose((()=>{console.warn("Notification connection closed; retrying in 5s."),this.connection=null,setTimeout((()=>this.init()),5e3)})),this.start())},start:function(){this.connection.start().catch((t=>{console.warn("Notification connection failed to start; retrying in 5s.",t),this.connection=null,setTimeout((()=>this.init()),5e3)}))},ensureFrame:function(){$("#notification_frame").length<1&&$("
      ",{id:"notification_frame"}).appendTo($("footer:first").length?"footer:first":"body")},push:function(t){this.ensureFrame(),t=t||{};let e=$("
      ",{class:"notification_item"}).addClass((t.severity||"info").toLowerCase()).append($("
      '),n=e.find(".form-body"),i=null;e.find("form").submit((function(t){t.preventDefault();var o=$(this).serializeObject(!0),r=null===i,s=r?"spwc":"spw";return $ocms.postXT.call(this,{url:$ocms.url(s),data:o,complete:function(){r?(n.append('
      Ihnen wurde ein Code per SMS zugesandt.
      Bitte tragen Sie den hier ein:
      '),i=$('
      ').appendTo(n)):(alert($t.l13),e.remove())},error:()=>{}}),!1})),e.find(".modal-close").click((function(){e.remove()}));var o=[];$.each($t.l7a.split("\n"),((t,e)=>{Array.prototype.push.apply(o,[$("
      "),$("").text(e)])})),e.find(".modal-note").append($('').text($t.alert)).append(o),e.appendTo("body"),setTimeout((function(){$(".modal").find('input[name="lastname"]').focus()}),600)}};var $$={s:function(t){return $("").text(t)},br:function(){return $("
      ")},sc:function(t,e){return $("").addClass(t).text(e)},td:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},th:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t?n.attr(t):"string"==typeof t&&n.text(t),"object"==typeof e?n.attr(e):"string"==typeof e&&n.text(e),n},tdc:function(t,e,n){return $$.td(e,n).addClass(t)},td2:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},td3:function(t){var e=$('');return"string"===$.type(t)?e.text(t):t instanceof jQuery?e.append(t):"function"==typeof t?t.call(e):e.html(" "),e},tdtr:function(t,e){var n=$$.tr().appendTo(e);return t instanceof jQuery==!0||"string"==typeof t?t.appendTo($$.td().appendTo(n)):!0===Array.isArray(t)&&$.each(t,(function(t,e){$(e).appendTo($$.td().appendTo(n))})),n},tr:function(t,e){var n=$("");return t instanceof jQuery==!0?n.appendTo(t):"object"==typeof t&&n.attr(t),"object"==typeof e&&n.attr(e),n},trc:function(t,e){var n=$("").addClass(t);return e instanceof jQuery==!0?n.appendTo(e):"object"==typeof e&&n.attr(e),n},d:function(t){return $("
      ").attr(t||{})},dc:function(t,e,n,i){var o=$("
      ").addClass(t);return e instanceof jQuery==!0?o.appendTo(e):"object"==typeof e?o.attr(e):"function"==typeof e?o.click(e):"string"==typeof e&&o.text(e),"string"==typeof n?o.text(n):"object"==typeof n?o.attr(n):"function"==typeof n&&o.click(n),"string"==typeof i?o.text(i):"object"==typeof i?o.attr(i):"function"==typeof i&&o.click(i),o},df:function(t){return $("
       
      ").attr(t||{})},opt:function(t,e,n){var i=$("");return"string"==typeof t?i.attr("value",t):"object"==typeof t&&i.attr(t),"string"==typeof e?i.text(e):"object"==typeof e&&i.attr(e),"object"==typeof n&&i.attr(n),i},eOpt:function(t){var e=$('');return t&&e.attr("selected","selected"),e},tbl:function(t){return $("
      ").attr(t||{})},tblc:function(t){return $("
      ").addClass(t)},thead:function(t){let e=$("");return t instanceof jQuery&&e.prependTo(t),e},tbody:function(t){let e=$("");return t instanceof jQuery&&e.appendTo(t),e},tblset:function(t,e){let n=$$.tbl(t||{});return e instanceof jQuery&&e.append(n),{tbl:n,hd:$$.thead().appendTo(n),bdy:$$.tbody().appendTo(n)}},i:function(t){return $("").attr(t||{})},img:function(t,e){return $("").attr("src",t).attr(e||{})},sel:function(t){return $("").attr(t||{})},btn:function(t){return $("").attr(t||{})},a:function(t){return $("").attr(t||{})},li:function(t){return $("
    • ").attr(t||{})},ul:function(t){return $("
        ").attr(t||{})},nav:function(t){return $("").attr(t||{})},lbl:function(t,e){var n=$("");return"string"==typeof t&&n.text(t),"object"==typeof t?n.attr(t):"object"==typeof e&&n.attr(e),n},txt:function(t){return $("").attr(t||{})},0:function(t,e){return $("<"+t+">").attr(e||{})},bbtn:function(t,e){return $$.btn({type:"button",class:"btn"}).addClass(e).text(t)},svg:t=>$(document.createElementNS("http://www.w3.org/2000/svg",t))};function getMonday(t){var e=(t=new Date(t)).getDay(),n=t.getDate()-e+(0==e?-6:1);return new Date(t.setDate(n))}function $lf(t){var e=void 0===t?null:"number"==typeof t&&1!==t||"boolean"==typeof cl&&!1===t;return $("#listframe").tC("hd",e).is(".hd")}function $nuf(t){if(t&&t.stopPropagation(),!$(this).is(".disabled")){var e=function(t){t.removeClass("vis").find("li.dropdown").removeClass("open").removeClass("vis").attr("aria-expanded","false")},n=$(this).parent("li.dropdown");if(n.length>0){n.tC("open"),navs=!0===n.is(".open")?"true":"false",n.attr("aria-expanded",navs);var i=n.closest("nav");i.find("li.dropdown").not(n.parentsUntil("nav")).not(n).removeClass("open").attr("aria-expanded","false"),!1===n.is(".open")&&n.find("li.dropdown").removeClass("open").attr("aria-expanded","false"),e($("nav").not(i))}else e($("nav"))}}function $tbr(){return $lf(0),$("#topbar").ocmsmenu([])}function $lfr(){return $("#sidebar").empty(),$("#listframe").removeClass("fix").addClass("hd").empty()}function $cfr(){return $tbr(),$("#contentframe").empty()}function jObj(t,e){let n={};if("{"===(t||"").substr(0,1))try{n=JSON.parse(t)}catch(t){n={}}return n[e]||""}function string(t,e){var n,i=t||"";return $.each(e||[],(function(t,e){n=new RegExp("\\{"+t.toString()+"\\}","ig"),i=i.replace(n,e)})),i}function init_tooltip(t){var e=!0===("boolean"==typeof t&&t)&&"mouse";$("[title]").qtip({position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1}),$("div.tooltiptext").each((function(){$(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:$(this).clone()},position:{target:e,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden}})}))}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")},String.prototype.left=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.slice(0,e):""}return this.substring(0,t)},String.prototype.right=function(t){if("string"===$.type(t)){var e=this.indexOf(t);return e>0?this.substring(this.length-e):""}return this.substring(this.length-t)},Array.prototype.move=function(t,e){if(e>=this.length)for(var n=e-this.length;1+n--;)this.push(void 0);return this.splice(e,0,this.splice(t,1)[0]),this},function(t){t.fn.appendToIf=function(e,n){var i=t(this),o="function"==typeof n?n(i):n;return!0===("boolean"!=typeof o||o)&&i.appendTo(e),i},t.fn.appendIf=function(e,n){var i=t(this),o="function"==typeof n?n(i):n;return!0===("boolean"!=typeof o||o)&&i.append(e),i},t.fn.rwText=function(e,n,i){var o=t(this).empty();i=t.extend({wrap:!0},i);var r=!0===Array.isArray(e)?e:(null==e?"":String(e)).split("\n");return t.each(r,(function(t,e){""!==(e||"")&&(t>0&&o.append($$.br()),o.append(!0===i.wrap?$$.s(e):e))})),n&&o.attr("title",n),o},t.fn.loadSel=function(e,n,i){if("SELECT"===t(this).prop("tagName").toUpperCase()){var o=t(this);$ocms.postXT.call(this,{url:e,data:n||{},success:function(e){t.each(e,(function(){o.append($$.opt(e.value,e.text))}))},complete:function(){o.ldng(0),"function"==typeof i&&i.call(o)}})}},t.fn.emptyWithEditors=function(e){var n=t(this);return n.find(":input.tinymce").each((function(e,n){try{var i=tinymce.get(t(n).attr("id"));i&&i.remove()}catch(e){t.noop()}})),n.empty()},t.fn.cssValue=function(t){if(this.length>0){var e=this.css(t)||"";if(""===e)return 0;var n=/(^[\d\.]*)(\D{1,3}$)/gi.exec(e);return null!==n?"rem"===n[2]?$ocms.rpx(parseFloat(n[1])):parseFloat(n[1]):!1===isNaN(e)?parseFloat(e):0}return 0},t.fn.veryInnerHeight=function(){let e=e=>t(this).cssValue(e);return t(this).innerHeight()-e("padding-top")-e("padding-bottom")},t.fn.veryInnerWidth=function(){let e=e=>t(this).cssValue(e);return t(this).innerWidth()-e("padding-left")-e("padding-right")},t.fn.marginWidth=function(){let e=e=>t(this).cssValue(e);return e("margin-left")+e("margin-right")},t.fn.marginHeight=function(){let e=e=>t(this).cssValue(e);return e("margin-top")+e("margin-bottom")},t.inArrayRegEx=function(e,n,i){var o="regexp"===t.type(e)?e:new RegExp(e);if(!n)return-1;for(var r=i=i||0;r7){i=e.split(","),o=(n||(t<0?"rgb(0,0,0)":"rgb(255,255,255)")).split(",");var c=a(i[0].slice(4)),l=a(i[1]),u=a(i[2]);return"rgb("+(s((a(o[0].slice(4))-c)*r)+c)+","+(s((a(o[1])-l)*r)+l)+","+(s((a(o[2])-u)*r)+u)+")"}var d=(i=a(e.slice(1),16))>>16,h=i>>8&255,p=255&i;return"#"+(16777216+65536*(s((((o=a((n||(t<0?"#000000":"#FFFFFF")).slice(1),16))>>16)-d)*r)+d)+256*(s(((o>>8&255)-h)*r)+h)+(s(((255&o)-p)*r)+p)).toString(16).slice(1)},t.fn.IN=function(e){return t(this).fadeIn(400,e),t(this)},t.fn.OUT=function(e){return t(this).fadeOut(400,e),t(this)},t.fn.tooltip=function(e,n){var i=!0===("boolean"==typeof e&&e)&&"mouse",o="boolean"==typeof n&&n,r=t(this);return r.each((function(){var e=o?t(this).find(".tooltiptext"):t(this).children(".tooltiptext");t(e).length>0?e.each((function(){var e=t(this);t(this).filter(":not(:empty)").parent().qtip({suppress:!1,content:{text:e.clone()},position:{target:i,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},show:{effect:!1},hide:{effect:!1}}),e.remove()})):t(this).qtip({position:{target:i,adjust:{x:2,y:2},viewport:!0},events:{hidden:$ocms.tooltip_hidden},effect:!1})})),r},t.fn.rC=function(e){return t(this).removeClass(e)},t.fn.aC=function(e){return t(this).addClass(e)},t.fn.tC=function(e,n){return t(this).toggleClass(e,n)}}(jQuery),function(t){t.fn.ocmsmenu=function(e,n){var i=t(this);return $ocms.menu.call(i,e,n),i},t.fn.activatemenu=function(){var e=t(this).filter("nav");return e.find("a").not(".on").addClass("on").click($nuf),e.find(".nav-btn").not(".on").addClass("on").click((function(e){e.stopPropagation();var n=t(this);t(n.attr("data-target")).tC(n.attr("data-toggle"))})),e}}(jQuery);class ObjectArray extends Array{isEmpty(){return 0===this[0].length}static get[Symbol.species](){return Array}filter(t){return"function"==typeof t?new ObjectArray(this[0].filter(t)):this}remove(t){if("function"!=typeof t)return this;{let e=this[0].findIndex(t);for(;e>-1;)this[0].splice(e),e=this[0].findIndex(t)}}sortBy(t){return"function"==typeof t&&this[0].sort(t),this}sortString(t){return this[0].sort(((e,n)=>{let i=(e[t]||"").toString().toUpperCase(),o=(n[t]||"").toString().toUpperCase();return console.debug(i.localeCompare(o)),i.localeCompare(o)})),this}sortNum(t){return this[0].sort(((e,n)=>{let i=e[t],o=n[t];return!0===isNaN(o)&&!1===isNaN(i)||io?1:0})),this}sum(t){return this[0].reduce(((e,n)=>e+(!0===isNaN(n[t])?0:n[t])),0)}groupBy(t){return this[0].reduce((function(e,n){let i=n[t];return e[i]||(e[i]=[]),e[i].push(n),e}),{})}each(t){if("function"==typeof t){let e=!1;this[0].forEach(((n,i,o)=>{if(!1===e){let r=t(n,i,o);"boolean"==typeof r&&!1===r&&(e=!0)}}))}}get toArray(){return this[0]}}class NumArray extends Array{sum(){return this.reduce(((t,e)=>t+e))}first(){return this[0]}last(){return this[this.length-1]}average(){return this.sum()/this.length}range(){let t=this.map((t=>t)).sort();return{min:t[0],max:t[this.length-1]}}static get[Symbol.species](){return Array}}$ocms.ocmsmenu=[{lbl:"",id:"m_home",ico:"glyphicon glyphicon-home",fnc:"init:home"},{fnc:"separator"}],function(t){t.multline=function(t){let e=t.split("\n"),n=$$.d();return $.each(e,((t,e)=>{n.append($$.s(e))})),n.html()},t.tooltip_hidden=function(t,e){$(this).remove(),e.rendered=!1},t.isJSONDateString=function(t){return"string"==typeof t&&/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(t)},t.failure=function(e){11110===(e.internalCode||-1)?t.login.dlg():alert($t.f1+"\n"+(e.internalText||""))},t.getScript=function(e,n){var i=[],o=[],r=function(t){return"string"==typeof t&&""!==(t||"")},s=function(t,e){!0===bool(e.condition,!0)&&(""!==(e.script||"")&&o.push({url:e.script,module:e.module||""}),!0===r(e.css||"")?i.push(e.css):!0===Array.isArray(e.css)&&Array.prototype.push.apply(i,e.css.filter(r)))};!0===r(e||"")?o.push(e):!0===Array.isArray(e)?$.each(e,s):"object"==typeof e&&""!==(e.script||"")&&s(0,e);let a=[];$.each(i,(function(t,e){""!==(e||"")&&a.push(loadCSS(e))}));let c=o.map((function(e,n){let i=e.url,r=e.module||"";if(""===r){let t=new Promise((function(t,e){try{!async function(){$.ajax({url:i,dataType:"script",success:function(){t(o)},error:function(){e(o)},timeout:3e4})}()}catch(t){console.debug(t.message+"%o",t)}}));return t}return t.loadmodule(r,i,e.alias)}));Promise.all(c).then(n)},t.loadmodule=function(e,n,i){let o=new Promise((function(o,r){!async function(){try{let s=(n.startsWith("/")||n.startsWith(".")?"":"/")+n;import(s).then((n=>{t[e]=n[i||"default"],o(e)})).catch((t=>{console.debug(t.message+"%o",t),r(e)}))}catch(t){console.debug(t.message+"%o",t)}}()}));return o},t.ocms_auth=function(e,n,i,o){!1===$.isPlainObject(t.auth.modules)&&(t.auth.modules={});var r=0;t.auth.modules[e+(i||"")]?((r=t.auth.modules[e+(i||"")])<2&&(i||"")===auth.guid&&(r=2),r>=(n||0)&&o(false)):t.postXT({url:t.url("auth"),data:{module:e,person_guid:i||""},success:function(s){r=s[e],t.auth.modules[e+(i||"")]=r,r<2&&(i||"")===t.auth.person_guid&&(r=2),r>=(n||0)&&o(false)},error:function(e){t.failure.call(this,e)}})},t.auth.locale="de",t.ocms_prepauth=function(e,n,i){t.postXT({url:t.url("auth"),data:{fn:"csv",modules:e,person_guid:n||""},success:function(e){t.ocms_regauth(e)},error:function(e){t.failure.call(this,e)},complete:function(){i()}})},t.ocms_regauth=function(t){$.each(t||{},(function(t,e){auth.modules[t]=parseInt(e)}))},t.init=function(e){var n="string"==typeof e?e:(e.data||{}).fn||"";""!==n&&("home"===n?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),t.ov.call($("#contentframe"))):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),t.postXT({url:t.url(n+"/auth"),success:function(e){void 0===t[n]&&(t[n]={}),t[n].auth=e,e.manage>0&&t.getScript({module:n,script:["web/imdl",n,t.auth.locale||"de","js"].join("."),css:["web/imdl",n,"css"].join("."),condition:"function"!=typeof t[n].init2},(function(){t[n].init2()}))},error:function(){$("#contentframe").empty()}})))},t.menuarray=function(t){this.array=[],this.sep=function(){this.length>0&&"separator"!==this.array[array.length-1].fnc&&this.push({fnc:"separator"})},this.push=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.push.apply(this.array,t):"object"==typeof t&&this.array.push(t),t)},this.unshift=function(t){return void 0===t?null:(!0===Array.isArray(t)?Array.prototype.unshift.apply(this.array,t):"object"==typeof t&&this.array.unshift(t),t)},this.push(t)},t.menu=function(e,n){e=e||[];var i=$(this).removeClass("vis");if(!0===bool(n,!0)&&!1===i.is("#mainmenu")&&i.empty(),!1===bool(n,!1)&&i.is("#sidebar,#topbar")&&(e.unshift({id:"sbctrl",glyph:"glyphicon-th-list",aclass:"fbtn",fnc:function(){$lf()}}),$lf(0)),0===(e||[]).length)i.empty().addClass("hd");else{i.removeClass("hd");var o=!0===i.is("nav")?i:i.children("nav");1!==o.length&&(o=$("").tC("nv",i.is("#sidebar")).tC("ctxt",i.is("#topbar")).appendTo(i));var r,s=$$.ul().appendTo(o),a=function(t,e){var n=$(this).addClass("dropdown submenu");t.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"}),""!==(e.ico||"")&&t.prepend($$.sc("ico "+e.ico));var i=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(n);$.each(e.itm||[],(function(t,e){r.call(i,e)}))},c=function(t){$(this).tC("disabled","boolean"==typeof t.disabled?t.disabled:"string"==typeof t.disabled&&"subs"===t.disabled&&0===(t.itm||[]).length)};r=function(e){var n,i=$$.li({id:e.id}).attr(e.attr||{}).addClass(e.lclass).appendTo($(this)),o="string"==typeof e.fnc&&""!==e.fnc?e.fnc.split(":")[0]:"";""!==o&&"init"!==o?i.attr("role",o).appendIf($$.s(e.lbl),""!==ne(e.lbl)):(n=$$.a({class:"on",role:"button"}).addClass(e.aclass).appendTo(i).append($$.s(e.lbl)),c.call(n,e),(e.itm||[]).length>0&&a.call(i,n,e),n.click($nuf),"function"==typeof e.fnc?n.click(e.data||{},e.fnc):"init"===o&&n.click($.extend({},e.data||{},{fn:e.fnc.split(":")[1]}),t.init))},$.each(e,(function(e,n){var i,o=$$.li({id:n.id}).attr(n.attr||{}).addClass(n.lclass),a="string"==typeof n.fnc&&""!==n.fnc?n.fnc.split(":")[0]:"";if(""!==a&&"init"!==a)o.attr("role",a).appendIf($$.s(n.lbl),""!==ne(n.lbl));else{if(i=$$.a({class:"on",role:"button"}).addClass(n.aclass).appendTo(o),c.call(i,n),""!==(n.lbl||"")&&i.append($$.s(n.lbl)),""!==(n.ico||"")&&i.prepend($$.sc("ico "+n.ico)),""!==(n.glyph||"")&&i.prepend($$.sc("glyphicon "+n.glyph)),(n.itm||[]).length>0){o.addClass("dropdown"),i.append($$.sc("caret dd")).addClass("dds dropdown-toggle").attr({"aria-expanded":"false"});var l=$$.ul({class:"dropdown-menu",role:"menu"}).appendTo(o);$.each(n.itm||[],(function(t,e){r.call(l,e)}))}(n.sel||[]).length>0||(i.click($nuf),"function"==typeof n.fnc?i.click(n.data||{},n.fnc):"init"===a&&i.click($.extend({},n.data||{},{fn:n.fnc.split(":")[1]}),t.init))}o.appendTo(s)})),o.activatemenu()}},t.easytbl=(t,e)=>{e=e||{};let n=$$.tbl().addClass(e.class).css("border-collapse","collapse"),i=($$.tbody(n),!0===bool(e.frame,!1)?{padding:"5px",border:"1px solid #727272"}:{});if(!0===Array.isArray(e.header)){let t=$$.thead(n);$.each(e.header,((n,o)=>$$.th(t).css(e.cellcss||i).rwText(o)))}else if(!0===bool(e.header,!1)&&(t||[]).length>0){let o=$$.thead(n);$.each(Object.keys(t[0]),((t,n)=>$$.th(o).css(e.cellcss||i).rwText(n)))}return $.each(t||[],((t,o)=>{let r=$$.tr();$.each(o,((t,n)=>{n=n||"";let o=$$.td(r).css(e.cellcss||i);n instanceof jQuery?o.append(n):"string"==typeof n&&("<"===n.substring(0,1)?o.append(n):o.text(n))})),n.append(r)})),n},t.dlgtbl=(e,n,i)=>{i=i||{};let o=t.easytbl(e,i);t.dlg(o,$.extend({title:n},i))},t.dlg=function(t,n){n=n||{};let i=$("body > .modal").length>0,o=t=>typeof n[t],r=t=>"function"===o(t);if(!0===bool(n.exclusive,!0)&&!0===i)return void alert($t.dbldlg||"Es ist bereits ein Dialog geöffnet");let s=$$.dc("modal",$("body")),a=$$.dc("modal-dialog",s);!1===isNaN(n.zindex)?s.css("zIndex",n.zindex):!0===i&&s.css("zIndex",parseInt($("body > .modal:last").cssValue("zIndex"))+200),!1===isNaN(n.zindex_min)&&s.cssValue("zIndex")').appendTo(d)),""!==ne(n.title)&&(c=$$.dc("modal-header",d),$("

        ").text(n.title).appendTo(c));let p=$$.dc("modal-body",d),f=$$.dc("modal-footer",d);t instanceof jQuery==!0&&p.append(t);let m=function(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation(),a.removeClass("in"),!0===r("closing")&&n.closing.call(d),p.hide().emptyWithEditors(),s.remove(),!0===r("close")&&n.close.call(d)};if(d.find(":input[required]").length>0&&($$.dc("note_required",f).append($$.sc("ind_required","*")).append($$.s($t.t1||"Eingabe erforderlich")),$$.dc("note_invalid",f).append($$.s($t.t2||"Bitte überprüfen Sie Ihre Eingaben im Formular."))),!0===r("cancel")){$$.bbtn(n.cancelbutton||"Abbrechen","cancel").attr({type:"button",role:"cancel"}).appendTo(f).click((function(t){n.cancel.call(d,t);t.stopPropagation(),m()}))}if(!0===r("confirm")){let t=$$.bbtn(n.button||"OK","confirm").attr({type:!0===bool(n.form,!1)?"submit":"button",role:"confirm"}).appendTo(f);!0===h?(d.submit((function(t){try{n.confirm.call(d,t)}finally{t.preventDefault()}return!1})),d.on("modal_submit",(function(){n.confirm.call(d,e)}))):(t.click((function(t){n.confirm.call(d,t);t.stopPropagation()})),d.on("modal_submit",(function(){t.click()})))}else!0===h&&d.submit((function(t){return t.preventDefault(),!1}));return d.on("modal_close",(function(){m()})),l.click(m),!0===r("opening")&&n.opening.call(d),a.addClass("in"),ne(n.mode).indexOf("maxbody")>-1&&p.css("min-height",(u.height()-c.outerHeight()-f.outerHeight()).toString()+"px"),!0===r("open")&&n.open.call(d),{hd:c,bdy:p,ft:f,ct:u,dlg:a,c:d}},t.mform=function(e){let n=$$.dc("form-body"),i=Array.isArray(e)?e:e instanceof fields_definition?e.fields:[];return $.each(i||[],(function(e,i){let o=i.type||"";if("ignore"===o)return!0;let r=$$.dc("form-group",n),s=i.id||"dlg_"+(i.name||"")+("html"===i.type?"_"+(65536*(1+Math.random())||0).toString(16).substr(9):""),a=$$.lbl(i.label||i.name,{for:s}).appendTo($$.dc("form-itm",r)),c=$$.dc("form-itm",r),l=$$.i({id:s,name:i.name,placeholder:i.placeholder,type:i.type});switch(o){case"email":i.pattern=ne(i.pattern,"[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$");break;case"url":i.pattern=ne(i.pattern,"https?://.+");break;case"number":i.pattern=ne(i.pattern,"[-+]?[0-9]*[.,]?[0-9]*"),l.attr("type","text"),l.attr("inputmode","decimal"),l.attr("step",i.precision||"any"),l.attr("data-format","float");break;case"integer":case"int":i.pattern=ne(i.pattern,"[-+]?[0-9]*"),l.attr("type","number"),l.attr("data-format","integer");break;case"date":if(""!==ne(i.pattern,$t.datepattern)&&(i.pattern=ne(i.pattern,"("+$t.datepattern+")|([0-9]{4}.(0[1-9]|1[012]).(0[1-9]|1[0-9]|2[0-9]|3[01]))")),""!==ne(i.placeholder,$t.dateplaceholder)&&l.attr("placeholder",ne(i.placeholder,$t.dateplaceholder)),"string"==typeof i.value){var u=i.value.substr(0,10);i.value="date"!==l.prop("type")?fdt(u+"T00:00:00",ne(i.dateformat,$t.dateformat)):u}l.attr("data-format","date:"+ne(i.dateformat,$t.dateformat)+";yyyy-MM-dd");break;case"datetime":l.attr("type","datetime-local"),""!==ne(i.pattern,$t.datetimepattern)&&(i.pattern=ne(i.pattern,"("+$t.datetimepattern+")|([0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])\\s([0-5][0-9]):([0-5][0-9]))")),""!==ne(i.placeholder,$t.datetimeplaceholder)&&l.attr("placeholder",ne(i.placeholder,$t.datetimeplaceholder)),"string"==typeof i.value&&"T"===i.value.substr(10,1)&&(i.value="datetime"!==l.prop("type").substr(0,8)?fdt(i.value,ne(i.datetimeformat,$t.datetimeformat)):i.value),l.attr("data-format","datetime:"+ne(i.datetimeformat,$t.datetimeformat)+";yyyy-MM-dd HH:mm:ss");break;case"hidden":r.addClass("hd");break;case"html":case"text":l=$$.txt({id:s,name:i.name,placeholder:i.placeholder,type:i.type}),l.tC("tinymce","html"===i.type);break;case"bool":case"boolean":i.url=[{value:"true",label:($t||{}).true||"Yes"},{value:"false",label:($t||{}).false||"No"}],"boolean"==typeof i.value&&(i.value=i.value?"true":"false");case"select":l=$$.sel({id:s,name:i.name,type:i.type}),!1===bool(i.required,!1)&&$$.eOpt().appendTo(l);try{var d=function(t){!0===Array.isArray(t)&&$.each(t,(function(t,e){"string"==typeof e?$$.opt(e,e).appendTo(l):!0===Array.isArray(e)?$$.opt(e[0],e[1]).appendTo(l):"object"==typeof e&&$$.opt(e.value,e.label||e.text).appendTo(l)}))};!0===Array.isArray(i.url)?d(i.url):"function"==typeof i.url?i.url.call(l):"string"==typeof i.url&&t.postXT({url:i.url,success:d})}catch(t){$.noop()}break;default:""!==ne(i["max-length"])&&l.attr("max-length",i["max-length"])}""!==ne(i.pattern)&&l.attr("pattern",i.pattern),l.val(i.value).change(),l.change((function(){$(this)[0].setCustomValidity("")})),l.addClass("form-control").prop("required",bool(i.required,!1)).prop("readonly",bool(i.readonly,!1)).appendTo(c),!0===bool(i.required,!1)&&a.append($$.sc("ind_required","*")),"object"==typeof i.attr&&l.attr(i.attr),"object"==typeof i.prop&&l.prop(i.prop),"string"==typeof i.class&&l.addClass(i.class),"function"==typeof i.change&&(l.change(i.change),!0===bool(i.applychange,!1)&&void 0!==i.value&&l.change()),""!==(i.note||"")&&$$.dc("form-note",c).rwText(i.note),"function"==typeof i.complete&&i.complete.call(l)})),n},t.initMCE=function(t,e){t=$(t),e=e||{};try{let n={target:t[0],inline:!1,width:e.width||"100%",statusbar:!1,document_base_url:window.location.origin+"/",content_style:"ph:before {content: '«'; color: #BBB; font-style:italic; } ph:after {content: '»'; color: #BBB; font-style:italic; } ph { color: #AAA; font-style:italic; }",relative_urls:!1,remove_script_host:!1};!0===bool(e.hidemenu,!1)&&(n.menubar=!1,n.menu={}),!0===bool(e.hidetoolbar,!1)&&(n.toolbar=!1),$.extend(n,e||{}),tinymce.init(n)}catch(t){alert(t.message)}},t.dlgform=function(e,n){n=n||{};let i,o=$$.dc("frm").append(t.mform(e||[]).addClass("stacked"));n.addcontent instanceof jQuery&&o.append(n.addcontent),"function"==typeof n.submit?i=n.submit:"function"==typeof n.success&&(i=function(e){var i=$(this).ldng(1),o=$.extend({loginaccount:t.auth.account||""},i.serializeObject(bool(n.checkvalidity,!0),{typedvalues:bool(n.typedvalues,!1)}));""!==(n.url||"")?t.postXT({url:n.url,data:o,success:function(t){n.success.call(this,t),i.trigger("modal_close")},error:function(){alert($t.l17)},complete:function(){i.ldng(0)},timeout:6e4}):(n.success.call(this,o),i.trigger("modal_close"))});let r={form:!0,title:n.title||"",button:n.button||$t.submit,confirm:i,size:n.size||[500,600],open:function(){let e=$(this).find(".tinymce");e.length>0&&t.initMCE(e,n.tinymce||{})}};return t.dlg.call(this,o,r)},t.login.dlg=function(e){e=e||{};let n=[{name:"userinfo",label:$t.l1,type:"string",value:t.auth.login,change:t.login.uichange,required:!0},{name:"userlogin",type:"hidden",required:!0,value:t.auth.login},{name:"username",type:"string",label:$t.l4,required:!0,readonly:!0,placeholder:$t.l5,value:t.auth.fullname_rev},{name:"userpass",type:"password",label:$t.l3,required:!0,placeholder:$t.l3}];""===(t.auth.account||"")&&n.unshift({id:"dlg_loginaccount",name:"loginaccount",type:"string",required:!0,value:t.auth.account});let i=$$.dc("frm").append(t.mform(n).addClass("stacked")),o=t.dlg.call(this,i,{form:!0,title:$t.l0,button:$t.submit,confirm:function(n){var i=$(this).ldng(1),o=$.extend({loginaccount:t.auth.account||""},i.serializeObject());t.postXT({url:"/vt/login",data:o,success:function(n){""!==((n||{}).login||"")&&(i.trigger("modal_close"),t.auth=n,"object"==typeof e.ajo&&(e.ajo.islogin,$.ajax(e.ajo)))},error:function(){alert($t.l17)},complete:function(){i.ldng(0)},timeout:6e4})},size:[500,600]}),r=$$.dc("modal-content").css("height","auto").attr("novalidate","true").append($$.dc("modal-header").appendIf($("

        ").text(t.auth.accountname),""!==(t.auth.accountname||"")).append($("

        Vereinsmanager

        ")));o.dlg.prepend(r)},t.addNoEntryInfo=function(t){$(this).append($$.dc("noentryinfo").text(t||$t.t11))}}($ocms),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),function(t,e){var n,i;"object"==typeof window&&(window[t]=(n=function(t){var e=window,n=document.body,i=document.documentElement,o=Math.max(0,e.pageXOffset||i.scrollLeft||n.scrollLeft||0)-(i.clientLeft||0),r=Math.max(0,e.pageYOffset||i.scrollTop||n.scrollTop||0)-(i.clientTop||0);return{x:t?Math.max(0,t.pageX||t.clientX||0)-o:0,y:t?Math.max(0,t.pageY||t.clientY||0)-r:0}},(i=function(t,e){t&&t instanceof Element&&(this._container=t,this._options=e||{},this._clickItem=null,this._dragItem=null,this._showDragItem="boolean"!=typeof this._options.dragItem||!1!==this._options.dragItem,this._hovItem=null,this._sortLists=[],this._click={},this._dragging=!1,this._dragHandleClass=this._options.dragHandleClass||"",this._parentident=this._options.parentident||"",this._swapdone="function"==typeof this._options.swapdone?this._options.swapdone:null,this._onend="function"==typeof this._options.onend?this._options.onend:null,this._container.setAttribute("data-is-sortable",1),this._container.classList.add("sortable"),this._container.style.position="static",window.addEventListener("mousedown",this._onPress.bind(this),!0),window.addEventListener("touchstart",this._onPress.bind(this),!0),window.addEventListener("mouseup",this._onRelease.bind(this),!0),window.addEventListener("touchend",this._onRelease.bind(this),!0),window.addEventListener("mousemove",this._onMove.bind(this),!0),window.addEventListener("touchmove",this._onMove.bind(this),!0))}).prototype={constructor:i,toArray:function(t){t=t||"id";for(var e=[],n="",i=0;ii.left&&ei.top&&n-1)&&e.className.indexOf("nosort")<0)&&(t.preventDefault(),this._dragging=!0,this._click=n(t),this._makeDragItem(e),this._onMove(t),!0)}t&&!1===e.call(this,t.target)&&""!==this._parentident&&t.target.closest(this._parentident)&&e.call(this,t.target.closest(this._parentident))},_onRelease:function(t){var e=!0===this._dragging&&null!==this._clickItem;this._dragging=!1,this._trashDragItem(),e&&"function"==typeof this._onend&&this._onend()},_onMove:function(t){if(this._dragItem&&this._dragging){t.preventDefault();var e=n(t),i=this._container;!0===this._showDragItem&&this._moveItem(this._dragItem,e.x-this._click.x,e.y-this._click.y);for(var o=0;o0?a.mousedown(c).addClass("dctrl"):s.mousedown(c).addClass("dctrl"),t(this)}}(jQuery),$(document).ready((function(){$("html").click((function(t){$nuf()})),$("#listframe").click((function(t){t.stopPropagation(),$nuf()})),$("#mainmenu").ocmsmenu($ocms.ocmsmenu),$("#mainmenu").activatemenu()})),$.extend($t,{m_inv:"Rechnungen",m_req:"Aufträge",m_rep:"Berichte",m_todo:"ToDos",m_bcd:"BankBuchungen",rsp:"Passwort ändern",pnm:"Die Passwörter stimmen nicht überein",cps:"Das neue Passwort wurde gespeichert.",pwr:"Bitte wählen Sie ein starkes Passwort (min 8 Zeichen, davon jeweils min 2 Zahlen, kleine und große Buchstaben, Sonderzeichen sind optional).",smsc:"Sie beötigen für diese Funktion einen SMS-Code.\nSoll dieser nun versandt werden?",wdc:"Doppelt klicken, um die Box zu aktualisieren.",wdg:{}}),$t.rspf={sms:"Der SMS-Code konnte nicht bestätigt werden",valid:"Das alte Passwort ist nicht korrekt",requirements:"Das Passwort entspricht nicht den Anforderungen.\n"+$t.pwr},$fd={rsp:new fields_definition("","",[{name:"opw",label:"aktuelles Passwort",type:"password",required:!0,attr:{"auto-complete":"current-password"}},{name:"npw",label:"neues Passwort",type:"password",required:!0,pattern:"(.{6,})",attr:{"auto-complete":"new-password"}},{name:"npwc",label:"neues Passwort (Bestätigung)",type:"password",required:!0,attr:{"auto-complete":"new-password"},note:$t.pwr},{name:"code",label:"SMS-Code",type:"string",required:!0,attr:{"auto-complete":"one-time-code"}}])},$ocms.init=function(t){var e="string"==typeof t?t:(t.data||{}).fn||"";""!==e&&("home"===e?($cfr(),$lfr(),$("#topbar").ocmsmenu([],!0),$("#activemodule").text($t.ov),$fis.ov()):($cfr(),$lfr(),$("#topbar").ocmsmenu([]),$ocms.postXT({url:$ocms.url(e+"/auth"),success:function(t){void 0===$ocms[e]&&($ocms[e]={}),$ocms[e].auth=t,t.manage>0&&$ocms.getScript({module:e,script:["/web/fis",e,$ocms.auth.locale||"de","js"].join("."),css:["/web/fis",e,"css"].join("."),condition:"function"!=typeof $ocms[e].init2},(function(){$ocms[e].init2()}))},error:function(){$("#contentframe").empty()}})))};var $fis={auth:{},db:function(){$("#mainmenu_activemodule").text($t.ov);let t=$(this).empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var i=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$ocms.wdg.call(i,{wdg:n})}))},loading:e})},ValidateEmail:function(t){return!!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)},cf:t=>{let e=$("#contentframe");return!0===bool(t,!1)&&e.empty().rC("hd"),e},lf:t=>{let e=$("#listframe");return!0===bool(t,!1)&&e.empty().aC("hd").rC("fix"),e},frm_edit:function(t){let e=$fis.cf(!1),n=e.children(".cfrm"),i=e.children(".edit_frm");return n.length<1?n=$$.dc("cfrm hd").prependTo(e):!0===bool(t,!1)&&n.empty(),i.length<1&&(i=$$.dc("edit_frm").insertAfter(n)),i.empty()},frm_list:function(t,e){let n=$fis.cf(!1),i=n.children(".cfrm"),o=n.children(".list_frm");return i.length<1?i=$$.dc("cfrm hd").prependTo(n):!0===bool(t,!1)&&i.empty(),!0===bool(e,!1)&&n.children(".edit_frm").remove(),o.length<1&&(o=$$.dc("list_frm").appendTo(n)),o.empty()},lfm:()=>{let t=$fis.lf(!1),e=t.children(".lfrm");return e.length<1&&(e=$$.dc("lfrm").prependTo(t)),e},getAuth:(t,e)=>new Promise(((n,i)=>{$fis.auth[t]&&!1===bool(e,!1)?n($fis.auth[t]||-1):$ocms.postXT({url:$ocms.url("auth"),data:{module:t},success:e=>{$fis.auth[t]=e.auth||-1,n($fis.auth[t]||-1)},error:()=>{i()}})})),prepAuth:t=>new Promise(((e,n)=>{$ocms.postXT({url:$ocms.url("auth"),data:{module:t,array:1},success:t=>{$.extend($fis.auth,t||{})},complete:()=>{e()}})})),isAuth:(t,e)=>($fis.auth[t]||-1)>=(e||1),resetPass:function(t,e){confirm($t.smsc)&&($ocms.postXT({url:$ocms.url("account/sms"),data:{fn:"pwc"}}),$ocms.dlgform($fd.rsp.clone(),{title:$t.rsp||"",submit:function(t){var e=$(this).ldng(1),n=$.extend({loginaccount:$ocms.auth.account||""},e.serializeObject(!0,{typedvalues:!0}));(n.npw||"")!==(n.npwc||"")?e.find('input[name="npw"]:first')[0].setCustomValidity($t.pnm):$ocms.postXT({url:$ocms.url("account/changepassword"),data:n,success:function(t){alert($t.cps),e.trigger("modal_close")},error:function(t){alert($t.rspf[t.getResponseHeader("x-ocms-std")])},complete:function(){e.ldng(0)},timeout:6e4})}}))},wdg:function(t){let e=$(this).empty();$ocms.postXT({url:$ocms.url("wdg/one"),data:{short_name:t.wdg},timeout:9e4,success:function(n,i,o){let r=t.wdg,s=n[r];if(!s)return void e.ldng(0);let a=$.inArrayRegEx("dblwidth",s.rendering_options)>-1,c=$.inArrayRegEx("tiny",s.rendering_options)>-1;e.toggleClass("dbl",a&&!c).toggleClass("tny",c);$$.dc("wdg_hd",e,{title:ne(s.description,$t.wdc)}).toggleClass("dbl",a).text(ne(s.name,t.wdg)).dblclick((function(t){t.stopPropagation(),$fis.wdg.call(e,{wdg:r})}));let l=$$.dc("wdg_cnt",e).toggleClass("dbl",a).hide(),u=$.inArrayRegEx("bgcolor",s.rendering_options);switch(u>-1&&l.css("backgroundColor",s.rendering_options[u].toString().right(":")),s.type){case"table":var d=$$.tblset({},l),h=$$.tr().appendTo(d.hd),p=$t.wdg[r.indexOf("wdg_ev_")>=0?"wdg_ev_":r]||{};$.each(s.columns,(function(t,e){var n=p[e]?p[e].label:e;$$.th().text(n).appendTo(h)})),$.each(s.data,(function(t,e){var n=$$.tr().appendTo(d.bdy);$.each(s.columns,(function(t,i){var o=$$.td().appendTo(n);e[i]instanceof Date||!0===$ocms.isJSONDateString(e[i])?o.text(fdt(e[i],$t.dateformat)):o.rwText(e[i])}))})),$.inArray("firstrow_bold",s.rendering_options)>-1&&h.nextAll("tr:first").css("font-weight","bold");break;case"ind":$$.dc("ind",l).addClass("sts_"+(s.data.status||"")).append([$$.dc("ind").text(s.data.value),$$.lbl(s.data.label)]);break;case"image_url":l.css("background","url('"+s.url+"') no-repeat center center transparent");break;case"image_base64":l.css("background","url('data:image/png;base64,"+s.image+"') no-repeat center center transparent");break;case"html":if(l.html(s.html),$.inArray("reload_10min",s.rendering_options)>-1){var f=l.find("iframe");setTimeout((function(){f.attr("src",(function(t,e){return e}))}),6e5)}}$.inArray("reload_30min",s.rendering_options)>-1&&"html"!==s.type&&setTimeout((function(){$fis.wdg.call(e,{wdg:r})}),18e5),l.slideDown(150)},error:function(t){e.slideUp(150),$fis.failure.call(this,t)},complete:function(){e.ldng(0)}})},ov:function(){$fis.lf(!0);let t=$("#contentframe").empty(),e=$$.d({id:"dashboard_frame"}).appendTo(t);$ocms.postXT({url:$ocms.url("wdg/my"),success:function(t){$.each(t,(function(t,n){var i=$$.dc("wdg_frame",e,{"data-wdg":n}).ldng(1);$fis.wdg.call(i,{wdg:n})}))},loading:e})}};$fis.notifications={connection:null,init:function(){"undefined"!=typeof signalR&&null===this.connection&&$ocms.auth.useraccount_id&&(this.ensureFrame(),this.connection=(new signalR.HubConnectionBuilder).withUrl("/notifications").withAutomaticReconnect().build(),this.connection.on("notification",(t=>{this.push(t)})),this.connection.onclose((()=>{console.warn("Notification connection closed; retrying in 5s."),this.connection=null,setTimeout((()=>this.init()),5e3)})),this.start())},start:function(){this.connection.start().catch((t=>{console.warn("Notification connection failed to start; retrying in 5s.",t),this.connection=null,setTimeout((()=>this.init()),5e3)}))},ensureFrame:function(){$("#notification_frame").length<1&&$("
        ",{id:"notification_frame"}).appendTo($("footer:first").length?"footer:first":"body")},push:function(t){this.ensureFrame(),t=t||{};let e=$("
        ",{class:"notification_item"}).addClass((t.severity||"info").toLowerCase()).append($("
        '),n=t.find(".form-body"),i=null;t.find("form").submit((function(e){e.preventDefault();var r=$(this).serializeObject(!0),o=null===i,a=o?"spwc":"spw";return $ocms.postXT.call(this,{url:$ocms.url(a),data:r,complete:function(){o?(n.append('
        Ihnen wurde ein Code per SMS zugesandt.
        Bitte tragen Sie den hier ein:
        '),i=$('
        ').appendTo(n)):(alert($t.l13),t.remove())},error:()=>{}}),!1})),t.find(".modal-close").click((function(){t.remove()}));var r=[];$.each($t.l7a.split("\n"),((e,t)=>{Array.prototype.push.apply(r,[$("
        "),$("").text(t)])})),t.find(".modal-note").append($('').text($t.alert)).append(r),t.appendTo("body"),setTimeout((function(){$(".modal").find('input[name="lastname"]').focus()}),600)}},$(document).ready((function(){$("#loginform").submit($ocms.login.send)})); \ No newline at end of file +var $t={lng:"de-DE",dn:["So","Mo","Di","Mi","Do","Fr","Sa"],mn:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],ma:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],datepattern:"(0[1-9]|1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}",datetimepattern:"(0[1-9]|1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}\\s([0-5][0-9]):([0-5][0-9])",dateplaceholder:"dd.MM.yyyy",datetimeplaceholder:"dd.MM.yyyy HH:mm",dateformat:"dd.MM.yyyy",datetimeformat:"dd.MM.yyyy HH:mm",f1:"Der Server hat einen Fehler gemeldet: \n",f2:"Bitte versuchen Sie es erneut.",m0:"Diese Internet-Seite benötigt einen html5-kompatiblen Browser.",m0b:"Unterstützt werden bspw: Internet Explorer ab Version 10, Firefox ab Version 31, Chrome ab Version 31, Safari ab Version 7, Opera ab Version 27",m1:"Dieser Datensatz ist momentan von jemand anderem zur Bearbeitung gesperrt.",m2:"Diese Funktion ist zur Zeit nicht verfügbar",t1:"Eingabe erforderlich.",t2:"Eingabe ist nicht erforderlich.",true:"Ja",false:"Nein",alert:"Hinweis",confirm:"Bestätigen",open:"Öffnen","not implemented":"Diese Funktion in zur Zeit noch nicht verfügbar.",l0:"Anmeldung",l1:"Email / Anmeldename",l2:"Email-Adresse / Anmeldename",l3:"Passwort",l4:"Benutzer",l5:"Wird vom System ermittelt...",l6:"Anmelden",l7:"Passwort vergessen?",l7a:'Die "Passwort vergessen"-Funktion läuft in zwei Schritten ab:\n \nIm ersten Schritt wird eine SMS mit einem Code an die hinterlegte Mobilfunk-Nummer versandt.\nIm zweiten Schritt geben Sie bitte diesen Code in das Formular ein und übermitteln es erneut.\n \nIn beiden Schritten wird aus Sicherheitsgründen kein Fehler angezeigt und auch dann ein erfolgreicher Versand bestätigt, wenn die Kombination aus Email-Adresse und Nachname nicht gefunden wurde und/oder der code falsch ist.',l8:"Keinen Account?",l9:"Anmeldenamen der Email-Adresse wurde nicht erkannt.",l10:"Nachname",l11:"Email-Adresse",l12:"Passwort zusenden",l13:"Das Passwort wurde erfolgreich verschickt",l14:"Das Passwort konnte nicht verschickt werden",l15:"Sie sind nicht berechtigt, diese Funktion auszuführen.",l16:"Sie müssen zunächst einen Account angeben.",l17:"Die Kombination aus Anmeldenamen und Passwort konnte nicht bestätigt werden.",l18:"Es gibt ein Problem mit dem Formular.\nEs kann momentan nicht verarbeitet und versendet werden.",name:"Name",submit:"Senden",cancel:"Abbrechen",noop:"Diese Funktion is noch nicht verfügar."};const isIE=/MSIE\/|Trident/gi.test(window.navigator.userAgent)||void 0!==window.document.documentMode,isfileapi=!!(window.File&&window.FileReader&&window.FileList&&window.Blob);var $ocms={auth:{},no:function(e){e.stopPropagation()},vmin:function(e){var t=$(window).width*(e||1),n=$(window).height*(e||1);return t($ocms.baseurl+"/"+(e||"")).replace(/\/\//,"/"),cexi:null};function deepCopy(e){var t,n,i;if("object"!=typeof e||null===e)return e;for(i in t=Array.isArray(e)?[]:{},e)n=e[i],t[i]=deepCopy(n);return t}function fields_definition(e,t,n){this.label_sng=!0===Array.isArray(e)?"":e||"",this.label_pl=!0===Array.isArray(e)?"":t||"",this.fields=!0===Array.isArray(e)?e:n||[],this.itm=function(e){for(var t=0;t0)for(var n=0;ne||"")).filter(((e,t)=>""!==e)).join(t)}function parseDt(e,t,n){e=(e||"").substr(0,t.length);var i=t,r=e.length>0&&t.split(";").some((function(t){for(var n,r=/[^yMdhms0-9]/gi,o=!0;null!==(n=r.exec(t));)o=o&&t.substr(n.index,1)===e.substr(n.index,1);var a=e.length===t.length&&o;return!0===a&&(i=t),a}));if(!0===r){for(var o,a=[0,0,0,0,0,0,0],s=/(mm{1,2}|dd{1,2}|MM{1,2}|(yy){2,4}|ss{1,2}|hh{1,2})(?!\w)/g;null!==(o=s.exec(i));)a["yMdhms".indexOf(o[0].substr(0,1))]=parseInt(("yy"===o[0]?"20":"")+e.substr(o.index,o[0].length))-("M"===o[0].substr(0,1)?1:0);var l=new(Function.prototype.bind.apply(Date,[null].concat(a)));return"string"==typeof n?fdt(l,n):l}return!1}function bool(e,t){return"boolean"==typeof e?e:"boolean"==typeof t&&t}function booln(e,t){return"boolean"==typeof e?e:"number"==typeof e?1===e:"boolean"==typeof t&&t}Date.prototype.isValid=function(){return!isNaN(this)},Date.prototype.format=function(e){return fdt(this,e)},Date.prototype.addDays=function(e){return this.setDate(this.getDate()+e),this},Date.prototype.isBetween=function(e,t){return this>e&&this section");$(window).scroll((function(t){let n=$(window).scrollTop(),i=$("body");i.toggleClass("unfocus",n>vh()-1.2*e),i.toggleClass("btb",n>.5*vh()-e)}))},$ocms.cf_reset=function(){return $("#contentframe").empty()},function(e){e.fn.scrollTo=function(t){if(e(this).length>0){var n=e(this).offset().top||0;n>0&&e("html, body").animate({scrollTop:n-hh()},2e3)}},e.fn.ldng=function(t){var n=!0;return"boolean"==typeof t?n=t:"number"==typeof t&&(n=t>0),e(this).toggleClass("loading",n)},"function"!=typeof e.noop&&(e.noop=function(){}),e.fn.hasAttr=function(t){var n=e(this).attr(t);return void 0!==n&&!1!==n},e.fn.parseCssPx=function(t){try{return parseFloat(e(this).css(t).replace("px","")||0)}catch(e){return 0}},e.max=function(e,t){return isNaN(e)&&isNaN(t)?null:isNaN(e)&&!isNaN(t)?t:!isNaN(t)&&isNaN(t)||e>=t?e:t},e.min=function(e,t){return isNaN(e)&&isNaN(t)?null:isNaN(e)&&!isNaN(t)?t:!isNaN(t)&&isNaN(t)||e<=t?e:t},e.lim=function(e,t){return isNaN(e)?null:isNaN(t)?e:t<=e?t:e},e.fn.enterKey=function(t){return this.each((function(){e(this).keypress((function(e){"13"===(e.keyCode?e.keyCode:e.which).toString()&&t.call(this,e)}))}))}}(jQuery),$ocms.defaultTimeout=3e4,$ocms.AjaxEX=function(e){var t=this;t.responseText=t.responseText||"";var n=t.getResponseHeader("x-ocms-code")||"";t.internalCode=""!==n&&!1===isNaN(n)?parseInt(n):-1,t.isInternal=t.internalCode>-1,t.internalText=decodeURIComponent((t.getResponseHeader("x-ocms-desc")||"").replace(/\+/g,"%20")||"");var i=t.internalText||e,r=t.internalCode||t.status;t.logtext=i+" ("+r+")"},$ocms.postXTS=function(e){$ocms.postXT.call(this,$.extend(e,{sync:!0}))},$ocms.postXT=function(e){if((e=e||{}).trycount=e.trycount||0,""!==(e.url||"")){e.url=-1!==e.url.indexOf("&yy=")?e.url:e.url.indexOf("?")>-1?e.url+"&yy="+(new Date).getTime():e.url+"?yy="+(new Date).getTime();var t=e.context||this;switch(e.context=t,e.retryLimit=e.retryLimit||0,e.timeout=e.timeout||$ocms.defaultTimeout,e.timeout<100&&(e.timeout=1e3*e.timeout),e.data=e.data||{},e.contentType=e.contentType||"multipart/form-data; charset=UTF-8",e.islogin="boolean"==typeof e.islogin&&e.islogin,e.contentType){case"":case"json":e.contentType="application/json; charset=utf-8";break;case"form":e.contentType="application/x-www-form-urlencoded; charset=UTF-8";break;case"multi":e.contentType="multipart/form-data";break;case"text":e.contentType="text/plain; charset=UTF-8"}if(e.form instanceof jQuery?(e.data=e.form.serializeObject(),e.contentType="form-data"):e.lzw instanceof jQuery&&(e.data.lzw=$.ccLZW(e.lzw.serializeAnything(!0)).join(",")),"multipart/form-data"!==e.contentType.substr(0,19)&&"form-data"!==e.contentType.substr(0,9)||e.data instanceof FormData!=!1)e.data instanceof FormData&&(e.contentType=!1,e.processData=!1);else{e.contentType=!1;var n=new FormData;$.each(e.files||[],(function(e,t){n.append("upload_file",t)})),$.each(e.data||{},(function(e,t){n.append(e,t)})),e.data=n,e.processData=!1}var i={type:e.method||"post",url:e.url,data:e.data,processData:"boolean"!=typeof e.processData||e.processData,contentType:e.contentType,cache:e.cache||!1,timeout:e.timeout,beforeSend:function(n){$(e.loading).ldng(),$("body").addClass("ldng"),"function"==typeof e.beforesend&&e.beforesend.apply(t,[n])},success:function(n,i,r){"false"===n||"not authorized"===n?("function"==typeof e.error&&e.error.apply(t,[r,i,n]),"function"==typeof $.status&&$.status(i+" - "+n)):"function"==typeof e.success&&e.success.apply(t,[n,i,r])},error:function(n,i,r){if($ocms.AjaxEX.call(n,i),-1===e.url.indexOf("doc.ashx")||-1!==e.url.indexOf("ftest")){if(401===n.status&&111===n.internalCode&&!1===e.islogin&&"function"==typeof $ocms.login.dlg)$ocms.login.dlg({ajo:e});else if("timeout"===i||302===n.status)return e.tryCount++,e.tryCount<=e.retryLimit?void $ocms.postXT(e):void 0;"function"==typeof e.error?e.error.apply(t,[n,i,r]):"function"==typeof $ocms.failure?$ocms.failure.apply(t,[n]):"function"==typeof $.status&&$.status("Server error: "+i+" - "+r)}},dataType:e.datatype||"json",complete:function(n,i){"function"==typeof e.complete&&e.complete.apply(t,[n,i]),$(e.loading).ldng(0),$("body").removeClass("ldng");let r=$("body > .timer");if(r.length>0){let e=new Date(n.getResponseHeader("ocms_cec")||""),t=new Date(n.getResponseHeader("ocms_cex")||"");if(e.isValid()&&t.isValid()){let n=new Date,i=Math.abs(t-e);n.setMilliseconds(n.getMilliseconds()+i),r.data({cex:n,ctt:i}),$ocms.cex_timer()}}},context:t,async:!0};"boolean"==typeof e.sync&&(i.async=!1===e.sync),!0==("boolean"==typeof e.contentType&&!1===e.contentType)&&(i.contentType=!1),$.ajax(i)}},$ocms.cex_timer=function(){$ocms.cexi||($ocms.cexi=setInterval($ocms.cex_timer,15e3));let e=$("body > .timer"),t=e.data("cex"),n=e.data("ctt"),i=new Date;if(t instanceof Date&&t.isValid()&&"number"==typeof n&&n>0&&t>i){let r=Math.abs(i-t)/n*100;e.css("width",r.toString()+"%"),r<98&&(!$ocms.cex_lp||Math.abs(i-$ocms.cex_lp)>6e5)&&$ocms.postXT({url:$ocms.url("ping"),success:()=>{$ocms.cex_lp=i},timeout:5e3,error:()=>{}})}},$ocms.vbl_send=function(e){var t=e.data||{};if(""!==(t.url||"")){var n=$("#contentframe form:first"),i={url:t.url,data:new FormData,success:function(e){"function"==typeof t.success?t.success(e):"string"==typeof t.success&&alert(t.success)},error:function(e,n,i){"function"==typeof t.error?t.error(i):"string"==typeof t.error&&alert(t.error)},complete:function(){n.ldng(0)}},r=!0;n.find("input").each((function(){var e=$(this),t=e.nza("name"),n=e.val(),o=$(this).prop("required")||!1;if(""!==t){var a=""!==n||!1===o;r=r&&a,!0===a?(i.data.append(t,n),e[0].setCustomValidity("")):""!==$(this).nza("ocms-nvnote")&&e[0].setCustomValidity($(this).nza("ocms-nvnote"))}})),!0===r&&(n.ldng(1),$ocms.postXT.call(this,i))}},function(e){e.fn.nza=function(t,n){var i=e(this).attr(t);return void 0!==i&&!1!==i?i:n||""},e.fn.serializeObject=function(t,n){var i=/\r?\n/g,r=/^(?:submit|button|image|reset|file)$/i,o=/^(?:input|select|textarea|keygen)/i,a=/^(?:checkbox|radio)$/i,s=bool((n=n||{}).typedvalues,!1),l={},c=e(this),u=c.find(':input:not([nosend],[type="file"])').addBack(":input"),d=!0;return e.each(u.not(".tinymce").get(),(function(n,c){var u=e(this),f=this,m=(this.type||"").toLowerCase(),p=u.prop("required")||!1;if(!0===(f.name&&!u.is(":disabled")&&o.test(f.nodeName)&&!r.test(m))){var h=u.val(),g=f.name,y=u.nza("data-format").split(":"),v=u.nza("pattern")||".*";if(!0===a.test(m)&&(h=f.checked?""!==h?h:"true":""),"date"===y[0].substr(0,4)&&y.length>1)"boolean"==typeof(h=parseDt(h,y.slice(1).join(":")))&&(h=null),null===h&&"date"===u.prop("type").substr(0,4)&&!1===isNaN(new Date(u.val()))&&(h=new Date(u.val())),h instanceof Date==!0&&"function"==typeof h.getMonth?!1===s&&(h=fdt(h,"date"===y[0]?"dts":"iso")):h=null;else if(("number"===m||"float"===y[0]||"integer"===y[0])&&!0===s){let e,t=String(h).replace(",",".");e="integer"===y[0]?parseInt(t):parseFloat(t),h=isNaN(e)?h:e}if(!0===p&&(""===h||null==h||"string"==typeof h&&null===h.match(v))?(!0===bool(t,!1)&&f.setCustomValidity(u.nza("ocms-nvnote",$ocms.t.inv||"Invalid field")),h=null):!0===bool(t,!1)&&f.setCustomValidity(""),null!=h&&"string"==typeof h){let e=l[g];null!=e?Array.isArray(e)?e.push(h.replace(i,"\r\n")):l[g]=[e,h.replace(i,"\r\n")]:l[g]=h.replace(i,"\r\n")}else if(null!=h){let e=l[g];null!=e?Array.isArray(e)?e.push(h):l[g]=[e,h]:l[g]=h}else d=!1}})),u.filter(".tinymce").each((function(t,n){var i=e(this),r=((this.type||"").toLowerCase(),i.prop("required")||!1);try{var o=tinymce.get(e(n).attr("id"));if(o){var a=e(n).attr("name"),s=o.getContent();!1===r||""!==(s||"")?l[a]=s:d=!1}}catch(t){e.noop()}})),c.toggleClass("invalid",!d),d?l:null},e.fn.sendForm=function(t,n,i){var r=e(this);i=i||{};var o={url:t,success:function(e){if(i.response=e,"function"==typeof n)n(e);r.closest("div.modal").remove()},error:function(e,t,n){"function"==typeof i.error?i.error.call(this,e):$ocms.failure.call(this,e)},complete:function(){r.ldng(0),"function"==typeof i.complete&&i.complete.call(this,jqXHR)}},a=r.find('input[type="file"]');o.data=new FormData,a.length>0&&e.each(a[0].files,(function(e,t){o.data.append(e,t),o.data.append("file_lastmodified",$ocms.isodt(t.lastModifiedDate))}));var s=r.serializeObject();e.each(s||{},(function(e,t){o.data.append(e,t)})),r.ldng(),$ocms.postXT.call(this,o)},e.fn.checkValidity=function(){var t=e(this),n=!0;return t.each((function(e,t){n=n&&t.checkValidity()})),n},e.fn.wrap=function(t,n){var i=e(this),r=$$.dc(t).attr(n||{}).insertAfter(i);return i.append(r),r}}(jQuery),$ocms.logout=function(){$ocms.postXT({url:$ocms.url("logout"),complete:function(){window.location.reload()}})},$ocms.login={send:function(e){e.preventDefault();var t=$(this);if(!0===t.find("#dbtn-confirm").hasClass("disabled"))return!1;var n=t.serializeObject();return n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),n.loginaccount=ne(n.loginaccount,$ocms.auth.account||$ocms.auth.requestedaccount||""),""===ne(n.loginaccount)&&!0===bool($ocms.auth.accountrequired,!0)?(alert($t.l16),!1):($ocms.postXT({url:$ocms.url("login"),data:n,success:function(){window.location.reload()}}),!1)},uichange:function(){let e=$(this),t=e.closest("form"),n=bool($ocms.auth.accountrequired,!0),i=ne(t.find('[name="loginaccount"]').val(),$ocms.auth.account||$ocms.auth.requestedaccount||"");if(""!==i||!1===n){var r=t.find('[name="userlogin"]').empty().val(""),o=t.find('[name="username"]').empty().val(""),a=$("#dlg_userlogin_sel").empty().val(""),s=e.val()||"";if(!1===e.checkValidity()&&""===s)return;var l=e.closest("table").ldng();$ocms.postXT.call(this,{url:$ocms.url("auth"),data:{userinfo:s,account:i||""},success:function(e,t,n){if(1===e.length){var i=e[0];r.val(i.login).change().attr("required","").removeAttr("nosend"),o.val(i.name).change().attr("required","").show(),a.removeAttr("required").attr("nosend","").hide()}else e.length>0?(o.hide().removeAttr("required"),r.removeAttr("required").attr("nosend",""),0===a.length&&(a=$("").attr({name:"userlogin",size:e.length,id:"dlg_userlogin_sel",class:"form-control",required:""}).css({width:"100%","max-width":"100%",padding:"2px"}).insertAfter(o)),$.each(e,(function(e,t){var n=$("").attr({value:t.login,style:"padding-top: 2px; padding-bottom: 5px;","border-bottom":"1px solid #EEE;"}).text(t.name).appendTo(a);e%2==0&&n.css({"background-color":"#F9F9F9"})})),a.attr("required","").removeAttr("nosend")):(a.hide().attr("nosend",""),o.attr("required","").show(),r.attr("required","").removeAttr("nosend"),alert($t.l9))},error:function(e){$ocms.failure.call(this,e)},complete:function(){l.ldng(0)}})}else alert($t.l18)},sendpassword:function(e){var t=$(''),n=t.find(".form-body"),i=null;t.find("form").submit((function(e){e.preventDefault();var r=$(this).serializeObject(!0),o=null===i,a=o?"spwc":"spw";return $ocms.postXT.call(this,{url:$ocms.url(a),data:r,complete:function(){o?(n.append('
        Ihnen wurde ein Code per SMS zugesandt.
        Bitte tragen Sie den hier ein:
        '),i=$('
        ').appendTo(n)):(alert($t.l13),t.remove())},error:()=>{}}),!1})),t.find(".modal-close").click((function(){t.remove()}));var r=[];$.each($t.l7a.split("\n"),((e,t)=>{Array.prototype.push.apply(r,[$("
        "),$("").text(t)])})),t.find(".modal-note").append($('').text($t.alert)).append(r),t.appendTo("body"),setTimeout((function(){$(".modal").find('input[name="lastname"]').focus()}),600)}},$(document).ready((function(){$("#loginform").submit($ocms.login.send)})); \ No newline at end of file diff --git a/Fuchs/wwwroot/web/tools.js b/Fuchs/wwwroot/web/tools.js index ceb47a5..f36c9c0 100644 --- a/Fuchs/wwwroot/web/tools.js +++ b/Fuchs/wwwroot/web/tools.js @@ -1,4 +1,5 @@ -/*! js-cookie v3.0.1 | MIT */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
        "],col:[2,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
        ",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0 + + + \ No newline at end of file diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__createReminder.sql b/Fuchs_Database/dbo/Stored Procedures/fds__createReminder.sql index c3618b4..dac340b 100644 --- a/Fuchs_Database/dbo/Stored Procedures/fds__createReminder.sql +++ b/Fuchs_Database/dbo/Stored Procedures/fds__createReminder.sql @@ -57,7 +57,8 @@ BEGIN ,[UserCreated] ,[DateModified] ,[UserModified] - ,[file]) + ,[file] + ,[file_guid]) OUTPUT inserted.* INTO @OUT VALUES @@ -82,7 +83,8 @@ BEGIN ,@authuser ,@now ,@authuser - ,NULL); + ,NULL + ,NEWID()); SELECT TOP(1) @Id = [id] FROM @out; diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual.sql b/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual.sql new file mode 100644 index 0000000..3a53a7f --- /dev/null +++ b/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual.sql @@ -0,0 +1,24 @@ +-- ============================================= +-- Description: Returns the raw field values of a single manually entered +-- banking transaction (TransactionTypeIdCode = 'MAN'), so the +-- "manuelle Buchung ändern" dialog can be pre-filled. +-- ============================================= +CREATE PROCEDURE [dbo].[fds__getBankingtransaction_manual] + @taID varchar(10), + @authuser varchar(100) +AS +BEGIN + SET NOCOUNT ON; + IF [dbo].[fis_getModuleAuth]('fds_bam', @authuser) < 1 + THROW 60000, N'not authorized', 1; + + SELECT + [taID] + , [ValueDate] + , [Amount] + , [NameOfPayer] + , [SepaRemittanceInformation] + FROM [dbo].[fds__bankingtransactions] + WHERE [taID] = @taID + AND [TransactionTypeIdCode] = 'MAN'; +END diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual_1.sql b/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual_1.sql new file mode 100644 index 0000000..aa83529 --- /dev/null +++ b/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransaction_manual_1.sql @@ -0,0 +1,25 @@ + +-- ============================================= +-- Description: Returns the raw field values of a single manually entered +-- banking transaction (TransactionTypeIdCode = 'MAN'), so the +-- "manuelle Buchung ändern" dialog can be pre-filled. +-- ============================================= +CREATE PROCEDURE [dbo].[fds__getBankingtransaction_manual] + @taID varchar(10), + @authuser varchar(100) +AS +BEGIN + SET NOCOUNT ON; + IF [dbo].[fis_getModuleAuth]('fds_bam', @authuser) < 1 + THROW 60000, N'not authorized', 1; + + SELECT + [taID] + , [ValueDate] + , [Amount] + , [NameOfPayer] + , [SepaRemittanceInformation] + FROM [dbo].[fds__bankingtransactions] + WHERE [taID] = @taID + AND [TransactionTypeIdCode] = 'MAN'; +END \ No newline at end of file diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransfers_questionable.sql b/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransfers_questionable.sql index d935289..21b8aad 100644 --- a/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransfers_questionable.sql +++ b/Fuchs_Database/dbo/Stored Procedures/fds__getBankingtransfers_questionable.sql @@ -54,6 +54,7 @@ BEGIN , bt.NameOfPayer , bt.SepaRemittanceInformation , bt.EndToEndReference + , [IsManual] = CAST(CASE WHEN bt.[TransactionTypeIdCode] = 'MAN' THEN 1 ELSE 0 END AS bit) , [order] = ROW_NUMBER() OVER (ORDER BY bt.[valuedate] DESC) FROM dbo.[fds__bankingtransactions] as bt @@ -67,7 +68,7 @@ BEGIN AND NOT (ISNULL(bt.[AccountNumberOfPayer],'') IN ('DE52301502000002091478') AND ISNULL(bt.[SepaRemittanceInformation],'') like ('%umbuchung%')) AND NOT (ISNULL(bt.[AccountNumberOfPayer],'') IN ('DE23501108006161606386') AND ISNULL(bt.[SepaRemittanceInformation],'') like ('%ebay%')) AND NOT (ISNULL(bt.[SepaRemittanceInformation],'') like ('%Umsatzsteuer%')) - AND ISNULL(bt.AccountNumberOfPayer ,'') <> '' + AND (ISNULL(bt.AccountNumberOfPayer ,'') <> '' OR bt.[TransactionTypeIdCode] = 'MAN') ) AND CASE WHEN inv.[InvId] is null THEN 1 WHEN (ISNULL(inv.ispayed,0) = 1 and fds = 1) THEN 0 diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__getReminder.sql b/Fuchs_Database/dbo/Stored Procedures/fds__getReminder.sql index 3d726f0..93fc9fb 100644 --- a/Fuchs_Database/dbo/Stored Procedures/fds__getReminder.sql +++ b/Fuchs_Database/dbo/Stored Procedures/fds__getReminder.sql @@ -44,6 +44,7 @@ BEGIN ,[DateModified] ,[UserModified] ,[file] = CASE WHEN ISNULL(@includefile,0) = 1 THEN [file] else NULL END -- do not return file if not explicitly requested + ,[file_guid] FROM [dbo].[fds__reminder] WHERE [Id] = @Id AND @Id is not null; diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__prepInvoice.sql b/Fuchs_Database/dbo/Stored Procedures/fds__prepInvoice.sql index 82dae8d..f53f3a5 100644 --- a/Fuchs_Database/dbo/Stored Procedures/fds__prepInvoice.sql +++ b/Fuchs_Database/dbo/Stored Procedures/fds__prepInvoice.sql @@ -177,7 +177,7 @@ BEGIN DECLARE @step [dbo].[fds__tt__mfr_steps]; - DECLARE @itm [dbo].[fds__tt__mfr_items]; + DECLARE @itm [dbo].[fds__tt__mfr_items+]; DECLARE @company TABLE ( [Id] [bigint] NOT NULL, [Location#ID] [bigint] NULL, @@ -207,9 +207,19 @@ BEGIN INSERT INTO @itm SELECT itm.* - , [baseorder] = s.[baseorder], [order] = ROW_NUMBER() OVER (PARTITION BY [ServiceRequestId] ORDER BY [SortOrder], itm.[Id]) - from [dbo].[mfr__items] as itm JOIN @SReq as s ON itm.ServiceRequestId = s.[Id] - where itm.[Type] <> 'PartialInvoice'; + , [baseorder] = s.[baseorder] + , [order] = ROW_NUMBER() OVER (PARTITION BY itm.[ServiceRequestId] ORDER BY itm.[SortOrder], itm.[Id]) + , [SetItmID] = CASE WHEN itm.[Type] = 'Set' AND ISNULL(itm.[Price], 0) > 0 THEN NULL + ELSE MAX(CASE WHEN itm.[Type] = 'Set' AND ISNULL(itm.[Price], 0) > 0 THEN itm.[Id] ELSE NULL END) + OVER ( + PARTITION BY itm.[ServiceRequestId] + ORDER BY itm.[SortOrder], itm.[Id] + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW + ) + END + FROM [dbo].[mfr__items] as itm + JOIN @SReq as s ON itm.ServiceRequestId = s.[Id] + WHERE itm.[Type] <> 'PartialInvoice'; DECLARE @NUM_of_int_Invoices int = 0; @@ -264,6 +274,7 @@ BEGIN ,[UnitString] = 'Pauschal' ,[baseorder] = ai.[baseorder] , [order] = 10000 + (ROW_NUMBER() OVER (PARTITION BY ai.[mfr__servicerequest] ORDER BY ai.[dateFinalized], ai.DateCreated) * 10) + ,[SetItmId] = null FROM associated_interims as ai UNION SELECT @@ -293,6 +304,7 @@ BEGIN ,[UnitString] = 'Pauschal' ,[baseorder] = ai.[baseorder] , [order] = 10001 + (ROW_NUMBER() OVER (PARTITION BY ai.[mfr__servicerequest] ORDER BY ai.[dateFinalized], ai.DateCreated) * 10) + ,[SetItmId] = null FROM associated_interims as ai WHERE ISNULL(ai.open_amount,0.0) > 0.0; @@ -381,6 +393,7 @@ BEGIN , itm.[NameOrNumber] , [Note] = IIF(ISNULL([Discount], 0) > 0, 'Rabatt '+ FORMAT([discount]*0.01,'#.0%','de-de') + '', '') + ISNULL(itm.[Note],'') , [order] = (itm.[baseorder] * 100) + itm.[order] + , [SetItmId] FROM @itm as itm LEFT JOIN [dbo].[fds__custom_vat] as vat ON itm.[Id] = vat.[EntityId] and vat.[EntityType] = 'item'; END diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__prepStorno_recreate.sql b/Fuchs_Database/dbo/Stored Procedures/fds__prepStorno_recreate.sql index 995934b..96b8b76 100644 --- a/Fuchs_Database/dbo/Stored Procedures/fds__prepStorno_recreate.sql +++ b/Fuchs_Database/dbo/Stored Procedures/fds__prepStorno_recreate.sql @@ -176,7 +176,7 @@ BEGIN DECLARE @step [dbo].[fds__tt__mfr_steps]; - DECLARE @itm [dbo].[fds__tt__mfr_items]; + DECLARE @itm [dbo].[fds__tt__mfr_items+]; DECLARE @company TABLE ( [Id] [bigint] NOT NULL, [Location#ID] [bigint] NULL, @@ -204,8 +204,19 @@ BEGIN INSERT INTO @itm - SELECT itm.*, [baseorder] = s.[baseorder], [order] = ROW_NUMBER() OVER (PARTITION BY [ServiceRequestId] ORDER BY [SortOrder], itm.[Id]) - from [dbo].[mfr__items] as itm JOIN @SReq as s ON itm.ServiceRequestId = s.[Id]; + SELECT itm.* + , [baseorder] = s.[baseorder] + , [order] = ROW_NUMBER() OVER (PARTITION BY itm.[ServiceRequestId] ORDER BY itm.[SortOrder], itm.[Id]) + , [SetItmID] = CASE WHEN itm.[Type] = 'Set' AND ISNULL(itm.[Price], 0) > 0 THEN NULL + ELSE MAX(CASE WHEN itm.[Type] = 'Set' AND ISNULL(itm.[Price], 0) > 0 THEN itm.[Id] ELSE NULL END) + OVER ( + PARTITION BY itm.[ServiceRequestId] + ORDER BY itm.[SortOrder], itm.[Id] + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW + ) + END + FROM [dbo].[mfr__items] as itm + JOIN @SReq as s ON itm.ServiceRequestId = s.[Id]; DECLARE @NUM_of_int_Invoices int = 0; @@ -238,7 +249,9 @@ BEGIN ,[CreatorId] = NULL ,[UnitId] = 15825600513 ,[UnitString] = 'Pauschal' - ,[baseorder] = s.[baseorder], [order] = 10000 + ROW_NUMBER() OVER (PARTITION BY srq.[mfr__servicerequest] ORDER BY inv.[dateFinalized], inv.DateCreated) + ,[baseorder] = s.[baseorder] + , [order] = 10000 + ROW_NUMBER() OVER (PARTITION BY srq.[mfr__servicerequest] ORDER BY inv.[dateFinalized], inv.DateCreated) + ,[SetItmID] = null from [dbo].[fds__invoices] as inv JOIN [dbo].[fds__invoice_servicerequests] as srq ON inv.[Id] = srq.[InvId] AND inv.[InvoiceType] = 'i' --important JOIN @SReq as s ON srq.[mfr__servicerequest] = s.[Id] @@ -292,7 +305,9 @@ BEGIN ,[CreatorId] = NULL ,[UnitId] = 15825600513 ,[UnitString] = 'Pauschal' - ,[baseorder] = 0, [order] = 1 + ,[baseorder] = 0 + , [order] = 1 + ,[SetItmID] = null from [dbo].[fds__invoices] as inv WHERE ISNULL(inv.[isFinal],0) = 1 AND ISNULL(inv.[IsCanceled],0) = 0 AND inv.[Id] = @InvId; @@ -373,6 +388,7 @@ BEGIN , itm.[NameOrNumber] , itm.[Note] , [order] = (itm.[baseorder] * 100) + itm.[order] + , [SetItmId] FROM @itm as itm LEFT JOIN [dbo].[fds__custom_vat] as vat ON itm.[Id] = vat.[EntityId] and vat.[EntityType] = 'item'; END diff --git a/Fuchs_Database/dbo/Stored Procedures/fds__setBankingtransaction_manual.sql b/Fuchs_Database/dbo/Stored Procedures/fds__setBankingtransaction_manual.sql new file mode 100644 index 0000000..37f4d96 --- /dev/null +++ b/Fuchs_Database/dbo/Stored Procedures/fds__setBankingtransaction_manual.sql @@ -0,0 +1,64 @@ + +CREATE PROCEDURE [dbo].[fds__setBankingtransaction_manual] + @taID varchar(10) = NULL, -- NULL=INSERT, value=UPDATE, value+others NULL=DELETE + @ValueDate date = NULL, + @Amount numeric(9,2) = NULL, + @NameOfPayer nvarchar(140) = NULL, + @SepaRemittanceInformation varchar(200) = NULL, + @authuser varchar(100) = NULL +AS +BEGIN + SET NOCOUNT ON; + IF [dbo].[fis_getModuleAuth]('fds_bam', @authuser) < 2 + THROW 60000, N'not authorized', 1; + + BEGIN TRY + + -- DELETE + IF @taID IS NOT NULL AND @Amount IS NULL + BEGIN + DELETE FROM [dbo].[fds__bankingtransactions] + WHERE [taID] = @taID; + RETURN; + END + + -- INSERT + IF @taID IS NULL + BEGIN + INSERT INTO [dbo].[fds__bankingtransactions] + ([taID], [AccountIdentification], [ValueDate], [Amount], + [FundsCode], [AccountNumberOfPayer], [BankCodeOfPayer], + [CompensationAmount], [CreditorReference], [CreditorsReferenceParty], + [CustomerReference], [EndToEndReference], [JournalNumber], + [MandateReference], [NameOfPayer], [OriginalAmount], + [OriginatorsIdentificationCode], [PayersReferenceParty], + [PostingText], [SepaRemittanceInformation], [TextKeyAddition], + [TransactionCode], [IsUnstructuredData], [UnstructuredData], + [UnstructuredRemittanceInformation], [DebitCreditMark], [TransactionTypeIdCode]) + VALUES + ([dbo].[fds__fn_bankingtransaction_id](), '999', @ValueDate, @Amount, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, @NameOfPayer, NULL, + NULL, NULL, + 'MANUELLE GUTSCHRIFT', @SepaRemittanceInformation, NULL, + NULL, 0, NULL, + NULL, 'C', 'MAN'); + RETURN; + END + + -- UPDATE + UPDATE [dbo].[fds__bankingtransactions] + SET + [ValueDate] = @ValueDate, + [Amount] = @Amount, + [NameOfPayer] = @NameOfPayer, + [SepaRemittanceInformation] = @SepaRemittanceInformation + WHERE [taID] = @taID; + + END TRY + BEGIN CATCH + THROW; + END CATCH +END \ No newline at end of file diff --git a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__companies.sql b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__companies.sql index 965d0df..812a79b 100644 --- a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__companies.sql +++ b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__companies.sql @@ -20,19 +20,19 @@ BEGIN IF @referencetable = 'mfr__companies' BEGIN DELETE p - OUTput deleted.*, @now INTO [dbo].[mfr__d_*PartnerSet] + --OUTput deleted.*, @now INTO [dbo].[mfr__d_*PartnerSet] FROM [dbo].[mfr__*PartnerSet] as p WHERE p.Property like 'Company[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = p.[EntityId]); DELETE cv - OUTput deleted.*, @now INTO [dbo].[mfr__d_#customvalues] + --OUTput deleted.*, @now INTO [dbo].[mfr__d_#customvalues] FROM [dbo].[mfr__#customvalues] as cv WHERE cv.Property like 'Company[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = cv.[EntityId]); DELETE lc - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_#locations] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_#locations] FROM [dbo].[mfr__#locations] as lc WHERE lc.Property like 'Company[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = lc.[EntityId]); DELETE cm - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_comments] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_comments] FROM [dbo].[mfr__comments] as cm WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = cm.[CompanyId] AND ISNULL(cm.[ServiceRequestId],0) = 0); END diff --git a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__serviceobjects.sql b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__serviceobjects.sql index 5dffeb8..87ca13f 100644 --- a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__serviceobjects.sql +++ b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__serviceobjects.sql @@ -20,19 +20,19 @@ BEGIN IF @referencetable = 'mfr__serviceobjects' BEGIN DELETE p - OUTput deleted.*, @now INTO [dbo].[mfr__d_*PartnerSet] + --OUTput deleted.*, @now INTO [dbo].[mfr__d_*PartnerSet] FROM [dbo].[mfr__*PartnerSet] as p WHERE p.Property like 'ServiceObject[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = p.[EntityId]); DELETE cv - OUTput deleted.*, @now INTO [dbo].[mfr__d_#customvalues] + --OUTput deleted.*, @now INTO [dbo].[mfr__d_#customvalues] FROM [dbo].[mfr__#customvalues] as cv WHERE cv.Property like 'ServiceObject[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = cv.[EntityId]); DELETE lc - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_#locations] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_#locations] FROM [dbo].[mfr__#locations] as lc WHERE lc.Property like 'ServiceObject[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = lc.[EntityId]); DELETE itm - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_items] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_items] FROM [dbo].[mfr__items] as itm WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = itm.[ServiceObjectId] and ISNULL(itm.[ServiceRequestId],0) = 0); END diff --git a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__servicerequests.sql b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__servicerequests.sql index 0816004..564c525 100644 --- a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__servicerequests.sql +++ b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__servicerequests.sql @@ -24,39 +24,39 @@ BEGIN IF @referencetable = 'mfr__servicerequests' BEGIN DELETE p - OUTput deleted.*, @now INTO [dbo].[mfr__d_*PartnerSet] + --OUTput deleted.*, @now INTO [dbo].[mfr__d_*PartnerSet] FROM [dbo].[mfr__*PartnerSet] as p WHERE p.Property like 'ServiceRequest[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = p.[EntityId]); DELETE cv - OUTput deleted.*, @now INTO [dbo].[mfr__d_#customvalues] + --OUTput deleted.*, @now INTO [dbo].[mfr__d_#customvalues] FROM [dbo].[mfr__#customvalues] as cv WHERE cv.Property like 'ServiceRequest[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = cv.[EntityId]); DELETE lc - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_#locations] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_#locations] FROM [dbo].[mfr__#locations] as lc WHERE lc.Property like 'ServiceRequest[:]%' AND EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = lc.[EntityId]); DELETE stp - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_steps] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_steps] FROM [dbo].[mfr__steps] as stp WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = stp.[ServiceRequestId] and ISNULL(stp.[StepListTemplateId],0) = 0); DELETE app - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_appointments] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_appointments] FROM [dbo].[mfr__appointments] as app WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = app.[ServiceRequestId]); DELETE itm - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_items] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_items] FROM [dbo].[mfr__items] as itm WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = itm.[ServiceRequestId] and ISNULL(itm.[ServiceobjectId],0) = 0); DELETE te - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_timeevents] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_timeevents] FROM [dbo].[mfr__timeevents] as te WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = te.[ServiceRequestId]); DELETE sm - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_stockmovements] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_stockmovements] FROM [dbo].[mfr__stockmovements] as sm WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = sm.[ServiceRequestId]); DELETE cm - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_comments] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_comments] FROM [dbo].[mfr__comments] as cm WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = cm.[ServiceRequestId] AND ISNULL(cm.[CompanyId],0) = 0); END diff --git a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steplisttemplates.sql b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steplisttemplates.sql index eff731b..272e8e8 100644 --- a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steplisttemplates.sql +++ b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steplisttemplates.sql @@ -22,7 +22,7 @@ BEGIN IF @referencetable = 'mfr__steplisttemplates' BEGIN DELETE stp - OUTPUT deleted.*, @now INTO [dbo].[mfr__d_steps] + --OUTPUT deleted.*, @now INTO [dbo].[mfr__d_steps] FROM [dbo].[mfr__steps] as stp WHERE EXISTS (SELECT * FROM @tmp as tmp where tmp.[id] = stp.[StepListTemplateId] and ISNULL(stp.[ServiceRequestId],0) = 0); END diff --git a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steps.sql b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steps.sql index 3502e29..c8a6157 100644 --- a/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steps.sql +++ b/Fuchs_Database/dbo/Stored Procedures/mfr__updt__steps.sql @@ -124,26 +124,26 @@ BEGIN $action, deleted.* INTO @ARCHIVE; - INSERT INTO [dbo].[mfr__d_steps] - SELECT [Id] - ,[MobileId] - ,[Version] - ,[Name] - ,[IsDone] - ,[HasError] - ,[TrackingId] - ,[Type] - ,[SortOrder] - ,[Data] - ,[DateModifiedOffline] - ,[ServiceRequestId] - ,[Description] - ,[Comment] - ,[InternalComment] - ,[ServiceObjectId] - ,[StepListTemplateId] - ,[ParentId] - ,[DateDeleted] = @now - FROM @ARCHIVE - WHERE [ActionType] IN ( 'DELETE', 'UPDATE' ); + --INSERT INTO [dbo].[mfr__d_steps] + -- SELECT [Id] + -- ,[MobileId] + -- ,[Version] + -- ,[Name] + -- ,[IsDone] + -- ,[HasError] + -- ,[TrackingId] + -- ,[Type] + -- ,[SortOrder] + -- ,[Data] + -- ,[DateModifiedOffline] + -- ,[ServiceRequestId] + -- ,[Description] + -- ,[Comment] + -- ,[InternalComment] + -- ,[ServiceObjectId] + -- ,[StepListTemplateId] + -- ,[ParentId] + -- ,[DateDeleted] = @now + -- FROM @ARCHIVE + -- WHERE [ActionType] IN ( 'DELETE', 'UPDATE' ); END \ No newline at end of file diff --git a/Fuchs_Database/dbo/User Defined Types/fds__tt__mfr_items+.sql b/Fuchs_Database/dbo/User Defined Types/fds__tt__mfr_items+.sql new file mode 100644 index 0000000..47547c2 --- /dev/null +++ b/Fuchs_Database/dbo/User Defined Types/fds__tt__mfr_items+.sql @@ -0,0 +1,29 @@ +CREATE TYPE [dbo].[fds__tt__mfr_items+] AS TABLE ( + [Id] BIGINT NULL, + [Version] INT NULL, + [QuantityHours] NUMERIC (10, 3) NULL, + [PlannedQuantityHours] NUMERIC (10, 3) NULL, + [ItemTypeId] BIGINT NULL, + [ItemNumber] NVARCHAR (255) NULL, + [TrackingId] NVARCHAR (255) NULL, + [Manufacture] NVARCHAR (255) NULL, + [Price] NUMERIC (10, 3) NULL, + [Costs] NUMERIC (10, 3) NULL, + [NameOrNumber] NVARCHAR (255) NULL, + [CustomValues] NVARCHAR (MAX) NULL, + [Note] NVARCHAR (MAX) NULL, + [ExternalId] NVARCHAR (255) NULL, + [Discount] NUMERIC (10, 3) NULL, + [VAT] NUMERIC (10, 3) NULL, + [IsManual] BIT NULL, + [SortOrder] INT NULL, + [Type] NVARCHAR (255) NULL, + [ServiceRequestId] BIGINT NULL, + [ServiceObjectId] BIGINT NULL, + [CreatorId] BIGINT NULL, + [UnitId] BIGINT NULL, + [UnitString] NVARCHAR (255) NULL, + [baseorder] INT NULL, + [order] INT NULL, + [SetItmId] BIGINT NULL); + diff --git a/Fuchs_Database/dbo/User Defined Types/fds__tt__reminder_core.sql b/Fuchs_Database/dbo/User Defined Types/fds__tt__reminder_core.sql index f045a48..5c9c660 100644 --- a/Fuchs_Database/dbo/User Defined Types/fds__tt__reminder_core.sql +++ b/Fuchs_Database/dbo/User Defined Types/fds__tt__reminder_core.sql @@ -1,27 +1,28 @@ CREATE TYPE [dbo].[fds__tt__reminder_core] AS TABLE ( - [Id] VARCHAR (10) NULL, - [Version] INT NULL, - [DocumentName] VARCHAR (100) NULL, - [InvId] VARCHAR (15) NULL, - [CustomerId] BIGINT NULL, - [SendToAddress] NVARCHAR (1000) NULL, - [SendToEmail] NVARCHAR (255) NULL, - [type] VARCHAR (3) NULL, - [amount] NUMERIC (10, 3) NULL, - [amount_payed] NUMERIC (10, 3) NULL, - [amount_open] NUMERIC (10, 3) NULL, - [subject] NVARCHAR (255) NULL, - [text] NVARCHAR (2000) NULL, - [IsSent] BIT NULL, - [IsFinal] BIT NULL, - [CustomValues] NVARCHAR (MAX) NULL, - [DateSent] DATETIME NULL, - [UserSent] VARCHAR (25) NULL, - [DateFinalized] DATETIME NULL, - [UserFinalized] VARCHAR (25) NULL, - [DateCreated] DATETIME NULL, - [UserCreated] VARCHAR (25) NULL, - [DateModified] DATETIME NULL, - [UserModified] VARCHAR (25) NULL, - [file] VARBINARY (MAX) NULL); + [Id] VARCHAR (10) NULL, + [Version] INT NULL, + [DocumentName] VARCHAR (100) NULL, + [InvId] VARCHAR (15) NULL, + [CustomerId] BIGINT NULL, + [SendToAddress] NVARCHAR (1000) NULL, + [SendToEmail] NVARCHAR (255) NULL, + [type] VARCHAR (3) NULL, + [amount] NUMERIC (10, 3) NULL, + [amount_payed] NUMERIC (10, 3) NULL, + [amount_open] NUMERIC (10, 3) NULL, + [subject] NVARCHAR (255) NULL, + [text] NVARCHAR (2000) NULL, + [IsSent] BIT NULL, + [IsFinal] BIT NULL, + [CustomValues] NVARCHAR (MAX) NULL, + [DateSent] DATETIME NULL, + [UserSent] VARCHAR (25) NULL, + [DateFinalized] DATETIME NULL, + [UserFinalized] VARCHAR (25) NULL, + [DateCreated] DATETIME NULL, + [UserCreated] VARCHAR (25) NULL, + [DateModified] DATETIME NULL, + [UserModified] VARCHAR (25) NULL, + [file] VARBINARY (MAX) NULL, + [file_guid] UNIQUEIDENTIFIER NULL); diff --git a/MFR_RESTClient/MFR_RESTClient.csproj b/MFR_RESTClient/MFR_RESTClient.csproj index 6d45cd3..a8258f9 100644 --- a/MFR_RESTClient/MFR_RESTClient.csproj +++ b/MFR_RESTClient/MFR_RESTClient.csproj @@ -32,7 +32,7 @@ - +