Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
This commit is contained in:
@@ -197,7 +197,7 @@ namespace BeWo
|
||||
var hideServiceRecordInsertedByAndInsertedOn = false;
|
||||
bool isEndDateVisible = false;
|
||||
bool isOnlyYearMonthVisible = false;
|
||||
bool isZeiterfassDateNormal = false;
|
||||
bool isZeiterfassDateNormal = true;
|
||||
bool isZeiterfassungInStdMin = false;
|
||||
int lastSelectedStundenkontoIntervall = 3;
|
||||
bool showSignatures = false;
|
||||
@@ -247,9 +247,9 @@ namespace BeWo
|
||||
}
|
||||
|
||||
val = GetSettingValue(_Mandator.Settings, "IsZeiterfassDateNormal");
|
||||
if (val != null && val.Equals("1"))
|
||||
if (val != null && val.Equals("0"))
|
||||
{
|
||||
isZeiterfassDateNormal = true;
|
||||
isZeiterfassDateNormal = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1566,8 +1566,6 @@ namespace BeWo.Core
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (relDc != null)
|
||||
dc.CostBearer2SupportConceptOid = relDc.CostBearer2SupportConceptOid;
|
||||
|
||||
|
||||
@@ -692,19 +692,19 @@
|
||||
|
||||
<Label Content="Dauer" Grid.Column="2" x:Name="MinStdDauerlbl" Grid.Row="2"/>
|
||||
<dxe:SpinEdit MinValue="0" Increment="5" IsFloatValue="False" AllowNullInput="False" x:Name="numeric_duration"
|
||||
EditValue="{Binding Path=PrototypeVM.DurationSTD, Mode=TwoWay, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="3" Grid.Row="2"
|
||||
EditValue="{Binding Path=PrototypeVM.DurationSTD, Mode=TwoWay, StringFormat=N2, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="3" Grid.Row="2"
|
||||
Height="23" Margin="3,0,3,3"/>
|
||||
|
||||
|
||||
|
||||
<dxe:ComboBoxEdit ItemsSource="{x:Static core:EnumTranslations.ZeiterfassungsDauerTranslations}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="2" Margin="3,0,3,3"
|
||||
EditValue="{Binding Path=PrototypeVM.DurationInStunden, UpdateSourceTrigger=PropertyChanged}" DisplayMember="Value" ValueMember="Key"
|
||||
IsTextEditable="False" x:Name="MinSTDMitEnd" Visibility="Collapsed" />
|
||||
IsTextEditable="False" x:Name="MinSTDMitEnd" Visibility="Collapsed" SelectedIndexChanged="MinSTDMitEnd_OnSelectedIndexChanged"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
<!--########################################################################################################-->
|
||||
<!--###########################################Converter={StaticResource Int2DecimalConverter},#############################################################-->
|
||||
|
||||
|
||||
<!--##################################### Grit Ohne Enddatum ###############################################-->
|
||||
@@ -751,7 +751,7 @@
|
||||
|
||||
<Label Content="Dauer (min)" Grid.Column="2" x:Name="MinStdDauerLabel" Grid.Row="2"/>
|
||||
<dxe:SpinEdit MinValue="0" Increment="5" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_duration"
|
||||
EditValue="{Binding Path=PrototypeVM.Duration, Mode=TwoWay, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditValue="{Binding Path=PrototypeVM.Duration, Mode=TwoWay, StringFormat=N2, UpdateSourceTrigger=PropertyChanged}"
|
||||
Grid.Column="3" Grid.Row="2"
|
||||
Height="23" Margin="3,0,3,3"/>
|
||||
|
||||
@@ -759,12 +759,12 @@
|
||||
|
||||
<dxe:ComboBoxEdit ItemsSource="{x:Static core:EnumTranslations.ZeiterfassungsDauerTranslations}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="2" Margin="3,0,3,3"
|
||||
EditValue="{Binding Path=PrototypeVM.DurationInStunden, UpdateSourceTrigger=PropertyChanged}" DisplayMember="Value" ValueMember="Key"
|
||||
IsTextEditable="False" x:Name="MinSTDOhneEnd" Visibility="Collapsed"/>
|
||||
IsTextEditable="False" x:Name="MinSTDOhneEnd" Visibility="Collapsed" SelectedIndexChanged="MinSTDOhneEnd_OnSelectedIndexChanged" />
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--##############################################################################################################################################-->
|
||||
<!--####################################Converter={StaticResource Int2DecimalConverter},##########################################################################################################-->
|
||||
|
||||
|
||||
<!--########################## Grid mit nur Jahr / Monat und feste dauer SharedSizeGroup="Label1"#####################################-->
|
||||
|
||||
@@ -4000,5 +4000,21 @@ namespace BeWo.View.Detail
|
||||
TimeIntervalComboBox.Width = 120;
|
||||
}
|
||||
}
|
||||
|
||||
private void MinSTDOhneEnd_OnSelectedIndexChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(MinSTDOhneEnd.Text == ZeiterfassungsDauer.Minuten.ToString())
|
||||
numerictb_duration.IsFloatValue = false;
|
||||
else
|
||||
numerictb_duration.IsFloatValue = true;
|
||||
}
|
||||
|
||||
private void MinSTDMitEnd_OnSelectedIndexChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (MinSTDMitEnd.Text == ZeiterfassungsDauer.Minuten.ToString())
|
||||
numeric_duration.IsFloatValue = false;
|
||||
else
|
||||
numeric_duration.IsFloatValue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1572,7 +1572,7 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
|
||||
lNewRecord.Date = _PrototypeVM.Date;
|
||||
lNewRecord.Duration = _PrototypeVM.Duration;
|
||||
|
||||
|
||||
if (_PrototypeVM.Duration.HasValue)
|
||||
lNewRecord.RoundedDuration = _PrototypeVM.Duration.Value;
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
private bool _DeleteAllowed = true;
|
||||
|
||||
private int? _Duration;
|
||||
private decimal? _Duration;
|
||||
|
||||
private decimal? _DurationSTD;
|
||||
|
||||
@@ -192,6 +192,8 @@ namespace BeWo.ViewModel
|
||||
|
||||
private bool _isUnterschrift;
|
||||
|
||||
private string _IsFloatGesetzt = "False";
|
||||
|
||||
private string[] _MonateBinden = {"Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"};
|
||||
|
||||
#endregion
|
||||
@@ -408,9 +410,9 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
_DurationSTD = (int)x.TotalMinutes;
|
||||
_DurationSTD = (decimal)x.TotalMinutes;
|
||||
}else{
|
||||
_DurationSTD = (int)x.TotalHours;
|
||||
_DurationSTD = (decimal)x.TotalHours;
|
||||
}
|
||||
|
||||
|
||||
@@ -434,8 +436,8 @@ namespace BeWo.ViewModel
|
||||
var date = _Date;
|
||||
var time = _StartTime;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// beim addend er zeit / dadurch das dateTime und Startime gleich sind werden diese zusammen gerechnet und das löst den fehler aus.
|
||||
//also inprinzip nur date zurück geben und kuken was danach passiert
|
||||
|
||||
@@ -444,8 +446,10 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
if(date.Value.Second != time.Value.Second)
|
||||
date = date.Value.AddSeconds(time.Value.Second);
|
||||
}
|
||||
|
||||
time = new DateTime(date.Value.Year,date.Value.Month,date.Value.Day,time.Value.Hour,time.Value.Minute,time.Value.Second);
|
||||
}
|
||||
|
||||
return time; // date
|
||||
}
|
||||
}
|
||||
@@ -485,18 +489,22 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
dt = timeDt.AddMinutes((double)RoundedDuration);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (GroupOid != null && GroupRoundedDuration != null)
|
||||
{
|
||||
dt = timeDt.AddHours((double)GroupRoundedDuration);
|
||||
var x = GroupRoundedDuration/60;
|
||||
dt = timeDt.AddHours((double)x /*(double)GroupRoundedDuration*/);
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = timeDt.AddHours((double)RoundedDuration);
|
||||
var x = RoundedDuration / 60;
|
||||
dt = timeDt.AddHours((double)x /*(double)RoundedDuration*/);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,7 +538,7 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
|
||||
[Validation(ValidationRule = ValidationRules.GreaterThanOrEqualZero)]
|
||||
public int? Duration
|
||||
public decimal? Duration
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -849,11 +857,11 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
_DurationSTD = (int)x.TotalMinutes;
|
||||
_DurationSTD = (decimal)x.TotalMinutes;
|
||||
}
|
||||
else
|
||||
{
|
||||
_DurationSTD = (int)x.TotalHours;
|
||||
_DurationSTD = (decimal)x.TotalHours;
|
||||
}
|
||||
|
||||
FirePropertyChanged(PropertyName_EditableEndDate);
|
||||
@@ -907,11 +915,11 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
_DurationSTD = (int)diff.TotalHours;
|
||||
_DurationSTD = (decimal)diff.TotalHours;
|
||||
}
|
||||
else
|
||||
{
|
||||
_DurationSTD = (int)diff.TotalMinutes;
|
||||
_DurationSTD = (decimal)diff.TotalMinutes;
|
||||
}
|
||||
|
||||
TimeCheckForDurationSTD();
|
||||
@@ -938,11 +946,11 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
_Duration = (int)diff.TotalHours;
|
||||
_Duration = (decimal)diff.TotalHours;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Duration = (int)diff.TotalMinutes;
|
||||
_Duration = (decimal)diff.TotalMinutes;
|
||||
}
|
||||
|
||||
TimeCheck();
|
||||
@@ -1129,6 +1137,9 @@ namespace BeWo.ViewModel
|
||||
if (_EditableEndDate.HasValue) {
|
||||
if (_EditableEndDate.Value.Date != _Date.Value.Date)
|
||||
{
|
||||
time = StartTime.Value.TimeOfDay.ToString();
|
||||
endtime = _EditableEndDate.Value.TimeOfDay.ToString();
|
||||
|
||||
date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString() + " " + time + " - " + _EditableEndDate.Value.ToShortDateString() + " " + endtime;
|
||||
}
|
||||
else
|
||||
@@ -1477,11 +1488,11 @@ namespace BeWo.ViewModel
|
||||
var x = _EditableEndDate.Value.Subtract(_StartTime.Value);
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
DurationSTD = (int) x.TotalHours;
|
||||
DurationSTD = (decimal) x.TotalHours;
|
||||
}
|
||||
else
|
||||
{
|
||||
DurationSTD = (int) x.TotalMinutes;
|
||||
DurationSTD = (decimal) x.TotalMinutes;
|
||||
}
|
||||
|
||||
|
||||
@@ -1493,11 +1504,11 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
Duration = (int) diff.TotalHours;
|
||||
Duration = (decimal) diff.TotalHours;
|
||||
}
|
||||
else
|
||||
{
|
||||
Duration = (int)diff.TotalMinutes;
|
||||
Duration = (decimal)diff.TotalMinutes;
|
||||
}
|
||||
FirePropertyChanged(PropertyName_Duration);
|
||||
TimeCheck();
|
||||
@@ -1600,19 +1611,48 @@ namespace BeWo.ViewModel
|
||||
if (value == ZeiterfassungsDauer.Minuten && _DurationInStunden == ZeiterfassungsDauer.Stunden )
|
||||
{
|
||||
if (BeWoApp.AppSettings.IsZeiterfassDateNormal)
|
||||
Duration = _Duration * 60;
|
||||
{
|
||||
if (_Duration.HasValue)
|
||||
{
|
||||
var x = _Duration.Value * 60;
|
||||
Duration = Math.Round(x,2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
DurationSTD = _DurationSTD.Value * 60;
|
||||
{
|
||||
if (_DurationSTD.HasValue)
|
||||
{
|
||||
var x = _DurationSTD.Value * 60;
|
||||
DurationSTD = Math.Round(x, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (value == ZeiterfassungsDauer.Stunden && _DurationInStunden == ZeiterfassungsDauer.Minuten )
|
||||
{
|
||||
|
||||
if (BeWoApp.AppSettings.IsZeiterfassDateNormal)
|
||||
Duration = _Duration/60;
|
||||
{
|
||||
if (_Duration.HasValue)
|
||||
{
|
||||
var x = _Duration.Value / 60;
|
||||
Duration = Math.Round(x, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
DurationSTD = _DurationSTD.Value / 60;
|
||||
{
|
||||
if (_DurationSTD.HasValue)
|
||||
{
|
||||
var x = _DurationSTD.Value / 60;
|
||||
DurationSTD = Math.Round(x, 2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (AreDifferent(_DurationInStunden, value))
|
||||
@@ -1791,7 +1831,22 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//public string IsFloatGesetzt
|
||||
//{
|
||||
// get { return _IsFloatGesetzt; }
|
||||
// set
|
||||
// {
|
||||
// if (AreDifferent(_IsFloatGesetzt, value))
|
||||
// {
|
||||
// _IsFloatGesetzt = value;
|
||||
|
||||
// FirePropertyChanged(PropertyName_DurationSTD);
|
||||
// FirePropertyChanged(PropertyName_Duration);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1947,15 +2002,15 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (pDataContract.DurationInStunden == ZeiterfassungsDauer.Stunden )
|
||||
{
|
||||
_Duration = (int)(pDataContract.End.Value - pDataContract.Start.Value).TotalHours;
|
||||
_Duration = (decimal)(pDataContract.End.Value - pDataContract.Start.Value).TotalHours;
|
||||
|
||||
_EndTime = pDataContract.Start.Value.AddHours(_Duration.Value);
|
||||
_EndTime = pDataContract.Start.Value.AddHours((double)_Duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
_Duration = (pDataContract.End.Value - pDataContract.Start.Value).GetTotalMinutes();
|
||||
|
||||
_EndTime = pDataContract.Start.Value.AddMinutes(_Duration.Value);
|
||||
_EndTime = pDataContract.Start.Value.AddMinutes((double)_Duration.Value);
|
||||
}
|
||||
|
||||
_DurationSTD = 0;
|
||||
@@ -2057,19 +2112,26 @@ namespace BeWo.ViewModel
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible && srf == null || ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
{
|
||||
pDataContract.Start = Date;
|
||||
pDataContract.End = EditableEndDate;
|
||||
|
||||
if(_DurationSTD != null){
|
||||
decimal endduration = 0;
|
||||
|
||||
//pDataContract.End = EditableEndDate;
|
||||
|
||||
if (_DurationSTD != null){
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
RoundedDuration = DurationSTD.Value * 60;
|
||||
RoundedDuration = DurationSTD.Value * 60;
|
||||
endduration = DurationSTD.Value * 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
RoundedDuration = DurationSTD.Value;
|
||||
RoundedDuration = DurationSTD.Value;
|
||||
endduration = DurationSTD.Value;
|
||||
}
|
||||
}
|
||||
|
||||
pDataContract.End = Date.Value.AddMinutes((double)endduration);
|
||||
|
||||
_DurationMonthYearGes = 0;
|
||||
_Duration = 0;
|
||||
|
||||
@@ -2090,8 +2152,12 @@ namespace BeWo.ViewModel
|
||||
RoundedDuration = DurationMonthYearGes.Value * 60;
|
||||
}
|
||||
|
||||
Date = StartDatetime;
|
||||
|
||||
StartTime = StartDatetime;
|
||||
|
||||
_DurationSTD = 0;
|
||||
_Duration = 0;
|
||||
_Duration = 0;
|
||||
|
||||
ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitMonatJahr;
|
||||
|
||||
@@ -2105,7 +2171,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
pDataContract.Start = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second);
|
||||
|
||||
var duration = 0;
|
||||
decimal duration = 0;
|
||||
if (Duration.HasValue)
|
||||
{
|
||||
duration = Duration.Value;
|
||||
@@ -2115,16 +2181,20 @@ namespace BeWo.ViewModel
|
||||
if (DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
duration = duration * 60;
|
||||
|
||||
}
|
||||
|
||||
RoundedDuration = duration;
|
||||
|
||||
_DurationSTD = 0;
|
||||
_DurationMonthYearGes = 0;
|
||||
|
||||
pDataContract.End = pDataContract.Start.Value.AddMinutes(duration);
|
||||
pDataContract.End = pDataContract.Start.Value.AddMinutes((double)duration);
|
||||
|
||||
ServiceRecordFormat = ServiceRecordFormate.OriginaleZeiterfassung;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
pDataContract.Notice = _Notice;
|
||||
pDataContract.Notice2 = _Notice2;
|
||||
@@ -2183,23 +2253,23 @@ namespace BeWo.ViewModel
|
||||
|
||||
private void TimeCheck()
|
||||
{
|
||||
var duration = 0;
|
||||
decimal duration = 0;
|
||||
if (_Duration.HasValue)
|
||||
{
|
||||
duration = _Duration.Value;
|
||||
|
||||
}
|
||||
StoreDirtyInformation(
|
||||
AreDifferent(DataContract.End, (_Date.Value + _StartTime.Value.TimeOfDay).AddMinutes(duration)) ||
|
||||
AreDifferent(DataContract.End, (_Date.Value + _StartTime.Value.TimeOfDay).AddMinutes((double)duration)) ||
|
||||
AreDifferent(DataContract.Start,_Date.Value + _StartTime.Value.TimeOfDay), "TIME");
|
||||
|
||||
|
||||
if (_StartTime != null)
|
||||
{
|
||||
if(_DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
_EndTime = _StartTime.Value.AddMinutes(duration);
|
||||
_EndTime = _StartTime.Value.AddMinutes((double)duration);
|
||||
else
|
||||
_EndTime = _StartTime.Value.AddHours(duration);
|
||||
_EndTime = _StartTime.Value.AddHours((double)duration);
|
||||
|
||||
FirePropertyChanged(PropertyName_EndTime);
|
||||
}
|
||||
@@ -2288,7 +2358,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
|
||||
var diff = _EditableEndDate.Value.Subtract(_Date.Value);
|
||||
duration = (int)diff.TotalMinutes;
|
||||
duration = (double)diff.TotalMinutes;
|
||||
|
||||
|
||||
_DurationSTD = (decimal)duration;
|
||||
@@ -2348,9 +2418,9 @@ namespace BeWo.ViewModel
|
||||
_EditableEndDate = new DateTime(_EndTime.Value.Year, _EndTime.Value.Month, _EndTime.Value.Day, _EndTime.Value.Hour, _EndTime.Value.Minute, _EndTime.Value.Second);
|
||||
|
||||
var diff = EditableEndDate.Value.Subtract(_Date.Value);
|
||||
duration = (int)diff.TotalHours;
|
||||
duration = (double)diff.TotalHours;
|
||||
|
||||
_DurationSTD = (decimal)duration;
|
||||
_DurationSTD = (decimal)Math.Round(duration,2);
|
||||
}
|
||||
|
||||
FirePropertyChanged(PropertyName_DurationSTD);
|
||||
|
||||
Reference in New Issue
Block a user