2016-06-27 01:45:38 +02:00
|
|
|
using BeWo.Report;
|
|
|
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
|
|
|
|
|
|
using DevExpress.XtraReports.UI;
|
2023-10-09 11:36:24 +02:00
|
|
|
using System;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
namespace VSDHammReports
|
|
|
|
|
{
|
|
|
|
|
public partial class ServiceInvoiceReport : XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
|
|
|
{
|
|
|
|
|
public ServiceInvoiceReport()
|
|
|
|
|
{
|
|
|
|
|
this.InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
|
|
|
{
|
2023-10-09 11:36:24 +02:00
|
|
|
decimal summeFachleistungen = 0;
|
|
|
|
|
decimal summeFehlkontakte = 0;
|
|
|
|
|
|
|
|
|
|
foreach (var ip in pRO.ServiceInvoicePeriods)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in ip.ServiceInvoiceItems)
|
|
|
|
|
{
|
|
|
|
|
decimal faktor = 1;
|
|
|
|
|
if (item.RateFactor.Contains("%"))
|
|
|
|
|
{
|
|
|
|
|
var splitFactor = item.RateFactor.Split('%');
|
|
|
|
|
faktor = 1 + (Convert.ToDecimal(splitFactor[0]) / 100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.ServiceDescription.ToLower().Contains("fehlkontakt"))
|
2026-07-21 09:28:04 +02:00
|
|
|
summeFehlkontakte += item.UnitCount.Value * item.AmountPerUnit.Value;
|
2023-10-09 11:36:24 +02:00
|
|
|
else
|
2026-07-21 09:28:04 +02:00
|
|
|
summeFachleistungen += item.UnitCount.Value * item.AmountPerUnit.Value;
|
2023-10-09 11:36:24 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tcSummeFachleistungen.Text = string.Format("{0:c}", summeFachleistungen);
|
|
|
|
|
tcSummeFehlkontakte.Text = string.Format("{0:c}", summeFehlkontakte);
|
|
|
|
|
|
|
|
|
|
if (summeFehlkontakte == 0)
|
|
|
|
|
{
|
|
|
|
|
tcLabelSummeFehlkontakte.Visible = false;
|
|
|
|
|
tcSummeFehlkontakte.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-27 01:45:38 +02:00
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|