MH: Die Brücke Niedersachsenanpassung
This commit is contained in:
202
ReportImp/DieBrueckeHilfeUndHalt/CustomReportCreator.cs
Normal file
202
ReportImp/DieBrueckeHilfeUndHalt/CustomReportCreator.cs
Normal file
@@ -0,0 +1,202 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared;
|
||||
using DevExpress.XtraReports.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace DieBrueckeHilfeUndHalt
|
||||
{
|
||||
class CustomReportCreator : DefaultReportCreator
|
||||
{
|
||||
|
||||
public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende)
|
||||
{
|
||||
List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid, true, nurFehlende);
|
||||
|
||||
if (lROs.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Function != null ? organisation.Function.Value : null;
|
||||
}
|
||||
|
||||
var rootReport = CreateServicesOverviewReportForRo(lROs[0], serviceCategoryOid, reportId);
|
||||
if (rootReport.Pages.Count == 0)
|
||||
rootReport.CreateDocument();
|
||||
|
||||
for (int i = 1; i < lROs.Count; i++)
|
||||
{
|
||||
var cb = lROs[i].CostBearer2SupportConceptList.FirstOrDefault(cb2sc => lROs[i].Costbearer.Contains(cb2sc.CostBearer.Organisation.Name));
|
||||
|
||||
if (cb != null && cb.CostBearer.Organisation.Function != null)
|
||||
reportId = cb.CostBearer.Organisation.Function.Value;
|
||||
|
||||
var lNext = CreateServicesOverviewReportForRo(lROs[i], serviceCategoryOid, reportId);
|
||||
if (lNext.Pages.Count == 0)
|
||||
lNext.CreateDocument();
|
||||
rootReport.Pages.AddRange(lNext.Pages);
|
||||
}
|
||||
|
||||
return rootReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
public override XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende)
|
||||
{
|
||||
var roList = new List<ServicesOverviewRO>();
|
||||
|
||||
foreach (var coid in customerOids)
|
||||
{
|
||||
var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
|
||||
|
||||
if (ro != null)
|
||||
{
|
||||
roList.Add(ro);
|
||||
}
|
||||
}
|
||||
|
||||
QBSortOrderEnum sortOrder = QBSortOrderEnum.NachKlient;
|
||||
|
||||
if (HttpContext.Current != null)
|
||||
{
|
||||
var so = HttpContext.Current.Request.Params["sortorder"];
|
||||
if (!String.IsNullOrWhiteSpace(so))
|
||||
{
|
||||
sortOrder = (QBSortOrderEnum)(Int32.Parse(so));
|
||||
}
|
||||
}
|
||||
if (sortOrder == QBSortOrderEnum.NachHauptbetreuung)
|
||||
{
|
||||
roList = roList.OrderBy(r => r.MainAttendant).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
roList = roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
|
||||
}
|
||||
|
||||
|
||||
if (roList.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid.HasValue && orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid.Value);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Function != null ? organisation.Function.Value : null;
|
||||
}
|
||||
|
||||
var rootReport = CreateServicesOverviewReportForRo(roList[0], serviceCategoryOid, reportId);
|
||||
if (rootReport.Pages.Count == 0)
|
||||
rootReport.CreateDocument();
|
||||
|
||||
for (int i = 1; i < roList.Count; i++)
|
||||
{
|
||||
var cb = roList[i].CostBearer2SupportConceptList.FirstOrDefault(cb2sc => roList[i].Costbearer.Contains(cb2sc.CostBearer.Organisation.Name));
|
||||
|
||||
if (cb != null && cb.CostBearer.Organisation.Function != null)
|
||||
reportId = cb.CostBearer.Organisation.Function.Value;
|
||||
|
||||
var lNext = CreateServicesOverviewReportForRo(roList[i], serviceCategoryOid, reportId);
|
||||
if (lNext.Pages.Count == 0)
|
||||
lNext.CreateDocument();
|
||||
rootReport.Pages.AddRange(lNext.Pages);
|
||||
}
|
||||
|
||||
return rootReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Function != null ? organisation.Function.Value : null;
|
||||
}
|
||||
|
||||
var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
|
||||
IBeWoReport<ServicesOverviewRO> lServiceOverviewSingleCustomerReport = new Quittierungsbeleg();
|
||||
|
||||
var cb = ro.CostBearer2SupportConceptList.FirstOrDefault(cb2sc => ro.Costbearer.Contains(cb2sc.CostBearer.Organisation.Name));
|
||||
|
||||
if (cb != null && cb.CostBearer.Organisation.Function != null)
|
||||
reportId = cb.CostBearer.Organisation.Function.Value;
|
||||
|
||||
return CreateServicesOverviewReportForRo(ro, serviceCategoryOid, reportId);
|
||||
}
|
||||
|
||||
private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, long? serviceCategoryOid, string reportID)
|
||||
{
|
||||
ServiceCategory sc = serviceCategoryOid != null ? DAOFactory.GenericDAO.GetByID<ServiceCategory>(serviceCategoryOid.Value) : null;
|
||||
|
||||
XtraReport report = null;
|
||||
|
||||
if (reportID != null && reportID.ToLower().Contains("neue vereinbarung"))
|
||||
{
|
||||
ServicesOverviewRO niedersachsenRO = ServicesOverviewRO.CopyFromRO(ro);
|
||||
|
||||
niedersachsenRO.TotalFLMBillable = 0;
|
||||
|
||||
if (ro.Services != null)
|
||||
{
|
||||
foreach (ServicesOverviewRO.ServiceDetail s in ro.Services)
|
||||
{
|
||||
niedersachsenRO.Services.Add(s);
|
||||
niedersachsenRO.TotalFLMBillable += s.Minutes;
|
||||
niedersachsenRO.TotalFLS += s.Minutes / 50;
|
||||
}
|
||||
}
|
||||
|
||||
report = AddReportToReport<QuittierungsbelegNiedersachsen>(report, niedersachsenRO);
|
||||
}
|
||||
else
|
||||
{
|
||||
report = AddReportToReport<Quittierungsbeleg>(report, ro);
|
||||
}
|
||||
|
||||
if (report == null)
|
||||
report = new XtraReport();
|
||||
return report;
|
||||
}
|
||||
|
||||
private XtraReport AddReportToReport<T>(XtraReport report, ServicesOverviewRO ro) where T : XtraReport, IBeWoReport<ServicesOverviewRO>, new()
|
||||
{
|
||||
if (ro.Services.Count > 0)
|
||||
{
|
||||
if (report == null)
|
||||
{
|
||||
report = new T();
|
||||
((T)report).SetReportDataSource(ro);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (report.Pages.Count == 0)
|
||||
{
|
||||
report.CreateDocument();
|
||||
}
|
||||
|
||||
XtraReport newReport = new T();
|
||||
((T)newReport).SetReportDataSource(ro);
|
||||
|
||||
newReport.CreateDocument();
|
||||
report.Pages.AddRange(newReport.Pages);
|
||||
}
|
||||
}
|
||||
return report;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
@@ -57,18 +58,27 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="CustomMitarbeiterstundenkontoBerechnung.cs" />
|
||||
<Compile Include="CustomMitarbeiterstundenkontoBerechnungMonate.cs" />
|
||||
<Compile Include="CustomReportCreator.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
|
||||
<Compile Include="Mitarbeiterarbeitszeitkonto.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Mitarbeiterarbeitszeitkonto.designer.cs" />
|
||||
<Compile Include="Mitarbeiterarbeitszeitkonto.designer.cs">
|
||||
<DependentUpon>Mitarbeiterarbeitszeitkonto.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Mitarbeiterstundenkonto.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Mitarbeiterstundenkonto.designer.cs" />
|
||||
<Compile Include="Mitarbeiterstundenkonto.designer.cs">
|
||||
<DependentUpon>Mitarbeiterstundenkonto.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MitarbeiterstundenkontoJahr.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MitarbeiterstundenkontoJahr.designer.cs" />
|
||||
<Compile Include="MitarbeiterstundenkontoJahr.designer.cs">
|
||||
<DependentUpon>MitarbeiterstundenkontoJahr.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Quittierungsbeleg.cs">
|
||||
<SubType>Component</SubType>
|
||||
@@ -76,6 +86,12 @@
|
||||
<Compile Include="Quittierungsbeleg.Designer.cs">
|
||||
<DependentUpon>Quittierungsbeleg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="QuittierungsbelegNiedersachsen.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="QuittierungsbelegNiedersachsen.Designer.cs">
|
||||
<DependentUpon>QuittierungsbelegNiedersachsen.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ServiceInvoiceReport.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -97,7 +113,9 @@
|
||||
<Compile Include="Teamstundenkonto.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Teamstundenkonto.designer.cs" />
|
||||
<Compile Include="Teamstundenkonto.designer.cs">
|
||||
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Data\Data.csproj">
|
||||
@@ -118,14 +136,24 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Mitarbeiterarbeitszeitkonto.resx" />
|
||||
<EmbeddedResource Include="Mitarbeiterstundenkonto.resx" />
|
||||
<EmbeddedResource Include="MitarbeiterstundenkontoJahr.resx" />
|
||||
<EmbeddedResource Include="Mitarbeiterarbeitszeitkonto.resx">
|
||||
<DependentUpon>Mitarbeiterarbeitszeitkonto.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Mitarbeiterstundenkonto.resx">
|
||||
<DependentUpon>Mitarbeiterstundenkonto.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MitarbeiterstundenkontoJahr.resx">
|
||||
<DependentUpon>MitarbeiterstundenkontoJahr.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="Quittierungsbeleg.resx">
|
||||
<DependentUpon>Quittierungsbeleg.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="QuittierungsbelegNiedersachsen.resx">
|
||||
<DependentUpon>QuittierungsbelegNiedersachsen.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ServiceInvoiceReport.resx">
|
||||
<DependentUpon>ServiceInvoiceReport.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -138,7 +166,9 @@
|
||||
<DependentUpon>SettlementReport.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Teamstundenkonto.resx" />
|
||||
<EmbeddedResource Include="Teamstundenkonto.resx">
|
||||
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Invoicing;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
using BS.Shared.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace DieBrueckeHilfeUndHalt.Invoicing
|
||||
{
|
||||
|
||||
public class CustomInvoiceCreation : InvoiceCreation
|
||||
{
|
||||
public override void SetInvoiceId(ServiceInvoice invoice)
|
||||
{
|
||||
base.SetInvoiceId(invoice);
|
||||
}
|
||||
|
||||
public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, Calculations calc)
|
||||
{
|
||||
var invoiceItem = base.CreateInvoiceItem(iServiceRecord, scap, calc);
|
||||
|
||||
var crp = scap.CostBearer2SupportConcept.CostBearer.CostRatePeriods;
|
||||
if (crp != null && crp.Count > 0)
|
||||
{
|
||||
var minutesPerServiceUnit = crp.FirstOrDefault(c => c.CostRateType == BS.Shared.CostRatePeriodType.MinutesPerServiceUnit);
|
||||
var minsProFLS = minutesPerServiceUnit != null ? minutesPerServiceUnit.CostRateValue : 60;
|
||||
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.GrossAmountTotal * 60 / minsProFLS;
|
||||
invoiceItem.AmountTotal = invoiceItem.AmountTotal * 60 / minsProFLS;
|
||||
}
|
||||
|
||||
return invoiceItem;
|
||||
}
|
||||
|
||||
public override IList<InvoiceItem> CreateInvoiceItems(List<ServiceRecordDC> serviceRecordsInPeriod, DateTimeSpan invoicePeriod,
|
||||
SupportConceptApprovalPeriod scap, BS.Shared.Services.Calculations calc)
|
||||
{
|
||||
var list = base.CreateInvoiceItems(serviceRecordsInPeriod, invoicePeriod, scap, calc);
|
||||
|
||||
var crp = scap.CostBearer2SupportConcept.CostBearer.CostRatePeriods;
|
||||
decimal minsProFLS = 60;
|
||||
if (crp != null && crp.Count > 0)
|
||||
{
|
||||
var minutesPerServiceUnit = crp.FirstOrDefault(c => c.CostRateType == BS.Shared.CostRatePeriodType.MinutesPerServiceUnit);
|
||||
minsProFLS = minutesPerServiceUnit.CostRateValue.Value;
|
||||
}
|
||||
|
||||
var function = scap.CostBearer2SupportConcept.CostBearer.Organisation.Function;
|
||||
if (function != null && function.Value.ToLower().Contains("neue vereinbarung"))
|
||||
{
|
||||
List<InvoiceItem> toAdd = new List<InvoiceItem>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
var countQualifiziert = serviceRecordsInPeriod.Where(sr => !sr.ServiceDescription.Name.ToLower().Contains("betriebsstätte") && !sr.ServiceDescription.Name.ToLower().Contains("telefonat") && !sr.ServiceDescription.Name.ToLower().Contains("terminabsage")).ToList();
|
||||
if (countQualifiziert.Count > 0)
|
||||
toAdd.Add(CreateKontaktpauschalenItem(countQualifiziert.Count, item.ItemPeriodStart, item.ItemPeriodEnd, "Wegepauschale"));
|
||||
}
|
||||
if (toAdd.Count > 0)
|
||||
list.AddRange(toAdd);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public override void BerechneSummaryItemsSummen(List<InvoiceItem> newlist, bool addRateFactorToUnitCount)
|
||||
{
|
||||
// Rausfinden, ob FLS 50 statt 60 Minuten gehen
|
||||
//
|
||||
if (newlist != null && newlist.Count > 0)
|
||||
{
|
||||
var oid = newlist.FirstOrDefault(i => i.SupportConceptApprovalPeriodOid != null).SupportConceptApprovalPeriodOid;
|
||||
SupportConceptApprovalPeriod ap = null;
|
||||
if (oid != null)
|
||||
ap = DAOFactory.GenericDAO.GetByID<SupportConceptApprovalPeriod>(oid.Value);
|
||||
|
||||
List<CostRatePeriod> crp = null;
|
||||
if (ap != null)
|
||||
crp = ap.CostBearer2SupportConcept.CostBearer.CostRatePeriods.ToList();
|
||||
|
||||
if (crp != null && crp.Count > 0)
|
||||
{
|
||||
var minutesPerServiceUnit = crp.FirstOrDefault(c => c.CostRateType == BS.Shared.CostRatePeriodType.MinutesPerServiceUnit);
|
||||
var minsProFLS = minutesPerServiceUnit != null ? minutesPerServiceUnit.CostRateValue : 60;
|
||||
|
||||
foreach (InvoiceItem invoiceItem in newlist)
|
||||
{
|
||||
if (!invoiceItem.AmountPerUnit.HasValue)
|
||||
{
|
||||
invoiceItem.AmountPerUnit = 0;
|
||||
}
|
||||
invoiceItem.AmountPerUnit = Math.Round(invoiceItem.AmountPerUnit.Value, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
if (!invoiceItem.UnitCount.HasValue)
|
||||
{
|
||||
invoiceItem.UnitCount = 0;
|
||||
}
|
||||
|
||||
if (addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue)
|
||||
{
|
||||
invoiceItem.UnitCount = (invoiceItem.UnitCount ?? 0) * ((invoiceItem.RateFactor + 100) / 100);
|
||||
}
|
||||
|
||||
invoiceItem.UnitCount = Math.Round(invoiceItem.UnitCount.Value, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
|
||||
// Änderung: Eine FLS hat 50 statt 60 Minuten
|
||||
// der Kostenträger braucht die Zwischenrundung auf 2 Nachkommastellen
|
||||
invoiceItem.UnitCount = (decimal)Math.Round((double)(invoiceItem.UnitCount * 60 / minsProFLS), 2, MidpointRounding.AwayFromZero);
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.AmountPerUnit * invoiceItem.UnitCount;
|
||||
invoiceItem.AmountTotal = invoiceItem.AmountPerUnit * invoiceItem.UnitCount;
|
||||
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
|
||||
|
||||
|
||||
if (!addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue)
|
||||
{
|
||||
invoiceItem.GrossAmountTotal *= (invoiceItem.RateFactor + 100) / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private InvoiceItem CreateKontaktpauschalenItem(decimal? unitCount, DateTime? itemPeriodStart, DateTime? itemPeriodEnd, string bezeichnungPreis)
|
||||
{
|
||||
var pauschale = GetPreis(bezeichnungPreis, itemPeriodStart.Value);
|
||||
|
||||
var ii = new InvoiceItem()
|
||||
{
|
||||
UnitCount = unitCount,
|
||||
ItemDescription = "Wegepauschale",
|
||||
UnitDescription = "Pauschale pro direktem Kontakt",
|
||||
AmountPerUnit = pauschale,
|
||||
AmountTotal = pauschale * unitCount,
|
||||
GrossAmountTotal = pauschale * unitCount,
|
||||
ItemPeriodStart = itemPeriodStart,
|
||||
ItemPeriodEnd = itemPeriodEnd
|
||||
};
|
||||
return ii;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Invoicing;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Services;
|
||||
|
||||
namespace DieBrueckeHilfeUndHalt.Invoicing
|
||||
{
|
||||
public class CustomInvoiceFactory : InvoiceFactory
|
||||
{
|
||||
|
||||
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
||||
{
|
||||
|
||||
foreach (var item in supportConcepts2ServiceRecords)
|
||||
{
|
||||
var csc = item.Key;
|
||||
var sc = DAOFactory.GenericDAO.GetByID<SupportConcept>(csc.SupportConceptOid);
|
||||
var ap = sc.CostBearer2SupportConceptList.FirstOrDefault(cb2sc => csc.CostBearer.Contains(cb2sc.CostBearer.Organisation.Name));
|
||||
if (ap != null)
|
||||
{
|
||||
if (ap.CostBearer.Organisation.Function != null && ap.CostBearer.Organisation.Function.Value.ToLower().Contains("neue vereinbarung"))
|
||||
{
|
||||
return new CustomInvoiceCreation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new InvoiceCreation();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,4 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="bindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1 @@
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
1329
ReportImp/DieBrueckeHilfeUndHalt/QuittierungsbelegNiedersachsen.Designer.cs
generated
Normal file
1329
ReportImp/DieBrueckeHilfeUndHalt/QuittierungsbelegNiedersachsen.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,166 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace DieBrueckeHilfeUndHalt
|
||||
{
|
||||
public partial class QuittierungsbelegNiedersachsen : XtraReport, IBeWoReport<ServicesOverviewRO>
|
||||
{
|
||||
public QuittierungsbelegNiedersachsen()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetReportDataSource(ServicesOverviewRO pRO)
|
||||
{
|
||||
// Get calling method name
|
||||
//StackTrace stackTrace = new StackTrace();
|
||||
//Debug.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);
|
||||
|
||||
bool hatGruppen = false;
|
||||
double minuten = 0;
|
||||
|
||||
var cr = pRO.CostBearer2SupportConceptList[0].CostBearer.CostRatePeriods.Where(p => p.CostRateType == CostRatePeriodType.MinutesPerServiceUnit).OrderBy(c => c.EndDate).ToList();
|
||||
var currentFLSUnit = cr.FirstOrDefault(c => c.EndDate >= pRO.EndDate);
|
||||
if (currentFLSUnit == null)
|
||||
currentFLSUnit = cr[0];
|
||||
|
||||
if (pRO.Services != null)
|
||||
{
|
||||
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
||||
int summeWegepauschalen = 0;
|
||||
int summeAusfallstunden = 0;
|
||||
foreach (var sd in pRO.Services)
|
||||
{
|
||||
if (sd.IsBillable)
|
||||
{
|
||||
minuten += sd.Minutes;
|
||||
|
||||
ServicesOverviewRO.CreateSignatureString(sd);
|
||||
|
||||
// Spalte Gruppenangebot
|
||||
if (sd.IsGroup)
|
||||
{
|
||||
hatGruppen = true;
|
||||
sd.Notice3 = "1";
|
||||
}
|
||||
|
||||
// Spalte für Wegepauschale setzen (wenn nicht bestimmte Leistung, dann ja)
|
||||
if (!sd.ServiceDescription.ToLower().Contains("betriebsstätte") && !sd.ServiceDescription.ToLower().Contains("telefonat") &&
|
||||
!sd.ServiceDescription.ToLower().Contains("terminabsage"))
|
||||
{
|
||||
sd.Notice4 = "1";
|
||||
summeWegepauschalen++;
|
||||
}
|
||||
else
|
||||
sd.Notice4 = "";
|
||||
|
||||
// Spalte für Ausfallstunden setzen (wenn Fehlbesuch, dann ja)
|
||||
if (sd.ServiceCategory.ToLower().Contains("fehlbesuch") || sd.ServiceDescription.ToLower().Contains("fehlbesuch"))
|
||||
{
|
||||
sd.Notice5 = "1";
|
||||
summeAusfallstunden++;
|
||||
}
|
||||
else
|
||||
sd.Notice5 = "";
|
||||
|
||||
servicesBillable.Add(sd);
|
||||
}
|
||||
}
|
||||
|
||||
pRO.Services = servicesBillable;
|
||||
lblSummeWegepauschalen.Text = string.Format("{0:0}", summeWegepauschalen);
|
||||
lblSummeAusfallstunden.Text = string.Format("{0:0}", summeAusfallstunden);
|
||||
}
|
||||
|
||||
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
|
||||
{
|
||||
var c2s = pRO.CostBearer2SupportConceptList[0];
|
||||
var dc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(c2s);
|
||||
|
||||
decimal bewilligteFLS = 0;
|
||||
|
||||
foreach (var scap in dc.ApprovalPeriodList)
|
||||
{
|
||||
if (scap.ServiceCategory != null)
|
||||
{
|
||||
if (scap.ApprovedBEPerInterval.HasValue && scap.ApprovedBEInterval.HasValue && scap.ServiceCategory != null && scap.ServiceCategory.Name == pRO.Services[0].ServiceCategory)
|
||||
{
|
||||
bewilligteFLS = scap.ApprovedBEPerInterval.Value;
|
||||
if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Weekly)
|
||||
pRO.ApprovedFLSTotal = Convert.ToDecimal((scap.EndDate.Value - scap.StartDate.Value).TotalDays / 7) * scap.ApprovedBEPerInterval.Value;
|
||||
else if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly)
|
||||
pRO.ApprovedFLSTotal = Convert.ToDecimal(((scap.EndDate.Value - scap.StartDate.Value).TotalDays + 1) / 30.44) * scap.ApprovedBEPerInterval.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (scap.ApprovedBEInterval.HasValue && scap.StartDate.HasValue && scap.EndDate.HasValue)
|
||||
{
|
||||
if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Weekly)
|
||||
{
|
||||
bewilligteFLS = scap.ApprovedBEPerInterval.Value;
|
||||
pRO.ApprovedFLSTotal = Convert.ToDecimal((scap.EndDate.Value - scap.StartDate.Value).TotalDays / 7) * scap.ApprovedBEPerInterval.Value;
|
||||
}
|
||||
else if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly)
|
||||
{
|
||||
bewilligteFLS = scap.ApprovedBEPerInterval.Value;
|
||||
pRO.ApprovedFLSTotal = Convert.ToDecimal(((scap.EndDate.Value - scap.StartDate.Value).TotalDays + 1) / 30.44) * scap.ApprovedBEPerInterval.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lblBewilligtFls.Text = String.Format("{0:0.00}", bewilligteFLS);
|
||||
}
|
||||
|
||||
pRO.TotalFLMBillable = minuten;
|
||||
|
||||
foreach (var s in pRO.Services)
|
||||
s.FLSQualified = s.Minutes / Convert.ToDouble(currentFLSUnit.CostRateValue);
|
||||
pRO.TotalFLSQualified = pRO.TotalFLMQualified / Convert.ToDouble(currentFLSUnit.CostRateValue);
|
||||
|
||||
pRO.CalculateFLSSollIst2();
|
||||
lblRestbudget.Text = String.Format("{0:0.00}", pRO.ApprovedFLSTotal - pRO.MinutenGeleistetBisVormonat / currentFLSUnit.CostRateValue);
|
||||
|
||||
bindingSource1.DataSource = pRO;
|
||||
}
|
||||
|
||||
private void picSignature_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
XRPictureBox xrBox = sender as XRPictureBox;
|
||||
//var test = this.GetCurrent
|
||||
string base64String = xrBox.Tag as string;
|
||||
if (!String.IsNullOrWhiteSpace(base64String))
|
||||
{
|
||||
var base64Data = Regex.Match(base64String, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
|
||||
var binData = Convert.FromBase64String(base64Data);
|
||||
Image img = ByteArrayToImage(binData);
|
||||
xrBox.Image = Utils.CropImage(img);
|
||||
}
|
||||
else
|
||||
{
|
||||
xrBox.Image = null;
|
||||
}
|
||||
}
|
||||
|
||||
public Image ByteArrayToImage(byte[] byteArrayIn)
|
||||
{
|
||||
using (var memoryStream = new MemoryStream(byteArrayIn))
|
||||
{
|
||||
return Image.FromStream(memoryStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user