From 3601c796310f7eac9ace74267416103916fcfdc9 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Tue, 13 May 2025 17:11:19 +0200 Subject: [PATCH] ProBalance/Service/CustomAccountingService.cs - StornoRg eingerichtet --- ReportImp/ProBalance/ProBalance.csproj | 1 + .../Service/CustomAccountingService.cs | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ReportImp/ProBalance/Service/CustomAccountingService.cs diff --git a/ReportImp/ProBalance/ProBalance.csproj b/ReportImp/ProBalance/ProBalance.csproj index eb4f1bb08..5e63c59f5 100644 --- a/ReportImp/ProBalance/ProBalance.csproj +++ b/ReportImp/ProBalance/ProBalance.csproj @@ -77,6 +77,7 @@ Sammelrechnung.cs + Component diff --git a/ReportImp/ProBalance/Service/CustomAccountingService.cs b/ReportImp/ProBalance/Service/CustomAccountingService.cs new file mode 100644 index 000000000..b7ebe10dc --- /dev/null +++ b/ReportImp/ProBalance/Service/CustomAccountingService.cs @@ -0,0 +1,42 @@ +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 ProBalance.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 = 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