SkmViersen/SammelrechnungSeite1 - Abfangen Differenzrechnung

This commit is contained in:
2024-09-26 10:18:55 +02:00
parent 4fd511f5d2
commit 8f8fb76f09
3 changed files with 20 additions and 19 deletions

View File

@@ -22,8 +22,11 @@ namespace SkmViersen
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
Customer customer = null;
if (pRO.ServiceInvoicePeriods != null && pRO.ServiceInvoicePeriods.Count > 0)
if (pRO.ServiceInvoicePeriods != null && pRO.ServiceInvoicePeriods.Count > 0
&& pRO.ServiceInvoicePeriods[0].ServiceInvoiceItems != null && !pRO.ServiceInvoicePeriods[0].ServiceInvoiceItems[0].ServiceDescription.Contains("Rechnungsdifferenz"))
{
customer = pRO.ServiceInvoicePeriods[0].CostBearer2SupportConcept.SupportConcept.Customer;
}
if (customer == null && pRO.CustomerOid.HasValue)
{
customer = DAOFactory.GenericDAO.GetByID<Customer>(pRO.CustomerOid.Value);

View File

@@ -540,6 +540,8 @@ namespace SkmViersen
this.xrTableCell42.BorderColor = System.Drawing.Color.DarkGray;
this.xrTableCell42.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell42.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.ServiceDescription")});
this.xrTableCell42.Name = "xrTableCell42";
this.xrTableCell42.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell42.StylePriority.UseBorderColor = false;

View File

@@ -29,30 +29,26 @@ namespace SkmViersen
{
foreach (var ii in sip.ServiceInvoiceItems)
{
var u = ii.UnitCount ?? 0;
if (!String.IsNullOrEmpty(ii.RateFactor))
if (!String.IsNullOrEmpty(ii.ServiceDescription) && !ii.ServiceDescription.StartsWith("Rechnungsdifferenz"))
{
var rfStr = ii.RateFactor.Replace("%", "").Replace(",00", "").Trim();
int rfInt = 0;
Int32.TryParse(rfStr, out rfInt);
decimal rateFactor = (100m + rfInt) / 100m;
ii.RateFactor = Math.Round(rateFactor, 2, MidpointRounding.AwayFromZero).ToString();
u *= rateFactor;
ii.UnitCountString = Math.Round(u, 2, MidpointRounding.AwayFromZero).ToString();
ii.ServiceDescription = "Betreuungsarbeit";
var u = ii.UnitCount ?? 0;
if (!String.IsNullOrEmpty(ii.RateFactor))
{
var rfStr = ii.RateFactor.Replace("%", "").Replace(",00", "").Trim();
int rfInt = 0;
Int32.TryParse(rfStr, out rfInt);
decimal rateFactor = (100m + rfInt) / 100m;
ii.RateFactor = Math.Round(rateFactor, 2, MidpointRounding.AwayFromZero).ToString();
u *= rateFactor;
ii.UnitCountString = Math.Round(u, 2, MidpointRounding.AwayFromZero).ToString();
}
}
}
}
}
}
//if (start.Month == end.Month && start.Year == end.Year)
//{
// lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Monat {0:MMMM yyyy} folgende erbrachte Tätigkeiten:", start);
//}
//else
//{
// lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end);
//}
var handy = pRO.InvoiceBase.SenderContactInformations.Where(c => c.ContactType == ContactType.business_MobilePhone).FirstOrDefault();
if (handy != null)