From d77cd15f564383375335bc9f49ef9baa8056aeda Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 2 Jul 2025 12:11:52 +0200 Subject: [PATCH] PSM/Invoicing/CustomAccountingService.cs - Storno Rechnung --- .../PSM/Invoicing/CustomAccountingService.cs | 45 +++++++++++++++++++ ReportImp/PSM/PSM.csproj | 3 ++ 2 files changed, 48 insertions(+) create mode 100644 ReportImp/PSM/Invoicing/CustomAccountingService.cs diff --git a/ReportImp/PSM/Invoicing/CustomAccountingService.cs b/ReportImp/PSM/Invoicing/CustomAccountingService.cs new file mode 100644 index 000000000..24e78a001 --- /dev/null +++ b/ReportImp/PSM/Invoicing/CustomAccountingService.cs @@ -0,0 +1,45 @@ +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 PSM.Invoicing +{ + 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 = inc.GetNextInvoiceNumber(invoiceCounter, i.InvoiceBase) + " 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 diff --git a/ReportImp/PSM/PSM.csproj b/ReportImp/PSM/PSM.csproj index eae603a81..497fb7606 100644 --- a/ReportImp/PSM/PSM.csproj +++ b/ReportImp/PSM/PSM.csproj @@ -31,6 +31,7 @@ 4 + @@ -39,6 +40,7 @@ + @@ -61,6 +63,7 @@ InvoiceCustomerReport.cs +