cb, Unterstützung von mehreren Rechnunungsnummern

This commit is contained in:
Christian
2020-09-15 13:14:43 +02:00
parent a49343786e
commit e60ea35935
16 changed files with 593 additions and 83 deletions

View File

@@ -17,7 +17,7 @@
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Grid.RenderTransform>
<Border CornerRadius="7,7,7,7" BorderThickness="2,2,2,2" Padding="5,5,5,5" BorderBrush="#FF606060" Background="{DynamicResource LoginBackgroundColor}">
<Border CornerRadius="7,7,7,7" BorderThickness="2,2,2,2" Padding="5,5,5,5" BorderBrush="#FF606060" Background="{DynamicResource LoginBackgroundColor}" KeyDown="UIElement_OnKeyDown">
<Grid Opacity="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
@@ -45,8 +45,8 @@
</StackPanel>
<Label Content="PIN:" Grid.Column="1" Grid.Row="1" Foreground="#FF000000" Background="#00000000" VerticalAlignment="Center" Visibility="{Binding Path=IsTechSupport, Converter={StaticResource BoolVisibilityConverter}}"/>
<TextBox x:Name="PINTextBox" Grid.Column="2" Grid.Row="1" Margin="10,0,20,0" Height="24" SnapsToDevicePixels="True" HorizontalAlignment="Stretch" Visibility="{Binding Path=IsTechSupport, Converter={StaticResource BoolVisibilityConverter}}"/>
<Label x:Name="lblPin" Content="PIN:" Grid.Column="1" Grid.Row="1" Foreground="#FF000000" Background="#00000000" VerticalAlignment="Center" Visibility="Collapsed"/>
<TextBox x:Name="PINTextBox" Grid.Column="2" Grid.Row="1" Margin="10,0,20,0" Height="24" SnapsToDevicePixels="True" HorizontalAlignment="Stretch" Visibility="Collapsed"/>
<Label Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Benutzername:" Foreground="#FF000000" Background="#00000000" />
<Label Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" Content="Passwort:" Foreground="#FF000000" Background="#00000000" />

View File

@@ -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

View File

@@ -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">
<Grid x:Name="root">
@@ -136,13 +137,34 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Content="Schema" Grid.Row="1" Margin="3" VerticalAlignment="Center" />
<TextBox Grid.Column="1" Grid.Row="1" Width="200" Margin="3" Height="23" Text="{Binding InvoiceNumber.Pattern}" />
<Label Content="Aktuelle Nummer" Grid.Row="2" Margin="3" VerticalAlignment="Center" />
<dxe:SpinEdit Name="spinedit_number" Grid.Column="1" Grid.Row="2" IsFloatValue="False"
<Label Content="Automatische Rechnungsnummer verwenden" Margin="3" VerticalAlignment="Center" />
<dxe:CheckEdit Grid.Column="1" Width="200" Margin="3" Height="23" IsChecked="{Binding InvoiceNumber.Use}" />
<Label x:Name="lblSchema" Content="Schema" Grid.Row="1" Margin="3" VerticalAlignment="Center" />
<TextBox x:Name="txtSchema" Grid.Column="1" Grid.Row="1" Width="200" Margin="3" Height="23" Text="{Binding InvoiceNumber.Pattern}" />
<Label x:Name="lblNumber" Content="Aktuelle Nummer" Grid.Row="2" Margin="3" VerticalAlignment="Center" />
<dxe:SpinEdit Name="spinedit_number" Grid.Column="1" Grid.Row="2" IsFloatValue="False" MaxValue="999999999"
Height="23" Width="200" EditValue="{Binding Path=InvoiceNumber.CurrentNumber, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource Int2DecimalConverter}}" />
<Label Content="Automatische Rechnungsnummer verwenden" Margin="3" VerticalAlignment="Center" />
<dxe:CheckEdit Grid.Column="1" Width="200" Margin="3" Height="23" IsChecked="{Binding InvoiceNumber.Use}" />
<dxg:GridControl x:Name="GridControlInvoiceNumbers" Margin="0,10,0,0" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" ItemsSource="{Binding InvoiceNumberList}">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Name" Header="Name" Width="100" SortOrder="Ascending" SortIndex="0" AllowEditing="False">
</dxg:GridColumn>
<dxg:GridColumn FieldName="Pattern" Header="Schema" Width="100">
</dxg:GridColumn>
<dxg:GridColumn FieldName="CurrentNumber" Header="Aktuelle Nummer" Width="100">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings DisplayFormat="0" Mask="########0" MaskType="Numeric"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" />
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</GroupBox>
</Grid>

View File

@@ -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<InvoiceNumberDC>();
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<InvoiceNumberVM>();
foreach (var indc in inl)
{
vmList.Add(new InvoiceNumberVM(indc));
}
this.ViewModel = new MandatorVM(vmList, m);
BeWoApp.Mandator = m;
})));
}

View File

@@ -46,13 +46,16 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ComboBox Height="23" x:Name="FilterComboBox" Margin="3" VerticalAlignment="Top" />
<CheckBox Margin="3 7" Name="checkbox_all" IsChecked="True" Content="Alle Klienten" Checked="CheckBox_Checked" />
<ComboBox Height="23" x:Name="FilterComboBox" Margin="3" VerticalAlignment="Top" MinWidth="180"/>
<uc:PopUpEdit IsReadOnly="True" Height="23" Grid.Row="0" Grid.Column="2"
x:Name="popupedit_customer" DeleteButtonVisibility="Collapsed"
Visibility="{Binding Path=IsChecked, ElementName=checkbox_all, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter='false'}"
Margin="3" VerticalAlignment="Top" PopUpClick="popupedit_customer_PopUpClick" Cursor="Arrow" PreviewMouseDoubleClick="Popupedit_customer_OnPreviewMouseDoubleClick" />
Margin="3" VerticalAlignment="Top" PopUpClick="popupedit_customer_PopUpClick" Cursor="Arrow" PreviewMouseDoubleClick="Popupedit_customer_OnPreviewMouseDoubleClick" Visibility="Collapsed"/>
<uc:PopUpEdit IsReadOnly="True" Height="23" Grid.Row="0" Grid.Column="2"
x:Name="popupedit_team" DeleteButtonVisibility="Collapsed"
Margin="3" VerticalAlignment="Top" PopUpClick="popupedit_team_PopUpClick" Cursor="Arrow" Visibility="Collapsed"/>
<Label Margin="0 2" Content="Monat" Grid.Row="0" Grid.Column="3" />
<ComboBox Height="23" x:Name="combobox_month" Grid.Row="0" Grid.Column="4" Margin="3" VerticalAlignment="Top" Width="90" />
@@ -97,7 +100,10 @@
Grid.Column="0" Height="400" Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:CustomerSearchView ItemSelected="CustomerSearchView_CustomerSelected" x:Name="customersearchview" />
</Popup>
<Popup Margin="10" Name="popup_team" StaysOpen="False" Placement="MousePoint" Width="400" Grid.Row="3"
Grid.Column="0" Height="400" Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:TeamSearchView ItemSelected="TeamSearchView_CustomerSelected" x:Name="teamsearchview" />
</Popup>
<Popup Margin="10" Name="popup_costbearer" StaysOpen="False" Placement="MousePoint" Width="400" Grid.Row="3"
Grid.Column="0" Height="400" Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:OrganisationSearchView SearchMode="CostBearer" ItemSelected="OrganisationSearchView_OrganisationSelected" x:Name="organisationsearchview" />

View File

@@ -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<CompactTeamDC> e)
{
_Team = e.Data;
popupedit_team.Text = _Team.ToString();
popup_team.IsOpen = false;
}
private void EmployeeSearchView_EmployeeSelected(object sender, EventArgs<CompactEmployeeDC> 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<QBFilterItem>();
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<CompactOrganisationDC> 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; }

View File

@@ -188,7 +188,7 @@ namespace BeWo.View.Detail.Report
var vm = this.GridControlTimesheet.GetCurrentValue<EmployeeTimesheetDetails>();
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;

View File

@@ -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;
}

View File

@@ -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<InvoiceNumberVM> _InvoiceNumberList;
private InvoiceNumberVM _InvoiceNumber;
private string _Apikey;
public MandatorVM(InvoiceNumberVM invoiceNumberVM, MandatorDC pDC) : base(pDC, true)
public MandatorVM(IList<InvoiceNumberVM> invoiceNumberList, MandatorDC pDC) : base(pDC, true)
{
_InvoiceNumber = invoiceNumberVM;
_InvoiceNumberList = new BindingList<InvoiceNumberVM>(invoiceNumberList);
if (_InvoiceNumberList.Count > 0)
{
_InvoiceNumber = _InvoiceNumberList[0];
}
}
public InvoiceNumberVM InvoiceNumber
public BindingList<InvoiceNumberVM> 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));
}
}

View File

@@ -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"]);

View File

@@ -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);

View File

@@ -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<long> GetMeineKlientenOids()
{
IList<long> customerOids = new List<long>();
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<long> GetKlientenOidsMeinesTeams(long? teamOid)
{
IList<long> customerOids = new List<long>();
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<Team>();
if (teamOid.HasValue)
{
teams.Add(DAOFactory.GenericDAO.LoadByID<Team>(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<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay)
{
var roList = new List<ServicesOverviewRO>();
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<Organisation>(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<ServicesOverviewRO>(reportId);
serviceOverviewReport.SetReportDataSource(ro);
return serviceOverviewReport as XtraReport;
}
public virtual XtraReport AddSubServicesOverviewReportToReport(XtraReport masterReport, IBeWoReport<ServicesOverviewRO> 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;
}
}
}
}

View File

@@ -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;
}

View File

@@ -1046,4 +1046,14 @@ namespace BS.Shared
SubstitutionWanted = 2,
SubstitutionNeeded = 3
}
public enum QBFilterEnum
{
AlleKlienten,
NurKlientenMeinesTeams,
MeineKlienten,
KlientenAuswahl,
TeamAuswahl
}
}

View File

@@ -20,5 +20,8 @@ namespace BS.Shared.DataContracts
[DataMember]
public bool Use { get; set; }
[DataMember]
public string Name { get; set; }
}
}

View File

@@ -25,6 +25,8 @@
Employee,
Contract,
NotizenKategorie,
SBDCharacteristics
SBDCharacteristics,
ServicesOverviewNew,
Stundenzettel
}
}