LH Frankfurt Oder, Bugfix Ersteller Infos wurden nicht auf den Rechnungen angezeigt

This commit is contained in:
2026-06-18 10:59:57 +02:00
parent db9dc64830
commit 41bd70180c
6 changed files with 185 additions and 21 deletions

View File

@@ -1,17 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Invoicing;
using BeWo.Service.Plugins;
using BeWo.Service.ServiceImplementations;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
using System;
using System.Collections.Generic;
using System.Linq;
namespace LebenshilfeFrankfurtOder.Invoicing
{
@@ -101,6 +103,36 @@ namespace LebenshilfeFrankfurtOder.Invoicing
return result;
}
public override void SetSenderInformation(ServiceInvoice serviceInvoice)
{
ApplicationUser user = null;
if (LoggedInUserOperationContextExt.Current != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
else
{
user = SessionFacade.LoggedInUser;
}
var mandator = new OperationsServiceImp().GetMandator2(false);
serviceInvoice.InvoiceBase.SenderAddress = new Address
{
Street = mandator.Street,
PostalCode = mandator.PostalCode,
Town = mandator.Town,
State = mandator.State
};
if (user != null)
{
serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName;
serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName;
serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList();
}
}
private void SetzeCategory(ServiceInvoice i, List<ServiceRecordDC> records)
{
foreach (var sr in records)

View File

@@ -1,17 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Invoicing;
using BeWo.Service.Plugins;
using BeWo.Service.ServiceImplementations;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
using System;
using System.Collections.Generic;
using System.Linq;
namespace LebenshilfeFrankfurtOder.Invoicing
{
@@ -100,6 +102,36 @@ namespace LebenshilfeFrankfurtOder.Invoicing
base.SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList);
}
public override void SetSenderInformation(ServiceInvoice serviceInvoice)
{
ApplicationUser user = null;
if (LoggedInUserOperationContextExt.Current != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
else
{
user = SessionFacade.LoggedInUser;
}
var mandator = new OperationsServiceImp().GetMandator2(false);
serviceInvoice.InvoiceBase.SenderAddress = new Address
{
Street = mandator.Street,
PostalCode = mandator.PostalCode,
Town = mandator.Town,
State = mandator.State
};
if (user != null)
{
serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName;
serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName;
serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList();
}
}
public override void SetServiceInvoicePeriods(ServiceInvoice invoice, CostBearer2SupportConcept costBearer2SupportConcept,
DateTimeSpan invoicePeriod, List<ServiceRecordDC> serviceRecords)
{

View File

@@ -1,17 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Invoicing;
using BeWo.Service.Plugins;
using BeWo.Service.ServiceImplementations;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
using System;
using System.Collections.Generic;
using System.Linq;
namespace LebenshilfeFrankfurtOder.Invoicing
{
@@ -91,7 +93,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing
//public override void SetRecipientInformation(ServiceInvoice serviceInvoice, CostBearer costBearer)
//{
// if (istSelbstzahler || brauchtExtraPrivatrechnung)
// {
@@ -117,9 +119,39 @@ namespace LebenshilfeFrankfurtOder.Invoicing
// {
// base.SetRecipientInformation(serviceInvoice, costBearer);
// }
//}
public override void SetSenderInformation(ServiceInvoice serviceInvoice)
{
ApplicationUser user = null;
if (LoggedInUserOperationContextExt.Current != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
else
{
user = SessionFacade.LoggedInUser;
}
var mandator = new OperationsServiceImp().GetMandator2(false);
serviceInvoice.InvoiceBase.SenderAddress = new Address
{
Street = mandator.Street,
PostalCode = mandator.PostalCode,
Town = mandator.Town,
State = mandator.State
};
if (user != null)
{
serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName;
serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName;
serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList();
}
}
public override void SetInvoiceBaseData(int invoiceCounter, ServiceInvoice invoice, CostBearer costBearer, DateTimeSpan invoicePeriod,
IList<CompactSupportConceptDC> supportConceptList)
{

View File

@@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Invoicing;
using BeWo.Service.Plugins;
using BeWo.Service.ServiceImplementations;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -13,6 +12,9 @@ using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
using DevExpress.Office.Drawing;
using System;
using System.Collections.Generic;
using System.Linq;
namespace LebenshilfeFrankfurtOder.Invoicing
{
@@ -155,6 +157,36 @@ namespace LebenshilfeFrankfurtOder.Invoicing
return result;
}
public override void SetSenderInformation(ServiceInvoice serviceInvoice)
{
ApplicationUser user = null;
if (LoggedInUserOperationContextExt.Current != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
else
{
user = SessionFacade.LoggedInUser;
}
var mandator = new OperationsServiceImp().GetMandator2(false);
serviceInvoice.InvoiceBase.SenderAddress = new Address
{
Street = mandator.Street,
PostalCode = mandator.PostalCode,
Town = mandator.Town,
State = mandator.State
};
if (user != null)
{
serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName;
serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName;
serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList();
}
}
private InvoiceItem GetMaxBetragItem(ServiceInvoice invoice)
{
decimal? maxBetrag = null;
@@ -218,7 +250,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing
{
foreach (var sr in records)
{
if (sr.ServiceDescription.Name.Contains("Kurskosten") || sr.ServiceDescription.Name.Contains("Mittag"))
if (MussPrivatAbgerechnetWerden(sr.ServiceDescription.Name))
{
return true;
}
@@ -231,7 +263,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing
{
foreach (var sr in records)
{
if (!sr.ServiceDescription.Name.Contains("Kurskosten") && !sr.ServiceDescription.Name.Contains("Mittag"))
if (!MussPrivatAbgerechnetWerden(sr.ServiceDescription.Name))
{
return true;
}
@@ -240,6 +272,15 @@ namespace LebenshilfeFrankfurtOder.Invoicing
return false;
}
private bool MussPrivatAbgerechnetWerden(String nameDerLeistung)
{
if (nameDerLeistung.Contains("Kurskosten") || nameDerLeistung.Contains("Mittag") || "FED Disco Verpflegung".Equals(nameDerLeistung))
{
return true;
}
return false;
}
public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC supportConcept, List<ServiceRecordDC> serviceRecords)
{
@@ -360,7 +401,7 @@ namespace LebenshilfeFrankfurtOder.Invoicing
if (cat.Contains("§45") || cat.Contains("§42") || cat.Contains("§39"))
{
if (i.ServiceDescription.Name.Contains("Kurskosten") || i.ServiceDescription.Name.Contains("Mittag"))
if (MussPrivatAbgerechnetWerden(i.ServiceDescription.Name))
{
valid = istPrivatrechnung;
}

View File

@@ -83,7 +83,37 @@ namespace LebenshilfeFrankfurtOder.Invoicing
return result;
}
private List<ServiceInvoice> CreatePrivatRechnungen(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC sc, List<ServiceRecordDC> serviceRecords)
public override void SetSenderInformation(ServiceInvoice serviceInvoice)
{
ApplicationUser user = null;
if (LoggedInUserOperationContextExt.Current != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
else
{
user = SessionFacade.LoggedInUser;
}
var mandator = new OperationsServiceImp().GetMandator2(false);
serviceInvoice.InvoiceBase.SenderAddress = new Address
{
Street = mandator.Street,
PostalCode = mandator.PostalCode,
Town = mandator.Town,
State = mandator.State
};
if (user != null)
{
serviceInvoice.InvoiceBase.CreatorFirstName = serviceInvoice.InvoiceBase.SenderFirstName = user.Employee.Person.FirstName;
serviceInvoice.InvoiceBase.CreatorLastName = serviceInvoice.InvoiceBase.SenderLastName = user.Employee.Person.LastName;
serviceInvoice.InvoiceBase.SenderContacts = user.Employee.Person.Contacts.Select(i => i.CopyToNew()).ToList();
}
}
private List<ServiceInvoice> CreatePrivatRechnungen(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC sc, List<ServiceRecordDC> serviceRecords)
{
IList<VarFieldDef> defs = DAOFactory.SearchDAO.GetVarFieldDefs(TableID.Customer);

View File

@@ -20,7 +20,6 @@ namespace LebenshilfeFrankfurtOder
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
CheckLastschriftAndAnschrift(pRO);
if (!String.IsNullOrEmpty(pRO.SenderContactPersonMail))
@@ -36,9 +35,7 @@ namespace LebenshilfeFrankfurtOder
pRO.SenderContactPersonFax = pRO.SenderContactPersonFax.Replace("Fax:", "").Trim();
}
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{