From 7893c3b8f90c634d4c53112872a0169f0bd4a1f6 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 19 Jul 2023 18:03:09 +0200 Subject: [PATCH] BehindertNaUnd - Storno --- .../BehindertNaUnd/BehindertNaUnd.csproj | 1 + .../Service/CustomAccountingService.cs | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 ReportImp/BehindertNaUnd/Service/CustomAccountingService.cs diff --git a/ReportImp/BehindertNaUnd/BehindertNaUnd.csproj b/ReportImp/BehindertNaUnd/BehindertNaUnd.csproj index ece9ae464..c28377bc7 100644 --- a/ReportImp/BehindertNaUnd/BehindertNaUnd.csproj +++ b/ReportImp/BehindertNaUnd/BehindertNaUnd.csproj @@ -66,6 +66,7 @@ AssistenzRechung.cs + Component diff --git a/ReportImp/BehindertNaUnd/Service/CustomAccountingService.cs b/ReportImp/BehindertNaUnd/Service/CustomAccountingService.cs new file mode 100644 index 000000000..85092f57c --- /dev/null +++ b/ReportImp/BehindertNaUnd/Service/CustomAccountingService.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Service.DCEntityMapper; +using BeWo.Service.Plugins; +using BS.Shared; +using BS.Shared.DataContracts; + + + +namespace BehindertNaUnd.Service +{ + public class CustomAccountingService : AccountingService + { + public override ServiceInvoice ErstelleStornoRechnung(InvoiceBaseDC ibdc) + { + var i = base.ErstelleStornoRechnung(ibdc); + //if (!String.IsNullOrEmpty(i.InvoiceBase.InvoiceNumber)) + //{ + // //i.InvoiceBase.InvoiceNumber = ibdc.InvoiceNumber + " Storno"; + // i.InvoiceBase.InvoiceNumber = i.InvoiceBase.InvoiceNumber + " Storno"; + //} + int invoiceCounter = 0; + var inc = PluginLoader.FindClass(); + i.InvoiceBase.InvoiceNumber = i.InvoiceBase.InvoiceNumber + " Storno"; + + if (String.IsNullOrEmpty(i.InvoiceBase.InvoiceTypeText)) + { + i.InvoiceBase.InvoiceTypeText = "Storno"; + } + else + { + i.InvoiceBase.InvoiceTypeText += " Storno"; + } + + DAOFactory.GenericDAO.Insert(i); + + //inc.IncreaseInvoiceNumber(1, null); + + return i; + } + } +} \ No newline at end of file