37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using System;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Service.DCEntityMapper;
|
|
using BeWo.Service.Plugins;
|
|
using BS.Shared;
|
|
using BS.Shared.DataContracts;
|
|
|
|
|
|
|
|
namespace LebenshilfeStadeMID.Service
|
|
{
|
|
public class CustomAccountingService : AccountingService
|
|
{
|
|
public override ServiceInvoice ErstelleStornoRechnung(InvoiceBaseDC ibdc)
|
|
{
|
|
var i = base.ErstelleStornoRechnung(ibdc);
|
|
int invoiceCounter = 0;
|
|
var inc = PluginLoader.FindClass<InvoiceNumberGenerator>();
|
|
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;
|
|
}
|
|
}
|
|
} |