50 lines
1.2 KiB
C#
50 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Service.Invoicing;
|
|
using BeWo.Service.Plugins;
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using BS.Shared.Services;
|
|
|
|
namespace LebenshilfeTrier.Invoicing
|
|
{
|
|
internal class CustomInvoiceNumberGenerator : InvoiceNumberGenerator
|
|
{
|
|
|
|
public override string GetNextInvoiceNumber(int increment, InvoiceBase invoiceBase)
|
|
{
|
|
var next = base.GetNextInvoiceNumber(increment, invoiceBase);
|
|
|
|
if (invoiceBase.CostBearer2SupportConcept != null)
|
|
{
|
|
var c = invoiceBase.CostBearer2SupportConcept.SupportConcept.Customer;
|
|
if (!String.IsNullOrWhiteSpace(c.DebitorNumber))
|
|
{
|
|
next = c.DebitorNumber + next;
|
|
}
|
|
}
|
|
return next;
|
|
}
|
|
|
|
public string GetNextInvoiceNumberForCustomer(int increment, InvoiceBase invoiceBase, Customer c)
|
|
{
|
|
|
|
var next = base.GetNextInvoiceNumber(increment, invoiceBase);
|
|
|
|
if (c != null && !String.IsNullOrWhiteSpace(c.DebitorNumber))
|
|
{
|
|
next = c.DebitorNumber + next;
|
|
}
|
|
|
|
return next;
|
|
}
|
|
|
|
|
|
}
|
|
}
|