65 lines
2.0 KiB
C#
65 lines
2.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.Text;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using System.Collections.Generic;
|
|
using BeWo.Service.DCEntityMapper;
|
|
using BS.Shared;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace BeWo.CaritasLeverkusen
|
|
{
|
|
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
{
|
|
public Stundenzettel()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
{
|
|
SetRateFactorText(pRO);
|
|
if (pRO.Services != null)
|
|
{
|
|
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
|
|
|
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
|
|
{
|
|
if (s.IsBillable)
|
|
servicesBillable.Add(s);
|
|
}
|
|
|
|
pRO.Services = servicesBillable;
|
|
}
|
|
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private void SetRateFactorText(ServicesOverviewRO pRo)
|
|
{
|
|
double factor = 1.2;
|
|
|
|
if (pRo.CostBearer2SupportConceptList != null && pRo.CostBearer2SupportConceptList.Count > 0)
|
|
{
|
|
var c2s = pRo.CostBearer2SupportConceptList[0];
|
|
|
|
var crps = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(c2s.CostBearer.CostRatePeriods);
|
|
|
|
var cp = crps.GetCostRatePeriodForDate(CostRatePeriodType.RateFactor, pRo.StartDate);
|
|
if (cp != null && cp.CostRateValue.HasValue)
|
|
{
|
|
factor = (100 + (double)cp.CostRateValue.Value)/100;
|
|
}
|
|
}
|
|
|
|
lblTextFactor.Text = String.Format("2.Summer der mit dem LVR\r\nabzurechnenden Leistungen\r\n(= Summe 1 x {0:0.0})", factor);
|
|
|
|
|
|
lblSummeFactor.Text = String.Format("{0:0.##}", pRo.TotalFLMBillable * factor);
|
|
}
|
|
}
|
|
}
|