74 lines
2.7 KiB
C#
74 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text.RegularExpressions;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.Core;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace PilarJugendhilfe
|
|
{
|
|
public partial class Quittierungsbeleg : XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
{
|
|
public Quittierungsbeleg()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
{
|
|
|
|
// Get calling method name
|
|
//StackTrace stackTrace = new StackTrace();
|
|
//Debug.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);
|
|
|
|
bool hatGruppen = false;
|
|
|
|
//if (pRO == null)
|
|
// return;
|
|
|
|
if (pRO.Services != null)
|
|
{
|
|
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
|
|
|
foreach (var sd in pRO.Services)
|
|
{
|
|
if (sd.IsBillable || sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt"))
|
|
{
|
|
ServicesOverviewRO.CreateSignatureString(sd);
|
|
sd.Notice5 = "E";
|
|
if (sd.IsGroup)
|
|
{
|
|
//sd.Notice5 = String.Format("{0} Teilnehmer", sd.CustomerCount);
|
|
sd.Notice5 = "GR";
|
|
hatGruppen = true;
|
|
}
|
|
if (sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt") || (sd.ProzentAbrechenbar < 100))
|
|
{
|
|
sd.Notice5 = "F";
|
|
}
|
|
servicesBillable.Add(sd);
|
|
}
|
|
}
|
|
|
|
pRO.Services = servicesBillable;
|
|
}
|
|
|
|
lblDatum.Text += string.Format(" {0:dd.MM.yyyy}", DateTime.Now);
|
|
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
|
|
{
|
|
if(pRO.CostBearer2SupportConceptList[0].CostBearerContactPerson == null)
|
|
{
|
|
var contact = pRO.CostBearer2SupportConceptList[0].CostBearer.Organisation.Organisation2PersonList.FirstOrDefault(p => p.Person.Function != null && p.Person.Function.Value == "ASD");
|
|
pRO.CostBearer2SupportConceptList[0].CostBearerContactPerson = contact.Person;
|
|
}
|
|
}
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|