DomizielAnsbach diverse Anpassungen
This commit is contained in:
@@ -26,11 +26,11 @@ namespace DomizielAnsbach.Invoicing
|
||||
if (scap.StartDate <= invoicePeriod.StartDate)
|
||||
start = invoicePeriod.StartDate;
|
||||
else
|
||||
start = (DateTime)scap.StartDate;
|
||||
start = (DateTime)scap.StartDate; //Einzugstag wird mit abgerechnet
|
||||
if (scap.EndDate >= invoicePeriod.EndDate)
|
||||
ende = invoicePeriod.EndDate;
|
||||
else
|
||||
ende = (DateTime)scap.EndDate;
|
||||
ende = (DateTime)scap.EndDate.Value.AddDays(-1); //Auszugstag wird NICHT abgerechnet
|
||||
|
||||
var preise = DAOFactory.GenericDAO.GetAllActive<Preis>();
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace DomizielAnsbach.Invoicing
|
||||
|
||||
while (start <= ende)
|
||||
{
|
||||
|
||||
DateTime monatStart = new DateTime(start.Year, start.Month, 1);
|
||||
DateTime monatEnde = monatStart.AddMonths(1);
|
||||
|
||||
@@ -52,12 +51,13 @@ namespace DomizielAnsbach.Invoicing
|
||||
foreach (var at in customer.AbsenceTimes)
|
||||
{
|
||||
DateTime? startAbw = at.Start;
|
||||
DateTime? endMinusEinTag = at.End;
|
||||
if (at.Start.HasValue && at.End.HasValue && at.End.Value.Date.Subtract(at.Start.Value.Date).TotalDays > 0)
|
||||
{
|
||||
endMinusEinTag = at.End.Value.AddDays(-1);
|
||||
}
|
||||
if (startAbw.HasValue && startAbw.Value < monatEnde && (!endMinusEinTag.HasValue || endMinusEinTag.Value >= monatStart))
|
||||
DateTime? endAbw = at.End;
|
||||
//18.04.2023: Frau Sachsenhauser sagt, jeder Tag Abwesenheit muss mit Platzfreihaltepauschale bezahlt werden
|
||||
//if (at.Start.HasValue && at.End.HasValue && at.End.Value.Date.Subtract(at.Start.Value.Date).TotalDays > 0)
|
||||
//{
|
||||
// endAbw = at.End.Value.AddDays(-1);
|
||||
//}
|
||||
if (startAbw.HasValue && startAbw.Value < monatEnde && (!endAbw.HasValue || endAbw.Value >= monatStart))
|
||||
{
|
||||
DateTime abwStart = at.Start.Value;
|
||||
if (start > abwStart)
|
||||
@@ -66,9 +66,9 @@ namespace DomizielAnsbach.Invoicing
|
||||
}
|
||||
|
||||
DateTime abwEnd = monatEnde.AddDays(-1);
|
||||
if (endMinusEinTag.HasValue && endMinusEinTag < monatEnde)
|
||||
if (endAbw.HasValue && endAbw < monatEnde)
|
||||
{
|
||||
abwEnd = endMinusEinTag.Value;
|
||||
abwEnd = endAbw.Value;
|
||||
}
|
||||
|
||||
DateTime dt = abwStart;
|
||||
|
||||
@@ -26,11 +26,21 @@ namespace DomizielAnsbach
|
||||
decimal? sumCustomerMonth = 0;
|
||||
string prevMonth = null;
|
||||
var counter = 0;
|
||||
string grund = null;
|
||||
|
||||
if (pRO.ServiceInvoicePeriods != null)
|
||||
{
|
||||
foreach (var sip in pRO.ServiceInvoicePeriods)
|
||||
{
|
||||
if (sip.CostBearer2SupportConcept.SupportConcept.Customer.TerminationDate.HasValue
|
||||
&& sip.CostBearer2SupportConcept.SupportConcept.Customer.TerminationDate > pRO.AccountingPeriodStart
|
||||
&& sip.CostBearer2SupportConcept.SupportConcept.Customer.TerminationDate < pRO.AccountingPeriodEnd)
|
||||
{
|
||||
if (sip.CostBearer2SupportConcept.SupportConcept.Customer.TerminationReason != null)
|
||||
{
|
||||
grund = sip.CostBearer2SupportConcept.SupportConcept.Customer.TerminationReason.Value;
|
||||
}
|
||||
}
|
||||
counter += 1;
|
||||
if (sip.ServiceInvoiceItems != null)
|
||||
{
|
||||
@@ -54,15 +64,19 @@ namespace DomizielAnsbach
|
||||
}
|
||||
prevMonth = sii.Notice;
|
||||
sii.RateFactor = counter.ToString();
|
||||
if (grund != null)
|
||||
{
|
||||
sii.ServiceDescription += grund;
|
||||
grund = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lblQuartal.Text = GetQuarter(pRO.AccountingPeriodEnd).ToString() + ". Quartal " + pRO.AccountingPeriodEnd.Year.ToString();
|
||||
lblMonate.Text = pRO.AccountingPeriodStart.ToString("MMMM") + " - " + pRO.AccountingPeriodEnd.ToString("MMMM");
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
lblQuartal.Text = GetQuarter(pRO.AccountingPeriodEnd).ToString() + ". Quartal " + pRO.AccountingPeriodEnd.Year.ToString();
|
||||
lblMonate.Text = pRO.AccountingPeriodStart.ToString("MMMM") + " - " + pRO.AccountingPeriodEnd.ToString("MMMM");
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
20
ReportImp/DomizielAnsbach/RechnungPB.Designer.cs
generated
20
ReportImp/DomizielAnsbach/RechnungPB.Designer.cs
generated
@@ -65,7 +65,7 @@ namespace DomizielAnsbach
|
||||
this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.lblAnrede = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.lblAbrechnungszeitraum = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
@@ -260,7 +260,7 @@ namespace DomizielAnsbach
|
||||
this.xrLabel4,
|
||||
this.xrLabel3,
|
||||
this.xrLabel2,
|
||||
this.xrLabel5,
|
||||
this.lblAnrede,
|
||||
this.xrLabel8,
|
||||
this.lblAbrechnungszeitraum});
|
||||
this.Page1.Font = new System.Drawing.Font("Verdana", 10F);
|
||||
@@ -478,14 +478,14 @@ namespace DomizielAnsbach
|
||||
this.xrLabel2.Text = "Rechnung Nr. [InvoiceNumber]";
|
||||
this.xrLabel2.WordWrap = false;
|
||||
//
|
||||
// xrLabel5
|
||||
// lblAnrede
|
||||
//
|
||||
this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 312.5F);
|
||||
this.xrLabel5.Name = "xrLabel5";
|
||||
this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.xrLabel5.SizeF = new System.Drawing.SizeF(317F, 17F);
|
||||
this.xrLabel5.StylePriority.UseFont = false;
|
||||
this.xrLabel5.Text = "Sehr geehrte Damen und Herren,";
|
||||
this.lblAnrede.LocationFloat = new DevExpress.Utils.PointFloat(0F, 312.5F);
|
||||
this.lblAnrede.Name = "lblAnrede";
|
||||
this.lblAnrede.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.lblAnrede.SizeF = new System.Drawing.SizeF(317F, 17F);
|
||||
this.lblAnrede.StylePriority.UseFont = false;
|
||||
this.lblAnrede.Text = "Sehr geehrte Damen und Herren,";
|
||||
//
|
||||
// xrLabel8
|
||||
//
|
||||
@@ -860,7 +860,7 @@ namespace DomizielAnsbach
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel4;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel3;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel5;
|
||||
private DevExpress.XtraReports.UI.XRLabel lblAnrede;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel8;
|
||||
private DevExpress.XtraReports.UI.XRLabel lblAbrechnungszeitraum;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel15;
|
||||
|
||||
@@ -63,6 +63,15 @@ namespace DomizielAnsbach
|
||||
lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end);
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("herr"))
|
||||
{
|
||||
lblAnrede.Text = String.Format("Sehr geehrter Herr {0},", pRO.CustomerLastName);
|
||||
}
|
||||
else if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("frau"))
|
||||
{
|
||||
lblAnrede.Text = String.Format("Sehr geehrte Frau {0},", pRO.CustomerLastName);
|
||||
}
|
||||
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace DomizielAnsbach
|
||||
this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.lblAnrede = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.lblAbrechnungszeitraum = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
@@ -267,7 +267,7 @@ namespace DomizielAnsbach
|
||||
this.xrLabel4,
|
||||
this.xrLabel3,
|
||||
this.xrLabel2,
|
||||
this.xrLabel5,
|
||||
this.lblAnrede,
|
||||
this.xrLabel8,
|
||||
this.lblAbrechnungszeitraum});
|
||||
this.Page1.Font = new System.Drawing.Font("Verdana", 10F);
|
||||
@@ -612,14 +612,14 @@ namespace DomizielAnsbach
|
||||
this.xrLabel2.Text = "Rechnung Nr. [InvoiceNumber]";
|
||||
this.xrLabel2.WordWrap = false;
|
||||
//
|
||||
// xrLabel5
|
||||
// lblAnrede
|
||||
//
|
||||
this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 312.5F);
|
||||
this.xrLabel5.Name = "xrLabel5";
|
||||
this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.xrLabel5.SizeF = new System.Drawing.SizeF(317F, 17F);
|
||||
this.xrLabel5.StylePriority.UseFont = false;
|
||||
this.xrLabel5.Text = "Sehr geehrte Damen und Herren,";
|
||||
this.lblAnrede.LocationFloat = new DevExpress.Utils.PointFloat(0F, 312.5F);
|
||||
this.lblAnrede.Name = "lblAnrede";
|
||||
this.lblAnrede.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.lblAnrede.SizeF = new System.Drawing.SizeF(317F, 17F);
|
||||
this.lblAnrede.StylePriority.UseFont = false;
|
||||
this.lblAnrede.Text = "Sehr geehrte Damen und Herren,";
|
||||
//
|
||||
// xrLabel8
|
||||
//
|
||||
@@ -955,7 +955,7 @@ namespace DomizielAnsbach
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel4;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel3;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel5;
|
||||
private DevExpress.XtraReports.UI.XRLabel lblAnrede;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel8;
|
||||
private DevExpress.XtraReports.UI.XRLabel lblAbrechnungszeitraum;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel15;
|
||||
|
||||
@@ -4,7 +4,7 @@ using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
|
||||
using BS.Shared;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace DomizielAnsbach
|
||||
@@ -86,6 +86,8 @@ namespace DomizielAnsbach
|
||||
lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end);
|
||||
}
|
||||
|
||||
SetzeAnrede(pRO);
|
||||
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
|
||||
@@ -124,5 +126,35 @@ namespace DomizielAnsbach
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private void SetzeAnrede(ServiceInvoiceRO pRO)
|
||||
{
|
||||
String anrede = "Sehr geehrte Damen und Herren,";
|
||||
var p = GetKontaktPerson(pRO);
|
||||
|
||||
if (p != null)
|
||||
{
|
||||
if (p.Sex.HasValue && p.Sex.Value == Sex.Male)
|
||||
{
|
||||
anrede = "Sehr geehrter Herr " + p.LastName + ",";
|
||||
}
|
||||
else if (p.Sex.HasValue && p.Sex.Value == Sex.Female)
|
||||
{
|
||||
anrede = "Sehr geehrte Frau " + p.LastName + ",";
|
||||
}
|
||||
}
|
||||
|
||||
lblAnrede.Text = anrede;
|
||||
}
|
||||
|
||||
private Person GetKontaktPerson(ServiceInvoiceRO pRO)
|
||||
{
|
||||
if (pRO.ServiceInvoicePeriods.Count > 0)
|
||||
{
|
||||
var c2s = pRO.ServiceInvoicePeriods[0].CostBearer2SupportConcept;
|
||||
return c2s.CostBearerContactPerson;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace DomizielAnsbach
|
||||
this.rowErbrachteLeistung = new DevExpress.XtraReports.UI.XRTableRow();
|
||||
this.xrTableCell22 = new DevExpress.XtraReports.UI.XRTableCell();
|
||||
this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.lblAnrede = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
@@ -357,14 +357,14 @@ namespace DomizielAnsbach
|
||||
this.xrLabel6.StylePriority.UseFont = false;
|
||||
this.xrLabel6.Text = resources.GetString("xrLabel6.Text");
|
||||
//
|
||||
// xrLabel5
|
||||
// lblAnrede
|
||||
//
|
||||
this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 301.7083F);
|
||||
this.xrLabel5.Name = "xrLabel5";
|
||||
this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.xrLabel5.SizeF = new System.Drawing.SizeF(317F, 17F);
|
||||
this.xrLabel5.StylePriority.UseFont = false;
|
||||
this.xrLabel5.Text = "Sehr geehrte Damen und Herren,";
|
||||
this.lblAnrede.LocationFloat = new DevExpress.Utils.PointFloat(0F, 301.7083F);
|
||||
this.lblAnrede.Name = "lblAnrede";
|
||||
this.lblAnrede.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.lblAnrede.SizeF = new System.Drawing.SizeF(317F, 17F);
|
||||
this.lblAnrede.StylePriority.UseFont = false;
|
||||
this.lblAnrede.Text = "Sehr geehrte Damen und Herren,";
|
||||
//
|
||||
// xrLabel4
|
||||
//
|
||||
@@ -696,7 +696,7 @@ namespace DomizielAnsbach
|
||||
this.xrLabel2,
|
||||
this.xrLabel3,
|
||||
this.xrLabel4,
|
||||
this.xrLabel5,
|
||||
this.lblAnrede,
|
||||
this.xrLabel6,
|
||||
this.xrTable1,
|
||||
this.xrLabel8});
|
||||
@@ -1190,7 +1190,7 @@ namespace DomizielAnsbach
|
||||
private System.Windows.Forms.BindingSource bindingSource1;
|
||||
private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel6;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel5;
|
||||
private DevExpress.XtraReports.UI.XRLabel lblAnrede;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel4;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel3;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
|
||||
|
||||
@@ -4,6 +4,7 @@ using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace DomizielAnsbach
|
||||
@@ -77,9 +78,22 @@ namespace DomizielAnsbach
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
|
||||
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson) && cb2sc.CostBearerContactPerson.Sex.HasValue)
|
||||
{
|
||||
if (cb2sc.CostBearerContactPerson.Sex.Value == Sex.Female)
|
||||
{
|
||||
lblAnrede.Text = "Sehr geehrte Frau " + cb2sc.CostBearerContactPerson.LastName.Trim() + ",";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblAnrede.Text = "Sehr geehrter Herr " + cb2sc.CostBearerContactPerson.LastName.Trim() + ",";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
|
||||
private String GetCustomerId(SettlementRO pRO)
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace DomizielAnsbach
|
||||
|
||||
private string GetKrankheiten(Customer c)
|
||||
{
|
||||
string krankheiten = "";
|
||||
string krankheiten = null;
|
||||
foreach (var vv in c.VarFieldValueList)
|
||||
{
|
||||
var varFieldValue = Utils.XMLDeserializeFromString(vv.SerializedValue, Type.GetType(vv.TypeName));
|
||||
|
||||
Reference in New Issue
Block a user