diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index f7d959929..935236d14 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -679,7 +679,7 @@ namespace BeWoPlanerMobil.Controllers if(Model.IsInGroupBookingMode) { var list = GetSelectedGroupBookingSupportConcepts(); - + LoadSupportConceptThings(null, false); list.DoForEach(sc => { allGoals.AddRangeIfElementsNotIn(sc.Goals); }); } else if(!Model.IsInGroupBookingMode) @@ -3525,30 +3525,53 @@ namespace BeWoPlanerMobil.Controllers [Authorize] public ActionResult AddScCbRelsToGroupBooking(string[] relOids, string[] groupOids) { - SkipModelInitialization = true; + if(!IsUserLoggedIn()) { TempData[TempDataConstants.DoLogoutKey] = true; return PartialView("GroupBookingScCbRelList"); } + AddScCbRelsToGroupOrMultiBooking(relOids, groupOids); + + return PartialView("GroupBookingScCbRelList", Model); + } + + [Authorize] + public ActionResult AddScCbRelsToMultiBooking(string[] relOids, string[] groupOids) + { + if (!IsUserLoggedIn()) + { + TempData[TempDataConstants.DoLogoutKey] = true; + return PartialView("MultiBookingScCbRelList"); + } + AddScCbRelsToGroupOrMultiBooking(relOids, groupOids); + + return PartialView("MultiBookingScCbRelList", Model); + } + + private void AddScCbRelsToGroupOrMultiBooking(string[] relOids, string[] groupOids) + { + + SkipModelInitialization = true; + var singleRels = new List(); var groupRels = new List(); var groups = new List(); - if(groupOids is null) + if (groupOids is null) { groupOids = Array.Empty(); } - if(relOids is null) + if (relOids is null) { relOids = Array.Empty(); } relOids.DoForEach(relOid => { - if(long.TryParse(relOid, out var singleRelOid)) + if (long.TryParse(relOid, out var singleRelOid)) { singleRels.AddIfNotIn(singleRelOid); } @@ -3556,19 +3579,21 @@ namespace BeWoPlanerMobil.Controllers groupOids.DoForEach(groupOid => { - if(long.TryParse(groupOid, out var g)) + if (long.TryParse(groupOid, out var g)) { groupRels.AddIfNotIn(g); } }); + Model.GroupsOfPeople = EmployeeService.GetAllGroups(LoggedInEmployee.EmployeeOid).OrderBy(gop => gop.Name).ToList(); + Model.GroupBookingSelectedGroupOfPeopleOids.Clear(); groupRels.DoForEach(groupOid => { var group = Model.GroupsOfPeople.FirstOrDefault(f => f.GroupOfPeopleOid.HasValue && f.GroupOfPeopleOid.Value.Equals(groupOid)); - if(group is null) + if (group is null) { return; } @@ -3578,7 +3603,7 @@ namespace BeWoPlanerMobil.Controllers }); Model.GroupBookingSelectedCostBearerSupportConcepts.Clear(); - + Model.GroupBookingSelectedCostBearerSupportConceptOids.Clear(); Model.GroupBookingSelectedCostBearerSupportConceptOids.AddRangeIfElementsNotIn(singleRels); @@ -3587,24 +3612,24 @@ namespace BeWoPlanerMobil.Controllers //var groupCostBearerRelations = CustomerService.GetSupportConceptCostBearerRelationsById(singleRels); - - foreach(var gruppe in groups.Where(g => g.GroupOfPeopleOid.HasValue)) + + foreach (var gruppe in groups.Where(g => g.GroupOfPeopleOid.HasValue)) { var groupRelOids = new List(); gruppe.SupportConceptList.ForEach(f => groupRelOids.AddRange(f.CostBearerRelOids)); - if(!gruppe.GroupOfPeopleOid.HasValue) + if (!gruppe.GroupOfPeopleOid.HasValue) { continue; } var groupOid = gruppe.GroupOfPeopleOid.Value; - if(singleRels.ContainsItems(groupRelOids)) + if (singleRels.ContainsItems(groupRelOids)) { Model.GroupBookingSelectedGroupOfPeopleOids.AddIfNotIn(groupOid); } - else if(Model.GroupBookingSelectedGroupOfPeopleOids.Contains(groupOid)) + else if (Model.GroupBookingSelectedGroupOfPeopleOids.Contains(groupOid)) { Model.GroupBookingSelectedGroupOfPeopleOids.Remove(groupOid); } @@ -3615,8 +3640,6 @@ namespace BeWoPlanerMobil.Controllers CreateModelSupportConceptListObjects(false); LoadSupportConceptThings(null, true); - - return PartialView("GroupBookingScCbRelList", Model); } [Authorize] @@ -4274,102 +4297,7 @@ namespace BeWoPlanerMobil.Controllers return PartialView("MultiBookingSelectionPartial", Model); } - [Authorize] - public ActionResult AddScCbRelsToMultiBooking(string[] relOids, string[] groupOids) - { - if(Model is null) - { - TempData[TempDataConstants.DoLogoutKey] = true; - return PartialView("MultiBookingScCbRelList"); - } - - var singleRels = new List(); - var groupRels = new List(); - var groups = new List(); - - if(groupOids is null) - { - groupOids = Array.Empty(); - } - - if(relOids is null) - { - relOids = Array.Empty(); - } - - relOids.DoForEach(relOid => - { - if(long.TryParse(relOid, out var singleRelOid)) - { - singleRels.AddIfNotIn(singleRelOid); - } - }); - - groupOids.DoForEach(groupOid => - { - if(long.TryParse(groupOid, out var g)) - { - groupRels.AddIfNotIn(g); - } - }); - - Model.GroupBookingSelectedGroupOfPeopleOids.Clear(); - - groupRels.DoForEach(groupOid => - { - var group = Model.GroupsOfPeople.FirstOrDefault(f => f.GroupOfPeopleOid.HasValue && f.GroupOfPeopleOid.Value.Equals(groupOid)); - - if(group is null) - { - return; - } - - groups.AddIfNotIn(group); - group.SupportConceptList.DoForEach(f => singleRels.AddRangeIfElementsNotIn(f.CostBearerRelOids)); - }); - - //Model.MultiBookingSelectedSupportConcepts.Clear(); - - Model.GroupBookingSelectedCostBearerSupportConceptOids.Clear(); - Model.GroupBookingSelectedCostBearerSupportConceptOids.AddRangeIfElementsNotIn(singleRels); - - //var selectedSupportConcepts = CustomerService.GetSupportConceptsByCostbearer2SupportConceptRelOids(singleRels); - - //var groupCostBearerRelations = CustomerService.GetSupportConceptCostBearerRelationsById(singleRels); - - - //Model.MultiBookingSelectedSupportConcepts.AddRangeIfElementsNotIn(selectedSupportConcepts); - - foreach(var gruppe in groups.Where(g => g.GroupOfPeopleOid.HasValue)) - { - var groupRelOids = new List(); - gruppe.SupportConceptList.ForEach(f => groupRelOids.AddRange(f.CostBearerRelOids)); - - if(!gruppe.GroupOfPeopleOid.HasValue) - { - continue; - } - - var groupOid = gruppe.GroupOfPeopleOid.Value; - - if(singleRels.ContainsItems(groupRelOids)) - { - Model.GroupBookingSelectedGroupOfPeopleOids.AddIfNotIn(groupOid); - } - else if(Model.GroupBookingSelectedGroupOfPeopleOids.Contains(groupOid)) - { - Model.GroupBookingSelectedGroupOfPeopleOids.Remove(groupOid); - } - } - - CreateModelSupportConceptListObjects(false); - LoadSupportConceptThings(null, true); - - //Model.SelectedConceptCostBearerRelationOids = Model.SelectedConceptCostBearerRelations.Select(s => s.CostBearer2SupportConceptOid.Value).ToList(); - //Model.MultiBookingSelectedSupportConceptOids = Model.MultiBookingSelectedSupportConcepts.Select(s => s.SupportConceptOid.Value).ToList(); - - return PartialView("MultiBookingScCbRelList", Model); - } + [Authorize] public ActionResult RemoveSupportConceptCostbearerRelFromMultiBooking(string relOid) diff --git a/ReportImp/SHKServiceSBD/Reports/KalkulationReport.Designer.cs b/ReportImp/SHKServiceSBD/Reports/KalkulationReport.Designer.cs index 24706f7e5..df3fc6c67 100644 --- a/ReportImp/SHKServiceSBD/Reports/KalkulationReport.Designer.cs +++ b/ReportImp/SHKServiceSBD/Reports/KalkulationReport.Designer.cs @@ -30,6 +30,7 @@ namespace SHKServiceSBD.Reports private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + DevExpress.XtraReports.UI.XRWatermark xrWatermark1 = new DevExpress.XtraReports.UI.XRWatermark(); this.Detail = new DevExpress.XtraReports.UI.DetailBand(); this.lblKlient = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel(); @@ -66,8 +67,12 @@ namespace SHKServiceSBD.Reports this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableRow5 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell20 = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellKostenAssiWoche = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellKostenAssiMonat = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellKostenAssiJahr = new DevExpress.XtraReports.UI.XRTableCell(); this.GroupHeader3 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -75,7 +80,12 @@ namespace SHKServiceSBD.Reports this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell19 = new DevExpress.XtraReports.UI.XRTableCell(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell24 = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellKostenBefTag = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellKostenBefWoche = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellKostenBefMonat = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellKostenBefJahr = new DevExpress.XtraReports.UI.XRTableCell(); this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand(); this.tableBetreuungszeiten = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow(); @@ -84,29 +94,24 @@ namespace SHKServiceSBD.Reports this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell13 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableRow5 = new DevExpress.XtraReports.UI.XRTableRow(); - this.xrTableCell20 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell21 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell22 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell23 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow(); - this.xrTableCell24 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell25 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell26 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell27 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell28 = new DevExpress.XtraReports.UI.XRTableCell(); this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); + this.lblAngebotGesamt = new DevExpress.XtraReports.UI.XRLabel(); + this.lblAngebotBefProMonat = new DevExpress.XtraReports.UI.XRLabel(); + this.lblAngebotAssProMonat = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel(); - this.lblAngebotAssProMonat = new DevExpress.XtraReports.UI.XRLabel(); - this.lblAngebotBefProMonat = new DevExpress.XtraReports.UI.XRLabel(); - this.lblAngebotGesamt = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblKmProTag = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel16 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblEuroProKm = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tableBetreuungszeiten)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // Detail @@ -153,6 +158,10 @@ namespace SHKServiceSBD.Reports // ReportHeader // this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel16, + this.lblEuroProKm, + this.xrLabel15, + this.lblKmProTag, this.xrTable3, this.lblStundenProWoche, this.lblDurchschnittStundenProTag, @@ -171,7 +180,7 @@ namespace SHKServiceSBD.Reports this.lblAlter2, this.xrLabel5, this.lblKlient}); - this.ReportHeader.HeightF = 409.0001F; + this.ReportHeader.HeightF = 470.3334F; this.ReportHeader.Name = "ReportHeader"; // // xrTable3 @@ -179,7 +188,7 @@ namespace SHKServiceSBD.Reports this.xrTable3.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 391.0001F); + this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 452.3334F); this.xrTable3.Name = "xrTable3"; this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow4}); @@ -317,7 +326,7 @@ namespace SHKServiceSBD.Reports // // xrLabel14 // - this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(0F, 361.0001F); + this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 422.3334F); this.xrLabel14.Name = "xrLabel14"; this.xrLabel14.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); this.xrLabel14.SizeF = new System.Drawing.SizeF(155.41F, 30F); @@ -497,28 +506,74 @@ namespace SHKServiceSBD.Reports this.xrTableCell8.Text = "Jährlich"; this.xrTableCell8.Weight = 0.34190062050507453D; // + // xrTableRow5 + // + this.xrTableRow5.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell20, + this.cellKostenAssiWoche, + this.cellKostenAssiMonat, + this.cellKostenAssiJahr}); + this.xrTableRow5.Name = "xrTableRow5"; + this.xrTableRow5.Weight = 1.125D; + // + // xrTableCell20 + // + this.xrTableCell20.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell20.Multiline = true; + this.xrTableCell20.Name = "xrTableCell20"; + this.xrTableCell20.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.xrTableCell20.StylePriority.UseBorders = false; + this.xrTableCell20.StylePriority.UseFont = false; + this.xrTableCell20.StylePriority.UsePadding = false; + this.xrTableCell20.Text = "Schulassistenz"; + this.xrTableCell20.Weight = 0.253114955818913D; + // + // cellKostenAssiWoche + // + this.cellKostenAssiWoche.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellKostenAssiWoche.Multiline = true; + this.cellKostenAssiWoche.Name = "cellKostenAssiWoche"; + this.cellKostenAssiWoche.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellKostenAssiWoche.StylePriority.UseBorders = false; + this.cellKostenAssiWoche.StylePriority.UseFont = false; + this.cellKostenAssiWoche.StylePriority.UsePadding = false; + this.cellKostenAssiWoche.Weight = 0.2024922118380062D; + // + // cellKostenAssiMonat + // + this.cellKostenAssiMonat.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellKostenAssiMonat.Multiline = true; + this.cellKostenAssiMonat.Name = "cellKostenAssiMonat"; + this.cellKostenAssiMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellKostenAssiMonat.StylePriority.UseBorders = false; + this.cellKostenAssiMonat.StylePriority.UsePadding = false; + this.cellKostenAssiMonat.Weight = 0.20249221183800623D; + // + // cellKostenAssiJahr + // + this.cellKostenAssiJahr.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellKostenAssiJahr.Multiline = true; + this.cellKostenAssiJahr.Name = "cellKostenAssiJahr"; + this.cellKostenAssiJahr.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellKostenAssiJahr.StylePriority.UseBorders = false; + this.cellKostenAssiJahr.StylePriority.UseFont = false; + this.cellKostenAssiJahr.StylePriority.UsePadding = false; + this.cellKostenAssiJahr.Weight = 0.34190062050507453D; + // // GroupHeader3 // this.GroupHeader3.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrLabel2, this.xrTable1}); - this.GroupHeader3.HeightF = 106F; + this.GroupHeader3.HeightF = 91.99998F; this.GroupHeader3.Name = "GroupHeader3"; // - // xrLabel2 - // - this.xrLabel2.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; - this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 24F); - this.xrLabel2.Name = "xrLabel2"; - this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel2.SizeF = new System.Drawing.SizeF(642.0001F, 24F); - this.xrLabel2.StylePriority.UseBorders = false; - this.xrLabel2.StylePriority.UseFont = false; - this.xrLabel2.Text = "Fahrtkosten / Bef. "; - // // xrTable1 // - this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 47.99998F); + this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 33.99999F); this.xrTable1.Name = "xrTable1"; this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow2, @@ -595,9 +650,75 @@ namespace SHKServiceSBD.Reports this.xrTableCell19.Text = "Jährlich"; this.xrTableCell19.Weight = 0.18613738062968507D; // - // bindingSource1 + // xrTableRow6 // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.CustomerDataRO); + this.xrTableRow6.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell24, + this.cellKostenBefTag, + this.cellKostenBefWoche, + this.cellKostenBefMonat, + this.cellKostenBefJahr}); + this.xrTableRow6.Name = "xrTableRow6"; + this.xrTableRow6.Weight = 2.5D; + // + // xrTableCell24 + // + this.xrTableCell24.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell24.Multiline = true; + this.xrTableCell24.Name = "xrTableCell24"; + this.xrTableCell24.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.xrTableCell24.StylePriority.UseBorders = false; + this.xrTableCell24.StylePriority.UseFont = false; + this.xrTableCell24.StylePriority.UsePadding = false; + this.xrTableCell24.Text = "Kosten\r\nBeförderung"; + this.xrTableCell24.Weight = 0.25311495581891308D; + // + // cellKostenBefTag + // + this.cellKostenBefTag.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellKostenBefTag.Multiline = true; + this.cellKostenBefTag.Name = "cellKostenBefTag"; + this.cellKostenBefTag.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellKostenBefTag.StylePriority.UseBorders = false; + this.cellKostenBefTag.StylePriority.UseFont = false; + this.cellKostenBefTag.StylePriority.UsePadding = false; + this.cellKostenBefTag.Weight = 0.18691588785046726D; + // + // cellKostenBefWoche + // + this.cellKostenBefWoche.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellKostenBefWoche.Multiline = true; + this.cellKostenBefWoche.Name = "cellKostenBefWoche"; + this.cellKostenBefWoche.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellKostenBefWoche.StylePriority.UseBorders = false; + this.cellKostenBefWoche.StylePriority.UsePadding = false; + this.cellKostenBefWoche.Weight = 0.18691588785046726D; + // + // cellKostenBefMonat + // + this.cellKostenBefMonat.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellKostenBefMonat.Multiline = true; + this.cellKostenBefMonat.Name = "cellKostenBefMonat"; + this.cellKostenBefMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellKostenBefMonat.StylePriority.UseBorders = false; + this.cellKostenBefMonat.StylePriority.UseFont = false; + this.cellKostenBefMonat.StylePriority.UsePadding = false; + this.cellKostenBefMonat.Weight = 0.18691588785046728D; + // + // cellKostenBefJahr + // + this.cellKostenBefJahr.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.cellKostenBefJahr.Multiline = true; + this.cellKostenBefJahr.Name = "cellKostenBefJahr"; + this.cellKostenBefJahr.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); + this.cellKostenBefJahr.StylePriority.UseBorders = false; + this.cellKostenBefJahr.StylePriority.UseFont = false; + this.cellKostenBefJahr.StylePriority.UsePadding = false; + this.cellKostenBefJahr.Weight = 0.18613738062968507D; // // GroupHeader2 // @@ -683,133 +804,6 @@ namespace SHKServiceSBD.Reports this.xrTableCell13.StylePriority.UsePadding = false; this.xrTableCell13.Weight = 0.15498442367601245D; // - // xrTableRow5 - // - this.xrTableRow5.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.xrTableCell20, - this.xrTableCell21, - this.xrTableCell22, - this.xrTableCell23}); - this.xrTableRow5.Name = "xrTableRow5"; - this.xrTableRow5.Weight = 1.125D; - // - // xrTableCell20 - // - this.xrTableCell20.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell20.Multiline = true; - this.xrTableCell20.Name = "xrTableCell20"; - this.xrTableCell20.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell20.StylePriority.UseBorders = false; - this.xrTableCell20.StylePriority.UseFont = false; - this.xrTableCell20.StylePriority.UsePadding = false; - this.xrTableCell20.Text = "Schulassistenz"; - this.xrTableCell20.Weight = 0.253114955818913D; - // - // xrTableCell21 - // - this.xrTableCell21.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell21.Multiline = true; - this.xrTableCell21.Name = "xrTableCell21"; - this.xrTableCell21.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell21.StylePriority.UseBorders = false; - this.xrTableCell21.StylePriority.UseFont = false; - this.xrTableCell21.StylePriority.UsePadding = false; - this.xrTableCell21.Weight = 0.2024922118380062D; - // - // xrTableCell22 - // - this.xrTableCell22.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell22.Multiline = true; - this.xrTableCell22.Name = "xrTableCell22"; - this.xrTableCell22.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell22.StylePriority.UseBorders = false; - this.xrTableCell22.StylePriority.UsePadding = false; - this.xrTableCell22.Weight = 0.20249221183800623D; - // - // xrTableCell23 - // - this.xrTableCell23.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell23.Multiline = true; - this.xrTableCell23.Name = "xrTableCell23"; - this.xrTableCell23.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell23.StylePriority.UseBorders = false; - this.xrTableCell23.StylePriority.UseFont = false; - this.xrTableCell23.StylePriority.UsePadding = false; - this.xrTableCell23.Weight = 0.34190062050507453D; - // - // xrTableRow6 - // - this.xrTableRow6.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.xrTableCell24, - this.xrTableCell25, - this.xrTableCell26, - this.xrTableCell27, - this.xrTableCell28}); - this.xrTableRow6.Name = "xrTableRow6"; - this.xrTableRow6.Weight = 2.5D; - // - // xrTableCell24 - // - this.xrTableCell24.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell24.Multiline = true; - this.xrTableCell24.Name = "xrTableCell24"; - this.xrTableCell24.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell24.StylePriority.UseBorders = false; - this.xrTableCell24.StylePriority.UseFont = false; - this.xrTableCell24.StylePriority.UsePadding = false; - this.xrTableCell24.Text = "Kosten\r\nBeförderung"; - this.xrTableCell24.Weight = 0.25311495581891308D; - // - // xrTableCell25 - // - this.xrTableCell25.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell25.Multiline = true; - this.xrTableCell25.Name = "xrTableCell25"; - this.xrTableCell25.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell25.StylePriority.UseBorders = false; - this.xrTableCell25.StylePriority.UseFont = false; - this.xrTableCell25.StylePriority.UsePadding = false; - this.xrTableCell25.Weight = 0.18691588785046726D; - // - // xrTableCell26 - // - this.xrTableCell26.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell26.Multiline = true; - this.xrTableCell26.Name = "xrTableCell26"; - this.xrTableCell26.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell26.StylePriority.UseBorders = false; - this.xrTableCell26.StylePriority.UsePadding = false; - this.xrTableCell26.Weight = 0.18691588785046726D; - // - // xrTableCell27 - // - this.xrTableCell27.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell27.Multiline = true; - this.xrTableCell27.Name = "xrTableCell27"; - this.xrTableCell27.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell27.StylePriority.UseBorders = false; - this.xrTableCell27.StylePriority.UseFont = false; - this.xrTableCell27.StylePriority.UsePadding = false; - this.xrTableCell27.Weight = 0.18691588785046728D; - // - // xrTableCell28 - // - this.xrTableCell28.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTableCell28.Multiline = true; - this.xrTableCell28.Name = "xrTableCell28"; - this.xrTableCell28.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F); - this.xrTableCell28.StylePriority.UseBorders = false; - this.xrTableCell28.StylePriority.UseFont = false; - this.xrTableCell28.StylePriority.UsePadding = false; - this.xrTableCell28.Weight = 0.18613738062968507D; - // // GroupFooter1 // this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { @@ -821,6 +815,37 @@ namespace SHKServiceSBD.Reports this.xrLabel13}); this.GroupFooter1.Name = "GroupFooter1"; // + // lblAngebotGesamt + // + this.lblAngebotGesamt.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 70F); + this.lblAngebotGesamt.Name = "lblAngebotGesamt"; + this.lblAngebotGesamt.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblAngebotGesamt.SizeF = new System.Drawing.SizeF(78.33333F, 30F); + this.lblAngebotGesamt.StylePriority.UseFont = false; + this.lblAngebotGesamt.StylePriority.UseTextAlignment = false; + this.lblAngebotGesamt.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + // + // lblAngebotBefProMonat + // + this.lblAngebotBefProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 40F); + this.lblAngebotBefProMonat.Name = "lblAngebotBefProMonat"; + this.lblAngebotBefProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblAngebotBefProMonat.SizeF = new System.Drawing.SizeF(78.33333F, 30F); + this.lblAngebotBefProMonat.StylePriority.UseFont = false; + this.lblAngebotBefProMonat.StylePriority.UseTextAlignment = false; + this.lblAngebotBefProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + // + // lblAngebotAssProMonat + // + this.lblAngebotAssProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 10F); + this.lblAngebotAssProMonat.Name = "lblAngebotAssProMonat"; + this.lblAngebotAssProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblAngebotAssProMonat.SizeF = new System.Drawing.SizeF(78.33333F, 30F); + this.lblAngebotAssProMonat.StylePriority.UseFont = false; + this.lblAngebotAssProMonat.StylePriority.UseTextAlignment = false; + this.lblAngebotAssProMonat.Text = "9.000,00 €"; + this.lblAngebotAssProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + // // xrLabel8 // this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10F); @@ -848,35 +873,63 @@ namespace SHKServiceSBD.Reports this.xrLabel13.StylePriority.UseFont = false; this.xrLabel13.Text = "Gesamtbetrag:"; // - // lblAngebotAssProMonat + // xrLabel15 // - this.lblAngebotAssProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 10F); - this.lblAngebotAssProMonat.Name = "lblAngebotAssProMonat"; - this.lblAngebotAssProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.lblAngebotAssProMonat.SizeF = new System.Drawing.SizeF(68.33333F, 30F); - this.lblAngebotAssProMonat.StylePriority.UseFont = false; - this.lblAngebotAssProMonat.StylePriority.UseTextAlignment = false; - this.lblAngebotAssProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrLabel15.LocationFloat = new DevExpress.Utils.PointFloat(0F, 340F); + this.xrLabel15.Name = "xrLabel15"; + this.xrLabel15.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel15.SizeF = new System.Drawing.SizeF(155.41F, 30F); + this.xrLabel15.StylePriority.UseFont = false; + this.xrLabel15.Text = "Kilometer / Tag"; // - // lblAngebotBefProMonat + // lblKmProTag // - this.lblAngebotBefProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 40F); - this.lblAngebotBefProMonat.Name = "lblAngebotBefProMonat"; - this.lblAngebotBefProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.lblAngebotBefProMonat.SizeF = new System.Drawing.SizeF(68.33333F, 30F); - this.lblAngebotBefProMonat.StylePriority.UseFont = false; - this.lblAngebotBefProMonat.StylePriority.UseTextAlignment = false; - this.lblAngebotBefProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.lblKmProTag.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.lblKmProTag.LocationFloat = new DevExpress.Utils.PointFloat(155.41F, 340F); + this.lblKmProTag.Multiline = true; + this.lblKmProTag.Name = "lblKmProTag"; + this.lblKmProTag.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblKmProTag.SizeF = new System.Drawing.SizeF(181.4193F, 24F); + this.lblKmProTag.StylePriority.UseBorders = false; + this.lblKmProTag.StylePriority.UseFont = false; // - // lblAngebotGesamt + // xrLabel16 // - this.lblAngebotGesamt.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 70F); - this.lblAngebotGesamt.Name = "lblAngebotGesamt"; - this.lblAngebotGesamt.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.lblAngebotGesamt.SizeF = new System.Drawing.SizeF(68.33333F, 30F); - this.lblAngebotGesamt.StylePriority.UseFont = false; - this.lblAngebotGesamt.StylePriority.UseTextAlignment = false; - this.lblAngebotGesamt.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 370F); + this.xrLabel16.Name = "xrLabel16"; + this.xrLabel16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel16.SizeF = new System.Drawing.SizeF(155.41F, 30F); + this.xrLabel16.StylePriority.UseFont = false; + this.xrLabel16.Text = "€ / Kilometer"; + // + // lblEuroProKm + // + this.lblEuroProKm.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.lblEuroProKm.LocationFloat = new DevExpress.Utils.PointFloat(155.4102F, 370F); + this.lblEuroProKm.Multiline = true; + this.lblEuroProKm.Name = "lblEuroProKm"; + this.lblEuroProKm.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblEuroProKm.SizeF = new System.Drawing.SizeF(181.4193F, 24F); + this.lblEuroProKm.StylePriority.UseBorders = false; + this.lblEuroProKm.StylePriority.UseFont = false; + // + // xrLabel2 + // + this.xrLabel2.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; + this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10F); + this.xrLabel2.Name = "xrLabel2"; + this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel2.SizeF = new System.Drawing.SizeF(642.0001F, 24F); + this.xrLabel2.StylePriority.UseBorders = false; + this.xrLabel2.StylePriority.UseFont = false; + // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.CustomerDataRO); // // KalkulationReport // @@ -889,6 +942,8 @@ namespace SHKServiceSBD.Reports this.GroupHeader3, this.GroupHeader2, this.GroupFooter1}); + this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] { + this.bindingSource1}); this.DataSource = this.bindingSource1; this.Font = new DevExpress.Drawing.DXFont("Calibri", 11F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] { new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))}); @@ -897,11 +952,13 @@ namespace SHKServiceSBD.Reports this.PageWidth = 827; this.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4; this.Version = "23.2"; + xrWatermark1.Id = "Watermark1"; + this.Watermarks.Add(xrWatermark1); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tableBetreuungszeiten)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } @@ -939,7 +996,6 @@ namespace SHKServiceSBD.Reports private DevExpress.XtraReports.UI.XRTableCell xrTableCell6; private DevExpress.XtraReports.UI.XRTableCell xrTableCell7; private DevExpress.XtraReports.UI.XRTableCell xrTableCell8; - private DevExpress.XtraReports.UI.XRLabel xrLabel2; private DevExpress.XtraReports.UI.XRTable xrTable1; private DevExpress.XtraReports.UI.XRTableRow xrTableRow2; private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; @@ -964,15 +1020,15 @@ namespace SHKServiceSBD.Reports private DevExpress.XtraReports.UI.XRTableCell xrTableCell19; private DevExpress.XtraReports.UI.XRTableRow xrTableRow5; private DevExpress.XtraReports.UI.XRTableCell xrTableCell20; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell21; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell22; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell23; + private DevExpress.XtraReports.UI.XRTableCell cellKostenAssiWoche; + private DevExpress.XtraReports.UI.XRTableCell cellKostenAssiMonat; + private DevExpress.XtraReports.UI.XRTableCell cellKostenAssiJahr; private DevExpress.XtraReports.UI.XRTableRow xrTableRow6; private DevExpress.XtraReports.UI.XRTableCell xrTableCell24; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell25; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell26; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell27; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell28; + private DevExpress.XtraReports.UI.XRTableCell cellKostenBefTag; + private DevExpress.XtraReports.UI.XRTableCell cellKostenBefWoche; + private DevExpress.XtraReports.UI.XRTableCell cellKostenBefMonat; + private DevExpress.XtraReports.UI.XRTableCell cellKostenBefJahr; private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1; private DevExpress.XtraReports.UI.XRLabel lblAngebotGesamt; private DevExpress.XtraReports.UI.XRLabel lblAngebotBefProMonat; @@ -980,5 +1036,10 @@ namespace SHKServiceSBD.Reports private DevExpress.XtraReports.UI.XRLabel xrLabel8; private DevExpress.XtraReports.UI.XRLabel xrLabel12; private DevExpress.XtraReports.UI.XRLabel xrLabel13; + private DevExpress.XtraReports.UI.XRLabel xrLabel16; + private DevExpress.XtraReports.UI.XRLabel lblEuroProKm; + private DevExpress.XtraReports.UI.XRLabel xrLabel15; + private DevExpress.XtraReports.UI.XRLabel lblKmProTag; + private DevExpress.XtraReports.UI.XRLabel xrLabel2; } } diff --git a/ReportImp/SHKServiceSBD/Reports/KalkulationReport.cs b/ReportImp/SHKServiceSBD/Reports/KalkulationReport.cs index 65dfd7d1f..7b33c2464 100644 --- a/ReportImp/SHKServiceSBD/Reports/KalkulationReport.cs +++ b/ReportImp/SHKServiceSBD/Reports/KalkulationReport.cs @@ -11,6 +11,8 @@ using BeWo.Report; using BeWo.Service.ServiceImplementations; using BeWo.Service.DCEntityMapper; using BS.Shared.Core; +using System.Linq; +using BS.Shared; namespace SHKServiceSBD.Reports { @@ -28,13 +30,16 @@ namespace SHKServiceSBD.Reports DateTime monat = DateTime.Now; + decimal euroKm = GetPreis("Kilometerpauschale", DateTime.Now); + CostBearer2SupportConcept c2s = GetC2S(pRO); if (c2s != null) { - - Customer c = c2s.SupportConcept.Customer; - + decimal km = GetKilometer(pRO); + Customer c = c2s.SupportConcept.Customer; + + //foreach (var sc in c.SupportConcepts) //{ @@ -49,29 +54,67 @@ namespace SHKServiceSBD.Reports //} + decimal euroProStunde = 0; + var stunden = CreateArbeitszeitenTableAndCalculateStunden(c.Arbeitszeiten); lblKlient.Text = String.Format("{0}, geb. {1:dd.MM.yyyy}", c.Person.FirstNameLastName, c.Person.DateOfBirth); lblStundenProWoche.Text = String.Format("{0:0.00}", stunden); lblDurchschnittStundenProTag.Text = String.Format("{0:0.00}", stunden / 5); lblWochenProJahr.Text = "52"; lblMonateProJahr.Text = "12"; + lblKmProTag.Text = String.Format("{0:0.00}", km); + lblEuroProKm.Text = String.Format("{0:c}", euroKm); var crlist = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(c2s.CostBearer.CostRatePeriods); var crp = crlist.GetCostRatePeriodForDate(BS.Shared.CostRatePeriodType.HourlyRate, monat); if (crp != null && crp.CostRateValue.HasValue) { + euroProStunde = crp.CostRateValue.Value; lblEuroProStunde.Text = String.Format("{0:c}", crp.CostRateValue); } + decimal wochen = 365 / 7; // Schaltjahre beachten? + + cellKostenBefTag.Text = String.Format("{0:c}", euroKm * km); + cellKostenBefWoche.Text = String.Format("{0:c}", euroKm * km * 5); + cellKostenBefMonat.Text = String.Format("{0:c}", euroKm * km * 5 * (wochen / 12)); + cellKostenBefJahr.Text = String.Format("{0:c}", euroKm * km * 5 * wochen); + + + cellKostenAssiWoche.Text = String.Format("{0:c}", stunden * euroProStunde); + cellKostenAssiMonat.Text = String.Format("{0:c}", stunden * euroProStunde * (wochen / 12)); + cellKostenAssiJahr.Text = String.Format("{0:c}", stunden * euroProStunde * wochen); //Organisation schule = GetSchule(c); + lblAngebotAssProMonat.Text = String.Format("{0:c}", stunden * euroProStunde * (wochen / 12)); + lblAngebotBefProMonat.Text = String.Format("{0:c}", euroKm * km * 5 * (wochen / 12)); + lblAngebotGesamt.Text = String.Format("{0:c}", (stunden * euroProStunde * (wochen / 12)) + (euroKm * km * 5 * (wochen / 12))); } this.bindingSource1.DataSource = pRO; } + public virtual decimal GetPreis(String preisBezeichnung, DateTime datum) + { + + var preise = DAOFactory.GenericDAO.GetAllActive(); + + var preis = preise.Where(p => p.Name.Contains(preisBezeichnung)).FirstOrDefault(); + if (preis != null) + { + var crlist = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(preis.CostRatePeriods); + + var cr = crlist.GetCostRatePeriodForDate(CostRatePeriodType.AmountOfMoney, datum); + if (cr != null && cr.CostRateValue.HasValue) + { + return cr.CostRateValue.Value; + } + } + + return 0; + } private CostBearer2SupportConcept GetC2S(QueryRO ro) { @@ -90,6 +133,23 @@ namespace SHKServiceSBD.Reports return null; } + private decimal GetKilometer(QueryRO ro) + { + + if (ro.Rows != null && ro.Rows.Count > 0) + { + if (ro.Rows[0].Field2 != null) + { + if (Decimal.TryParse(ro.Rows[0].Field2.ToString(), out var d)) + { + return d; + } + } + } + + return 0; + } + private Customer GetCustomer(QueryRO ro) {