DJIN#54780 (koppel)zalen honoreren nu schoonmaaktijd ongeacht catalogus

svn path=/Website/trunk/; revision=39551
This commit is contained in:
2018-10-26 13:52:35 +00:00
parent 9cb09a2a4a
commit b3d0cceec1
5 changed files with 193 additions and 168 deletions

View File

@@ -170,13 +170,19 @@ if (rsv_ruimte_key == -1)
else if (ab_mode < 0) // Ruimte Reservering
{
curPage = 3;
// verplicht: date_from: begin van reservering
// loc_key: locatie key
// act_key: activiteit
// optioneel: bez_cnt: aantal bezoekers
// res_tot: einde van reservering (niet meerdaags)
var sql = "SELECT res_srtactiviteit_key, "
+ lcl.xsqla('a.res_activiteit_omschrijving', 'a.res_activiteit_key')
+ " , a.res_activiteit_posttime"
+ " FROM res_activiteit a"
+ " WHERE res_activiteit_key = " + act_key;
var oRs = Oracle.Execute(sql);
var params = { loc: loc_key,
loc_plaats: getQParam("loc_plaats", ""),
forSelectRoom: true,
@@ -184,10 +190,13 @@ if (rsv_ruimte_key == -1)
res_tot: date_to,
vis: bez_cnt,
activiteit_key: act_key,
act_post_time: oRs("res_activiteit_posttime").Value,
srtact: oRs("res_srtactiviteit_key").Value,
with_satisfaction: true,
authparams: user.checkAutorisation("WEB_RESUSE", null, null, true), // urole == "fe" en pessimistisch.
ruimtecat: []
};
oRs.Close();
}
else if (res_deel_key < 0) // Voorziening Reservering
{

View File

@@ -82,7 +82,9 @@ FCLTHeader.Requires({ js: [rooturl+"/appl/pda/modernizr-3.3.0.custom.min.js"],
}
else
{
var enkele_ruimte = "(SELECT ra.res_ruimte_key"
// Dit moet nog uitgebreid worden zodat het meerdere "enkele_ruimten" in verschillende catalogi kan handelen
// voor nu MAX() om AiAi uit te voorkomen
var enkele_ruimte = "(SELECT MAX(ra.res_ruimte_key)"
+ " FROM res_alg_ruimte ra"
+ " WHERE ra.res_alg_ruimte_verwijder IS NULL"
+ " AND ra.alg_ruimte_key="+alg_ruimte_key
@@ -309,7 +311,7 @@ FCLTHeader.Requires({ js: [rooturl+"/appl/pda/modernizr-3.3.0.custom.min.js"],
// TODO: een list(!) van de reserveringen vanaf nu (reeds begonnen) tot einde van de dag
// Daar kan ik op klikken en dan.... of...?
// BLOCK_START({collapsed: false, title: L("lcl_mobile_res_today")});
// BLOCK_START({collapsed: false, title: L("lcl_mobile_res_today")});
if (RuimteMode)
var periods = S("res_pda_room_times"); // Let op: alles moet deelbaar zijn door 'blokgrootte' S("res_h") en groter zijn dan S("res_block")

View File

@@ -1504,6 +1504,7 @@ res = {
+ " AND rrd.bez_bezoekers_key IS NULL) aantalD" // Uitsluiten parkeerplaatsen met een bez_bezoekers_key.
+ " , (SELECT count(1) FROM mld_melding mld_res"
+ " WHERE mld_res.res_rsv_ruimte_key = rv.res_rsv_ruimte_key) aantalM"
+ " , rsv_prepost.res_disc_params_preposttime"
+ " FROM res_v_aanwezigrsv_ruimte rv"
+ " , res_ruimte_opstelling ro"
+ " , res_activiteit ra"
@@ -1515,6 +1516,9 @@ res = {
+ " AND r1.res_alg_ruimte_verwijder IS NULL"
+ " AND r2.res_alg_ruimte_verwijder IS NULL"
+ " ) X"
+ " , (SELECT res_ruimte_key, res_disc_params_preposttime"
+ " FROM res_disc_params, res_ruimte"
+ " WHERE res_disc_params.res_ins_discipline_key = res_ruimte.res_discipline_key) rsv_prepost"
+ " WHERE rv.res_rsv_ruimte_van between " + params.res_van.toSQL() + " AND " + params.res_tot.endToSQL()
+ " AND rv.res_ruimte_opstel_key = ro.res_ruimte_opstel_key"
+ " AND X.res_ruimte_key_2 = ro.res_ruimte_key"
@@ -1526,6 +1530,7 @@ res = {
? " AND res_ruimte_key_1=" + params.res_ruimte_key
: "")
+ " AND res_ruimte_key_1 IN (SELECT res_ruimte_key FROM (" + room_sql + "))"
+ " AND rsv_prepost.res_ruimte_key = res_ruimte_key_2"
+ " ORDER BY res_ruimte_key_1"
+ " , (res_rsv_ruimte_tot - res_rsv_ruimte_van) DESC" // langste reserveringen eerst/onderop
+ " , rv.res_rsv_ruimte_dirtlevel ASC"
@@ -1552,6 +1557,8 @@ res = {
res_tot : new Date(oRs("res_rsv_ruimte_tot").Value),
fo_status : oRs("res_status_fo_key").Value
};
if (oRs("res_disc_params_preposttime").Value)
data.rsv_preposttime = oRs("res_disc_params_preposttime").Value;
if (oRs("res_activiteit_posttime").Value)
data.act_post_time = oRs("res_activiteit_posttime").Value;
if (oRs("res_rsv_ruimte_flag").Value)

View File

@@ -171,7 +171,7 @@ var tot_ruimtes = 0;
var tot_beschik = 0;
function calcTotals(sql)
{
var totalSql = "SELECT " + (dayschedule ? "COUNT(COUNT(1))" : "COUNT(1), SUM(MAX(beschikbaar_uren))") + "FROM (" + sql + ") GROUP BY " + (groupres == 14 ? "res_keycolumn" : "alg_ruimte_key");
var totalSql = "SELECT " + (dayschedule ? "COUNT(COUNT(1))" : "COUNT(1), SUM(MAX(beschikbaar_uren))") + " FROM (" + sql + ") GROUP BY " + (groupres == 14 ? "res_keycolumn" : "alg_ruimte_key");
var totaloRs = Oracle.Execute(totalSql);
tot_ruimtes = totaloRs(0).Value;
if (!dayschedule)
@@ -506,163 +506,8 @@ function calcTotals(sql)
//order_by = "6";
}
if (groupres == 6)
{ // locatie.
res_colums[0][0] = L("lcl_location");
sql = " SELECT l.alg_locatie_key res_keycolumn"
+ ", l.alg_locatie_omschrijving locatie"
+ ", x.alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sql + ") x"
+ ", alg_locatie l"
+ " WHERE x.alg_locatie_key = l.alg_locatie_key"
+ " GROUP BY l.alg_locatie_key"
+ ", l.alg_locatie_omschrijving"
+ ", x.alg_ruimte_key";
calcTotals(sql);
sql = " SELECT res_keycolumn, locatie, COUNT(DISTINCT alg_ruimte_key) aantal_ruimten"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn, locatie"
+ " ORDER BY locatie";
}
else if (groupres == 15)
{ // room_cat
res_colums[0][0] = L("lcl_res_roomcat");
res_colums[0][1] = "ruimte_categorie";
sql = " SELECT d.ins_discipline_key res_keycolumn"
+ ", ins_discipline_volgnr"
+ ", "+ lcl.xsql('d.ins_discipline_omschrijving','d.ins_discipline_key') +" ruimte_categorie"
+ ", x.alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sql + ") x"
+ ", ins_tab_discipline d"
+ " WHERE x.res_discipline_key = d.ins_discipline_key"
+ " GROUP BY d.ins_discipline_key"
+ ", ins_discipline_volgnr"
+ ", "+ lcl.xsql('d.ins_discipline_omschrijving','d.ins_discipline_key')
+ ", x.alg_ruimte_key";
calcTotals(sql);
sql = " SELECT res_keycolumn, ins_discipline_volgnr, ruimte_categorie, COUNT(DISTINCT alg_ruimte_key) aantal_ruimten"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn, ins_discipline_volgnr, ruimte_categorie"
+ " ORDER BY ins_discipline_volgnr, ruimte_categorie";
}
else if (groupres == 16)
{ // maand
if (dayschedule)
{
res_colums = [ [L("lcl_month"), fnrowMaand, "string", false] ];
res_colums = res_colums.concat(forhours(function (i, h) { return [String(h) == "23" ? "23:00 - 00:00" : String(h) + ":00 - " + String(h + 1) + ":00", "t" + String(i), "float", false, true];}));
}
else
{
res_colums = [ [L("lcl_month"), fnrowMaand, "string", false],
[L("lcl_res_load_in_hours"), "gebruik_uren", "float", false],
[L("lcl_res_available_in_hours"), "beschikbaar_uren", "float", false],
[L("lcl_occupation_perc"), "bezetting", "float", false] ];
}
sql = " SELECT periode res_keycolumn, alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sqlM + ") x"
+ " GROUP BY periode, x.alg_ruimte_key";
sql = " SELECT res_keycolumn"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn"
+ " ORDER BY res_keycolumn";
}
else if (groupres == 18)
{ // weekdag
if (dayschedule)
{
res_colums = [ [L("lcl_weekday"), fnrowMaand, "string", false] ];
res_colums = res_colums.concat(forhours(function (i, h) { return [String(h) == "23" ? "23:00 - 00:00" : String(h) + ":00 - " + String(h + 1) + ":00", "t" + String(i), "float", false, true];}));
}
else
{
res_colums = [ [L("lcl_weekday"), fnrowMaand, "string", false],
[L("lcl_res_load_in_hours"), "gebruik_uren", "float", false],
[L("lcl_res_available_in_hours"), "beschikbaar_uren", "float", false],
[L("lcl_occupation_perc"), "bezetting", "float", false] ];
}
sql = " SELECT periode, alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sqlM + ") x"
+ " GROUP BY periode, x.alg_ruimte_key";
sql = " SELECT TO_CHAR(TO_DATE(periode,'yyyymmdd'),'d') res_keycolumn"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY TO_CHAR(TO_DATE(periode,'yyyymmdd'),'d')"
+ " ORDER BY TO_CHAR(TO_DATE(periode,'yyyymmdd'),'d')";
}
else if (groupres == 19)
{ // datum
if (dayschedule)
{
res_colums = [ [L("lcl_date"), fnrowMaand, "string", false] ];
res_colums = res_colums.concat(forhours(function (i, h) { return [String(h) == "23" ? "23:00 - 00:00" : String(h) + ":00 - " + String(h + 1) + ":00", "t" + String(i), "float", false, true];}));
}
else
{
res_colums = [ [L("lcl_date"), fnrowMaand, "string", false],
[L("lcl_res_load_in_hours"), "gebruik_uren", "float", false],
[L("lcl_res_available_in_hours"), "beschikbaar_uren", "float", false],
[L("lcl_occupation_perc"), "bezetting", "float", false] ];
}
sql = " SELECT periode res_keycolumn, alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sqlM + ") x"
+ " GROUP BY periode, x.alg_ruimte_key";
sql = " SELECT res_keycolumn"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn"
+ " ORDER BY res_keycolumn";
}
else if (groupres == 10)
{ // gebouw
res_colums[0][0] = L("lcl_building");
res_colums[0][1] = "gebouw";
sql = " SELECT g.alg_gebouw_key res_keycolumn"
+ ", g.alg_gebouw_omschrijving gebouw"
+ ", x.alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sql + ") x"
+ ", alg_gebouw g"
+ " WHERE x.alg_gebouw_key = g.alg_gebouw_key"
+ " GROUP BY g.alg_gebouw_key"
+ ", g.alg_gebouw_omschrijving"
+ ", x.alg_ruimte_key";
calcTotals(sql);
sql = " SELECT res_keycolumn, gebouw, COUNT(alg_ruimte_key) aantal_ruimten"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn, gebouw"
+ " ORDER BY gebouw";
}
else if (groupres == 5)
{ // district
if (groupres == 5)
{ // District
res_colums[0][0] = L("lcl_district");
res_colums[0][1] = "district";
@@ -685,9 +530,57 @@ function calcTotals(sql)
+ " GROUP BY res_keycolumn, district"
+ " ORDER BY district";
}
else if (groupres == 6)
{ // Locatie.
res_colums[0][0] = L("lcl_location");
sql = " SELECT l.alg_locatie_key res_keycolumn"
+ ", l.alg_locatie_omschrijving locatie"
+ ", x.alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sql + ") x"
+ ", alg_locatie l"
+ " WHERE x.alg_locatie_key = l.alg_locatie_key"
+ " GROUP BY l.alg_locatie_key"
+ ", l.alg_locatie_omschrijving"
+ ", x.alg_ruimte_key";
calcTotals(sql);
sql = " SELECT res_keycolumn, locatie, COUNT(DISTINCT alg_ruimte_key) aantal_ruimten"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn, locatie"
+ " ORDER BY locatie";
}
else if (groupres == 10)
{ // Gebouw
res_colums[0][0] = L("lcl_building");
res_colums[0][1] = "gebouw";
sql = " SELECT g.alg_gebouw_key res_keycolumn"
+ ", g.alg_gebouw_omschrijving gebouw"
+ ", x.alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sql + ") x"
+ ", alg_gebouw g"
+ " WHERE x.alg_gebouw_key = g.alg_gebouw_key"
+ " GROUP BY g.alg_gebouw_key"
+ ", g.alg_gebouw_omschrijving"
+ ", x.alg_ruimte_key";
calcTotals(sql);
sql = " SELECT res_keycolumn, gebouw, COUNT(alg_ruimte_key) aantal_ruimten"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn, gebouw"
+ " ORDER BY gebouw";
}
else if (groupres == 14)
{ // ruimte
{ // Ruimte
if (dayschedule)
{
res_colums = [ [L("lcl_room"), "ruimte", "string", false] ];
@@ -715,6 +608,113 @@ function calcTotals(sql)
+ " GROUP BY res_keycolumn, ruimte"
+ " ORDER BY ruimte";
}
else if (groupres == 15)
{ // Ruimte catalogus
res_colums[0][0] = L("lcl_res_roomcat");
res_colums[0][1] = "ruimte_categorie";
sql = " SELECT d.ins_discipline_key res_keycolumn"
+ ", ins_discipline_volgnr"
+ ", "+ lcl.xsql('d.ins_discipline_omschrijving','d.ins_discipline_key') +" ruimte_categorie"
+ ", x.alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sql + ") x"
+ ", ins_tab_discipline d"
+ " WHERE x.res_discipline_key = d.ins_discipline_key"
+ " GROUP BY d.ins_discipline_key"
+ ", ins_discipline_volgnr"
+ ", "+ lcl.xsql('d.ins_discipline_omschrijving','d.ins_discipline_key')
+ ", x.alg_ruimte_key";
calcTotals(sql);
sql = " SELECT res_keycolumn, ins_discipline_volgnr, ruimte_categorie, COUNT(DISTINCT alg_ruimte_key) aantal_ruimten"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn, ins_discipline_volgnr, ruimte_categorie"
+ " ORDER BY ins_discipline_volgnr, ruimte_categorie";
}
else if (groupres == 16)
{ // Maand
if (dayschedule)
{
res_colums = [ [L("lcl_month"), fnrowMaand, "string", false] ];
res_colums = res_colums.concat(forhours(function (i, h) { return [String(h) == "23" ? "23:00 - 00:00" : String(h) + ":00 - " + String(h + 1) + ":00", "t" + String(i), "float", false, true];}));
}
else
{
res_colums = [ [L("lcl_month"), fnrowMaand, "string", false],
[L("lcl_res_load_in_hours"), "gebruik_uren", "float", false],
[L("lcl_res_available_in_hours"), "beschikbaar_uren", "float", false],
[L("lcl_occupation_perc"), "bezetting", "float", false] ];
}
sql = " SELECT periode res_keycolumn, alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sqlM + ") x"
+ " GROUP BY periode, x.alg_ruimte_key";
sql = " SELECT res_keycolumn"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn"
+ " ORDER BY res_keycolumn";
}
else if (groupres == 18)
{ // Weekdag
if (dayschedule)
{
res_colums = [ [L("lcl_weekday"), fnrowMaand, "string", false] ];
res_colums = res_colums.concat(forhours(function (i, h) { return [String(h) == "23" ? "23:00 - 00:00" : String(h) + ":00 - " + String(h + 1) + ":00", "t" + String(i), "float", false, true];}));
}
else
{
res_colums = [ [L("lcl_weekday"), fnrowMaand, "string", false],
[L("lcl_res_load_in_hours"), "gebruik_uren", "float", false],
[L("lcl_res_available_in_hours"), "beschikbaar_uren", "float", false],
[L("lcl_occupation_perc"), "bezetting", "float", false] ];
}
sql = " SELECT periode, alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sqlM + ") x"
+ " GROUP BY periode, x.alg_ruimte_key";
sql = " SELECT TO_CHAR(TO_DATE(periode,'yyyymmdd'),'d') res_keycolumn"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY TO_CHAR(TO_DATE(periode,'yyyymmdd'),'d')"
+ " ORDER BY TO_CHAR(TO_DATE(periode,'yyyymmdd'),'d')";
}
else if (groupres == 19)
{ // Datum
if (dayschedule)
{
res_colums = [ [L("lcl_date"), fnrowMaand, "string", false] ];
res_colums = res_colums.concat(forhours(function (i, h) { return [String(h) == "23" ? "23:00 - 00:00" : String(h) + ":00 - " + String(h + 1) + ":00", "t" + String(i), "float", false, true];}));
}
else
{
res_colums = [ [L("lcl_date"), fnrowMaand, "string", false],
[L("lcl_res_load_in_hours"), "gebruik_uren", "float", false],
[L("lcl_res_available_in_hours"), "beschikbaar_uren", "float", false],
[L("lcl_occupation_perc"), "bezetting", "float", false] ];
}
sql = " SELECT periode res_keycolumn, alg_ruimte_key"
+ inner_select_sql
+ " FROM (" + sqlM + ") x"
+ " GROUP BY periode, x.alg_ruimte_key";
sql = " SELECT res_keycolumn"
+ outer_select_sql
+ " FROM (" + sql + ") data"
+ " GROUP BY res_keycolumn"
+ " ORDER BY res_keycolumn";
}
else
{
sql = sql;

View File

@@ -47,9 +47,12 @@ function set_will_fit(plan_rooms_info, plan_bezet_info, params)
}
else
{
// deze_room.pre_time = Max van deze_room.prepost_time en geplande_room.activity.post_time
room.pre_time = (ar[ci].act_post_time ? Math.max(room.prepost_time, ar[ci].act_post_time) : room.prepost_time);
room.post_time = Math.max(room.prepost_time, params.act_post_time);
// We willen graag de max(preposttime) van de catalogus waarin we nu reserveren, en de existing_rsv catalogus
var this_prepost_time = Math.max(room.prepost_time, (ar[ci].rsv_preposttime || 0));
// this_pre_time = Max van this_prepost_time en existing_rsv.activity.post_time
room.pre_time = (ar[ci].act_post_time ? Math.max(this_prepost_time, ar[ci].act_post_time) : this_prepost_time);
room.post_time = Math.max(this_prepost_time, params.act_post_time);
if (params.res_van.getTime() - room.pre_time *60*60*1000 < ar[ci].res_tot.getTime()
&& params.res_tot.getTime() + room.post_time*60*60*1000 > ar[ci].res_van.getTime())
@@ -198,9 +201,13 @@ function make_plan_regel(room, ar, params, nr_days, hour_px)
var theStyleLeft = ""; // voor cleaning blokje afmeting
var theStyleRight = "";
// We willen graag de max(preposttime) van de catalogus waarin we nu reserveren, en de existing_rsv catalogus
var this_prepost_time = Math.max(room.prepost_time, (ar[ci].rsv_preposttime || 0));
// Perhaps cleaning time, alleen optie en definitief
// room.post_time >= room.prepost_time (always)
var this_post_time = Math.max(room.prepost_time, (ar[ci].act_post_time || 0));
// this_post_time >= this_prepost_time (always)
var this_post_time = Math.max(this_prepost_time, (ar[ci].act_post_time || 0));
var preclean = 0;
var postclean = 0;
@@ -209,7 +216,7 @@ function make_plan_regel(room, ar, params, nr_days, hour_px)
theClass += " res_cleaning";
// maximaal kwartier 'doorschieten' links/rechts
preclean = Math.min(room.prepost_time, h_start - S("res_t1") + 0.25);
preclean = Math.min(this_prepost_time, h_start - S("res_t1") + 0.25);
postclean = Math.min(this_post_time, S("res_t2") - h_end + 0.25);
if ( Math.round(hour_px * postclean - 1) > 0 )