diff --git a/BeWo/LoginControl.xaml b/BeWo/LoginControl.xaml
index b5da03e84..54a5b8558 100644
--- a/BeWo/LoginControl.xaml
+++ b/BeWo/LoginControl.xaml
@@ -17,7 +17,7 @@
-
+
@@ -45,8 +45,8 @@
-
-
+
+
diff --git a/BeWo/LoginControl.xaml.cs b/BeWo/LoginControl.xaml.cs
index c051e8d02..10ec5581f 100644
--- a/BeWo/LoginControl.xaml.cs
+++ b/BeWo/LoginControl.xaml.cs
@@ -45,13 +45,6 @@ namespace BeWo
private String GETNETMESSAGE_URL = "https://support.bewoplaner.de/api/getxmlstate.php?k={0}&t=1";
- private bool _IsTechSupport;
- public bool IsTechSupport
- {
- get { return _IsTechSupport; }
- set { _IsTechSupport = value; OnPropertyChanged("IsTechSupport"); }
- }
-
private Control _CurrentModalPopUp;
private Grid _ModalPopUpBackGround;
@@ -205,11 +198,6 @@ namespace BeWo
//string ipaddress = "";
-#if DEBUG
- IsTechSupport = true;
-#else
- IsTechSupport = !String.IsNullOrEmpty(BeWoApp.IpAddress) && BeWoApp.IpAddress.Equals("87.79.89.65");
-#endif
// --------------
if (ProfileList.Count == 0 || String.IsNullOrEmpty(ProfileList[0].Tenant))
@@ -242,17 +230,15 @@ namespace BeWo
//if (profileSelectionComboBox.SelectedItem == null)
profileSelectionComboBox.SelectedItem = selectedProfile;
- if (selectedProfile != null && selectedProfile.Tenant == "demo")
+ TextBox_Username.Focus();
+
+ if (selectedProfile != null && selectedProfile.Tenant == "demo")
{
TextBox_Username.Text = "demo";
PasswordBox_Password.Password = "demo";
- button_login.Focus();
+
}
- else
- {
- TextBox_Username.Focus();
- }
-
+
//this.lblTenant.Content = BeWoApp.Tenant;
lblVersion.Content = BeWoApp.Version;
@@ -263,11 +249,8 @@ namespace BeWo
PinCertificate();
- if (!IsTechSupport)
- return;
-
- linkLine.Margin = new Thickness(linkLine.Margin.Left, linkLine.Margin.Top + 25, linkLine.Margin.Right, linkLine.Margin.Bottom);
- gridLogin.Height += 25;
+ //linkLine.Margin = new Thickness(linkLine.Margin.Left, linkLine.Margin.Top + 25, linkLine.Margin.Right, linkLine.Margin.Bottom);
+ //gridLogin.Height += 25;
}
@@ -329,7 +312,6 @@ namespace BeWo
// Vielen Dank.
// Ihr BeWoPlaner-Team;1";
-
//if (!String.IsNullOrWhiteSpace(message) && message.Trim().Length > 2)
//{
// String ende = message.Substring(message.Length - 2);
@@ -347,15 +329,9 @@ namespace BeWo
// dlg.Message = message;
// }
+ // dlg.Visibility = Visibility.Visible;
- // var test = this.GetRootParent() as Window;
- // if (test != null)
- // {
- // dlg.Owner = test;
- // dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner;
- // }
-
- // var result = dlg.ShowDialog();
+ // dlg.ShowDialog();
// if (ende.EndsWith(";0"))
// {
// return false;
@@ -791,10 +767,10 @@ namespace BeWo
}
#if DEBUG
- //if (!CheckStatusMessage(profile, String.Format(GETNETMESSAGE_URL, profile.Tenant)))
- //{
- // return;
- //}
+ if (!CheckStatusMessage(profile, String.Format(GETNETMESSAGE_URL, profile.Tenant)))
+ {
+ return;
+ }
#else
if (!CheckStatusMessage(profile, String.Format(GETSTATUSMESSAGE_URL, profile.Tenant)))
{
@@ -803,7 +779,6 @@ namespace BeWo
#endif
-
ChangeServerAndTenant(profile);
var lWaitLayer = new WaitLayer2();
grid_root.Children.Add(lWaitLayer);
@@ -1406,6 +1381,29 @@ namespace BeWo
pwvViewOffen = true;
}
+
+ private void UIElement_OnKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.P)
+ {
+ if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl) && Keyboard.IsKeyDown(Key.LeftAlt))
+ {
+ PinEinblenden();
+ }
+
+ }
+ }
+
+ private void PinEinblenden()
+ {
+ PINTextBox.Visibility = Visibility.Visible;
+ lblPin.Visibility = Visibility.Visible;
+
+ linkLine.Margin = new Thickness(linkLine.Margin.Left, linkLine.Margin.Top + 25, linkLine.Margin.Right, linkLine.Margin.Bottom);
+ gridLogin.Height += 25;
+
+ PINTextBox.Focus();
+ }
}
public class BeWoProfile
diff --git a/BeWo/View/Detail/MandatorView.xaml b/BeWo/View/Detail/MandatorView.xaml
index e38f850c5..f3e67385b 100644
--- a/BeWo/View/Detail/MandatorView.xaml
+++ b/BeWo/View/Detail/MandatorView.xaml
@@ -4,6 +4,7 @@
xmlns:localView="clr-namespace:BeWo.View"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
+ xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True">
@@ -136,13 +137,34 @@
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/MandatorView.xaml.cs b/BeWo/View/Detail/MandatorView.xaml.cs
index a35bc83a7..344f67ff0 100644
--- a/BeWo/View/Detail/MandatorView.xaml.cs
+++ b/BeWo/View/Detail/MandatorView.xaml.cs
@@ -1,7 +1,8 @@
-using System.Windows;
+using System.Collections.Generic;
+using System.Windows;
using BeWo.ServiceProxy;
using BeWo.ViewModel;
-
+using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace BeWo.View.Detail
@@ -32,19 +33,42 @@ namespace BeWo.View.Detail
{
this.DataContext = value;
this._Viewmodel = value;
+
+ if (ViewModel.InvoiceNumberList.Count > 1)
+ {
+ lblSchema.Visibility = Visibility.Collapsed;
+ txtSchema.Visibility = Visibility.Collapsed;
+ lblNumber.Visibility = Visibility.Collapsed;
+ spinedit_number.Visibility = Visibility.Collapsed;
+ }
+ else
+ {
+ GridControlInvoiceNumbers.Visibility = Visibility.Collapsed;
+ }
}
}
protected override void Save()
{
+ var invoiceNumberList = new List();
+
+ foreach (var ivm in this.ViewModel.InvoiceNumberList)
+ {
+ invoiceNumberList.Add(ivm.CommitToDataContract());
+ }
ServiceFacade.DoAccountingServiceAsync(
- s => s.UpdateInvoiceNumber(this.ViewModel.InvoiceNumber.CommitToDataContract()),
- iv => ServiceFacade.DoOperationsServiceAsync(
+ s => s.UpdateInvoiceNumberList(invoiceNumberList),
+ inl => ServiceFacade.DoOperationsServiceAsync(
s => s.UpdateMandator(this.ViewModel.CommitToDataContract()),
m => this.Dispatch(
delegate
{
- this.ViewModel = new MandatorVM(new InvoiceNumberVM(iv), m);
+ var vmList = new List();
+ foreach (var indc in inl)
+ {
+ vmList.Add(new InvoiceNumberVM(indc));
+ }
+ this.ViewModel = new MandatorVM(vmList, m);
BeWoApp.Mandator = m;
})));
}
diff --git a/BeWo/View/Detail/Report/ServicesReportView.xaml b/BeWo/View/Detail/Report/ServicesReportView.xaml
index 14d589978..e62b24960 100644
--- a/BeWo/View/Detail/Report/ServicesReportView.xaml
+++ b/BeWo/View/Detail/Report/ServicesReportView.xaml
@@ -46,13 +46,16 @@
-
-
+
+
+ Margin="3" VerticalAlignment="Top" PopUpClick="popupedit_customer_PopUpClick" Cursor="Arrow" PreviewMouseDoubleClick="Popupedit_customer_OnPreviewMouseDoubleClick" Visibility="Collapsed"/>
+
+
@@ -97,7 +100,10 @@
Grid.Column="0" Height="400" Closed="popup_Closed" Opened="popup_Opened">
-
+
+
+
diff --git a/BeWo/View/Detail/Report/ServicesReportView.xaml.cs b/BeWo/View/Detail/Report/ServicesReportView.xaml.cs
index a3c5997a3..a0f77630f 100644
--- a/BeWo/View/Detail/Report/ServicesReportView.xaml.cs
+++ b/BeWo/View/Detail/Report/ServicesReportView.xaml.cs
@@ -33,12 +33,16 @@ namespace BeWo.View.Detail.Report
{
private CompactCustomerDC _Customer;
+ private CompactTeamDC _Team;
+
private CompactEmployeeDC _Employee;
private CompactOrganisationDC _Organisation;
public CompactCustomerDC Customer { get { return _Customer; } set { _Customer = value; } }
+ public CompactTeamDC Team { get { return _Team; } set { _Team = value; } }
+
public CompactEmployeeDC Employee { get { return _Employee; } set { _Employee = value; } }
public CompactOrganisationDC Organisation { get { return _Organisation; } set { _Organisation = value; } }
@@ -56,7 +60,7 @@ namespace BeWo.View.Detail.Report
InitializeComponent();
InitDateCombos();
InitServiceCategoryCombo();
-
+ InitFilterCombos();
//if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
//{
// checkbox_all.IsEnabled = false;
@@ -109,6 +113,12 @@ namespace BeWo.View.Detail.Report
popup_customer.IsOpen = false;
}
+ private void TeamSearchView_CustomerSelected(object sender, EventArgs e)
+ {
+ _Team = e.Data;
+ popupedit_team.Text = _Team.ToString();
+ popup_team.IsOpen = false;
+ }
private void EmployeeSearchView_EmployeeSelected(object sender, EventArgs e)
{
_Employee = e.Data;
@@ -192,6 +202,70 @@ namespace BeWo.View.Detail.Report
this.combobox_Endday.SelectedIndex = lastEndIndex;
}
+
+ private void InitFilterCombos()
+ {
+ var filterList = new List();
+
+ if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
+ {
+ filterList.Add(new QBFilterItem(QBFilterEnum.AlleKlienten));
+ }
+
+ if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
+ {
+ filterList.Add(new QBFilterItem(QBFilterEnum.NurKlientenMeinesTeams));
+ }
+ filterList.Add(new QBFilterItem(QBFilterEnum.MeineKlienten));
+ filterList.Add(new QBFilterItem(QBFilterEnum.KlientenAuswahl));
+
+ if (BeWoApp.LoggedOnUser.HasRight(UserRightType.TeamView_ViewMyTeams) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TeamView_ViewAll))
+ {
+ //Wenn man das Recht hat nur das eigene Team zu sehen aber nicht alle, muss man zumindest auch noch das Recht haben die Klienten des eigenen Teams zu sehen
+ if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
+ {
+ filterList.Add(new QBFilterItem(QBFilterEnum.TeamAuswahl));
+ }
+
+ }
+ else if (BeWoApp.LoggedOnUser.HasRight(UserRightType.TeamView_ViewAll))
+ {
+ //Wenn man das Recht hat alle Team zu sehen muss man auch das Recht haben alle Klienten zu sehen.
+ if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
+ {
+ filterList.Add(new QBFilterItem(QBFilterEnum.TeamAuswahl));
+ }
+
+ }
+
+ FilterComboBox.DisplayMemberPath = "Name";
+ FilterComboBox.ItemsSource = filterList;
+ FilterComboBox.SelectedIndex = 0;
+
+ FilterComboBox.SelectionChanged += FilterComboBox_SelectionChanged;
+
+ }
+
+ private void FilterComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ popupedit_customer.Visibility = Visibility.Collapsed;
+ popupedit_team.Visibility = Visibility.Collapsed;
+
+ QBFilterItem filterItem = FilterComboBox.SelectedItem as QBFilterItem;
+
+ if (filterItem != null)
+ {
+ if (filterItem.FilterEnum == QBFilterEnum.KlientenAuswahl)
+ {
+ popupedit_customer.Visibility = Visibility.Visible;
+ }
+ else if (filterItem.FilterEnum == QBFilterEnum.TeamAuswahl)
+ {
+ popupedit_team.Visibility = Visibility.Visible;
+ }
+ }
+ }
+
private void OrganisationSearchView_OrganisationSelected(object sender, EventArgs e)
{
_Organisation = e.Data;
@@ -201,14 +275,33 @@ namespace BeWo.View.Detail.Report
private void button_generate_Click(object sender, RoutedEventArgs e)
{
- long orgaOid = 0;
- long empOid = 0;
+
+ long? customerOid = 0;
+ long? teamOid = 0;
+ long? empOid = 0;
+ long? orgaOid = 0;
- if (checkbox_all.IsChecked.Value)
+
+ QBFilterItem filterItem = null;
+
+ if (FilterComboBox.SelectedItem != null)
+ {
+ filterItem = FilterComboBox.SelectedItem as QBFilterItem;
+ }
+
+ if (filterItem == null)
+ {
+ filterItem = new QBFilterItem(QBFilterEnum.AlleKlienten);
+ }
+
+ if (filterItem.FilterEnum != QBFilterEnum.KlientenAuswahl)
{
_Customer = null;
}
-
+ if (filterItem.FilterEnum != QBFilterEnum.TeamAuswahl)
+ {
+ _Team = null;
+ }
if (!chkForAllCostbearer.IsChecked.Value)
{
_Organisation = null;
@@ -219,10 +312,14 @@ namespace BeWo.View.Detail.Report
_Employee = null;
}
- if (!checkbox_all.IsChecked.Value && _Customer == null)
+ if (filterItem.FilterEnum == QBFilterEnum.KlientenAuswahl && _Customer == null)
{
MessageBox.Show(Translator.Translate("Bitte wählen Sie einen Klienten aus."), "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
}
+ else if (filterItem.FilterEnum == QBFilterEnum.TeamAuswahl && _Team == null)
+ {
+ MessageBox.Show(Translator.Translate("Bitte wählen Sie ein Team aus."), "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
else if (chkForAllCostbearer.IsChecked.Value && _Organisation == null)
{
MessageBox.Show(Translator.Translate("Bitte wählen Sie einen Kostenträger aus."), "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
@@ -247,27 +344,28 @@ namespace BeWo.View.Detail.Report
empOid = _Employee.EmployeeOid;
}
- var url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?";
+ if (_Team != null)
+ {
+ teamOid = _Team.TeamOid;
+ }
if (_Customer != null)
{
- //var month = new DateTime(DateTime.Now.Year, combobox_month.SelectedIndex + 1, 1);
- //ServiceFacade.DoCustomerServiceSync(r => r.UpdateQuittierungsCheckWithCustomer(_Customer.CustomerOid,BeWoApp.LoggedOnUser.Employee.EmployeeOid,month));
-
- url += "cOid=" + Customer.CustomerOid + "&type=" + Utils.EnumName(ReportTypes.ServiceOverviewSingleCustomer);
- }
- else
- {
- url += "type=" + Utils.EnumName(ReportTypes.ServiceOverviewAllCustomers);
+ customerOid = _Customer.CustomerOid;
}
- url += "&orgaOid=" + orgaOid + "&empOid=" + empOid + "&month=" + (combobox_month.SelectedIndex + 1) + "&year=" + combobox_year.SelectedItem + "&start=" + combobox_Startday.SelectedItem + "&end=" + combobox_Endday.SelectedItem;
+ var url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?";
+
+
+ url += "&ft=" + (int)filterItem.FilterEnum + "&cOid=" + customerOid + "&tOid=" + teamOid + "&orgaOid=" + orgaOid + "&empOid=" + empOid + "&month=" + (combobox_month.SelectedIndex + 1) + "&year=" + combobox_year.SelectedItem + "&start=" + combobox_Startday.SelectedItem + "&end=" + combobox_Endday.SelectedItem;
if (ChkForAllServiceCategories.IsChecked.HasValue && ChkForAllServiceCategories.IsChecked.Value)
{
url += "&scOid=" + ((ServiceCategoryDC)ServiceCategoriesComboBox.SelectedItem).ServiceCategoryOid;
}
+ url += "&type=" + Utils.EnumName(ReportTypes.ServicesOverviewNew);
+
//var tempToken = string.Empty;
//ServiceFacade.DoDownloadServiceSync(s => tempToken = s.CreateTemporaryToken(url, true));
//string addChar = (url.Contains("?")) ? "&" : "?";
@@ -306,6 +404,11 @@ namespace BeWo.View.Detail.Report
popup_employee.IsOpen = true;
}
+ private void popupedit_team_PopUpClick(object sender, RoutedEventArgs e)
+ {
+ popup_team.IsOpen = true;
+ }
+
private void Popupedit_customer_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || _Customer == null || !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
@@ -577,6 +680,38 @@ namespace BeWo.View.Detail.Report
}
+ public class QBFilterItem
+ {
+ public QBFilterItem(QBFilterEnum e)
+ {
+ FilterEnum = e;
+ }
+
+ public QBFilterEnum FilterEnum { get; set; }
+
+ public String Name
+ {
+ get
+ {
+ switch (FilterEnum)
+ {
+ case QBFilterEnum.AlleKlienten:
+ return Translator.Translate("Für alle Klienten");
+ case QBFilterEnum.NurKlientenMeinesTeams:
+ return Translator.Translate("Für Klienten meiner Teams");
+ case QBFilterEnum.MeineKlienten:
+ return Translator.Translate("Für meine Klienten");
+ case QBFilterEnum.KlientenAuswahl:
+ return Translator.Translate("Klient/in auswählen");
+ case QBFilterEnum.TeamAuswahl:
+ return Translator.Translate("Team auswählen");
+ }
+
+ return "";
+ }
+ }
+ }
+
//public class QuittierungsCheckView
//{
// public string Klient { get; set; }
diff --git a/BeWo/View/Detail/Report/TimeSheetMailView.xaml.cs b/BeWo/View/Detail/Report/TimeSheetMailView.xaml.cs
index 0823a038b..ce40a6ec2 100644
--- a/BeWo/View/Detail/Report/TimeSheetMailView.xaml.cs
+++ b/BeWo/View/Detail/Report/TimeSheetMailView.xaml.cs
@@ -188,7 +188,7 @@ namespace BeWo.View.Detail.Report
var vm = this.GridControlTimesheet.GetCurrentValue();
var url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?";
- url += "cOid=0&empOid=" + vm.Employee.EmployeeOid + "&type=" + Utils.EnumName(ReportTypes.ServiceOverviewSingleCustomer);
+ url += "cOid=0&empOid=" + vm.Employee.EmployeeOid + "&type=" + Utils.EnumName(ReportTypes.Stundenzettel);
url += "&orgaOid=0&month=" + (combobox_month.SelectedIndex + 1) + "&year=" + combobox_year.SelectedItem;
diff --git a/BeWo/ViewModel/InvoiceNumberVM.cs b/BeWo/ViewModel/InvoiceNumberVM.cs
index 373160578..373f93a46 100644
--- a/BeWo/ViewModel/InvoiceNumberVM.cs
+++ b/BeWo/ViewModel/InvoiceNumberVM.cs
@@ -12,12 +12,16 @@ namespace BeWo.ViewModel
public static string PropertyName_Use = "Use";
+ public static string PropertyName_Name = "Name";
+
private long _CurrentNumber;
private string _Pattern;
private bool _Use;
+ private string _Name;
+
#endregion
#region Constructors and Destructors
@@ -82,6 +86,23 @@ namespace BeWo.ViewModel
}
}
+ public string Name
+ {
+ get
+ {
+ return this._Name;
+ }
+
+ set
+ {
+ if (this.AreDifferent(this._Name, value))
+ {
+ this._Name = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Name, value), PropertyName_Name);
+ this.FirePropertyChanged(PropertyName_Name);
+ }
+ }
+ }
#endregion
#region Methods
@@ -91,6 +112,7 @@ namespace BeWo.ViewModel
this._Use = pDataContract.Use;
this._CurrentNumber = pDataContract.CurrentNumber;
this._Pattern = pDataContract.Pattern;
+ this._Name = pDataContract.Name;
}
protected override InvoiceNumberDC MapToDataContract(InvoiceNumberDC pDataContract, bool doCommit)
@@ -98,6 +120,7 @@ namespace BeWo.ViewModel
pDataContract.CurrentNumber = this._CurrentNumber;
pDataContract.Pattern = this._Pattern;
pDataContract.Use = this._Use;
+ pDataContract.Name = this._Name;
return this.DataContract;
}
diff --git a/BeWo/ViewModel/MandatorVM.cs b/BeWo/ViewModel/MandatorVM.cs
index a030ad3ae..8b509a21c 100644
--- a/BeWo/ViewModel/MandatorVM.cs
+++ b/BeWo/ViewModel/MandatorVM.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
@@ -64,16 +65,30 @@ namespace BeWo.ViewModel
private int _ZeiterfassungsSchwellwert;
+ private BindingList _InvoiceNumberList;
+
private InvoiceNumberVM _InvoiceNumber;
private string _Apikey;
- public MandatorVM(InvoiceNumberVM invoiceNumberVM, MandatorDC pDC) : base(pDC, true)
+ public MandatorVM(IList invoiceNumberList, MandatorDC pDC) : base(pDC, true)
{
- _InvoiceNumber = invoiceNumberVM;
+ _InvoiceNumberList = new BindingList(invoiceNumberList);
+ if (_InvoiceNumberList.Count > 0)
+ {
+ _InvoiceNumber = _InvoiceNumberList[0];
+ }
}
- public InvoiceNumberVM InvoiceNumber
+ public BindingList InvoiceNumberList
+ {
+ get
+ {
+ return _InvoiceNumberList;
+ }
+ }
+
+ public InvoiceNumberVM InvoiceNumber
{
get
{
@@ -400,7 +415,7 @@ namespace BeWo.ViewModel
{
get
{
- return (base.IsDirty || InvoiceNumber.IsDirty);
+ return (base.IsDirty || _InvoiceNumberList.Any(vm => vm.IsDirty));
}
}
diff --git a/Host/ReportView.aspx.cs b/Host/ReportView.aspx.cs
index ff433b506..9e13893f8 100644
--- a/Host/ReportView.aspx.cs
+++ b/Host/ReportView.aspx.cs
@@ -76,8 +76,14 @@ namespace Host
case ReportTypes.ServiceOverviewSingleCustomer:
report = CreateServiceOverviewSingleCustomerReport();
break;
+ case ReportTypes.Stundenzettel:
+ report = CreateServiceOverviewSingleCustomerReport();
+ break;
case ReportTypes.ServiceOverviewAllCustomers:
return CreateServiceOverviewAllCustomersReport();
+ case ReportTypes.ServicesOverviewNew:
+ report = CreateServiceOverviewNew();
+ break;
case ReportTypes.CustomerData:
report = CreateCustomerDataReport();
break;
@@ -360,7 +366,59 @@ namespace Host
return reportCreator.CreateServiceOverviewSingleCustomerReport(customerOid, month, year, orgaOid, empOid, scOid, startDay, endDay);
}
- private XtraReport CreateServiceRecordListReport()
+ private XtraReport CreateServiceOverviewNew()
+ {
+
+ int month = int.Parse(Request.Params["month"]);
+ int year = int.Parse(Request.Params["year"]);
+ int filterType = int.Parse(Request.Params["ft"]);
+
+ long? customerOid = null;
+ if (Request.Params["cOid"] != null)
+ {
+ customerOid = long.Parse(Request.Params["cOid"]);
+ }
+
+ long? teamOid = null;
+ if (Request.Params["tOid"] != null)
+ {
+ teamOid =long.Parse(Request.Params["tOid"]);
+ }
+
+ long? orgaOid = null;
+ if (Request.Params["orgaOid"] != null)
+ {
+ orgaOid = long.Parse(Request.Params["orgaOid"]);
+ }
+
+ long? empOid = null;
+ if (Request.Params["empOid"] != null)
+ {
+ empOid = long.Parse(Request.Params["empOid"]);
+ }
+
+ int startDay = 1;
+ if (Request.Params["start"] != null)
+ {
+ startDay = int.Parse(Request.Params["start"]);
+ }
+
+ int endDay = DateTime.DaysInMonth(year, month);
+ if (Request.Params["end"] != null)
+ {
+ endDay = int.Parse(Request.Params["end"]);
+ }
+
+ long? scOid;
+ if (Request.Params["scOid"] != null)
+ scOid = long.Parse(Request.Params["scOid"]);
+ else
+ scOid = null;
+
+ return reportCreator.CreateServiceOverviewReportNew(month, year, (QBFilterEnum)filterType, customerOid, teamOid, empOid, orgaOid, scOid, startDay, endDay);
+ }
+
+ private XtraReport CreateServiceRecordListReport()
{
long eOid = long.Parse(Request.Params["eOid"]);
long cOid = long.Parse(Request.Params["cOid"]);
diff --git a/Report/AbstractReportCreator.cs b/Report/AbstractReportCreator.cs
index 1433f5987..50858ac37 100644
--- a/Report/AbstractReportCreator.cs
+++ b/Report/AbstractReportCreator.cs
@@ -27,7 +27,9 @@ namespace BeWo.Report
public abstract XtraReport CreateServiceInvoiceReport(String dcIds, long? invoiceBaseOid);
- public abstract XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid,
+ public abstract XtraReport CreateServiceOverviewReportNew(int month, int year, QBFilterEnum filterType, long? customerOid, long? teamOid, long? empOid, long? orgaOid, long? serviceCategoryOid, int startDay, int endDay);
+
+ public abstract XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid,
long? serviceCategoryOid,
int startDay, int endDay);
diff --git a/Report/DefaultReportCreator.cs b/Report/DefaultReportCreator.cs
index f294d6140..3fc0fef86 100644
--- a/Report/DefaultReportCreator.cs
+++ b/Report/DefaultReportCreator.cs
@@ -375,7 +375,217 @@ namespace BeWo.Report
return lServiceOverviewSingleCustomerReport as XtraReport;
}
- public override XtraReport CreateSbdLeistungsnachweisForAllCustomers(int month, int year, long orgaOid, long empOid, long serviceCategoryOid, int startDay, int endDay)
+ public override XtraReport CreateServiceOverviewReportNew(int month, int year, QBFilterEnum filterType, long? customerOid, long? teamOid, long? empOid, long? orgaOid, long? serviceCategoryOid, int startDay, int endDay)
+ {
+ switch (filterType)
+ {
+ case QBFilterEnum.AlleKlienten:
+ return CreateServiceOverviewAllCustomersReport(month, year, orgaOid ?? 0, empOid ?? 0, serviceCategoryOid, startDay, endDay);
+ break;
+ case QBFilterEnum.NurKlientenMeinesTeams:
+ var list1 = GetKlientenOidsMeinesTeams(null);
+ return CreateServiceOverviewReportForCustomers(list1, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
+ break;
+ case QBFilterEnum.MeineKlienten:
+ var list2 = GetMeineKlientenOids();
+ return CreateServiceOverviewReportForCustomers(list2, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
+ break;
+ case QBFilterEnum.KlientenAuswahl:
+ return CreateServiceOverviewSingleCustomerReport(customerOid ?? 0, month, year, orgaOid ?? 0, empOid ?? 0, serviceCategoryOid, startDay, endDay);
+ break;
+ case QBFilterEnum.TeamAuswahl:
+ var list3 = GetKlientenOidsMeinesTeams(teamOid);
+ return CreateServiceOverviewReportForCustomers(list3, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
+ break;
+ }
+
+ return new XtraReport();
+ }
+
+ private IList GetMeineKlientenOids()
+ {
+ IList customerOids = new List();
+
+ ApplicationUser loggedInUser = null;
+
+ if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
+ {
+ loggedInUser = LoggedInUserOperationContextExt.Current.User;
+ }
+ else
+ {
+ loggedInUser = SessionFacade.LoggedInUser;
+ }
+
+ if (loggedInUser != null && loggedInUser.Employee != null)
+ {
+ foreach (var e2c in loggedInUser.Employee.Employee2CustomerList)
+ {
+ if (e2c.Customer.IsActive == ActivationTypeId.Active)
+ {
+ foreach (var v2o in e2c.ValueList)
+ {
+ if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
+ {
+ if (!customerOids.Contains(e2c.Customer.Oid.Value))
+ {
+ customerOids.Add(e2c.Customer.Oid.Value);
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+ return customerOids;
+ }
+
+ public virtual IList GetKlientenOidsMeinesTeams(long? teamOid)
+ {
+ IList customerOids = new List();
+
+ ApplicationUser loggedInUser = null;
+
+ if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
+ {
+ loggedInUser = LoggedInUserOperationContextExt.Current.User;
+ }
+ else
+ {
+ loggedInUser = SessionFacade.LoggedInUser;
+ }
+
+ if (loggedInUser != null && loggedInUser.Employee != null)
+ {
+ var teams = new List();
+
+ if (teamOid.HasValue)
+ {
+ teams.Add(DAOFactory.GenericDAO.LoadByID(teamOid.Value));
+ }
+ else
+ {
+ teams.AddRange(DAOFactory.SearchDAO.FindLeadingTeams(loggedInUser.Employee.Oid.Value));
+ teams.AddRange(DAOFactory.SearchDAO.FindTeamsOfEmployee(loggedInUser.Employee.Oid.Value));
+ }
+
+
+ foreach (var team in teams)
+ {
+ foreach (var employee in team.MemberList)
+ {
+ foreach (var e2c in employee.Employee2CustomerList)
+ {
+ if (e2c.Customer.IsActive == ActivationTypeId.Active)
+ {
+ foreach (var v2o in e2c.ValueList)
+ {
+ if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
+ {
+ if (!customerOids.Contains(e2c.Customer.Oid.Value))
+ {
+ customerOids.Add(e2c.Customer.Oid.Value);
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ return customerOids;
+ }
+
+ public virtual XtraReport CreateServiceOverviewReportForCustomers(IList customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay)
+ {
+ var roList = new List();
+
+ foreach (var coid in customerOids)
+ {
+ var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
+
+ if (ro != null)
+ {
+ roList.Add(ro);
+ }
+ }
+
+ var sortedList = roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
+
+ if (sortedList.Count > 0)
+ {
+ String reportId = null;
+ if (orgaOid.HasValue && orgaOid > 0)
+ {
+ var organisation = DAOFactory.GenericDAO.LoadByID(orgaOid.Value);
+ if (organisation != null)
+ reportId = organisation.Name;
+ }
+
+ var rootReport = CreateReportForServicesOverviewRo(sortedList[0], reportId);
+ if (rootReport.Pages.Count == 0)
+ {
+ rootReport.CreateDocument();
+ }
+
+
+ for (int i = 1; i < sortedList.Count; i++)
+ {
+ var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId);
+ if (lNext.Pages.Count == 0)
+ {
+ lNext.CreateDocument();
+ }
+
+ rootReport.Pages.AddRange(lNext.Pages);
+ }
+
+ return rootReport;
+ }
+ return new XtraReport();
+ }
+
+
+
+ public virtual XtraReport CreateReportForServicesOverviewRo(ServicesOverviewRO ro, String reportId)
+ {
+
+ var serviceOverviewReport = this.FindReportImp(reportId);
+ serviceOverviewReport.SetReportDataSource(ro);
+
+
+ return serviceOverviewReport as XtraReport;
+ }
+
+ public virtual XtraReport AddSubServicesOverviewReportToReport(XtraReport masterReport, IBeWoReport newReport, ServicesOverviewRO ro)
+ {
+ if (ro.Services.Count > 0)
+ {
+ newReport.SetReportDataSource(ro);
+ ((XtraReport)newReport).CreateDocument();
+ if (masterReport == null)
+ {
+ masterReport = newReport as XtraReport;
+ }
+ else
+ {
+ if (masterReport.Pages.Count == 0)
+ {
+ masterReport.CreateDocument();
+ }
+
+ masterReport.Pages.AddRange(((XtraReport)newReport).Pages);
+
+ }
+ }
+ return masterReport;
+ }
+
+ public override XtraReport CreateSbdLeistungsnachweisForAllCustomers(int month, int year, long orgaOid, long empOid, long serviceCategoryOid, int startDay, int endDay)
{
return CreateReportForStundenaufstellungROs(SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
@@ -647,5 +857,5 @@ namespace BeWo.Report
return report as XtraReport;
}
- }
+ }
}
\ No newline at end of file
diff --git a/Service/DCEntityMapper/InvoiceNumberDC_InvoiceNumber.cs b/Service/DCEntityMapper/InvoiceNumberDC_InvoiceNumber.cs
index 251b8dd1b..d27acbbb8 100644
--- a/Service/DCEntityMapper/InvoiceNumberDC_InvoiceNumber.cs
+++ b/Service/DCEntityMapper/InvoiceNumberDC_InvoiceNumber.cs
@@ -13,6 +13,7 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.CurrentNumber = pEntity.CurrentNumber;
pDataContract.Pattern = pEntity.Pattern;
pDataContract.Use = pEntity.Use;
+ pDataContract.Name = pEntity.Notice;
return pDataContract;
}
@@ -24,6 +25,7 @@ namespace BeWo.Service.DCEntityMapper
pEntity.CurrentNumber = pDataContract.CurrentNumber;
pEntity.Pattern = pDataContract.Pattern;
pEntity.Use = pDataContract.Use;
+ pEntity.Notice = pDataContract.Name;
return pEntity;
}
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index 72f2d413e..afac9f019 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -1046,4 +1046,14 @@ namespace BS.Shared
SubstitutionWanted = 2,
SubstitutionNeeded = 3
}
+
+ public enum QBFilterEnum
+ {
+ AlleKlienten,
+ NurKlientenMeinesTeams,
+ MeineKlienten,
+ KlientenAuswahl,
+ TeamAuswahl
+ }
+
}
\ No newline at end of file
diff --git a/Shared/DataContracts/InvoiceNumberDC.cs b/Shared/DataContracts/InvoiceNumberDC.cs
index 8ec839399..0b1dfa05a 100644
--- a/Shared/DataContracts/InvoiceNumberDC.cs
+++ b/Shared/DataContracts/InvoiceNumberDC.cs
@@ -20,5 +20,8 @@ namespace BS.Shared.DataContracts
[DataMember]
public bool Use { get; set; }
+
+ [DataMember]
+ public string Name { get; set; }
}
}
\ No newline at end of file
diff --git a/Shared/DataContracts/ReportTypes.cs b/Shared/DataContracts/ReportTypes.cs
index b2c1ae1b2..147ab9ebb 100644
--- a/Shared/DataContracts/ReportTypes.cs
+++ b/Shared/DataContracts/ReportTypes.cs
@@ -25,6 +25,8 @@
Employee,
Contract,
NotizenKategorie,
- SBDCharacteristics
+ SBDCharacteristics,
+ ServicesOverviewNew,
+ Stundenzettel
}
}
\ No newline at end of file