Bugfix im Mok, potenzielle Doppelte Einträge verhindern.
This commit is contained in:
@@ -1510,20 +1510,32 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
if(!Model.IsInEditingMode)
|
||||
{
|
||||
var oidList = OperationsService.InsertNewServiceRecords(new List<ServiceRecordDC> { Model.NewServiceRecord });
|
||||
|
||||
Model.LastCreatedServiceRecordOid = oidList[0];
|
||||
|
||||
TempData[TempDataConstants.AfterInsertKey] = true;
|
||||
|
||||
if (Model.IsAllowedToCreateSignature(Model.NewServiceRecord))
|
||||
var valRes = OperationsService.ValidateServiceRecord(Model.NewServiceRecord, null, 0, null, null);
|
||||
bool doppelt = false;
|
||||
if (valRes.Count > 0 && valRes.FirstOrDefault(v => v.ResultType == ServiceRecordValidationResult.DoppelterEintrag) != null)
|
||||
{
|
||||
if (Model.NewServiceRecord.CostBearer != null && Model.ShowSignature && (Model.NewServiceRecord.ServiceDescription.Category.IsBillable || Model.NewServiceRecord.ServiceDescription.Category.BillableAmount > 0m || Model.NewServiceRecord.ServiceDescription.BillableAmount > 0m))
|
||||
doppelt = true;
|
||||
|
||||
|
||||
}
|
||||
if (!doppelt)
|
||||
{
|
||||
var oidList = OperationsService.InsertNewServiceRecords(new List<ServiceRecordDC> { Model.NewServiceRecord });
|
||||
|
||||
Model.LastCreatedServiceRecordOid = oidList[0];
|
||||
|
||||
|
||||
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)
|
||||
TempData[TempDataConstants.AfterInsertKey] = true;
|
||||
|
||||
if (appointmentPrototype is object)
|
||||
{
|
||||
var isRecurring = !(appointmentPrototype.RecurrenceInfo is null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user