This commit is contained in:
Christian
2019-07-12 17:36:37 +02:00
parent 51bcf19d3a
commit 9c97d6fe79
366 changed files with 137956 additions and 770 deletions

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Invoicing;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Services;
namespace VKMAachen.Invoicing
{
internal class CustomInvoiceNumberGenerator : InvoiceNumberGenerator
{
protected override String ApplyPatternWithId(String pattern, long number, String id)
{
string next = pattern;
if (!String.IsNullOrEmpty(next))
{
int pos = next.IndexOf("{n");
if (pos >= 0)
{
int stop = next.IndexOf("}", pos);
if (stop > pos)
{
int nCount = stop - pos - 1;
String nextNumberStr = number.ToString();
while (nextNumberStr.Length < nCount)
nextNumberStr = "0" + nextNumberStr;
next = next.Replace(next.Substring(pos, stop - pos + 1), nextNumberStr);
}
}
DateTime dt = DateTime.Now.Date.AddMonths(-1);
next = next.Replace("{jj}", String.Format("{0:yy}", dt));
next = next.Replace("{jjjj}", String.Format("{0:yyyy}", dt));
next = next.Replace("{MM}", String.Format("{0:MM}", dt));
next = next.Replace("{mm}", String.Format("{0:MM}", dt));
}
return next;
}
}
}