Hack: Mehrere Mandatoren möglich

This commit is contained in:
2024-12-09 11:16:17 +01:00
parent becc2db940
commit 0b776f279f
9 changed files with 695 additions and 597 deletions

View File

@@ -194,16 +194,16 @@ namespace Dakota.Logic
info.IKAbsender = DakotaConfig.IKAbsender;
info.IKKostentrager = infoParameter.IKKostentrager;
info.IKKrankenkasse = infoParameter.IKKrankenkasse;
info.IKLeistungserbringer = infoParameter.IKLeistungserbringer;
info.IKLeistungserbringer = infoParameter.AddressInformation.IKLeistungserbringer;
info.Rechnungsnummer = infoParameter.InvoiceBase.InvoiceNumber;
info.Rechnungsdatum = infoParameter.InvoiceBase.InvoiceDate.Value;
info.Rechnungsart = SchlüsselRechnungsart.AbrechnungÜberAbrechnungsstelleOhneInkassovollmacht;
info.Name1 = infoParameter.Mandator.Name;
info.Name2 = "Rene Evertz";
info.Name3 = "Entwickler bei ownSoft";
info.Name4 = "dakota.exchange@ownsoft.de";
info.Name1 = infoParameter.AddressInformation.OrganisationName;
info.Name2 = infoParameter.AddressInformation.Phone;
info.Name3 = infoParameter.AddressInformation.Mail;
info.Name4 = "Entwicklung: dakota.exchange@ownsoft.de";
return info;
}
@@ -215,7 +215,7 @@ namespace Dakota.Logic
info.IKAbsender = DakotaConfig.IKAbsender;
info.IKKostentrager = infoParameter.IKKostentrager;
info.IKKrankenkasse = infoParameter.IKKrankenkasse;
info.IKLeistungserbringer = infoParameter.IKLeistungserbringer;
info.IKLeistungserbringer = infoParameter.AddressInformation.IKLeistungserbringer;
info.Rechnungsnummer = infoParameter.InvoiceBase.InvoiceNumber;
info.Rechnungsdatum = infoParameter.InvoiceBase.InvoiceDate.Value;

View File

@@ -1,4 +1,5 @@
using BS.Shared.DataContracts;
using BeWo.Data.Models;
using BS.Shared.DataContracts;
using Dakota.Models.Infos;
using System;
using System.Collections.Generic;
@@ -40,7 +41,7 @@ namespace Dakota.Logic
IsSammelrechnung = isSammelrechnung;
}
public void Add(ServiceInvoiceDC serviceInvoice, OrganisationDC organisation, CustomerDC customer, MandatorDC mandator, int datenaustauschreferenz, int transfernummer)
public void Add(ServiceInvoiceDC serviceInvoice, OrganisationDC organisation, CustomerDC customer, AddressInformation address, int datenaustauschreferenz, int transfernummer)
{
try
{
@@ -75,7 +76,7 @@ namespace Dakota.Logic
{
foreach (var invoice in peroid.InvoiceItems)
{
var info_nutz_item = new InfoParameterInvoiceItem(serviceInvoice, invoice, organisation, customer, mandator);
var info_nutz_item = new InfoParameterInvoiceItem(serviceInvoice, invoice, organisation, customer, address);
DakotaInfoCreator.AddInfoParameter(nutzdaten, info_nutz_item, Version);
}

View File

@@ -1,4 +1,5 @@
using BS.Shared.DataContracts;
using BeWo.Data.Models;
using BS.Shared.DataContracts;
using Dakota.Models.Schlüssels;
using System;
using System.Collections.Generic;
@@ -15,22 +16,21 @@ namespace Dakota.Models.Infos
public ServiceInvoiceDC ServiceInvoice { get; set; }
public CustomerDC Customer { get; set; }
public OrganisationDC Organisation { get; set; }
public MandatorDC Mandator { get; set; }
public AddressInformation AddressInformation { get; set; }
public string Abrechnungsposition { get; set; }
public string IKKostentrager => Organisation.IKKostentrager;
public string IKKrankenkasse => Organisation.IKKrankenkasse;
public string IKLeistungserbringer => Mandator.IKLeistungserbringer;
public InfoParameterInvoiceItem(ServiceInvoiceDC serviceInvoice, InvoiceItemDC invoiceItem, OrganisationDC organisation, CustomerDC customer, MandatorDC mandator)
public InfoParameterInvoiceItem(ServiceInvoiceDC serviceInvoice, InvoiceItemDC invoiceItem, OrganisationDC organisation, CustomerDC customer, AddressInformation addressInformation)
{
InvoiceItem = invoiceItem;
InvoiceBase = serviceInvoice.InvoiceBase;
ServiceInvoice = serviceInvoice;
Customer = customer;
Organisation = organisation;
Mandator = mandator;
AddressInformation = addressInformation;
// Todo: Valid prüfen
Abrechnungsposition = invoiceItem.UnitDescription?.Substring(6) ?? "TODO";

View File

@@ -391,6 +391,7 @@
<Compile Include="ICF\ICFDAO.cs" />
<Compile Include="LoggedInUserOperationContextExt.cs" />
<EmbeddedResource Include="Mappings\Bargeldtransaktionshistory.hbm.xml" />
<Compile Include="Models\AddressInformation.cs" />
<Compile Include="MultitenancyOperationContextExt.cs" />
<Compile Include="Security\BCrypt.cs" />
<Compile Include="Security\BeWoToolUserCollection.cs" />

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.Data.Models
{
public class AddressInformation
{
public string IKLeistungserbringer { get; set; }
public string OrganisationName { get; set; }
public string Street { get; set; }
public string PostCode { get; set; }
public string Town { get; set; }
public string Phone { get; set; }
public string Fax { get; set; }
public string Mail { get; set; }
public string Website { get; set; }
}
}

View File

@@ -200,6 +200,7 @@
<Compile Include="RechnungSoziotherapie.Designer.cs">
<DependentUpon>RechnungSoziotherapie.cs</DependentUpon>
</Compile>
<Compile Include="Service\DkkkAccountingService.cs" />
<Compile Include="Service\DkkkCustomerService.cs" />
<Compile Include="RechnungMitEigenbeteiligung.cs">
<SubType>Component</SubType>

View File

@@ -0,0 +1,38 @@
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.Models;
using BeWo.Service.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DiakonieKKKleve.Service
{
public class DkkkAccountingService : AccountingService
{
public override AddressInformation GetAddressInformation(long? customer_oid = null)
{
var info = base.GetAddressInformation();
if (customer_oid is null)
return info;
var c = DAOFactory.GenericDAO.GetByID<Customer>(customer_oid.Value);
foreach (var t2c in c.Team2CustomerList)
{
if (t2c.Team.Name.Contains("Nord"))
{
info.IKLeistungserbringer = "500506341";
info.Street = "Stechbahn 33";
info.PostCode = "47533";
info.Town = "Kleve";
}
}
return info;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -27,6 +27,7 @@ using BS.Shared.DataContracts.GkvAbrechnung;
using BS.Shared.Extensions;
using BS.Shared.Exceptions;
using BS.Shared.AppSender;
using BeWo.Data.Security;
namespace BeWo.Service.ServiceImplementations
{
@@ -1048,6 +1049,23 @@ namespace BeWo.Service.ServiceImplementations
protokoll.Datenaustauschreferenz = datenaustauschreferenz;
protokoll.Transfernummer = transfernummer;
var first_cost = gkvAbrechnung.InvoiceBases.First().CostBearer2SupportConcept.SupportConcept.Customer;
var plugin = PluginLoader.FindClass<AccountingService>();
var addressInfo = plugin.GetAddressInformation(first_cost.Oid);
foreach (var invoicebase in gkvAbrechnung.InvoiceBases)
{
var customer = invoicebase.CostBearer2SupportConcept.SupportConcept.Customer;
var addressInfo2 = plugin.GetAddressInformation(customer.Oid);
if (addressInfo.IKLeistungserbringer != addressInfo2.IKLeistungserbringer)
{
throw new GkvException($"Klient '{first_cost.Person.LastNameFirstName}' ({addressInfo.IKLeistungserbringer}) und '{customer.Person.LastNameFirstName}' ({addressInfo2.IKLeistungserbringer}) verweisen auf unterschiedliche Leistungserbringer.");
}
}
foreach (var invoicebase in gkvAbrechnung.InvoiceBases)
{
var service = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoicebase.Oid.Value);
@@ -1061,7 +1079,7 @@ namespace BeWo.Service.ServiceImplementations
Validator.ValidateCustomer(customerdc);
manager.Add(servicedc, orgadc, customerdc, mandatordc, dat_short, tra_short);
manager.Add(servicedc, orgadc, customerdc, addressInfo, dat_short, tra_short);
}
manager.Apply();
@@ -1070,8 +1088,6 @@ namespace BeWo.Service.ServiceImplementations
{
var msg = "Unerwartete Anzahl an Dakota Files berechnet.";
MailUtils.SendGkvModuleErrorMail("CreateGkvTransferProtokoll", msg, Tenant);
throw new GkvException(msg);
}
@@ -1096,8 +1112,6 @@ namespace BeWo.Service.ServiceImplementations
{
var msg = $"nutzdatendatei - Länger als 16777215: {nutzdatendatei.Length}";
MailUtils.SendGkvModuleErrorMail("CreateGkvTransferProtokoll", msg, Tenant);
throw new GkvException(msg);
}