AidshilfeDortmund/CustomReportCreator.cs u CustomSettlementInvoiceCreation - Vorbereitung für SchneideBeiErreichenDesBudgetsAb, warte auf go
This commit is contained in:
@@ -6,6 +6,8 @@ using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraReports.Design;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
@@ -17,5 +19,70 @@ namespace BeWo.AidshilfeDortmund
|
||||
{
|
||||
return base.CreateSettlementReport(dcId, invoiceBaseOid, true);
|
||||
}
|
||||
|
||||
// 09.04.2025: Vorbereitet - warte auf ihr ok
|
||||
//public override XtraReport CreateSettlementReport(string dcId, long? invoiceBaseOid)
|
||||
//{
|
||||
// long oid = 0;
|
||||
// long? ibOid = null;
|
||||
// if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
|
||||
// {
|
||||
// ibOid = invoiceBaseOid.Value;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Int64.TryParse(dcId, out oid);
|
||||
// var si = DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(oid);
|
||||
// ibOid = si.InvoiceBase.Oid;
|
||||
// }
|
||||
|
||||
// if (ibOid.HasValue && ibOid.Value > 0)
|
||||
// {
|
||||
// var ib = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(ibOid.Value);
|
||||
// if (ib.CostBearer2SupportConcept.CostBearer.Organisation.Name == "LWL" || ib.CostBearer2SupportConcept.CostBearer.Organisation.Name == "Landschaftsverband Westfalen-Lippe")
|
||||
// return CreateSettlementReportLwl(ibOid.Value, true);
|
||||
// }
|
||||
|
||||
// return base.CreateSettlementReport(dcId, invoiceBaseOid, false);
|
||||
//}
|
||||
|
||||
//private XtraReport CreateSettlementReportLwl(long invoiceBaseOid, bool createAnhang)
|
||||
//{
|
||||
// XtraReport report = null;
|
||||
|
||||
// Settlement2DC lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.SearchDAO.GetSettlementInvoiceByInvoiceBaseOid(invoiceBaseOid));
|
||||
|
||||
// var anhangRo = new BudgetnachweisAnhangRO();
|
||||
// anhangRo.Create(lSettlementDC);
|
||||
// var geleisteteFls = anhangRo.SummeGesamtStunden;
|
||||
|
||||
// if (lSettlementDC.DifferentHourlyRateCount > 0)
|
||||
// {
|
||||
// IBeWoReport<SettlementRO> lSettlementReport = new VSDHammReports.Alt.Budgetnachweis();
|
||||
// var ro = SettlementRO.Create(lSettlementDC);
|
||||
// ro.RecordedFLSTotal = (double)geleisteteFls;
|
||||
// lSettlementReport.SetReportDataSource(ro);
|
||||
|
||||
// report = lSettlementReport as XtraReport;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// IBeWoReport<Settlement2RO> lSettlementReport = new VSDHammReports.Budgetnachweis2();
|
||||
// var ro = Settlement2RO.Create(lSettlementDC);
|
||||
// ro.RecordedFlsTotal = geleisteteFls;
|
||||
// lSettlementReport.SetReportDataSource(ro);
|
||||
// report = lSettlementReport as XtraReport;
|
||||
|
||||
|
||||
// }
|
||||
// report.CreateDocument();
|
||||
|
||||
// var anhangReport = new BudgetnachweisAnhang();
|
||||
// anhangReport.SetReportDataSource(anhangRo);
|
||||
// anhangReport.CreateDocument();
|
||||
// report.Pages.AddRange(anhangReport.Pages);
|
||||
|
||||
// return report;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,113 +11,6 @@ namespace BeWo.AidshilfeDortmund
|
||||
|
||||
internal class CustomSettlementInvoiceCreation : LWLSettlementInvoiceCreation
|
||||
{
|
||||
|
||||
|
||||
//public override List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList, bool schneideBeiMaxAb)
|
||||
//{
|
||||
// var items = base.CreateInvoiceItems(si, apList, true);
|
||||
|
||||
|
||||
// decimal hours = 0;
|
||||
// foreach (var ap in apList)
|
||||
// {
|
||||
// hours += ap.RecordedMinutes;
|
||||
// }
|
||||
// if (si.RateFactor.HasValue)
|
||||
// {
|
||||
// hours *= (100 + si.RateFactor.Value) / 100;
|
||||
// }
|
||||
// hours /= 60;
|
||||
|
||||
// si.RecordedBillableFLSNetto = hours;
|
||||
// si.RecordedBillableFLSBrutto = si.RecordedBillableFLSNetto;
|
||||
|
||||
|
||||
// return items;
|
||||
//}
|
||||
//public override List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList, bool schneideBeiMaxAb)
|
||||
//{
|
||||
// List<InvoiceItemDC> iiList = new List<InvoiceItemDC>();
|
||||
|
||||
|
||||
|
||||
// var apsByHourlyRate = new Dictionary<String, IList<ApprovalPeriod>>();
|
||||
|
||||
// foreach (var ap in apList)
|
||||
// {
|
||||
// IList<ApprovalPeriod> list = null;
|
||||
// String key = String.Format("{0}_{1}", ap.AmountPerUnit, ap.RateFactor);
|
||||
|
||||
// if (apsByHourlyRate.ContainsKey(key))
|
||||
// {
|
||||
// list = apsByHourlyRate[key];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// list = new List<ApprovalPeriod>();
|
||||
// apsByHourlyRate[key] = list;
|
||||
// }
|
||||
|
||||
// list.Add(ap);
|
||||
// }
|
||||
|
||||
|
||||
// decimal maxApprovedFls = si.ApprovedFLS ?? 0;
|
||||
// decimal totalHours = 0;
|
||||
// foreach (var key in apsByHourlyRate.Keys)
|
||||
// {
|
||||
// IList<ApprovalPeriod> list = apsByHourlyRate[key];
|
||||
// var ii = new InvoiceItemDC();
|
||||
|
||||
// decimal minutesTotal = 0;
|
||||
// DateTime start = DateTime.MaxValue;
|
||||
// DateTime end = DateTime.MinValue;
|
||||
|
||||
// decimal rf = si.RateFactor ?? 0;
|
||||
// decimal hr = 0;
|
||||
|
||||
// foreach (var approvalPeriod in list)
|
||||
// {
|
||||
// minutesTotal += approvalPeriod.RecordedMinutes;
|
||||
// if (approvalPeriod.PeriodStartDate < start)
|
||||
// start = approvalPeriod.PeriodStartDate;
|
||||
// if (approvalPeriod.PeriodEndDate > end)
|
||||
// end = approvalPeriod.PeriodEndDate;
|
||||
|
||||
// hr = approvalPeriod.AmountPerUnit;
|
||||
// if (approvalPeriod.RateFactor.HasValue)
|
||||
// {
|
||||
// rf = approvalPeriod.RateFactor.Value;
|
||||
// }
|
||||
// }
|
||||
// ii.ItemPeriodStart = start;
|
||||
// ii.ItemPeriodEnd = end;
|
||||
// ii.RateFactor = rf;
|
||||
// ii.AmountPerUnit = hr;
|
||||
// decimal hours = Math.Round(minutesTotal / 60m, 2, MidpointRounding.AwayFromZero);
|
||||
// hours *= (100 + rf) / 100;
|
||||
// hours = Math.Round(hours, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
// if (schneideBeiMaxAb)
|
||||
// {
|
||||
// if (totalHours + hours > maxApprovedFls)
|
||||
// {
|
||||
// hours = maxApprovedFls - totalHours;
|
||||
// if (hours < 0)
|
||||
// hours = 0;
|
||||
// }
|
||||
// }
|
||||
// totalHours += hours;
|
||||
|
||||
// ii.UnitCount = hours;
|
||||
// ii.AmountTotal = Math.Round(hr * hours, 2, MidpointRounding.AwayFromZero);
|
||||
// ii.GrossAmountTotal = ii.AmountTotal;
|
||||
|
||||
// iiList.Add(ii);
|
||||
// }
|
||||
// si.RecordedBillableFLSNetto = totalHours;
|
||||
// si.RecordedBillableFLSBrutto = totalHours;
|
||||
// return iiList.OrderBy(ii => ii.ItemPeriodStart).ToList();
|
||||
//}
|
||||
//public override bool SchneideBeiErreichenDesBudgetsAb { get { return true; } }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user