LebenshilfeDorsten/SettlementReport2.cs - Spezifizierung wenn Beschriftung Fehlkontakte
This commit is contained in:
@@ -7,6 +7,7 @@ using BeWo.Report.ReportObjects;
|
|||||||
using BeWo.Report;
|
using BeWo.Report;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using BS.Shared.Extensions;
|
using BS.Shared.Extensions;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace LebenshilfeDorsten
|
namespace LebenshilfeDorsten
|
||||||
{
|
{
|
||||||
@@ -25,22 +26,29 @@ namespace LebenshilfeDorsten
|
|||||||
}
|
}
|
||||||
|
|
||||||
decimal rateFactor = 1;
|
decimal rateFactor = 1;
|
||||||
|
bool factor = false;
|
||||||
foreach (var ii in pRO.InvoiceItems)
|
if (pRO.InvoiceItems != null && pRO.InvoiceItems.Count > 0)
|
||||||
{
|
{
|
||||||
if (ii.RateFactor.HasValue)
|
if (pRO.InvoiceItems.Any(i => i.RateFactor.HasValue && i.RateFactor.Value > 0))
|
||||||
|
{
|
||||||
|
factor = true;
|
||||||
|
}
|
||||||
|
foreach (var ii in pRO.InvoiceItems)
|
||||||
{
|
{
|
||||||
rateFactor = (100 + ii.RateFactor.Value) / 100;
|
if (ii.RateFactor.HasValue)
|
||||||
}
|
|
||||||
|
|
||||||
if (!pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
|
|
||||||
{
|
|
||||||
Zwischensumme.Visible = true;
|
|
||||||
if (!ii.ItemDescription.IsNullOrEmpty())
|
|
||||||
{
|
{
|
||||||
ii.DetailDescription = Regex.Replace(ii.DetailDescription, ii.ItemDescription, "Fehlkontakte");
|
rateFactor = (100 + ii.RateFactor.Value) / 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (factor && !pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
|
||||||
|
{
|
||||||
|
Zwischensumme.Visible = true;
|
||||||
|
if (!ii.ItemDescription.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
ii.DetailDescription = Regex.Replace(ii.DetailDescription, ii.ItemDescription, "Fehlkontakte");
|
||||||
|
}
|
||||||
|
ii.ItemDescription = "Fehlkontakte";
|
||||||
}
|
}
|
||||||
ii.ItemDescription = "Fehlkontakte";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pRO.RateFactor = (double)rateFactor;
|
pRO.RateFactor = (double)rateFactor;
|
||||||
|
|||||||
Reference in New Issue
Block a user