This commit is contained in:
@@ -2250,9 +2250,11 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
o.LineTotalViz = o.ChargeAmount + o.TaxAViz + o.TaxBViz;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
o.LineTotalViz = o.ChargeAmount + o.TaxPaid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4759,6 +4761,24 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
}
|
||||
|
||||
//Scheduling conflict?
|
||||
//TODO: Add global settings allow schedule conflicts setting check here (after implementing it)
|
||||
if (proposedObj.UserId!=null && proposedObj.StartDate != null
|
||||
&& proposedObj.StopDate != null
|
||||
&& (isNew
|
||||
|| (proposedObj.StartDate != currentObj.StartDate)
|
||||
|| (proposedObj.StopDate != currentObj.StopDate)
|
||||
|| (proposedObj.UserId != currentObj.UserId)
|
||||
))
|
||||
{
|
||||
// ICollection<DateTime> Overlaps = await db.TaskTime.Where(a => a.UserId == UserId && a.StartDate <= time.EndDate && time.StartDate <= a.EndDate.Value).OrderBy(a => a).Select(a => a.StartDate).ToListAsync();
|
||||
// if (Overlaps.Any())
|
||||
// {
|
||||
if(await ct.WorkOrderItemScheduledUser.AnyAsync(x=>x.Id!=proposedObj.Id && x.UserId==proposedObj.UserId && x.StartDate<= proposedObj.StopDate && proposedObj.StartDate <= x.StopDate )){
|
||||
AddError(ApiErrorCode.VALIDATION_FAILED, "StartDate", await Translate("GlobalAllowScheduleConflicts"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user