diff --git a/ReportImp/AwoDortmund/Service/CustomAccountingService.cs b/ReportImp/AwoDortmund/Service/CustomAccountingService.cs index 9d68a2823..c5548cfb1 100644 --- a/ReportImp/AwoDortmund/Service/CustomAccountingService.cs +++ b/ReportImp/AwoDortmund/Service/CustomAccountingService.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; - using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Service.DCEntityMapper; @@ -29,27 +28,27 @@ namespace AwoDortmund.Service } - public override ServiceInvoice ErstelleStornoRechnung(InvoiceBaseDC ibdc) + public override ServiceInvoice ErstelleStornoRechnung(InvoiceBaseDC ibdc) + { + var i = base.ErstelleStornoRechnung(ibdc); + + int invoiceCounter = 0; + var inc = PluginLoader.FindClass(); + i.InvoiceBase.InvoiceNumber = inc.GetNextInvoiceNumber(invoiceCounter, i.InvoiceBase) + " Storno"; + + if (String.IsNullOrEmpty(i.InvoiceBase.InvoiceTypeText)) { - var i = base.ErstelleStornoRechnung(ibdc); - - 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; + 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