Skip to content
Snippets Groups Projects
Commit 9345b7a2 authored by c.wimmer's avatar c.wimmer
Browse files

[Projekt: Crowd-Development / Besuch vor Ort][TicketNr.: 1068901][[Bug]...

[Projekt: Crowd-Development / Besuch vor Ort][TicketNr.: 1068901][[Bug] Mainview Wochenplan - Neuer Wochenplaneintrag  Datum vorbelegen]
parent 52f7fe0a
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@
<element>PROCESS_SETVALUE</element>
<element>RECORD</element>
</onValueChangeTypes>
<onValidation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entrydate/onValidation.js</onValidation>
</entityField>
<entityField>
<name>END_TIME</name>
......
import("system.neon");
import("system.eMath");
import("Sql_lib");
import("system.logging");
......@@ -13,3 +14,16 @@ var begin_time = eMath.absInt(vars.get("$field.BEGIN_TIME"));
if (endTime != "" && begin_time != "" && endTime < begin_time)
result.string(translate.text("The endtime can't be before begintime!"));
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$param.NoVisitPlanEmployeeWeek_param"))
{
var week = newSelect("VISITPLAN_WEEK")
.from("VISITPLANEMPLOYEEWEEK")
.where("VISITPLANEMPLOYEEWEEK.VISITPLANEMPLOYEEWEEKID", vars.get("$field.VISITPLANEMPLOYEEWEEK_ID"))
.cell();
weekEntrydate = eMath.absInt(datetime.toDate(vars.get("$field.ENTRYDATE"), "w"))
if(week != weekEntrydate)
result.string(translate.text("Entrydate has to be in the selected calendar week!"));
}
......@@ -17,10 +17,6 @@ var weekId = newSelect("VISITPLANEMPLOYEEWEEKID")
.and("VISITPLANEMPLOYEEWEEK.VISITPLAN_YEAR", calendarYear)
.and("VISITPLANEMPLOYEEWEEK.CONTACT_ID", user)
.cell();
logging.log(rowData["ENTRYDATE.value"])
logging.log(datetime.toDate(rowData["ENTRYDATE.value"], "w"))
logging.log(datetime.toDate(rowData["ENTRYDATE.value"], "yyyy"))
if(weekId)
visitPlanEmployeeWeekID = weekId;
......@@ -66,7 +62,7 @@ var columns = [
"STATUS_APPOINTMENT",
"VISITPLANEMPLOYEEWEEK_ID"
];
logging.log(visitPlanEmployeeWeekID)
var cond = newWhere("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$field.UID")).toString();
db.updateData("VISITPLANENTRY", columns, null, values, cond);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment