CB: Report Changes

This commit is contained in:
Christian
2019-02-12 19:10:37 +01:00
parent dbed05ccb2
commit c9aa0937fa
220 changed files with 30524 additions and 14130 deletions

View File

@@ -48,7 +48,15 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CustomMitarbeiterstundenkontoBerechnung.cs" />
<Compile Include="Calculation\GroupDurationCalculator.cs" />
<Compile Include="Mitarbeiterstundenkonto.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Mitarbeiterstundenkonto.designer.cs">
<DependentUpon>Mitarbeiterstundenkonto.cs</DependentUpon>
</Compile>
<Compile Include="Plugins\CustomHomeContentGenerator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServiceRecordListReport.cs">
<SubType>Component</SubType>
@@ -68,8 +76,19 @@
<Compile Include="SettlementReport.Designer.cs">
<DependentUpon>SettlementReport.cs</DependentUpon>
</Compile>
<Compile Include="Teamstundenkonto.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Teamstundenkonto.designer.cs">
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
</Compile>
<Compile Include="Validation\ServiceRecordValidator.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Data\Data.csproj">
<Project>{B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}</Project>
<Name>Data</Name>
</ProjectReference>
<ProjectReference Include="..\..\Report\Report.csproj">
<Project>{40D8B312-EA64-49E3-A31A-5E57ED4D5654}</Project>
<Name>Report</Name>
@@ -84,6 +103,10 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Mitarbeiterstundenkonto.resx">
<DependentUpon>Mitarbeiterstundenkonto.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="ServiceRecordListReport.resx">
<DependentUpon>ServiceRecordListReport.cs</DependentUpon>
@@ -96,6 +119,9 @@
<DependentUpon>SettlementReport.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Teamstundenkonto.resx">
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -51,7 +51,6 @@ namespace Lori
this.xrTableCell17 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.formattingRuleStartDate = new DevExpress.XtraReports.UI.FormattingRule();
this.formattingRuleServiceDesc = new DevExpress.XtraReports.UI.FormattingRule();
this.formattingRuleCostBearer = new DevExpress.XtraReports.UI.FormattingRule();
@@ -88,6 +87,7 @@ namespace Lori
this.xrLabel28 = new DevExpress.XtraReports.UI.XRLabel();
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
@@ -331,10 +331,6 @@ namespace Lori
this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell2.Weight = 0.12626258228374876D;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// formattingRuleStartDate
//
this.formattingRuleStartDate.Condition = "[StartDate2] < [StartDate]";
@@ -712,6 +708,10 @@ namespace Lori
this.GroupHeader1.RepeatEveryPage = true;
this.GroupHeader1.StylePriority.UseFont = false;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// Stundenzettel
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using BeWo.Report;
using BeWo.Report.ReportObjects;
@@ -13,6 +14,10 @@ namespace Lori
public void SetReportDataSource(ServicesOverviewRO pRO)
{
if (String.IsNullOrEmpty(pRO.MainAttendant))
{
pRO.MainAttendant = "";
}
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
@@ -30,6 +35,16 @@ namespace Lori
s.ServiceCategoryAbbr = "E";
}
servicesBillable.Add(s);
if (!pRO.MainAttendant.Contains(s.EmployeeFullname))
{
if (pRO.MainAttendant.Length > 0)
{
pRO.MainAttendant += ", ";
}
pRO.MainAttendant += s.EmployeeFullname;
}
}
}

View File

@@ -73,11 +73,11 @@ namespace Lori
this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.ortDatum = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.lblAdresseLori = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel19 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel9 = new DevExpress.XtraReports.UI.XRLabel();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.lblAdresse = new DevExpress.XtraReports.UI.XRLabel();
this.xrCrossBandBox1 = new DevExpress.XtraReports.UI.XRCrossBandBox();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
@@ -446,9 +446,9 @@ namespace Lori
//
this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.ortDatum,
this.xrLabel1,
this.lblAdresseLori,
this.xrLabel19,
this.xrLabel9});
this.lblAdresse});
this.GroupHeader1.Font = new System.Drawing.Font("Arial", 11F);
this.GroupHeader1.HeightF = 347.2498F;
this.GroupHeader1.Name = "GroupHeader1";
@@ -467,16 +467,16 @@ namespace Lori
this.ortDatum.StylePriority.UseTextAlignment = false;
this.ortDatum.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
//
// xrLabel1
// lblAdresseLori
//
this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(50F, 0F);
this.xrLabel1.Multiline = true;
this.xrLabel1.Name = "xrLabel1";
this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel1.ProcessNullValues = DevExpress.XtraReports.UI.ValueSuppressType.SuppressAndShrink;
this.xrLabel1.SizeF = new System.Drawing.SizeF(280F, 81.16665F);
this.xrLabel1.StylePriority.UseFont = false;
this.xrLabel1.Text = "LORI GbR\r\nMastholter Straße 306\r\n59558 Lippstadt";
this.lblAdresseLori.LocationFloat = new DevExpress.Utils.PointFloat(50F, 0F);
this.lblAdresseLori.Multiline = true;
this.lblAdresseLori.Name = "lblAdresseLori";
this.lblAdresseLori.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAdresseLori.ProcessNullValues = DevExpress.XtraReports.UI.ValueSuppressType.SuppressAndShrink;
this.lblAdresseLori.SizeF = new System.Drawing.SizeF(309.1667F, 108.25F);
this.lblAdresseLori.StylePriority.UseFont = false;
this.lblAdresseLori.Text = "LORI GbR\r\nMastholter Straße 306\r\n59558 Lippstadt";
//
// xrLabel19
//
@@ -492,21 +492,15 @@ namespace Lori
this.xrLabel19.Text = "Ansprechpartner/in: [CreatorName] \r\nTelefon: [SenderContactPersonPhone]\r\nFax: " +
" [SenderContactPersonFax]\r\nE-Mail: [SenderContactPersonMail]\r\n";
//
// xrLabel9
// lblAdresse
//
this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(60.0001F, 200.9583F);
this.xrLabel9.Multiline = true;
this.xrLabel9.Name = "xrLabel9";
this.xrLabel9.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel9.ProcessNullValues = DevExpress.XtraReports.UI.ValueSuppressType.SuppressAndShrink;
this.xrLabel9.SizeF = new System.Drawing.SizeF(329.9999F, 81.58333F);
this.xrLabel9.StylePriority.UseFont = false;
this.xrLabel9.Text = "[RecipientOrganisation]\r\n[RecipientContactPerson]\r\n[RecipientStreet]\r\n[RecipientP" +
"ostCodeAndTown]";
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.SettlementRO);
this.lblAdresse.LocationFloat = new DevExpress.Utils.PointFloat(60.0001F, 200.9583F);
this.lblAdresse.Multiline = true;
this.lblAdresse.Name = "lblAdresse";
this.lblAdresse.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAdresse.ProcessNullValues = DevExpress.XtraReports.UI.ValueSuppressType.SuppressAndShrink;
this.lblAdresse.SizeF = new System.Drawing.SizeF(329.9999F, 81.58333F);
this.lblAdresse.StylePriority.UseFont = false;
//
// xrCrossBandBox1
//
@@ -519,6 +513,10 @@ namespace Lori
this.xrCrossBandBox1.StartPointFloat = new DevExpress.Utils.PointFloat(0F, 29.99999F);
this.xrCrossBandBox1.WidthF = 766.6667F;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.SettlementRO);
//
// Spitzabrechnung
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
@@ -551,7 +549,7 @@ namespace Lori
private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1;
private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1;
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1;
private DevExpress.XtraReports.UI.XRLabel xrLabel9;
private DevExpress.XtraReports.UI.XRLabel lblAdresse;
private DevExpress.XtraReports.UI.XRLabel xrLabel7;
private DevExpress.XtraReports.UI.XRLabel xrLabel14;
private DevExpress.XtraReports.UI.XRLabel xrLabel10;
@@ -587,7 +585,7 @@ namespace Lori
private DevExpress.XtraReports.UI.XRCheckBox xrCheckBox2;
private DevExpress.XtraReports.UI.XRCheckBox xrCheckBox1;
private DevExpress.XtraReports.UI.XRLabel xrLabel35;
private DevExpress.XtraReports.UI.XRLabel xrLabel1;
private DevExpress.XtraReports.UI.XRLabel lblAdresseLori;
private DevExpress.XtraReports.UI.XRLabel xrLabel19;
private DevExpress.XtraReports.UI.XRLine xrLine2;
private DevExpress.XtraReports.UI.XRLine xrLine1;

View File

@@ -1,6 +1,11 @@
using System;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using BS.Shared.DataContracts;
using DevExpress.XtraReports.UI;
namespace Lori
{
@@ -13,17 +18,110 @@ namespace Lori
public void SetReportDataSource(SettlementRO pRO)
{
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
{
sb.AppendLine(pRO.RecipientPostCodeAndTown);
}
lblAdresse.Text = sb.ToString();
xrCheckBox2.Checked = true;
DateTime? terminationDate = null;
if (pRO.CostBearer2SupportConceptOid > 0)
{
var c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
if (c2s.SupportConcept.Customer.TerminationDate.HasValue)
{
terminationDate = c2s.SupportConcept.Customer.TerminationDate;
xrCheckBox1.Text = String.Format(" Die Betreuung wurde am {0:dd.MM.yyyy} beendet.",
c2s.SupportConcept.Customer.TerminationDate);
xrCheckBox2.Checked = false;
xrCheckBox1.Checked = true;
}
}
ErstelleRechnungspositionen(pRO, terminationDate);
ortDatum.Text = string.Format("{0}", DateTime.Now.ToShortDateString());
bindingSource1.DataSource = pRO;
}
private void ErstelleRechnungspositionen(SettlementRO pRO, DateTime? terminationDate)
{
if (pRO.InvoiceItems != null && pRO.InvoiceItems.Count > 0)
{
if (terminationDate.HasValue)
{
if (terminationDate < pRO.InvoiceItems[pRO.InvoiceItems.Count - 1].ItemPeriodEnd)
{
pRO.InvoiceItems[pRO.InvoiceItems.Count - 1].ItemPeriodEnd = terminationDate;
}
}
if (pRO.InvoiceItems.Count == 3)
{
SetzeRechnungsTexte(pRO.InvoiceItems[0], cellStart1, cellEnd1, cellHourlyRate1, cellFLS1);
SetzeRechnungsTexte(pRO.InvoiceItems[1], cellStart2, cellEnd2, cellHourlyRate2, cellFLS2);
SetzeRechnungsTexte(pRO.InvoiceItems[2], cellStart3, cellEnd3, cellHourlyRate3, cellFLS3);
}
else if (pRO.InvoiceItems.Count == 2)
{
SetzeRechnungsTexte(pRO.InvoiceItems[0], cellStart1, cellEnd1, cellHourlyRate1, cellFLS1);
SetzeRechnungsTexte(pRO.InvoiceItems[1], cellStart2, cellEnd2, cellHourlyRate2, cellFLS2);
}
else
{
SetzeRechnungsTexte(pRO.InvoiceItems[0], cellStart1, cellEnd1, cellHourlyRate1, cellFLS1);
}
}
else
{
ErstelleStandardRechnungspositionen(pRO, terminationDate);
}
}
private void SetzeRechnungsTexte(InvoiceItemDC ii, XRTableCell cellStart, XRTableCell cellEnd, XRTableCell cellHourlyRate, XRTableCell cellFLS)
{
cellStart.Text = String.Format("{0:dd.MM.yyyy}", ii.ItemPeriodStart);
cellEnd.Text = String.Format("{0:dd.MM.yyyy}", ii.ItemPeriodEnd);
cellHourlyRate.Text = String.Format("{0:c}", ii.AmountPerUnit);
cellFLS.Text = String.Format("{0:0.00}", ii.UnitCount);
}
private void ErstelleStandardRechnungspositionen(SettlementRO pRO, DateTime? terminationDate)
{
pRO.AccountingEndDateString = CorrectPossibleTerminationEndDate(pRO.AccountingEndDateString, terminationDate);
if (pRO.DifferentHourlyRateCount == 3)
{
//Erbrachte Leistungen (FLS) - bis [HourlyRateOldEndDateString] à [HourlyRateOldString] €
pRO.Abrechnungstext1 = String.Format("{0} bis {1}",
pRO.Abrechnungstext1 = String.Format("{0} bis {1}",
pRO.AccountingStartDateString, pRO.HourlyRate3EndDateString);
pRO.Abrechnungstext1 += String.Format(": {0:0.##} FLS {1}x {2:c}",
pRO.GeleisteteFLSMitStundensatz3, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRate3);
//[AccountingStartDateString] - [HourlyRate3EndDateString] sind [RecordedFLSWithHourlyRate3String] Std. x [HourlyRate3String] € =";
//[AccountingStartDateString] - [HourlyRate3EndDateString] sind [RecordedFLSWithHourlyRate3String] Std. x [HourlyRate3String] € =";
pRO.Betrag1 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatz3 * (decimal)pRO.RateFactor * pRO.HourlyRate3);
@@ -45,24 +143,24 @@ namespace Lori
cellStart1.Text = pRO.AccountingStartDateString;
cellEnd1.Text = pRO.HourlyRate3EndDateString;
cellHourlyRate1.Text = pRO.HourlyRate3String;
cellFLS1.Text = pRO.RecordedFLSWithHourlyRate3String;
cellStart1.Text = pRO.AccountingStartDateString;
cellEnd1.Text = pRO.HourlyRate3EndDateString;
cellHourlyRate1.Text = pRO.HourlyRate3String;
cellFLS1.Text = pRO.RecordedFLSWithHourlyRate3String;
cellStart2.Text = pRO.HourlyRateOldStartDateString;
cellEnd2.Text = pRO.HourlyRateOldEndDateString;
cellHourlyRate2.Text = pRO.HourlyRateOldString;
cellFLS2.Text = pRO.RecordedFLSWithOldHourlyRateString;
cellStart2.Text = pRO.HourlyRateOldStartDateString;
cellEnd2.Text = pRO.HourlyRateOldEndDateString;
cellHourlyRate2.Text = pRO.HourlyRateOldString;
cellFLS2.Text = pRO.RecordedFLSWithOldHourlyRateString;
cellStart3.Text = pRO.HourlyRateNewStartDateString;
cellEnd3.Text = pRO.AccountingEndDateString;
cellHourlyRate3.Text = pRO.HourlyRateNewString;
cellFLS3.Text = pRO.RecordedFLSWithNewHourlyRateString;
cellStart3.Text = pRO.HourlyRateNewStartDateString;
cellEnd3.Text = pRO.AccountingEndDateString;
cellHourlyRate3.Text = pRO.HourlyRateNewString;
cellFLS3.Text = pRO.RecordedFLSWithNewHourlyRateString;
}
else if (pRO.DifferentHourlyRateCount == 2)
{
pRO.Abrechnungstext2 = String.Format("{0} bis {1}",
pRO.AccountingStartDateString, pRO.HourlyRateOldEndDateString);
pRO.Abrechnungstext2 += String.Format(": {0:0.##} FLS {1}x {2:c}",
@@ -79,22 +177,22 @@ namespace Lori
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
cellStart1.Text = pRO.AccountingStartDateString;
cellEnd1.Text = pRO.HourlyRateOldEndDateString;
cellHourlyRate1.Text = pRO.HourlyRateOldString;
cellFLS1.Text = pRO.RecordedFLSWithOldHourlyRateString;
cellStart1.Text = pRO.AccountingStartDateString;
cellEnd1.Text = pRO.HourlyRateOldEndDateString;
cellHourlyRate1.Text = pRO.HourlyRateOldString;
cellFLS1.Text = pRO.RecordedFLSWithOldHourlyRateString;
cellStart2.Text = pRO.HourlyRateNewStartDateString;
cellEnd2.Text = pRO.AccountingEndDateString;
cellHourlyRate2.Text = pRO.HourlyRateNewString;
cellFLS2.Text = pRO.RecordedFLSWithNewHourlyRateString;
cellStart2.Text = pRO.HourlyRateNewStartDateString;
cellEnd2.Text = pRO.AccountingEndDateString;
cellHourlyRate2.Text = pRO.HourlyRateNewString;
cellFLS2.Text = pRO.RecordedFLSWithNewHourlyRateString;
}
else
{
cellStart1.Text = pRO.AccountingStartDateString;
cellEnd1.Text = pRO.AccountingEndDateString;
cellHourlyRate1.Text = pRO.HourlyRateNewString;
cellFLS1.Text = pRO.RecordedFLSWithNewHourlyRateString;
cellStart1.Text = pRO.AccountingStartDateString;
cellEnd1.Text = pRO.AccountingEndDateString;
cellHourlyRate1.Text = pRO.HourlyRateNewString;
cellFLS1.Text = pRO.RecordedFLSWithNewHourlyRateString;
pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
pRO.AccountingStartDateString, pRO.AccountingEndDateString);
@@ -103,11 +201,24 @@ namespace Lori
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
}
private string CorrectPossibleTerminationEndDate(string dateString, DateTime? terminationDate)
{
if (terminationDate.HasValue)
{
DateTime dt = DateTime.MinValue;
if (DateTime.TryParse(dateString, out dt))
{
if (terminationDate < dt)
{
return String.Format("{0:dd.MM.yyyy}", terminationDate);
}
}
ortDatum.Text = string.Format("Hattingen, {0}", DateTime.Now.ToShortDateString());
}
bindingSource1.DataSource = pRO;
return dateString;
}
}
}