From 1b4595dbf918db41ba1b2deefd9968b3af6e159a Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 13 Sep 2023 01:39:27 +0200 Subject: [PATCH] CustomerListReport --- BeWo/ServiceProxy/Generated.cs | 72 ++++ BeWo/View/Controls/DPCtrlDay.cs | 2 +- .../Navigation/CustomerNavigationView.xaml | 1 + .../Navigation/CustomerNavigationView.xaml.cs | 13 + BeWo/View/Navigation/MainNavigationView.xaml | 3 + .../Navigation/MainNavigationView.xaml.cs | 9 + Report/AbstractReportCreator.cs | 4 +- Report/DefaultReportCreator.cs | 9 + .../CustomerListReport.Designer.cs | 335 ++++++++++++++++++ Report/DefaultReports/CustomerListReport.cs | 23 ++ Report/DefaultReports/CustomerListReport.resx | 123 +++++++ .../QueryListReport.Designer.cs | 1 + Report/Report.csproj | 11 + Report/ReportObjects/CustomerListRO.cs | 35 ++ ...CustomMitarbeiterstundenkontoBerechnung.cs | 4 +- .../AkggMid/Mitarbeiterarbeitszeitkonto.cs | 105 ++++-- .../ServiceContracts/IReportService.cs | 33 ++ .../ReportServiceImp.cs | 44 +++ 18 files changed, 804 insertions(+), 23 deletions(-) create mode 100644 Report/DefaultReports/CustomerListReport.Designer.cs create mode 100644 Report/DefaultReports/CustomerListReport.cs create mode 100644 Report/DefaultReports/CustomerListReport.resx create mode 100644 Report/ReportObjects/CustomerListRO.cs diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index 10109f040..d3e6b4812 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -9031,6 +9031,38 @@ namespace BeWo.ServiceProxy [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateInvoiceListReport", ReplyAction="http://tempuri.org/IReportService/CreateInvoiceListReportResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateInvoiceListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] System.IO.MemoryStream CreateInvoiceListReport(System.Collections.Generic.List invoiceBaseOids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateCustomerListReport", ReplyAction="http://tempuri.org/IReportService/CreateCustomerListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateCustomerListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreateCustomerListReport(System.Collections.Generic.List oids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateSupportConceptListReport", ReplyAction="http://tempuri.org/IReportService/CreateSupportConceptListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateSupportConceptListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreateSupportConceptListReport(System.Collections.Generic.List oids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreatePersonListReport", ReplyAction="http://tempuri.org/IReportService/CreatePersonListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreatePersonListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreatePersonListReport(System.Collections.Generic.List oids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateEmployeeListReport", ReplyAction="http://tempuri.org/IReportService/CreateEmployeeListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateEmployeeListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreateEmployeeListReport(System.Collections.Generic.List oids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateOrganisationListReport", ReplyAction="http://tempuri.org/IReportService/CreateOrganisationListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateOrganisationListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreateOrganisationListReport(System.Collections.Generic.List oids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateTeamListReport", ReplyAction="http://tempuri.org/IReportService/CreateTeamListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateTeamListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreateTeamListReport(System.Collections.Generic.List oids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateUserListReport", ReplyAction="http://tempuri.org/IReportService/CreateUserListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateUserListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreateUserListReport(System.Collections.Generic.List oids); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IReportService/CreateUSerGroupListReport", ReplyAction="http://tempuri.org/IReportService/CreateUSerGroupListReportResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IReportService/CreateUSerGroupListReportBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.IO.MemoryStream CreateUSerGroupListReport(System.Collections.Generic.List oids); } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] @@ -9151,6 +9183,46 @@ namespace BeWo.ServiceProxy { return base.Channel.CreateInvoiceListReport(invoiceBaseOids); } + + public System.IO.MemoryStream CreateCustomerListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreateCustomerListReport(oids); + } + + public System.IO.MemoryStream CreateSupportConceptListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreateSupportConceptListReport(oids); + } + + public System.IO.MemoryStream CreatePersonListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreatePersonListReport(oids); + } + + public System.IO.MemoryStream CreateEmployeeListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreateEmployeeListReport(oids); + } + + public System.IO.MemoryStream CreateOrganisationListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreateOrganisationListReport(oids); + } + + public System.IO.MemoryStream CreateTeamListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreateTeamListReport(oids); + } + + public System.IO.MemoryStream CreateUserListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreateUserListReport(oids); + } + + public System.IO.MemoryStream CreateUSerGroupListReport(System.Collections.Generic.List oids) + { + return base.Channel.CreateUSerGroupListReport(oids); + } } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] diff --git a/BeWo/View/Controls/DPCtrlDay.cs b/BeWo/View/Controls/DPCtrlDay.cs index 97f7e33e2..b99b930f1 100644 --- a/BeWo/View/Controls/DPCtrlDay.cs +++ b/BeWo/View/Controls/DPCtrlDay.cs @@ -84,7 +84,7 @@ namespace BeWo.View.Controls c.Foreground = Brushes.Red; c.Text = "ÜS"; c.ToolTip = (dc == null) ? string.Format("Überstunden:\t{0:0.00}\nAuszahlung:\t{1}\nBemerkung:\t{2}", - info.OverTime.Betrag, info.OverTime.Auszahlungsart.Name, info.OverTime.Notice) : null; + info.OverTime.Betrag, info.OverTime.Auszahlungsart?.Name, info.OverTime.Notice) : null; if (info.DayOfWeek == DayOfWeek.Saturday || info.DayOfWeek == DayOfWeek.Sunday) c.Background = new SolidColorBrush(ColorExtensions.FromHexString("EFEFEF")); diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml b/BeWo/View/Navigation/CustomerNavigationView.xaml index e147197ec..c35972a2e 100644 --- a/BeWo/View/Navigation/CustomerNavigationView.xaml +++ b/BeWo/View/Navigation/CustomerNavigationView.xaml @@ -168,6 +168,7 @@ DeleteObject="mainNavigationView_DeleteObject" ArchiveObject="mainNavigationView_ArchiveObject" ExcelExport="mainNavigationView_ExcelExport" + Print="mainNavigationView_Print" DeleteDemands="DeleteAll, CustomerView_Delete" CreateDemands="CreateAll, CustomerView_Create" ShowDetailsPanel="True" diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs index ce5e8d3b1..d9a41ad80 100644 --- a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs +++ b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs @@ -454,5 +454,18 @@ namespace BeWo.View.Navigation }); }); } + + private void mainNavigationView_Print(object sender, EventArgs> e) + { + var oids = e.Data.Cast().Select(c => c.CustomerOid).ToList(); + + ServiceFacade.DoReportServiceAsync(s => s.CreateCustomerListReport(oids), r => + { + this.Dispatch(() => + { + BeWoUtils.ShowReportWindow(r, Translator.Translate("Klienten")); + }); + }); + } } } \ No newline at end of file diff --git a/BeWo/View/Navigation/MainNavigationView.xaml b/BeWo/View/Navigation/MainNavigationView.xaml index 7a125f7b1..3d6524b11 100644 --- a/BeWo/View/Navigation/MainNavigationView.xaml +++ b/BeWo/View/Navigation/MainNavigationView.xaml @@ -105,6 +105,9 @@ Excel Export + + Liste drucken + diff --git a/BeWo/View/Navigation/MainNavigationView.xaml.cs b/BeWo/View/Navigation/MainNavigationView.xaml.cs index d343722c2..94323a6fc 100644 --- a/BeWo/View/Navigation/MainNavigationView.xaml.cs +++ b/BeWo/View/Navigation/MainNavigationView.xaml.cs @@ -108,6 +108,8 @@ namespace BeWo.View.Navigation public event EventHandler>> ExcelExport; + public event EventHandler>> Print; + public event OpenObjectDelegate OpenObject; public event ReloadDataDelegate OnReloadData; @@ -610,6 +612,13 @@ namespace BeWo.View.Navigation ExcelExport(this, new EventArgs>(objectListBox.ItemsSource as IEnumerable)); } + private void linkPrint_RequestNavigate(object sender, RequestNavigateEventArgs e) + { + if (Print != null) + Print(this, new EventArgs>(objectListBox.ItemsSource as IEnumerable)); + e.Handled = true; + } + private void objectHistoryListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { OnOpenObject(); diff --git a/Report/AbstractReportCreator.cs b/Report/AbstractReportCreator.cs index e3aa0abf5..f6f50cae5 100644 --- a/Report/AbstractReportCreator.cs +++ b/Report/AbstractReportCreator.cs @@ -104,5 +104,7 @@ namespace BeWo.Report public abstract XtraReport CreateVertretungsPlanungReport(DateTime start, int ansicht); public abstract XtraReport CreateValidationMessageListReport(DateTime startDate, DateTime endDate); - } + + public abstract XtraReport CreateCustomerListReport(List oids); + } } \ No newline at end of file diff --git a/Report/DefaultReportCreator.cs b/Report/DefaultReportCreator.cs index dacf44122..9435453ab 100644 --- a/Report/DefaultReportCreator.cs +++ b/Report/DefaultReportCreator.cs @@ -1193,6 +1193,15 @@ namespace BeWo.Report report.SetReportDataSource(ValidationMessageListRO.Create(startDate, endDate, DAOFactory.SearchDAO.GetValidationMessagesForMonth(startDate, endDate).ToList())); + return report as XtraReport; + } + + public override XtraReport CreateCustomerListReport(List oids) + { + var ro = CustomerListRO.Create(oids); + IBeWoReport report = FindReportImp(); + report.SetReportDataSource(ro); + return report as XtraReport; } } diff --git a/Report/DefaultReports/CustomerListReport.Designer.cs b/Report/DefaultReports/CustomerListReport.Designer.cs new file mode 100644 index 000000000..5e7120e46 --- /dev/null +++ b/Report/DefaultReports/CustomerListReport.Designer.cs @@ -0,0 +1,335 @@ +namespace BeWo.Report.DefaultReports +{ + partial class CustomerListReport + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.Detail = new DevExpress.XtraReports.UI.DetailBand(); + this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); + this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell(); + this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand(); + this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); + this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand(); + this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand(); + this.Detail1 = new DevExpress.XtraReports.UI.DetailBand(); + this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); + this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); + this.Einzahlungstextsichtbarkeitsformatierungsregel = new DevExpress.XtraReports.UI.FormattingRule(); + this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); + this.Auszahlungstextsichtbarkeitsformatierungsregel = new DevExpress.XtraReports.UI.FormattingRule(); + this.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); + this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + // + // Detail + // + this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable1}); + this.Detail.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Detail.HeightF = 25F; + this.Detail.Name = "Detail"; + this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); + this.Detail.StylePriority.UseFont = false; + this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + // + // xrTable1 + // + this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrTable1.Name = "xrTable1"; + this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.xrTableRow1}); + this.xrTable1.SizeF = new System.Drawing.SizeF(700F, 25F); + this.xrTable1.StylePriority.UseFont = false; + // + // xrTableRow1 + // + this.xrTableRow1.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top))); + this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell9, + this.xrTableCell1, + this.xrTableCell2, + this.xrTableCell7}); + this.xrTableRow1.Name = "xrTableRow1"; + this.xrTableRow1.StylePriority.UseBorders = false; + this.xrTableRow1.Weight = 0.59999992675782143D; + // + // xrTableCell9 + // + this.xrTableCell9.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell9.Name = "xrTableCell9"; + this.xrTableCell9.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F); + this.xrTableCell9.StylePriority.UseBorders = false; + this.xrTableCell9.StylePriority.UsePadding = false; + this.xrTableCell9.StylePriority.UseTextAlignment = false; + this.xrTableCell9.Text = "Nachname"; + this.xrTableCell9.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.xrTableCell9.Weight = 0.69230768057016234D; + // + // xrTableCell1 + // + this.xrTableCell1.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell1.Name = "xrTableCell1"; + this.xrTableCell1.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F); + this.xrTableCell1.StylePriority.UseBorders = false; + this.xrTableCell1.StylePriority.UsePadding = false; + this.xrTableCell1.StylePriority.UseTextAlignment = false; + this.xrTableCell1.Text = "Vorname"; + this.xrTableCell1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.xrTableCell1.Weight = 0.69230768057016223D; + // + // xrTableCell2 + // + this.xrTableCell2.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell2.Name = "xrTableCell2"; + this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F); + this.xrTableCell2.StylePriority.UseBorders = false; + this.xrTableCell2.StylePriority.UsePadding = false; + this.xrTableCell2.StylePriority.UseTextAlignment = false; + this.xrTableCell2.Text = "Rolle"; + this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.xrTableCell2.Weight = 0.69230769817645732D; + // + // xrTableCell7 + // + this.xrTableCell7.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell7.Name = "xrTableCell7"; + this.xrTableCell7.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F); + this.xrTableCell7.StylePriority.UseBorders = false; + this.xrTableCell7.StylePriority.UsePadding = false; + this.xrTableCell7.StylePriority.UseTextAlignment = false; + this.xrTableCell7.Text = "Notiz"; + this.xrTableCell7.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.xrTableCell7.Weight = 1.1538461714524488D; + // + // TopMargin + // + this.TopMargin.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.TopMargin.HeightF = 100F; + this.TopMargin.Name = "TopMargin"; + this.TopMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); + this.TopMargin.StylePriority.UseFont = false; + this.TopMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + // + // xrLabel1 + // + this.xrLabel1.Font = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrLabel1.Name = "xrLabel1"; + this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel1.SizeF = new System.Drawing.SizeF(650F, 37.33331F); + this.xrLabel1.StylePriority.UseFont = false; + this.xrLabel1.Text = "[Employee.FirstName] [Employee.LastName]"; + // + // BottomMargin + // + this.BottomMargin.HeightF = 74F; + this.BottomMargin.Name = "BottomMargin"; + this.BottomMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); + this.BottomMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + // + // DetailReport + // + this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { + this.Detail1}); + this.DetailReport.DataMember = "CustomerList"; + this.DetailReport.DataSource = this.bindingSource1; + this.DetailReport.Level = 0; + this.DetailReport.Name = "DetailReport"; + // + // Detail1 + // + this.Detail1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable2}); + this.Detail1.HeightF = 25F; + this.Detail1.Name = "Detail1"; + // + // xrTable2 + // + this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrTable2.Name = "xrTable2"; + this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.xrTableRow2}); + this.xrTable2.SizeF = new System.Drawing.SizeF(700F, 25F); + this.xrTable2.StylePriority.UseBorders = false; + this.xrTable2.StylePriority.UseFont = false; + // + // xrTableRow2 + // + this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell10, + this.xrTableCell4, + this.xrTableCell5, + this.xrTableCell8}); + this.xrTableRow2.Name = "xrTableRow2"; + this.xrTableRow2.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 3, 0, 100F); + this.xrTableRow2.StylePriority.UsePadding = false; + this.xrTableRow2.Weight = 1D; + // + // xrTableCell10 + // + this.xrTableCell10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerList.Customer.LastName", "{0:dd.MM.yyyy}")}); + this.xrTableCell10.Name = "xrTableCell10"; + this.xrTableCell10.StylePriority.UsePadding = false; + this.xrTableCell10.StylePriority.UseTextAlignment = false; + this.xrTableCell10.Text = "xrTableCell10"; + this.xrTableCell10.Weight = 0.69230768057016234D; + // + // xrTableCell4 + // + this.xrTableCell4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerList.Customer.FirstName", "{0:c}")}); + this.xrTableCell4.FormattingRules.Add(this.Einzahlungstextsichtbarkeitsformatierungsregel); + this.xrTableCell4.Name = "xrTableCell4"; + this.xrTableCell4.StylePriority.UsePadding = false; + this.xrTableCell4.StylePriority.UseTextAlignment = false; + this.xrTableCell4.Text = "xrTableCell4"; + this.xrTableCell4.Weight = 0.69230768057016223D; + // + // Einzahlungstextsichtbarkeitsformatierungsregel + // + this.Einzahlungstextsichtbarkeitsformatierungsregel.Condition = "[Einzahlung] == 0"; + this.Einzahlungstextsichtbarkeitsformatierungsregel.DataMember = "Transaktionen"; + this.Einzahlungstextsichtbarkeitsformatierungsregel.Formatting.ForeColor = System.Drawing.Color.Transparent; + this.Einzahlungstextsichtbarkeitsformatierungsregel.Name = "Einzahlungstextsichtbarkeitsformatierungsregel"; + // + // xrTableCell5 + // + this.xrTableCell5.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerList.Rolle", "{0:c}")}); + this.xrTableCell5.FormattingRules.Add(this.Auszahlungstextsichtbarkeitsformatierungsregel); + this.xrTableCell5.Name = "xrTableCell5"; + this.xrTableCell5.StylePriority.UsePadding = false; + this.xrTableCell5.StylePriority.UseTextAlignment = false; + this.xrTableCell5.Text = "xrTableCell5"; + this.xrTableCell5.Weight = 0.69230769817645732D; + // + // Auszahlungstextsichtbarkeitsformatierungsregel + // + this.Auszahlungstextsichtbarkeitsformatierungsregel.Condition = "[Auszahlung] == 0"; + this.Auszahlungstextsichtbarkeitsformatierungsregel.DataMember = "Transaktionen"; + this.Auszahlungstextsichtbarkeitsformatierungsregel.Formatting.ForeColor = System.Drawing.Color.Transparent; + this.Auszahlungstextsichtbarkeitsformatierungsregel.Name = "Auszahlungstextsichtbarkeitsformatierungsregel"; + // + // xrTableCell8 + // + this.xrTableCell8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerList.Notiz")}); + this.xrTableCell8.Multiline = true; + this.xrTableCell8.Name = "xrTableCell8"; + this.xrTableCell8.StylePriority.UsePadding = false; + this.xrTableCell8.StylePriority.UseTextAlignment = false; + this.xrTableCell8.Weight = 1.1538461714524493D; + // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.CustomerListRO); + // + // xrLabel2 + // + this.xrLabel2.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 37.33332F); + this.xrLabel2.Name = "xrLabel2"; + this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel2.SizeF = new System.Drawing.SizeF(650F, 25.66666F); + this.xrLabel2.StylePriority.UseFont = false; + this.xrLabel2.Text = "Zugeordnete Klient:innen"; + // + // GroupHeader1 + // + this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel2, + this.xrLabel1}); + this.GroupHeader1.HeightF = 70F; + this.GroupHeader1.Name = "GroupHeader1"; + // + // EmployeeCustomerListReport + // + this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { + this.Detail, + this.TopMargin, + this.BottomMargin, + this.DetailReport, + this.GroupHeader1}); + this.DataSource = this.bindingSource1; + this.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormattingRuleSheet.AddRange(new DevExpress.XtraReports.UI.FormattingRule[] { + this.Einzahlungstextsichtbarkeitsformatierungsregel, + this.Auszahlungstextsichtbarkeitsformatierungsregel}); + this.Margins = new System.Drawing.Printing.Margins(75, 75, 100, 74); + this.Version = "17.1"; + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + + } + + #endregion + + private DevExpress.XtraReports.UI.DetailBand Detail; + private DevExpress.XtraReports.UI.TopMarginBand TopMargin; + private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin; + private DevExpress.XtraReports.UI.DetailReportBand DetailReport; + private DevExpress.XtraReports.UI.DetailBand Detail1; + private System.Windows.Forms.BindingSource bindingSource1; + private DevExpress.XtraReports.UI.XRTable xrTable1; + private DevExpress.XtraReports.UI.XRTableRow xrTableRow1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; + private DevExpress.XtraReports.UI.XRTable xrTable2; + private DevExpress.XtraReports.UI.XRTableRow xrTableRow2; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell4; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell5; + private DevExpress.XtraReports.UI.XRLabel xrLabel1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell9; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell10; + private DevExpress.XtraReports.UI.FormattingRule Einzahlungstextsichtbarkeitsformatierungsregel; + private DevExpress.XtraReports.UI.FormattingRule Auszahlungstextsichtbarkeitsformatierungsregel; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell7; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell8; + private DevExpress.XtraReports.UI.XRLabel xrLabel2; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1; + } +} diff --git a/Report/DefaultReports/CustomerListReport.cs b/Report/DefaultReports/CustomerListReport.cs new file mode 100644 index 000000000..6498c8d49 --- /dev/null +++ b/Report/DefaultReports/CustomerListReport.cs @@ -0,0 +1,23 @@ +using System.Linq; +using BeWo.Report.ReportObjects; + +namespace BeWo.Report.DefaultReports +{ + public partial class CustomerListReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport + { + public CustomerListReport() + { + InitializeComponent(); + } + + public void SetReportDataSource(CustomerListRO pRO) + { + //if (pRO.Transaktionen != null) + //{ + // pRO.Transaktionen = pRO.Transaktionen.OrderBy(o => o.Belegdatum).ToList(); + //} + + bindingSource1.DataSource = pRO; + } + } +} diff --git a/Report/DefaultReports/CustomerListReport.resx b/Report/DefaultReports/CustomerListReport.resx new file mode 100644 index 000000000..76cdda25e --- /dev/null +++ b/Report/DefaultReports/CustomerListReport.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Report/DefaultReports/QueryListReport.Designer.cs b/Report/DefaultReports/QueryListReport.Designer.cs index 68842ee62..eda799c04 100644 --- a/Report/DefaultReports/QueryListReport.Designer.cs +++ b/Report/DefaultReports/QueryListReport.Designer.cs @@ -148,6 +148,7 @@ namespace BeWo.Report.DefaultReports // xrTableCell5 // this.xrTableCell5.Name = "xrTableCell5"; + this.xrTableCell5.Text = " "; this.xrTableCell5.Weight = 1D; // // bindingSource1 diff --git a/Report/Report.csproj b/Report/Report.csproj index 30a1e71b3..fd68b2e09 100644 --- a/Report/Report.csproj +++ b/Report/Report.csproj @@ -136,6 +136,12 @@ BudgetnachweisAnhang.cs + + Component + + + CustomerListReport.cs + Component @@ -431,6 +437,7 @@ + @@ -489,6 +496,10 @@ BudgetnachweisAnhang.cs Designer + + CustomerListReport.cs + Designer + RatingReport.cs Designer diff --git a/Report/ReportObjects/CustomerListRO.cs b/Report/ReportObjects/CustomerListRO.cs new file mode 100644 index 000000000..52b33d3a6 --- /dev/null +++ b/Report/ReportObjects/CustomerListRO.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Service.DCEntityMapper; +using BS.Shared.Core; +using BS.Shared.DataContracts.Compact; + +namespace BeWo.Report.ReportObjects +{ + public class CustomerListRO : AbstractBeWoReportObject + { + public List CustomerList { get; set; } + + public static CustomerListRO Create(List oids) + { + var ro = new CustomerListRO(); + ro.CustomerList = new List(); + + var customers = DAOFactory.GenericDAO.LoadByIDs(oids); + var dclist = MapperFactory.CustomerDC_Customer.MapToNewDCs(customers); + + foreach (var item in dclist) + { + var customerRO = CustomerDataRO.Create(item); + ro.CustomerList.Add(customerRO); + } + return ro; + } + + + } + +} diff --git a/ReportImp/AkggMid/CustomMitarbeiterstundenkontoBerechnung.cs b/ReportImp/AkggMid/CustomMitarbeiterstundenkontoBerechnung.cs index 871f39922..c45707ea5 100644 --- a/ReportImp/AkggMid/CustomMitarbeiterstundenkontoBerechnung.cs +++ b/ReportImp/AkggMid/CustomMitarbeiterstundenkontoBerechnung.cs @@ -111,6 +111,7 @@ namespace AkggMid { return true; } + public override MitarbeiterstundenkontoRO.DayDetail CreateDayDetail(DateTime date, MitarbeiterstundenkontoRO.EmployeeDetail ed) { var dd = base.CreateDayDetail(date, ed); @@ -122,7 +123,8 @@ namespace AkggMid return dd; } - public override MitarbeiterstundenkontoRO.EmployeeDetail BerechneUeberstundenBis(MitarbeiterstundenkontoRO.EmployeeDetail edOrig, IList records, DateTime monat, out decimal? ueberstunden, out decimal alteExtraUeberstunden) + + public override MitarbeiterstundenkontoRO.EmployeeDetail BerechneUeberstundenBis(MitarbeiterstundenkontoRO.EmployeeDetail edOrig, IList records, DateTime monat, out decimal? ueberstunden, out decimal alteExtraUeberstunden) { DateTime stichTag = new DateTime(2023, 9, 1); diff --git a/ReportImp/AkggMid/Mitarbeiterarbeitszeitkonto.cs b/ReportImp/AkggMid/Mitarbeiterarbeitszeitkonto.cs index 1e9050ef9..32ff91df5 100644 --- a/ReportImp/AkggMid/Mitarbeiterarbeitszeitkonto.cs +++ b/ReportImp/AkggMid/Mitarbeiterarbeitszeitkonto.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using BeWo.Data.Entities; using BeWo.Report; using BeWo.Report.ReportObjects; @@ -21,10 +22,14 @@ namespace AkggMid { var msb = new CustomMitarbeiterstundenkontoBerechnung(); msb.CreateReport(pRO); - + foreach (var ed in pRO.EmployeeDetailList) { - var c = ed.Employee.GetValidContractForDate(pRO.ReportStartDate); + var c = ed.Employee.GetValidContractForDate(pRO.ReportEndDate); + if (c == null) + { + c = ed.Employee.GetValidContractForDate(pRO.ReportStartDate); + } if (c != null) { if (c.MonthlyTotalHours.HasValue) @@ -42,46 +47,106 @@ namespace AkggMid // Alles in Custom6 / 7 / 8 / 9 schreiben foreach (var empDetail in pRO.EmployeeDetailList) { + var newDayList = new List(); + foreach (var day in empDetail.Days) { + + if (day.AbsenceTimes != null && day.AbsenceTimes.Count > 0) + { + var hours = day.HoursSick + day.HoursInVacation; + + empDetail.StundenGesamtIst += hours; + } + + if (day.ServiceRecords != null && day.ServiceRecords.Count > 0) + { + foreach (var sr in day.ServiceRecords) + { + var dd = new MitarbeiterstundenkontoRO.DayDetail(); + dd.Date = day.Date; + dd.ServiceRecords = new List(); + dd.ServiceRecords.Add(sr); + newDayList.Add(dd); + } + } + else + { + newDayList.Add(day); + } + + + } + empDetail.Days = newDayList; + foreach (var day in empDetail.Days) + { + string custom6 = ""; string custom7 = ""; string custom8 = ""; string custom9 = ""; if (day.AbsenceTimes != null && day.AbsenceTimes.Count > 0) - { + { var hours = day.HoursSick + day.HoursInVacation; - custom7 = day.AbsenceTimes[0].AbsenceReason.Description + "\n"; - custom9 += string.Format("{0:0.00}\n", hours); - empDetail.StundenGesamtIst += hours; + custom7 = day.AbsenceTimes[0].AbsenceReason.Description; + custom9 += string.Format("{0:0.00}", hours); } - if (day.ServiceRecords != null) - { - if (day.IstFeiertag) + if (day.IstFeiertag) + { + custom6 = "keine*r"; + + if (custom7.Length > 0) { - custom6 += "keine*r\n"; - custom7 += day.Feiertag.Name + "\n"; - custom8 += "-\n"; - } - + custom7 += "\n"; + } + custom7 += day.Feiertag.Name; + custom8 = "-"; + } + if (day.ServiceRecords != null && day.ServiceRecords.Count > 0) + { foreach (var sr in day.ServiceRecords) { + if (custom7.Length > 0) + { + custom7 += "\n"; + } custom7 += sr.ServiceDescription.ServiceCategory.Name + "\n"; + + if (custom8.Length > 0) + { + custom8 += "\n"; + } custom8 += sr.ServiceDescription.Name + "\n"; if (sr.Group != null && sr.GroupRoundedDuration.HasValue && sr.GroupPersonCount.HasValue && sr.GroupPersonCount.Value > 1) - { - foreach (var gsr in sr.Group.ServiceRecordList) - { + { + foreach (var gsr in sr.Group.ServiceRecordList) + { + if (custom6.Length > 0) + { + custom6 += "\n"; + } custom6 += gsr.SupportConcept != null ? gsr.SupportConcept.Customer.Person.FirstNameLastName + "\n" : ""; } - + if (custom9.Length > 0) + { + custom9 += "\n"; + } custom9 += string.Format("{0:0.00}\n", sr.GroupRoundedDuration / 60); } else - { + { + if (custom6.Length > 0) + { + custom6 += "\n"; + } custom6 += sr.SupportConcept != null ? sr.SupportConcept.Customer.Person.FirstNameLastName + "\n" : "keine*r\n"; + + if (custom9.Length > 0) + { + custom9 += "\n"; + } custom9 += string.Format("{0:0.00}\n", sr.RoundedDuration / 60); } } @@ -92,7 +157,7 @@ namespace AkggMid day.Custom8 = custom8; day.Custom9 = custom9; } - } + } this.bindingSource1.DataSource = pRO; } diff --git a/ReportService/ServiceContracts/IReportService.cs b/ReportService/ServiceContracts/IReportService.cs index 0d3d97ced..bbe1b3845 100644 --- a/ReportService/ServiceContracts/IReportService.cs +++ b/ReportService/ServiceContracts/IReportService.cs @@ -82,5 +82,38 @@ namespace ReportingService.ServiceContracts [FaultContract(typeof(BeWoFault))] [OperationContract] MemoryStream CreateInvoiceListReport(List invoiceBaseOids); + + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreateCustomerListReport(List oids); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreateSupportConceptListReport(List oids); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreatePersonListReport(List oids); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreateEmployeeListReport(List oids); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreateOrganisationListReport(List oids); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreateTeamListReport(List oids); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreateUserListReport(List oids); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + MemoryStream CreateUSerGroupListReport(List oids); } } \ No newline at end of file diff --git a/ReportService/ServiceImplementations/ReportServiceImp.cs b/ReportService/ServiceImplementations/ReportServiceImp.cs index 2f1047a0d..aeb193d00 100644 --- a/ReportService/ServiceImplementations/ReportServiceImp.cs +++ b/ReportService/ServiceImplementations/ReportServiceImp.cs @@ -131,6 +131,9 @@ namespace ReportingService.ServiceImplementations private static MemoryStream CreateReportStream(XtraReport pReport) { + if (pReport == null) + return null; + pReport.CreateDocument(); var resultStream = new MemoryStream(); @@ -333,5 +336,46 @@ namespace ReportingService.ServiceImplementations { return null; } + + public MemoryStream CreateCustomerListReport(List oids) + { + var reportCreator = GetReportCreator(); + return CreateReportStream(reportCreator.CreateCustomerListReport(oids)); + } + + public MemoryStream CreateSupportConceptListReport(List oids) + { + return null; + } + + public MemoryStream CreatePersonListReport(List oids) + { + return null; + } + + public MemoryStream CreateEmployeeListReport(List oids) + { + return null; + } + + public MemoryStream CreateOrganisationListReport(List oids) + { + return null; + } + + public MemoryStream CreateTeamListReport(List oids) + { + return null; + } + + public MemoryStream CreateUserListReport(List oids) + { + return null; + } + + public MemoryStream CreateUSerGroupListReport(List oids) + { + return null; + } } } \ No newline at end of file