64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
using System;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Service.DCEntityMapper;
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace RatPlusTat
|
|
{
|
|
[IDSpecificClass(Identifier = "Assistenz")]
|
|
public partial class RechnungAssistenz : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
{
|
|
public RechnungAssistenz()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
{
|
|
DateTime start = pRO.AccountingPeriodStart;
|
|
DateTime end = pRO.AccountingPeriodEnd;
|
|
decimal hourlyRate = 0;
|
|
decimal hours = 0;
|
|
|
|
if (pRO.ServiceInvoicePeriods != null && pRO.ServiceInvoicePeriods.Count > 0)
|
|
{
|
|
foreach (var p in pRO.ServiceInvoicePeriods)
|
|
{
|
|
if (p.ServiceInvoiceItems != null && p.ServiceInvoiceItems.Count > 0)
|
|
{
|
|
|
|
foreach (var i in p.ServiceInvoiceItems)
|
|
{
|
|
if (i.HourlyRate.HasValue)
|
|
hourlyRate = i.HourlyRate.Value;
|
|
|
|
if (i.Hours.HasValue)
|
|
hours += i.Hours.Value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (pRO.InvoiceBase != null && pRO.InvoiceBase.SupportConceptOid.HasValue)
|
|
{
|
|
var sc = DAOFactory.GenericDAO.LoadByID<SupportConcept>(pRO.InvoiceBase.SupportConceptOid.Value);
|
|
var bewStart = sc.StartDate;
|
|
var BewEnd = sc.EndDate;
|
|
lblBewilligungszeitraum.Text = String.Format("Bewilligungszeitraum - {0:dd.MM.yyyy} bis {1:dd.MM.yyyy}", bewStart, BewEnd);
|
|
}
|
|
|
|
DateTime zahlziel;
|
|
if (pRO.InvoiceDateTime != null)
|
|
{
|
|
zahlziel = (pRO.InvoiceDateTime ?? DateTime.Now).AddDays(14);
|
|
lblZahlziel.Text = String.Format("{0:dd.MM.yyyy}", zahlziel);
|
|
}
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
} |