diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml
index a11a066d5..6235bbd1a 100644
--- a/BeWo/View/Detail/CustomerView.xaml
+++ b/BeWo/View/Detail/CustomerView.xaml
@@ -1147,7 +1147,7 @@
+ Content="{markup:Translate CustomerKommentar}" />
singleReport = FindReportImp(iDC.InvoiceBase.InvoiceId);
- if (iDC.InvoiceBase != null && iDC.InvoiceBase.InvoiceId != "Jugendamt")
+ if (iDC.ServiceInvoicePeriods.Count > 0 && iDC.ServiceInvoicePeriods[0].SupportConceptApprovalPeriod.ServiceCategory != null)
{
+ var seite1 = new ServiceInvoiceReport();
+ var ro = ServiceInvoiceRO.Create(iDC);
+ seite1.SetReportDataSource(ro);
+ seite1.CreateDocument();
- if (iDC.ServiceInvoicePeriods.Count > 0 && iDC.ServiceInvoicePeriods[0].SupportConceptApprovalPeriod.ServiceCategory != null)
+ int month = iDC.InvoiceBase.AccountingPeriodStart.Value.Month;
+ int year = iDC.InvoiceBase.AccountingPeriodStart.Value.Year;
+ long cOid = iDC.InvoiceBase.SupportConceptCostBearerRelDc.SupportConcept.Customer.CustomerOid;
+ long oOid = iDC.InvoiceBase.RecipientOrganisationOid ?? 0;
+
+ while (month <= iDC.InvoiceBase.AccountingPeriodEnd.Value.Month)
{
- var seite1 = new ServiceInvoiceReport();
- var ro = ServiceInvoiceRO.Create(iDC);
+ var qb = CreateServiceOverviewSingleCustomerReport(cOid, month, year, oOid, 0, null, 1, DateTime.DaysInMonth(year, month));
+ qb.CreateDocument();
- seite1.SetReportDataSource(ro);
- seite1.CreateDocument();
-
- int month = iDC.InvoiceBase.AccountingPeriodStart.Value.Month;
- int year = iDC.InvoiceBase.AccountingPeriodStart.Value.Year;
- long cOid = iDC.InvoiceBase.SupportConceptCostBearerRelDc.SupportConcept.Customer.CustomerOid;
- long oOid = iDC.InvoiceBase.RecipientOrganisationOid ?? 0;
-
- while (month <= iDC.InvoiceBase.AccountingPeriodEnd.Value.Month)
- {
- var qb = CreateServiceOverviewSingleCustomerReport(cOid, month, year, oOid, 0, null, 1, DateTime.DaysInMonth(year, month));
- qb.CreateDocument();
-
- seite1.Pages.AddRange(qb.Pages);
- invoiceReport = seite1;
- month++;
- }
+ seite1.Pages.AddRange(qb.Pages);
+ invoiceReport = seite1;
+ month++;
}
}
else
diff --git a/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs b/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs
index 92401045d..de07957c0 100644
--- a/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs
+++ b/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/CollectiveInvoiceCreation.cs
@@ -31,12 +31,12 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
// die haben 5 Standorte, die über Kostenstellen unter Notiz im Hilfeplan identifiziert werden
// Es werden grundsätzlich volle Tagessätze aus der Verwaltung abgerechnet, bei Abwesenheiten > 3 Tage,
// werden alle Abwesenheitstage nur mit 75 % berechnet
-
public override List GenerateServiceInvoices(long costBearerOid,
DateTimeSpan invoicePeriod,
Dictionary> supportConcepts2ServiceRecords)
{
var costBearer = DAOFactory.GenericDAO.LoadByID(costBearerOid);
+ FuegeAbgelaufeneHilfeplaeneMitAktuellenBewilligungenHinzu(costBearer, invoicePeriod, supportConcepts2ServiceRecords);
var invoiceList = new List();
ServiceInvoice invoice;
Dictionary> TeamKaldauen = new Dictionary>();
@@ -89,18 +89,47 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
return result.Count > 1 ? result.OrderBy(i => i.InvoiceBase.CustomerLastName).ToList() : result;
}
+ private void FuegeAbgelaufeneHilfeplaeneMitAktuellenBewilligungenHinzu(CostBearer costBearer, DateTimeSpan invoicePeriod, Dictionary> supportConcepts2ServiceRecords)
+ {
+ var alleHilfeplaene = DAOFactory.GenericDAO.GetAllActive();
+ var cs = new CustomerService();
+ foreach (var sc in alleHilfeplaene)
+ {
+ foreach (var c2s in sc.CostBearer2SupportConceptList)
+ {
+ if (c2s.EndDate < invoicePeriod.StartDate)
+ {
+ if (c2s.CostBearer.Oid == costBearer.Oid)
+ {
+ foreach (var ap in c2s.ApprovalPeriodList)
+ {
+ if (ap.EndDate >= invoicePeriod.StartDate && ap.StartDate <= invoicePeriod.EndDate)
+ {
+ var scDc = cs.CreateFlatSupportConcept(sc, c2s);
+ supportConcepts2ServiceRecords.Add(scDc, new List());
+ break;
+
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+
private ServiceInvoice CreateCollectiveBilling2(CostBearer costBearer, DateTimeSpan invoicePeriod, Dictionary> supportConcepts2ServiceRecords)
{
var invoice = new ServiceInvoice();
var newDict = new Dictionary>();
- foreach (var sc2sr in supportConcepts2ServiceRecords) // Abrechnung erfolgt auch wenn nur beantragt
- {
- if (sc2sr.Key.IsApproved)
- newDict.Add(sc2sr.Key, sc2sr.Value);
- }
+ foreach (var sc2sr in supportConcepts2ServiceRecords)
+ {
+ if (!sc2sr.Key.IsArchived && !sc2sr.Key.IsDeleted)
+ newDict.Add(sc2sr.Key, sc2sr.Value);
+ }
- SetRecipientInformation(invoice, costBearer);
+ SetRecipientInformation(invoice, costBearer);
SetSenderInformation(invoice);
SetInvoiceBaseData(0, invoice, costBearer, invoicePeriod, newDict.Keys.ToList());
SetCollectiveBillingBaseData(0, invoice, costBearer, invoicePeriod, newDict);
diff --git a/Service/Plugins/TranslationDictionary.cs b/Service/Plugins/TranslationDictionary.cs
index 1dd470dd9..1753c2f73 100644
--- a/Service/Plugins/TranslationDictionary.cs
+++ b/Service/Plugins/TranslationDictionary.cs
@@ -84,6 +84,7 @@ namespace BeWo.Service.Plugins
AddOrReplaceTranslation(dict, "CustomerVerhalten", "Verhalten");
AddOrReplaceTranslation(dict, "CustomerBetreuungsbedarf", "Betreuungsbedarf");
AddOrReplaceTranslation(dict, "CustomerBemerkungenSbd", "Allgemeine Bemerkungen");
+ AddOrReplaceTranslation(dict, "CustomerKommentar", "Kommentar");
AddOrReplaceTranslation(dict, "EmployeePflege", "Pflege");
AddOrReplaceTranslation(dict, "EmployeeToilettengang", "Toilettengang");