58 lines
2.2 KiB
C#
58 lines
2.2 KiB
C#
using System;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace AutismusLeben
|
|
{
|
|
public partial class ServiceInvoiceReport : XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
{
|
|
public ServiceInvoiceReport()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
{
|
|
DateTime start = pRO.AccountingPeriodStart;
|
|
DateTime end = pRO.AccountingPeriodEnd;
|
|
//if (start.Month == end.Month && start.Year == end.Year)
|
|
//{
|
|
// lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Monat {0:MMMM yyyy} folgende erbrachte Tätigkeiten:", start);
|
|
//}
|
|
//else
|
|
//{
|
|
// lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end);
|
|
//}
|
|
foreach (var sip in pRO.ServiceInvoicePeriods)
|
|
{
|
|
if (sip.ServiceInvoiceItems != null)
|
|
{
|
|
foreach (var ii in sip.ServiceInvoiceItems)
|
|
{
|
|
if (!String.IsNullOrEmpty(ii.RateFactor))
|
|
{
|
|
var rfStr = ii.RateFactor.Replace("%", "").Replace(",00", "").Trim();
|
|
int rfInt = 0;
|
|
Int32.TryParse(rfStr, out rfInt);
|
|
|
|
decimal rateFactor = (100m + rfInt) / 100m;
|
|
|
|
ii.Hours = ii.Hours * rateFactor;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (pRO.InvoiceNumber.Length > 2)
|
|
pRO.InvoiceNumber = String.Format("3{0:MM}{0:yy}0{1}", end, pRO.InvoiceNumber);
|
|
else
|
|
pRO.InvoiceNumber = String.Format("3{0:MM}{0:yy}00{1}", end, pRO.InvoiceNumber);
|
|
|
|
lblSchlusssatz.Text = string.Format("Zahlbar bis {0:dd.MM.yyyy} ohne Abzug.\nUmsatzsteuerfrei gemäß §4 Nr. 18 UStG.", pRO.InvoiceDateTime.Value.AddDays(14));
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
} |