GOUD#40845 RES2BO werkt nog niet juist

svn path=/Website/branches/v2017.1/; revision=34339
This commit is contained in:
Erik Groener
2017-06-19 11:03:22 +00:00
parent e4a730201e
commit f358d2fb66

View File

@@ -259,7 +259,8 @@ var trackarray = [];
// Onze checkboxen hebben een hidden veld 'has_xxx' waaraan je kunt zien dat het object gereservereerd was
// in het voorheen.
var durationHours = (res_tot - res_van) / 1000/60/60;
var last_discipline = -1;
var curr_discipline = -1;
for (i = 1; i <= Request.Form.Count; i++)
{
deel_key = -1;
@@ -299,6 +300,7 @@ for (i = 1; i <= Request.Form.Count; i++)
var sql = "SELECT p.res_disc_params_maxduur"
+ " , " + lcl.xsqla("c.ins_discipline_omschrijving", "c.ins_discipline_key")
+ " , p.res_disc_params_bonotify"
+ " , c.ins_discipline_key"
+ " FROM res_deel d"
+ " , res_disc_params p"
+ " , res_discipline c"
@@ -308,6 +310,7 @@ for (i = 1; i <= Request.Form.Count; i++)
var oRs = Oracle.Execute(sql);
var bonotify = oRs("res_disc_params_bonotify").Value == 1;
var maxHours = (oRs.Eof ? 0 : oRs("res_disc_params_maxduur").Value);
curr_discipline = oRs("ins_discipline_key").Value;
if ((maxHours > 0) && (maxHours < durationHours))
{
abort_with_warning( oRs("ins_discipline_omschrijving").Value + ": " + L("lcl_res_bad_maxperiod").format(maxHours));
@@ -327,16 +330,20 @@ for (i = 1; i <= Request.Form.Count; i++)
+ " ," + res_tot.toSQL(true)
+ " , 1);";
// Nu de echte update.
if (bonotify)
if (bonotify && (curr_discipline != last_discipline))
{
sql += " RES.notifybackoffice(" + rsv_ruimte_key + ", 'RESNEW', 'V', " + deel_key + ");";
last_discipline = curr_discipline;
}
sql += " END;"
Oracle.Execute(sql);
__Log("added " + name + " : " +deel_key);
// Tracking toevoegen.
if (!bonotify)
if (!bonotify && (curr_discipline != last_discipline))
{
var inserttrack = res.trackobject(deel_key, "insert");
trackarray.push(inserttrack);
last_discipline = curr_discipline;
}
}
}
@@ -491,6 +498,8 @@ for (i = 0; i < r_a_key.length; i++)
}
// insert is based on the scanned list of currently reserved objects
var last_discipline = -1;
var curr_discipline = -1;
for (i = 0; i < a_arIns.length; i++)
{
for ( j =0; j < r_a_key.length; j++ ) { // r_a_key bevat records die al in de database zitten
@@ -513,6 +522,7 @@ for (i = 0; i < a_arIns.length; i++)
var prijs_vast = oRs("res_artikel_prijs_vast").value == 1;
var disc_key = oRs("res_discipline_key").value;
var bonotify = oRs("res_disc_params_bonotify").Value == 1;
curr_discipline = disc_key;
if (!must_warn)
must_warn = must_warn || is_expired(disc_key, jsDate);
@@ -540,15 +550,19 @@ for (i = 0; i < a_arIns.length; i++)
sql += " , NULL";
}
sql += " ," + jsDate.toSQL(true) + ");";
if (bonotify)
if (bonotify && (curr_discipline != last_discipline))
{
sql += " RES.notifybackoffice(" + rsv_ruimte_key + ", 'RESNEW', 'C', " + a_arIns[i].res_deel + ");";
last_discipline = curr_discipline;
}
sql += " END;"
Oracle.Execute(sql);
// Tracking toevoegen.
if (!bonotify)
if (!bonotify && (curr_discipline != last_discipline))
{
var inserttrack = res.trackartikel(a_arIns[i].res_deel, "insert");
trackarray.push(inserttrack);
last_discipline = curr_discipline;
}
reserved++;
}