MH: BeWoAmRhein Fehlkontaktrechnung
This commit is contained in:
@@ -164,7 +164,7 @@
|
||||
<Compile Include="SettlementReport2.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SettlementReport2.designer.cs">
|
||||
<Compile Include="SettlementReport2.Designer.cs">
|
||||
<DependentUpon>SettlementReport2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Teamstundenkonto.cs">
|
||||
@@ -205,6 +205,7 @@
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SettlementReport2.resx">
|
||||
<DependentUpon>SettlementReport2.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Teamstundenkonto.resx">
|
||||
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
|
||||
|
||||
@@ -18,36 +18,37 @@ namespace BetreutesWohnenAmRheinReports.Invoicing
|
||||
{
|
||||
public override bool CanCreateInvoiceTheOldWay(Settlement2DC si, CostBearer2SupportConcept c2s)
|
||||
{
|
||||
var relDC = c2s.MapToNewDC();
|
||||
return false;
|
||||
//var relDC = c2s.MapToNewDC();
|
||||
|
||||
|
||||
DateTime start = si.AccountingPeriodStart.Value.Date;
|
||||
DateTime end = si.AccountingPeriodEnd.Value.Date;
|
||||
if (c2s.SupportConcept.Customer.TerminationDate.HasValue &&
|
||||
c2s.SupportConcept.Customer.TerminationDate.Value < end)
|
||||
{
|
||||
end = c2s.SupportConcept.Customer.TerminationDate.Value;
|
||||
}
|
||||
if (end > DateTime.Now)
|
||||
{
|
||||
var srList = c2s.ServiceRecords;
|
||||
//DateTime start = si.AccountingPeriodStart.Value.Date;
|
||||
//DateTime end = si.AccountingPeriodEnd.Value.Date;
|
||||
//if (c2s.SupportConcept.Customer.TerminationDate.HasValue &&
|
||||
// c2s.SupportConcept.Customer.TerminationDate.Value < end)
|
||||
//{
|
||||
// end = c2s.SupportConcept.Customer.TerminationDate.Value;
|
||||
//}
|
||||
//if (end > DateTime.Now)
|
||||
//{
|
||||
// var srList = c2s.ServiceRecords;
|
||||
|
||||
var max = srList.Max(s => s.End);
|
||||
// var max = srList.Max(s => s.End);
|
||||
|
||||
if (max.HasValue && max < end)
|
||||
{
|
||||
end = max.Value;
|
||||
}
|
||||
}
|
||||
// if (max.HasValue && max < end)
|
||||
// {
|
||||
// end = max.Value;
|
||||
// }
|
||||
//}
|
||||
|
||||
var hourlyRatesInSpanList = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.HourlyRate, start, end).ToList();
|
||||
if (hourlyRatesInSpanList.Count > 3)
|
||||
return false;
|
||||
//var hourlyRatesInSpanList = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.HourlyRate, start, end).ToList();
|
||||
//if (hourlyRatesInSpanList.Count > 3)
|
||||
// return false;
|
||||
|
||||
var factorInSpanList = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.RateFactor, start, end).ToList();
|
||||
if (factorInSpanList.Count > 1)
|
||||
return false;
|
||||
return true;
|
||||
//var factorInSpanList = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.RateFactor, start, end).ToList();
|
||||
//if (factorInSpanList.Count > 1)
|
||||
// return false;
|
||||
//return true;
|
||||
}
|
||||
|
||||
public override bool IsServiceRecordBillable(ServiceRecord iRecord)
|
||||
|
||||
1131
ReportImp/BetreutesWohnenAmRheinReports/SettlementReport2.Designer.cs
generated
Normal file
1131
ReportImp/BetreutesWohnenAmRheinReports/SettlementReport2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
61
ReportImp/BetreutesWohnenAmRheinReports/SettlementReport2.cs
Normal file
61
ReportImp/BetreutesWohnenAmRheinReports/SettlementReport2.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using DevExpress.XtraReports.UI;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Report;
|
||||
using System.Text.RegularExpressions;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
namespace BetreutesWohnenAmRheinReports
|
||||
{
|
||||
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
||||
{
|
||||
public Spitzabrechnung()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetReportDataSource(Settlement2RO pRO)
|
||||
{
|
||||
if (String.IsNullOrEmpty(pRO.Notice))
|
||||
{
|
||||
lblNotice.Visible = false;
|
||||
}
|
||||
|
||||
decimal rateFactor = 1;
|
||||
|
||||
foreach (var ii in pRO.InvoiceItems)
|
||||
{
|
||||
if (ii.RateFactor.HasValue)
|
||||
{
|
||||
rateFactor = (100 + ii.RateFactor.Value) / 100;
|
||||
}
|
||||
|
||||
if (!pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
|
||||
{
|
||||
Zwischensumme.Visible = true;
|
||||
//if (!ii.ItemDescription.IsNullOrEmpty())
|
||||
//{
|
||||
//ii.AbrechnungsText = Regex.Replace(ii.DetailDescription, ii.ItemDescription, "Fehlkontakte");
|
||||
//}
|
||||
ii.AbrechnungsText = ii.AbrechnungsText.Replace("FLS", "Std.");
|
||||
ii.ItemDescription = "Fehlkontakte";
|
||||
}
|
||||
else if (ii.ItemDescription.IsNullOrEmpty())
|
||||
{
|
||||
ii.ItemDescription = "Fachleistungsstunden";
|
||||
}
|
||||
}
|
||||
pRO.RateFactor = (double)rateFactor;
|
||||
|
||||
if (pRO.Salutation1.IsNullOrEmpty() && pRO.Salutation2.IsNullOrEmpty())
|
||||
{
|
||||
lblAnrede.Text = "Guten Tag,";
|
||||
}
|
||||
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
}
|
||||
}
|
||||
130
ReportImp/BetreutesWohnenAmRheinReports/SettlementReport2.resx
Normal file
130
ReportImp/BetreutesWohnenAmRheinReports/SettlementReport2.resx
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user