AutismusKoelnBonn und DiakonieKKKleve

This commit is contained in:
Alexandra
2022-11-08 15:50:32 +01:00
parent f667f8a4d1
commit 1616fc68ac
7 changed files with 200 additions and 32 deletions

View File

@@ -4,7 +4,7 @@ using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared;
using DevExpress.XtraReports.UI;
namespace AutismusKoelnBonn
@@ -22,7 +22,15 @@ namespace AutismusKoelnBonn
// jeder Klient ist derzeit wirklich nur in einem Team
DateTime start = pRO.AccountingPeriodStart;
DateTime end = pRO.AccountingPeriodEnd;
string poBox = null;
if (pRO.RecipientOrganisation.ToLower() != "selbstzahler" && pRO.InvoiceBase.RecipientContactInformations.Count > 0)
{
foreach (var i in pRO.InvoiceBase.RecipientContactInformations)
{
if (i.ContactType == BS.Shared.ContactType.private_POBox)
poBox = i.ContactValue;
}
}
StringBuilder sb = new StringBuilder();
//if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1) && !String.IsNullOrEmpty(pRO.RecipientAddressLine1.Trim()) && pRO.RecipientOrganisation.Contains(pRO.CustomerLastName))
@@ -45,11 +53,15 @@ namespace AutismusKoelnBonn
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
if (pRO.RecipientOrganisation.ToLower() != "selbstzahler" && !String.IsNullOrEmpty(poBox))
{
sb.AppendLine(poBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
{
sb.AppendLine(pRO.RecipientPoBox);
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet) && String.IsNullOrEmpty(pRO.RecipientPoBox))
else if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
@@ -66,6 +78,8 @@ namespace AutismusKoelnBonn
c = DAOFactory.GenericDAO.LoadByID<Customer>(pRO.ServiceInvoicePeriods[0].Customer.Oid ?? 0);
if (c.Team2CustomerList.Count > 0)
team = c.Team2CustomerList[0].Team.Name;
if (c.Person.Sex == Sex.Divers)
pRO.CustomerSalutation = "Liebe*r";
}
if (team.Contains("Team Bonn"))
@@ -122,6 +136,8 @@ namespace AutismusKoelnBonn
lblAnrede.Text = String.Format("Sehr geehrter Herr {0},", pRO.CustomerLastName);
else if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("frau"))
lblAnrede.Text = String.Format("Sehr geehrte Frau {0},", pRO.CustomerLastName);
else if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("liebe"))
lblAnrede.Text = String.Format("{0} {1} {2},", pRO.CustomerSalutation, pRO.CustomerFirstName, pRO.CustomerLastName);
}
this.bindingSource1.DataSource = pRO;

View File

@@ -1,7 +1,10 @@
using BeWo.Data.Entities;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Invoicing;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,5 +18,43 @@ namespace AutismusKoelnBonn.Invoicing
{
invoice.InvoiceBase.InvoiceId = "Faktor";
}
//public override void BerechneSummaryItemsSummen(List<InvoiceItem> newlist, bool addRateFactorToUnitCount)
//{
// base.BerechneSummaryItemsSummen(newlist, true);
//}
public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, Calculations calc)
{
var invoiceItem = new InvoiceItem();
BillingData bd = calc.GetBillingData(iServiceRecord);
invoiceItem.ItemDescription = iServiceRecord.ServiceDescription.Name; //iServiceRecord.Employee + " - " + iServiceRecord.ServiceDescription.Name;
invoiceItem.AmountPerUnit = bd.AmountPerUnit;
invoiceItem.UnitCount = bd.UnitCount;
invoiceItem.ItemPeriodStart = bd.BillingPeriodStart;
invoiceItem.ItemPeriodEnd = bd.BillingPeriodEnd;
invoiceItem.AccountingInterval = bd.AccountingInterval;
invoiceItem.ItemDescription = iServiceRecord.ServiceDescription.Name; //iServiceRecord.Employee + " - " + iServiceRecord.ServiceDescription.Name;
invoiceItem.ServiceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(iServiceRecord.ServiceRecordOid.Value);
if (scap != null)
invoiceItem.SupportConceptApprovalPeriodOid = scap.Oid;
if (iServiceRecord.ServiceDescription.Name == "Fallpauschale")
{
invoiceItem.AmountTotal = bd.AmountPerUnit * bd.UnitCount;
invoiceItem.RateFactor = null;
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
}
else
{
invoiceItem.AmountTotal = bd.AmountTotal;
invoiceItem.RateFactor = iServiceRecord.CostBearer.ActualRateFactor;
invoiceItem.GrossAmountTotal = bd.AmountTotal + (bd.AmountTotal * iServiceRecord.CostBearer.ActualRateFactor / 100);
}
return invoiceItem;
}
}
}

View File

@@ -94,9 +94,9 @@ namespace AutismusKoelnBonn
this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.AnteilFaktor = new DevExpress.XtraReports.UI.CalculatedField();
this.StdFaktor = new DevExpress.XtraReports.UI.CalculatedField();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrRichText3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText5)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText6)).BeginInit();
@@ -720,6 +720,8 @@ namespace AutismusKoelnBonn
this.xrTableCell40.BorderColor = System.Drawing.Color.Black;
this.xrTableCell40.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell40.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.ServiceDescription")});
this.xrTableCell40.Font = new System.Drawing.Font("Arial", 10F);
this.xrTableCell40.Name = "xrTableCell40";
this.xrTableCell40.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -775,7 +777,7 @@ namespace AutismusKoelnBonn
this.xrTableCell7.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell7.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.AnteilFaktor", "{0:n2}")});
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.Notice", "{0:n2}")});
this.xrTableCell7.Font = new System.Drawing.Font("Arial", 10F);
this.xrTableCell7.Name = "xrTableCell7";
this.xrTableCell7.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -794,7 +796,7 @@ namespace AutismusKoelnBonn
this.xrTableCell9.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.StdFaktor", "{0:n2}")});
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.UnitCountString", "{0:n2}")});
this.xrTableCell9.Font = new System.Drawing.Font("Arial", 10F);
this.xrTableCell9.Name = "xrTableCell9";
this.xrTableCell9.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -812,7 +814,7 @@ namespace AutismusKoelnBonn
this.xrTableCell44.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell44.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.HourlyRate", "{0:0.##} €")});
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.AmountPerUnit", "{0:0.00} €")});
this.xrTableCell44.Font = new System.Drawing.Font("Arial", 10F);
this.xrTableCell44.Name = "xrTableCell44";
this.xrTableCell44.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -1014,10 +1016,6 @@ namespace AutismusKoelnBonn
this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell6.Weight = 0.52190865825182176D;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO);
//
// AnteilFaktor
//
this.AnteilFaktor.DataMember = "ServiceInvoicePeriods.ServiceInvoiceItems";
@@ -1030,6 +1028,10 @@ namespace AutismusKoelnBonn
this.StdFaktor.Expression = "[Hours]*1.2";
this.StdFaktor.Name = "StdFaktor";
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO);
//
// ServiceInvoiceReportFactor
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {

View File

@@ -23,10 +23,20 @@ namespace AutismusKoelnBonn
// jeder Klient ist derzeit wirklich nur in einem Team
DateTime start = pRO.AccountingPeriodStart;
DateTime end = pRO.AccountingPeriodEnd;
string poBox = null;
if (pRO.InvoiceBase.RecipientContactInformations.Count > 0)
{
foreach (var i in pRO.InvoiceBase.RecipientContactInformations)
{
if (i.ContactType == BS.Shared.ContactType.private_POBox)
poBox = i.ContactValue;
}
}
StringBuilder sb = new StringBuilder();
//if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1) && !String.IsNullOrEmpty(pRO.RecipientAddressLine1.Trim()) && pRO.RecipientOrganisation.Contains(pRO.CustomerLastName))
//if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1) && !String.IsNullOrEmpty(pRO.RecipientAddressLine1.Trim())))
//{
// sb.AppendLine(pRO.RecipientAddressLine1);
//}
@@ -46,11 +56,15 @@ namespace AutismusKoelnBonn
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
if (!String.IsNullOrEmpty(poBox))
{
sb.AppendLine(poBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
{
sb.AppendLine(pRO.RecipientPoBox);
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet) && String.IsNullOrEmpty(pRO.RecipientPoBox))
else if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
@@ -97,6 +111,31 @@ namespace AutismusKoelnBonn
lblHeaderKoeln.Visible = false;
lblTeamKoeln.Visible = false;
}
foreach (var sip in pRO.ServiceInvoicePeriods)
{
foreach (var ii in sip.ServiceInvoiceItems)
{
ii.Notice = "";
ii.UnitCountString = "";
double hours = (double)Convert.ToDecimal(ii.Hours ?? 1);
if (ii.ServiceDescription != "Fallpauschale")
{
ii.ServiceDescription = "Fachleistungsstunden";
if (ii.Hours != null && ii.Hours != 0)
{
ii.Notice = String.Format("{0:0.00}", hours * 0.2);
ii.UnitCountString = String.Format("{0:0.00}", hours * 1.2);
}
}
else
{
ii.UnitCountString = String.Format("{0:0.00}", hours);
}
}
}
this.bindingSource1.DataSource = pRO;
}
}

View File

@@ -18,6 +18,17 @@ namespace AutismusKoelnBonn.Alt
public void SetReportDataSource(SettlementRO pRO)
{
var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
string poBox = null;
if (cb2sc.CostBearer.Organisation.Contacts.Count > 0)
{
foreach (var i in cb2sc.CostBearer.Organisation.Contacts)
{
if (i.Type == BS.Shared.ContactType.private_POBox)
poBox = i.Value;
}
}
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
@@ -28,19 +39,23 @@ namespace AutismusKoelnBonn.Alt
{
sb.AppendLine(pRO.RecipientDivision);
}
//Angaben aus Rechnungsadresse
//var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
//if (!String.IsNullOrEmpty(cb2sc.CostBearer.Organisation.InvoiceAddress.AddressLine1))
//{
// sb.AppendLine(cb2sc.CostBearer.Organisation.InvoiceAddress.AddressLine1);
// }
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
//Angaben aus Rechnungsadresse
//var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
if (!String.IsNullOrEmpty(cb2sc.CostBearer.Organisation.InvoiceAddress.AddressLine1))
{
sb.AppendLine(cb2sc.CostBearer.Organisation.InvoiceAddress.AddressLine1);
}
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
}
if (!String.IsNullOrEmpty(poBox))
{
sb.AppendLine(pRO.RecipientStreet);
sb.AppendLine(poBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
{
sb.AppendLine(pRO.RecipientPoBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
@@ -112,11 +127,12 @@ namespace AutismusKoelnBonn.Alt
pRO.AmountRecordedFLSString = String.Format("{0:c}", pRO.AmountRecordedFLS - pRO.Eigenbeteiligung);
if (pRO.AbsenceTimes == "")
pRO.AbsenceTimes = String.Format("Stationärer Aufenthalt: keiner / im Monat {0:MM.yyyy}, siehe Quittierungsbeleg.", pRO.AccountingEndDate);
pRO.AbsenceTimes = String.Format("Stationärer Aufenthalt: keiner");
else
pRO.AbsenceTimes = String.Format("Stationärer Aufenthalt: {0}, siehe Quittierungsbeleg(e).", pRO.AbsenceTimes);
string team = "MoveAut Team Köln";
var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
var c = cb2sc.SupportConcept.Customer;
if (c.Team2CustomerList.Count > 0)
team = c.Team2CustomerList[0].Team.Name;

View File

@@ -7,6 +7,7 @@ using BeWo.Report.ReportObjects;
using BeWo.Report;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using System.Text;
namespace AutismusKoelnBonn
{
@@ -19,7 +20,8 @@ namespace AutismusKoelnBonn
public void SetReportDataSource(Settlement2RO pRO)
{
string poBox = null;
string AddressLine1 = null;
decimal rateFactor = 1;
foreach (var ii in pRO.InvoiceItems)
@@ -35,13 +37,26 @@ namespace AutismusKoelnBonn
pRO.AmountBillableTotal = pRO.AmountBillableTotal - pRO.Eigenbeteiligung ?? 0;
if (pRO.AbsenceTimes == "")
pRO.AbsenceTimes = String.Format("Stationärer Aufenthalt: keiner / im Monat {0:MM.yyyy}, siehe Quittierungsbeleg.", pRO.AccountingEndDate);
pRO.AbsenceTimes = String.Format("Stationärer Aufenthalt: keiner");
else
pRO.AbsenceTimes = String.Format("Stationärer Aufenthalt: {0}, siehe Quittierungsbeleg(e).", pRO.AbsenceTimes);
string team = "MoveAut Team Köln";
if (pRO.InvoiceBaseOid.HasValue)
{
var ib = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(pRO.InvoiceBaseOid.Value);
var c = ib.CostBearer2SupportConcept.SupportConcept.Customer;
if (ib.CostBearer2SupportConcept.CostBearer.Organisation.Contacts.Count > 0)
{
foreach (var i in ib.CostBearer2SupportConcept.CostBearer.Organisation.Contacts)
{
if (i.Type == BS.Shared.ContactType.private_POBox)
poBox = i.Value;
}
}
if (!String.IsNullOrEmpty(ib.CostBearer2SupportConcept.CostBearer.Organisation.InvoiceAddress.AddressLine1))
AddressLine1 = ib.CostBearer2SupportConcept.CostBearer.Organisation.InvoiceAddress.AddressLine1;
if (c.Team2CustomerList.Count > 0)
team = c.Team2CustomerList[0].Team.Name;
@@ -77,6 +92,45 @@ namespace AutismusKoelnBonn
//}
}
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
{
sb.AppendLine(pRO.RecipientDivision);
}
//Angaben aus Rechnungsadresse
//var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
if (!String.IsNullOrEmpty(AddressLine1))
{
sb.AppendLine(AddressLine1);
}
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(poBox))
{
sb.AppendLine(poBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientPostBox))
{
sb.AppendLine(pRO.RecipientPostBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
{
sb.AppendLine(pRO.RecipientPostCodeAndTown);
}
lblAdresse.Text = sb.ToString();
foreach (var i in pRO.InvoiceItems)
{
i.DetailDescription = String.Format("Summe der Betreuungsminuten /60x{4:0.00}{3}Faktor in der Zeit von {0:dd.MM.yyyy} bis {1:dd.MM.yyyy} gemäß Anlage: ",

View File

@@ -125,7 +125,7 @@ namespace DiakonieKKKleve.Reporting
}
//report = AddSubServicesOverviewReportToReport(report, new LeistungsnachweisSoziotherapie(), soziRo);
report = AddSubServicesOverviewReportToReport(report, new LeistungsnachweisSoziotherapie(), soziRo);
report = AddSubServicesOverviewReportToReport(report, new Stundenzettel(), bewoRo);
//report = AddSubServicesOverviewReportToReport(report, new QuittierungsbelegDienstleistung(), dienstRo);