Files
BeWoPlaner/Report/ReportObjects/ServiceInvoiceRO.cs

450 lines
16 KiB
C#
Raw Permalink Normal View History

2016-06-27 01:45:38 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using BeWo.Data.Entities;
using BeWo.Data.Access;
using BS.Shared.DataContracts.Compact;
2025-11-03 14:31:39 +01:00
using System.Diagnostics;
2026-03-31 16:05:16 +02:00
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Configuration;
2016-06-27 01:45:38 +02:00
namespace BeWo.Report.ReportObjects
{
2024-11-22 16:30:43 +01:00
public class ServiceInvoiceRO : AbstractBeWoReportObject<ServiceInvoiceRO>
{
public string AccountingPeriod { get; set; }
public DateTime AccountingPeriodStart { get; set; }
public DateTime AccountingPeriodEnd { get; set; }
public string AmountAdvancedPayments { get; set; }
public string AmountEquityContribution { get; set; }
public string ApprovedAmountSum { get; set; }
public string ApprovedBESum { get; set; }
public string CreatorName { get; set; }
2016-06-27 01:45:38 +02:00
public string CreatorDivision { get; set; }
public long? CustomerOid { get; set; }
public string CustomerFirstName { get; set; }
public string CustomerLastName { get; set; }
2024-11-22 16:30:43 +01:00
public string CustomerName { get; set; }
public string CustomerReferenceNumber { get; set; }
public string CustomerSalutation { get; set; }
2016-06-27 01:45:38 +02:00
public string CustomerStreet { get; set; }
public string CustomerPostalCode { get; set; }
public string CustomerTown { get; set; }
public DateTime? CustomerBirthdate { get; set; }
public string CustomerInsuranceNumber { get; set; }
2016-06-27 01:45:38 +02:00
public string CustomerCostCenter { get; set; }
- Es gibt jetzt unter View/Controls/ComboBoxes eine ComboBoxEmployeeSearch, kann recht einfach wiederverwendet werden für. Beispiel findet sich in SoziotherapieSettingView. - UserPermission Binding führen im VS Designer nichtmehr zu Exceptions. Standard: Im Designer hat man für alles Rechte. - Mandator hat Webseite + Logo + Bankverbindung in der Maske - Beispiel für Verwendung von Logo: Report GkvBegleitzettel - Position muss ggf noch angepasst werden - Neue Logik für Ausliefern von Servern: - Ich habe ein Post-Build-Script hinzugefügt, welches nach erfolgreichem Build von Release ein Host/binRelease erzeugt und dort alle DLLs hinkopiert - Verhindert ausliefern von Debug Version! - StringExtionsions ToNullIfEmpty - und sonst nur paar Kleinigkeiten Merge branch 'feature_rene_13_dakota' of ssh://float.ownsoft.de/git/beyondSoft/BeWo * 'feature_rene_13_dakota' of ssh://float.ownsoft.de/git/beyondSoft/BeWo: (56 commits) Dakota Update 1.1 Scripte zusammengefasst Text Anpassung Formular Button fehlt bei IsEnabled=false Getrennte log files DakotaSender, checkt Status nur bei gefunden Items -> Vorbereitung auf permanentes Senden Bericht Format mit Logo, final Altes laden für Frau Schulten in AdministrationView Druckinformation ShowInfoMessage zentral in BeWoApp Format + Logo wird ohne Hintergrund angezeigt TEST - AdministrationView DoSaveCheck Update: Cache jetzt auch asynchrones Speichern ServiceFacade Erweiterung: IsWaiting und WaitUntilAsyncIsFinished SoziotherapieSetting Top Margin Reihenfolge Logo auf Report - Erster Entwurf Bug: Potentieller Speicherverlust + Speichert jetzt letztes Einstellungsfenster Logo bei Mandator - Todo: Transparent wird zu schwarz beim Speichern MandatorView und SoziotherapieSettingsView teilen sich MandatorVM Kein individueller Report -> wird standard mit neuem Logo in der Verwaltung Format + komische Abfolge von PreviewMouseWheel - Parent Control wird Child bevorzugt? Kein Standard Verhalten, wird über eigenen Subreiter bei Administration umgangen ... # Conflicts: # Report/ReportObjects/ServiceInvoiceRO.cs
2024-12-03 10:19:16 +01:00
public string DebitorNumber { get; set; }
2024-11-22 16:30:43 +01:00
public string GrossClaim { get; set; }
public string InvoiceDate { get; set; }
2016-06-27 01:45:38 +02:00
public string InvoiceId { get; set; }
public DateTime? InvoiceDateTime { get; set; }
2024-11-22 16:30:43 +01:00
public string InvoiceNumber { get; set; }
public string NetClaim { get; set; }
public string NotBillableNote { get; set; }
public string Notice { get; set; }
public string RecipientContactPerson { get; set; }
public string RecipientDivision { get; set; }
public string RecipientOrganisation { get; set; }
public string RecipientPostCodeAndTown { get; set; }
public string RecipientAddressLine1 { get; set; }
public string RecipientStreet { get; set; }
2016-06-27 01:45:38 +02:00
public string RecipientPoBox { get; set; }
2024-11-22 16:30:43 +01:00
public string SenderContactPerson { get; set; }
public string SenderContactPersonDivision { get; set; }
public string SenderContactPersonFax { get; set; }
public string SenderContactPersonMail { get; set; }
public string SenderContactPersonPhone { get; set; }
public List<ServiceInvoicePeriodRO> ServiceInvoicePeriods { get; set; }
public string ServiceUnitName { get; set; }
2016-06-27 01:45:38 +02:00
public string OrganisationDebitorNumber { get; set; }
public string OrganisationCostCenter { get; set; }
2024-11-22 16:30:43 +01:00
public string BusinessPartnerId { get; set; }
public string ApprovalDate { get; set; }
public InvoiceBaseDC InvoiceBase { get; set; }
public List<ServiceRecordDC> BillableServiceRecords { get; set; }
2026-03-31 16:05:16 +02:00
public MandatorDC Mandator { get; set; }
2024-11-22 16:30:43 +01:00
public static ServiceInvoiceRO Create(ServiceInvoiceDC pDC)
{
var lResult = new ServiceInvoiceRO
{
InvoiceBase = pDC.InvoiceBase,
InvoiceId = pDC.InvoiceBase.InvoiceId,
InvoiceDate = String.Format("{0:dd.MM.yyyy}", pDC.InvoiceBase.InvoiceDate),
InvoiceDateTime = pDC.InvoiceBase.InvoiceDate,
InvoiceNumber = pDC.InvoiceBase.InvoiceNumber,
RecipientContactPerson = pDC.InvoiceBase.RecipientPersonFirstName.ToStringNullCheck()
+ " " +
pDC.InvoiceBase.RecipientPersonLastName.ToStringNullCheck(),
RecipientDivision = pDC.InvoiceBase.RecipientDivision,
RecipientOrganisation = pDC.InvoiceBase.RecipientOrganisation,
RecipientPostCodeAndTown = pDC.InvoiceBase.RecipientPostCode + " " + pDC.InvoiceBase.RecipientTown,
RecipientStreet = pDC.InvoiceBase.RecipientStreet,
SenderContactPerson =
pDC.InvoiceBase.SenderFirstName.ToStringNullCheck() + " " +
pDC.InvoiceBase.SenderLastName.ToStringNullCheck(),
SenderContactPersonDivision = pDC.InvoiceBase.SenderDivision,
};
if (pDC.InvoiceBase.RecipientAddressOid.HasValue)
{
var address = DAOFactory.GenericDAO.LoadByID<Address>(pDC.InvoiceBase.RecipientAddressOid.Value);
lResult.RecipientAddressLine1 = address.AddressLine1;
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
if (String.IsNullOrWhiteSpace(lResult.RecipientContactPerson))
{
lResult.RecipientContactPerson = string.Empty;
}
foreach (var iContactDC in pDC.InvoiceBase.SenderContactInformations)
{
if (iContactDC.ContactType == ContactType.business_Fax)
{
lResult.SenderContactPersonFax = "Fax: " + iContactDC.ContactValue;
}
else if (iContactDC.ContactType == ContactType.business_Phone)
{
lResult.SenderContactPersonPhone = "Tel.: " + iContactDC.ContactValue;
}
else if (iContactDC.ContactType == ContactType.business_Mail)
{
lResult.SenderContactPersonMail = "E-Mail: " + iContactDC.ContactValue;
}
}
2016-06-27 01:45:38 +02:00
2026-03-31 16:05:16 +02:00
lResult.Mandator = MapperFactory.MandatorDC_Mandator.MapToNewDC(AppSettings.GetMandatorEntity());
2016-06-27 01:45:38 +02:00
foreach (var iContactDC in pDC.InvoiceBase.RecipientContactInformations.Where(iContactDC => iContactDC.ContactType == ContactType.private_POBox))
{
lResult.RecipientPoBox = "Postfach " + iContactDC.ContactValue;
}
2024-12-12 12:14:16 +01:00
foreach (var iContactDC in pDC.InvoiceBase.RecipientContactInformations.Where(iContactDC => iContactDC.ContactType == ContactType.business_POBox))
{
lResult.RecipientPoBox = "Postfach " + iContactDC.ContactValue;
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.CustomerOid = pDC.InvoiceBase.RecipientCustomerOid;
lResult.CustomerReferenceNumber = pDC.InvoiceBase.CustomerReferenceNumber;
lResult.CustomerName = pDC.InvoiceBase.CustomerFirstName + " " + pDC.InvoiceBase.CustomerLastName;
lResult.CustomerFirstName = pDC.InvoiceBase.CustomerFirstName;
2016-06-27 01:45:38 +02:00
lResult.CustomerLastName = pDC.InvoiceBase.CustomerLastName;
2024-11-22 16:30:43 +01:00
long? customerOid = pDC.InvoiceBase.RecipientCustomerOid;
SupportConcept sc = null;
2016-06-27 01:45:38 +02:00
if (pDC.InvoiceBase.SupportConceptOid.HasValue)
{
sc = DAOFactory.GenericDAO.GetByID<SupportConcept>(pDC.InvoiceBase.SupportConceptOid.Value);
}
2024-11-22 16:30:43 +01:00
if (!customerOid.HasValue)
{
if (sc != null)
{
2016-06-27 01:45:38 +02:00
customerOid = sc.Customer.Oid;
2024-11-22 16:30:43 +01:00
}
}
2016-06-27 01:45:38 +02:00
if (customerOid.HasValue)
{
var customer = DAOFactory.GenericDAO.GetByID<Customer>(customerOid.Value);
lResult.DebitorNumber = customer.DebitorNumber;
lResult.CustomerCostCenter = customer.CostCenter;
lResult.CustomerBirthdate = customer.Person.DateOfBirth;
lResult.CustomerInsuranceNumber = customer.InsuranceNumber;
2016-06-27 01:45:38 +02:00
if (customer.Person.Address != null)
{
lResult.CustomerStreet = customer.Person.Address.Street;
lResult.CustomerPostalCode = customer.Person.Address.PostalCode;
lResult.CustomerTown = customer.Person.Address.Town;
}
}
2024-11-22 16:30:43 +01:00
if (pDC.InvoiceBase.SupportConceptCostBearerRelDc != null)
{
if (pDC.InvoiceBase.SupportConceptCostBearerRelDc.SupportConcept.Customer.Sex == Sex.Male)
lResult.CustomerSalutation = "Herr";
else if (pDC.InvoiceBase.SupportConceptCostBearerRelDc.SupportConcept.Customer.Sex == Sex.Female)
lResult.CustomerSalutation = "Frau";
else
lResult.CustomerSalutation = "";
2016-06-27 01:45:38 +02:00
var org = pDC.InvoiceBase.SupportConceptCostBearerRelDc.CostBearer;
lResult.OrganisationDebitorNumber = org.DebitorNumber;
lResult.OrganisationCostCenter = org.CostCenter;
lResult.BusinessPartnerId = org.BusinessPartnerId;
2016-06-27 01:45:38 +02:00
}
2022-02-10 12:17:08 +01:00
else
{
lResult.OrganisationDebitorNumber = "";
lResult.OrganisationCostCenter = "";
}
if (lResult.BusinessPartnerId == null)
{
long? organisationOid = pDC.InvoiceBase.RecipientOrganisationOid;
if (organisationOid.HasValue)
{
var organisation = DAOFactory.GenericDAO.GetByID<Organisation>(organisationOid.Value);
if (organisation != null)
{
lResult.BusinessPartnerId = organisation.BusinessPartnerId;
}
}
}
2016-06-27 01:45:38 +02:00
lResult.AccountingPeriod = String.Format("{0:dd.MM.yyyy}-{1:dd.MM.yyyy}", pDC.InvoiceBase.AccountingPeriodStart, pDC.InvoiceBase.AccountingPeriodEnd);
2024-11-22 16:30:43 +01:00
lResult.AccountingPeriodStart = pDC.InvoiceBase.AccountingPeriodStart.Value;
lResult.AccountingPeriodEnd = pDC.InvoiceBase.AccountingPeriodEnd.Value;
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
if (pDC.ServiceUnit != null)
{
lResult.ServiceUnitName = pDC.ServiceUnit.UnitName;
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.ApprovedBESum = pDC.ServiceInvoicePeriods.Sum(i => i.ApprovedBE).Value.ToString("0.00");
lResult.ApprovedAmountSum = pDC.ServiceInvoicePeriods.Sum(i => i.ApprovedAmountDefaultHourlyRate ?? i.ApprovedFixedAmount).Value.ToString("c");
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.AmountAdvancedPayments = pDC.AmountAdvancePayments.HasValue ? pDC.AmountAdvancePayments.Value.ToString("c") : "-";
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.AmountEquityContribution = pDC.AmountEquityContribution.HasValue ? pDC.AmountEquityContribution.Value.ToString("c") : "-";
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.GrossClaim = (pDC.ClaimSum ?? 0m).ToString("c");
lResult.NetClaim = (pDC.EndClaim ?? 0m).ToString("c");
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.CreatorName = pDC.InvoiceBase.CreatorFirstName.ToStringNullCheck() + " "
+ pDC.InvoiceBase.CreatorLastName.ToStringNullCheck();
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.CreatorDivision = pDC.InvoiceBase.SenderDivision;
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
if (sc != null && sc.ApprovalDate.HasValue)
{
lResult.ApprovalDate = sc.ApprovalDate.Value.ToString("dd.MM.yyyy");
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.Notice = pDC.InvoiceBase.Notice;
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
var hoursNotBillableAbsence = pDC.ServiceInvoicePeriods.Sum(i => i.HoursNotBillableAbsence);
var hoursNotBillableNotApproved = pDC.ServiceInvoicePeriods.Sum(i => i.HoursNotBillableNotApproved);
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
if (hoursNotBillableAbsence == 0 && hoursNotBillableNotApproved == 0)
{
lResult.NotBillableNote = string.Empty;
}
else
{
var s = "Nicht abrechenbare geleistete Stunden im Zeitraum: ";
if (hoursNotBillableAbsence > 0)
{
s += string.Format("{0:0.00} (Klient abwesend) ", hoursNotBillableAbsence);
if (hoursNotBillableNotApproved > 0)
{
s += " + ";
}
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
if (hoursNotBillableNotApproved > 0)
{
s += string.Format("{0:0.00} (nicht bewilligt) ", hoursNotBillableNotApproved);
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
lResult.NotBillableNote = s;
}
2018-05-21 16:39:24 +02:00
2024-11-22 16:30:43 +01:00
lResult.ServiceInvoicePeriods = pDC.ServiceInvoicePeriods.Select(i => ServiceInvoicePeriodRO.Create(pDC, i)).ToList();
return lResult;
}
public void CreateBillableServiceRecords()
{
this.BillableServiceRecords = new List<ServiceRecordDC>();
if (ServiceInvoicePeriods != null)
{
foreach (var sip in ServiceInvoicePeriods)
{
if (sip.ServiceInvoiceItems != null)
{
foreach (var ii in sip.ServiceInvoiceItems)
{
if (ii.ServiceRecord != null)
{
BillableServiceRecords.Add(ii.ServiceRecord);
}
}
}
}
}
BillableServiceRecords.Sort((a, b) => a.Start.Value.CompareTo(b.Start.Value));
}
2016-06-27 01:45:38 +02:00
}
2024-11-22 16:30:43 +01:00
public class ServiceInvoicePeriodRO
{
public string ApprovalPeriod { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string ApprovedAmount { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string ApprovedBE { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public decimal? ApprovedHours { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string Claim { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string NotBillableString { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string Notice { get; set; }
2021-05-05 10:58:36 +02:00
2024-11-22 16:30:43 +01:00
public CompactCustomerDC Customer { get; set; }
2016-06-27 01:45:38 +02:00
public CostBearer2SupportConcept CostBearer2SupportConcept { get; set; }
public SupportConceptApprovalPeriod SupportConceptApprovalPeriod { get; set; }
2024-11-22 16:30:43 +01:00
public List<ServiceInvoiceItemRO> ServiceInvoiceItems { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public static ServiceInvoicePeriodRO Create(ServiceInvoiceDC invoice, ServiceInvoicePeriodDC pDC)
{
var result = new ServiceInvoicePeriodRO
{
ApprovalPeriod = new DateTimeSpan
{
StartDateTime = pDC.Start.Value,
EndDateTime = pDC.End.Value
}.ToDateString()
};
decimal amount = pDC.ApprovedAmountDefaultHourlyRate ?? (pDC.ApprovedFixedAmount ?? 0);
result.ApprovedAmount = amount.ToString("c");
result.ApprovedBE = string.Empty;
if (pDC.ApprovedBE.HasValue)
{
2016-06-27 01:45:38 +02:00
if (invoice.ServiceUnit != null)
result.ApprovedBE = pDC.ApprovedBE.Value.ToString("(0.00 " + invoice.ServiceUnit.UnitName + ")");
else
result.ApprovedBE = pDC.ApprovedBE.Value.ToString("(0.00)");
2024-11-22 16:30:43 +01:00
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
result.ApprovedHours = pDC.ApprovedHours;
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
result.Claim = (pDC.Claim ?? 0m).ToString("c");
result.NotBillableString = pDC.NotBillableString;
result.Notice = pDC.Notice;
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
result.ServiceInvoiceItems = pDC.InvoiceItems.Select(ServiceInvoiceItemRO.Create).ToList();
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
result.Customer = pDC.Customer;
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
if (pDC.SupportConceptApprovalPeriod != null)
{
var scap =
DAOFactory.GenericDAO.GetByID<SupportConceptApprovalPeriod>(
pDC.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value);
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
result.SupportConceptApprovalPeriod = scap;
2016-06-27 01:45:38 +02:00
result.CostBearer2SupportConcept = scap.CostBearer2SupportConcept;
2024-11-22 16:30:43 +01:00
}
return result;
}
2016-06-27 01:45:38 +02:00
}
2025-11-03 14:31:39 +01:00
[DebuggerDisplay("{Duration}: {ServiceDescription} {UnitCount}x{HourlyRate}={NetAmount}")]
2024-11-22 16:30:43 +01:00
public class ServiceInvoiceItemRO
{
public string Duration { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string GrossAmount { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public decimal? HourlyRate { get; set; }
2016-06-27 01:45:38 +02:00
public string HourlyRateString { get; set; }
public decimal? Hours { get; set; }
public decimal? NetAmount { get; set; }
2024-11-22 16:30:43 +01:00
public string RateFactor { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string ServiceDescription { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string CustomerFirstname { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public string CustomerLastname { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public DateTime? CustomerBirthdate { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public DateTime? AccountingPeriodStart { get; set; }
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
public DateTime? AccountingPeriodEnd { get; set; }
2016-06-27 01:45:38 +02:00
public string UnitDescription { get; set; }
2024-11-22 16:30:43 +01:00
public string Notice { get; set; }
2016-06-27 01:45:38 +02:00
public decimal? UnitCount { get; set; }
public string UnitCountString { get; set; }
public decimal? AmountPerUnit { get; set; }
public ServiceRecordDC ServiceRecord { get; set; }
2024-11-22 16:30:43 +01:00
public static ServiceInvoiceItemRO Create(InvoiceItemDC pDC)
{
var result = new ServiceInvoiceItemRO
{
Duration = String.Format("{0:dd.MM.yy} - {1:dd.MM.yy}",
pDC.ItemPeriodStart,
pDC.ItemPeriodEnd),
GrossAmount = pDC.GrossAmountTotal.HasValue ? pDC.GrossAmountTotal.Value.ToString("c") : string.Empty,
HourlyRate = pDC.AmountPerUnit,
HourlyRateString = pDC.AmountPerUnit.HasValue ? pDC.AmountPerUnit.Value.ToString("c") : string.Empty,
Hours = pDC.UnitCount,
NetAmount = pDC.AmountTotal,
RateFactor = pDC.RateFactor.HasValue ? pDC.RateFactor.Value.ToString("0.00") + " %" : string.Empty,
ServiceDescription = pDC.ItemDescription,
AccountingPeriodStart = pDC.ItemPeriodStart,
AccountingPeriodEnd = pDC.ItemPeriodEnd,
UnitCount = pDC.UnitCount,
UnitCountString = pDC.UnitCount.HasValue ? pDC.UnitCount.Value.ToString("#.##") : string.Empty,
AmountPerUnit = pDC.AmountPerUnit,
UnitDescription = pDC.UnitDescription,
2016-06-27 01:45:38 +02:00
Notice = pDC.Notice,
ServiceRecord = pDC.ServiceRecord
2024-11-22 16:30:43 +01:00
};
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
if (pDC.SupportConceptApprovalPeriodOid.HasValue)
{
var ap = DAOFactory.GenericDAO.LoadByID<SupportConceptApprovalPeriod>(pDC.SupportConceptApprovalPeriodOid.Value);
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
try
{
2016-06-27 01:45:38 +02:00
var c = ap.CostBearer2SupportConcept.SupportConcept.Customer;
if (c != null)
{
result.CustomerFirstname = c.Person.FirstName;
result.CustomerLastname = c.Person.LastName;
result.CustomerBirthdate = c.Person.DateOfBirth;
}
2024-11-22 16:30:43 +01:00
}
catch (Exception)
{
//ignore
}
}
2016-06-27 01:45:38 +02:00
2024-11-22 16:30:43 +01:00
return result;
}
2016-06-27 01:45:38 +02:00
}
}