Fristen für Unterschriften eingebaut
This commit is contained in:
@@ -1513,11 +1513,13 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
TempData[TempDataConstants.AfterInsertKey] = true;
|
||||
|
||||
if(Model.NewServiceRecord.CostBearer != null && Model.ShowSignature && (Model.NewServiceRecord.ServiceDescription.Category.IsBillable || Model.NewServiceRecord.ServiceDescription.Category.BillableAmount > 0m || Model.NewServiceRecord.ServiceDescription.BillableAmount > 0m))
|
||||
if (Model.IsAllowedToCreateSignature(Model.NewServiceRecord))
|
||||
{
|
||||
TempData[TempDataConstants.ShowSignatureSuggestionPopup] = true;
|
||||
if (Model.NewServiceRecord.CostBearer != null && Model.ShowSignature && (Model.NewServiceRecord.ServiceDescription.Category.IsBillable || Model.NewServiceRecord.ServiceDescription.Category.BillableAmount > 0m || Model.NewServiceRecord.ServiceDescription.BillableAmount > 0m))
|
||||
{
|
||||
TempData[TempDataConstants.ShowSignatureSuggestionPopup] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(appointmentPrototype is object)
|
||||
{
|
||||
var isRecurring = !(appointmentPrototype.RecurrenceInfo is null);
|
||||
|
||||
@@ -57,6 +57,16 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
private void InitViewModel()
|
||||
{
|
||||
Model.MokSettings = new MokSettings
|
||||
{
|
||||
SupportConceptExpirationLimitInMonths = UserSettingsUtils.GetSettingValueAsInteger(Model.Mandator.Settings, SettingsKeys.HilfeplanAuslaufAuswahl, 3),
|
||||
AnzTageZeiterfassErfolgt = UserSettingsUtils.GetSettingValueAsInteger(Model.Mandator.Settings, SettingsKeys.AnzTageZeiterfassErfolgt),
|
||||
AnzTageUnterschriftErfolgt = UserSettingsUtils.GetSettingValueAsInteger(Model.Mandator.Settings, SettingsKeys.AnzTageUnterschriftErfolgt),
|
||||
MaxDaysEditServiceRecordsAllowed = UserSettingsUtils.GetSettingValueAsInteger(Model.Mandator.Settings, SettingsKeys.MaxDaysEditServiceRecordsAllowed),
|
||||
TimeUntilUILock = UserSettingsUtils.GetSettingValueAsInteger(Model.Mandator.Settings, SettingsKeys.TimeUntilUILock),
|
||||
ServiceRecordAllowChangeHours = UserSettingsUtils.GetSettingValueAsInteger(Model.Mandator.Settings, SettingsKeys.ServiceRecordAllowChangeHours)
|
||||
};
|
||||
|
||||
var month = DateTime.Today.Month;
|
||||
var year = DateTime.Today.Year;
|
||||
var first = new DateTime(year, month, 1).AddMonths(-1);
|
||||
@@ -1286,10 +1296,20 @@ namespace BeWoPlanerMobil.Controllers
|
||||
reportObjects.DoForEach(reportObject =>
|
||||
{
|
||||
var quittierungsbelegItems = new List<QuittierungsbelegItem>();
|
||||
|
||||
bool fristAbgelaufen = false;
|
||||
|
||||
reportObject.Services.DoForEach(serviceDetail =>
|
||||
{
|
||||
quittierungsbelegItems.Add(new QuittierungsbelegItem(serviceDetail));
|
||||
if (this.Model.MokSettings != null && this.Model.MokSettings.AnzTageUnterschriftErfolgt > 0)
|
||||
{
|
||||
if (DateTime.Now.Date.Subtract(serviceDetail.StartDate).TotalDays > this.Model.MokSettings.AnzTageUnterschriftErfolgt)
|
||||
{
|
||||
fristAbgelaufen = true;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(quittierungsbelegItems.Count == 0)
|
||||
@@ -1340,7 +1360,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
employeeSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Employee];
|
||||
}
|
||||
|
||||
foreach(var quittierungsbelegItem in quittierungsbelegItems)
|
||||
foreach (var quittierungsbelegItem in quittierungsbelegItems)
|
||||
{
|
||||
var serviceRecordOid = quittierungsbelegItem.ServiceRecordOid;
|
||||
|
||||
@@ -1377,7 +1397,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
customerSignatureOids,
|
||||
employeeSignatureState2,
|
||||
employeeSignatureOids,
|
||||
employeeOids.Count
|
||||
employeeOids.Count,
|
||||
fristAbgelaufen
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -238,6 +238,21 @@ namespace BeWoPlanerMobil.Models
|
||||
return allowed;
|
||||
}
|
||||
|
||||
public bool IsAllowedToCreateSignature(ServiceRecordDC serviceRecord)
|
||||
{
|
||||
|
||||
if (MokSettings != null && MokSettings.AnzTageUnterschriftErfolgt > 0)
|
||||
{
|
||||
if (DateTime.Now.Date.Subtract(serviceRecord.Start.Value.Date).TotalDays > MokSettings.AnzTageUnterschriftErfolgt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public long? SelectedServiceRecordOid
|
||||
{
|
||||
get => MainSessionModel.SelectedServiceRecordOid;
|
||||
|
||||
@@ -30,7 +30,9 @@ namespace BeWoPlanerMobil.Util
|
||||
|
||||
public int EmployeeCount { get; }
|
||||
|
||||
public QuittierungsbelegResult(string customerName, List<QuittierungsbelegItem> items, long customerOid, bool hasCustomerSignature, long? customerSignatureOid, SignatureState customerSignatureStatus, List<long> customerSignatureOids, SignatureState employeeSignatureState, List<long> employeeSignatureOids, int employeeCount)
|
||||
public bool FristAbgelaufen { get; }
|
||||
|
||||
public QuittierungsbelegResult(string customerName, List<QuittierungsbelegItem> items, long customerOid, bool hasCustomerSignature, long? customerSignatureOid, SignatureState customerSignatureStatus, List<long> customerSignatureOids, SignatureState employeeSignatureState, List<long> employeeSignatureOids, int employeeCount, bool fristAbgelaufen)
|
||||
{
|
||||
CustomerName = customerName;
|
||||
Items = items;
|
||||
@@ -43,6 +45,8 @@ namespace BeWoPlanerMobil.Util
|
||||
EmployeeSignatureState = employeeSignatureState;
|
||||
EmployeeSignatureOids = employeeSignatureOids;
|
||||
EmployeeCount = employeeCount;
|
||||
FristAbgelaufen = fristAbgelaufen;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -310,7 +310,7 @@
|
||||
}
|
||||
|
||||
@* Unterschrift-Anlegen-Button *@
|
||||
@if(Model.ShowSignature && !serviceRecord.SignatureOid.HasValue && serviceRecord.Customer != null)
|
||||
@if(Model.ShowSignature && !serviceRecord.SignatureOid.HasValue && serviceRecord.Customer != null && Model.IsAllowedToCreateSignature(serviceRecord))
|
||||
{
|
||||
<button type="button" class="btn btn-outline-primary" onclick="showNewSignaturePopup(@serviceRecord.ServiceRecordOid)">
|
||||
<span class="fas fa-signature"></span>
|
||||
|
||||
@@ -267,6 +267,7 @@
|
||||
|
||||
var hasNoOwnEntries = !Model.HasRightToProvideEmployeeSignatureForOthers && result.Items.All(item => !item.EmployeeOid.Equals(Model.LoggedInEmployee.EmployeeOid));
|
||||
var disabledString = hasNoOwnEntries ? "disabled" : string.Empty;
|
||||
var customerDisabledString = result.FristAbgelaufen ? "disabled" : string.Empty;
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
@@ -298,7 +299,7 @@
|
||||
<span class="fas fa-trash"></span>
|
||||
</button>
|
||||
}
|
||||
<button class="btn btn-bewo-customers" type="button" onclick="loadConfirmationReceiptSignatures('@cardBodyId_ssp', '@result.Identifier', false, @result.HasCustomerSignature.ToString().ToLower(), @canCustomerSign.ToString().ToLower(), @result.CustomerOid)">
|
||||
<button class="btn btn-bewo-customers" @customerDisabledString type="button" onclick="loadConfirmationReceiptSignatures('@cardBodyId_ssp', '@result.Identifier', false, @result.HasCustomerSignature.ToString().ToLower(), @canCustomerSign.ToString().ToLower(), @result.CustomerOid)">
|
||||
<span class="fas fa-signature mr-0 pr-0"></span>
|
||||
@if(customerSignatureState != SignatureState.All)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user