Merge alte Version

This commit is contained in:
Christian
2017-02-01 13:53:59 +01:00
parent 37a51d73f0
commit 21e230e568
123 changed files with 7103 additions and 3298 deletions

View File

@@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>D:\Projects\beyondsoft\BeWoPlaner\Publish\|C:\Projects\beyondsoft\BeWoPlaner\Publish\|D:\Projects\BEYONDSOFT\BeWoPlaner\Publish\|C:\Projects\BEYONDSOFT\BeWoPlaner\Publish\|C:\Projects\BEYONDSOFT\BeWoPlaner\Publish4\</PublishUrlHistory>
<InstallUrlHistory>http://app.beyondsoft.de/intern/|http://app.beyondsoft.de/deploy/|http://FOBP01.fortis-ev.org.local/|http://10.0.116.4/|http://app.beyondsoft.de/</InstallUrlHistory>
<InstallUrlHistory>http://app.beyondsoft.de/intern/|http://app.beyondsoft.de/|http://app.beyondsoft.de/deploy/|http://FOBP01.fortis-ev.org.local/|http://10.0.116.4/</InstallUrlHistory>
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />

View File

@@ -39,7 +39,7 @@ namespace BeWo
//public static string Version = "Version 2.0";
public static string Version = "Version 2.3";
public static string Version = "Version 2.3.3";
public static int RenderTier = 0;
@@ -426,11 +426,12 @@ namespace BeWo
String url = ServerAddress.ToLower();
#if DEBUG
url = String.Format("http://localhost/Host");
//url = String.Format("app1.bewoplaner.de/service");
//url = String.Format("http://localhost/Host");
url = String.Format("http://localhost:3777/Host");
//url = String.Format("app1.bewoplaner.de/service");
#endif
if (url.IndexOf("localhost") < 0)
if (url.IndexOf("localhost") < 0)
{
int i;

View File

@@ -5,6 +5,7 @@ using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
@@ -1424,46 +1425,58 @@ namespace BeWo.Core
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(path));
}
//public static void Richloaded(object sender, RoutedEventArgs e)
//{
// var richEditControl1 = (RichEditControl) sender;
// richEditControl1.ActiveViewType = RichEditViewType.Simple;
// richEditControl1.ShowBorder = false;
// richEditControl1.ShowHoverMenu = false;
// richEditControl1.CornerBoxVisibility = Visibility.Visible;
// richEditControl1.VerticalRulerVisibility = Visibility.Collapsed;
// richEditControl1.HorizontalRulerVisibility = Visibility.Collapsed;
// richEditControl1.Language = System.Windows.Markup.XmlLanguage.GetLanguage("de-DE");
//}
public static void WriteFile(string content, string path)
{
using (var uFileStream = File.Create(path))
using (var uSw = new StreamWriter(uFileStream, Encoding.GetEncoding(1252)))
uSw.Write(content);
//public static void Popupmenu(object sender, PopupMenuShowingEventArgs e)
//{
// foreach (var item in e.Menu.ItemLinks.Where(x => x.ActualIsVisible).Where(item => !(item is BarItemLinkSeparator)))
// {
// var btn = (BarButtonItemLink)item;
if (MessageBox.Show("Möchten Sie die Datei öffnen?", "Datei öffnen", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(path));
}
}
// if (btn.ActualContent.Equals("Lösche Zeile") ||
// btn.ActualContent.Equals("Lösche Spalte") ||
// btn.ActualContent.Equals("Lösche Zelle...") ||
// btn.ActualContent.Equals("Zellen verbinden") ||
// btn.ActualContent.Equals("Teile Zellen...") ||
// btn.ActualContent.Equals("Zellausrichtung") ||
// btn.ActualContent.Equals("AutoAnpassen") ||
// btn.ActualContent.Equals("Tabelleneigenschaften...") ||
// btn.ActualContent.Equals("Einzug erhöhen") ||
// btn.ActualContent.Equals("Einzug verringern") ||
// btn.ActualContent.Equals("Schriftart") ||
// btn.ActualContent.Equals("Absatz") ||
// btn.ActualContent.Equals("Nummerierun") ||
// btn.ActualContent.Equals("Lesezeichen...") ||
// btn.ActualContent.Equals("Hyperlink...") ||
// btn.ActualContent.Equals("Zeilenumbruch") ||
// btn.ActualContent.Equals("Eine Ebene nach vorne") ||
// btn.ActualContent.Equals("Eine Ebene nach hinten") ||
// btn.ActualContent.Equals("Layout"))
// item.IsVisible = false;
// }
//}
//public static void Richloaded(object sender, RoutedEventArgs e)
//{
// var richEditControl1 = (RichEditControl) sender;
// richEditControl1.ActiveViewType = RichEditViewType.Simple;
// richEditControl1.ShowBorder = false;
// richEditControl1.ShowHoverMenu = false;
// richEditControl1.CornerBoxVisibility = Visibility.Visible;
// richEditControl1.VerticalRulerVisibility = Visibility.Collapsed;
// richEditControl1.HorizontalRulerVisibility = Visibility.Collapsed;
// richEditControl1.Language = System.Windows.Markup.XmlLanguage.GetLanguage("de-DE");
//}
//public static void Popupmenu(object sender, PopupMenuShowingEventArgs e)
//{
// foreach (var item in e.Menu.ItemLinks.Where(x => x.ActualIsVisible).Where(item => !(item is BarItemLinkSeparator)))
// {
// var btn = (BarButtonItemLink)item;
// if (btn.ActualContent.Equals("Lösche Zeile") ||
// btn.ActualContent.Equals("Lösche Spalte") ||
// btn.ActualContent.Equals("Lösche Zelle...") ||
// btn.ActualContent.Equals("Zellen verbinden") ||
// btn.ActualContent.Equals("Teile Zellen...") ||
// btn.ActualContent.Equals("Zellausrichtung") ||
// btn.ActualContent.Equals("AutoAnpassen") ||
// btn.ActualContent.Equals("Tabelleneigenschaften...") ||
// btn.ActualContent.Equals("Einzug erhöhen") ||
// btn.ActualContent.Equals("Einzug verringern") ||
// btn.ActualContent.Equals("Schriftart") ||
// btn.ActualContent.Equals("Absatz") ||
// btn.ActualContent.Equals("Nummerierun") ||
// btn.ActualContent.Equals("Lesezeichen...") ||
// btn.ActualContent.Equals("Hyperlink...") ||
// btn.ActualContent.Equals("Zeilenumbruch") ||
// btn.ActualContent.Equals("Eine Ebene nach vorne") ||
// btn.ActualContent.Equals("Eine Ebene nach hinten") ||
// btn.ActualContent.Equals("Layout"))
// item.IsVisible = false;
// }
//}
public static void OpenMailClient(string mailAddress, string subject = "")
{
@@ -1768,7 +1781,7 @@ namespace BeWo.Core
}
public static PasswortSecurityStrength CheckPasswotrSecurity(string paswd)
public static PasswortSecurityStrength CheckPasswordSecurity(string paswd)
{
string zahlen = "0123456789";
string grossBuchstaben = "ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ";

View File

@@ -183,8 +183,8 @@ namespace BeWo
}
else if (uri.Host.IndexOf("fortis") >= 0)
{
BeWoProfile bp = new BeWoProfile("Fortis", "FOBP01.fortis-ev.org.local", "4526293996");
ProfileList.Add(bp);
BeWoProfile bp = new BeWoProfile("Fortis", "fortis-bewoplaner.fortis-ev.org.local", "4526293996");
ProfileList.Add(bp);
SaveProfileListToFile();
}
}
@@ -758,7 +758,7 @@ namespace BeWo
BeWoApp.UserName = lUserName;
BeWoApp.UserPassword = lPassword;
BeWoApp.PasswortStrength = BeWoUtils.CheckPasswotrSecurity(lPassword);
BeWoApp.PasswortStrength = BeWoUtils.CheckPasswordSecurity(lPassword);
ServiceFacade.DoUserServiceAsync(s2 => s2.LoadUserByLoginName(lUserName),
r2 =>

View File

@@ -66,6 +66,18 @@
</InlineUIContainer>
</Hyperlink>
</TextBlock>
<TextBlock HorizontalAlignment="Right" Width="Auto" Margin="0,2,5,0" Grid.Column="2">
<Hyperlink NavigateUri="http://www.bewoplaner.de" TargetName="newWindow" Foreground="Transparent" RequestNavigate="Hyperlink_OnRequestNavigate">
<InlineUIContainer>
<Image HorizontalAlignment="Left" Source="Ressources\Icons\bewoplaner_logo_small.png"
Style="{StaticResource toolbarImageStyle}" RenderTransformOrigin="0.5,0.5" x:Name="image2">
</Image>
</InlineUIContainer>
</Hyperlink>
</TextBlock>
<BeWo:BSLogoControl Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" Width="1000" Height="1000"
VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,-300,-250" x:Name="bSLogoControl"
RenderTransformOrigin="0.5,0.5">

View File

@@ -37,7 +37,7 @@ namespace BeWo.Scheduler
void InitNewAppointment(Appointment appointment);
bool FilterAppointment(string filterCategory, object selectedObject, Appointment appointment, bool showPrivateAppointments);
bool HideAppointment(string filterCategory, object selectedObject, Appointment appointment, bool showPrivateAppointments);
void InitChangedOccurrencyCustomFields(IEnumerable<SchedulerAppointmentDC> appList);
}

View File

@@ -375,7 +375,7 @@ namespace BeWo.Scheduler.View
IsEmployeeBrushVisible = true;
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen))
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen))
{
Cache.GetInstance().GetAllActiveEmployeesCompact(liste => this.Dispatch(() =>
{
@@ -526,15 +526,19 @@ namespace BeWo.Scheduler.View
private void UpdateDataSource(ISchedulerViewModel vm)
{
UpdateCustomFieldMappings(vm);
Scheduler.Storage.BeginUpdate();
UpdateCustomFieldMappings(vm);
Scheduler.Storage.EndUpdate();
IgnoreChangeEvents = true;
IgnoreChangeEvents = true;
Scheduler.Storage.AppointmentStorage.DataSource = vm.Appointments;
UpdateSchedulerSettings();
Scheduler.Storage.BeginUpdate();
foreach (var item in Scheduler.Storage.AppointmentStorage.Items)
UpdateSchedulerSettings();
int idx = 1;
foreach (var item in Scheduler.Storage.AppointmentStorage.Items)
{
var bapp = item.GetSourceObject(Scheduler.GetCoreStorage()) as IBeWoAppointment;
@@ -563,7 +567,8 @@ namespace BeWo.Scheduler.View
}
}
IgnoreChangeEvents = false;
Scheduler.Storage.EndUpdate();
IgnoreChangeEvents = false;
}
private void UpdateSchedulerSettings()
@@ -838,8 +843,8 @@ namespace BeWo.Scheduler.View
}
var appList = e.Objects.Cast<Appointment>().ToList();
if (appList.Any(f => f.CustomFields["IsPrivate"] != null && (bool)f.CustomFields["IsPrivate"]))
if (appList.Any(f => f.CustomFields["IsPrivate"] != null && (bool)f.CustomFields["IsPrivate"]))
{
ShowPrivateAppointmentsCheckBox.IsChecked = true;
}
@@ -857,10 +862,10 @@ namespace BeWo.Scheduler.View
}
var showOnlyPrivateApps = ShowPrivateAppointmentsCheckBox.IsChecked.HasValue && ShowPrivateAppointmentsCheckBox.IsChecked.Value;
if (showOnlyPrivateApps)
if (showOnlyPrivateApps)
{
e.Cancel = ViewModel.ActiveAppointmentViewModel.FilterAppointment("NurPrivate", null, ((Appointment) e.Object), true);
e.Cancel = ViewModel.ActiveAppointmentViewModel.HideAppointment("NurPrivate", null, ((Appointment) e.Object), true);
}
var me = MitarbeiterEbenenCheckBox.IsChecked.HasValue && MitarbeiterEbenenCheckBox.IsChecked.Value;
@@ -869,7 +874,7 @@ namespace BeWo.Scheduler.View
if ((me || ke || re) && !SelectedItems.Any())
{
e.Cancel = ViewModel.ActiveAppointmentViewModel.FilterAppointment("Ebenen", new List<bool> { me, re, ke }, ((Appointment)e.Object), showOnlyPrivateApps);
e.Cancel = ViewModel.ActiveAppointmentViewModel.HideAppointment("Ebenen", new List<bool> { me, re, ke }, ((Appointment)e.Object), showOnlyPrivateApps);
return;
}
@@ -879,18 +884,11 @@ namespace BeWo.Scheduler.View
;
if ((m.Any() || r.Any() || k.Any()) && ZeigeNurMeineTermineCheckBox.IsChecked == false)
{
e.Cancel = ViewModel.ActiveAppointmentViewModel.FilterAppointment("NachAuswahl", new Dictionary<string, object> { { "Mitarbeiter", m }, { "Ressourcen", r }, { "Klienten", k } }, ((Appointment)e.Object), showOnlyPrivateApps);
e.Cancel = ViewModel.ActiveAppointmentViewModel.HideAppointment("NachAuswahl", new Dictionary<string, object> { { "Mitarbeiter", m }, { "Ressourcen", r }, { "Klienten", k } }, ((Appointment)e.Object), showOnlyPrivateApps);
return;
}
var abc = ((Appointment) e.Object).Subject;
if (abc.Equals("Ohne Chandler"))
{
}
e.Cancel = ViewModel.ActiveAppointmentViewModel.FilterAppointment("NurEigene", new Dictionary<string, object> { { "Mitarbeiter", m }, { "Ressourcen", r }, { "Klienten", k }, {"Teams", EmployeesTeams} }, ((Appointment)e.Object), showOnlyPrivateApps);
e.Cancel = ViewModel.ActiveAppointmentViewModel.HideAppointment("NurEigene", new Dictionary<string, object> { { "Mitarbeiter", m }, { "Ressourcen", r }, { "Klienten", k }, {"Teams", EmployeesTeams} }, ((Appointment)e.Object), showOnlyPrivateApps);
}
private void NewSchedulerStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e)
@@ -995,43 +993,35 @@ namespace BeWo.Scheduler.View
{
var darfTerminDetailsSehen = true;
var appointment = e.Appointment;
var originator = (CompactEmployeeDC) appointment.CustomFields["Originator"];
var ersteller = (CompactEmployeeDC) appointment.CustomFields["Originator"];
var mitarbeiterliste = (List<Employee2SchedulerAppointmentDC>)appointment.CustomFields["EmployeeList"];
var hatMitarbeiter = mitarbeiterliste.Count > 0 && !(mitarbeiterliste.Count == 1 && mitarbeiterliste.ElementAt(0).Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid));
var hatNurAndereMitarbeiter = mitarbeiterliste.Count > 0 && !(mitarbeiterliste.Count == 1 && mitarbeiterliste.ElementAt(0).Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid));
var hatKlienten = ((List<CompactCustomerDC>) appointment.CustomFields["CustomerList"]).Count > 0;
//var hatRessourcen = ((List<ResourceDC>) apt.CustomFields["ResourceList"]).Count > 0;
bool istErsteller = ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid);
if (hatMitarbeiter)
//var hatRessourcen = ((List<ResourceDC>) apt.CustomFields["ResourceList"]).Count > 0;
if (hatNurAndereMitarbeiter || !istErsteller)
{
darfTerminDetailsSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern);
}
darfTerminDetailsSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern);
}
if (hatKlienten)
{
darfTerminDetailsSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern);
}
}
//if (hatRessourcen)
//{
// darfTerminDetailsSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern);
//}
if (hatNurAndereMitarbeiter && !darfTerminDetailsSehen)
{
darfTerminDetailsSehen = mitarbeiterliste.Select(ml => ml.Employee).Any(a => a.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) || istErsteller;
}
//if (hatRessourcen && !o.Equals(BeWoApp.LoggedOnEmployeeCompact))
//{
// darfTerminDetailsSehen = BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAndererAendern);
//}
if (darfTerminDetailsSehen == false)
{
darfTerminDetailsSehen = mitarbeiterliste.Select(ml => ml.Employee).Any(a => a.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) || originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid);
}
if (!originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && (bool)appointment.CustomFields["IsPrivate"] && !mitarbeiterliste.Any(em => em.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)))
if (!istErsteller && ((bool)appointment.CustomFields["IsPrivate"]) && !mitarbeiterliste.Any(em => em.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)))
{
darfTerminDetailsSehen = false;
}
e.Allow = darfTerminDetailsSehen;
}

View File

@@ -1,10 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Core.Service;
using BS.Shared.Core;
using BeWo.Scheduler.View;
using BeWo.ServiceProxy;
using BeWo.ViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using DevExpress.XtraPrinting.Native;
using DevExpress.XtraScheduler;
namespace BeWo.Scheduler.ViewModel
@@ -14,8 +20,8 @@ namespace BeWo.Scheduler.ViewModel
public event EventHandler<EventArgs<ISchedulerViewModel>> ViewModelChanged;
private ISchedulerViewModel mActiveAppointmentViewModel;
public ISchedulerViewModel ActiveAppointmentViewModel
private Dictionary<ValueListEntryDC, List<ResourceDC>> mAllCats2ResInDic;
public ISchedulerViewModel ActiveAppointmentViewModel
{
get
{
@@ -38,16 +44,58 @@ namespace BeWo.Scheduler.ViewModel
public void UpdateAppointmentViewModel(DateTime intervalStart, DateTime intervalEnd)
{
VMFactory.CreateNewSchedulerAppointmentListVM(cb =>
{
ActiveAppointmentViewModel = cb;
SchedulerSettings = GetActiveSettings();
SchedulerSettings.StartDate = intervalStart;
BeWoApp.MainControl.AufOffeneTerminePruefen();
}, intervalStart - NewSchedulerView.FetchPadding, intervalEnd + NewSchedulerView.FetchPadding);
}
BeWoApp.MainControl.StartWaiting();
public AbstractAppointmentEditForm GetEditAppointmentForm(DevExpress.Xpf.Scheduler.SchedulerControl control, Appointment appointment)
if (!BeWoApp.LoggedOnEmployee.EmployeeOid.HasValue)
{
return;
}
var allEmps = new List<CompactEmployeeDC>();
var appointments = new List<SchedulerAppointmentDC>();
var allCust = new List<CompactCustomerDC>();
allEmps = Cache.GetInstance().GetAllActiveEmployeesCompactSync();
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen))
{
ServiceFacade.DoEmployeeServiceSync(es => allEmps = new List<CompactEmployeeDC> { es.LoadCompactEmployee(BeWoApp.LoggedOnEmployee.EmployeeOid.Value) });
}
if (mAllCats2ResInDic == null)
{
ServiceFacade.DoResourceServiceSync(s => mAllCats2ResInDic = s.GetAllCategories2ResourcesInDictionary());
}
var start = intervalStart - NewSchedulerView.FetchPadding;
var end = intervalEnd + NewSchedulerView.FetchPadding;
ServiceFacade.DoResourceServiceSync(rs => appointments = rs.GetAllActiveAppointmentsForEmployeeInInterval2(start, end, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)));
allCust = Cache.GetInstance().GetAllActiveCustomersCompactSync();
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
{
allCust = allCust.Where(c => BeWoApp.LoggedOnEmployee.RelatedCustomers.Any(a => a.Customer.Equals(c))).ToList();
}
var prefilteredAppointments = appointments.Where(w => ((w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ||
w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))) ||
BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) && (!w.EmployeeList.TrueForAll(e2a => e2a.ParticipationAnswer == ParticipationAnswer.Absage) || w.EmployeeList.IsEmpty()));
var vm = new SchedulerAppointmentListVM(prefilteredAppointments.ToList(), allCust, allEmps, mAllCats2ResInDic);
ActiveAppointmentViewModel = vm;
SchedulerSettings = GetActiveSettings();
SchedulerSettings.StartDate = intervalStart;
BeWoApp.MainControl.EndWaiting();
//BeWoApp.MainControl.AufOffeneTerminePruefen();
}
public AbstractAppointmentEditForm GetEditAppointmentForm(DevExpress.Xpf.Scheduler.SchedulerControl control, Appointment appointment)
{
return ActiveAppointmentViewModel != null ? ActiveAppointmentViewModel.GetEditAppointmentForm(control, appointment) : null;
}

View File

@@ -432,119 +432,101 @@ namespace BeWo.Scheduler.ViewModel
appointment.StatusId = 0;
}
public bool FilterAppointment(string filterCategory, object selectedObject, Appointment appointment, bool showPrivateAppointments)
{
var wirdAngezeigt = true; // -> wird standardmäßig angezeigt
public bool HideAppointment(string filterCategory, object selectedObject, Appointment appointment, bool showPrivateAppointments)
{
var wirdAngezeigt = true; // -> wird standardmäßig angezeigt
if(showPrivateAppointments)
if (appointment.CustomFields["IsPrivate"] != null)
{
var isPrivate = Convert.ToBoolean(appointment.CustomFields["IsPrivate"]);
if(!isPrivate)
return true;
}
bool isPrivate = false;
if (appointment.CustomFields["IsPrivate"] != null)
{
isPrivate = Convert.ToBoolean(appointment.CustomFields["IsPrivate"]);
}
switch (filterCategory)
{
case "NurEigene":
var resourceList = (List<ResourceDC>) appointment.CustomFields["ResourceList"];
if (resourceList != null && resourceList.Any())
{
break;
}
if (showPrivateAppointments && !isPrivate)
{
return true;
}
var emps = (List<Employee2SchedulerAppointmentDC>)appointment.CustomFields["EmployeeList"];
var orig = (CompactEmployeeDC) appointment.CustomFields["Originator"];
var cus = (List<CompactCustomerDC>) appointment.CustomFields["CustomerList"];
var hatEigeneKlienten = false;
var teams = (List<CompactTeamDC>)((Dictionary<string, object>)selectedObject)["Teams"];
var ersteller = (CompactEmployeeDC)appointment.CustomFields["Originator"];
var employeeList = (List<Employee2SchedulerAppointmentDC>)appointment.CustomFields["EmployeeList"];
var customerList = (List<CompactCustomerDC>)appointment.CustomFields["CustomerList"];
var resourceList = (List<ResourceDC>)appointment.CustomFields["ResourceList"];
if (cus != null)
{
hatEigeneKlienten = cus.Select(sel => sel.CustomerOid).Intersect(BeWoApp.LoggedOnEmployee.RelatedCustomers.Select(se => se.Customer.CustomerOid)).Any() ||
cus.Any(c => c.RelatedTeamOids != null && c.RelatedTeamOids.Intersect(teams.Select(t => t.TeamOid)).Any());
}
if (isPrivate)
{
if (ersteller == null || !ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))
{
return true;
}
}
switch (filterCategory)
{
case "NurEigene":
var istEigenerTermin = (ersteller != null && ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && employeeList != null && employeeList.Count == 0) ||
(employeeList != null && employeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)));
// Ursprünglich: var isOriginatorWithoutParticipants = (orig != null && orig.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && (emps != null && (emps.Count == 0 || emps.Count == 1 && emps.Any(a => a.Employee.Equals(orig)))));
wirdAngezeigt = istEigenerTermin;
var isOriginatorWithoutParticipants = (orig != null && orig.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && ((emps != null && emps.Count == 1 && emps.Any(a => a.Employee.Equals(orig)))) || emps != null && emps.Count == 0);
break;
case "NachAuswahl":
var dictionary = (Dictionary<string, object>)selectedObject;
var ressourcen = (List<ResourceDC>)dictionary["Ressourcen"];
var mitarbeiter = (List<CompactEmployeeDC>)dictionary["Mitarbeiter"];
var klienten = (List<CompactCustomerDC>)dictionary["Klienten"];
var istEigenerTermin = (orig != null && orig.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && emps != null && emps.Count == 0) ||
(emps != null && emps.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)));
var empsContainsEmployeesExceptOriginator = emps != null && emps.Count > 0 && orig != null && (orig.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && false == emps.Any(a => a.Employee.Equals(orig)));
// Eingeloggter muss Originator oder in der Liste sein oder er darf Termine anderer ansehen
wirdAngezeigt = istEigenerTermin;//isOriginatorWithoutParticipants || false == empsContainsEmployeesExceptOriginator;// orig != null && (orig.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) && (emps != null && emps.Count == 0))
//|| emps != null && emps.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)) && emps.Count == 1
//|| hatEigeneKlienten;
//|| BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen);
// false -> wird ignoriert (herausgefiltert)
//wirdAngezeigt = isOriginatorWithoutParticipants || empsContainsEmployeesExceptOriginator == false || BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen);
var cfe = (employeeList == null ? new List<CompactEmployeeDC>() : employeeList.Select(s => s.Employee).ToList());
var cfr = resourceList ?? new List<ResourceDC>();
var cfc = customerList ?? new List<CompactCustomerDC>();
break;
case "NachAuswahl":
var dictionary = (Dictionary<string, object>) selectedObject;
var ressourcen = (List<ResourceDC>) dictionary["Ressourcen"];
var mitarbeiter = (List<CompactEmployeeDC>) dictionary["Mitarbeiter"];
var klienten = (List<CompactCustomerDC>) dictionary["Klienten"];
var hasOnlyOriginatorInCommon = employeeList != null && ersteller != null && employeeList.Any() == false && mitarbeiter.Contains(ersteller);
var originator = appointment.CustomFields["Originator"] as CompactEmployeeDC;
var appEL = (List<Employee2SchedulerAppointmentDC>) appointment.CustomFields["EmployeeList"];
var appRL = (List<ResourceDC>) appointment.CustomFields["ResourceList"];
var appCL = (List<CompactCustomerDC>) appointment.CustomFields["CustomerList"];
var m = cfe.Intersect(mitarbeiter).ToList();
var r = cfr.Intersect(ressourcen).ToList();
var k = cfc.Intersect(klienten).ToList();
var cfe = (appEL == null ? new List<CompactEmployeeDC>() : appEL.Select(s=>s.Employee).ToList());
var cfr = appRL ?? new List<ResourceDC>();
var cfc = appCL ?? new List<CompactCustomerDC>();
wirdAngezeigt = (m.Any() || k.Any() || r.Any()) || hasOnlyOriginatorInCommon;
break;
case "Ebenen":
var liste = (List<bool>)selectedObject; // mkr
var appEList = employeeList.Where(w => !w.Employee.Equals(appointment.CustomFields["Originator"])).ToList();
var hasOnlyOriginatorInCommon = appEL!=null && originator != null && appEL.Any() == false && mitarbeiter.Contains(originator);
// Ersteller und Rechte beachten
var m = cfe.Intersect(mitarbeiter).ToList();
var r = cfr.Intersect(ressourcen).ToList();
var k = cfc.Intersect(klienten).ToList();
var istEigen = ersteller.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid);
wirdAngezeigt = (m.Any() || k.Any() || r.Any()) || hasOnlyOriginatorInCommon;
break;
case "Ebenen":
var liste = (List<bool>) selectedObject; // mkr
var appEList = ((List<Employee2SchedulerAppointmentDC>) appointment.CustomFields["EmployeeList"]).Where(w => !w.Employee.Equals(appointment.CustomFields["Originator"])).ToList();
var appRList = (List<ResourceDC>) appointment.CustomFields["ResourceList"];
var appCList = (List<CompactCustomerDC>) appointment.CustomFields["CustomerList"];
var mVorhanden = appEList.Any(a2app => mAllEmployees.Contains(a2app.Employee));
var kVorhanden = customerList.Any(mAllCustomers.Contains);
// Ersteller und Rechte beachten
var o = (CompactEmployeeDC) appointment.CustomFields["Originator"];
var istEigen = o.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid);
wirdAngezeigt = liste[0] && mVorhanden || liste[1] && resourceList.Any() || liste[2] && kVorhanden;
var mVorhanden = appEList.Any(a2app => mAllEmployees.Contains(a2app.Employee));
var kVorhanden = appCList.Any(mAllCustomers.Contains);
wirdAngezeigt = liste[0] && mVorhanden || liste[1] && appRList.Any() || liste[2] && kVorhanden;
// Nur Ansehen
// Nur Ansehen
if (!istEigen && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen) && liste[0] && mVorhanden && !appEList.Select(e2sa => e2sa.Employee).Any(a => a.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid)))
{
wirdAngezeigt = false;
}
if (!istEigen && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen) && liste[2] && kVorhanden)
{
wirdAngezeigt = false;
}
if (!istEigen && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen) && liste[1] && appRList.Any())
{
wirdAngezeigt = false;
}
if (!istEigen && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen) && liste[2] && kVorhanden)
{
wirdAngezeigt = false;
}
break;
}
if (!istEigen && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen) && liste[1] && resourceList.Any())
{
wirdAngezeigt = false;
}
return !wirdAngezeigt;
}
break;
}
public void InitChangedOccurrencyCustomFields(IEnumerable<SchedulerAppointmentDC> appList)
return !wirdAngezeigt;
}
public void InitChangedOccurrencyCustomFields(IEnumerable<SchedulerAppointmentDC> appList)
{
changedOccurencyCustomFields = new Dictionary<Guid, Dictionary<string, Dictionary<string, object>>>();
foreach (var termin in appList)

View File

@@ -161,7 +161,21 @@ namespace BeWo.ServiceProxy
}
}
public static void DoEmployeeServiceAsync<T>(Func<IEmployeeService, T> pFunc, Action<T> pCallBack, bool showWaitDialog)
public static T DoDownloadServiceSync<T>(Func<IDownloadService, T> pFunc)
{
try
{
return pFunc.Invoke(GetInstance<DownloadServiceClient, IDownloadService>());
}
catch (Exception e)
{
ShowErrorMessage(e);
}
return default(T);
}
public static void DoEmployeeServiceAsync<T>(Func<IEmployeeService, T> pFunc, Action<T> pCallBack, bool showWaitDialog)
{
DoAsync<EmployeeServiceClient, IEmployeeService, T>(pFunc, pCallBack, showWaitDialog);
}

View File

@@ -319,7 +319,7 @@ namespace BeWo.View
{
var mitarbeiter = ServiceFacade.DoEmployeeServiceSync(s => s.GetEmployeeWithPersonOid(personoid));
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname,StatusType.Online, BuildImg(mitarbeiter.EmployeeImage,ChatType.Mitarbeiter), personoid, ChatType.Mitarbeiter);//"Online"
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname,StatusType.Online, BuildImgList(mitarbeiter.Images,ChatType.Mitarbeiter), personoid, ChatType.Mitarbeiter);//"Online"
var zugehorigkeit = ServiceFacade.DoEmployeeServiceSync(s => s.GetTeamOidsByEmployee(personoid));
@@ -354,7 +354,7 @@ namespace BeWo.View
customerCompact.LastName = klienten.LastName;
customerCompact.DateOfBirth = klienten.DateOfBirth;
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname, StatusType.Online, BuildImg(klienten.CustomerImage,ChatType.Klienten), personoid, ChatType.Klienten, customerCompact);//"Online"
KontaktlistBuilder konbuild = new KontaktlistBuilder(clientname, StatusType.Online, BuildImgList(klienten.Images,ChatType.Klienten), personoid, ChatType.Klienten, customerCompact);//"Online"
foreach (var variable in ita)
{
@@ -600,7 +600,7 @@ namespace BeWo.View
foreach (var team in employeeteamoids)
{
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, StatusType.Offline, BuildImg(null,ChatType.Team), team.TeamOid, ChatType.Team));
Clientlist.Items.Add(new KontaktlistBuilder(team.Name, StatusType.Offline, BuildImg(null, ChatType.Team), team.TeamOid, ChatType.Team));
}
foreach (var list in offmitarbeiter)
@@ -1299,19 +1299,25 @@ namespace BeWo.View
MessageBox.Show("Beim Auswählen eines Users ist ein Fehler aufgetreten. " + s.Message + "\n" + s.StackTrace, "Fehler: 2280 ", MessageBoxButton.OK);
}
}
public ImageSource BuildImg(Byte[] c ,ChatType x)
public ImageSource BuildImgList(List<Byte[]> images, ChatType x)
{
if (images != null && images.Count > 0)
{
return BuildImg(images[0], x);
}
return null;
}
public ImageSource BuildImg(Byte[] image, ChatType x)
{
try
{
if (c != null)
if (image != null)
{
var biImg = new BitmapImage();
using (var ms = new MemoryStream(c))
using (var ms = new MemoryStream(image))
{
biImg.BeginInit();
biImg.StreamSource = ms;

207
BeWo/View/ChatWindow.xaml Normal file
View File

@@ -0,0 +1,207 @@
<Window x:Class="BeWo.View.ChatWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BeWo.View"
mc:Ignorable="d"
Title="Chat" Height="300" Width="300" WindowStartupLocation="CenterScreen" >
<Grid >
<GroupBox Header="Chat" x:Name="rootGroupBox" Style="{DynamicResource MainContentGroupBoxWithoutMaximizeBtnStyle}" MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown">
<Grid Background="{StaticResource ObjectEditBackgroundBrush}" >
<TextBox x:Name="ServerStats" Height="23" Margin="539,13,7,0" TextWrapping="Wrap" VerticalAlignment="Top" ToolTip="Server Info" IsEnabled="False" VerticalContentAlignment="Center">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Padding" Value="10,0,0,0" />
</Style>
</TextBox.Resources>
</TextBox>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBox x:Name="Chatbox" HorizontalAlignment="Left" Margin="221,720,0,10" TextWrapping="Wrap" Text="Nachricht schreiben" TextChanged="Chatbox_OnTextChanged" VerticalScrollBarVisibility="Auto" MaxLines="5" MaxHeight="70"
VerticalContentAlignment="Center" Width="416" MinHeight="25" ToolTip="Schreiben Sie hier eine Nachricht hinein" KeyDown="OnKeyDownHandler" GotFocus="OnFocus" Foreground="DarkGray" >
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Padding" Value="10,0,0,0" />
</Style>
</TextBox.Resources>
</TextBox>
<Button HorizontalAlignment="Left" x:Name="EmojiButton" Margin="642,720,-18,0" VerticalAlignment="Top" Width="23" Height="25" Click="SmileyButton_OnClick">
<Image x:Name="Smiley" ToolTip="Smiley einfügen" Source="/BeWoPlaner;component/Ressources/Icons/trauriges-smiley.png" />
</Button>
</Grid>
<ListBox x:Name="Chat" HorizontalAlignment="Left" Height="630" Margin="221,64,0,0" VerticalAlignment="Top" Width="564" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" SelectionMode="Extended" MouseRightButtonDown="OnRightClickEvent" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalAlignment" Value="{Binding Posi}" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Padding" Value="10,0,0,0" />
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="{Binding ChatColor}" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" Background="{Binding ChatColor}">
<DockPanel MinHeight="15" Margin="5" LastChildFill="True" Background="{Binding ChatColor}" >
<StackPanel DockPanel.Dock="Bottom" >
<TextBlock VerticalAlignment="Center" Text="{Binding UserMessage}" MinWidth="0" MaxWidth="500" TextWrapping="Wrap" />
</StackPanel>
<StackPanel DockPanel.Dock="Left" Margin="0,0,0,5">
<TextBlock Text="{Binding Username}" FontWeight="Bold" MaxWidth="150" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel DockPanel.Dock="Right" Margin="5,0,0,5">
<TextBlock Text="{Binding SendTime}" MaxWidth="350" HorizontalAlignment="Right" TextAlignment="Right" VerticalAlignment="Center"/>
</StackPanel>
</DockPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<!-- <ListBox.ItemsPanel> falls der Text von unten kommen soll
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="Bottom"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>-->
</ListBox>
<!--###################################### Liste aller User mit Chat Berechtigung ######################################################-->
<ListView x:Name="Clientlist" HorizontalAlignment="Left" Height="680" Margin="10,64,0,0" VerticalAlignment="Top" Width="206" SelectionChanged="ListBoxSelectedIndexChanged" Style="{DynamicResource ResourceKey=styleListBox}" ItemTemplate="{DynamicResource DataTemplate1}">
<ListView.Resources>
<DataTemplate x:Key="DataTemplate1">
<Grid Margin="15,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="35"/>
<ColumnDefinition Width="15"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="25"/>
</Grid.ColumnDefinitions>
<Border BorderThickness="0.25" CornerRadius="3" Grid.RowSpan="2" Grid.ColumnSpan="4" Background="White" >
<Border.BorderBrush>
<SolidColorBrush Color="Black" />
</Border.BorderBrush>
</Border>
<Ellipse Width='30' Height='30'>
<Ellipse.Fill>
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' />
</Ellipse.Fill>
</Ellipse>
<StackPanel Grid.Column="1" Height="30" >
<Ellipse Width='15' Height='15' Fill="{Binding Path=Color}" Margin="0,6,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Fill" />
</StackPanel>
<StackPanel Grid.Column="2" Margin="5" >
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
</StackPanel>
<TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />
</StackPanel>
<!--Für die anzeige der anzahl ungelesener Nachrichten Height="30"-->
<StackPanel Grid.Column="3" Margin="5">
<TextBlock Text="{Binding Path=Receivems}" FontWeight="Bold" Foreground="DarkRed" />
</StackPanel>
</Grid>
</DataTemplate>
</ListView.Resources>
<!--Uberschríft Mitarbeiter, ItemCount-->
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Expander IsExpanded="True">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="Black" FontSize="18" VerticalAlignment="Bottom" />
<TextBlock Text="{Binding ItemCount}" FontSize="12" Foreground="OrangeRed" FontWeight="Bold" FontStyle="Italic" Margin="10,0,0,0" VerticalAlignment="Bottom" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
<!--###################################### Ende Liste #######################################################-->
<Button x:Name="SendButton" Content="Senden" HorizontalAlignment="Left" Margin="672,720,0,0" VerticalAlignment="Top" Width="111" Click="SendButton_Click" Height="25"/>
<Label Content="Aktuelle Liste:" HorizontalAlignment="Left" Margin="10,41,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.622,0.045" Width="132"/>
</Grid>
</GroupBox>
<!-- Online | Offline | Beschäftigt -->
<ComboBox x:Name="StatusSetting" HorizontalAlignment="Left" Margin="17,53,0,0" VerticalAlignment="Top" Width="100" SelectionChanged="ComboBox_SelectionChanged"/>
<ListBox x:Name="AktChatUser" HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" Height="50" Margin="228,52,0,0" VerticalAlignment="Top" Width="312" ItemTemplate="{DynamicResource DataTemplate2}">
<ListBox.Resources>
<DataTemplate x:Key="DataTemplate2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<!-- <Border Margin="5" BorderBrush="DarkGray" BorderThickness="1"> -->
<Ellipse Width='30' Height='30'>
<Ellipse.Fill>
<ImageBrush ImageSource='{Binding Image}' Stretch='Fill' />
</Ellipse.Fill>
</Ellipse>
<!-- <Image Source="{Binding Path=Image}" Stretch="Fill" Width="30" Height="30" />-->
<!-- </Border> -->
<StackPanel Grid.Column="1" Margin="5">
<StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" >
<TextBlock Text="{Binding Path=Name, FallbackValue=FirstName}" />
</StackPanel>
<TextBlock Text="{Binding Path=StatusTyp, FallbackValue=Message}" />
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.Resources>
</ListBox>
<Button Style="{DynamicResource IconButtonStyle}" x:Name="ButtonAlarmLabel" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Left" Height="20" Margin="725,10,0,0" VerticalAlignment="Top" Width="20" Visibility="Collapsed" >
<Image x:Name="AlarmLabel" ToolTip="Zurzeit nicht Verbunden" Source="" />
</Button>
</Grid>
</Window>

1514
BeWo/View/ChatWindow.xaml.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -234,16 +234,15 @@ namespace BeWo.View.Detail
if (_ViewModel.CustomerImage != null)
{
var biImg = new BitmapImage();
var ms = new MemoryStream(_ViewModel.CustomerImage);
biImg.BeginInit();
biImg.StreamSource = ms;
biImg.EndInit();
var imgSrc = biImg as ImageSource;
Img.Source = biImg;
using (var ms = new System.IO.MemoryStream(_ViewModel.CustomerImage))
{
var image = new BitmapImage();
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad; // here
image.StreamSource = ms;
image.EndInit();
Img.Source = image;
}
}
Img.EditValueChanged += Image_EditValueChanged;

View File

@@ -110,7 +110,8 @@
<Grid x:Name="grid_details">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@@ -169,8 +170,7 @@
<Label Grid.Column="0" Grid.Row="9" Margin="3" VerticalAlignment="Center">Versicherungs Nr.</Label>
<Label x:Name="lblArchiviert" Grid.Column="0" Grid.Row="10" Margin="3,0,3,3" VerticalAlignment="Center">Archiviert</Label>
<Label Content="Farbe im Kalender" Grid.Column="0" Grid.Row="11" VerticalAlignment="Center" />
<Label Content="Farbe im Kalender" Grid.Column="0" Grid.Row="11" Margin="3" VerticalAlignment="Center" />
<ComboBox Grid.Column="1" Grid.Row="11" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectedItem="{Binding Path=EmployeeBrush, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Name="combobox_brush" Height="23" Margin="3" ItemsSource="{Binding Path=AllBrushes, Mode=OneWay}"
Loaded="Combobox_brush_OnLoaded">

View File

@@ -11,7 +11,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="g1" />

View File

@@ -332,16 +332,22 @@ namespace BeWo.View.Detail
if (category.GoalEntryDC.ParentOid == null || category.GoalEntryDC.ValueListEntryOid == null)
continue;
var parent = dictOid2TreeItem[category.GoalEntryDC.ParentOid.Value];
if (dictOid2TreeItem.ContainsKey(category.GoalEntryDC.ParentOid.Value))
{
var parent = dictOid2TreeItem[category.GoalEntryDC.ParentOid.Value];
parent.Items.Add(dictOid2TreeItem[category.GoalEntryDC.ValueListEntryOid.Value]);
category.ParentGoal = parent;
parent.Items.Add(dictOid2TreeItem[category.GoalEntryDC.ValueListEntryOid.Value]);
category.ParentGoal = parent;
}
}
var categoriesWithParents = dictOid2TreeItem.Values.Where(w => w.GoalEntryDC.ParentOid != null).ToList();
foreach (var goalCategory in categoriesWithParents)
{
dictOid2TreeItem[goalCategory.GoalEntryDC.ParentOid.Value].Children.Add(goalCategory);
if (dictOid2TreeItem.ContainsKey(goalCategory.GoalEntryDC.ParentOid.Value))
{
dictOid2TreeItem[goalCategory.GoalEntryDC.ParentOid.Value].Children.Add(goalCategory);
}
}
foreach (var goal in ViewModel.VMList.Where(w => w.Type.Equals(ValueListEntryType.SupportConceptGoalType)))

View File

@@ -30,7 +30,7 @@
HorizontalAlignment="Left"
EditValue="{val:ValidationBinding Path=NewVM.PublishDate, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<Label Grid.Column="0" Grid.Row="1">Nur für Team</Label>
<Label x:Name="lblNurFuerTeam" Grid.Column="0" Grid.Row="1">Nur für Team</Label>
<uc:PopUpEdit IsReadOnly="True"
x:Name="popupedit_TeamSearch"
Grid.Column="1" Margin="3" Height="23" Grid.Row="1"

View File

@@ -21,6 +21,12 @@ namespace BeWo.View.Detail
{
this.InitializeComponent();
this.ViewModel = viewModel;
if (!BeWoApp.AppSettings.ShowTeamNews)
{
lblNurFuerTeam.Visibility = Visibility.Collapsed;
popupedit_TeamSearch.Visibility = Visibility.Collapsed;
}
}
public override bool IsDirty

View File

@@ -20,7 +20,7 @@
<TextBlock Grid.Row="2" x:Name="textblock_link_pdfexport_direct" VerticalAlignment="Center" Margin="3,3,0,3" FontSize="14" Visibility="Hidden">
<Hyperlink x:Name="linkPdfExport_direct" TargetName="_NewWindow" Foreground="#FF2B508B" RequestNavigate="linkPdfExport_direct_RequestNavigate">
<Run Text="Bericht öffnen" />
<Run x:Name="TxtLinkExport" Text="Bericht öffnen" />
</Hyperlink>
</TextBlock>
@@ -46,10 +46,11 @@
<Run Text="Drucken" />
</Hyperlink>
</TextBlock>
<TextBlock Grid.Column="2" x:Name="textblock_link" VerticalAlignment="Center" Margin="5 0" HorizontalAlignment="Left" FontSize="14">
<Hyperlink x:Name="linkExcelExport" TargetName="newWindow" Foreground="{StaticResource GridPrintMenuLightBrush}" RequestNavigate="linkExcelExport_RequestNavigate">Excel Export</Hyperlink>
</TextBlock>
<TextBlock Grid.Column="2" x:Name="textblock_link" VerticalAlignment="Center" Margin="5 0" HorizontalAlignment="Left" FontSize="14">
<Hyperlink x:Name="linkExcelExport" TargetName="newWindow" Foreground="{StaticResource GridPrintMenuLightBrush}" RequestNavigate="linkExcelExport_RequestNavigate">
<Run Text="Excel Export" />
</Hyperlink>
</TextBlock>
</Grid>
</Grid>

View File

@@ -42,6 +42,8 @@ namespace BeWo.View.Detail.Report
private CompactEmployeeDC lastSelectedEmployee;
private CompactCustomerDC lastSelectedCustomer;
private CompactSupportConceptDC lastSelectedSupportConcept;
private CompactTeamDC lastSelectedTeam;
public QueryView(IEnumerable<QueryDC> pQueries)
{
@@ -155,6 +157,45 @@ namespace BeWo.View.Detail.Report
switch (item.ParamType)
{
case QueryParameterType.SupportConcept:
var peSc = new PopUpEdit
{
IsReadOnly = true,
MinWidth = 250,
Margin = new Thickness(3),
DeleteButtonVisibility = Visibility.Collapsed
};
if (lastSelectedSupportConcept != null)
{
peSc.Text = lastSelectedSupportConcept.ToString();
}
var popupSc = new Popup();
popupSc.StaysOpen = false;
popupSc.Placement = PlacementMode.MousePoint;
popupSc.Width = 370;
popupSc.Height = 250;
var scsv = new SupportConceptSearchView();
scsv.SearchMode = SearchMode.ActiveCostbearer2SupportConcepts;
scsv.ItemSelected += (s, e) =>
{
popupSc.IsOpen = false;
peSc.Focus();
var newSc = e.Data;
peSc.Text = String.Format("{0}, {1}", newSc.Customer.LastNameFirstName, newSc.CostBearer);
lastSelectedSupportConcept = newSc;
};
popupSc.Child = scsv;
parameterUIElements.Add(item.Name + "_" + item.ParamType + "_1", scsv);
peSc.PopUpClick += (s, e) => { popupSc.IsOpen = true; };
sp.Children.Add(peSc);
sp.Children.Add(popupSc);
break;
case QueryParameterType.Employee:
var peEmp = new PopUpEdit
@@ -234,6 +275,45 @@ namespace BeWo.View.Detail.Report
sp.Children.Add(pe);
sp.Children.Add(popup);
break;
case QueryParameterType.Team:
var peTeam = new PopUpEdit
{
IsReadOnly = true,
Width = 250,
Margin = new Thickness(3),
DeleteButtonVisibility = Visibility.Collapsed
};
if (lastSelectedTeam != null)
{
peTeam.Text = lastSelectedTeam.ToString();
}
var popupTeam = new Popup();
popupTeam.StaysOpen = false;
popupTeam.Width = 370;
popupTeam.Height = 250;
popupTeam.Placement = PlacementMode.MousePoint;
var tsv = new TeamSearchView();
tsv.ItemSelected += (s, e) =>
{
popupTeam.IsOpen = false;
peTeam.Focus();
CompactTeamDC newTeam = e.Data;
peTeam.Text = newTeam.ToString();
lastSelectedTeam = newTeam;
};
popupTeam.Child = tsv;
parameterUIElements.Add(item.Name + "_" + item.ParamType + "_1", tsv);
peTeam.PopUpClick += (s, e) => { popupTeam.IsOpen = true; };
sp.Children.Add(peTeam);
sp.Children.Add(popupTeam);
break;
case QueryParameterType.Month:
ComboBox monthCombo = CreateMonthCombo();
@@ -257,6 +337,10 @@ namespace BeWo.View.Detail.Report
break;
case QueryParameterType.Date:
DateEdit dtpStart2 = CreateDateEdit();
sp.Children.Add(dtpStart2);
parameterUIElements.Add(item.Name + "_" + item.ParamType + "_1", dtpStart2);
break;
case QueryParameterType.DateRange:
DateEdit dtpStart = CreateDateEdit();
@@ -317,6 +401,18 @@ namespace BeWo.View.Detail.Report
switch (item.ParamType)
{
case QueryParameterType.SupportConcept:
if (lastSelectedSupportConcept != null)
{
if (lastSelectedSupportConcept.CostBearerRelOids != null &&
lastSelectedSupportConcept.CostBearerRelOids.Count == 1)
{
param.Value = lastSelectedSupportConcept.CostBearerRelOids[0];
}
else
{
param.Value = lastSelectedSupportConcept.SupportConceptOid;
}
}
break;
case QueryParameterType.Employee:
if (lastSelectedEmployee != null)
@@ -330,6 +426,13 @@ namespace BeWo.View.Detail.Report
param.Value = lastSelectedCustomer.CustomerOid;
}
break;
case QueryParameterType.Team:
if (lastSelectedTeam != null)
{
param.Value = lastSelectedTeam.TeamOid;
}
break;
case QueryParameterType.Month:
if (parameterUIElements.ContainsKey(item.Name + "_" + item.ParamType + "_1") &&
@@ -358,6 +461,17 @@ namespace BeWo.View.Detail.Report
break;
case QueryParameterType.Date:
if (parameterUIElements.ContainsKey(item.Name + "_" + item.ParamType + "_1"))
{
var dtp = parameterUIElements[item.Name + "_" + item.ParamType + "_1"] as DateEdit;
if (dtp.EditValue != null)
{
var dt = dtp.DateTime;
param.Value = dt;
}
}
break;
case QueryParameterType.DateRange:
if (parameterUIElements.ContainsKey(item.Name + "_" + item.ParamType + "_1") &&
@@ -576,8 +690,13 @@ namespace BeWo.View.Detail.Report
ResetQueryFields();
String exportTitle = "Bericht öffnen";
if (lQuery != null)
{
if (!String.IsNullOrWhiteSpace(lQuery.ExportTitle))
{
exportTitle = lQuery.ExportTitle;
}
if (lQuery.Parameter == null || lQuery.Parameter.Count == 0)
{
if (lQuery.IsDirect)
@@ -617,7 +736,7 @@ namespace BeWo.View.Detail.Report
}
}
}
TxtLinkExport.Text = exportTitle;
UpdatePDFExportUri(lQuery);
}
}
@@ -650,10 +769,20 @@ namespace BeWo.View.Detail.Report
var path = BeWoApp.GetAndCreateUserAppDataPath() + "\\BeWoDokument.xls";
var lQuery = combo_query.SelectedItem as QueryDC;
if (lQuery != null)
bool isExcel = true;
if (lQuery != null)
{
path = String.Format("{0}\\{1}.xls", BeWoApp.GetAndCreateUserAppDataPath(), lQuery.Title);
}
if (!String.IsNullOrWhiteSpace(lQuery.FileName))
{
path = String.Format("{0}\\{1}", BeWoApp.GetAndCreateUserAppDataPath(), lQuery.FileName);
isExcel = false;
}
else
{
path = String.Format("{0}\\{1}.xls", BeWoApp.GetAndCreateUserAppDataPath(), lQuery.Title);
}
}
var sf = new SaveFileDialog
{
FileName = Path.GetFileName(path),
@@ -661,10 +790,23 @@ namespace BeWo.View.Detail.Report
};
if (sf.ShowDialog() != true)
return;
ServiceFacade.DoDownloadServiceSync(
s =>
BeWoUtils.WriteExcelFile(s.PrepareExcelFile(DownloadLinkEngine.ExcelFileId, lHeaderCaptions, lContent),
sf.FileName));
if (isExcel)
{
ServiceFacade.DoDownloadServiceSync(
s =>
BeWoUtils.WriteExcelFile(
s.PrepareExcelFile(DownloadLinkEngine.ExcelFileId, lHeaderCaptions, lContent),
sf.FileName));
}
else
{
ServiceFacade.DoDownloadServiceSync(
s =>
BeWoUtils.WriteFile(
s.PrepareExcelFile(DownloadLinkEngine.ExcelFileId, lHeaderCaptions, lContent),
sf.FileName));
}
//string navitageUri = ((Hyperlink)sender).NavigateUri.ToString();
//BeWoUtils.NavigateToReportUri(navitageUri);
@@ -699,20 +841,43 @@ namespace BeWo.View.Detail.Report
private void linkPdfExport_direct_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
var lQuery = combo_query.SelectedItem as QueryDC;
if (lQuery != null)
{
List<QueryParamDC> parameterList = CreateQueryParamValues(lQuery);
//###EINKOMMENTIEREN
// var lQuery = combo_query.SelectedItem as QueryDC;
// if (lQuery != null)
// {
// List<QueryParamDC> parameterList = CreateQueryParamValues(lQuery);
DataTable dt = ServiceFacade.DoQueryServiceSync(s => s.ExecuteQuery(lQuery.Oid, parameterList));
ServiceFacade.DoQueryServiceSync(
q =>
q.PrepareQueryReport(dt, BeWoApp.Tenant + "queryeoid" + BeWoApp.LoggedOnUser.Employee.EmployeeOid));
// if (!String.IsNullOrWhiteSpace(lQuery.ExportTitle))
// {
// lQuery.Parameter = parameterList;
string navigateUri = linkPdfExport.NavigateUri.ToString();
navigateUri = BeWoUtils.RemoveAuthenticationInfoFromUri(navigateUri);
BeWoUtils.NavigateToReportUri(navigateUri, lQuery.Title);
}
// var result = ServiceFacade.DoDownloadServiceSync(s => s.CreateQuery(lQuery));
// var path = String.Format("{0}\\{1}", BeWoApp.GetAndCreateUserAppDataPath(), result.FileName);
// var sf = new SaveFileDialog
// {
// FileName = Path.GetFileName(path),
// Filter = "Alle Dateien|*.*"
// };
// if (sf.ShowDialog() != true)
// return;
// BeWoUtils.WriteFile(result.QueryResult, sf.FileName);
// }
// else
// {
// DataTable dt = ServiceFacade.DoQueryServiceSync(s => s.ExecuteQuery(lQuery.Oid, parameterList));
// ServiceFacade.DoQueryServiceSync(
// q =>
// q.PrepareQueryReport(dt, BeWoApp.Tenant + "queryeoid" + BeWoApp.LoggedOnUser.Employee.EmployeeOid));
// string navigateUri = linkPdfExport.NavigateUri.ToString();
// navigateUri = BeWoUtils.RemoveAuthenticationInfoFromUri(navigateUri);
// BeWoUtils.NavigateToReportUri(navigateUri, lQuery.Title);
// }
// }
}
}
}

View File

@@ -7,7 +7,7 @@
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
<GroupBox Header="Leistungsübersicht" Style="{StaticResource ObjectEditGroupBox}">
<GroupBox Header="Quittierungsbelege" Style="{StaticResource ObjectEditGroupBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>

View File

@@ -53,8 +53,9 @@ namespace BeWo.View.Detail.Report
//}
combobox_month.SelectionChanged += combobox_month_SelectionChanged;
combobox_year.SelectionChanged += combobox_year_SelectionChanged;
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, Theme.Office2010Black);
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, Theme.Office2010Black);
//ThemeManager.SetTheme(docPrevControl, Theme.Office2010Black);
Unloaded += delegate { ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, null); docPrevControl.Visibility = Visibility.Collapsed; };
@@ -65,6 +66,11 @@ namespace BeWo.View.Detail.Report
InitDayCombos();
}
void combobox_year_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
InitDayCombos();
}
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
if (popupedit_customer == null)

View File

@@ -803,10 +803,10 @@
</TreeView>
</GroupBox>-->
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Button Margin="10 3 0 0"
<Button Margin="10 3 0 0" IsEnabled="{Binding Path=IsAllowedToEditGoals, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type view:SupportConceptView}}}"
Name="button_checkAllGoals" Click="button_checkAllGoals_Click"
HorizontalAlignment="Left">Alle auswählen</Button>
<Button Margin="10 3 0 0"
<Button Margin="10 3 0 0" IsEnabled="{Binding Path=IsAllowedToEditGoals, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type view:SupportConceptView}}}"
Name="button_uncheckAllGoals" Click="button_uncheckAllGoals_Click"
HorizontalAlignment="Left">Alle abwählen</Button>
<Button Margin="10 3 0 0"

View File

@@ -202,7 +202,7 @@
<TextBox x:Name="txtHeader" Margin="3,3,0,0" Background="{x:Null}" Foreground="{DynamicResource MainGroupBoxForegroundBrush}" FontSize="22" BorderBrush="{x:Null}" VerticalAlignment="Center" Padding="0,0,0,0" IsReadOnly="True" />
<!-- ########################################### Achtung Schloss ################################################################################################## -->
<TextBlock x:Name="txtPasswortSchloss" VerticalAlignment="Center" Margin="5,3,3,3" Foreground="Black" ToolTip="Passwort Sicherheit Onlinehilfe">
<TextBlock x:Name="txtPasswortSchloss" VerticalAlignment="Center" Margin="5,3,3,3" Foreground="Black" ToolTip="Hinweise zum Datenschutz">
<Hyperlink RequestNavigate="LinkNewDatenschutz_OnRequestNavigate" NavigateUri="https://www.beyondsoft.de/datenschutz_beyondsoft.html" Foreground="Black" TextDecorations="None">
<TextBlock x:Name="PasswortSchloss" Text="" HorizontalAlignment="Center" Foreground="OrangeRed" FontSize="12" VerticalAlignment="Center" />
</Hyperlink>

View File

@@ -166,7 +166,7 @@ namespace BeWo.View
{
if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
{
MessageBox.Show("Ihr Passwort ist zu Schwach.\nBitte ändern sie es bei gelegenheit!", "Achtung!",
MessageBox.Show("Sie benutzen ein schwaches Passwort.\nBitte ändern Sie Ihr Passwort, indem Sie im Startbildschirm oben auf \"Passwort ändern\" klicken.", "Achtung!",
MessageBoxButton.OK,MessageBoxImage.Information);
}
});
@@ -175,16 +175,6 @@ namespace BeWo.View
{
PasswortSchloss.Foreground = new SolidColorBrush(Colors.Yellow);
//this.Dispatcher.BeginInvoke(
//DispatcherPriority.Normal,
//(Action)delegate
//{
// if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
// {
// MessageBox.Show("Ihr Passwort ist zu Schwach.\nBitte ändern sie es bei gelegenheit!", "Achtung!",
// MessageBoxButton.OK,MessageBoxImage.Information);
// }
//});
}else if (BeWoApp.PasswortStrength == PasswortSecurityStrength.Stark)
{
@@ -714,7 +704,7 @@ namespace BeWo.View
private void InitTasks()
{
int test = 0;
while (BeWoApp.LoggedOnEmployee == null && test < 10)
while (BeWoApp.LoggedOnEmployee == null && test < 50)
{
Thread.Sleep(100);
test++;

View File

@@ -98,9 +98,9 @@ namespace BeWo.View.Master
_OpenViews[pTabItem] = pView;
pTabItem.Content = pView;
pView.VerticalAlignment = VerticalAlignment.Top;
if (ActualHeight > 120)
{
if (ActualHeight > 120 && !(pView is MandatorView))
{
pView.MaxHeight = ActualHeight - 120;
}

View File

@@ -77,7 +77,10 @@ namespace BeWo.View.Navigation
{
if (MessageBox.Show("Wollen Sie den Benutzer '" + dc.LoginName + "' wirklich löschen?", "Löschen", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes)
{
ServiceFacade.DoUserServiceAsync(s => s.DeactivateUser(dc.UserOid, dc.UserVersion), true);
ServiceFacade.DoUserServiceAsync(s => s.DeactivateUser(dc.UserOid, dc.UserVersion), () => this.Dispatch(() => ReloadData(true)), true);
//ServiceFacade.DoUserServiceAsync(s => s.DeactivateUserGroup(ugdc.UserGroupOid.Value, ugdc.UserGroupVersion.Value), () => this.Dispatch(() => ReloadData(true)), true);
return true;
}
}

View File

@@ -24,7 +24,7 @@
<Label Grid.Row="1" Grid.Column="0" Content="Altes Passwort" Margin="3" />
<PasswordBox x:Name="AltesPwBox" Grid.Row="1" Grid.Column="1" Margin="3" VerticalContentAlignment="Center" PasswordChanged="AltesPWgeaendert" />
<Label Content="Passwort zu kurz" Grid.Row="2" Grid.ColumnSpan="2" Foreground="Red" x:Name="passwortprüfer" Visibility="Collapsed" />
<Label Content="Passwort zu kurz" Grid.Row="2" Grid.ColumnSpan="2" Foreground="Red" x:Name="passwortprüfer" Visibility="Hidden" />
<Label Grid.Row="3" Grid.Column="0" Content="Neues Passwort" Margin="3" />
<PasswordBox x:Name="NeuesPwBox" Grid.Row="3" Grid.Column="1" Margin="3" VerticalContentAlignment="Center" PasswordChanged="NeuesPwBox_OnPasswordChanged" />

View File

@@ -143,7 +143,7 @@ namespace BeWo.View
letztespw = s;
getPasswortStrength(NeuesPwBox.Password.Length);
GetPasswortStrength(NeuesPwBox.Password.Length);
//NeuesPwBox.Password.Equals("/[!§$%&\/\(\)=?,;.:\-_#'+*@°^²³€µ~\[\]\{\}\\]/)");
@@ -165,7 +165,7 @@ namespace BeWo.View
bool schalter = false;
List<int> letztewerte = new List<int>();
private void getPasswortStrength(int text)
private void GetPasswortStrength(int text)
{
int i = 0;
letzterwert = 0;
@@ -355,8 +355,8 @@ namespace BeWo.View
if (text == 0)
{
if (passwortprüfer.Visibility != Visibility.Collapsed)
passwortprüfer.Visibility = Visibility.Collapsed;
if (passwortprüfer.Visibility != Visibility.Hidden)
passwortprüfer.Visibility = Visibility.Hidden;
score = 0;
letzterwert = 0;
@@ -371,7 +371,7 @@ namespace BeWo.View
passwortprüfer.Visibility = Visibility.Visible;
passwortprüfer.Foreground = new SolidColorBrush(Colors.Red);
passwortprüfer.Content = "Passwortstärke: sehr schwach";
passwortprüfer.Content = "Passwortstärke: Sehr schwach";
break;
@@ -380,8 +380,8 @@ namespace BeWo.View
if (passwortprüfer.Visibility != Visibility.Visible)
passwortprüfer.Visibility = Visibility.Visible;
passwortprüfer.Foreground = new SolidColorBrush(Colors.Red);
passwortprüfer.Content = "Passwortstärke: schwach";
passwortprüfer.Foreground = new SolidColorBrush(Colors.Orange);
passwortprüfer.Content = "Passwortstärke: Schwach";
break;
@@ -390,7 +390,7 @@ namespace BeWo.View
passwortprüfer.Visibility = Visibility.Visible;
passwortprüfer.Foreground = new SolidColorBrush(Colors.Yellow);
passwortprüfer.Content = "Passwortstärke: mittelmäßig";
passwortprüfer.Content = "Passwortstärke: Mittel";
break;
@@ -400,7 +400,7 @@ namespace BeWo.View
passwortprüfer.Visibility = Visibility.Visible;
passwortprüfer.Foreground = new SolidColorBrush(Colors.Green);
passwortprüfer.Content = "Passwortstärke: stark";
passwortprüfer.Content = "Passwortstärke: Stark";
break;
@@ -410,7 +410,7 @@ namespace BeWo.View
passwortprüfer.Visibility = Visibility.Visible;
passwortprüfer.Foreground = new SolidColorBrush(Colors.Green);
passwortprüfer.Content = "Passwortstärke: sehr stark";
passwortprüfer.Content = "Passwortstärke: Sehr stark";
break;
}

View File

@@ -381,10 +381,17 @@ namespace BeWo.View.Report.FLSReport
if (row.DetailRowType != DetailRowTypes.Detail)
{
lblDate.FontWeight = FontWeights.Bold;
lblDate.Content = dv.DateValueText;
}
else
{
if (dv.DateValue != 0)
{
lblDate.Content = dv.DateValueText;
}
}
lblDate.SetValue(Grid.ColumnProperty, idx++);
lblDate.Content = dv.DateValueText;
lblDate.HorizontalAlignment = HorizontalAlignment.Right;
lblDate.ToolTip = this.CreateToolTip(dv);
grid.Children.Add(lblDate);

View File

@@ -1266,7 +1266,7 @@ namespace BeWo.ViewModel
if (AreDifferent(_CustomerImage, value))
{
_CustomerImage = value;
StoreDirtyInformation(AreDifferent(DataContract.CustomerImage, value), PropertyName_CustomerImage);
StoreDirtyInformation(AreDifferent(DataContract.Images, value), PropertyName_CustomerImage);
FirePropertyChanged(PropertyName_CustomerImage);
}
}
@@ -1424,10 +1424,13 @@ namespace BeWo.ViewModel
_Vormund = pDataContract.Vormund;
_CustomerAlias = pDataContract.CustomerAlias;
_Pflegegrad = pDataContract.Pflegegrad;
_CustomerImage = pDataContract.CustomerImage;
if (pDataContract.Jugendamt != null)
if (pDataContract.Images != null && pDataContract.Images.Count > 0)
{
_CustomerImage = pDataContract.Images[0];
}
if (pDataContract.Jugendamt != null)
{
_Jugendamt = pDataContract.Jugendamt;
}
@@ -1573,7 +1576,20 @@ namespace BeWo.ViewModel
}
pDataContract.CustomerAlias = _CustomerAlias;
pDataContract.Pflegegrad = _Pflegegrad;
pDataContract.CustomerImage = _CustomerImage;
if (pDataContract.Images != null)
{
pDataContract.Images.Clear();
}
if (_CustomerImage != null)
{
if (pDataContract.Images == null)
{
pDataContract.Images = new List<byte[]>();
}
pDataContract.Images.Add(_CustomerImage);
}
CommitContact(_MobilePhone, ContactType.business_MobilePhone);

View File

@@ -1033,7 +1033,7 @@ namespace BeWo.ViewModel
if (AreDifferent(_EmployeeImage, value))
{
_EmployeeImage = value;
StoreDirtyInformation(AreDifferent(DataContract.EmployeeImage, value), PropertyName_EmployeeImage);
StoreDirtyInformation(AreDifferent(DataContract.Images, value), PropertyName_EmployeeImage);
FirePropertyChanged(PropertyName_EmployeeImage);
}
}
@@ -1074,9 +1074,13 @@ namespace BeWo.ViewModel
_Text5 = pDataContract.Text5;
_Notice2 = pDataContract.Notice2;
_EmployeeColor = pDataContract.EmployeeColor;
_EmployeeImage = pDataContract.EmployeeImage;
_IsArchived = pDataContract.ActivationType == ActivationTypeId.Archived;
if (pDataContract.Images != null && pDataContract.Images.Count > 0)
{
_EmployeeImage = pDataContract.Images[0];
}
_IsArchived = pDataContract.ActivationType == ActivationTypeId.Archived;
//this._CancellationPeriod = pDataContract.CancellationPeriod;
//this._EntryDate = pDataContract.EntryDate;
@@ -1173,19 +1177,32 @@ namespace BeWo.ViewModel
pDataContract.Text5 = _Text5;
pDataContract.Notice2 = _Notice2;
pDataContract.EmployeeColor = _EmployeeColor;
pDataContract.EmployeeImage = _EmployeeImage;
pDataContract.Type = PersonType.Employee;
pDataContract.ActivationType = _IsArchived ? ActivationTypeId.Archived : ActivationTypeId.Active;
//pDataContract.CancellationPeriod = this._CancellationPeriod;
//pDataContract.EntryDate = this._EntryDate;
//pDataContract.ProbationPeriod = this._ProbationPeriod;
//pDataContract.HourlyRate = this._HourlyRate;
//pDataContract.LeaveDays = this._LeaveDays;
//pDataContract.WeeklyFLS = this._WeeklyFLS;
//pDataContract.WeeklyTotalHours = this._WeeklyTotalHours;
if (pDataContract.Images != null)
{
pDataContract.Images.Clear();
}
if (_EmployeeImage != null)
{
if (pDataContract.Images == null)
{
pDataContract.Images = new List<byte[]>();
}
pDataContract.Images.Add(_EmployeeImage);
}
//pDataContract.CancellationPeriod = this._CancellationPeriod;
//pDataContract.EntryDate = this._EntryDate;
//pDataContract.ProbationPeriod = this._ProbationPeriod;
//pDataContract.HourlyRate = this._HourlyRate;
//pDataContract.LeaveDays = this._LeaveDays;
//pDataContract.WeeklyFLS = this._WeeklyFLS;
//pDataContract.WeeklyTotalHours = this._WeeklyTotalHours;
CommitContact(_MobilePhone, ContactType.business_MobilePhone);
CommitContact(_MobilePhone, ContactType.business_MobilePhone);
CommitContact(_Phone, ContactType.business_Phone);
CommitContact(_Fax, ContactType.business_Fax);
CommitContact(_EMail, ContactType.business_Mail);

View File

@@ -495,7 +495,7 @@ namespace BeWo.ViewModel.ListViewModel
if (minuteInterval > 0)
{
Calculations calc = Calculations.GetInstance(iCustomerNode.SupportConceptTreeNodeDC.CostBearer.CostBearerID);
decimal lRoudedDuration = calc.GetRoundedDuration(minuteInterval, _PrototypeVM.Duration.Value);
decimal lRoudedDuration = calc.GetRoundedDuration(minuteInterval, _PrototypeVM.Duration ?? 0);
lNewRecord.RoundedDuration = lRoudedDuration/_CustomerNodes.Count;
}
@@ -1200,7 +1200,7 @@ namespace BeWo.ViewModel.ListViewModel
{
if (periodStats.SupportConceptApprovalPeriod.StartDate.HasValue && periodStats.SupportConceptApprovalPeriod.EndDate.HasValue &&
periodStats.SupportConceptApprovalPeriod.StartDate.Value.Date == stats.StatisticsStartDate.Date &&
periodStats.SupportConceptApprovalPeriod.EndDate.Value.Date == stats.StatisticsEndDate.Date)
periodStats.SupportConceptApprovalPeriod.EndDate.Value.Date == stats.StatisticsEndDate.Date && !showOutOfPeriod)
{
vm.Header = periodStats.SupportConceptApprovalPeriod.ServiceCategory.Name;
}

View File

@@ -36,9 +36,9 @@ namespace BeWo.ViewModel.ListViewModel
var hasRightToViewAll = BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll);
var hasRightToViewBetreuungsschluessel = BeWoApp.LoggedOnUser.HasRight(UserRightType.Betreuungsschluessel_View);
var hasRightToViewEmployees = BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View);
//var hasRightToViewEmployees = BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View);
return hasRightToViewEmployees && (hasRightToCreateAll || hasRightToCreateBetreuungsschluessel) && (hasRightToViewAll || hasRightToViewBetreuungsschluessel) ? Visibility.Visible : Visibility.Collapsed;
return (hasRightToCreateAll || hasRightToCreateBetreuungsschluessel) && (hasRightToViewAll || hasRightToViewBetreuungsschluessel) ? Visibility.Visible : Visibility.Collapsed;
}
}

View File

@@ -679,39 +679,7 @@ namespace BeWo.ViewModel
public static void CreateNewSchedulerAppointmentListVM(Action<SchedulerAppointmentListVM> pCallBack, DateTime intervalStart, DateTime intervalEnd)
{
if (!BeWoApp.LoggedOnEmployee.EmployeeOid.HasValue)
{
return;
}
var allEmps = new List<CompactEmployeeDC>();
var allCats2ResInDic = new Dictionary<ValueListEntryDC, List<ResourceDC>>();
var appointments = new List<SchedulerAppointmentDC>();
var allCust = new List<CompactCustomerDC>();
allEmps = Cache.GetInstance().GetAllActiveEmployeesCompactSync();
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen))
{
ServiceFacade.DoEmployeeServiceSync(es => allEmps = new List<CompactEmployeeDC> {es.LoadCompactEmployee(BeWoApp.LoggedOnEmployee.EmployeeOid.Value)});
}
ServiceFacade.DoResourceServiceSync(s => allCats2ResInDic = s.GetAllCategories2ResourcesInDictionary());
ServiceFacade.DoResourceServiceSync(rs => appointments = rs.GetAllActiveAppointmentsForEmployeeInInterval2(intervalStart, intervalEnd, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)));
allCust = Cache.GetInstance().GetAllActiveCustomersCompactSync();
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
{
allCust = allCust.Where(c => BeWoApp.LoggedOnEmployee.RelatedCustomers.Any(a => a.Customer.Equals(c))).ToList();
}
var prefilteredAppointments = appointments.Where(w => ((w.EmployeeList.Count == 0 && w.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ||
w.EmployeeList.Count > 0 && w.EmployeeList.Any(a => a.Employee.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid))) ||
BeWoApp.LoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen)) && (!w.EmployeeList.TrueForAll(e2a => e2a.ParticipationAnswer == ParticipationAnswer.Absage) || w.EmployeeList.IsEmpty()));
pCallBack(new SchedulerAppointmentListVM(prefilteredAppointments.ToList(), allCust, allEmps, allCats2ResInDic));
}
public static void CreateAppointmentCategoryListVMAsync(Action<AppointmentCategoryListVM> pCallBack)

View File

@@ -17,6 +17,7 @@ using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using Newtonsoft.Json;
using BeWo.Data.Entities;
namespace BeWoPlanerAndroid
{
@@ -84,9 +85,17 @@ namespace BeWoPlanerAndroid
[WebMethod(EnableSession = true)]
public string LoadImageForEmployee(long pEmployeePersonOid)
{
var employee = DAOFactory.SearchDAO.FindEmployeeWithPersonOid(pEmployeePersonOid);
//var employee = DAOFactory.SearchDAO.FindEmployeeWithPersonOid(pEmployeePersonOid);
return SerializeObject(employee.EmployeeThumbnail);
var person = DAOFactory.GenericDAO.LoadByID<Person>(pEmployeePersonOid);
byte[] image = null;
if (person.Images != null && person.Images.Count > 0)
{
image = person.Images[0].SmallThumbnail;
}
return SerializeObject(image);
}
[WebMethod(EnableSession = true)]

View File

@@ -14,12 +14,13 @@
<RootNamespace>BeWoPlanerAndroid</RootNamespace>
<AssemblyName>BeWoPlanerAndroid</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<UseIISExpress>false</UseIISExpress>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<TargetFrameworkProfile />
<UseGlobalApplicationHostFile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -84,6 +85,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
<None Include="Properties\PublishProfiles\Test.pubxml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
@@ -133,7 +135,7 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>65460</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>

View File

@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NameOfLastUsedPublishProfile>Test</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">

View File

@@ -15,7 +15,7 @@
<AssemblyName>BeWoPlanerMobil</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>false</UseIISExpress>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
@@ -247,7 +247,7 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<UseIIS>False</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>8808</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>

View File

@@ -45,14 +45,14 @@ namespace BeWoPlanerMobil.Controllers
Name = brauser.Browser,
BrowserVersion = brauser.Version,
Platform = brauser.Platform,
Tenant = SessionFacade.Tenant
Tenant = MobileSessionFacade.Tenant
};
OperationsService.InsertBeWoMobilBrowserInfo(brauserInfoDC);
return RedirectToActionPermanent("Main", "Main");
}
log.Info(String.Format("LoginController.Index(): Login failed! Tenant = {0}", SessionFacade.Tenant));
log.Info(String.Format("LoginController.Index(): Login failed! Tenant = {0}", MobileSessionFacade.Tenant));
ViewData[loginErrorIndex] = "Die Anmeldung ist fehlgeschlagen. Bitte überprüfen Sie Benutzername und Passwort.";
return View("Index");
@@ -75,7 +75,7 @@ namespace BeWoPlanerMobil.Controllers
if (MobileSessionFacade.IsUserLoggedIn())
return RedirectToActionPermanent("Main", "Main");
SessionFacade.Tenant = tenant;
MobileSessionFacade.Tenant = tenant;
return View("Index");
}
}

View File

@@ -59,12 +59,23 @@ namespace BeWoPlanerMobil.Controllers
if (!MobileSessionFacade.IsUserLoggedIn())
return RedirectToActionPermanent("Index", "Login");
var unter = GetSettingValue("ShowSignature");
Model.ShowSignature = unter == "1";
bool test = Model.SaveSignature;
Model.SelectedGoals = null;
Model.Dokutypes = ValueListService.GetAllValueListEntrysByType(ValueListEntryType.DocumentType);
if (Model.Dokutypes != null)
{
Model.Dokutypes = Model.Dokutypes.OrderBy(s => s.ValueListEntryOid).ToArray();
}
if (MainModel.AllEmployees == null)
{
MainModel.AllEmployees = EmployeeService.GetAllActiveEmployeesCompact();
}
var m = Model;
var myRelatedCustomers = Model.Employee == null ? new List<CustomerEmployeeRelationDC>() : Model.Employee.RelatedCustomers;
if (MobileSessionFacade.CheckForUserRight(UserRightType.CustomerView_View))
@@ -275,15 +286,16 @@ namespace BeWoPlanerMobil.Controllers
}
public string CheckDokuReiter() {
var dokutypes = ValueListService.GetAllValueListEntrysByType(ValueListEntryType.DocumentType);
var sortDoctypes = dokutypes.OrderBy(s => s.ValueListEntryOid).ToList();
return SerializeObject(sortDoctypes);
public string CheckDokuReiter()
{
return SerializeObject(Model.Dokutypes);
}
private string GetSettingValue(string key)
{
var man = OperationsService.GetMandator();
return GetSettingValue(man.Settings, key);
}
private static string GetSettingValue(string settings, string key)
{
@@ -464,7 +476,7 @@ namespace BeWoPlanerMobil.Controllers
}
}
public void SaveSchalter(bool schalti)
public void SetSaveSignature(bool save)
{
try
{
@@ -474,7 +486,7 @@ namespace BeWoPlanerMobil.Controllers
}
else
{
Model.Schalter = schalti;
Model.SaveSignature = save;
}
}
catch (Exception e)
@@ -530,8 +542,19 @@ namespace BeWoPlanerMobil.Controllers
{
return RedirectToActionPermanent("Index", "Login");
}
String doku1 = null;
log.Info(string.Format("CreateServiceRecord: datum:{0}; start:{1}; ende:{2}; dauer:{3}; doku:{4}; aktion:{5}", collection["Datum"], collection["Start"], collection["Ende"], collection["Dauer"], collection["Dokumentation"], collection["versteckt"]));
if (Model.Dokutypes != null && Model.Dokutypes.Length > 1)
{
doku1 = collection["Dokumentation"];
}
else
{
doku1 = collection["Dokumentation6"];
}
log.Info(string.Format("CreateServiceRecord: datum:{0}; start:{1}; ende:{2}; dauer:{3}; doku:{4}; aktion:{5}", collection["Datum"], collection["Start"], collection["Ende"], collection["Dauer"], doku1, collection["versteckt"]));
if (String.IsNullOrEmpty(collection["Datum"]))
@@ -545,14 +568,14 @@ namespace BeWoPlanerMobil.Controllers
DateTime enddatum;
if (collection["EndDatum"] != "")
{
enddatum = Convert.ToDateTime(collection["EndDatum"]);
}
else
{
//if (collection["EndDatum"] != "")
//{
// enddatum = Convert.ToDateTime(collection["EndDatum"]);
//}
//else
//{
enddatum = datum;
}
//}
var start = collection["Start"];
var ende = collection["Ende"];
@@ -568,14 +591,12 @@ namespace BeWoPlanerMobil.Controllers
Int32.TryParse(collection["Dauer"], out dauer);
}
var doku = collection["Dokumentation"];
var doku2 = collection["Dokumentation2"];
var doku3 = collection["Dokumentation3"];
var doku4 = collection["Dokumentation4"];
var doku5 = collection["Dokumentation5"];
if(doku == "")
doku = collection["Dokumentation6"];
var zeitenFeld = new DateTime[2];
@@ -664,17 +685,12 @@ namespace BeWoPlanerMobil.Controllers
}
}
Model.NewServiceRecord.Notice = doku;
if(doku2 != "")
Model.NewServiceRecord.Notice2 = doku2;
if (doku3 != "")
Model.NewServiceRecord.Notice3 = doku3;
if (doku4 != "")
Model.NewServiceRecord.Notice4 = doku4;
if (doku5 != "")
Model.NewServiceRecord.Notice5 = doku5;
Model.NewServiceRecord.Notice = doku1;
Model.NewServiceRecord.Notice2 = doku2;
Model.NewServiceRecord.Notice3 = doku3;
Model.NewServiceRecord.Notice4 = doku4;
Model.NewServiceRecord.Notice5 = doku5;
var serviceDescOid = 0L;
@@ -727,9 +743,7 @@ namespace BeWoPlanerMobil.Controllers
log.Error(e.Message, e);
}
//wenn auf false dann ist Unterschreiben nicht möglich
Model.Schalter = false;
model.ButtonsSchalter = false;
Model.SaveSignature = Model.ShowSignature;
return RedirectToActionPermanent("Main");
}
@@ -1166,68 +1180,16 @@ namespace BeWoPlanerMobil.Controllers
private static DateTime[] ConvertRecordTimes(String start, String ende, DateTime datum, int dauer)
{
var result = new DateTime[2];
var startDate = datum;
var endDate = datum;
var h = 0;
var m = 0;
if (!String.IsNullOrEmpty(start) && (start.Contains(":") || start.Contains(".") || start.Contains(",")))
{
var seperator = ':';
if (start.Contains("."))
seperator = '.';
else if (start.Contains(","))
seperator = ',';
var hm = start.Split(seperator);
h = Convert.ToInt32(hm[0]);
m = Convert.ToInt32(hm[1]);
}
else if (!String.IsNullOrEmpty(start))
{
if (start.Length <= 2)
{
m = 0;
h = Convert.ToInt32(start);
}
else
{
m = Convert.ToInt32(start.Substring(start.Length - 2, 2));
h = Convert.ToInt32(start.Substring(0, start.Length - 2));
}
}
startDate = startDate.AddHours(h);
startDate = startDate.AddMinutes(m);
if (!String.IsNullOrEmpty(ende) && (ende.Contains(":") || ende.Contains(".") || ende.Contains(",")))
{
var seperator2 = ':';
if (ende.Contains("."))
seperator2 = '.';
else if (ende.Contains(","))
seperator2 = ',';
var hm = ende.Split(seperator2);
h = Convert.ToInt32(hm[0]);
m = Convert.ToInt32(hm[1]);
}
else if (!String.IsNullOrEmpty(ende))
{
m = Convert.ToInt32(ende.Substring(ende.Length - 2, 2));
h = Convert.ToInt32(ende.Substring(0, ende.Length - 2));
}
endDate = endDate.AddHours(h);
endDate = endDate.AddMinutes(m);
var startDate = datum.Date;
var endDate = datum.Date;
var dateTemp = ConvertTimeStringToDateTime(start);
startDate = startDate.AddHours(dateTemp.Hour).AddMinutes(dateTemp.Minute);
dateTemp = ConvertTimeStringToDateTime(ende);
endDate = endDate.AddHours(dateTemp.Hour).AddMinutes(dateTemp.Minute);
if (String.IsNullOrEmpty(start) && !String.IsNullOrEmpty(ende))
{
startDate = endDate.AddMinutes(-1 * dauer);
@@ -1242,18 +1204,52 @@ namespace BeWoPlanerMobil.Controllers
{
endDate = startDate;
}
if (dauer == 0 || endDate == startDate)
{
dauer = (int)(endDate - startDate).TotalMinutes;
}
result[0] = startDate;
result[1] = endDate;
return result;
}
private static DateTime CreateDateFromString(DateTime datum, string dateString)
{
var h = 0;
var m = 0;
if (!String.IsNullOrEmpty(dateString))
{
if (dateString.Contains(":") || dateString.Contains(".") || dateString.Contains(","))
{
var seperator = ':';
if (dateString.Contains("."))
seperator = '.';
else if (dateString.Contains(","))
seperator = ',';
var hm = dateString.Split(seperator);
h = Convert.ToInt32(hm[0]);
m = Convert.ToInt32(hm[1]);
}
else
{
if (dateString.Length <= 2)
{
m = 0;
h = Convert.ToInt32(dateString);
}
else
{
m = Convert.ToInt32(dateString.Substring(dateString.Length - 2, 2));
h = Convert.ToInt32(dateString.Substring(0, dateString.Length - 2));
}
}
}
return datum.AddHours(h).AddMinutes(m);
}
private static DateTime[] ConvertRecordTimesWithEndDate(String start, String ende, DateTime datum,DateTime enddatum ,int dauer)
{
@@ -1589,15 +1585,32 @@ namespace BeWoPlanerMobil.Controllers
var numberString = Regex.Replace(timeString, "[^0-9]", "");
if (numberString.Length == 2)
//if (numberString.Length == 2)
//{
// numberString = numberString + "00";
//}
if (numberString.Length < 3)
{
numberString = numberString + "00";
if (numberString.Length < 2)
{
numberString = "0" + numberString;
}
while (numberString.Length < 4)
{
numberString = numberString + "0";
}
}
else
{
while (numberString.Length < 4)
{
numberString = "0" + numberString;
}
}
while (numberString.Length < 4)
{
numberString = "0" + numberString;
}
if (numberString.Length > 4)
{
numberString = numberString.Substring(0, 4);

View File

@@ -1,6 +1,20 @@
namespace BeWoPlanerMobil.Models
using System;
using BeWoPlanerMobil.Service;
namespace BeWoPlanerMobil.Models
{
public class LoginModel
{
}
public static String Tenant
{
get
{
return MobileSessionFacade.Tenant;
}
set
{
MobileSessionFacade.Tenant = value;
}
}
}
}

View File

@@ -31,12 +31,12 @@ namespace BeWoPlanerMobil.Models
public int Zeitraum { get; set; }
public bool Schalter { get; set; }
public bool SaveSignature { get; set; }
//######### neuer wert zur überprüfung
public int ErrorWert { get; set; }
public bool ButtonsSchalter { get; set; }
public bool ShowSignature { get; set; }
public long SrviceRecoOID { get; set; }
@@ -58,17 +58,7 @@ namespace BeWoPlanerMobil.Models
}
public List<ValueListEntryDC> SelectedGoals { get; set; }
public ValueListEntryDC[] SelectedGoalsforType
{
get{
var a = new MobileSessionFacade().ValueListService.GetAllValueListEntrysByType(ValueListEntryType.DocumentType);
return a;
}
set { SelectedGoalsforType = value; }
}
public ServiceRecordDC NewServiceRecord { get; set; }
public long? ServiceRecordOidToDelete { get; set; }
@@ -192,6 +182,6 @@ namespace BeWoPlanerMobil.Models
return result;
}
}
}
public ValueListEntryDC[] Dokutypes { get; set; }
}
}

View File

@@ -31,22 +31,22 @@ $(document).ready(function () {
if (localStorage.getItem("Zeitdaten") != null || localStorage.getItem("Kalenderdaten") != null) {
console.log("Ich bin hier drinne weil Storage vorhanden");
if (document.getElementById("ErrorZeiterfassungAfterCrashSchalter").value == 1 ||
document.getElementById("ErrorZeiterfassungAfterCrashSchalter").value == null ||
document.getElementById("ErrorZeiterfassungAfterCrashSchalter").value == 0) {
console.log("Ich bin hier beim Laden einer Zeiterfassung ");
LoadOnly(1, 2);
DeletStorage(1);
DeletStorage(2);
} else {
ErrorZeiterfassungAfterCrash();
console.log(" ich bin hier nach dem Crash ")
}
} else {
console.log("Ich bin hier drinne weil Storage nicht vorhanden");
}
//if (localStorage.getItem("Zeitdaten") != null || localStorage.getItem("Kalenderdaten") != null) {
// console.log("Ich bin hier drinne weil Storage vorhanden");
// if (document.getElementById("ErrorZeiterfassungAfterCrashSchalter").value == 1 ||
// document.getElementById("ErrorZeiterfassungAfterCrashSchalter").value == null ||
// document.getElementById("ErrorZeiterfassungAfterCrashSchalter").value == 0) {
// console.log("Ich bin hier beim Laden einer Zeiterfassung ");
// LoadOnly(1, 2);
// DeletStorage(1);
// DeletStorage(2);
// } else {
// ErrorZeiterfassungAfterCrash();
// console.log(" ich bin hier nach dem Crash ")
// }
//} else {
// console.log("Ich bin hier drinne weil Storage nicht vorhanden");
//}
ErfolgteSpx();
@@ -345,6 +345,10 @@ function checkDokuReiter() {
document.getElementById('Dokumentation4').style = 'width: 99%';
document.getElementById('Dokumentation5').style = 'width: 99%';
}
if (x > 0) {
document.getElementById('DokName1').click();
}
}
});
}

View File

@@ -101,14 +101,14 @@ function loadServiceCategoriesOnSuccess(json) {
function showAjaxError(jqXHR, textStatus, errorThrown) {
hideSanduhr();
if (jqXHR.status == 0) {
toggleErrorPopup("Es besteht zurzeit keine Internetverbindung." +
" Die Daten werden zwischen Gespeichert und beim nächsten Login an den Server gesendet. " + errorThrown,2);
setTimeout(function () {
showServiceRecords();
}, SetTimeoutTime);
}
else
//if (jqXHR.status == 0) {
//toggleErrorPopup("Es besteht zurzeit keine Internetverbindung." +
// " Die Daten werden zwischengespeichert und beim nächsten Login an den Server gesendet. " + errorThrown,2);
//setTimeout(function () {
//showServiceRecords();
//}, SetTimeoutTime);
//}
//else
toggleErrorPopup(jqXHR.status + " " + errorThrown);
}
@@ -151,9 +151,9 @@ function calcEndByStartDuration() {
if (isNaN(dauer)) return;
var neu = addMinutes(shm2, dauer);
var ende = (neu.getHours() < 10 ? "0" : "") + neu.getHours() + (neu.getMinutes() < 10 ? "0" : "") + neu.getMinutes();
var ende = (neu.getHours() < 10 ? "0" : "") + neu.getHours() + ':' + (neu.getMinutes() < 10 ? "0" : "") + neu.getMinutes();
if (isNaN(ende)) return;
//if (isNaN(ende)) return;
$("#ende_textbox").val(ende).trigger("change");
}
else {
@@ -202,9 +202,9 @@ function loadGoals(actionPath) {
var selectedSC = $($("#scDropDown")).find(":selected").val();
makeAjaxCall("GET", actionPath, loadGoalsOnSuccess, { pCostbearer2SupportConceptOid: selectedSC }, null);
if (document.getElementById('DokName1').style.display != 'none'){
document.getElementById('DokName1').click();
}
//if (document.getElementById('DokName1').style.display != 'none'){
// document.getElementById('DokName1').click();
//}
}
function toggleMenu() {
@@ -663,7 +663,14 @@ function validateServiceRecordBeforeSubmit() {
isValidRecord = false;
exitLoop = true;
break;
case 7:
var msg7 = "Sie können keine neuen Leistungen dokumentieren, da die Frist zur Bearbeitung abgelaufen ist. Das Speichern ist nicht möglich.";
writeFatalErrorMessage(msg7);
isValidRecord = false;
exitLoop = true;
break;
default:
writeFatalErrorMessage(results[i].Message);
isValidRecord = false;
exitLoop = true;
break;
@@ -685,16 +692,15 @@ function validateServiceRecordBeforeSubmit() {
}
function ErfolgteSpx() {
if (document.getElementById("Schalter").value =="True") {
if (document.getElementById("SaveSignature").value == "True") {
toggleSuccessPopup("Zeiterfassung wurde gespeichert." + "\n" + "Möchte Sie diese Unterschreiben lassen?");
document.getElementById("Schalter").value = "False";
var schalti = false;
toggleSuccessPopup("Eintrag wurde gespeichert." + "\n" + "Möchte Sie diesen unterschreiben lassen?", 4);
document.getElementById("SaveSignature").value = "False";
$.ajax({
type: "GET",
url: SaveSchalterUrl,
data: { schalti: schalti }
url: SetSaveSignatureUrl,
data: { save: false }
});
}
}
@@ -1375,8 +1381,8 @@ var lastpositionx = 0;
var lastpositiony = 0;
var newpositionx = 0;
var newpositiony = 0;
var minuswert = -30;
var maxwert = 30;
var minuswert = -20;
var maxwert = 20;
var posix = 0;
var posiy = 0;
@@ -1397,7 +1403,7 @@ function loadUnterschriftFeldFunktion() {
if (posiy > minuswert && posix > minuswert && posiy < maxwert && posix < maxwert) {
ctx.lineTo(lastpositionx + 2, lastpositiony + 2);
ctx.lineWidth = 4;
ctx.lineWidth = 2;
ctx.lineCap = "butt";
ctx.lineJoin = "round";
ctx.stroke();
@@ -1567,7 +1573,7 @@ function speichereUnterschrift() {
newday = "";
newday = ddStr + '.' + mmStr + '.' + yyyy + " " + hhStr + ":" + MnStr + ":" + ScStr;
var ServRecord = $("#SaveRecordOID").value;
var serviceRecordOid = $("#SaveRecordOID").val();
//console.log(ServRecord + " das ist die Oid");
@@ -1580,16 +1586,18 @@ function speichereUnterschrift() {
}
function showPosition(position) {
var breitenGrad = position.coords.latitude;
var langenGrad = position.coords.longitude;
var breitenGrad = "";
var langenGrad = "";
//var breitenGrad = position.coords.latitude;
//var langenGrad = position.coords.longitude;
longrider = "";
longrider = langenGrad.toString();
console.log(ServRecord);
//longrider = langenGrad.toString();
//console.log(ServRecord);
$.ajax({
type: "POST",
url: setSelectedUnterschriftUrl,
data: { breitengrad: breitenGrad, langengrad: langenGrad, blob: dataURL, zeitstempel: newday, ServiceRecord: ServRecord },
data: { breitengrad: breitenGrad, langengrad: langenGrad, blob: dataURL, zeitstempel: newday, ServiceRecord: serviceRecordOid },
success: function () {
loescheUnterschrift(canvas, ctx);
backToZeiterfassung();
@@ -1623,7 +1631,8 @@ function speichereUnterschrift() {
showPosition(null);
}
getLocation();
//getLocation();
showPosition(null);
}
function loescheUnterschrift(canvas, ctx) {
@@ -1916,7 +1925,7 @@ function toggleErrorPopup(errorMessage, i , zeit) {
$("#errorPopupOkBtn").onclick = "toggleErrorPopup('')";
DeletStorage(1);
SaveOnly(); // Speichere Daten bei absturz
//SaveOnly(); // Speichere Daten bei absturz
}
else {
$("#errorPopupTitle").text("Fehler");
@@ -1950,16 +1959,22 @@ function toggleSuccessPopup(message, i) {
$(".modalWrapper").css("display", displayValue);
$(".modalWrapper").css("height", $(document).height());
if (i == 2)
$(".SuccessPopupUSchrift").css("display", "none");
else
$(".SuccessPopupUSchrift").css("display", "inline");
$("#SuccessPopupOkBtn").val("OK");
if (i == 3) {
if (i == 2) {
$(".SuccessPopupUSchrift").css("display", "none");
$("#SuccessPopupTitle").text("Fehler 404: Internal Server Error");
}
else if (i == 3) {
$(".SuccessPopupUSchrift").css("display", "none");
$("#SuccessPopupTitle").text("Es ist leider ein Fehler aufgetreten!");
}
else if (i == 4) {
$(".SuccessPopupUSchrift").css("display", "inline");
$("#SuccessPopupOkBtn").val("Nein");
}
else
$(".SuccessPopupUSchrift").css("display", "inline");
if (isDisplayNone) {
$("#SuccessPopupText").text(message);

View File

@@ -43,13 +43,28 @@ function stringToTime(str) {
var defaultResult = [-1, -1];
var minutes = 0;
if (str.length > 2) {
minutes = str.slice(str.length - 2, str.length);
}
var hours = str.slice(0, 2);
defaultResult[0] = parseInt(hours);
defaultResult[1] = parseInt(minutes);
str = str.replace(':', '');
str = str.replace('.', '');
str = str.replace(' ', '');
return defaultResult;
if (str.length < 3) {
if (str.length < 2) {
str = "0" + str;
}
while (str.length < 4) {
str = str + "0";
}
} else {
while (str.length < 4) {
str = "0" + str;
}
}
minutes = str.slice(2, 4);
var hours = str.slice(0, 2);
defaultResult[0] = parseInt(hours);
defaultResult[1] = parseInt(minutes);
return defaultResult;
}

View File

@@ -40,8 +40,11 @@ namespace BeWoPlanerMobil.Service
serverPath = Path.Combine(serverPath, ConfigurationManager.AppSettings.Get("MultitenancyPath"));
serverPath = Path.Combine(serverPath, MobileSessionFacade.Tenant + ".config");
_SessionFactories[MobileSessionFacade.Tenant] = new Configuration().Configure(serverPath).SetInterceptor(new MobileUpdInsInterceptor()).BuildSessionFactory();
if (!File.Exists(serverPath))
{
return null;
}
_SessionFactories[MobileSessionFacade.Tenant] = new Configuration().Configure(serverPath).SetInterceptor(new MobileUpdInsInterceptor()).BuildSessionFactory();
}
return _SessionFactories[MobileSessionFacade.Tenant];
@@ -104,44 +107,53 @@ namespace BeWoPlanerMobil.Service
private static bool ConfigureHibernateSession()
{
var lTenant = MobileSessionFacade.Tenant;
var tenant = MobileSessionFacade.Tenant;
if (String.IsNullOrEmpty(lTenant))
if (String.IsNullOrEmpty(tenant))
{
return false;
tenant = HttpContext.Current.Request.Params["tb_tenant"];
MobileSessionFacade.Tenant = tenant;
}
if (String.IsNullOrEmpty(tenant))
return false;
HttpContext.Current.Items.Add("hibernateSession", SessionFactory.OpenSession());
return true;
var sf = SessionFactory;
if (sf != null)
{
HttpContext.Current.Items.Add("hibernateSession", sf.OpenSession());
return true;
}
return false;
}
private static bool TryAuthenticateWithLoginForm(HttpApplication context)
{
var name = context.Request.Params["tb_login"];
var password = context.Request.Params["tb_password"];
var tenant = context.Request.Params["tb_tenant"];
if (Utils.IsAnyNullOrEmpty(name, password))
{
return false;
}
var s = new UserServiceImp();
if (Utils.IsAnyNullOrEmpty(name, password, tenant))
return false;
log.Info(String.Format("TryAuthenticateWithLoginForm with username: {0}, Tenant: {1}", name, MobileSessionFacade.Tenant));
MobileSessionFacade.Tenant = tenant;
var s = new UserServiceImp();
if (s.IsUserValid(name, password, null, "MobilClient", false) == UserValidationResult.UserValid)
{
var user = DAOFactory.UserDAO.FindUserByLoginName(name);
//log.Info(String.Format("TryAuthenticateWithLoginForm with username: '{0}', Password: '{1}', Tenant: {2}", name, password, MobileSessionFacade.Tenant));
log.Info(String.Format("TryAuthenticateWithLoginForm with username: '{0}', Tenant: {1}", name, MobileSessionFacade.Tenant));
if (user == null || !DAOFactory.UserDAO.CheckPassword(user, password)) return false;
if (s.IsUserValid(name, password, null, "MobilClient", false) == UserValidationResult.UserValid)
{
var user = DAOFactory.UserDAO.FindUserByLoginName(name);
MobileSessionFacade.LoggedInUser = user;
}
if (user == null || !DAOFactory.UserDAO.CheckPassword(user, password)) return false;
return true;
MobileSessionFacade.LoggedInUser = user;
}
return true;
}
public static bool ConfigureHibernateSessionForWebService()
{
return ConfigureHibernateSession();

View File

@@ -35,28 +35,40 @@ namespace BeWoPlanerMobil.Service
public static ApplicationUser LoggedInUser
{
get { return HttpContext.Current.Session["apuser"] as ApplicationUser; }
get
{
return HttpContext.Current.Session["apuser"] as ApplicationUser;
}
set
set
{
HttpContext.Current.Session["apuser"] = value;
EmployeeFullname = value != null ? value.Employee.Person.FirstNameLastName : string.Empty;
}
}
public static string EmployeeFullname { get; set; }
public static string EmployeeFullname
{
get
{
if (LoggedInUser != null)
{
return LoggedInUser.Employee.Person.FirstNameLastName;
}
return string.Empty;
}
}
public static EmployeeDC LoggedInEmployee
{
get { return LoggedInUser == null ? null : MapperFactory.EmployeeDC_Employee.MapToNewDC(LoggedInUser.Employee); }
}
public static EmployeeDC LoggedInEmployee
{
get { return LoggedInUser == null ? null : MapperFactory.EmployeeDC_Employee.MapToNewDC(LoggedInUser.Employee); }
}
public static CompactEmployeeDC LoggedInCompactEmployee
{
get { return LoggedInUser == null ? null : MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(LoggedInUser.Employee); }
}
public static CompactEmployeeDC LoggedInCompactEmployee
{
get { return LoggedInUser == null ? null : MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(LoggedInUser.Employee); }
}
public static string Tenant
public static string Tenant
{
get { return HttpContext.Current.Session["tenant"] as string; }

View File

@@ -13,20 +13,25 @@
<div class="margin-div">
<h4 id="errorMessageHeading" class="error-text">@ViewData["LoginErrorIndex"]</h4>
@using (Html.BeginForm("Index", "Login", FormMethod.Post, new {@onsubmit = "showSanduhr(); return true;"}))
{
@using (Html.BeginForm("Index", "Login", FormMethod.Post, new { @onsubmit = "showSanduhr(); return true;" }))
{
<div class="input-wrapper input-wrapper-w-margin">
<input class="floating-label-input" type="text" id="tb_tenant" name="tb_tenant" value="@LoginModel.Tenant" required/>
<label class="floating-label" for="tb_tenant">Kundennummer</label>
</div>
<div class="input-wrapper input-wrapper-w-margin">
<input class="floating-label-input" type="text" id="tb_login" name="tb_login" value="@usernameDef" required/>
<label class="floating-label" for="tb_login">Benutzername</label>
</div>
<div class="input-wrapper input-wrapper-w-margin">
<input class="floating-label-input" type="password" id="tb_password" name="tb_password" value="@pwDef" required/>
<label class="floating-label" for="tb_password">Passwort</label>
</div>
<input type="submit" value="Login" />
}
}
</div>
<img class="warte-animation" alt="Lade..." src="@Url.Content("~/Content/images/spinner.png")" >

View File

@@ -119,7 +119,7 @@
</tr>
<tr>
<td colspan="2">
<div class="input-wrapper cell-content" id="EndDate_div">
<div class="input-wrapper cell-content" id="EndDate_div" style="display: none">
<input type="text" id="enddatum_textbox" name="Enddatum" class="date-input-css floating-label-input" required disabled onchange="aktualDurationwithEndDate()"/>
<label class="floating-label" for="enddatum_textbox">Enddatum</label>
</div>
@@ -217,15 +217,16 @@
}
</div>
<input value="@Model.Schalter.ToString()" type="hidden" id="Schalter" />
<input value="@Model.SaveSignature.ToString()" type="hidden" id="SaveSignature" />
<input type="hidden" id="Leistung" />
@using (Html.BeginForm("LoadServiceRecords", "Main", FormMethod.Post, new { @id = "selectSCForm2" }))
{
<div class="combobox-label-parent" id="recordLoader_select_container">
<div class="combobox-label-parent" id="recordLoader_select_container" style="min-width: 120px">
<div class="styled-select-div" id="record-loader-select-container">
<select class="dropdownlist-for" id="recordLoader_select" onchange="showSanduhr();$('#serviceRecords').empty();this.form.submit();" name="Records">
<option value="-1">Laden</option>
<option value="-1"></option>
<option value="7" @{if (Model.Zeitraum == 7) { @Html.Raw("selected") }}>Letzte 7 Tage</option>
<option value="30" @{if (Model.Zeitraum == 30) { @Html.Raw("selected") }}>Letzte 30 Tage</option>
<option value="90" @{if (Model.Zeitraum == 90) { @Html.Raw("selected") }}>Letzte 90 Tage</option>
@@ -266,8 +267,7 @@
{ @Html.Raw("style=\"display: none;\"") }} />
<input type="button" onclick="@("togglePopup('" + record.ServiceRecordOid + "')")" class="delete-button" @{if (!MainModel.IsDeleteBtnVisible || record.GroupPersonCount > 1)
{ @Html.Raw("style=\"display: none;\"") }} />
@{if (record.SignatureOid == null && Model.ButtonsSchalter == true || record.SignatureOid.Equals("") && Model.ButtonsSchalter == true)
@{if ((record.SignatureOid == null || record.SignatureOid.Equals("")) && Model.ShowSignature)
{
<input type="button" onclick="@("showUnterschrift(" + record.ServiceRecordOid + ")")" value="Unterschreiben" class="unterschreiben" style="color:#ff5a00; font-weight: bold; font-size:large"/>
}
@@ -314,14 +314,14 @@
<td>@record.InsertedOn</td>
</tr>
@{if ( Model.SelectedGoalsforType.Length >= 1)
@{if ( Model.Dokutypes.Length >= 1)
{
<tr class="testklasse" >
<td class="recordHeader">@Model.SelectedGoalsforType[0].TypeDescription.ToString():</td>
<td class="recordHeader">@Model.Dokutypes[0].TypeDescription.ToString():</td>
<td>@record.Notice</td>
</tr>
}
else if (record.Notice2 == null && record.Notice3 == null && record.Notice4 == null && record.Notice5 == null && Model.SelectedGoalsforType.Length == 0)
else if (record.Notice2 == null && record.Notice3 == null && record.Notice4 == null && record.Notice5 == null && Model.Dokutypes.Length == 0)
{
<tr class="testklasse" >
<td class="recordHeader">Dokumentation:</td>
@@ -331,19 +331,19 @@
else if (record.Notice2 != null || record.Notice3 != null || record.Notice4 != null || record.Notice5 != null)
{
<tr class="testklasse">
<td class="recordHeader">Dokumentation 1:</td>
<td class="recordHeader">Dokumentation:</td>
<td> @record.Notice</td>
</tr>
}
}
@{if(record.Notice2 != null){
if (Model.SelectedGoalsforType.Length >= 2)
if (Model.Dokutypes.Length >= 2)
{
if (!record.Notice2.Equals("") && Model.SelectedGoalsforType[1] != null)
if (!record.Notice2.Equals("") && Model.Dokutypes[1] != null)
{
<tr class="testklasse">
<td class="recordHeader">@Model.SelectedGoalsforType[1].TypeDescription.ToString():</td>
<td class="recordHeader">@Model.Dokutypes[1].TypeDescription.ToString():</td>
<td> @record.Notice2</td>
</tr>
}
@@ -358,10 +358,10 @@
}
if(record.Notice3 != null){
if (Model.SelectedGoalsforType.Length >= 3){
if(!record.Notice3.Equals("") && Model.SelectedGoalsforType[2] != null){
if (Model.Dokutypes.Length >= 3){
if(!record.Notice3.Equals("") && Model.Dokutypes[2] != null){
<tr class="testklasse">
<td class="recordHeader">@Model.SelectedGoalsforType[2].TypeDescription.ToString():</td>
<td class="recordHeader">@Model.Dokutypes[2].TypeDescription.ToString():</td>
<td> @record.Notice3</td>
</tr>
}
@@ -375,10 +375,10 @@
}
if(record.Notice4 != null){
if (Model.SelectedGoalsforType.Length >= 4){
if(!record.Notice4.Equals("") && Model.SelectedGoalsforType[3] != null){
if (Model.Dokutypes.Length >= 4){
if(!record.Notice4.Equals("") && Model.Dokutypes[3] != null){
<tr class="testklasse">
<td class="recordHeader">@Model.SelectedGoalsforType[3].TypeDescription.ToString():</td>
<td class="recordHeader">@Model.Dokutypes[3].TypeDescription.ToString():</td>
<td> @record.Notice4</td>
</tr>
}
@@ -392,12 +392,12 @@
}
if(record.Notice5 != null){
if ( Model.SelectedGoalsforType.Length == 5)
if ( Model.Dokutypes.Length == 5)
{
if (!record.Notice5.Equals("") && Model.SelectedGoalsforType[4] != null)
if (!record.Notice5.Equals("") && Model.Dokutypes[4] != null)
{
<tr class="testklasse">
<td class="recordHeader">@Model.SelectedGoalsforType[4].TypeDescription.ToString():</td>
<td class="recordHeader">@Model.Dokutypes[4].TypeDescription.ToString():</td>
<td> @record.Notice5</td>
</tr>
}
@@ -412,7 +412,8 @@
}
}
@{if(Model.ButtonsSchalter){
@{if(Model.ShowSignature)
{
<tr class="testklasse">
<td class="recordHeader">Unterschrieben:</td>
<td>@{if (record.SignatureOid == null || record.SignatureOid.Equals(""))
@@ -465,11 +466,11 @@
</div>
<div id="SuccessPopupDiv">
<h4 id="SuccessPopupTitle" class="error-text">Speichern Erfolgreich</h4>
<h4 id="SuccessPopupTitle" style="text-align: center">Speichern erfolgreich</h4>
<p id="SuccessPopupText" class="center-aligned-text-element"></p>
<div id="SuccessPopupBtnDiv" class="center-aligned-text-element">
<input type="button" class="SuccessPopupOkBtn" value="OK" onclick="toggleSuccessPopup(''), location.reload()" />
<input type="button" class="SuccessPopupUSchrift" value="Unterschreiben" onclick="showUnterschrift('', 1)" />
<input type="button" id="SuccessPopupOkBtn" class="SuccessPopupOkBtn" value="OK" onclick="toggleSuccessPopup(''), location.reload()" />
<input type="button" class="SuccessPopupUSchrift" value="Unterschreiben" onclick="showUnterschrift('', 1)"/>
</div>
</div>
@@ -749,13 +750,13 @@
<div id="UnterschriftBereich" style="display: none" align="center">
<h2>HilfePlan - Unterschrift</h2>
<div onload="LadeDatenVor()">
<input class="floating-label-input" id="UnterschriftHilfeplan" readonly name="HilfePlan" />
<input class="floating-label-input" id="UnterschriftHilfeplan" readonly name="Hilfeplan" />
<input class="floating-label-input" id="UnterschriftEmployee" readonly name="Mitarbeiter" />
<input class="floating-label-input" id="UnterschriftKategorie" readonly name="Kategorie" />
<input class="floating-label-input" id="UnterschriftLeistung" readonly name="Leistung" />
<input class="floating-label-input" id="UnterschriftDatum" readonly name="Datum/Uhrzeit" />
<input id="SaveRecordOID" style="display: none" />
<input id="SaveRecordOID" readonly name="OID" style="display: none" />
</div>
<div>
<canvas id="sketchpad" height="150" style="cursor: default; border-color: black" width="325"></canvas>
@@ -849,7 +850,7 @@
LoadSessionSettingsFromBWPUrl = '@Url.Action("LoadBWPSettings")';
CheckEndDateUrl = '@Url.Action("CheckEndDate")';
CheckDokuReiterUrl = '@Url.Action("CheckDokuReiter")';
SetSaveSignatureUrl = '@Url.Action("SetSaveSignature")';
$(".toggle-btn").click(function () {

View File

@@ -12,18 +12,22 @@ namespace BeWo.Data.Access
DataSet lDs = new DataSet();
if (!string.IsNullOrEmpty(pQuery))
{
var lCommand = this.Session.Connection.CreateCommand();
lCommand.CommandText = pQuery;
using (var lCommand = this.Session.Connection.CreateCommand())
{
lCommand.CommandText = pQuery;
IDataAdapter lAdapter = lCommand is SqlCommand
? new SqlDataAdapter {SelectCommand = (SqlCommand) lCommand}
: (IDataAdapter)
new MySqlDataAdapter {SelectCommand = (MySqlCommand) lCommand};
IDataAdapter lAdapter = lCommand is SqlCommand
? new SqlDataAdapter { SelectCommand = (SqlCommand)lCommand }
: (IDataAdapter)
new MySqlDataAdapter { SelectCommand = (MySqlCommand)lCommand };
lAdapter.Fill(lDs);
lAdapter.Fill(lDs);
}
}
return lDs;
}
}

View File

@@ -131,6 +131,18 @@ namespace BeWo.Data.Access
.List<Team>();
}
public virtual IList<Team> FindAllActiveTeamsOfEmployee(long employeeOid)
{
return CreateCriteriaIsActive<Team>()
.CreateAlias(Team.PropertyName_MemberList, "m", JoinType.InnerJoin)
.CreateAlias(Team.PropertyName_Leader, "l", JoinType.InnerJoin)
.Add(Restrictions.Disjunction()
.Add(Restrictions.Eq("m." + BeWoEntityBase.PropertyName_Oid, employeeOid))
.Add(Restrictions.Eq("l." + BeWoEntityBase.PropertyName_Oid, employeeOid)))
.List<Team>().Distinct().ToList();
}
public IEnumerable<ResourceBookingSequence> FindBookings(long pResourceOid, DateTime pSpanStart, DateTime pSpanEnd)
{
var lResult = CreateCriteria<ResourceBookingSequence>()
@@ -370,14 +382,14 @@ namespace BeWo.Data.Access
.List<SupportConcept>();
}
public IEnumerable<SupportConcept> FindExpiringSupportConcepts(long? employeeOid, DateTime expiredUntil)
public IEnumerable<SupportConcept> FindExpiringSupportConcepts(long? employeeOid, DateTime minDate, DateTime expiredUntil)
{
var c = CreateCriteriaIsActive<SupportConcept>();
if (employeeOid == null)
{
return c
.CreateCriteria(SupportConcept.PropertyName_CostBearer2SupportConceptList, JoinType.InnerJoin)
.Add(Restrictions.Between(CostBearer2SupportConcept.PropertyName_ApprovedEndDate, DateTime.Now, expiredUntil))
.Add(Restrictions.Between(CostBearer2SupportConcept.PropertyName_ApprovedEndDate, minDate, expiredUntil))
.List<SupportConcept>();
}
@@ -387,8 +399,8 @@ namespace BeWo.Data.Access
.CreateAlias("c.Employee2CustomerList", "e2c", JoinType.InnerJoin)
.Add(Restrictions.Eq("e2c." + Employee2Customer.PropertyName_EmployeeOid, employeeOid.Value))
.Add(Restrictions.Or(
Restrictions.Between("cb2sc." + CostBearer2SupportConcept.PropertyName_ApprovedEndDate, DateTime.Now.Date, expiredUntil),
Restrictions.And(Restrictions.IsNotNull("c.TerminationDate"), Restrictions.Between("c.TerminationDate", DateTime.Now.Date, expiredUntil))))
Restrictions.Between("cb2sc." + CostBearer2SupportConcept.PropertyName_ApprovedEndDate, minDate, expiredUntil),
Restrictions.And(Restrictions.IsNotNull("c.TerminationDate"), Restrictions.Between("c.TerminationDate", minDate, expiredUntil))))
.List<SupportConcept>().Distinct().ToList();
}
@@ -409,6 +421,12 @@ namespace BeWo.Data.Access
.Add(Restrictions.Eq("e2c." + Employee2Customer.PropertyName_EmployeeOid, employeeOid.Value))
.List<SupportConcept>().Distinct().ToList();
}
public ApplicationUser FindUserForEmployee(Employee employee)
{
return CreateCriteria<ApplicationUser>()
.Add(Restrictions.Eq(ApplicationUser.PropertyName_Employee, employee))
.List<ApplicationUser>().FirstOrDefault();
}
public IEnumerable<Person> FindPersonsHavingBirthday(DateTime birthdayUntil)
{
@@ -571,15 +589,15 @@ namespace BeWo.Data.Access
public IEnumerable<Customer> GetAllCustomersWithRelatedEmployee()
{
return CreateCriteria<Customer>()
.CreateAlias(Customer.PropertyName_Person, "cp", JoinType.InnerJoin)
.CreateAlias("cp." + Person.PropertyName_Address, "a", JoinType.LeftOuterJoin)
.CreateAlias(Customer.PropertyName_Employee2CustomerList, "e2c", JoinType.LeftOuterJoin)
.CreateAlias("e2c." + Employee2Customer.PropertyName_Employee, "e", JoinType.LeftOuterJoin)
.CreateCriteria("e2c." + Employee2Customer.PropertyName_ValueList, JoinType.LeftOuterJoin)
.CreateCriteria("e." + Employee.PropertyName_Person, JoinType.LeftOuterJoin)
.List<Customer>();
}
return CreateCriteria<Customer>()
.CreateAlias("Person", "cp", JoinType.InnerJoin)
.CreateAlias("cp." + Person.PropertyName_Address, "a", JoinType.LeftOuterJoin)
.CreateAlias("Employee2CustomerList", "e2c", JoinType.LeftOuterJoin)
.CreateAlias("e2c." + Employee2Customer.PropertyName_Employee, "e", JoinType.LeftOuterJoin)
.CreateCriteria("e2c." + Employee2Customer.PropertyName_ValueList, JoinType.LeftOuterJoin)
.CreateCriteria("e." + Employee.PropertyName_Person, JoinType.LeftOuterJoin)
.List<Customer>();
}
public IList<ServiceRecord> FindServiceRecordsDetailsForLastDays(long costbearer2SupportConcept, long? days)
{
@@ -1767,15 +1785,15 @@ namespace BeWo.Data.Access
var customers = c2.List<Customer>();
var employees = FindAllChatActiveEmployees();
foreach (var customer in customers.Where(w => w.CustomerImage != null))
{
result.Add(customer.Person.Oid.Value, customer.CustomerImage);
}
//foreach (var customer in customers.Where(w => w.CustomerImage != null))
//{
// result.Add(customer.Person.Oid.Value, customer.CustomerImage);
//}
foreach (var emp in employees.Where(w => w.EmployeeImage != null))
{
result.Add(emp.Person.Oid.Value, emp.EmployeeImage);
}
//foreach (var emp in employees.Where(w => w.EmployeeImage != null))
//{
// result.Add(emp.Person.Oid.Value, emp.EmployeeImage);
//}
return result;
}

View File

@@ -158,6 +158,7 @@
<Compile Include="Entities\EmployeeAPPCode.cs" />
<Compile Include="Entities\ChatMessage.cs" />
<Compile Include="Entities\ChatMediaMessage.cs" />
<Compile Include="Entities\Image.cs" />
<Compile Include="Entities\PasswortVerlauf.cs" />
<Compile Include="Entities\MedRecord.cs" />
<Compile Include="Entities\NewestChatMessage.cs" />
@@ -553,6 +554,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="ICD10\icd10gm2012syst_claml_20110923.xml" />
<EmbeddedResource Include="Mappings\Image.hbm.xml">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Mappings\PasswortVerlauf.hbm.xml">
<SubType>Designer</SubType>
</EmbeddedResource>

View File

@@ -60,6 +60,16 @@ namespace BeWo.Data.Entities
}
}
public virtual DateTime? GueltigkeitsDatum
{
get
{
if (_ValidityDate.HasValue)
return _ValidityDate;
return _BookingDate;
}
}
public virtual DateTime? BookingDate
{
get

View File

@@ -169,7 +169,11 @@ namespace BeWo.Data.Entities
public virtual void ChangePassword(string pPassword)
{
var lMD5 = new MD5CryptoServiceProvider();
if (String.IsNullOrEmpty(Salt))
{
InitSalt();
}
var lMD5 = new MD5CryptoServiceProvider();
string lHash = BitConverter.ToString(lMD5.ComputeHash(Encoding.UTF8.GetBytes(String.Format("{0}_{1}_{2}", Salt, pPassword, "o238rRndguK4Fh8dsfkhwon54H8n3qo4itv8nz3o4LvnzQs0npmwEp"))));
lHash = BitConverter.ToString(lMD5.ComputeHash(Encoding.UTF8.GetBytes(lHash)));
HashedPassword = lHash;

View File

@@ -48,8 +48,6 @@ namespace BeWo.Data.Entities
public static string PropertyName_BehinderungsartenListe = "BehinderungsartenListe";
public static string PropertyName_CustomerAlias = "CustomerAlias";
public static string PropertyName_Pflegegrad = "Pflegegrad";
public static string Propertyname_CustomerImage = "CustomerImage";
public static string Propertyname_Thumbnail = "Thumbnail";
public static string Propertyname_IsMigrant = "IsMigrant";
@@ -95,8 +93,6 @@ namespace BeWo.Data.Entities
private IList<Behinderungsart> _BehinderungsartenListe;
private string _CustomerAlias;
private Pflegegrad? _Pflegegrad;
private byte[] _CustomerImage;
private byte[] _Thumbnail;
private bool _IsMigrant;
@@ -652,32 +648,6 @@ namespace BeWo.Data.Entities
}
}
public virtual Byte[] CustomerImage
{
get { return _CustomerImage; }
set
{
if (AreDifferent(_CustomerImage, value))
{
_CustomerImage = value;
}
}
}
public virtual Byte[] Thumbnail
{
get { return _Thumbnail; }
set
{
if (AreDifferent(_Thumbnail, value))
{
_Thumbnail = value;
}
}
}
public virtual bool IsMigrant
{
get { return _IsMigrant; }

View File

@@ -49,12 +49,7 @@ namespace BeWo.Data.Entities
public static string PropertyName_Notice2 = "Notice2";
public static String PropertyName_EmployeeColor = "EmployeeColor";
public static string PropertyName_EmployeeImage = "EmployeeImage";
public static string PropertyName_EmployeeThumbnail = "EmployeeThumbnail";
private IList<AbsenceTime> _AbsenceTimes;
private IList<Contract> _Contracts;
@@ -98,11 +93,7 @@ namespace BeWo.Data.Entities
private IList<ValueListEntry2Object> _ValueList;
private String _EmployeeColor;
private byte[] _EmployeeImage;
private byte[] _EmployeeThumbnail;
public Employee()
{
@@ -465,33 +456,6 @@ namespace BeWo.Data.Entities
{
return Person.LastName + ", " + Person.FirstName;
}
public virtual Byte[] EmployeeImage
{
get { return _EmployeeImage; }
set
{
if (AreDifferent(_EmployeeImage, value))
{
_EmployeeImage = value;
}
}
}
public virtual Byte[] EmployeeThumbnail
{
get { return _EmployeeThumbnail; }
set
{
if (AreDifferent(_EmployeeThumbnail, value))
{
_EmployeeThumbnail = value;
}
}
}
}
}

18
Data/Entities/Image.cs Normal file
View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using BS.Shared;
using BS.Shared.Core;
namespace BeWo.Data.Entities
{
public class Image : BeWoEntityBase
{
public virtual byte[] Original { get; set; }
public virtual byte[] MediumThumbnail { get; set; }
public virtual byte[] SmallThumbnail { get; set; }
}
}

View File

@@ -367,5 +367,7 @@ namespace BeWo.Data.Entities
}
}
}
public virtual IList<Image> Images { get; set; }
}
}

View File

@@ -130,5 +130,9 @@ namespace BeWo.Data.Entities
}
}
}
public virtual string FileName { get; set; }
public virtual string ExportTitle { get; set; }
}
}

View File

@@ -292,6 +292,11 @@ namespace BeWo.Data.Entities
{
get
{
if (!_GroupOid.HasValue && _GroupPersonCount.HasValue && _GroupEmployeeCount.HasValue &&
_GroupPersonCount.Value == 1 && _GroupEmployeeCount.Value == 1)
{
return null;
}
return this._GroupEmployeeCount;
}
@@ -337,6 +342,11 @@ namespace BeWo.Data.Entities
{
get
{
if (!_GroupOid.HasValue && _GroupPersonCount.HasValue && _GroupEmployeeCount.HasValue &&
_GroupPersonCount.Value == 1 && _GroupEmployeeCount.Value == 1)
{
return null;
}
return this._GroupPersonCount;
}
@@ -353,6 +363,11 @@ namespace BeWo.Data.Entities
{
get
{
if (!_GroupOid.HasValue && _GroupPersonCount.HasValue && _GroupEmployeeCount.HasValue &&
_GroupPersonCount.Value == 1 && _GroupEmployeeCount.Value == 1)
{
return null;
}
return this._GroupRoundedDuration;
}

View File

@@ -1,122 +1,119 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BeWo.Data.Entities.Customer,BeWo.Data" table="Customer">
<id name="Oid" column="Oid" type="Int64" unsaved-value="null">
<generator class="identity" />
</id>
<version type="Int64" column="Version" name="Version" />
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
<property column="ReferenceNumber" type="String" name="ReferenceNumber" length="128" />
<property column="EquityContribution" type="Decimal" name="EquityContribution" />
<property column="Diagnosis" type="String" name="Diagnosis" length="1024" />
<property column="ICD10Diagnosis" type="String" name="ICD10Diagnosis" length="1024" />
<property column="Medication" type="String" name="Medication" length="1024" />
<property column="Environment" type="String" name="Environment" length="2048" />
<property column="Childs" type="String" name="Childs" length="256" />
<property column="AssistanceBegin" type="DateTime" name="AssistanceBegin" />
<property column="TerminationDate" type="DateTime" name="TerminationDate" />
<property column="Notice" type="String" name="Notice" length="1024" />
<property column="InsTs" type="DateTime" name="InsTs" />
<property column="InsUser" type="String" name="InsUser" length="256" />
<property column="UdpUser" type="String" name="UdpUser" length="256" />
<property column="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" name="IsActive" />
<property column="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" name="SystemEntryID" />
<property column="DebitorNumber" type="String" name="DebitorNumber" />
<property column="CostCenter" type="String" name="CostCenter" />
<property column="IsAdvisedOrAttended" type="Boolean" name="IsAdvisedOrAttended" />
<property column="IsMigrant" type="Boolean" name="IsMigrant" />
<property column="DistanceInMeter" type="Int32" name="DistanceInMeter" />
<class name="BeWo.Data.Entities.Customer,BeWo.Data" table="Customer">
<id name="Oid" column="Oid" type="Int64" unsaved-value="null">
<generator class="identity" />
</id>
<version type="Int64" column="Version" name="Version" />
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
<property column="ReferenceNumber" type="String" name="ReferenceNumber" length="128" />
<property column="EquityContribution" type="Decimal" name="EquityContribution" />
<property column="Diagnosis" type="String" name="Diagnosis" length="1024" />
<property column="ICD10Diagnosis" type="String" name="ICD10Diagnosis" length="1024" />
<property column="Medication" type="String" name="Medication" length="1024" />
<property column="Environment" type="String" name="Environment" length="2048" />
<property column="Childs" type="String" name="Childs" length="256" />
<property column="AssistanceBegin" type="DateTime" name="AssistanceBegin" />
<property column="TerminationDate" type="DateTime" name="TerminationDate" />
<property column="Notice" type="String" name="Notice" length="1024" />
<property column="InsTs" type="DateTime" name="InsTs" />
<property column="InsUser" type="String" name="InsUser" length="256" />
<property column="UdpUser" type="String" name="UdpUser" length="256" />
<property column="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" name="IsActive" />
<property column="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" name="SystemEntryID" />
<property column="DebitorNumber" type="String" name="DebitorNumber" />
<property column="CostCenter" type="String" name="CostCenter" />
<property column="IsAdvisedOrAttended" type="Boolean" name="IsAdvisedOrAttended" />
<property column="IsMigrant" type="Boolean" name="IsMigrant" />
<many-to-one name="TerminationReason" column="TerminationValueListEntryOid" class="BeWo.Data.Entities.ValueListEntry,BeWo.Data" cascade="none" />
<many-to-one name="Person" column="PersonOid" class="BeWo.Data.Entities.Person,BeWo.Data" cascade="all-delete-orphan" fetch="join"/>
<property column="DistanceInMeter" type="Int32" name="DistanceInMeter" />
<property column="CustomerAlias" type="String" name="CustomerAlias" length="256" />
<many-to-one name="TerminationReason" column="TerminationValueListEntryOid" class="BeWo.Data.Entities.ValueListEntry,BeWo.Data" cascade="none" />
<many-to-one name="Person" column="PersonOid" class="BeWo.Data.Entities.Person,BeWo.Data" cascade="all-delete-orphan" fetch="join"/>
<property column="AusstVersAmt" type="String" name="AusstVersAmt" />
<property column="AusweisGueltigVon" type="DateTime" name="AusweisGueltigVon" />
<property column="AusweisGueltigBis" type="DateTime" name="AusweisGueltigBis" />
<property column="AusweisUnbefristetGueltig" type="Boolean" name="AusweisUnbefristetGueltig" />
<property column="BeiblattGueltigBis" type="DateTime" name="BeiblattGueltigBis" />
<property column="GradDerBehinderung" type="String" name="GradDerBehinderung" />
<property column="Pflegegrad" type="BS.Shared.Pflegegrad, BS.Shared" name="Pflegegrad" />
<property column="CustomerImage" name="CustomerImage" />
<property column="Thumbnail" name="Thumbnail" />
<bag name="MerkzeichenListe" table="merkzeichen2customer" generic="true" cascade="all" batch-size="250" lazy="false">
<key column="CustomerOid" />
<element column="Merkzeichen" type="BS.Shared.Merkzeichen, BS.Shared" />
</bag>
<property column="CustomerAlias" type="String" name="CustomerAlias" length="256" />
<bag name="BehinderungsartenListe" table="behinderungsart2customer" generic="true" cascade="all" batch-size="250" lazy="false">
<key column="CustomerOid" />
<element column="Behinderungsart" type="BS.Shared.Behinderungsart, BS.Shared" />
</bag>
<property column="AusstVersAmt" type="String" name="AusstVersAmt" />
<property column="AusweisGueltigVon" type="DateTime" name="AusweisGueltigVon" />
<property column="AusweisGueltigBis" type="DateTime" name="AusweisGueltigBis" />
<property column="AusweisUnbefristetGueltig" type="Boolean" name="AusweisUnbefristetGueltig" />
<property column="BeiblattGueltigBis" type="DateTime" name="BeiblattGueltigBis" />
<property column="GradDerBehinderung" type="String" name="GradDerBehinderung" />
<!--<many-to-one name="Bargeldverwaltung" column="BargeldverwaltungOid" class="BeWo.Data.Entities.Bargeldverwaltung, BeWo.Data" cascade="all-delete-orphan" />-->
<property column="Pflegegrad" type="BS.Shared.Pflegegrad, BS.Shared" name="Pflegegrad" />
<bag name="MerkzeichenListe" table="merkzeichen2customer" generic="true" cascade="all" batch-size="250" lazy="false">
<key column="CustomerOid" />
<element column="Merkzeichen" type="BS.Shared.Merkzeichen, BS.Shared" />
</bag>
<bag name="BehinderungsartenListe" table="behinderungsart2customer" generic="true" cascade="all" batch-size="250" lazy="false">
<key column="CustomerOid" />
<element column="Behinderungsart" type="BS.Shared.Behinderungsart, BS.Shared" />
</bag>
<!--<many-to-one name="Bargeldverwaltung" column="BargeldverwaltungOid" class="BeWo.Data.Entities.Bargeldverwaltung, BeWo.Data" cascade="all-delete-orphan" />-->
<!--<many-to-one name="FamilyData" column="FamilyDataOid" class="BeWo.Data.Entities.FamilyData, BeWo.Data" cascade="all" />
<many-to-one name="Jugendamt" column="OrganisationOid" class="BeWo.Data.Entities.Organisation, BeWo.Data" cascade="none" />
<many-to-one name="Ansprechpartner" column="AnsprechpartnerOid" class="BeWo.Data.Entities.Person, BeWo.Data" cascade="none" />-->
<bag name="ValueList" table="ValueListEntry2Object" generic="true" cascade="all-delete-orphan" where="ObjectTid = 8" batch-size="250">
<key column="ObjectOid" />
<one-to-many class="BeWo.Data.Entities.ValueListEntry2Object,BeWo.Data" />
</bag>
<bag name="Employee2CustomerList" table="Employee2Customer" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Employee2Customer,BeWo.Data" />
</bag>
<bag name="Team2CustomerList" table="Team2Customer" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid"/>
<one-to-many class="BeWo.Data.Entities.Team2Customer,BeWo.Data"/>
</bag>
<bag name="Customer2PersonList" table="Customer2Person" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Customer2Person,BeWo.Data" />
</bag>
<bag name="Customer2OrganisationList" table="Customer2Organisation" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Customer2Organisation,BeWo.Data" />
</bag>
<bag name="AbsenceTimes" table="AbsenceTime" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.AbsenceTime, BeWo.Data" />
</bag>
<bag name="Medikamentenverordnungslisten" table="Medikamentenverordnungsliste" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Medikamentenverordnungsliste,BeWo.Data" />
</bag>
<bag name="SupportConcepts" table="SupportConcept" generic="true" inverse="true" cascade="none" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.SupportConcept,BeWo.Data" />
</bag>
<bag name="Customer2CostBearerList" table="Customer2CostBearer" generic="true" cascade="all" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Customer2CostBearer,BeWo.Data" />
</bag>
<bag name="ServiceRecordList" table="ServiceRecord" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.ServiceRecord,BeWo.Data" />
</bag>
<bag name="Diagnosis2CustomerList" table="Diagnosis2Customer" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Diagnosis2Customer,BeWo.Data" />
</bag>
<bag name="PlacementList" table="Placement" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Placement,BeWo.Data" />
</bag>
<bag name="AssessmentSheetCategoryList" table="Customer2AssessmentSheetCategory" generic="true" cascade="save-update" batch-size="250">
<key column="CustomerOid" />
<many-to-many column="AssessmentSheetOid" class="BeWo.Data.Entities.AssessmentSheetCategory,BeWo.Data" />
</bag>
<bag name="VarFieldValueList" table="VarFieldValue" generic="true" cascade="all-delete-orphan" where="ObjectTid = 8 AND IsActive=1" batch-size="250">
<key column="ObjectOid" />
<one-to-many class="BeWo.Data.Entities.VarFieldValue, BeWo.Data" />
</bag>
</class>
<bag name="ValueList" table="ValueListEntry2Object" generic="true" cascade="all-delete-orphan" where="ObjectTid = 8" batch-size="250">
<key column="ObjectOid" />
<one-to-many class="BeWo.Data.Entities.ValueListEntry2Object,BeWo.Data" />
</bag>
<bag name="Employee2CustomerList" table="Employee2Customer" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Employee2Customer,BeWo.Data" />
</bag>
<bag name="Team2CustomerList" table="Team2Customer" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid"/>
<one-to-many class="BeWo.Data.Entities.Team2Customer,BeWo.Data"/>
</bag>
<bag name="Customer2PersonList" table="Customer2Person" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Customer2Person,BeWo.Data" />
</bag>
<bag name="Customer2OrganisationList" table="Customer2Organisation" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Customer2Organisation,BeWo.Data" />
</bag>
<bag name="AbsenceTimes" table="AbsenceTime" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.AbsenceTime, BeWo.Data" />
</bag>
<bag name="Medikamentenverordnungslisten" table="Medikamentenverordnungsliste" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Medikamentenverordnungsliste,BeWo.Data" />
</bag>
<bag name="SupportConcepts" table="SupportConcept" generic="true" inverse="true" cascade="none" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.SupportConcept,BeWo.Data" />
</bag>
<bag name="Customer2CostBearerList" table="Customer2CostBearer" generic="true" cascade="all" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Customer2CostBearer,BeWo.Data" />
</bag>
<bag name="ServiceRecordList" table="ServiceRecord" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.ServiceRecord,BeWo.Data" />
</bag>
<bag name="Diagnosis2CustomerList" table="Diagnosis2Customer" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Diagnosis2Customer,BeWo.Data" />
</bag>
<bag name="PlacementList" table="Placement" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="CustomerOid" />
<one-to-many class="BeWo.Data.Entities.Placement,BeWo.Data" />
</bag>
<bag name="AssessmentSheetCategoryList" table="Customer2AssessmentSheetCategory" generic="true" cascade="save-update" batch-size="250">
<key column="CustomerOid" />
<many-to-many column="AssessmentSheetOid" class="BeWo.Data.Entities.AssessmentSheetCategory,BeWo.Data" />
</bag>
<bag name="VarFieldValueList" table="VarFieldValue" generic="true" cascade="all-delete-orphan" where="ObjectTid = 8 AND IsActive=1" batch-size="250">
<key column="ObjectOid" />
<one-to-many class="BeWo.Data.Entities.VarFieldValue, BeWo.Data" />
</bag>
</class>
</hibernate-mapping>

View File

@@ -20,11 +20,9 @@
<property column="Text4" type="String" name="Text4" />
<property column="Text5" type="String" name="Text5" />
<property column="Notice2" type="String" name="Notice2" />
<property column="EmployeeColor" type="String" name="EmployeeColor" />
<property column="EmployeeImage" name="EmployeeImage" />
<property column="EmployeeThumbnail" name="EmployeeThumbnail" />
<property column="EmployeeColor" type="String" name="EmployeeColor" />
<property column="InsTs" type="DateTime" name="InsTs" />
<property column="InsUser" type="String" name="InsUser" length="256" />
<property column="UdpUser" type="String" name="UdpUser" length="256" />
@@ -70,9 +68,9 @@
<key column="EmployeeOid" />
<one-to-many class="BeWo.Data.Entities.Contract, BeWo.Data" />
</bag>
<bag name="Overtimes" table="Overtime" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="EmployeeOid" />
<one-to-many class="BeWo.Data.Entities.Overtime, BeWo.Data" />
</bag>
<bag name="Overtimes" table="Overtime" generic="true" cascade="all-delete-orphan" batch-size="250">
<key column="EmployeeOid" />
<one-to-many class="BeWo.Data.Entities.Overtime, BeWo.Data" />
</bag>
</class>
</hibernate-mapping>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BeWo.Data.Entities.Image,BeWo.Data" table="Image">
<id name="Oid" column="Oid" type="Int64" unsaved-value="null">
<generator class="identity" />
</id>
<version type="Int64" column="Version" name="Version" />
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
<property column="Notice" type="String" name="Notice" length="1024" />
<property column="InsTs" type="DateTime" name="InsTs" />
<property column="InsUser" type="String" name="InsUser" length="256" />
<property column="UpdUser" type="String" name="UdpUser" length="256" />
<property column="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" name="IsActive" />
<property column="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" name="SystemEntryID" />
<property column="Original" name="Original" />
<property column="MediumThumbnail" name="MediumThumbnail" />
<property column="SmallThumbnail" name="SmallThumbnail" />
</class>
</hibernate-mapping>

View File

@@ -39,5 +39,9 @@
<key column="ObjectOid" />
<one-to-many class="BeWo.Data.Entities.VarFieldValue, BeWo.Data" />
</bag>
<bag name="Images" table="Image" generic="true" cascade="all-delete-orphan" >
<key column="PersonOid" />
<one-to-many class="BeWo.Data.Entities.Image, BeWo.Data" />
</bag>
</class>
</hibernate-mapping>

View File

@@ -18,6 +18,8 @@
<property column="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" name="SystemEntryID" />
<property column="UserGroupOids" type="String" name="UserGroupOids" />
<property column="ReportTypeName" type="String" name="ReportTypeName" />
<property column="FileName" type="String" name="FileName" />
<property column="ExportTitle" type="String" name="ExportTitle" />
<bag name="Parameter" table="Parameter" generic="true" cascade="all-delete-orphan">
<key column="QueryOid" />
<one-to-many class="BeWo.Data.Entities.Parameter,BeWo.Data" />

View File

@@ -34,13 +34,18 @@ namespace Host
throw new SecurityException("Anmeldung erforderlich!");
var report = CreateReport();
var repxStream = new MemoryStream();
using (var repxStream = new MemoryStream())
{
report.PrintingSystem.SaveDocument(repxStream, new NativeFormatOptions { Compressed = true });
report.PrintingSystem.SaveDocument(repxStream, new NativeFormatOptions { Compressed = true });
var bytesToWrite = repxStream.ToArray();
//var test = new XtraReport();
//test.PrintingSystem.LoadDocument(repxStream);
Response.OutputStream.Write(bytesToWrite, 0, bytesToWrite.Length);
var bytesToWrite = repxStream.ToArray();
Response.OutputStream.Write(bytesToWrite, 0, bytesToWrite.Length);
}
}
catch (Exception ex)
{

View File

@@ -0,0 +1,6 @@
ALTER TABLE `image`
ADD COLUMN `PersonOid` bigint(19) DEFAULT NULL;
update image set personoid = (select personoid from customer c where c.oid = customeroid) where customeroid is not null and personoid is null
update image set personoid = (select personoid from employee e where e.oid = employeeoid) where employeeoid is not null and personoid is null

View File

@@ -296,7 +296,7 @@ namespace BeWo.Report
return new XtraReport();
}
private void AddCostBearerIdToDict(long serviceInvoiceOid, Dictionary<long, string> serviceInvoiceOid2CostbearerId, CostBearer2SupportConcept c2s)
public virtual void AddCostBearerIdToDict(long serviceInvoiceOid, Dictionary<long, string> serviceInvoiceOid2CostbearerId, CostBearer2SupportConcept c2s)
{
if (c2s != null && c2s.CostBearer != null)
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -54,7 +54,6 @@
this.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.lblZeitraum = new DevExpress.XtraReports.UI.XRLabel();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
@@ -156,7 +155,6 @@
// TopMargin
//
this.TopMargin.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.lblZeitraum,
this.xrLabel2,
this.xrLabel1,
this.xrLabel3});
@@ -184,7 +182,7 @@
this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 52.66666F);
this.xrLabel1.Name = "xrLabel1";
this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel1.SizeF = new System.Drawing.SizeF(650F, 30F);
this.xrLabel1.SizeF = new System.Drawing.SizeF(650F, 47.33333F);
this.xrLabel1.StylePriority.UseFont = false;
this.xrLabel1.Text = "[ReportTitle]";
//
@@ -332,15 +330,6 @@
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.KassenbuchRO);
//
// lblZeitraum
//
this.lblZeitraum.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.lblZeitraum.LocationFloat = new DevExpress.Utils.PointFloat(0F, 82.66666F);
this.lblZeitraum.Name = "lblZeitraum";
this.lblZeitraum.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblZeitraum.SizeF = new System.Drawing.SizeF(650F, 33.79166F);
this.lblZeitraum.StylePriority.UseFont = false;
//
// KassenbuchReport
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
@@ -389,6 +378,5 @@
private DevExpress.XtraReports.UI.XRLabel xrLabel3;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell7;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell8;
private DevExpress.XtraReports.UI.XRLabel lblZeitraum;
}
}

View File

@@ -12,15 +12,12 @@ namespace BeWo.Report.DefaultReports
public void SetReportDataSource(KassenbuchRO pRO)
{
if (pRO.Transaktionen != null)
{
pRO.Transaktionen = pRO.Transaktionen.OrderBy(o => o.Belegdatum).ToList();
}
pRO.ReportTitle = string.Format("Kassenbuch \"{0}\" {1}", pRO.Kassenname,(pRO.Beguenstigter == null ? string.Empty : string.Format(" von {0}", pRO.Beguenstigter)));
lblZeitraum.Text = string.Format("{0} - {1}", pRO.StartZeitraum.ToString("dd. MMMM yyyy"),
pRO.EndZeitraum.ToString("dd. MMMM yyyy"));
bindingSource1.DataSource = pRO;
//if (pRO.Transaktionen != null)
//{
// pRO.Transaktionen = pRO.Transaktionen.OrderBy(o => o.Belegdatum).ToList();
//}
bindingSource1.DataSource = pRO;
}
}
}

View File

@@ -47,21 +47,33 @@ namespace BeWo.Report.DefaultReports.Alt
}
else
{
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
ii.ItemDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} FLS {3}x {4:c}",
ii.ItemPeriodStart, ii.ItemPeriodEnd,
ii.UnitCount, ii.RateFactor == 0 ? "" : "x " + pRO.RateFactorText2 + " ",
ii.AmountPerUnit);
}
}
var id = GetCustomerId(pRO);
if (id == "LWLNEU")
{
pRO.RateFactorText = null;
pRO.RateFactorText2 = null;
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
ii.ItemDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} FLS x {3:c}",
ii.ItemPeriodStart, ii.ItemPeriodEnd, ii.UnitCount, ii.AmountPerUnit);
}
}
}
else
{
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
ii.ItemDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} FLS {3}x {4:c}",
ii.ItemPeriodStart, ii.ItemPeriodEnd,
ii.UnitCount, ii.RateFactor == 0 ? "" : "x " + pRO.RateFactorText2 + " ",
ii.AmountPerUnit);
}
}
}
}

View File

@@ -21,6 +21,8 @@ namespace BeWo.Report.ReportObjects
public List<CustomerOrganisationRelationDC> EnvironmentOrganisations { get; set; }
public List<AbsenceTimeDC> Abwesenheiten { get; set; }
public string FamilyStatus { get; set; }
public string Fax { get; set; }
@@ -81,10 +83,16 @@ namespace BeWo.Report.ReportObjects
public List<ICD10Row> ICD10Diagnosen { get; set; }
public CustomerDC Customer { get; set; }
public static CustomerDataRO Create(CustomerDC pDC)
{
var result = new CustomerDataRO();
result.CustomerOid = pDC.CustomerOid.Value;
result.Customer = pDC;
if (pDC.AbsenceTimes != null)
{
result.Abwesenheiten = pDC.AbsenceTimes.OrderBy(a => a.Start).ToList();
}
result.CustomerOid = pDC.CustomerOid.Value;
result.FirstName = pDC.FirstName;
result.LastName = pDC.LastName;
result.ReferenceNumber = pDC.ReferenceNumber;
@@ -93,15 +101,15 @@ namespace BeWo.Report.ReportObjects
result.DateOfBirth = pDC.DateOfBirth.Value.ToShortDateString();
}
result.ICD10Diagnosen = new List<ICD10Row>();
foreach (var idc10 in pDC.ICD10DiagnosisCodes)
{
result.ICD10Diagnosen.Add(new ICD10Row(idc10, ICD10DAO.GetDiagnosisForCode(idc10)));
}
result.ICD10Diagnosen = new List<ICD10Row>();
foreach (var idc10 in pDC.ICD10DiagnosisCodes)
{
result.ICD10Diagnosen.Add(new ICD10Row(idc10, ICD10DAO.GetDiagnosisForCode(idc10)));
}
result.Sex = pDC.Sex == BS.Shared.Sex.Female
? "weiblich"
: "männlich";
? "weiblich"
: "männlich";
result.Occupation = pDC.Profession;
if (pDC.FamilyStatus.HasValue)
@@ -123,18 +131,18 @@ namespace BeWo.Report.ReportObjects
case BS.Shared.FamilyStatus.Partner:
result.FamilyStatus = "in Partnerschaft";
break;
case BS.Shared.FamilyStatus.PartnerDivorced:
case BS.Shared.FamilyStatus.PartnerDivorced:
result.FamilyStatus = "getrennt lebend";
break;
case BS.Shared.FamilyStatus.PartnerDead:
result.FamilyStatus = "partnerhinterblieben";
result.FamilyStatus = "partnerhinterblieben";
break;
case BS.Shared.FamilyStatus.PartnerMarried:
result.FamilyStatus = "verpartnert";
break;
case BS.Shared.FamilyStatus.Entpartnert:
result.FamilyStatus = "entpartnert";
break;
case BS.Shared.FamilyStatus.PartnerMarried:
result.FamilyStatus = "verpartnert";
break;
case BS.Shared.FamilyStatus.Entpartnert:
result.FamilyStatus = "entpartnert";
break;
}
}
@@ -193,6 +201,8 @@ namespace BeWo.Report.ReportObjects
if (pDC.CustomerVarFields.Count > 9)
result.VarField10 = pDC.CustomerVarFields[9].VarFieldValue;
}
return result;
}
}

View File

@@ -226,6 +226,10 @@ namespace BeWo.Report.ReportObjects
reportSR.ServiceRecordOid = sr.ServiceRecordOid;
reportSR.DistanceInMeter = sr.DistanceInMeter;
reportSR.Notice = sr.Notice;
reportSR.Notice2 = sr.Notice2;
reportSR.Notice3 = sr.Notice3;
reportSR.Notice4 = sr.Notice4;
reportSR.Notice5 = sr.Notice5;
reportSR.RoundedDuration = sr.RoundedDuration;
flm += sr.RoundedDuration;
@@ -430,6 +434,14 @@ namespace BeWo.Report.ReportObjects
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 RoundedDuration { get; set; }
public string ServiceCategory { get; set; }

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Web;
using BeWo.Data.Access;
@@ -53,12 +54,27 @@ namespace BeWo.Report.ReportObjects
public decimal? RateFactor { get; set; }
public List<ServiceRecordDC> ServiceRecords { get; set; }
public decimal? HourlyRate { get; set; }
public decimal? AmountInReportTimeSpan { get; set; }
public List<ServiceRecordDC> ServiceRecords { get; set; }
public bool IsApproved { get; set; }
public SupportConceptCostBearerRelDC Costbearer2Supportconcept { get; set; }
}
public string Custom1 { get; set; }
public string Custom2 { get; set; }
public string Custom3 { get; set; }
public string Custom4 { get; set; }
public string Custom5 { get; set; }
}
public static FinanceRO Create(DateTime? start, DateTime? end)
{
@@ -93,15 +109,22 @@ namespace BeWo.Report.ReportObjects
var relDC =
MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(cb2sc);
ro.ApprovedHours = calc.GetApprovedHoursTillNow(relDC, null) ?? 0;
ro.ServiceRecords =
cb2sc.ServiceRecords.Where(sr => sr.Start.Value.Date <= DateTime.Now.Date).ToList().MapToNewDCs();
ro.ServiceRecords = cb2sc.ServiceRecords.MapToNewDCs();
ro.Costbearer2Supportconcept = relDC;
ro.IsApproved = (relDC.ApprovedEndDate.HasValue || relDC.ApprovedStartDate.HasValue);
ro.BillableHours = calc.GetBillableDurationInMinutes(ro.ServiceRecords) / 60;
if (end.HasValue && end < DateTime.MaxValue.AddDays(-1))
{
ro.BillableHours =
calc.GetBillableDurationInMinutes(ro.ServiceRecords.Where(sr => sr.Start.Value.Date < end.Value.AddDays(1)).ToList())/60;
}
else
{
ro.BillableHours = calc.GetBillableDurationInMinutes(ro.ServiceRecords) / 60;
}
if (start.HasValue && end.HasValue)
if (start.HasValue && end.HasValue)
{
ro.ApprovedHoursInReportTimeSpan = calc.GetApprovedHoursForPeriod(relDC, start.Value, end.Value);
@@ -110,6 +133,10 @@ namespace BeWo.Report.ReportObjects
cb2sc.ServiceRecords.Where(sr => sr.Start >= start && sr.Start.Value.Date <= end.Value.Date).ToList().
MapToNewDCs())/60;
foreach (var serviceRecordtemp in cb2sc.ServiceRecords)
{
var test = serviceRecordtemp.DurationMinutes;
}
var costRateDcs =
MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(cb2sc.CostBearer.CostRatePeriods);
@@ -124,6 +151,21 @@ namespace BeWo.Report.ReportObjects
result.RateFactor = ro.RateFactor;
}
}
var hcr = costRateDcs.GetCostRatePeriodForDate(CostRatePeriodType.HourlyRate, start.Value);
if (hcr != null && hcr.CostRateValue.HasValue)
{
ro.HourlyRate = hcr.CostRateValue.Value;
}
if (ro.BillableHoursInReportTimeSpanWithFactor > 0)
{
ro.AmountInReportTimeSpan = ro.BillableHoursInReportTimeSpanWithFactor*ro.HourlyRate;
}
else
{
ro.AmountInReportTimeSpan = ro.BillableHoursInReportTimeSpan * ro.HourlyRate;
}
}

View File

@@ -9,51 +9,23 @@ using BS.Shared.DataContracts;
namespace BeWo.Report.ReportObjects
{
public class KassenbuchRO : AbstractBeWoReportObject<KassenbuchRO>
{
public List<ZeilenObjekt> Transaktionen { get; set; }
public DateTime Zeitraum { get; set; }
public decimal Anfangsbestand { get; set; }
public string Kassenname { get; set; }
public string Beguenstigter { get; set; }
public string ReportTitle { get; set; }
public DateTime StartZeitraum { get; set; }
public DateTime EndZeitraum { get; set; }
public class KassenbuchRO : AbstractBeWoReportObject<KassenbuchRO>
{
public List<ZeilenObjekt> Transaktionen { get; set; }
public decimal Anfangsbestand { get; set; }
public string Kassenname { get; set; }
public string Beguenstigter { get; set; }
public string ReportTitle { get; set; }
public DateTime StartZeitraum { get; set; }
public DateTime EndZeitraum { get; set; }
public static KassenbuchRO Create(DateTime pZeitraum, BargeldkassenDC pBargeldkasse, BeWoEntityBase pBeguenstigter)
{
var beguenstigter = string.Empty;
DateTime start = new DateTime(pZeitraum.Year, pZeitraum.Month, 1);
return Create(start, start.AddMonths(1), pBargeldkasse, pBeguenstigter);
}
if (pBeguenstigter is Customer)
{
var customer = (Customer) pBeguenstigter;
beguenstigter = customer.Person.FirstNameLastName;
}
var t = pBargeldkasse.Bargeldtransaktionen.Where(w => w.Zahlungsdatum != null && w.Zahlungsdatum.Value.Year == pZeitraum.Year && w.Zahlungsdatum.Value.Month == pZeitraum.Month).OrderByDescending(o => o.Zahlungsdatum).Select(tDC => new ZeilenObjekt
{
Einzahlung = tDC.Zahlungstyp == Zahlungstyp.Einzahlung && tDC.Betrag != null ? tDC.Betrag.Value : 0,
Auszahlung = tDC.Zahlungstyp == Zahlungstyp.Auszahlung && tDC.Betrag != null ? tDC.Betrag.Value : 0,
Bestand = tDC.Transaktionskassenbestand.Value,
Belegdatum = tDC.Zahlungsdatum.Value,
Notiz = tDC.Notice
}).ToList();
var ersteTransaktion = pBargeldkasse.Bargeldtransaktionen.OrderBy(o => o.Zahlungsdatum).ToList()[0];
return new KassenbuchRO
{
Kassenname = pBargeldkasse.Kassenname,
Beguenstigter = beguenstigter,
Zeitraum = pZeitraum,
Transaktionen = t,
Anfangsbestand = ersteTransaktion.Transaktionskassenbestand.Value - ersteTransaktion.Betrag.Value * (ersteTransaktion.Zahlungstyp == Zahlungstyp.Einzahlung ? 1 : -1),
ReportTitle = string.Format("Kassenbuch \"{0}\" {1}{2}", pBargeldkasse.Kassenname, pZeitraum.ToString("MMMM yyyy"), (pBeguenstigter == null ? string.Empty : string.Format(" von {0}", beguenstigter)))
};
}
public static KassenbuchRO Create(DateTime pStartZeitraum,DateTime pEndZeitraum, BargeldkassenDC pBargeldkasse, BeWoEntityBase pBeguenstigter)
public static KassenbuchRO Create(DateTime start, DateTime end, BargeldkassenDC pBargeldkasse, BeWoEntityBase pBeguenstigter)
{
var beguenstigter = string.Empty;
@@ -64,7 +36,7 @@ namespace BeWo.Report.ReportObjects
beguenstigter = customer.Person.FirstNameLastName;
}
var t = pBargeldkasse.Bargeldtransaktionen.Where(w => w.Zahlungsdatum != null && w.Zahlungsdatum.Value >= pStartZeitraum && w.Zahlungsdatum <= pEndZeitraum).OrderByDescending(o => o.Zahlungsdatum).Select(tDC => new ZeilenObjekt
var transkationenDiesenMonat = pBargeldkasse.Bargeldtransaktionen.Where(w => w.Zahlungsdatum != null && w.Zahlungsdatum.Value >= start && w.Zahlungsdatum.Value <= end).OrderBy(o => o.Zahlungsdatum).Select(tDC => new ZeilenObjekt
{
Einzahlung = tDC.Zahlungstyp == Zahlungstyp.Einzahlung && tDC.Betrag != null ? tDC.Betrag.Value : 0,
Auszahlung = tDC.Zahlungstyp == Zahlungstyp.Auszahlung && tDC.Betrag != null ? tDC.Betrag.Value : 0,
@@ -73,26 +45,52 @@ namespace BeWo.Report.ReportObjects
Notiz = tDC.Notice
}).ToList();
var ersteTransaktion = pBargeldkasse.Bargeldtransaktionen.OrderBy(o => o.Zahlungsdatum).ToList()[0];
return new KassenbuchRO
var transkationenVorDiesenMonat = pBargeldkasse.Bargeldtransaktionen.Where(w => w.Zahlungsdatum != null && w.Zahlungsdatum.Value < start).ToList();
//var ersteTransaktion = pBargeldkasse.Bargeldtransaktionen.OrderBy(o => o.Zahlungsdatum).ToList()[0];
var kb = new KassenbuchRO
{
Kassenname = pBargeldkasse.Kassenname,
Beguenstigter = beguenstigter,
StartZeitraum = pStartZeitraum,
EndZeitraum = pEndZeitraum,
Transaktionen = t,
Anfangsbestand = ersteTransaktion.Transaktionskassenbestand.Value - ersteTransaktion.Betrag.Value * (ersteTransaktion.Zahlungstyp == Zahlungstyp.Einzahlung ? 1 : -1)
StartZeitraum = start,
EndZeitraum = end,
Transaktionen = transkationenDiesenMonat,
Anfangsbestand = transkationenVorDiesenMonat.Sum(t => (t.Betrag ?? 0) * (t.Zahlungstyp == Zahlungstyp.Einzahlung ? 1 : -1)),
};
}
}
public struct ZeilenObjekt
{
public decimal Einzahlung { get; set; }
public decimal Auszahlung { get; set; }
public decimal Bestand { get; set; }
public DateTime? Belegdatum { get; set; }
public string Notiz { get; set; }
}
if (start.Month == end.Month && start.Year == end.Year)
{
kb.ReportTitle = string.Format("Kassenbuch \"{0}\" {1}{2}", pBargeldkasse.Kassenname,
start.ToString("MMMM yyyy"),
(pBeguenstigter == null ? string.Empty : string.Format(" von {0}", beguenstigter)));
}
else
{
kb.ReportTitle = string.Format("Kassenbuch \"{0}\" {1} bis {2} {3}", pBargeldkasse.Kassenname,
start.ToString("dd.MM.yyyy"), end.ToString("dd.MM.yyyy"),
(pBeguenstigter == null ? string.Empty : string.Format(" von {0}", beguenstigter)));
}
decimal bestand = kb.Anfangsbestand;
foreach (var ta in transkationenDiesenMonat)
{
bestand = bestand + ta.Einzahlung - ta.Auszahlung;
ta.Bestand = bestand;
}
return kb;
}
}
public class ZeilenObjekt
{
public decimal Einzahlung { get; set; }
public decimal Auszahlung { get; set; }
public decimal Bestand { get; set; }
public DateTime? Belegdatum { get; set; }
public string Notiz { get; set; }
}
}

View File

@@ -108,7 +108,10 @@ namespace BeWo.Report.ReportObjects
case "DSO":
ro.MedVerDetailList6.Add(medVerDetail);
break;
}
default:
ro.MedVerDetailList6.Add(medVerDetail);
break;
}
}
return ro;

View File

@@ -7,6 +7,7 @@ using BeWo.Data.Entities;
using BeWo.Data.Access;
using BeWo.Service.Configuration;
using BeWo.Service.ServiceImplementations;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.Extensions;
using DevExpress.XtraCharts.Native;
@@ -18,6 +19,7 @@ namespace BeWo.Report.ReportObjects
{
private decimal maxWochenstunden = 40;
private AppSettings appSettings;
private const int ANZ_WOCHENTAGE = 5;
public MitarbeiterstundenkontoBerechnung()
{
@@ -64,6 +66,7 @@ namespace BeWo.Report.ReportObjects
{
foreach (var teamDetail in ro.TeamDetailList)
{
teamDetail.EmployeeDetailList = FilterEmployeeList(teamDetail.EmployeeDetailList);
foreach (var empDetail in teamDetail.EmployeeDetailList)
{
teamDetail.SollGesamt += empDetail.StundenSollOhneUrlaubKrankheit;
@@ -95,8 +98,9 @@ namespace BeWo.Report.ReportObjects
Employee emp = empDetail.Employee;
decimal bu = 0;
int anzWochentage = ANZ_WOCHENTAGE;
Contract c = emp.GetValidContractForDate(ro.ReportStartDate);
Contract c = emp.GetValidContractForDate(ro.ReportStartDate);
if (c == null) // Kein Vertrag vom 1. gefunden, gucken, ob es einen gibt, der mitten im Monat beginnt.
{
@@ -119,7 +123,9 @@ namespace BeWo.Report.ReportObjects
decimal flsIst = 0;
decimal mittelbarIst = 0;
decimal weeklyTotalHours = 0;
decimal pause1 = 0;
decimal pause2 = 0;
decimal weeklyTotalHours = 0;
decimal flsSollGesamt = 0;
decimal? fehlZeitenGesamt = null;
decimal? tageUrlaubGesamt = null;
@@ -150,10 +156,15 @@ namespace BeWo.Report.ReportObjects
while (berichtsAnfang < berichtsEnde)
{
var arbeitstage = GetArbeitstageImBereich(berichtsAnfang, berichtsEnde, emp);
var arbeitstage = GetArbeitstageImBereich(berichtsAnfang, berichtsEnde, emp);
//if (anzWochentage != 5)
//{
// arbeitstage *= anzWochentage/5m;
//}
workdaysTotal += arbeitstage;
weeklyTotalHours = 0;
if (c != null)
if (c != null)
{
if (c.WeeklyTotalHours.HasValue)
{
@@ -161,22 +172,37 @@ namespace BeWo.Report.ReportObjects
bu = c.WeeklyTotalHours.Value/this.maxWochenstunden;
}
//if (c.WeeklyDays.HasValue && c.WeeklyDays.Value > 0)
//{
// anzWochentage = c.WeeklyDays.Value;
//}
//if (c.EntryDate > ro.ReportStartDate)
// bu = 0;
}
var stundenSoll = arbeitstage * (weeklyTotalHours / 5m);
stundenSollGesamt += stundenSoll;
var stundenSollProMonat = BerechneSollProMonat(emp, berichtsAnfang, berichtsEnde);
var stundenSoll = stundenSollProMonat;
tatsaechlicheSollStdGesamt += stundenSoll;
if (!stundenSoll.HasValue)
{
stundenSoll = arbeitstage*(weeklyTotalHours/anzWochentage);
}
stundenSollGesamt += stundenSoll ?? 0;
tatsaechlicheSollStdGesamt += stundenSoll ?? 0;
HandleServiceRecords(empDetail, groupFilteredRecords, c);
foreach (var item in groupFilteredRecords)
{
if (!IsServiceRecordFehlzeit(item))
{
if (item.Start.Value >= berichtsAnfang && item.Start.Value < berichtsEnde)
{
String test = String.Format("{0:dd.MM.yyyy HH:mm}, {1:0} Minuten, {2}, {3}", item.Start, item.RoundedDuration, item.ServiceDescription.Name, item.Notice);
HandleServiceRecord(empDetail, item);
if (AddServiceRecordToDuration(item))
{
decimal duration = 0;
@@ -209,7 +235,16 @@ namespace BeWo.Report.ReportObjects
}
}
decimal? fehlZeiten = GetFehlzeiten(groupFilteredRecords, berichtsAnfang, berichtsEnde);
if (SollPauseBerechnen())
{
pause1 += BerechnePauseMinuten(recordsThisMonth);
pause2 += BerechneAutoPausen(recordsThisMonth);
}
var flsSollProMonat = BerechneFlsSollProMonat(emp, berichtsAnfang, berichtsEnde);
decimal? fehlZeiten = GetFehlzeiten(groupFilteredRecords, berichtsAnfang, berichtsEnde);
if (fehlZeiten.HasValue)
{
if (!fehlZeitenGesamt.HasValue)
@@ -233,19 +268,48 @@ namespace BeWo.Report.ReportObjects
tageKrankheitGesamt = 0;
tageKrankheitGesamt += ath.TageKrankheit;
}
if (ath.TageGesamt.HasValue)
empDetail.ArbeitstageProWoche = anzWochentage;
if (ath.TageGesamt.HasValue)
{
if (!abwesenheitTageGesamt.HasValue)
abwesenheitTageGesamt = 0;
abwesenheitTageGesamt += ath.TageGesamt;
tatsaechlicheSollStdGesamt -= (ath.TageGesamt.Value * (weeklyTotalHours / 5m));
if (c != null && c.WeeklyDays.HasValue && c.WeeklyDays.Value > 0)
{
empDetail.ArbeitstageProWoche = c.WeeklyDays.Value;
}
if (stundenSollProMonat.HasValue)
{
decimal stundenProTag = stundenSollProMonat.Value/arbeitstage;
tatsaechlicheSollStdGesamt -= (ath.TageGesamt.Value * stundenProTag);
}
else
{
tatsaechlicheSollStdGesamt -= (ath.TageGesamt.Value * (weeklyTotalHours / empDetail.ArbeitstageProWoche));
}
}
flsSollGesamt = tatsaechlicheSollStdGesamt;
flsSollGesamt = tatsaechlicheSollStdGesamt;
if (c != null && c.WeeklyFLS.HasValue && c.WeeklyTotalHours.HasValue && c.WeeklyTotalHours.Value != 0)
flsSollGesamt *= c.WeeklyFLS.Value / c.WeeklyTotalHours.Value;
if (flsSollProMonat.HasValue)
{
if (stundenSollProMonat.HasValue)
{
flsSollGesamt *= flsSollProMonat.Value / stundenSollProMonat.Value;
}
}
else
{
if (c != null && c.WeeklyFLS.HasValue && c.WeeklyTotalHours.HasValue && c.WeeklyTotalHours.Value != 0)
flsSollGesamt *= c.WeeklyFLS.Value / c.WeeklyTotalHours.Value;
}
berichtsAnfang = berichtsEnde;
berichtsEnde = monatsEnde;
@@ -270,9 +334,9 @@ namespace BeWo.Report.ReportObjects
mittelbarIst /= 60m;
empDetail.WorkDaysThisMonth = workdaysTotal;
//decimal stundenSollMax = arbeitstage * (maxWochenstunden / 5) * bu;
//decimal stundenSollMax = arbeitstage * (maxWochenstunden / xxx) * bu;
empDetail.SollProTag = (weeklyTotalHours/5m);
empDetail.SollProTag = (weeklyTotalHours/ anzWochentage);
empDetail.StundenSollMax = stundenSollGesamt;
@@ -293,7 +357,11 @@ namespace BeWo.Report.ReportObjects
empDetail.FlsDiff = flsIst - empDetail.FlsSoll;
empDetail.StundenMittelbarIst = mittelbarIst;
empDetail.StundenGesamtIst = flsIst + mittelbarIst;
if (empDetail.FlsSoll != 0)
empDetail.StundenGesamtIst -= pause1/60;
empDetail.StundenGesamtIst -= pause2/60;
if (empDetail.FlsSoll != 0)
empDetail.RelationIstSoll = (empDetail.FlsIst/empDetail.FlsSoll)*100m;
@@ -316,6 +384,7 @@ namespace BeWo.Report.ReportObjects
if (ShouldCreateDayDetails())
{
empDetail.Days = CreateDayDetails(monatsAnfang, monatsEnde, empDetail, recordsThisMonth);
var ah = GetAdditionalHours(empDetail.Days, monatsAnfang, monatsEnde, empDetail, recordsThisMonth);
ueberstunden += ah;
@@ -336,9 +405,230 @@ namespace BeWo.Report.ReportObjects
GetAbsenceTimeDays(emp.AbsenceTimes, new DateTime(monatsAnfang.Year, 1, 1), monatsEnde).TageUrlaub;
}
ro.EmployeeDetailList = FilterEmployeeList(ro.EmployeeDetailList);
}
public virtual bool ShouldCreateDayDetails()
public virtual decimal BerechneAutoPausen(IList<ServiceRecord> recordsThisMonth)
{
return 0;
}
public virtual decimal BerechnePauseMinuten(IList<ServiceRecord> srList)
{
decimal pausenZeit = 0;
List<ServiceRecord> pausen = new List<ServiceRecord>();
List<ServiceRecord> nichtpausen = new List<ServiceRecord>();
foreach (var sr in srList)
{
if (sr.ServiceDescription.Name == "Pause")
{
pausen.Add(sr);
}
else
{
nichtpausen.Add(sr);
}
}
foreach (var pause in pausen)
{
foreach (var arbeitszeit in nichtpausen)
{
var pauseSpan = new DateTimeSpan
{
StartDateTime = pause.Start.Value,
EndDateTime = pause.Start.Value.AddMinutes((double) pause.RoundedDuration)
};
var arbeitszeitSpan = new DateTimeSpan
{
StartDateTime = arbeitszeit.Start.Value,
EndDateTime = arbeitszeit.Start.Value.AddMinutes((double) arbeitszeit.RoundedDuration)
};
if (arbeitszeit.GroupOid.HasValue)
{
arbeitszeitSpan.EndDateTime =
arbeitszeit.Start.Value.AddMinutes((double) (arbeitszeit.GroupRoundedDuration ?? 0));
}
if (pauseSpan.Overlaps(arbeitszeitSpan))
{
DateTime startUeberlappung = pauseSpan.StartDateTime;
if (arbeitszeitSpan.StartDateTime > startUeberlappung)
startUeberlappung = arbeitszeitSpan.StartDateTime;
DateTime endUeberlappung = pauseSpan.EndDateTime;
if (arbeitszeitSpan.EndDateTime < endUeberlappung)
endUeberlappung = arbeitszeitSpan.EndDateTime;
var overlapping = (decimal) endUeberlappung.Subtract(startUeberlappung).TotalMinutes;
pausenZeit += overlapping;
}
}
}
return pausenZeit;
}
public virtual bool SollPauseBerechnen()
{
return false;
}
public virtual List<MitarbeiterstundenkontoRO.EmployeeDetail> FilterEmployeeList(List<MitarbeiterstundenkontoRO.EmployeeDetail> employeeDetailList)
{
List<MitarbeiterstundenkontoRO.EmployeeDetail> newEmpList = new List<MitarbeiterstundenkontoRO.EmployeeDetail>();
foreach (var ed in employeeDetailList)
{
if (ed.Employee.IsActive == ActivationTypeId.Active)
{
newEmpList.Add(ed);
}
else if (ed.Employee.IsActive == ActivationTypeId.Archived)
{
if (ed.StundenGesamtIst != 0)
{
newEmpList.Add(ed);
}
}
}
return newEmpList;
}
public virtual void HandleServiceRecords(MitarbeiterstundenkontoRO.EmployeeDetail empDetail, IList<ServiceRecord> groupFilteredRecords, Contract contract)
{
//do nothing
}
public virtual void CorrectOverlappingTimes(IList<ServiceRecord> serviceRecords)
{
List<ServiceRecord> oldRecords = new List<ServiceRecord>();
foreach (var newRecord in serviceRecords)
{
if (!CorrectOverlappingTime(newRecord))
{
continue;
}
if (newRecord.Start.HasValue && newRecord.Start.Value.Second > 0)
{
continue;
}
bool isGroup = false;
var minuten = newRecord.RoundedDuration;
if (newRecord.GroupRoundedDuration.HasValue)
{
minuten = newRecord.GroupRoundedDuration.Value;
isGroup = true;
}
var newSpan = new DateTimeSpan
{
StartDateTime = newRecord.Start.Value,
EndDateTime = newRecord.Start.Value.AddMinutes((double)minuten)
};
foreach (var oldRecord in oldRecords)
{
var oldSpan = new DateTimeSpan
{
StartDateTime = oldRecord.Start.Value,
EndDateTime = oldRecord.Start.Value.AddMinutes((double)oldRecord.RoundedDuration)
};
if (oldRecord.GroupRoundedDuration.HasValue)
{
oldSpan.EndDateTime = oldRecord.Start.Value.AddMinutes((double)oldRecord.GroupRoundedDuration);
}
if (oldSpan.Overlaps(newSpan))
{
DateTime start = newSpan.StartDateTime;
if (oldSpan.StartDateTime > start)
start = oldSpan.StartDateTime;
DateTime end = newSpan.EndDateTime;
if (oldSpan.EndDateTime < end)
end = oldSpan.EndDateTime;
if (newSpan.StartDateTime >= oldSpan.StartDateTime)
{
newSpan.StartDateTime = oldSpan.EndDateTime;
if (newSpan.StartDateTime > newSpan.EndDateTime)
{
newSpan.StartDateTime = newSpan.EndDateTime;
}
newRecord.Start = newSpan.StartDateTime;
newRecord.End = newSpan.EndDateTime;
if (!isGroup)
{
newRecord.RoundedDuration =
(decimal)newRecord.End.Value.Subtract(newRecord.Start.Value).TotalMinutes;
}
else
{
newRecord.GroupRoundedDuration = (decimal)newRecord.End.Value.Subtract(newRecord.Start.Value).TotalMinutes;
}
}
else
{
oldSpan.StartDateTime = newSpan.EndDateTime;
if (oldSpan.StartDateTime > oldSpan.EndDateTime)
{
oldSpan.StartDateTime = oldSpan.EndDateTime;
}
oldRecord.Start = oldSpan.StartDateTime;
oldRecord.End = oldSpan.EndDateTime;
if (!isGroup)
{
oldRecord.RoundedDuration = (decimal)oldRecord.End.Value.Subtract(oldRecord.Start.Value).TotalMinutes;
}
else
{
oldRecord.GroupRoundedDuration = (decimal)oldRecord.End.Value.Subtract(oldRecord.Start.Value).TotalMinutes;
}
}
}
}
oldRecords.Add(newRecord);
}
}
public virtual bool CorrectOverlappingTime(ServiceRecord newRecord)
{
return true;
}
public virtual decimal? BerechneSollProMonat(Employee emp, DateTime start, DateTime ende)
{
return null;
}
public virtual decimal? BerechneFlsSollProMonat(Employee emp, DateTime start, DateTime ende)
{
return null;
}
public virtual void HandleServiceRecord(MitarbeiterstundenkontoRO.EmployeeDetail emp, ServiceRecord item)
{
//do nothing
}
public virtual bool ShouldCreateDayDetails()
{
return false;
}
@@ -621,6 +911,7 @@ namespace BeWo.Report.ReportObjects
if (c != null)
{
Dictionary<String, IList<ServiceRecord>> srDict = CreateServiceRecordDictByDate(records);
DateTime start = c.EntryDate.HasValue ? c.EntryDate.Value : new DateTime(2011, 1, 1);
@@ -629,8 +920,14 @@ namespace BeWo.Report.ReportObjects
DateTime contractEnd = c.ContractEndDate.HasValue ? c.ContractEndDate.Value : DateTime.MaxValue;
decimal bu = 0;
decimal weeklyTotalHours = this.maxWochenstunden;
if (c.WeeklyTotalHours.HasValue)
int anzWochentage = ANZ_WOCHENTAGE;
//if (c.WeeklyDays.HasValue && c.WeeklyDays.Value > 0)
//{
// anzWochentage = c.WeeklyDays.Value;
//}
if (c.WeeklyTotalHours.HasValue)
{
weeklyTotalHours = c.WeeklyTotalHours.Value;
bu = c.WeeklyTotalHours.Value / maxWochenstunden;
@@ -646,7 +943,7 @@ namespace BeWo.Report.ReportObjects
if (contractEnd < DateTime.MaxValue && contractEnd.AddDays(1) < ende)
ende = contractEnd.AddDays(1);
//IList<ServiceRecord> recordsThisMonth = new List<ServiceRecord>();
IList<ServiceRecord> recordsThisMonth = new List<ServiceRecord>();
String key = String.Format("{0:yyyyMM}", start);
if (srDict.ContainsKey(key))
@@ -685,16 +982,28 @@ namespace BeWo.Report.ReportObjects
else
mittelbarIst += duration;
}
//recordsThisMonth.Add(item);
}
}
recordsThisMonth.Add(item);
}
}
}
decimal arbeitstage = GetArbeitstageImBereich(start, ende, emp);
decimal arbeitstage = GetArbeitstageImBereich(start, ende, emp);
//if (anzWochentage != 5)
//{
// arbeitstage *= anzWochentage / 5m;
//}
var stundenSollProMonat = BerechneSollProMonat(emp, start, ende);
var soll = stundenSollProMonat;
if (!soll.HasValue)
{
decimal maxSollMonat = arbeitstage * (maxWochenstunden / anzWochentage);
soll = maxSollMonat*bu;
}
decimal maxSollMonat = arbeitstage * (maxWochenstunden / 5);
decimal sollMitarbeiter = maxSollMonat * bu;
decimal sollMitarbeiter = soll ?? 0;
var ath = GetAbsenceTimeDays(emp.AbsenceTimes, start, ende);
decimal? fehlzeit = GetFehlzeiten(records, start, ende);
@@ -702,13 +1011,29 @@ namespace BeWo.Report.ReportObjects
if (fehlzeit.HasValue)
{
sollMitarbeiter -= fehlzeit.Value;
maxSollMonat -= fehlzeit.Value;
}
if (ath.TageGesamt.HasValue)
{
sollMitarbeiter -= (ath.TageGesamt.Value * (maxWochenstunden / 5) * bu);
maxSollMonat -= (ath.TageGesamt.Value * (maxWochenstunden / 5) * bu);
}
var arbeitstageProWoche = anzWochentage;
if (ath.TageGesamt.HasValue)
{
if (c != null && c.WeeklyDays.HasValue && c.WeeklyDays.Value > 0)
{
arbeitstageProWoche = c.WeeklyDays.Value;
}
if (stundenSollProMonat.HasValue)
{
decimal stundenProTag = stundenSollProMonat.Value / arbeitstage;
sollMitarbeiter -= (ath.TageGesamt.Value * stundenProTag);
}
else
{
sollMitarbeiter -= (ath.TageGesamt.Value * (maxWochenstunden / arbeitstageProWoche) * bu);
}
}
decimal stundenMonat = minutenMonat/60m;
if (AddRateFactorToIst() != 1)
@@ -721,7 +1046,16 @@ namespace BeWo.Report.ReportObjects
ueberstunden = 0;
ueberstunden += stundenMonat - sollMitarbeiter;
decimal extraUeberstunden = 0;
if (SollPauseBerechnen())
{
var pause1 = BerechnePauseMinuten(recordsThisMonth);
var pause2 = BerechneAutoPausen(recordsThisMonth);
ueberstunden -= pause1/60;
ueberstunden -= pause2/60;
}
decimal extraUeberstunden = 0;
BerechneExtraUeberstunden(emp, start, ende, out extraUeberstunden);
ueberstunden += extraUeberstunden;
@@ -731,8 +1065,10 @@ namespace BeWo.Report.ReportObjects
if (ShouldCreateDayDetails())
{
MitarbeiterstundenkontoRO.EmployeeDetail ed = new MitarbeiterstundenkontoRO.EmployeeDetail();
ed.SollProTag = weeklyTotalHours/5;
ed.Employee = emp;
ed.SollProTag = weeklyTotalHours/ anzWochentage;
ed.ArbeitstageProWoche = arbeitstageProWoche;
ed.Employee = emp;
var days = CreateDayDetails(start, ende, ed, records);
var ah = GetAdditionalHours(days, start, ende, ed, records);
ueberstunden += ah;
@@ -768,7 +1104,9 @@ namespace BeWo.Report.ReportObjects
}
}
public virtual Dictionary<string, IList<ServiceRecord>> CreateServiceRecordDictByDate(IList<ServiceRecord> records)
public virtual Dictionary<string, IList<ServiceRecord>> CreateServiceRecordDictByDate(IList<ServiceRecord> records)
{
var dict = new Dictionary<string, IList<ServiceRecord>>();
foreach (var item in records)
@@ -1092,8 +1430,13 @@ namespace BeWo.Report.ReportObjects
list.Add(new DateTime(year, 12, 24)); // , "Heilig Abend"));
list.Add(new DateTime(year, 12, 25)); // , "1. Weihnachtstag"));
list.Add(new DateTime(year, 12, 26)); // , "2. Weihnachtstag"));
DateTime osterSonntag = GetOsterSonntag(year);
if (year == 2017)
{
list.Add(new DateTime(year, 10, 31)); // , "Reformationstag"));
}
DateTime osterSonntag = GetOsterSonntag(year);
//list.Add(osterSonntag); // , "Ostersonntag"));
//list.Add(osterSonntag.AddDays(-3)); // , "Gründonnerstag")); q
//list.Add(osterSonntag.AddDays(-48)); // , "Rosenmontag"));

View File

@@ -5,6 +5,7 @@ using System.Windows.Ink;
using BS.Shared.Core;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared;
namespace BeWo.Report.ReportObjects
{
@@ -69,19 +70,45 @@ namespace BeWo.Report.ReportObjects
}
else
{
employees = DAOFactory.GenericDAO.GetAllActive<Employee>();
}
employees = DAOFactory.GenericDAO.GetAllActiveAndArchived<Employee>();
}
foreach (var emp in employees)
{
var empDetail = new EmployeeDetail();
ro.EmployeeDetailList.Add(empDetail);
empDetail.Teams = team == null ? DAOFactory.SearchDAO.FindTeamsOfEmployee(emp.Oid.Value) : new List<Team> {team};
empDetail.Employee = emp;
empDetail.LastName = emp.Person.LastName;
empDetail.FirstName = emp.Person.FirstName;
empDetail.FullName = String.Format("{0}, {1}", empDetail.LastName, empDetail.FirstName);
bool add = true;
if (emp.IsActive == ActivationTypeId.Archived)
{
Contract c = emp.GetValidContractForDate(ro.ReportStartDate);
if (c == null) // Kein Vertrag vom 1. gefunden, gucken, ob es einen gibt, der mitten im Monat beginnt.
{
var c2 = GetNextValidContractForDate(ro.ReportStartDate, emp);
if (c2 != null && c2.EntryDate.HasValue && c2.EntryDate.Value < ro.ReportEndDate)
c = c2;
}
if (c == null)
{
add = false;
}
}
if (add)
{
ro.EmployeeDetailList.Add(empDetail);
empDetail.Teams = team == null
? DAOFactory.SearchDAO.FindTeamsOfEmployee(emp.Oid.Value)
: new List<Team> {team};
empDetail.Employee = emp;
empDetail.LastName = emp.Person.LastName;
empDetail.FirstName = emp.Person.FirstName;
empDetail.FullName = String.Format("{0}, {1}", empDetail.LastName, empDetail.FirstName);
}
}
@@ -113,7 +140,30 @@ namespace BeWo.Report.ReportObjects
return ro;
}
public class TeamDetail
private static Contract GetNextValidContractForDate(DateTime dt, Employee emp)
{
Contract contractNextToStartDate = emp.GetValidContractForDate(dt);
if (contractNextToStartDate == null)
{
foreach (var item in emp.Contracts)
{
if (item.EntryDate.HasValue && item.EntryDate.Value >= dt)
{
if (contractNextToStartDate == null || item.EntryDate.Value < contractNextToStartDate.EntryDate.Value)
{
contractNextToStartDate = item;
}
}
}
}
return contractNextToStartDate;
}
public class TeamDetail
{
private List<EmployeeDetail> _EmployeeDetailList = new List<EmployeeDetail>();
@@ -217,7 +267,29 @@ namespace BeWo.Report.ReportObjects
public decimal WorkDaysThisMonth { get; set; }
public decimal SollProTag { get; set; }
}
public decimal Custom1 { get; set; }
public decimal Custom2 { get; set; }
public decimal Custom3 { get; set; }
public decimal Custom4 { get; set; }
public decimal Custom5 { get; set; }
public decimal Custom6 { get; set; }
public decimal Custom7 { get; set; }
public decimal Custom8 { get; set; }
public decimal Custom9 { get; set; }
public decimal Custom10 { get; set; }
public int ArbeitstageProWoche { get; set; }
}
public class DayDetail
{

View File

@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using BeWo.Service.Plugins;
using BS.Shared;
using BeWo.Data.Access;
@@ -59,7 +62,9 @@ namespace BeWo.Report.ReportObjects
var factory = PluginLoader.FindClass<ServiceRecordStatisticFactory>() ?? new ServiceRecordStatisticFactory();
if (cb2scOid > 0)
Dictionary<long, ValueListEntry> oid2ValueListEntries = null;
if (cb2scOid > 0)
{
var statistics = factory.CreateSupportConceptStatisticsImpl(cb2scOid, DateTime.Now);
@@ -162,11 +167,14 @@ namespace BeWo.Report.ReportObjects
{
detail.StartTime = dc.Start;
DateTime endDt = dc.Start.Value.AddMinutes((double)dc.RoundedDuration);
//DateTime endDt = dc.Start.Value.AddMinutes((double)dc.RoundedDuration);
detail.EndTime = endDt;
//detail.EndTime = endDt;
detail.TimeRange = String.Format("{0:HH:mm} - {1:HH:mm}", detail.Start, endDt);
//detail.TimeRange = String.Format("{0:HH:mm} - {1:HH:mm}", detail.Start, endDt);
detail.EndTime = dc.End;
detail.TimeRange = String.Format("{0:HH:mm} - {1:HH:mm}", detail.Start, detail.EndTime);
}
detail.InsertedOn = dc.InsertedOn;
@@ -174,7 +182,8 @@ namespace BeWo.Report.ReportObjects
detail.Notice = dc.Notice;
detail.RoundedDuration = dc.RoundedDuration;
detail.DistanceInMeter = dc.DistanceInMeter;
detail.IsBillable = dc.ServiceDescription.Category.IsBillable;
if (detail.Start != null && detail.End != null)
{
var ts = detail.End.Value.Subtract(detail.Start.Value);
@@ -188,17 +197,60 @@ namespace BeWo.Report.ReportObjects
detail.ServiceCategory = dc.ServiceDescription.CategoryName;
}
detail.Goals = String.Empty;
detail.GoalPaths = new List<string>();
if (dc.Goals != null && dc.Goals.Count > 0)
{
if (oid2ValueListEntries == null)
{
oid2ValueListEntries = new Dictionary<long, ValueListEntry>();
var list = DAOFactory.SearchDAO.FindValueListEntries(new[]
{
ValueListEntryType.SupportConceptGoalCategoryType,
ValueListEntryType.SupportConceptGoalType,
ValueListEntryType.SupportConceptIndividualGoalCategoryType,
ValueListEntryType.SupportConceptIndividualGoalType
}.ToList()).Where(ve => ve.IsActive == ActivationTypeId.Active);
foreach (var vle in list)
{
oid2ValueListEntries.Add(vle.Oid.Value, vle);
}
}
foreach (var goal in dc.Goals)
{
if (detail.Goals.Length > 0)
detail.Goals += ", ";
detail.Goals += goal.TypeDescription;
detail.GoalPaths.Add(CreateGoalPath(goal, oid2ValueListEntries));
}
}
if (dc.SignatureOid.HasValue)
{
var sig = DAOFactory.GenericDAO.GetByID<Signature>(dc.SignatureOid.Value);
detail.Signature = sig.DataBild;
//if (!String.IsNullOrWhiteSpace(sig.DataBild))
//{
// //detail.Signature = Encoding.ASCII.GetBytes(sig.DataBild);
// byte[] barray = System.Text.Encoding.Unicode.GetBytes(sig.DataBild);
// using (var ms = new MemoryStream(barray))
// {
// Image returnImage = Image.FromStream(ms);
// detail.Signature = returnImage.
// }
// //var buffer = Convert.FromBase64String(Convert.ToBase64String(str));
// //detail.Signature = buffer;
// //detail.Signature = File.ReadAllBytes("C:\\Temp\\monster.png");
//}
}
ro.ServiceRecordDetailList.Add(detail);
}
@@ -210,7 +262,21 @@ namespace BeWo.Report.ReportObjects
return ro;
}
private static bool TimeSpanIsEqual(SupportConceptStatisticsDC r)
private static string CreateGoalPath(ValueListEntryDC goal, Dictionary<long, ValueListEntry> oid2ValueListEntries)
{
String path = goal.TypeDescription;
long? parentOid = goal.ParentOid;
while (parentOid.HasValue && oid2ValueListEntries.ContainsKey(parentOid.Value))
{
var parent = oid2ValueListEntries[parentOid.Value];
path = parent.Value + "->" + path;
parentOid = parent.ParentOid;
}
return path;
}
private static bool TimeSpanIsEqual(SupportConceptStatisticsDC r)
{
if (r.PeriodStatistics != null && r.PeriodStatistics.Count > 1)
{
@@ -250,6 +316,8 @@ namespace BeWo.Report.ReportObjects
public string Goals { get; set; }
public List<string> GoalPaths { get; set; }
public string InsUser { get; set; }
public DateTime? InsertedOn { get; set; }
@@ -269,6 +337,10 @@ namespace BeWo.Report.ReportObjects
public string TimeRange { get; set; }
public int? DistanceInMeter { get; set; }
public bool IsBillable { get; set; }
public String Signature { get; set; }
}
public class ServiceRecordStatistics

View File

@@ -666,6 +666,11 @@ namespace BeWo.Report.ReportObjects
sd.EmployeeNameCommaSeparated = string.Format("{0}, {1}", iSr.Employee.Person.LastName, iSr.Employee.Person.FirstName);
sd.Notice = iSr.Notice;
sd.Notice2 = iSr.Notice2;
sd.Notice3 = iSr.Notice3;
sd.Notice4 = iSr.Notice4;
sd.Notice5 = iSr.Notice5;
if (iSr.ServiceDescription != null)
{
sd.ServiceDescription = iSr.ServiceDescription.Name;
@@ -1126,6 +1131,14 @@ namespace BeWo.Report.ReportObjects
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 string ServiceCategory { get; set; }
public string ServiceCategoryAbbr { get; set; }

View File

@@ -16,6 +16,7 @@ namespace BeWo.Report.ReportObjects
{
public class SettlementRO : AbstractBeWoReportObject<SettlementRO>
{
public Settlement2DC SettlementDC { get; set; }
public long CostBearer2SupportConceptOid { get; set; }
public string Abrechnungstext1 { get; set; }
@@ -315,6 +316,7 @@ namespace BeWo.Report.ReportObjects
{
var lResult = new SettlementRO();
lResult.SettlementDC = pDC;
lResult.CostBearer2SupportConceptOid = pDC.CostBearer2SupportConceptOid.Value;
lResult.InvoiceItems = pDC.InvoiceItems;

View File

@@ -0,0 +1,512 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Text;
using BeWo.Data.Access;
using NHibernate.Hql.Classic;
namespace BeWo.Service.Core
{
public class DiamantExporter
{
public DiamantExporter()
{
}
public static string CreateExportString(string[] pHeaderCaption, string[][] pContent)
{
if (pHeaderCaption != null && pHeaderCaption.Length > 1 && pHeaderCaption[0].Contains("Diamant"))
{
DateTime dt = DateTime.Now;
DateTime.TryParse(pHeaderCaption[1], out dt);
if (pHeaderCaption[0].Contains("Stammdaten"))
{
return GetDebitorenString(dt);
}
else
{
return GetAbrechnungenString(dt);
}
}
return null;
}
public static String GetDebitorenString(DateTime date)
{
var dt = ExecuteQuery(GetDebitorenSql(date), date);
StringBuilder sb = new StringBuilder();
foreach (DataRow row in dt.Rows)
{
if (sb.Length > 0)
{
sb.AppendLine();
}
for (int i = 0; i < row.ItemArray.Length; i++)
{
if (i > 0)
{
sb.Append(",");
}
var item = row[i];
bool quote = i == 5 || i == 6 || i > 25;
if (quote)
{
sb.Append('"');
sb.Append(item);
sb.Append('"');
}
else
{
sb.Append(item);
}
}
}
//Debitorenstamm
//S,0, D,200001,,"Bezeichnung1","Bezeichnung2",,,1200,,,,,,,,,,,,,,,,,"Name1","Name2", "Name3","Straße","PLZ","Ort"
return sb.ToString();
}
public static String GetAbrechnungenString(DateTime date)
{
StringBuilder sb = new StringBuilder();
var s = GetMonatlicheAbrechnungLvrString(date);
if (!String.IsNullOrWhiteSpace(s))
{
sb.Append(s);
}
if (sb.Length > 0)
sb.AppendLine();
s = GetAbschlagszahlungenString(date);
if (!String.IsNullOrWhiteSpace(s))
{
sb.Append(s);
}
if (sb.Length > 0)
sb.AppendLine();
//s = GetSelbstzahlerString(date);
//if (!String.IsNullOrWhiteSpace(s))
//{
// sb.Append(s);
//}
return sb.ToString();
}
public static String GetMonatlicheAbrechnungLvrString(DateTime date)
{
var dt = ExecuteQuery(GetMonatlicheAbrechnungLvrSql(date), date);
StringBuilder sb = new StringBuilder();
foreach (DataRow row in dt.Rows)
{
if (sb.Length > 0)
{
sb.AppendLine();
}
for (int i = 0; i < row.ItemArray.Length; i++)
{
if (i > 0)
{
sb.Append(",");
}
var item = row[i];
bool quote = i == 15 || i == 38;
if (quote)
{
sb.Append('"');
sb.Append(item);
sb.Append('"');
}
else
{
sb.Append(item);
}
}
}
//F,0,050,,BEWO,DA,01012016,012016,iBelegNr1,Belegnr1,220001,,,,999.99, "Name AZ Abrechnung 01/2016 LVR",,,EUR,,,,,,,,,,,R,,,
//G,0,1695,,,-999.99,"Name AZ Abrechnung 01/2016 LVR",
return sb.ToString();
}
public static String GetAbschlagszahlungenString(DateTime date)
{
var dt = ExecuteQuery(GetAbschlagszahlungenSql(date), date);
StringBuilder sb = new StringBuilder();
foreach (DataRow row in dt.Rows)
{
if (sb.Length > 0)
{
sb.AppendLine();
}
for (int i = 0; i < row.ItemArray.Length; i++)
{
if (i > 0)
{
sb.Append(",");
}
var item = row[i];
bool quote = i == 15 || i == 38;
if (quote)
{
sb.Append('"');
sb.Append(item);
sb.Append('"');
}
else
{
sb.Append(item);
}
}
}
//F,0,050,,BEWO,DA,02012016,012016,iBelegNr2,Belegnr2,220001,,,,-888.88, "Name AZ Abschlagszahlung LVR 01/2016",,,EUR,,,,,,,,,,,R,,,
//G,0,4473,,,888.88,"Name AZ Abschlagszahlung LVR 05/2016",
return sb.ToString();
}
public static String GetSelbstzahlerString(DateTime date)
{
var dt = ExecuteQuery(GetSelbstzahlerSql(date), date);
StringBuilder sb = new StringBuilder();
foreach (DataRow row in dt.Rows)
{
if (sb.Length > 0)
{
sb.AppendLine();
}
for (int i = 0; i < row.ItemArray.Length; i++)
{
if (i > 0)
{
sb.Append(",");
}
var item = row[i];
bool quote = i == 15 || i == 38;
if (quote)
{
sb.Append('"');
sb.Append(item);
sb.Append('"');
}
else
{
sb.Append(item);
}
}
}
return sb.ToString();
}
private static String GetDebitorenSql(DateTime date)
{
String sql = @"
SELECT
distinct
'S',
'0',
'D',
org.DebitorNumber,
null,
'',
'',
null,
null,
'1200',
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
org.`Name`,
'',
'',
a.Street,
a.PostalCode,
a.Town
FROM `organisation` org
INNER JOIN `costbearer` cb ON org.`CostBearerOid` = cb.`Oid`
INNER JOIN costbearer2supportconcept cb2sc on cb2sc.CostBearerOID = cb.Oid
LEFT JOIN Address a on org.addressOid = a.oid
WHERE org.isactive=1
order by org.`Name`
";
return sql;
}
private static String GetMonatlicheAbrechnungLvrSql(DateTime date)
{
String sql = @"
SELECT
'F',
'0',
'050',
null,
'BEWO',
'DA',
':Abrechnungsmonat',
':Periode',
CONCAT(':Periode', c.Oid),
CONCAT(':Periode', c.Oid),
c.DebitorNumber,
null,
null,
null,
IF(crpRateFactor.`CostRateValue` is null, ROUND((sr.`GeleisteteFLM` / 60) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 )),
ROUND(ROUND((sr.`GeleisteteFLM` / 60), 2) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 ) * ((100 + crpRateFactor.`CostRateValue`)/100), 2)) AS 'Betrag',
CONCAT(p.`LastName`, ', ', p.`FirstName`, ' ', cb2sc.CustomerRefenrenceNumber, ' Abrechnung :PeriodeSlash ', org.Name) as 'Verwendung',
null,
null,
'EUR',
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
'R',
null,
null,
'G',
'0',
'1695',
null,
null,
-1 * IF(crpRateFactor.`CostRateValue` is null, ROUND((sr.`GeleisteteFLM` / 60) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 )),
ROUND(ROUND((sr.`GeleisteteFLM` / 60), 2) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 ) * ((100 + crpRateFactor.`CostRateValue`)/100), 2)) AS 'Betrag2',
CONCAT(p.`LastName`, ', ', p.`FirstName`, ' ', cb2sc.CustomerRefenrenceNumber, ' Abrechnung :PeriodeSlash ', org.Name) as 'Verwendung2',
null
FROM `supportconcept` sc
INNER JOIN `costbearer2supportconcept` cb2sc ON sc.`Oid` = cb2sc.`SupportConceptOid`
INNER JOIN `costbearer` cb ON cb2sc.`CostBearerOid` = cb.`Oid`
LEFT JOIN
(SELECT crp.`ObjectOid`, crp.`CostRateValue` FROM `costrateperiod` crp
WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 2 AND (crp.`EndDate` is null or crp.`EndDate` > NOW()))
AS crpRateFactor ON crpRateFactor.`ObjectOid` = cb.`Oid`
INNER JOIN `organisation` org ON org.`CostBearerOid` = cb.`Oid`
INNER JOIN `customer` c ON sc.`CustomerOid` = c.`Oid`
INNER JOIN `person` p on c.`PersonOid` = p.`Oid`
LEFT JOIN
(SELECT sr2.`CostBearer2SupportConceptOid`, SUM(sr2.`roundedduration` / IF(sr2.`GroupEmployeeCount` is null, 1, sr2.`GroupEmployeeCount`)) AS GeleisteteFLM FROM `servicerecord` sr2
INNER JOIN `servicedescription` sd ON sr2.`ServiceDescriptionOid` = sd.`Oid`
INNER JOIN `servicecategory` sc ON sd.`ServiceCategoryOid` = sc.`Oid`
WHERE sr2.`StartDate` >= ':Monat_Start' AND sr2.`StartDate` < ':Monat_End' AND sc.`Billable` = 1 GROUP BY sr2.`CostBearer2SupportConceptOid`)
AS sr ON sr.`CostBearer2SupportConceptOid` = cb2sc.`Oid`
WHERE c.`IsActive` = 1 AND sc.`IsActive` = 1
and (sr.`GeleisteteFLM` is not null)
ORDER BY p.`LastName`, p.`FirstName`, cb2sc.`ApprovedStartDate`
";
return sql;
}
private static String GetAbschlagszahlungenSql(DateTime date)
{
String sql = @"
SELECT
'F',
'0',
'050',
null,
'BEWO',
'DA',
':Abrechnungsmonat',
':Periode',
CONCAT(':Periode', c.Oid),
CONCAT(':Periode', c.Oid),
c.DebitorNumber,
null,
null,
null,
-1 * ROUND(at.`GesamtBetrag`, 2) as 'Abschlagszahlungen',
CONCAT(p.`LastName`, ', ', p.`FirstName`, ' ', cb2sc.CustomerRefenrenceNumber, ' Abschlagszahlung :PeriodeSlash ', org.Name) as 'Verwendung',
null,
null,
'EUR',
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
'R',
null,
null,
'G',
'0',
'1696',
null,
null,
ROUND(at.`GesamtBetrag`, 2) as 'Abschlagszahlungen2',
CONCAT(p.`LastName`, ', ', p.`FirstName`, ' ', cb2sc.CustomerRefenrenceNumber, ' Abschlagszahlung :PeriodeSlash ', org.Name) as 'Verwendung2',
null
FROM `supportconcept` sc
INNER JOIN `costbearer2supportconcept` cb2sc ON sc.`Oid` = cb2sc.`SupportConceptOid`
INNER JOIN `costbearer` cb ON cb2sc.`CostBearerOid` = cb.`Oid`
LEFT JOIN
(SELECT crp.`ObjectOid`, crp.`CostRateValue` FROM `costrateperiod` crp
WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 2 AND (crp.`EndDate` is null or crp.`EndDate` > NOW()))
AS crpRateFactor ON crpRateFactor.`ObjectOid` = cb.`Oid`
INNER JOIN `organisation` org ON org.`CostBearerOid` = cb.`Oid`
INNER JOIN `customer` c ON sc.`CustomerOid` = c.`Oid`
INNER JOIN `person` p on c.`PersonOid` = p.`Oid`
LEFT JOIN
(SELECT at2.`CostBearer2SupportConceptOid`, SUM(at2.`Amount`) AS GesamtBetrag FROM `accountingtransaction` at2
WHERE at2.`BookingDate` >= ':Monat_Start' AND at2.`BookingDate` < ':Monat_End' GROUP BY at2.`CostBearer2SupportConceptOid`)
AS at ON at.`CostBearer2SupportConceptOid` = cb2sc.`Oid`
WHERE c.`IsActive` = 1 AND sc.`IsActive` = 1
and (at.`GesamtBetrag` is not null)
ORDER BY p.`LastName`, p.`FirstName`, cb2sc.`ApprovedStartDate`
";
return sql;
}
private static String GetSelbstzahlerSql(DateTime date)
{
String sql = @"
SELECT
'F',
'0',
'050',
null,
'BEWO',
'DA',
':Abrechnungsmonat',
':Periode',
CONCAT(':Periode', c.Oid),
CONCAT(':Periode', c.Oid),
c.DebitorNumber,
null,
null,
null,
IF(crpRateFactor.`CostRateValue` is null, ROUND((sr.`GeleisteteFLM` / 60) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 )),
ROUND(ROUND((sr.`GeleisteteFLM` / 60), 2) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 ) * ((100 + crpRateFactor.`CostRateValue`)/100), 2)) AS 'Betrag',
CONCAT(p.`LastName`, ', ', p.`FirstName`, ' ', cb2sc.CustomerRefenrenceNumber, ' Abrechnung :PeriodeSlash ', org.Name) as 'Verwendung',
null,
null,
'EUR',
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
'R',
null,
null,
'G',
'0',
'1695',
null,
null,
-1 * IF(crpRateFactor.`CostRateValue` is null, ROUND((sr.`GeleisteteFLM` / 60) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 )),
ROUND(ROUND((sr.`GeleisteteFLM` / 60), 2) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 ) * ((100 + crpRateFactor.`CostRateValue`)/100), 2)) AS 'Betrag2',
CONCAT(p.`LastName`, ', ', p.`FirstName`, ' ', cb2sc.CustomerRefenrenceNumber, ' Abrechnung :PeriodeSlash ', org.Name) as 'Verwendung2',
null
FROM `supportconcept` sc
INNER JOIN `costbearer2supportconcept` cb2sc ON sc.`Oid` = cb2sc.`SupportConceptOid`
INNER JOIN `costbearer` cb ON cb2sc.`CostBearerOid` = cb.`Oid`
LEFT JOIN
(SELECT crp.`ObjectOid`, crp.`CostRateValue` FROM `costrateperiod` crp
WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 2 AND (crp.`EndDate` is null or crp.`EndDate` > NOW()))
AS crpRateFactor ON crpRateFactor.`ObjectOid` = cb.`Oid`
INNER JOIN `organisation` org ON org.`CostBearerOid` = cb.`Oid`
INNER JOIN `customer` c ON sc.`CustomerOid` = c.`Oid`
INNER JOIN `person` p on c.`PersonOid` = p.`Oid`
LEFT JOIN
(SELECT sr2.`CostBearer2SupportConceptOid`, SUM(sr2.`roundedduration` / IF(sr2.`GroupEmployeeCount` is null, 1, sr2.`GroupEmployeeCount`)) AS GeleisteteFLM FROM `servicerecord` sr2
INNER JOIN `servicedescription` sd ON sr2.`ServiceDescriptionOid` = sd.`Oid`
INNER JOIN `servicecategory` sc ON sd.`ServiceCategoryOid` = sc.`Oid`
WHERE sr2.`StartDate` >= ':Monat_Start' AND sr2.`StartDate` < ':Monat_End' AND sc.`Billable` = 1 GROUP BY sr2.`CostBearer2SupportConceptOid`)
AS sr ON sr.`CostBearer2SupportConceptOid` = cb2sc.`Oid`
WHERE c.`IsActive` = 1 AND sc.`IsActive` = 1
and (sr.`GeleisteteFLM` is not null)
ORDER BY p.`LastName`, p.`FirstName`, cb2sc.`ApprovedStartDate`
";
return sql;
}
public static DataTable ExecuteQuery(String sql, DateTime dt)
{
var newsql = sql;
newsql = newsql.Replace(":PeriodeSlash", String.Format("{0:MM/yyyy}", dt));
newsql = newsql.Replace(":Periode", String.Format("{0:MMyyyy}", dt));
newsql = newsql.Replace(":Abrechnungsmonat", String.Format("{0:ddMMyyyy}", dt));
newsql = newsql.Replace(":Monat_Start", String.Format("{0:yyyy-MM}-01", dt));
dt = dt.AddMonths(1);
newsql = newsql.Replace(":Monat_End", String.Format("{0:yyyy-MM}-01", dt));
return DAOFactory.AdoDAO.ExecuteQuery(newsql).Tables[0];
}
//Buchung Abrechnung Stundenzettel
//F,0,050,, BEWO, DA,01012016,012016, iBelegNr1, Belegnr1,220001,,,,999.99, "Name AZ Abrechnung 01/2016 LVR",,, EUR,,,,,,,,,,, R,,,
//G,0,1695,,,-999.99,"Name AZ Abrechnung 01/2016 LVR",
//Buchung Abschlagszahlung
//F,0,050,, BEWO, DA,02012016,012016, iBelegNr2, Belegnr2,220001,,,,-888.88, "Name AZ Abschlagszahlung LVR 01/2016",,, EUR,,,,,,,,,,, R,,,
//G,0,4473,,,888.88,"Name AZ Abschlagszahlung LVR 05/2016",
//Buchung Abrechnung LVR / Selbstzahler
//F,0,050,, BEWO, DA,01022016,022016, iBelegNr3, Belegnr3,220001,,,,900.00, "Name AZ Abrechnung LVR + SZ 02/2016",,, EUR,,,,,,,,,,, R,,,
//G,0,1695,,,-800.00,"Name AZ Abrechnung 05/2016 LVR",
//G,0,1695,,,-100.00,"Name AZ Abrechnung 05/2016 SZ",
//schwarz = konstant
//rot = variabel
}
}

View File

@@ -19,6 +19,7 @@ using System.Xml;
using BeWo.Data.Entities;
using BeWo.Service.ServiceContracts;
using BeWo.Data;
using BS.Shared;
using DevExpress.XtraPrinting.Native;
namespace BeWo.Service.Core
@@ -183,7 +184,20 @@ namespace BeWo.Service.Core
return erg;
}
public static bool UserHasRight(ApplicationUser user, UserRightType right)
{
foreach (var ug in user.UserGroups)
{
foreach (var rr in ug.Rights)
{
if (rr.RightType == right)
{
return true;
}
}
}
return false;
}
}
}

View File

@@ -28,6 +28,7 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.AssistanceBegin = pEntity.AssistanceBegin;
pDataContract.EquityContribution = pEntity.EquityContribution;
pDataContract.CustomerAlias = pEntity.CustomerAlias;
pDataContract.DebitorNumber = pEntity.DebitorNumber;
if (pEntity.Person.Address != null)
{

View File

@@ -68,7 +68,6 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.BeiblattGueltigBis = pEntity.BeiblattGueltigBis;
pDataContract.GradDerBehinderung = pEntity.GradDerBehinderung;
pDataContract.Pflegegrad = pEntity.Pflegegrad;
pDataContract.CustomerImage = pEntity.CustomerImage;
pDataContract.IsMigrant = pEntity.IsMigrant;
if (pEntity.BehinderungsartenListe != null)
@@ -92,8 +91,9 @@ namespace BeWo.Service.DCEntityMapper
{
pDataContract.ICD10DiagnosisCodes = pEntity.Diagnosis2CustomerList.Select(e => e.ICD10DiagnosisCode).ToList();
}
IList<VarFieldDef> defs = DAOFactory.SearchDAO.GetVarFieldDefs(TableID.Customer);
IList<VarFieldDef> defs = DAOFactory.SearchDAO.GetVarFieldDefs(TableID.Customer);
pDataContract.CustomerVarFields = MapperFactory.VarFieldDC_VarField.VarFieldMapToDCs(defs, pEntity.VarFieldValueList);
pDataContract.AssessmentSheetCategoryDCs = MapperFactory.AssessmentSheetCategoryDC_AssessmentSheetCategory.MapToNewDCs(pEntity.AssessmentSheetCategoryList);
@@ -180,12 +180,9 @@ namespace BeWo.Service.DCEntityMapper
pEntity.BehinderungsartenListe = pDataContract.BehinderungsartenListe;
pEntity.MerkzeichenListe = pDataContract.MerkzeichenListe;
pEntity.Pflegegrad = pDataContract.Pflegegrad;
pEntity.CustomerImage = pDataContract.CustomerImage;
pEntity.IsMigrant = pDataContract.IsMigrant;
pEntity.Thumbnail = Utils.ErstelleThumbnail(pDataContract.CustomerImage, 200, 200);
if (pDataContract.TerminationReason == null)
if (pDataContract.TerminationReason == null)
{
pEntity.TerminationReason = null;
}

View File

@@ -47,9 +47,7 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.Notice2 = pEntity.Notice2;
pDataContract.ActivationType = pEntity.IsActive;
pDataContract.EmployeeImage = pEntity.EmployeeImage;
//pDataContract.ProbationPeriod = pEntity.ProbationPeriod;
//pDataContract.CancellationPeriod = pEntity.CancellationPeriod;
//pDataContract.EntryDate = pEntity.EntryDate;
@@ -156,13 +154,7 @@ namespace BeWo.Service.DCEntityMapper
pEntity.Notice2 = pDataContract.Notice2;
pEntity.IsActive = pDataContract.ActivationType;
pEntity.EmployeeImage = pDataContract.EmployeeImage;
pEntity.EmployeeThumbnail = Utils.ErstelleThumbnail(pDataContract.EmployeeImage, 200, 200);
//pEntity.CancellationPeriod = pDataContract.CancellationPeriod;
//pEntity.EntryDate = pDataContract.EntryDate;
//pEntity.ProbationPeriod = pDataContract.ProbationPeriod;

View File

@@ -1,8 +1,11 @@
using BeWo.Data.Access;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared.DataContracts;
using System.Collections.Generic;
using BS.Shared.Core;
namespace BeWo.Service.DCEntityMapper
{
@@ -73,6 +76,11 @@ namespace BeWo.Service.DCEntityMapper
var defs = DAOFactory.SearchDAO.GetVarFieldDefs(TableID.Person);
pDataContract.VarFields = MapperFactory.VarFieldDC_VarField.VarFieldMapToDCs(defs, pEntity.VarFieldValueList);
if (pEntity.Images != null)
{
pDataContract.Images = pEntity.Images.Select(i => i.Original).ToList();
}
return pDataContract;
}
@@ -183,6 +191,30 @@ namespace BeWo.Service.DCEntityMapper
DAOFactory.GenericDAO.Delete(lBankAccount);
}
if (pEntity.Images != null)
{
pEntity.Images.Clear();
}
if (pDataContract.Images != null)
{
if (pEntity.Images == null)
{
pEntity.Images = new List<Image>();
}
foreach (var imgBytes in pDataContract.Images)
{
var image = new Image();
image.Original = imgBytes;
image.MediumThumbnail = Utils.ErstelleThumbnail(imgBytes, 800, 800);
image.SmallThumbnail = Utils.ErstelleThumbnail(imgBytes, 200, 200);
pEntity.Images.Add(image);
}
}
MapperFactory.ContactDC_Contact.MergeWithEntitys(pDataContract.ContactInformations, pEntity.Contacts);
MapperFactory.Organisation2PersonDC_Organisation2Person.MergeWithEntitys(pDataContract.OrganisationRelations, pEntity.Organisation2Persons);

View File

@@ -95,7 +95,14 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.GroupPersonCount = pEntity.GroupPersonCount;
pDataContract.GroupRoundedDuration = pEntity.GroupRoundedDuration;
pDataContract.GroupOid = pEntity.GroupOid;
pDataContract.IP = pEntity.IP;
if (!pEntity.GroupOid.HasValue && pEntity.GroupPersonCount.HasValue && pEntity.GroupEmployeeCount.HasValue &&
pEntity.GroupPersonCount.Value == 1 && pEntity.GroupEmployeeCount.Value == 1)
{
pDataContract.GroupEmployeeCount = null;
pDataContract.GroupPersonCount = null;
pDataContract.GroupRoundedDuration = null;
}
pDataContract.IP = pEntity.IP;
pDataContract.IsCreatedInMobileClient = pEntity.IsCreatedInMobileClient;
return pDataContract;

View File

@@ -31,7 +31,13 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.GroupPersonCount = pEntity.GroupPersonCount;
pDataContract.GroupRoundedDuration = pEntity.GroupRoundedDuration;
pDataContract.GroupOid = pEntity.GroupOid;
if (!pEntity.GroupOid.HasValue && pEntity.GroupPersonCount.HasValue && pEntity.GroupEmployeeCount.HasValue &&
pEntity.GroupPersonCount.Value == 1 && pEntity.GroupEmployeeCount.Value == 1)
{
pDataContract.GroupEmployeeCount = null;
pDataContract.GroupPersonCount = null;
pDataContract.GroupRoundedDuration = null;
}
return pDataContract;
}

View File

@@ -18,7 +18,7 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.LoginName = pEntity.LoginName;
pDataContract.HashedPassword = pEntity.HashedPassword;
pDataContract.RC2Password = pEntity.RC2EncryptedHash;
pDataContract.Salt = pEntity.Salt;
//pDataContract.Salt = pEntity.Salt;
pDataContract.Zeitstempel = pEntity.Zeitstempel ?? DateTime.Now;
@@ -57,8 +57,10 @@ namespace BeWo.Service.DCEntityMapper
{
pEntity.ChangePassword(pDataContract.NewPassword);
}
pEntity.Salt = pDataContract.Salt;
if (!String.IsNullOrEmpty(pDataContract.Salt))
{
pEntity.Salt = pDataContract.Salt;
}
pEntity.UserGroups.RemoveRange(x => pDataContract.UserGroups.FirstOrDefault(y => x.Oid == y.UserGroupOid) == null);
pEntity.UserGroups.AddRange(pDataContract.UserGroups.Where(x => pEntity.UserGroups.FirstOrDefault(y => x.UserGroupOid == y.Oid) == null).Select(dc => DAOFactory.GenericDAO.LoadByID<UserGroup>(dc.UserGroupOid.Value)));

View File

@@ -153,8 +153,8 @@ namespace BeWo.Service.Invoicing
{
IList<AccountingTransaction> bookingList = period.SupportConceptApprovalPeriod.CostBearer2SupportConcept.AccountingTransactions;
bookingList = bookingList.Where(i => i.BookingDate.HasValue
&& i.BookingDate.Value.InBetween(period.Start.Value, period.End.Value, true)).ToList();
bookingList = bookingList.Where(i => i.GueltigkeitsDatum.HasValue
&& i.GueltigkeitsDatum.Value.InBetween(period.Start.Value, period.End.Value, true)).ToList();
foreach (AccountingTransaction item in bookingList)
{
@@ -536,6 +536,12 @@ namespace BeWo.Service.Invoicing
}
public virtual IList<InvoiceItem> CreateSummaryInvoiceItems(IList<InvoiceItem> itemList, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc)
{
return CreateSummaryInvoiceItems(itemList, invoicePeriod, scap, calc, false);
}
public virtual IList<InvoiceItem> CreateSummaryInvoiceItems(IList<InvoiceItem> itemList,
DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc, bool summaryPerMonth)
{
//Fasse InvoiceItems mit gleichem Stundensatz zusammen:
@@ -546,6 +552,10 @@ namespace BeWo.Service.Invoicing
{
InvoiceItem item;
String key = String.Format("{0}_{1}", iitem.AmountPerUnit, iitem.RateFactor);
if (summaryPerMonth)
{
key = String.Format("{0}_{1}_{2:yyyyMM}", iitem.AmountPerUnit, iitem.RateFactor, iitem.ItemPeriodStart);
}
if (rateToItem.ContainsKey(key))
{
@@ -567,6 +577,20 @@ namespace BeWo.Service.Invoicing
item.ItemPeriodStart = scap.StartDate;
item.ItemPeriodEnd = scap.EndDate;
}
if (summaryPerMonth && iitem.ItemPeriodStart.HasValue)
{
DateTime start = new DateTime(iitem.ItemPeriodStart.Value.Year, iitem.ItemPeriodStart.Value.Month, 1);
DateTime end = start.AddMonths(1).AddDays(-1);
if (item.ItemPeriodStart < start)
{
item.ItemPeriodStart = start;
}
if (item.ItemPeriodEnd > end)
{
item.ItemPeriodEnd = end;
}
}
item.RateFactor = iitem.RateFactor;
item.AccountingInterval = iitem.AccountingInterval;
@@ -606,12 +630,12 @@ namespace BeWo.Service.Invoicing
invoiceItem.UnitCount = 0;
}
invoiceItem.AmountTotal = invoiceItem.AmountPerUnit*invoiceItem.UnitCount;
invoiceItem.AmountTotal = invoiceItem.AmountPerUnit * invoiceItem.UnitCount;
invoiceItem.AmountTotal = Math.Round(invoiceItem.AmountTotal.Value, 2, MidpointRounding.AwayFromZero);
if (invoiceItem.RateFactor.HasValue)
{
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal*((invoiceItem.RateFactor + 100)/100);
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal * ((invoiceItem.RateFactor + 100) / 100);
}
else
{

View File

@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BeWo.Data.Entities;
using BeWo.Service.Plugins;
using BS.Shared.Core;
namespace BeWo.Service.Invoicing
@@ -13,5 +15,9 @@ namespace BeWo.Service.Invoicing
return InvoiceCreation.GetInstance(specificId, tenant);
}
}
public virtual SettlementInvoiceCreation CreateSettlementInvoiceCreator(string costbearerId, string tenant, CostBearer2SupportConcept lCb2Sc)
{
return PluginLoader.FindClass<SettlementInvoiceCreation>(costbearerId) ?? SettlementInvoiceCreation.GetInstance(costbearerId, tenant);
}
}
}

View File

@@ -14,7 +14,7 @@ using DevExpress.Utils;
namespace BeWo.Service.Invoicing
{
[IDSpecificClass(Identifier = "LWLNEU")]
class LWLSettlementInvoiceCreation : SettlementInvoiceCreation
public class LWLSettlementInvoiceCreation : SettlementInvoiceCreation
{
public override bool CanCreateInvoiceTheOldWay(Settlement2DC si, CostBearer2SupportConcept c2s)
{
@@ -39,14 +39,20 @@ namespace BeWo.Service.Invoicing
c2s.SupportConcept.Customer.TerminationDate.Value < periodEnd)
{
periodEnd = c2s.SupportConcept.Customer.TerminationDate.Value;
}
si.ErrorNotice =
String.Format(
"Achtung: Die Betreuung endete am {0:dd.MM.yyyy}. Alle nachträglich eingegebenen Stunden werden nicht abgerechnet!",
periodEnd);
}
var hourlyRatesInSpanList = relDc.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.HourlyRate, periodStart, periodEnd).ToList();
si.DifferentHourlyRateCount = hourlyRatesInSpanList.Count;
var rateFactorsInSpanList = relDc.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.RateFactor, periodStart, periodEnd).ToList();
if (si.DifferentHourlyRateCount == 0)
{
si.DifferentHourlyRateCount = 1;
}
var rateFactorsInSpanList = relDc.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.RateFactor, periodStart, periodEnd).ToList();
if (rateFactorsInSpanList.Count > 0)
{
var cdc = rateFactorsInSpanList.Last().Key;
@@ -164,8 +170,8 @@ namespace BeWo.Service.Invoicing
}
private decimal GetRateFactor(Settlement2DC si)
{
private decimal GetRateFactor(Settlement2DC si)
{
decimal rf = 1;
if (si.RateFactor.HasValue && si.RateFactor.Value != 0)
{
@@ -175,9 +181,14 @@ namespace BeWo.Service.Invoicing
return rf;
}
private List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList)
{
List<InvoiceItemDC> iiList = new List<InvoiceItemDC>();
public virtual List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList)
{
return CreateInvoiceItems(si, apList, true);
}
public virtual List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList, bool schneideBeiMaxAb)
{
List<InvoiceItemDC> iiList = new List<InvoiceItemDC>();
@@ -202,8 +213,8 @@ namespace BeWo.Service.Invoicing
}
decimal maxApprovedFLS = si.ApprovedFLS ?? 0;
decimal totalHours = 0;
decimal maxApprovedFls = si.ApprovedFLS ?? 0;
decimal totalHours = 0;
foreach (var key in apsByHourlyRate.Keys)
{
IList<ApprovalPeriod> list = apsByHourlyRate[key];
@@ -238,14 +249,16 @@ namespace BeWo.Service.Invoicing
hours *= (100 + rf) / 100;
hours = Math.Round(hours, 2, MidpointRounding.AwayFromZero);
if (totalHours + hours > maxApprovedFLS)
{
hours = maxApprovedFLS - totalHours;
if (hours < 0)
hours = 0;
}
totalHours += hours;
if (schneideBeiMaxAb)
{
if (totalHours + hours > maxApprovedFls)
{
hours = maxApprovedFls - totalHours;
if (hours < 0)
hours = 0;
}
}
totalHours += hours;
ii.UnitCount = hours;
ii.AmountTotal = Math.Round(hr * hours, 2, MidpointRounding.AwayFromZero);

View File

@@ -211,10 +211,14 @@ namespace BeWo.Service.Invoicing
c2s.SupportConcept.Customer.TerminationDate.Value < periodEnd)
{
periodEnd = c2s.SupportConcept.Customer.TerminationDate.Value;
si.ErrorNotice =
String.Format(
"Achtung: Die Betreuung endete am {0:dd.MM.yyyy}. Alle nachträglich eingegebenen Stunden werden nicht abgerechnet!",
periodEnd);
}
}
var tolerancesInSpanList = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.ServiceTolerance, periodStart, periodEnd).ToList();
var tolerancesInSpanList = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.ServiceTolerance, periodStart, periodEnd).ToList();
var hourlyRatesInSpanList = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.HourlyRate, periodStart, periodEnd).ToList();
@@ -349,7 +353,7 @@ namespace BeWo.Service.Invoicing
}
foreach (var iRecord in records)
{
if (iRecord.ServiceDescription.ServiceCategory.IsBillable)
if (iRecord.ServiceDescription.ServiceCategory.IsBillable && IsServiceRecordBillable(iRecord))
{
if (iRecord.GroupOid == null || !groupBookingDict.ContainsKey(iRecord.GroupOid.Value))
{
@@ -491,8 +495,13 @@ namespace BeWo.Service.Invoicing
}
public virtual decimal? CalculateMaxAmount(Settlement2DC si)
{
public virtual bool IsServiceRecordBillable(ServiceRecord iRecord)
{
return true;
}
public virtual decimal? CalculateMaxAmount(Settlement2DC si)
{
return null;
}
@@ -877,13 +886,13 @@ namespace BeWo.Service.Invoicing
foreach (var item in bookingList)
{
if (item.BookingDate.HasValue)
if (item.GueltigkeitsDatum.HasValue)
{
foreach (var ii in settlementInvoice.InvoiceItems)
{
if (ii.ItemPeriodStart.HasValue && ii.ItemPeriodEnd.HasValue)
{
if (item.BookingDate.Value.InBetween(ii.ItemPeriodStart.Value, ii.ItemPeriodEnd.Value, true))
if (item.GueltigkeitsDatum.Value.InBetween(ii.ItemPeriodStart.Value, ii.ItemPeriodEnd.Value, true))
{
ii.ReceivedAmount += item.Amount;
@@ -912,19 +921,19 @@ namespace BeWo.Service.Invoicing
if (periodStart.HasValue && periodEnd.HasValue)
{
bookingList =
bookingList.Where(i => i.BookingDate.HasValue
&& i.BookingDate.Value.InBetween(periodStart.Value, periodEnd.Value, true)).ToList();
bookingList.Where(i => i.GueltigkeitsDatum.HasValue
&& i.GueltigkeitsDatum.Value.InBetween(periodStart.Value, periodEnd.Value, true)).ToList();
}
foreach (var item in bookingList)
{
if (hourlyRatesInSpanList.Count > 2 && item.BookingDate != null &&
item.BookingDate < hourlyRatesInSpanList[hourlyRatesInSpanList.Count - 2].Value.StartDateTime)
if (hourlyRatesInSpanList.Count > 2 && item.GueltigkeitsDatum != null &&
item.GueltigkeitsDatum < hourlyRatesInSpanList[hourlyRatesInSpanList.Count - 2].Value.StartDateTime)
{
amount3 += item.Amount;
}
else if (hourlyRatesInSpanList.Count > 1 && item.BookingDate != null &&
item.BookingDate < hourlyRatesInSpanList[hourlyRatesInSpanList.Count - 1].Value.StartDateTime)
else if (hourlyRatesInSpanList.Count > 1 && item.GueltigkeitsDatum != null &&
item.GueltigkeitsDatum < hourlyRatesInSpanList[hourlyRatesInSpanList.Count - 1].Value.StartDateTime)
{
amountOld += item.Amount;
}
@@ -1103,8 +1112,18 @@ namespace BeWo.Service.Invoicing
{
approvalPeriod.ApprovedTotal = approvalPeriod.ApprovedPerUnit;
}
else
{
else if (approvalPeriod.ApprovalUnit == AccountingIntervalType.Monthly)
{
var months = GetTotalMonths(approvalPeriod.PeriodStartDate, approvalPeriod.PeriodEndDate);
approvalPeriod.ApprovedTotal = months * approvalPeriod.ApprovedPerUnit;
}
else if (approvalPeriod.ApprovalUnit == AccountingIntervalType.Quarterly)
{
var months = GetTotalQuarters(approvalPeriod.PeriodStartDate, approvalPeriod.PeriodEndDate);
approvalPeriod.ApprovedTotal = months * approvalPeriod.ApprovedPerUnit;
}
else
{
approvalPeriod.ApprovedTotal = Math.Round(approvalPeriod.Weeks * approvalPeriod.ApprovedPerUnit, 2,
MidpointRounding.AwayFromZero);
@@ -1112,5 +1131,112 @@ namespace BeWo.Service.Invoicing
approvalPeriod.ApprovedAmountTotal = Math.Round(approvalPeriod.ApprovedTotal * approvalPeriod.AmountPerUnit, 2,
MidpointRounding.AwayFromZero);
}
}
public virtual decimal GetTotalMonths(DateTime start, DateTime end)
{
int restTageStart = 0;
int restTageEnd = 0;
DateTime startDt = start;
DateTime endDt = end;
if (startDt.Day > 1)
{
var endMonat = new DateTime(startDt.Year, startDt.Month, 1).AddMonths(1).AddDays(-1);
if (endDt < endMonat)
{
endMonat = endDt;
}
restTageStart = endMonat.Subtract(startDt).Days + 1;
startDt = endMonat.AddDays(1);
}
if (endDt.AddDays(1).Day != 1)
{
var startMonat = new DateTime(endDt.Year, endDt.Month, 1);
restTageEnd += endDt.Subtract(startMonat).Days + 1;
endDt = startMonat;
}
int fullMonths = 0;
while (startDt < endDt)
{
fullMonths++;
startDt = startDt.AddMonths(1);
}
decimal monthsTotal = fullMonths;
if (restTageStart != 0)
{
monthsTotal += restTageStart / (decimal)DateTime.DaysInMonth(start.Date.Year, start.Date.Month);
}
if (restTageEnd != 0)
{
monthsTotal += restTageEnd / (decimal)DateTime.DaysInMonth(end.Date.Year, end.Date.Month);
}
return monthsTotal;
}
public virtual decimal GetTotalQuarters(DateTime start, DateTime end)
{
int restTageStart = 0;
int restTageEnd = 0;
DateTime startDt = start;
DateTime endDt = end;
if (startDt.Day > 1)
{
var endMonat = new DateTime(startDt.Year, startDt.Month, 1).AddMonths(1).AddDays(-1);
if (endDt < endMonat)
{
endMonat = endDt;
}
restTageStart = endMonat.Subtract(startDt).Days + 1;
startDt = endMonat.AddDays(1);
}
DateTime startTemp = startDt;
int fullQuarters = 0;
while (startDt <= endDt)
{
startDt = startDt.AddMonths(3);
if (startDt <= endDt.AddDays(1))
{
startTemp = startDt;
fullQuarters++;
}
}
if (startTemp < endDt.AddDays(1))
{
restTageEnd = endDt.Subtract(startTemp).Days + 1;
}
decimal quartersTotal = fullQuarters;
if (restTageStart > 0)
{
quartersTotal += restTageStart / 90m;
}
if (restTageEnd > 0)
{
quartersTotal += restTageEnd / 90m;
}
return quartersTotal;
}
}
}

View File

@@ -0,0 +1,194 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using BS.Shared.Services;
using Utils = BS.Shared.Core.Utils;
namespace BeWo.Service.Plugins
{
public class DataExporter : AbstractIDSpecificDefaultClass<DataExporter>
{
public virtual string CreateExportString(string pFileID, string[] pHeaderCaption, string[][] pContent)
{
if (pHeaderCaption != null && pHeaderCaption.Length > 0 && pHeaderCaption[0].Contains("Diamant"))
{
return DiamantExporter.CreateExportString(pHeaderCaption, pContent);
}
return WriteHTMLFile(pHeaderCaption, pContent);
}
public virtual QueryDC CreateQuery(QueryDC query)
{
return null;
}
public virtual string PrepareExcelFileSupportConceptExport(string pFileId, long[] pSortedOids)
{
string lPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, pFileId + ".tmp");
var lSupportConcepts = DAOFactory.GenericDAO.LoadByIDs<SupportConcept>(pSortedOids);
string[] lHeaderCaption = {
"Nachname", // 0
"Vorname", // 1
"Kommentar", // 2
"Hilfeplankonferenz", // 3
"Kostenträger", // 4
"Aktenzeichen", // 5
"beantragt von", // 6
"beantragt bis", // 7
"bewilligt von", // 8
"bewilligt bis", // 9
"Verlängerung beantragt am", // 10
"gen. FLS/Woche", // 11
"gen. FLS Gesamt", // 12
"Stundensatz", // 13
"Kostenträger Notiz", // 14
"BetreuerIn", // 15
"Betreuung beendet am" // 16
};
List<string[]> lContent = new List<string[]>();
int lContentIndex = 0;
for (int iRowCount = 0; iRowCount < lSupportConcepts.Count; iRowCount++)
{
lContent.Add(new string[lHeaderCaption.Count()]);
lContent[lContentIndex][0] = lSupportConcepts[iRowCount].Customer.Person.LastName;
lContent[lContentIndex][1] = lSupportConcepts[iRowCount].Customer.Person.FirstName;
lContent[lContentIndex][2] = lSupportConcepts[iRowCount].Notice;
lContent[lContentIndex][3] = lSupportConcepts[iRowCount].ConferenceDate != null
? lSupportConcepts[iRowCount].ConferenceDate.Value.ToShortDateString()
: string.Empty;
lContent[lContentIndex][10] = lSupportConcepts[iRowCount].RenewalSendDate != null
? lSupportConcepts[iRowCount].RenewalSendDate.Value.ToShortDateString()
: string.Empty;
int cbCount = 0;
foreach (var iCostBearer in lSupportConcepts[iRowCount].CostBearer2SupportConceptList)
{
if (cbCount++ > 0)
{
lContent.Add(new string[lHeaderCaption.Count()]);
lContentIndex++;
}
if (iCostBearer.CostBearer != null && iCostBearer.CostBearer.Organisation != null)
{
lContent[lContentIndex][4] = iCostBearer.CostBearer.Organisation.Name;
var calc = PluginLoader.FindClass<Calculations>(iCostBearer.CostBearer.ID) ?? Calculations.GetInstance(iCostBearer.CostBearer.ID);
SupportConceptCostBearerRelDC relDC = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(iCostBearer);
DateTime dt = DateTime.Now;
DateTime end = DateTime.MaxValue;
if (iCostBearer.ApprovedEndDate.HasValue)
end = iCostBearer.ApprovedEndDate.Value;
else if (iCostBearer.RequestedEndDate.HasValue)
end = iCostBearer.RequestedEndDate.Value;
if (dt > end)
dt = end;
if (relDC.ApprovalPeriodList.Count == 1)
{
var ap = relDC.ApprovalPeriodList[0];
if (ap.ApprovedBEPerInterval.HasValue && ap.ApprovedBEInterval.HasValue && ap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Weekly)
{
var serviceUnit = relDC.CostBearer.CostRatePeriods.GetCostRatePeriodForDate(CostRatePeriodType.MinutesPerServiceUnit, DateTime.Now);
if (serviceUnit != null)
lContent[lContentIndex][11] = String.Format("{0:0.##}", serviceUnit.GetBEInHours(ap.ApprovedBEPerInterval));
}
}
else
{
lContent[lContentIndex][11] = String.Format("{0:0.##}", calc.GetApprovedHoursPerWeek(relDC, dt, false)); // iCostBearer.ApprovedFLS.ToStringNullCheck();
}
lContent[lContentIndex][12] = String.Format("{0:0.##}", calc.GetApprovedHoursTotal(relDC, false)); //iCostBearer.ApprovedFLSTotal.ToStringNullCheck();
}
else
{
lContent[lContentIndex][4] = string.Empty;
}
lContent[lContentIndex][5] = iCostBearer.CustomerReferenceNumber;
lContent[lContentIndex][6] = iCostBearer.RequestedStartDate.DoIfNotNull(d => d.ToShortDateString());
lContent[lContentIndex][7] = iCostBearer.RequestedEndDate.DoIfNotNull(d => d.ToShortDateString());
lContent[lContentIndex][8] = iCostBearer.ApprovedStartDate.DoIfNotNull(d => d.ToShortDateString());
lContent[lContentIndex][9] = iCostBearer.ApprovedEndDate.DoIfNotNull(d => d.ToShortDateString());
if (iCostBearer.CostBearer != null)
{
lContent[lContentIndex][13] = iCostBearer.CostBearer.CostRatePeriods.MapToNewDCs()
.GetCurrentlyValidRateValue(CostRatePeriodType.HourlyRate).ToStringNullCheck();
}
lContent[lContentIndex][14] = iCostBearer.Notice;
String mainAttendant = "";
foreach (Employee2Customer e2c in lSupportConcepts[iRowCount].Customer.Employee2CustomerList)
{
foreach (ValueListEntry2Object vle2o in e2c.ValueList)
{
ValueListEntry vle = vle2o.Entry;
if (vle.SystemEntryID != null && vle.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
{
string empName = e2c.Employee.Person.FirstName + " " + e2c.Employee.Person.LastName;
if (String.IsNullOrEmpty(mainAttendant))
mainAttendant = empName;
else
{
if (!mainAttendant.Contains(empName))
{
mainAttendant += ", " + empName;
}
}
}
}
}
lContent[lContentIndex][15] = mainAttendant;
if (lSupportConcepts[iRowCount].Customer.TerminationDate.HasValue)
{
lContent[lContentIndex][16] = String.Format("{0:dd.MM.yyyy}", lSupportConcepts[iRowCount].Customer.TerminationDate);
}
else
{
lContent[lContentIndex][16] = "";
}
}
// if (iRowCount < lSupportConcepts.Count - 1)
// {
// //next Row
// lContentIndex++; lContent.Add(new string[lHeaderCaption.Count()]);
// }
lContentIndex++;
}
return WriteHTMLFile(lHeaderCaption, lContent.ToArray());
}
public string WriteHTMLFile(string[] pHeaderCaption, string[][] pContent)
{
return new ExcelDownload(pHeaderCaption, pContent).CreateExcelOutputString();
}
}
}

View File

@@ -18,8 +18,8 @@ namespace BeWo.Service.Plugins
public virtual List<CompactSupportConceptDC> GetExpiringSupportConcepts(long? employeeOid, DateTime expiredUntil)
{
return MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDCs(DAOFactory.SearchDAO.FindExpiringSupportConcepts(employeeOid, expiredUntil));
}
return MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDCs(DAOFactory.SearchDAO.FindExpiringSupportConcepts(employeeOid, DateTime.Now.Date, expiredUntil));
}
}
}

Some files were not shown because too many files have changed in this diff Show More