diff --git a/.gitignore b/.gitignore
index d1d0e13ef..6a0adad09 100644
--- a/.gitignore
+++ b/.gitignore
@@ -377,3 +377,4 @@
/ReportImp/TabulaRasa/obj/Release
/ReportImp/KirschbaumManz/obj/Debug
/ReportImp/KirschbaumManz/obj/Release
+/ReportImp/VkmRietberg/obj/Debug
diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 5201a5c91..2ca56988c 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -102,6 +102,7 @@
+
@@ -282,6 +283,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -604,6 +609,7 @@
+
@@ -820,6 +826,9 @@
BudgetView.xaml
+
+ FlexibleReportEntryDetail.xaml
+
Component
diff --git a/BeWo/Converter/NullableBoolToBoolConverter.cs b/BeWo/Converter/NullableBoolToBoolConverter.cs
new file mode 100644
index 000000000..41303415b
--- /dev/null
+++ b/BeWo/Converter/NullableBoolToBoolConverter.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Converter
+{
+ public class NullableBoolToBoolConverter : System.Windows.Data.IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return false;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs
index c5213ee0a..f048298e0 100644
--- a/BeWo/Core/BeWoUtils.cs
+++ b/BeWo/Core/BeWoUtils.cs
@@ -1951,7 +1951,7 @@ namespace BeWo.Core
ThemeManager.SetTheme(window, Theme.Office2010Black);
}
- ThemeManager.SetTheme(documentPreviewControl, Theme.Office2007Black);
+ //ThemeManager.SetTheme(documentPreviewControl, Theme.Office2007Black);
documentPreviewControl.DocumentSource = report;
diff --git a/BeWo/MainControl.xaml.cs b/BeWo/MainControl.xaml.cs
index 396c5ed37..0a85838aa 100644
--- a/BeWo/MainControl.xaml.cs
+++ b/BeWo/MainControl.xaml.cs
@@ -1115,7 +1115,7 @@ namespace BeWo
private void button_Support_Click(object sender, RoutedEventArgs e)
{
- var mailButton = new Button
+ var mailButton = new Button
{
Content = "*",
FontFamily = new FontFamily("Wingdings"),
@@ -1199,12 +1199,35 @@ namespace BeWo
{
Foreground = Brushes.Black,
Margin = new Thickness(45, 5, 5, 5),
+ FontSize = 12
};
-
+
+ String linkText = "Teamviewer herunterladen";
+ String url = "https://get.teamviewer.com/dj5y4zy";
+
+ if (!String.IsNullOrWhiteSpace(BeWoApp.Mandator.SupportToolUrl))
+ {
+ url = BeWoApp.Mandator.SupportToolUrl;
+ if (BeWoApp.Mandator.SupportToolUrl.Contains("<") && BeWoApp.Mandator.SupportToolUrl.Contains(">") && BeWoApp.Mandator.SupportToolUrl.IndexOf("<") > 0)
+ {
+ linkText = BeWoApp.Mandator.SupportToolUrl.Substring(0, BeWoApp.Mandator.SupportToolUrl.IndexOf("<"));
+ url = BeWoApp.Mandator.SupportToolUrl.Substring(BeWoApp.Mandator.SupportToolUrl.IndexOf("<"));
+ url = url.Replace("<", "").Replace(">", "");
+ }
+
+ }
+
Hyperlink link = new Hyperlink();
- link.Inlines.Add("Teamviewer herunterladen");
+ link.NavigateUri = new Uri(url);
+ link.TargetName = "newWindow";
+ link.Inlines.Add(linkText);
supportToolLink.Inlines.Add(link);
+ link.RequestNavigate += (s, e2) =>
+ {
+ System.Diagnostics.Process.Start(
+ new System.Diagnostics.ProcessStartInfo((s as Hyperlink).NavigateUri.ToString()));
+ };
BeWoWindow bewoWindow = BeWoWpfUtils.CreateBeWoPopupWindow(300, 1000, true);
diff --git a/BeWo/MainWindow.xaml.cs b/BeWo/MainWindow.xaml.cs
index dbcc36e9e..6fba923e1 100644
--- a/BeWo/MainWindow.xaml.cs
+++ b/BeWo/MainWindow.xaml.cs
@@ -4,7 +4,7 @@ using System.Windows;
using BeWo.Core.Config;
using BeWo.MultiLanguage;
using BS.Shared.Translation;
-
+using DevExpress.Xpf.Core;
namespace BeWo
{
@@ -16,6 +16,9 @@ namespace BeWo
public MainWindow()
{
InitializeComponent();
+
+ ApplicationThemeHelper.ApplicationThemeName = "Office2010Black";
+
ShowLoginControl();
}
diff --git a/BeWo/View/Detail/DokumentationstypView.xaml.cs b/BeWo/View/Detail/DokumentationstypView.xaml.cs
index caf1a58ef..838a1f671 100644
--- a/BeWo/View/Detail/DokumentationstypView.xaml.cs
+++ b/BeWo/View/Detail/DokumentationstypView.xaml.cs
@@ -139,7 +139,7 @@ namespace BeWo.View.Detail
this.ViewModel.AddNewVMToList();
}
else {
- MessageBox.Show("Es können maximal fünf Dokumentationstypen angelegt werden.", "Hinzufügen nicht möglich", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show("Es können maximal fünf Dokumentationsfelder angelegt werden.", "Hinzufügen nicht möglich", MessageBoxButton.OK, MessageBoxImage.Information);
}
// grid.DataSource = null;
diff --git a/BeWo/View/Detail/Report/FlexibleReportEntryDetail.xaml b/BeWo/View/Detail/Report/FlexibleReportEntryDetail.xaml
new file mode 100644
index 000000000..5de402570
--- /dev/null
+++ b/BeWo/View/Detail/Report/FlexibleReportEntryDetail.xaml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Report/FlexibleReportEntryDetail.xaml.cs b/BeWo/View/Detail/Report/FlexibleReportEntryDetail.xaml.cs
new file mode 100644
index 000000000..caf0bd018
--- /dev/null
+++ b/BeWo/View/Detail/Report/FlexibleReportEntryDetail.xaml.cs
@@ -0,0 +1,50 @@
+using BeWo.Core;
+using BeWo.ServiceProxy;
+using BS.Shared.Extensions;
+using DevExpress.Utils;
+using DevExpress.XtraGrid.Views.Grid.ViewInfo;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using BS.Shared.DataContracts;
+using DevExpress.Data;
+using DevExpress.Xpf.Grid;
+using DevExpress.Xpf.Scheduler.UI;
+using static BeWo.View.Detail.Report.FlexibleReportView;
+
+namespace BeWo.View.Detail.Report
+{
+ public partial class FlexibleReportEntryDetail
+ {
+ #region Konstruktor
+
+ public FlexibleReportEntryDetail(List list, IReadOnlyList docTypes)
+ {
+ InitializeComponent();
+ DatagridRegions.ItemsSource = list;
+
+ ColumnDauer.EditSettings.DisplayFormat = "{0:N2} Std.";
+ ColumnKilometer.EditSettings.DisplayFormat = "{0:N1} km";
+
+ var noticeColumns = new[] { ColumnNotice, ColumnNotice2, ColumnNotice3, ColumnNotice4, ColumnNotice5 };
+
+ for (var i = 0; i < docTypes.Count && i < noticeColumns.Length; i++)
+ {
+ noticeColumns[i].Header = docTypes[i].TypeDescription;
+ noticeColumns[i].Visible = true;
+ }
+ }
+
+ #endregion
+
+ #region Propeties
+
+ public List Entries { get; set; }
+
+ #endregion
+ }
+}
diff --git a/BeWo/View/Detail/Report/FlexibleReportView.xaml b/BeWo/View/Detail/Report/FlexibleReportView.xaml
index e3246be41..d19724173 100644
--- a/BeWo/View/Detail/Report/FlexibleReportView.xaml
+++ b/BeWo/View/Detail/Report/FlexibleReportView.xaml
@@ -13,127 +13,166 @@
x:Class="BeWo.View.Detail.Report.FlexibleReportView"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs b/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
index f56d4254b..6e4d18ced 100644
--- a/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
+++ b/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
@@ -28,6 +28,10 @@ using MessageBox = System.Windows.MessageBox;
using BeWo.Data.Access;
using DevExpress.XtraReports.UI;
using DevExpress.Data.PivotGrid;
+using System.Windows.Media;
+using BeWo.Core.Service;
+using DevExpress.Utils.Gesture;
+using DevExpress.Xpf.Core.Native;
namespace BeWo.View.Detail.Report
{
@@ -60,22 +64,32 @@ namespace BeWo.View.Detail.Report
FlexibleGefahreneKilometer.CellFormat = "{0:N0}";
FlexibleRundungspotenzial.CellFormat = "{0:N0}";
- UFlexibleProzentualeAbweichung.UnboundExpressionMode = FieldUnboundExpressionMode.UseAggregateFunctions;
- UFlexibleProzentualeAbweichung.UnboundType = FieldUnboundColumnType.Decimal;
- UFlexibleProzentualeAbweichung.CellFormat = "{0:P2}";
- UFlexibleProzentualeAbweichung.UnboundExpression = string.Format("SUM([{0}]) / SUM([{1}])", FlexibleAnzahlStdIst.ExpressionFieldName, FlexibleAnzahlStdSoll.ExpressionFieldName);
- UFlexibleProzentualeAbweichung.SummaryType = FieldSummaryType.Average;
-
- FlexibleStundensatz.SummaryType = FieldSummaryType.Average;
-
FlexibleGefahreneKilometer.CellFormat = "{0:N0}";
FlexibleKlient.TotalValueFormat = "{0}";
FlexibleMitarbeiter.TotalValueFormat = "{0}";
FlexibleLeistung.TotalValueFormat = "{0}";
FlexibleLeistungskategorie.TotalValueFormat = "{0}";
+ FlexibleQuarter.ValueFormat = "{0}. Quartal";
- datePickerStartDate.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
- datePickerEndDate.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1);
+ UFlexibleProzentualeAbweichung.UnboundExpressionMode = FieldUnboundExpressionMode.UseAggregateFunctions;
+ UFlexibleProzentualeAbweichung.UnboundType = FieldUnboundColumnType.Decimal;
+ UFlexibleProzentualeAbweichung.CellFormat = "{0:P2}";
+ UFlexibleProzentualeAbweichung.UnboundExpression = $"SUM([{FlexibleAnzahlStdIst.ExpressionFieldName}]) / SUM([{FlexibleAnzahlStdSoll.ExpressionFieldName}])";
+ UFlexibleProzentualeAbweichung.SummaryType = FieldSummaryType.Average;
+
+ FlexibleStundensatz.SummaryType = FieldSummaryType.Average;
+
+ FlexibleDatum.SortMode = FieldSortMode.Custom;
+
+ datePickerEndDate.AllowNullInput = false;
+ datePickerStartDate.AllowNullInput = false;
+
+ var i = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
+ datePickerStartDate.DateTime = i;
+ datePickerEndDate.DateTime = i.AddMonths(1).AddDays(-1);
+
+ datePickerStartDate.DateTime = new DateTime(2019, 7, 1);
+ datePickerEndDate.DateTime = new DateTime(2019, 8, 1).AddDays(-1);
myPivotGridControl.PrintColumnHeaders = false;
myPivotGridControl.PrintRowHeaders = false;
@@ -83,6 +97,26 @@ namespace BeWo.View.Detail.Report
myPivotGridControl.PrintDataHeaders = false;
myPivotGridControl.PrintUnusedFilterFields = false;
myPivotGridControl.PrintHeadersOnEveryPage = false;
+
+ myPivotGridControl.AllowCustomizationForm = true;
+ myPivotGridControl.FieldListIncludeVisibleFields = true;
+ myPivotGridControl.GroupFieldsInFieldList = true;
+
+ checkBetrag.IsChecked = true;
+ checkHilepläne.IsChecked = true;
+ checkIst.IsChecked = true;
+ checkKilometer.IsChecked = true;
+ checkKlienten.IsChecked = true;
+ checkMitarbeiter.IsChecked = true;
+ checkRecords.IsChecked = true;
+ checkSoll.IsChecked = true;
+
+ LayoutGroupPivotChart.IsCollapsible = true;
+
+ LayoutGroupPivotChart.Visibility = Visibility.Collapsed;
+
+ DocTypes = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.DocumentType);
+ DocTypes.Sort((a, b) => a.ValueListEntryOid.Value.CompareTo(b.ValueListEntryOid.Value));
}
#endregion
@@ -93,36 +127,39 @@ namespace BeWo.View.Detail.Report
{
StartDatum = datePickerStartDate.DateTime,
EndDatum = datePickerEndDate.DateTime,
- ReduzierteAnsicht = checkReduzierteAnsicht.IsChecked.Value
+ ReduzierteAnsicht = checkReduzierteAnsicht.IsChecked,
+ AlleHilfeplaneAnzeigen = checkHilepläne.IsChecked,
+ AlleKlientenAnzeigen = checkKlienten.IsChecked,
+ AlleMitarbeiterAnzeigen = checkMitarbeiter.IsChecked,
+ AlleServiceBerichteAnzeigen = checkRecords.IsChecked,
+ BetragAnzeigen = checkBetrag.IsChecked,
+ GefahreneKilometerAnzeigen = checkKilometer.IsChecked,
+ IstAnzeigen = checkIst.IsChecked,
+ SollAnzeigen = checkSoll.IsChecked
};
ServiceFacade.DoOperationsServiceAsync(
s => s.GetFlexibleReportResult(filter),
- r =>
+ r => this.Dispatch(delegate
{
- this.Dispatch(delegate
- {
- var liste = new List();
+ var liste = new List();
- if (r.Entries != null)
- foreach (var item in r.Entries)
- {
- liste.Add(FlexibleReportEntry.InitByFlexibleReportEntryDC(item));
- }
+ if (r.Entries != null) liste.AddRange(r.Entries.Select(FlexibleReportEntry.InitByFlexibleReportEntryDC));
- if (r.Dummies != null)
- foreach (var item in r.Dummies)
- {
- liste.AddRange(FlexibleReportEntry.InitByFlexibleReportDummyDC(item));
- }
+ if (r.Dummies != null)
+ foreach (var item in r.Dummies)
+ liste.AddRange(FlexibleReportEntry.InitByFlexibleReportDummyDC(item));
- if (r.Employees != null)
- liste.AddRange(FlexibleReportEntry.InitByFlexibleReportEmployeeDictornary(r.Employees, filter.StartDatum));
+ if (r.Employees != null)
+ liste.AddRange(FlexibleReportEntry.InitByFlexibleReportDictornary(r.Employees, filter.StartDatum, filter.EndDatum, filter.ReduzierteAnsicht.HasValue && filter.ReduzierteAnsicht.Value, true));
- myPivotGridControl.DataSource = liste;
- checkBoxChart.IsEnabled = true;
- });
- });
+ if (r.Customers != null)
+ liste.AddRange(FlexibleReportEntry.InitByFlexibleReportDictornary(r.Customers, filter.StartDatum, filter.EndDatum, filter.ReduzierteAnsicht.HasValue && filter.ReduzierteAnsicht.Value, false));
+
+ myPivotGridControl.DataSource = liste;
+
+ checkBoxChart.IsEnabled = true;
+ }));
}
private void GridControl_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
@@ -135,7 +172,7 @@ namespace BeWo.View.Detail.Report
}
}
- if (e.Value != null && decimal.TryParse(e.Value.ToString(), out decimal d) && d == 0)
+ if (e.Value != null && decimal.TryParse(e.Value.ToString(), out decimal d) && d == 0)
e.DisplayText = "";
if (e.DisplayText == "Fehler")
e.DisplayText = "";
@@ -143,7 +180,7 @@ namespace BeWo.View.Detail.Report
private void GridControl_CustomFieldValueCells(object sender, PivotCustomFieldValueCellsEventArgs e)
{
- PivotGridControl pivot = (PivotGridControl)sender;
+ var pivot = (PivotGridControl)sender;
if (pivot.DataSource == null)
return;
@@ -172,30 +209,35 @@ namespace BeWo.View.Detail.Report
private void CheckChartChanged(object sender, RoutedEventArgs e)
{
- if (myPivotGridControl.DataSource != null)
+ if (myPivotGridControl.DataSource == null) return;
+ if (!checkBoxChart.IsChecked.HasValue) return;
+
+ ChartControl.Visibility = checkBoxChart.IsChecked.Value ? Visibility.Visible : Visibility.Collapsed;
+ LayoutGroupPivotChart.Visibility = checkBoxChart.IsChecked.Value ? Visibility.Visible : Visibility.Collapsed;
+ if (ChartControl.Visibility == Visibility.Visible)
{
- ChartControl.Visibility = checkBoxChart.IsChecked.Value ? Visibility.Visible : Visibility.Collapsed;
- if (ChartControl.Visibility == Visibility.Visible)
- {
- InitChart();
- }
+ InitChart();
+ }
+ else
+ {
+ LayoutGroupPivotGrid.Height = double.NaN;
}
}
private void CheckDataBarChanged(object sender, RoutedEventArgs e)
{
- if (myPivotGridControl.DataSource != null)
- {
- var conditions = CreateDataBarConditions(_Columns, _Rows, _DataDiff, "GreenSolidDataBar");
+ if (!checkBoxData.IsChecked.HasValue) return;
+ if (myPivotGridControl.DataSource == null) return;
- if (checkBoxData.IsChecked.Value)
- {
- myPivotGridControl.FormatConditions.AddRange(conditions);
- }
- else
- {
- myPivotGridControl.FormatConditions.RemoveRange(conditions);
- }
+ var conditions = CreateDataBarConditions(_Columns, _Rows, _DataDiff, "GreenSolidDataBar");
+
+ if (checkBoxData.IsChecked.Value)
+ {
+ myPivotGridControl.FormatConditions.AddRange(conditions);
+ }
+ else
+ {
+ myPivotGridControl.FormatConditions.RemoveRange(conditions);
}
}
@@ -204,25 +246,20 @@ namespace BeWo.View.Detail.Report
var control = new FlexibleReportLayoutSaveControl();
var beWoWindow = new BeWoWindow();
- control.CancelButtonClicked += delegate
- {
- beWoWindow.Close();
- };
+ control.CancelButtonClicked += () => beWoWindow.Close();
+
control.SaveButtonClicked += delegate
{
var liste = new List();
ServiceFacade.DoOperationsServiceAsync(
s => s.GetFlexibleReportLayouts(),
- r =>
+ r => this.Dispatch(delegate
{
- this.Dispatch(delegate
+ foreach (var item in r)
{
- foreach (var item in r)
- {
- liste.Add(FlexibleReportLayout.InitByFlexibleReportLayoutDC(item));
- }
- });
- });
+ liste.Add(FlexibleReportLayout.InitByFlexibleReportLayoutDC(item));
+ }
+ }));
if (string.IsNullOrWhiteSpace(control.LayoutName))
{
@@ -259,9 +296,17 @@ namespace BeWo.View.Detail.Report
private void ButtonLayoutLoad_Click(object sender, RoutedEventArgs e)
{
var control = new FlexibleReportLayoutListControl();
- var beWoWindow = new BeWoWindow();
+ var beWoWindow = new BeWoWindow
+ {
+ rootGroupBox = {Header = "Layout Laden"},
+ Height = 500,
+ Width = 500,
+ WindowStartupLocation = WindowStartupLocation.CenterOwner,
+ GroupBoxContent = control,
+ Owner = BeWoApp.CurrentBeWo.MainWindow
+ };
+
- beWoWindow.rootGroupBox.Header = "Layout Laden";
control.DatagridRegions.Columns.Remove(control.LayoutDeleteColumn);
control.LayoutNameColumn.ReadOnly = true;
control.ActionButton.Content = "Laden";
@@ -277,10 +322,7 @@ namespace BeWo.View.Detail.Report
beWoWindow.Close();
};
- control.CancelButtonClicked += delegate
- {
- beWoWindow.Close();
- };
+ control.CancelButtonClicked += () => beWoWindow.Close();
control.MouseDoubleClick += delegate
{
@@ -292,22 +334,24 @@ namespace BeWo.View.Detail.Report
LayoutString = control.SelectedLayout.LayoutString;
beWoWindow.Close();
};
-
- beWoWindow.Height = 500;
- beWoWindow.Width = 500;
- beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
- beWoWindow.GroupBoxContent = control;
- beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow;
-
+
beWoWindow.ShowDialog();
}
private void ButtonLayoutEdit_Click(object sender, RoutedEventArgs e)
{
var control = new FlexibleReportLayoutListControl();
- var beWoWindow = new BeWoWindow();
+ var beWoWindow = new BeWoWindow
+ {
+ rootGroupBox = {Header = "Layout(s) bearbeiten"},
+ Height = 500,
+ Width = 500,
+ WindowStartupLocation = WindowStartupLocation.CenterOwner,
+ GroupBoxContent = control,
+ Owner = BeWoApp.CurrentBeWo.MainWindow
+ };
+
- beWoWindow.rootGroupBox.Header = "Layout(s) bearbeiten";
control.ActionButton.Content = "Speichern";
control.ActionButtonClicked += delegate
{
@@ -321,123 +365,128 @@ namespace BeWo.View.Detail.Report
control.CancelButtonClicked += delegate
{
- if (control.IsDirty)
+ if (!control.IsDirty) return;
+
+ var result = MessageBox.Show("Möchten Sie die Änderung(en) verwerfen?", "BeWoPlaner", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
+ switch (result)
{
- var result = MessageBox.Show("Möchten Sie die Änderung(en) verwerfen?", "BeWoPlaner", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
- switch (result)
- {
- case MessageBoxResult.None:
- return;
- case MessageBoxResult.Cancel:
- return;
- case MessageBoxResult.Yes:
- control.Save();
- beWoWindow.Close();
- break;
- case MessageBoxResult.No:
- beWoWindow.Close();
- break;
- default:
- return;
- }
- return;
+ case MessageBoxResult.None:
+ return;
+ case MessageBoxResult.Cancel:
+ return;
+ case MessageBoxResult.Yes:
+ control.Save();
+ beWoWindow.Close();
+ break;
+ case MessageBoxResult.No:
+ beWoWindow.Close();
+ break;
+ case MessageBoxResult.OK:
+ return;
+ default:
+ return;
}
};
- beWoWindow.Height = 500;
- beWoWindow.Width = 500;
- beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
- beWoWindow.GroupBoxContent = control;
- beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow;
-
beWoWindow.ShowDialog();
}
private void MyPivotGridControl_CustomCellAppearance(object sender, PivotCustomCellAppearanceEventArgs e)
{
+ if (e.ColumnValueType == FieldValueType.Total || e.RowValueType == FieldValueType.Total)
+ e.Background = e.Selected
+ ? new SolidColorBrush(Color.FromArgb(180, 193, 180, 120))
+ : new SolidColorBrush(Color.FromArgb(60, 150, 150, 150));
+ if (e.ColumnValueType == FieldValueType.GrandTotal || e.RowValueType == FieldValueType.GrandTotal)
+ e.Background = e.Selected
+ ? new SolidColorBrush(Color.FromArgb(180, 191, 168, 66))
+ : new SolidColorBrush(Color.FromArgb(60, 120, 120, 120));
}
private void CheckDataBarPerChanged(object sender, RoutedEventArgs e)
{
- if (myPivotGridControl.DataSource != null)
- {
- var conditions = CreateDataBarConditions(_Columns, _Rows, _DataPer, "BlueSolidDataBar", 0, 1);
+ if (myPivotGridControl.DataSource == null) return;
+ if (!checkBoxDataPer.IsChecked.HasValue) return;
- if (checkBoxDataPer.IsChecked.Value)
- {
- myPivotGridControl.FormatConditions.AddRange(conditions);
- }
- else
- {
- myPivotGridControl.FormatConditions.RemoveRange(conditions);
- }
+ var conditions = CreateDataBarConditions(_Columns, _Rows, _DataPer, "BlueSolidDataBar", 0, 1);
+
+ if (checkBoxDataPer.IsChecked.Value)
+ {
+ myPivotGridControl.FormatConditions.AddRange(conditions);
+ }
+ else
+ {
+ myPivotGridControl.FormatConditions.RemoveRange(conditions);
}
}
private void ButtonLayoutPrint_Click(object sender, RoutedEventArgs e)
{
- var report = new PivotGridReport();
- var reportPivotGrid = (XRPivotGrid)report.FindControl("xrPivotGrid1", true);
+ myPivotGridControl.ShowPrintPreviewDialog(Window.GetWindow(this));
+ }
+ private void MyPivotGridControl_CustomGroupInterval(object sender, PivotCustomGroupIntervalEventArgs e)
+ {
+ e.GroupValue = ((DateTime)e.Value).ToString("ddd, dd.MM.yyyy");
+ }
- myPivotGridControl.SavePivotGridToFile(@"D:\icf\test.dat");
- reportPivotGrid.DataSource = new PivotFileDataSource(@"D:\icf\test.dat");
+ private void MyPivotGridControl_CustomFieldSort(object sender, PivotCustomFieldSortEventArgs e)
+ {
+ if (e.Field != FlexibleDatum) return;
+ if (e.Value1 == null || e.Value2 == null)
+ return;
- reportPivotGrid.Fields.Clear();
- foreach (var item in myPivotGridControl.Fields)
+ DateTime d1 = Convert.ToDateTime(e.Value1.ToString().Split(' ')[1]);
+ DateTime d2 = Convert.ToDateTime(e.Value2.ToString().Split(' ')[1]);
+ if (d1 > d2)
+ e.Result = 1;
+ else if (d1 == d2)
+ e.Result = 0;
+ else
+ e.Result = -1;
+
+ e.Handled = true;
+ }
+
+ private void ButtonShowOptions_Click(object sender, RoutedEventArgs e)
+ {
+ myPivotGridControl.IsFieldListVisible = true;
+ }
+
+ private void MyPivotGridControl_CellDoubleClick(object sender, PivotCellEventArgs e)
+ {
+ var selectedEntries = e.CreateDrillDownDataSource()
+ .Cast()
+ .Select(row => ActualFlexibleReportEntries[row.ListSourceRowIndex])
+ .Where(item => item.Type == FlexibleReportEntryType.ServiceRecordEntry)
+ .ToList();
+
+ if(selectedEntries.Count > 0)
{
- if (item.Area != FieldArea.FilterArea)
+ var beWoWindow = new BeWoWindow
{
- var field = new DevExpress.XtraReports.UI.PivotGrid.XRPivotGridField();
- field.Area = GetArea(item.Area);
- field.Caption = item.Caption;
- field.Name = item.Name;
- field.FieldName = item.FieldName;
- field.GroupInterval = GetGroupInterval(item.GroupInterval);
- field.AreaIndex = item.AreaIndex;
- field.Width = (int)item.Width;
- field.ValueFormat.FormatString = item.ValueFormat;
- field.CellFormat.FormatType = DevExpress.Utils.FormatType.Custom;
- field.CellFormat.FormatString = item.CellFormat;
- field.SortOrder = (DevExpress.XtraPivotGrid.PivotSortOrder)((int)item.SortOrder);
- field.SortMode = (DevExpress.XtraPivotGrid.PivotSortMode)((int)item.SortMode);
+ Height = 500,
+ Width = 1500,
+ WindowStartupLocation = WindowStartupLocation.CenterOwner,
+ GroupBoxContent = new FlexibleReportEntryDetail(selectedEntries, DocTypes),
+ Owner = BeWoApp.CurrentBeWo.MainWindow,
+ rootGroupBox = {Header = "Eintrag Details"}
+ };
- if (item.UnboundType != FieldUnboundColumnType.Bound)
- {
- field.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
- field.UnboundExpression = item.UnboundExpression;
- field.UnboundExpressionMode = DevExpress.XtraPivotGrid.UnboundExpressionMode.UseAggregateFunctions;
- field.SummaryType = PivotSummaryType.Average;
- }
-
- reportPivotGrid.Fields.Add(field);
- }
+ beWoWindow.ShowDialog();
+ }
+ else
+ {
+ MessageBox.Show("Hier befindet sich keine Zeiterfassung!", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Stop);
}
- reportPivotGrid.OptionsView.ShowDataHeaders = false;
- reportPivotGrid.OptionsView.ShowColumnHeaders = false;
- reportPivotGrid.BestFit();
-
- report.CreateDocument();
-
- var documentPreviewControl = new DocumentPreviewControl { CommandBarStyle = DevExpress.Xpf.DocumentViewer.CommandBarStyle.Bars };
- documentPreviewControl.Loaded += BeWoUtils.CustomizeReportPreviewToolBar;
- var window = new BeWoWindow { GroupBoxContent = documentPreviewControl, Owner = BeWoApp.CurrentBeWo.MainWindow };
-
- ThemeManager.SetTheme(window, Theme.Office2010Black);
-
- ThemeManager.SetTheme(documentPreviewControl, Theme.Office2007Black);
-
- documentPreviewControl.DocumentSource = report;
-
- window.rootGroupBox.Header = "Druckvorschau";
- window.Title = "Druckvorschau";
- window.Show();
- documentPreviewControl.Visibility = Visibility.Visible;
}
#endregion
#region Proterties
+
+ public List DocTypes { get; set; }
+
public string LayoutString
{
get
@@ -456,12 +505,15 @@ namespace BeWo.View.Detail.Report
}
}
}
+
+ public List ActualFlexibleReportEntries => myPivotGridControl?.DataSource as List;
+
#endregion
#region Methoden
private void InitChart()
{
- ChartControl.Diagram = ChartFactory.GenerateDiagram(typeof(BarStackedSeries2D), false);
+ ChartControl.Diagram = ChartFactory.GenerateDiagram(typeof(AreaSeries2D), false);
}
private IEnumerable CreateDataBarConditions(List columns, List rows, List datas, string formatName)
@@ -510,7 +562,6 @@ namespace BeWo.View.Detail.Report
}
}
-
private DevExpress.XtraPivotGrid.PivotGroupInterval GetGroupInterval(FieldGroupInterval groupInterval)
{
switch (groupInterval)
@@ -548,6 +599,8 @@ namespace BeWo.View.Detail.Report
#region Classes
public class FlexibleReportEntry
{
+ public long? ServiceRecordOid { get; set; }
+
public long? CustomerOid { get; set; }
public string CustomerString { get; set; }
@@ -566,15 +619,13 @@ namespace BeWo.View.Detail.Report
public string Leistung { get; set; }
- public decimal AnzahlMinutenIst { get; set; }
+ public decimal? IstMinuten { get; set; }
- public decimal AnzahlStundenIst { get { return AnzahlMinutenIst / 60; } }
+ public decimal? SollMinuten { get; set; }
- public decimal? AnzahlMinutenSoll { get; set; }
+ public DateTime StartDatum { get; set; }
- public decimal? AnzahlStundenSoll { get { return AnzahlMinutenSoll / 60; } }
-
- public DateTime Datum { get; set; }
+ public DateTime EndDatum { get; set; }
public FlexibleReportEntryType Type { get; set; }
@@ -586,46 +637,56 @@ namespace BeWo.View.Detail.Report
public decimal Rundungspotenzial { get; set; }
- public decimal? DifferenzIstSollMinuten { get { return AnzahlMinutenIst - AnzahlMinutenSoll; } }
-
- public decimal? DifferenzIstSollStunden { get { return DifferenzIstSollMinuten / 60; } }
-
public string Organisation { get; set; }
+ public string Notice { get; set; }
+
+ public string Notice2 { get; set; }
+
+ public string Notice3 { get; set; }
+
+ public string Notice4 { get; set; }
+
+ public string Notice5 { get; set; }
+
+ public decimal? IstStunden => IstMinuten / 60;
+
+ public decimal? SollStunden => SollMinuten / 60;
+
+ public decimal DifferenzIstSollMinuten => (IstMinuten ?? 0) - (SollMinuten ?? 0);
+
+ public decimal DifferenzIstSollStunden => DifferenzIstSollMinuten / 60;
+
public static FlexibleReportEntry InitByFlexibleReportEntryDC(FlexibleReportEntryDC entryDC)
{
var entry = new FlexibleReportEntry()
{
+ ServiceRecordOid = entryDC.ServiceRecordOid,
CustomerOid = entryDC.CustomerOid,
+ CustomerString = entryDC.CustomerString ?? "",
EmployeeOid = entryDC.EmployeeOid,
+ EmployeeString = entryDC.EmployeeString ?? "",
SupportConceptOid = entryDC.SupportConceptOid,
- AnzahlMinutenIst = entryDC.AnzahlMinuten,
- Datum = entryDC.StartDatum,
+ SupportConceptString = entryDC.SupportConceptString ?? "",
+ IstMinuten = entryDC.IstMinuten,
+ StartDatum = entryDC.StartDatum,
+ EndDatum = entryDC.EndDatum,
Leistung = entryDC.Leistung,
Leistungskategorie = entryDC.Leistungskategorie,
Team = entryDC.Team,
- AnzahlMinutenSoll = entryDC.AnzahlMinutenSoll,
- Type = entryDC.Type,
+ SollMinuten = entryDC.SollMinuten,
+ Type = FlexibleReportEntryType.ServiceRecordEntry,
Kilometer = entryDC.Kilometer,
Organisation = entryDC.Organisation,
- Rundungspotenzial = entryDC.AnzahlMinuten - ((decimal)entryDC.EndDatum.Subtract(entryDC.StartDatum).TotalMinutes),
+ Rundungspotenzial = (entryDC.IstMinuten ?? 0) - ((decimal)entryDC.EndDatum.Subtract(entryDC.StartDatum).TotalMinutes),
Betrag = entryDC.Betrag,
- Stundensatz = entryDC.Stundensatz
+ Stundensatz = entryDC.Stundensatz,
+ Notice = entryDC.Notice,
+ Notice2 = entryDC.Notice2,
+ Notice3 = entryDC.Notice3,
+ Notice4 = entryDC.Notice4,
+ Notice5 = entryDC.Notice5,
};
-
- if (entryDC.Type == FlexibleReportEntryType.ServiceRecordEntry)
- {
- entry.CustomerString = entryDC.CustomerString == null ? "" : entryDC.CustomerString;
- entry.EmployeeString = entryDC.EmployeeString == null ? "" : entryDC.EmployeeString;
- entry.SupportConceptString = entryDC.SupportConceptString == null ? "" : entryDC.SupportConceptString;
- }
- else
- {
- entry.CustomerString = null;
- entry.EmployeeString = null;
- entry.SupportConceptString = null;
- }
-
return entry;
}
@@ -637,12 +698,13 @@ namespace BeWo.View.Detail.Report
{
flexibleReports.Add(new FlexibleReportEntry()
{
- AnzahlMinutenSoll = dummyDC.Soll,
- AnzahlMinutenIst = 0m,
+ SollMinuten = dummyDC.Soll ?? 0,
+ IstMinuten = 0m,
Betrag = 0,
CustomerOid = dummyDC.CustomerOid,
CustomerString = dummyDC.CustomerString,
- Datum = date,
+ StartDatum = date,
+ EndDatum = dummyDC.EndDate,
EmployeeOid = dummyDC.EmployeeOid,
EmployeeString = dummyDC.EmployeeString,
Kilometer = null,
@@ -654,30 +716,54 @@ namespace BeWo.View.Detail.Report
SupportConceptOid = dummyDC.SupportConceptOid,
SupportConceptString = dummyDC.SupportConceptString,
Team = null,
- Type = dummyDC.EntryType
+ Type = FlexibleReportEntryType.SupportConceptEntry
});
}
return flexibleReports;
}
- public static IList InitByFlexibleReportEmployeeDictornary(Dictionary dic, DateTime date)
+ public static IList InitByFlexibleReportDictornary(Dictionary dic, DateTime start, DateTime ende, bool reduziert, bool isEmployee)
{
var flexibleReports = new List();
foreach (var item in dic)
{
- flexibleReports.Add(new FlexibleReportEntry()
+ for (var date = start; date <= ende; date = date.AddDays(1))
{
- EmployeeOid = item.Key,
- EmployeeString = item.Value,
- Type = FlexibleReportEntryType.EmployeeNullEntry,
- Datum = date
- });
+ // isEmployee = true -> Employee
+ if (isEmployee)
+ flexibleReports.Add(new FlexibleReportEntry()
+ {
+ EmployeeOid = item.Key,
+ EmployeeString = item.Value,
+ Type = FlexibleReportEntryType.EmployeeNullEntry,
+ StartDatum = date,
+ EndDatum = date
+ });
+ // isEmployee = false -> Customer
+ else
+ flexibleReports.Add(new FlexibleReportEntry()
+ {
+ CustomerOid = item.Key,
+ CustomerString = item.Value,
+ Type = FlexibleReportEntryType.CustomerNullEntry,
+ StartDatum = date,
+ EndDatum = date
+ });
+ if (reduziert)
+ break;
+ }
}
return flexibleReports;
}
+
+ // Wurde eig nur zum Testen verwendet, kann bei Bedarf überschrieben werden
+ public override string ToString()
+ {
+ return StartDatum.ToShortTimeString();
+ }
}
public class FlexibleReportLayout
@@ -735,18 +821,18 @@ namespace BeWo.View.Detail.Report
{
Dictionary seriesTypes = new Dictionary();
seriesTypes.Add(typeof(AreaFullStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Area Full-Stacked Series 2D" });
- seriesTypes.Add(typeof(AreaSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Area Series 2D" });
- seriesTypes.Add(typeof(AreaStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Area Stacked Series 2D" });
- seriesTypes.Add(typeof(BarFullStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Bar Full-Stacked Series 2D" });
- seriesTypes.Add(typeof(BarStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Bar Stacked Series 2D" });
- seriesTypes.Add(typeof(LineSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText="Line Series 2D" });
+ seriesTypes.Add(typeof(AreaSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Area Series 2D" });
+ seriesTypes.Add(typeof(AreaStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Area Stacked Series 2D" });
+ seriesTypes.Add(typeof(BarFullStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Bar Full-Stacked Series 2D" });
+ seriesTypes.Add(typeof(BarStackedSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Bar Stacked Series 2D" });
+ seriesTypes.Add(typeof(LineSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Line Series 2D" });
seriesTypes.Add(typeof(PointSeries2D), new SeriesTypeDescriptor { DiagramType = XYDiagram2DType, DisplayText = "Point Series 2D" });
- seriesTypes.Add(typeof(AreaSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Area Series 3D" });
- seriesTypes.Add(typeof(AreaStackedSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Area Stacked Series 3D" });
- seriesTypes.Add(typeof(AreaFullStackedSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Area Full-Stacked Series 3D" });
- seriesTypes.Add(typeof(BarSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Bar Series 3D" });
- seriesTypes.Add(typeof(PointSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText="Point Series 3D" });
- seriesTypes.Add(typeof(PieSeries3D), new SeriesTypeDescriptor { DiagramType = SimpleDiagram3DType, DisplayText="Pie Series 3D" });
+ seriesTypes.Add(typeof(AreaSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText = "Area Series 3D" });
+ seriesTypes.Add(typeof(AreaStackedSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText = "Area Stacked Series 3D" });
+ seriesTypes.Add(typeof(AreaFullStackedSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText = "Area Full-Stacked Series 3D" });
+ seriesTypes.Add(typeof(BarSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText = "Bar Series 3D" });
+ seriesTypes.Add(typeof(PointSeries3D), new SeriesTypeDescriptor { DiagramType = XYDiagram3DType, DisplayText = "Point Series 3D" });
+ seriesTypes.Add(typeof(PieSeries3D), new SeriesTypeDescriptor { DiagramType = SimpleDiagram3DType, DisplayText = "Pie Series 3D" });
seriesTypes.Add(typeof(PieSeries2D), new SeriesTypeDescriptor { DiagramType = SimpleDiagram2DType, DisplayText = "Pie Series 2D" });
return seriesTypes;
}
diff --git a/BeWo/View/Detail/SupportConceptView.xaml b/BeWo/View/Detail/SupportConceptView.xaml
index 36daa2914..846638faa 100644
--- a/BeWo/View/Detail/SupportConceptView.xaml
+++ b/BeWo/View/Detail/SupportConceptView.xaml
@@ -16,6 +16,8 @@
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:viewModel="clr-namespace:BS.Shared.DataContracts;assembly=BS.Shared"
xmlns:drawing="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
@@ -25,6 +27,8 @@
+
+