This commit is contained in:
2021-06-22 23:33:41 +00:00
parent 3c5298aa05
commit 9c60886cfa
8 changed files with 27 additions and 16 deletions

2
.vscode/launch.json vendored
View File

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

View File

@@ -4764,8 +4764,9 @@ namespace AyaNova.Biz
} }
//Scheduling conflict? //Scheduling conflict?
//TODO: Add global settings allow schedule conflicts setting check here (after implementing it) if (!AyaNova.Util.ServerGlobalBizSettings.Cache.AllowScheduleConflicts
if (proposedObj.UserId!=null && proposedObj.StartDate != null && proposedObj.UserId != null
&& proposedObj.StartDate != null
&& proposedObj.StopDate != null && proposedObj.StopDate != null
&& (isNew && (isNew
|| (proposedObj.StartDate != currentObj.StartDate) || (proposedObj.StartDate != currentObj.StartDate)
@@ -4773,12 +4774,14 @@ namespace AyaNova.Biz
|| (proposedObj.UserId != currentObj.UserId) || (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 (await ct.WorkOrderItemScheduledUser.AnyAsync(x => x.Id != proposedObj.Id
// if (Overlaps.Any()) && x.UserId == proposedObj.UserId
// { && x.StartDate <= proposedObj.StopDate
if(await ct.WorkOrderItemScheduledUser.AnyAsync(x=>x.Id!=proposedObj.Id && x.UserId==proposedObj.UserId && x.StartDate<= proposedObj.StopDate && proposedObj.StartDate <= x.StopDate )){ && proposedObj.StartDate <= x.StopDate))
AddError(ApiErrorCode.VALIDATION_FAILED, "StartDate", await Translate("GlobalAllowScheduleConflicts")); {
} AddError(ApiErrorCode.VALIDATION_FAILED, "StartDate", await Translate("ScheduleConflict"));
AddError(ApiErrorCode.VALIDATION_FAILED, "StopDate", await Translate("ScheduleConflict"));
}
} }

View File

@@ -40,6 +40,9 @@ namespace AyaNova.Models
[Required] [Required]
public TimeSpan WorkOrderCompleteByAge { get; set; } = TimeSpan.Zero;//was workorderclosebyage public TimeSpan WorkOrderCompleteByAge { get; set; } = TimeSpan.Zero;//was workorderclosebyage
public bool AllowScheduleConflicts { get; set; }
//CUSTOMER ACCESS FEATURES AND SETTINGS //CUSTOMER ACCESS FEATURES AND SETTINGS
public long? CustomerDefaultWorkOrderReportId { get; set; } public long? CustomerDefaultWorkOrderReportId { get; set; }

View File

@@ -2268,5 +2268,6 @@
"CustomerAccessWorkOrderReport":"Kundenversion Arbeitsauftragsbericht", "CustomerAccessWorkOrderReport":"Kundenversion Arbeitsauftragsbericht",
"NoFeaturesAvailable":"Für Ihr Konto sind keine Funktionen aktiviert", "NoFeaturesAvailable":"Für Ihr Konto sind keine Funktionen aktiviert",
"CustomerSignature":"Unterschrift des Kunden", "CustomerSignature":"Unterschrift des Kunden",
"TechSignature":"Unterschrift des Technikers" "TechSignature":"Unterschrift des Technikers",
"ScheduleConflict":"Terminkonflikt"
} }

View File

@@ -2268,7 +2268,8 @@
"CustomerAccessWorkOrderReport":"Customer work order report", "CustomerAccessWorkOrderReport":"Customer work order report",
"NoFeaturesAvailable":"No features are enabled for your account", "NoFeaturesAvailable":"No features are enabled for your account",
"CustomerSignature":"Customer signature", "CustomerSignature":"Customer signature",
"TechSignature":"Technician signature" "TechSignature":"Technician signature",
"ScheduleConflict":"Schedule conflict"
} }

View File

@@ -2268,5 +2268,6 @@
"CustomerAccessWorkOrderReport":"Informe de orden de trabajo del cliente", "CustomerAccessWorkOrderReport":"Informe de orden de trabajo del cliente",
"NoFeaturesAvailable":"No hay funciones habilitadas para su cuenta", "NoFeaturesAvailable":"No hay funciones habilitadas para su cuenta",
"CustomerSignature":"Firma del cliente", "CustomerSignature":"Firma del cliente",
"TechSignature":"Firma del técnico" "TechSignature":"Firma del técnico",
"ScheduleConflict":"Conflicto de horario"
} }

View File

@@ -2268,5 +2268,6 @@
"CustomerAccessWorkOrderReport":"Rapport de bon de travail client", "CustomerAccessWorkOrderReport":"Rapport de bon de travail client",
"NoFeaturesAvailable":"Aucune fonctionnalité n'est activée pour votre compte", "NoFeaturesAvailable":"Aucune fonctionnalité n'est activée pour votre compte",
"CustomerSignature":"Signature du client", "CustomerSignature":"Signature du client",
"TechSignature":"Signature du technicien" "TechSignature":"Signature du technicien",
"ScheduleConflict":"Conflit d'horaire"
} }

View File

@@ -252,6 +252,7 @@ namespace AyaNova.Util
await ExecQueryAsync("CREATE TABLE aglobalbizsettings (id INTEGER NOT NULL PRIMARY KEY, " await ExecQueryAsync("CREATE TABLE aglobalbizsettings (id INTEGER NOT NULL PRIMARY KEY, "
+ "searchcasesensitiveonly BOOL DEFAULT FALSE, " + "searchcasesensitiveonly BOOL DEFAULT FALSE, "
+ "useinventory BOOL DEFAULT TRUE, " + "useinventory BOOL DEFAULT TRUE, "
+ "allowscheduleconflicts BOOL DEFAULT FALSE, "
+ "workordercompletebyage INTERVAL NOT NULL DEFAULT '00:00:00', " + "workordercompletebyage INTERVAL NOT NULL DEFAULT '00:00:00', "
+ "workordertraveldefaultminutes INTEGER NOT NULL DEFAULT 0, " + "workordertraveldefaultminutes INTEGER NOT NULL DEFAULT 0, "
+ "worklaborscheduledefaultminutes INTEGER NOT NULL DEFAULT 0, " + "worklaborscheduledefaultminutes INTEGER NOT NULL DEFAULT 0, "