This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -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\\"
|
||||||
|
|||||||
@@ -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"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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; }
|
||||||
|
|||||||
@@ -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"
|
||||||
}
|
}
|
||||||
@@ -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"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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"
|
||||||
}
|
}
|
||||||
@@ -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"
|
||||||
}
|
}
|
||||||
@@ -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, "
|
||||||
|
|||||||
Reference in New Issue
Block a user