FeidPartnerReports/PersonalplanungReport - Individualbericht 1.0

This commit is contained in:
2026-04-29 14:57:08 +02:00
parent 5ff631f9e7
commit 55d89505e1
6 changed files with 740 additions and 0 deletions

View File

@@ -27,6 +27,11 @@ namespace FeidPartnerReports
return CreateRechnungslaufUnbewilligte(queryOid, queryReportId);
}
if (queryOid == 200)
{
return CreatePersonalplanung(queryOid, queryReportId);
}
return base.CreateQueryReport(queryOid, queryReportId);
}
@@ -166,6 +171,27 @@ namespace FeidPartnerReports
return newInvoices;
}
private XtraReport CreatePersonalplanung(long queryOid, string queryReportId)
{
var query = DAOFactory.GenericDAO.LoadByID<Query>(queryOid);
if (query == null)
return new XtraReport();
var path = Path.Combine(TempPath, queryReportId + ".xml");
var table = Utils.XMLDeserialize<DataTable>(path);
var qro = QueryRO.Create(query, table);
DateTime reportMonth = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
if (qro.Rows.Count > 0 && qro.Rows[0].Field1 != null
&& DateTime.TryParse(qro.Rows[0].Field1.ToString(), out DateTime parsedMonth))
reportMonth = new DateTime(parsedMonth.Year, parsedMonth.Month, 1);
var ro = PersonalplanungRO.Create(reportMonth);
var report = new FeidPartnerReports.PersonalplanungReport();
report.SetReportDataSource(ro);
return report;
}
}
}

View File

@@ -127,6 +127,13 @@
<Compile Include="Invoicing\CollectiveInvoiceBeWo67Creation.cs" />
<Compile Include="Invoicing\CollectiveInvoiceCreation.cs" />
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
<Compile Include="PersonalplanungReport.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="PersonalplanungReport.Designer.cs">
<DependentUpon>PersonalplanungReport.cs</DependentUpon>
</Compile>
<Compile Include="PersonalplanungRO.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
@@ -155,6 +162,9 @@
<EmbeddedResource Include="CollectiveBillingReportTab.resx">
<DependentUpon>CollectiveBillingReportTab.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PersonalplanungReport.resx">
<DependentUpon>PersonalplanungReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>

View File

@@ -0,0 +1,333 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.Services;
namespace FeidPartnerReports
{
public class PersonalplanungRO
{
public DateTime ReportMonth { get; set; }
public List<PersonalplanungRow> Rows { get; set; } = new List<PersonalplanungRow>();
public static PersonalplanungRO Create(DateTime reportMonth)
{
var ro = new PersonalplanungRO();
ro.ReportMonth = reportMonth;
var monthStart = new DateTime(reportMonth.Year, reportMonth.Month, 1);
var monthEnd = monthStart.AddMonths(1).AddDays(-1);
var nextMonthStart = monthEnd.AddDays(1);
var nextMonthEnd = monthStart.AddMonths(2).AddDays(-1);
var serviceRecordStart = monthStart.AddMonths(-3);
decimal weeksInPeriod = (decimal)(monthEnd - serviceRecordStart).TotalDays / 7m;
var employees = DAOFactory.GenericDAO.GetAllActive<Employee>();
foreach (var emp in employees)
{
// ServiceRecords des MAs für den 3-Monats-Zeitraum gebündelt laden
IList<ServiceRecord> empServiceRecords = null;
try
{
empServiceRecords = DAOFactory.SearchDAO.FindEmployeeServiceRecords(
emp.Oid.Value,
new DateTimeSpan(serviceRecordStart, monthEnd),
null, null);
}
catch { }
var groupMinutesByCb2scOid = empServiceRecords != null
? empServiceRecords
.Where(sr => sr.CostBearer2SupportConceptOid.HasValue && sr.GroupOid.HasValue)
.GroupBy(sr => sr.CostBearer2SupportConceptOid.Value)
.ToDictionary(g => g.Key, g => g.Sum(sr => sr.RoundedDuration))
: new Dictionary<long, decimal>();
var empName = $"{emp.Person.LastName}, {emp.Person.FirstName}";
var contract = emp.GetValidContractForDate(monthStart);
decimal weeklyTotalHours = contract?.WeeklyTotalHours ?? 0m;
decimal weeklyFLS = contract?.WeeklyFLS ?? 0m;
var cb2scEntries = new Dictionary<long, Cb2ScEntry>();
var processedScapOids = new HashSet<long>();
// --- Pfad 1: explizite Betreuungsschlüssel (sp2e) — haben Vorrang ---
var sp2eList = DAOFactory.SearchDAO.FindSupportConceptApprovalPeriod2Employees(emp);
if (sp2eList != null)
{
foreach (var sp2e in sp2eList)
{
SupportConceptApprovalPeriod scap;
CostBearer2SupportConcept cb2sc;
try
{
scap = DAOFactory.GenericDAO.Unproxy(sp2e.SupportConceptApprovalPeriod);
if (scap == null || !scap.Oid.HasValue) continue;
cb2sc = DAOFactory.GenericDAO.Unproxy(scap.CostBearer2SupportConcept);
if (cb2sc == null || !cb2sc.Oid.HasValue) continue;
}
catch { continue; }
processedScapOids.Add(scap.Oid.Value);
if (scap.ServiceCategory?.Name?.IndexOf("Fahrzeit", StringComparison.OrdinalIgnoreCase) >= 0) continue;
bool validThis = IsValidInPeriod(scap, monthStart, monthEnd);
bool validNext = IsValidInPeriod(scap, nextMonthStart, nextMonthEnd);
if (!validThis && !validNext) continue;
long key = cb2sc.Oid.Value;
if (!cb2scEntries.ContainsKey(key))
cb2scEntries[key] = new Cb2ScEntry { Cb2Sc = cb2sc };
var entry = cb2scEntries[key];
if (validThis && entry.ScapThis == null) { entry.ScapThis = scap; entry.Sp2eThis = sp2e; }
if (validNext && entry.ScapNext == null) { entry.ScapNext = scap; entry.Sp2eNext = sp2e; }
}
}
// --- Pfad 2: Hauptbetreuer via Employee2Customer (primäre Zuordnung) ---
if (emp.Employee2CustomerList != null)
{
foreach (var e2c in emp.Employee2CustomerList)
{
bool isMainAttendant = e2c.ValueList != null && e2c.ValueList.Count > 0
&& e2c.ValueList[0].Entry.SystemEntryID == SystemEntryID.EmployeeRoleMainAttendant;
if (!isMainAttendant) continue;
if (e2c.Customer == null || e2c.Customer.IsActive == ActivationTypeId.Deleted) continue;
if (e2c.StartDate.HasValue && e2c.StartDate.Value.Date >= nextMonthEnd.Date) continue;
if (e2c.EndDate.HasValue && e2c.EndDate.Value.Date < monthStart) continue;
if (e2c.Customer.SupportConcepts == null) continue;
foreach (var sc in e2c.Customer.SupportConcepts)
{
if (sc.IsActive == ActivationTypeId.Deleted || sc.IsActive == ActivationTypeId.Archived) continue;
if (sc.CostBearer2SupportConceptList == null) continue;
foreach (var c2s in sc.CostBearer2SupportConceptList)
{
if (c2s.ApprovalPeriodList == null) continue;
foreach (var scap in c2s.ApprovalPeriodList)
{
if (!scap.Oid.HasValue) continue;
if (processedScapOids.Contains(scap.Oid.Value)) continue;
if (scap.ServiceCategory?.Name?.IndexOf("Fahrzeit", StringComparison.OrdinalIgnoreCase) >= 0) continue;
bool validThis = IsValidInPeriod(scap, monthStart, monthEnd);
bool validNext = IsValidInPeriod(scap, nextMonthStart, nextMonthEnd);
if (!validThis && !validNext) continue;
CostBearer2SupportConcept cb2sc;
try
{
cb2sc = DAOFactory.GenericDAO.Unproxy(c2s);
if (cb2sc == null || !cb2sc.Oid.HasValue) continue;
}
catch { continue; }
long key = cb2sc.Oid.Value;
if (!cb2scEntries.ContainsKey(key))
cb2scEntries[key] = new Cb2ScEntry { Cb2Sc = cb2sc };
var entry = cb2scEntries[key];
// sp2e == null signalisiert Hauptbetreuer-Pfad
if (validThis && entry.ScapThis == null) { entry.ScapThis = scap; entry.Sp2eThis = null; }
if (validNext && entry.ScapNext == null) { entry.ScapNext = scap; entry.Sp2eNext = null; }
}
}
}
}
}
// --- Zeilen erzeugen ---
foreach (var entry in cb2scEntries.Values)
{
var cb2sc = entry.Cb2Sc;
var sc = cb2sc.SupportConcept;
if (sc == null || sc.IsActive == ActivationTypeId.Deleted || sc.IsActive == ActivationTypeId.Archived) continue;
var customer = sc.Customer;
if (customer == null || customer.IsActive != ActivationTypeId.Active) continue;
if (customer.TerminationDate.HasValue && customer.TerminationDate.Value < monthStart) continue;
decimal bewilligtThis = entry.Sp2eThis != null
? CalculateBewilligtSp2e(entry.ScapThis, entry.Sp2eThis, cb2sc)
: CalculateBewilligtHauptbetreuer(entry.ScapThis, cb2sc);
decimal bewilligtNext = entry.Sp2eNext != null
? CalculateBewilligtSp2e(entry.ScapNext, entry.Sp2eNext, cb2sc)
: CalculateBewilligtHauptbetreuer(entry.ScapNext, cb2sc);
if (bewilligtThis == 0m && bewilligtNext == 0m) continue;
decimal avgGruppeStdProWoche = 0m;
if (cb2sc.Oid.HasValue
&& groupMinutesByCb2scOid.TryGetValue(cb2sc.Oid.Value, out decimal gruppeMin)
&& weeksInPeriod > 0)
avgGruppeStdProWoche = (gruppeMin / 60m) / weeksInPeriod;
decimal geleistetThis = Math.Max(0m, bewilligtThis - avgGruppeStdProWoche);
decimal geleistetNext = Math.Max(0m, bewilligtNext - avgGruppeStdProWoche);
decimal auslastungThis = bewilligtThis > 0 ? Math.Round((geleistetThis / bewilligtThis) * 100m, 1) : 0m;
decimal auslastungNext = bewilligtNext > 0 ? Math.Round((geleistetNext / bewilligtNext) * 100m, 1) : 0m;
var relevantScap = entry.ScapThis ?? entry.ScapNext;
DateTime? enddatum = null;
enddatum = TakeEarliest(enddatum, relevantScap?.EndDate);
enddatum = TakeEarliest(enddatum, cb2sc.EndDate);
enddatum = TakeEarliest(enddatum, customer.TerminationDate);
var kostentraeger = "";
try { kostentraeger = cb2sc.CostBearer?.Organisation?.Name ?? ""; } catch { }
var wohnort = "";
try { wohnort = customer.Person?.Address?.Town ?? ""; } catch { }
ro.Rows.Add(new PersonalplanungRow
{
MitarbeiterName = empName,
VertragWochenstunden = weeklyTotalHours,
VertragFLSProWoche = weeklyFLS,
KlientName = $"{customer.Person.LastName}, {customer.Person.FirstName}",
Kostentraeger = kostentraeger,
WohnortKlient = wohnort,
BewilligteStdProWoche = Math.Round(bewilligtThis, 2),
GeleisteteStdProWoche = Math.Round(geleistetThis, 2),
AuslastungProWoche = auslastungThis,
BewilligteStdProWocheNaechsterMonat = Math.Round(bewilligtNext, 2),
GeleisteteStdProWocheNaechsterMonat = Math.Round(geleistetNext, 2),
AuslastungProWocheNaechsterMonat = auslastungNext,
Enddatum = enddatum,
});
}
}
ro.Rows.Sort((a, b) =>
{
int cmp = string.Compare(a.MitarbeiterName, b.MitarbeiterName, StringComparison.CurrentCulture);
if (cmp != 0) return cmp;
return string.Compare(a.KlientName, b.KlientName, StringComparison.CurrentCulture);
});
return ro;
}
// Bewilligte Std/Woche für explizite Betreuungsschlüssel-Zuordnung
private static decimal CalculateBewilligtSp2e(SupportConceptApprovalPeriod scap, SupportConceptApprovalPeriod2Employee sp2e, CostBearer2SupportConcept cb2sc)
{
if (scap == null || sp2e == null) return 0m;
try
{
decimal rawBewilligt = GetRawApprovedHoursPerWeek(scap, cb2sc);
decimal anteil = sp2e.Betreuungsschluessel;
if (!sp2e.IsAbsolut)
{
if (anteil == 33m) anteil = 100m / 3m;
else if (anteil == 67m) anteil = (100m / 3m) * 2m;
return rawBewilligt * (anteil / 100m);
}
else
{
return anteil / 60m;
}
}
catch { return 0m; }
}
// Bewilligte Std/Woche für Hauptbetreuer = volle Bewilligung minus Anteile anderer MAs
private static decimal CalculateBewilligtHauptbetreuer(SupportConceptApprovalPeriod scap, CostBearer2SupportConcept cb2sc)
{
if (scap == null) return 0m;
try
{
decimal fullHours = GetRawApprovedHoursPerWeek(scap, cb2sc);
decimal deductions = 0m;
var otherSp2e = DAOFactory.SearchDAO.FindSupportConceptApprovalPeriod2Employees(scap);
foreach (var sp2e in otherSp2e)
{
decimal anteil = sp2e.Betreuungsschluessel;
if (!sp2e.IsAbsolut)
{
if (anteil == 33m) anteil = 100m / 3m;
else if (anteil == 67m) anteil = (100m / 3m) * 2m;
deductions += fullHours * (anteil / 100m);
}
else
{
deductions += anteil / 60m;
}
}
return Math.Max(0m, fullHours - deductions);
}
catch { return 0m; }
}
private static decimal GetRawApprovedHoursPerWeek(SupportConceptApprovalPeriod scap, CostBearer2SupportConcept cb2sc)
{
var calc = PluginLoader.FindClass<Calculations>(cb2sc.CostBearer.ID)
?? Calculations.GetInstance(cb2sc.CostBearer.ID);
var scapDc = MapperFactory.SupportConceptApprovalPeriodDC_SupportConceptApprovalPeriod.MapToNewDC(scap);
var cb2scDc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(cb2sc);
return calc.GetApprovedHoursPerWeek(scapDc, cb2scDc.CostBearer.CostRatePeriods) ?? 0m;
}
private static bool IsValidInPeriod(SupportConceptApprovalPeriod scap, DateTime periodStart, DateTime periodEnd)
{
return (!scap.StartDate.HasValue || scap.StartDate.Value <= periodEnd)
&& (!scap.EndDate.HasValue || scap.EndDate.Value >= periodStart);
}
private static DateTime? TakeEarliest(DateTime? current, DateTime? candidate)
{
if (!candidate.HasValue) return current;
if (!current.HasValue) return candidate;
return candidate.Value < current.Value ? candidate : current;
}
private class Cb2ScEntry
{
public CostBearer2SupportConcept Cb2Sc { get; set; }
public SupportConceptApprovalPeriod2Employee Sp2eThis { get; set; }
public SupportConceptApprovalPeriod ScapThis { get; set; }
public SupportConceptApprovalPeriod2Employee Sp2eNext { get; set; }
public SupportConceptApprovalPeriod ScapNext { get; set; }
}
}
public class PersonalplanungRow
{
public string MitarbeiterName { get; set; }
public decimal VertragWochenstunden { get; set; }
public decimal VertragFLSProWoche { get; set; }
public string MitarbeiterNameMitVertrag => VertragWochenstunden > 0 || VertragFLSProWoche > 0
? $"{MitarbeiterName} (Std/Wo: {VertragWochenstunden:0.##}, FLS/Wo: {VertragFLSProWoche:0.##})"
: MitarbeiterName;
public string KlientName { get; set; }
public string Kostentraeger { get; set; }
public string WohnortKlient { get; set; }
public decimal BewilligteStdProWoche { get; set; }
public decimal GeleisteteStdProWoche { get; set; }
public decimal AuslastungProWoche { get; set; }
public decimal BewilligteStdProWocheNaechsterMonat { get; set; }
public decimal GeleisteteStdProWocheNaechsterMonat { get; set; }
public decimal AuslastungProWocheNaechsterMonat { get; set; }
public DateTime? Enddatum { get; set; }
public string EnddatumFormatted => Enddatum.HasValue ? Enddatum.Value.ToString("dd.MM.yyyy") : "";
public string AuslastungFormatted => AuslastungProWoche.ToString("0.0") + " %";
public string AuslastungNaechsterMonatFormatted => AuslastungProWocheNaechsterMonat.ToString("0.0") + " %";
}
}

View File

@@ -0,0 +1,233 @@
namespace FeidPartnerReports
{
partial class PersonalplanungReport
{
private System.ComponentModel.IContainer components;
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
components.Dispose();
base.Dispose(disposing);
}
#region Designer generated code
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
this.xrTableDetail = new DevExpress.XtraReports.UI.XRTable();
this.xrRowDetail = new DevExpress.XtraReports.UI.XRTableRow();
this.cellKlient = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostentraeger = new DevExpress.XtraReports.UI.XRTableCell();
this.cellWohnort = new DevExpress.XtraReports.UI.XRTableCell();
this.cellBewilligt = new DevExpress.XtraReports.UI.XRTableCell();
this.cellGeleistet = new DevExpress.XtraReports.UI.XRTableCell();
this.cellAuslastung = new DevExpress.XtraReports.UI.XRTableCell();
this.cellBewilligtNext = new DevExpress.XtraReports.UI.XRTableCell();
this.cellGeleistetNext = new DevExpress.XtraReports.UI.XRTableCell();
this.cellAuslastungNext = new DevExpress.XtraReports.UI.XRTableCell();
this.cellEnddatum = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.xrLabelMitarbeiter = new DevExpress.XtraReports.UI.XRLabel();
this.PageHeader = new DevExpress.XtraReports.UI.PageHeaderBand();
this.xrTableHeader = new DevExpress.XtraReports.UI.XRTable();
this.xrRowHeader1 = new DevExpress.XtraReports.UI.XRTableRow();
this.cellHKlientSpan = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHKostentraegerSpan = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHWohnortSpan = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHDieserMonat = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHNaechsterMonat = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHEnddatumSpan = new DevExpress.XtraReports.UI.XRTableCell();
this.xrRowHeader2 = new DevExpress.XtraReports.UI.XRTableRow();
this.cellHKlient = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHKostentraeger = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHWohnort = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHBewilligt = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHGeleistet = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHAuslastung = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHBewilligtNext = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHGeleistetNext = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHAuslastungNext = new DevExpress.XtraReports.UI.XRTableCell();
this.cellHEnddatum = new DevExpress.XtraReports.UI.XRTableCell();
this.PageFooter = new DevExpress.XtraReports.UI.PageFooterBand();
this.xrPageInfo = new DevExpress.XtraReports.UI.XRPageInfo();
this.xrLabelFooter = new DevExpress.XtraReports.UI.XRLabel();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableDetail)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableHeader)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
// bindingSource1
this.bindingSource1.DataSource = typeof(FeidPartnerReports.PersonalplanungRow);
// --- Page Header (2 Zeilen: Monatsgruppen-Label + Spaltenköpfe) ---
this.PageHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrTableHeader });
this.PageHeader.HeightF = 50F;
this.PageHeader.Name = "PageHeader";
this.xrTableHeader.LocationF = new System.Drawing.PointF(0F, 0F);
this.xrTableHeader.Name = "xrTableHeader";
this.xrTableHeader.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrRowHeader1, this.xrRowHeader2 });
this.xrTableHeader.SizeF = new System.Drawing.SizeF(1050F, 50F);
this.xrTableHeader.Font = new DevExpress.Drawing.DXFont("Arial", 8F, DevExpress.Drawing.DXFontStyle.Bold);
// Zeile 1: Gruppenbezeichnungen
this.xrRowHeader1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.cellHKlientSpan, this.cellHKostentraegerSpan, this.cellHWohnortSpan,
this.cellHDieserMonat, this.cellHNaechsterMonat, this.cellHEnddatumSpan });
this.xrRowHeader1.Name = "xrRowHeader1";
this.xrRowHeader1.Weight = 1D;
this.cellHKlientSpan.Name = "cellHKlientSpan"; this.cellHKlientSpan.Text = ""; this.cellHKlientSpan.Weight = 2.5D;
this.cellHKostentraegerSpan.Name = "cellHKostentraegerSpan"; this.cellHKostentraegerSpan.Text = ""; this.cellHKostentraegerSpan.Weight = 2D;
this.cellHWohnortSpan.Name = "cellHWohnortSpan"; this.cellHWohnortSpan.Text = ""; this.cellHWohnortSpan.Weight = 1.5D;
this.cellHDieserMonat.Name = "cellHDieserMonat"; this.cellHDieserMonat.Text = "Dieser Monat"; this.cellHDieserMonat.Weight = 3D; this.cellHDieserMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.cellHNaechsterMonat.Name = "cellHNaechsterMonat"; this.cellHNaechsterMonat.Text = "Nächster Monat"; this.cellHNaechsterMonat.Weight = 3D; this.cellHNaechsterMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.cellHEnddatumSpan.Name = "cellHEnddatumSpan"; this.cellHEnddatumSpan.Text = ""; this.cellHEnddatumSpan.Weight = 1D;
// Zeile 2: Spaltenköpfe
this.xrRowHeader2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.cellHKlient, this.cellHKostentraeger, this.cellHWohnort,
this.cellHBewilligt, this.cellHGeleistet, this.cellHAuslastung,
this.cellHBewilligtNext, this.cellHGeleistetNext, this.cellHAuslastungNext,
this.cellHEnddatum });
this.xrRowHeader2.Name = "xrRowHeader2";
this.xrRowHeader2.Weight = 1D;
this.cellHKlient.Name = "cellHKlient"; this.cellHKlient.Text = "Klient"; this.cellHKlient.Weight = 2.5D;
this.cellHKostentraeger.Name = "cellHKostentraeger"; this.cellHKostentraeger.Text = "Kostenträger"; this.cellHKostentraeger.Weight = 2D;
this.cellHWohnort.Name = "cellHWohnort"; this.cellHWohnort.Text = "Wohnort"; this.cellHWohnort.Weight = 1.5D;
this.cellHBewilligt.Name = "cellHBewilligt"; this.cellHBewilligt.Text = "Bew. Std/Wo"; this.cellHBewilligt.Weight = 1D; this.cellHBewilligt.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellHGeleistet.Name = "cellHGeleistet"; this.cellHGeleistet.Text = "Gel. Std/Wo"; this.cellHGeleistet.Weight = 1D; this.cellHGeleistet.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellHAuslastung.Name = "cellHAuslastung"; this.cellHAuslastung.Text = "Auslastung"; this.cellHAuslastung.Weight = 1D; this.cellHAuslastung.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellHBewilligtNext.Name = "cellHBewilligtNext"; this.cellHBewilligtNext.Text = "Bew. Std/Wo"; this.cellHBewilligtNext.Weight = 1D; this.cellHBewilligtNext.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellHGeleistetNext.Name = "cellHGeleistetNext"; this.cellHGeleistetNext.Text = "Gel. Std/Wo"; this.cellHGeleistetNext.Weight = 1D; this.cellHGeleistetNext.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellHAuslastungNext.Name = "cellHAuslastungNext"; this.cellHAuslastungNext.Text = "Auslastung"; this.cellHAuslastungNext.Weight = 1D; this.cellHAuslastungNext.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellHEnddatum.Name = "cellHEnddatum"; this.cellHEnddatum.Text = "Enddatum"; this.cellHEnddatum.Weight = 1D; this.cellHEnddatum.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
// --- Group Header (Mitarbeiter) ---
this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrLabelMitarbeiter });
this.GroupHeader1.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] {
new DevExpress.XtraReports.UI.GroupField("MitarbeiterName", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending) });
this.GroupHeader1.HeightF = 22F;
this.GroupHeader1.Name = "GroupHeader1";
this.GroupHeader1.RepeatEveryPage = true;
this.xrLabelMitarbeiter.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "MitarbeiterNameMitVertrag") });
this.xrLabelMitarbeiter.Font = new DevExpress.Drawing.DXFont("Arial", 9F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabelMitarbeiter.LocationF = new System.Drawing.PointF(0F, 2F);
this.xrLabelMitarbeiter.Name = "xrLabelMitarbeiter";
this.xrLabelMitarbeiter.SizeF = new System.Drawing.SizeF(500F, 18F);
// --- Detail Band ---
this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrTableDetail });
this.Detail.HeightF = 22F;
this.Detail.Name = "Detail";
this.xrTableDetail.LocationF = new System.Drawing.PointF(0F, 0F);
this.xrTableDetail.Name = "xrTableDetail";
this.xrTableDetail.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrRowDetail });
this.xrTableDetail.SizeF = new System.Drawing.SizeF(1050F, 22F);
this.xrTableDetail.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrRowDetail.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.cellKlient, this.cellKostentraeger, this.cellWohnort,
this.cellBewilligt, this.cellGeleistet, this.cellAuslastung,
this.cellBewilligtNext, this.cellGeleistetNext, this.cellAuslastungNext,
this.cellEnddatum });
this.xrRowDetail.Name = "xrRowDetail";
this.xrRowDetail.Weight = 1D;
this.cellKlient.Name = "cellKlient"; this.cellKlient.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "KlientName") }); this.cellKlient.Weight = 2.5D;
this.cellKostentraeger.Name = "cellKostentraeger"; this.cellKostentraeger.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "Kostentraeger") }); this.cellKostentraeger.Weight = 2D;
this.cellWohnort.Name = "cellWohnort"; this.cellWohnort.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "WohnortKlient") }); this.cellWohnort.Weight = 1.5D;
this.cellBewilligt.Name = "cellBewilligt"; this.cellBewilligt.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "BewilligteStdProWoche", "{0:0.00}") }); this.cellBewilligt.Weight = 1D; this.cellBewilligt.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellGeleistet.Name = "cellGeleistet"; this.cellGeleistet.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "GeleisteteStdProWoche", "{0:0.00}") }); this.cellGeleistet.Weight = 1D; this.cellGeleistet.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellAuslastung.Name = "cellAuslastung"; this.cellAuslastung.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "AuslastungFormatted") }); this.cellAuslastung.Weight = 1D; this.cellAuslastung.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellBewilligtNext.Name = "cellBewilligtNext"; this.cellBewilligtNext.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "BewilligteStdProWocheNaechsterMonat", "{0:0.00}") }); this.cellBewilligtNext.Weight = 1D; this.cellBewilligtNext.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellGeleistetNext.Name = "cellGeleistetNext"; this.cellGeleistetNext.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "GeleisteteStdProWocheNaechsterMonat", "{0:0.00}") }); this.cellGeleistetNext.Weight = 1D; this.cellGeleistetNext.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellAuslastungNext.Name = "cellAuslastungNext"; this.cellAuslastungNext.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "AuslastungNaechsterMonatFormatted") }); this.cellAuslastungNext.Weight = 1D; this.cellAuslastungNext.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.cellEnddatum.Name = "cellEnddatum"; this.cellEnddatum.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "EnddatumFormatted") }); this.cellEnddatum.Weight = 1D; this.cellEnddatum.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
// --- Page Footer ---
this.PageFooter.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrPageInfo, this.xrLabelFooter });
this.PageFooter.HeightF = 25F;
this.PageFooter.Name = "PageFooter";
this.xrPageInfo.LocationF = new System.Drawing.PointF(800F, 2F);
this.xrPageInfo.Name = "xrPageInfo";
this.xrPageInfo.SizeF = new System.Drawing.SizeF(250F, 20F);
this.xrPageInfo.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrPageInfo.Font = new DevExpress.Drawing.DXFont("Arial", 7F);
this.xrLabelFooter.LocationF = new System.Drawing.PointF(0F, 2F);
this.xrLabelFooter.Name = "xrLabelFooter";
this.xrLabelFooter.SizeF = new System.Drawing.SizeF(400F, 20F);
this.xrLabelFooter.Text = "Personalplanung";
this.xrLabelFooter.Font = new DevExpress.Drawing.DXFont("Arial", 7F);
// --- Report ---
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail, this.GroupHeader1, this.PageHeader, this.PageFooter });
this.DataSource = this.bindingSource1;
this.Margins = new System.Drawing.Printing.Margins(20, 20, 20, 20);
this.PageWidth = 1090;
this.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4Rotated;
this.Name = "PersonalplanungReport";
this.Version = "17.2";
((System.ComponentModel.ISupportInitialize)(this.xrTableDetail)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableHeader)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
}
#endregion
private System.Windows.Forms.BindingSource bindingSource1;
private DevExpress.XtraReports.UI.DetailBand Detail;
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1;
private DevExpress.XtraReports.UI.XRLabel xrLabelMitarbeiter;
private DevExpress.XtraReports.UI.PageHeaderBand PageHeader;
private DevExpress.XtraReports.UI.PageFooterBand PageFooter;
private DevExpress.XtraReports.UI.XRTable xrTableDetail;
private DevExpress.XtraReports.UI.XRTableRow xrRowDetail;
private DevExpress.XtraReports.UI.XRTableCell cellKlient;
private DevExpress.XtraReports.UI.XRTableCell cellKostentraeger;
private DevExpress.XtraReports.UI.XRTableCell cellWohnort;
private DevExpress.XtraReports.UI.XRTableCell cellBewilligt;
private DevExpress.XtraReports.UI.XRTableCell cellGeleistet;
private DevExpress.XtraReports.UI.XRTableCell cellAuslastung;
private DevExpress.XtraReports.UI.XRTableCell cellBewilligtNext;
private DevExpress.XtraReports.UI.XRTableCell cellGeleistetNext;
private DevExpress.XtraReports.UI.XRTableCell cellAuslastungNext;
private DevExpress.XtraReports.UI.XRTableCell cellEnddatum;
private DevExpress.XtraReports.UI.XRTable xrTableHeader;
private DevExpress.XtraReports.UI.XRTableRow xrRowHeader1;
private DevExpress.XtraReports.UI.XRTableCell cellHKlientSpan;
private DevExpress.XtraReports.UI.XRTableCell cellHKostentraegerSpan;
private DevExpress.XtraReports.UI.XRTableCell cellHWohnortSpan;
private DevExpress.XtraReports.UI.XRTableCell cellHDieserMonat;
private DevExpress.XtraReports.UI.XRTableCell cellHNaechsterMonat;
private DevExpress.XtraReports.UI.XRTableCell cellHEnddatumSpan;
private DevExpress.XtraReports.UI.XRTableRow xrRowHeader2;
private DevExpress.XtraReports.UI.XRTableCell cellHKlient;
private DevExpress.XtraReports.UI.XRTableCell cellHKostentraeger;
private DevExpress.XtraReports.UI.XRTableCell cellHWohnort;
private DevExpress.XtraReports.UI.XRTableCell cellHBewilligt;
private DevExpress.XtraReports.UI.XRTableCell cellHGeleistet;
private DevExpress.XtraReports.UI.XRTableCell cellHAuslastung;
private DevExpress.XtraReports.UI.XRTableCell cellHBewilligtNext;
private DevExpress.XtraReports.UI.XRTableCell cellHGeleistetNext;
private DevExpress.XtraReports.UI.XRTableCell cellHAuslastungNext;
private DevExpress.XtraReports.UI.XRTableCell cellHEnddatum;
private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo;
private DevExpress.XtraReports.UI.XRLabel xrLabelFooter;
}
}

View File

@@ -0,0 +1,18 @@
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace FeidPartnerReports
{
public partial class PersonalplanungReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<FeidPartnerReports.PersonalplanungRO>
{
public PersonalplanungReport()
{
InitializeComponent();
}
public void SetReportDataSource(FeidPartnerReports.PersonalplanungRO pRO)
{
this.bindingSource1.DataSource = pRO.Rows;
}
}
}

View File

@@ -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>