This commit is contained in:
2021-06-22 23:19:21 +00:00
parent 2ac3c95816
commit 3c5298aa05
2 changed files with 23 additions and 3 deletions

2
.vscode/launch.json vendored
View File

@@ -53,7 +53,7 @@
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
"AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE": "false",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"

View File

@@ -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"));
}
}