CaritasverbandDuerenJuelichEV/Mitarbeiterauslastung.cs - MinutesFreePerWeekStatisticDate - Ganze Anpassung raus, wird jetzt in schön im Standard gemacht
This commit is contained in:
@@ -26,86 +26,93 @@ namespace CaritasverbandDuerenJuelichEV
|
||||
{
|
||||
AuslastungBerechnung b = new AuslastungBerechnung();
|
||||
b.CreateReport(pRO);
|
||||
decimal flsSoll = 0;
|
||||
decimal flsPlusMinus = 0;
|
||||
decimal flsIst = 0;
|
||||
|
||||
AnalysisServiceImp analysisService = new AnalysisServiceImp();
|
||||
foreach (var ed in pRO.EmployeeDetailList)
|
||||
{
|
||||
if (ed.SupportConceptDetailList != null)
|
||||
{
|
||||
foreach (var sc in ed.SupportConceptDetailList)
|
||||
{
|
||||
if (sc.CostBearer2SupportConcept != null)
|
||||
{
|
||||
// Der Standard ist bei denen, dass die Bewilligung nicht übertragbar per Monat läuft - so etwas genauer, wegen Rundung in Bewilligung
|
||||
if (sc.SupportConceptApprovalPeriod != null && sc.SupportConceptApprovalPeriod.IsApprovedBEShifting == false
|
||||
&& sc.SupportConceptApprovalPeriod.ApprovedBEInterval == BS.Shared.SupportConceptApprovalInterval.Monthly
|
||||
&& sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue)
|
||||
{
|
||||
flsSoll = sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value;
|
||||
flsIst = CreateIst(sc, pRO.ReportStartDate, pRO.ReportEndDate) / 60;
|
||||
if (sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee != null &&
|
||||
sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Count > 1)
|
||||
{
|
||||
var scapAnteil = sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Where(e => e.Employee.Oid == ed.Employee.Oid).FirstOrDefault();
|
||||
if (scapAnteil.Employee.Oid == ed.Employee.Oid)
|
||||
{
|
||||
var anteil = scapAnteil.Betreuungsschluessel / 100;
|
||||
flsPlusMinus = Math.Round(flsSoll * anteil - flsIst * anteil, 2, MidpointRounding.AwayFromZero);
|
||||
sc.FreiProMonat = flsPlusMinus;
|
||||
sc.MinutesSoll = Math.Round(flsSoll * anteil, 2, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flsPlusMinus = flsSoll - flsIst;
|
||||
sc.FreiProMonat = flsPlusMinus;
|
||||
sc.MinutesSoll = flsSoll;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.MinutesSoll = sc.ApprovedHoursPerWeek *4.33m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
// Übernahme in Standard
|
||||
//decimal flsSoll = 0;
|
||||
//decimal flsPlusMinus = 0;
|
||||
//decimal flsIst = 0;
|
||||
|
||||
//AnalysisServiceImp analysisService = new AnalysisServiceImp();
|
||||
// foreach (var ed in pRO.EmployeeDetailList)
|
||||
// {
|
||||
// if (ed.SupportConceptDetailList != null)
|
||||
// {
|
||||
// foreach (var sc in ed.SupportConceptDetailList)
|
||||
// {
|
||||
// if (sc.CostBearer2SupportConcept != null)
|
||||
// {
|
||||
// if (sc.Customer.Person.FirstName == "Ilona ")
|
||||
// {
|
||||
// int test = 0;
|
||||
// }
|
||||
// flsIst = CreateIst(sc, pRO.ReportStartDate, pRO.ReportEndDate) / 60;
|
||||
|
||||
// // Der Standard ist bei denen, dass die Bewilligung nicht übertragbar per Monat läuft - so etwas genauer, wegen Rundung in Bewilligung
|
||||
// if (sc.SupportConceptApprovalPeriod != null && sc.SupportConceptApprovalPeriod.IsApprovedBEShifting == false
|
||||
// && sc.SupportConceptApprovalPeriod.ApprovedBEInterval == BS.Shared.SupportConceptApprovalInterval.Monthly
|
||||
// && sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue)
|
||||
// {
|
||||
// flsSoll = sc.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value;
|
||||
// if (sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee != null &&
|
||||
// sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Count > 1)
|
||||
// {
|
||||
// var scapAnteil = sc.SupportConceptApprovalPeriod.SupportConceptApprovalPeriod2Employee.Where(e => e.Employee.Oid == ed.Employee.Oid).FirstOrDefault();
|
||||
// if (scapAnteil.Employee.Oid == ed.Employee.Oid)
|
||||
// {
|
||||
// var anteil = scapAnteil.Betreuungsschluessel / 100;
|
||||
// flsPlusMinus = Math.Round(flsSoll * anteil - flsIst * anteil, 2, MidpointRounding.AwayFromZero);
|
||||
// sc.FreiProMonat = flsPlusMinus;
|
||||
// sc.MinutesSoll = Math.Round(flsSoll * anteil, 2, MidpointRounding.AwayFromZero);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// flsPlusMinus = flsSoll - flsIst;
|
||||
// sc.FreiProMonat = flsPlusMinus;
|
||||
// sc.MinutesSoll = flsSoll;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// sc.MinutesSoll = sc.ApprovedHoursPerWeek * 4.33m;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
private decimal CreateIst(MitarbeiterauslastungRO.SupportConceptDetail sd, DateTime reportStartDate, DateTime reportEndDate)
|
||||
{
|
||||
if (sd.CostBearer2SupportConcept == null || !sd.CostBearer2SupportConcept.Oid.HasValue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
decimal minutes = 0;
|
||||
IList<ServiceRecord> records = DAOFactory.SearchDAO.FindServiceRecordsDetailsForLastDays(sd.CostBearer2SupportConcept.Oid.Value, null);
|
||||
var srListMonth = records.Where(sr => sr.Start >= reportStartDate && sr.Start < reportEndDate).ToList();
|
||||
Dictionary<long, bool> groupOids = new Dictionary<long, bool>();
|
||||
Dictionary<long, bool> srOids = new Dictionary<long, bool>();
|
||||
foreach (ServiceRecord sr in srListMonth)
|
||||
{
|
||||
if (!srOids.ContainsKey(sr.Oid.Value))
|
||||
{
|
||||
srOids.Add(sr.Oid.Value, true);
|
||||
if (sr.Start.Value < reportEndDate)
|
||||
{
|
||||
if (!sr.GroupOid.HasValue || !groupOids.ContainsKey(sr.GroupOid.Value))
|
||||
{
|
||||
if (sr.GroupOid.HasValue)
|
||||
groupOids.Add(sr.GroupOid.Value, true);
|
||||
//private decimal CreateIst(MitarbeiterauslastungRO.SupportConceptDetail sd, DateTime reportStartDate, DateTime reportEndDate)
|
||||
//{
|
||||
// if (sd.CostBearer2SupportConcept == null || !sd.CostBearer2SupportConcept.Oid.HasValue)
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
// decimal minutes = 0;
|
||||
// IList<ServiceRecord> records = DAOFactory.SearchDAO.FindServiceRecordsDetailsForLastDays(sd.CostBearer2SupportConcept.Oid.Value, null);
|
||||
// var srListMonth = records.Where(sr => sr.Start >= reportStartDate && sr.Start < reportEndDate).ToList();
|
||||
// Dictionary<long, bool> groupOids = new Dictionary<long, bool>();
|
||||
// Dictionary<long, bool> srOids = new Dictionary<long, bool>();
|
||||
// foreach (ServiceRecord sr in srListMonth)
|
||||
// {
|
||||
// if (!srOids.ContainsKey(sr.Oid.Value))
|
||||
// {
|
||||
// srOids.Add(sr.Oid.Value, true);
|
||||
// if (sr.Start.Value < reportEndDate)
|
||||
// {
|
||||
// if (!sr.GroupOid.HasValue || !groupOids.ContainsKey(sr.GroupOid.Value))
|
||||
// {
|
||||
// if (sr.GroupOid.HasValue)
|
||||
// groupOids.Add(sr.GroupOid.Value, true);
|
||||
|
||||
if (sr.ServiceDescription.ServiceCategory.IsBillable)
|
||||
minutes += sr.RoundedDuration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (sr.ServiceDescription.ServiceCategory.IsBillable)
|
||||
// minutes += sr.RoundedDuration;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return minutes;
|
||||
}
|
||||
// return minutes;
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ namespace CaritasverbandDuerenJuelichEV
|
||||
// xrTableCell28
|
||||
//
|
||||
this.xrTableCell28.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
|
||||
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.MinutesSoll", "{0:0.00}")});
|
||||
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.ApprovedHoursPerMonth", "{0:0.00}")});
|
||||
this.xrTableCell28.Name = "xrTableCell28";
|
||||
this.xrTableCell28.Text = "xrTableCell28";
|
||||
this.xrTableCell28.Weight = 0.090171325518485085D;
|
||||
@@ -365,7 +365,7 @@ namespace CaritasverbandDuerenJuelichEV
|
||||
// cellSollGesamt
|
||||
//
|
||||
this.cellSollGesamt.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
|
||||
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.MinutesSoll")});
|
||||
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.SupportConceptDetailList.ApprovedHoursPerMonth")});
|
||||
this.cellSollGesamt.Name = "cellSollGesamt";
|
||||
xrSummary1.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
|
||||
this.cellSollGesamt.Summary = xrSummary1;
|
||||
|
||||
Reference in New Issue
Block a user