FSN#34578: Codereview: Catering expire controle niet 100% zuiver?

svn path=/Website/trunk/; revision=27406
This commit is contained in:
Maykel Geerdink
2015-12-10 16:07:51 +00:00
parent a6461868e9
commit f5705618dd
2 changed files with 25 additions and 12 deletions

View File

@@ -964,26 +964,25 @@ res = {
// Als *alle* R/C/V onderdelen 'verwerkt' zijn dan worden we ook readonly
// Let op: CV -reservering heeft geen bo-status in res_rsv_ruimte
sql = "SELECT rd.res_status_bo_key"
+ " FROM res_v_aanwezigrsv_deel rd"
+ " WHERE rd.res_rsv_ruimte_key = " + rsv_ruimte_key
+ " UNION "
+ "SELECT ra.res_status_bo_key"
+ " FROM res_v_aanwezigrsv_artikel ra"
+ " WHERE ra.res_rsv_ruimte_key = " + rsv_ruimte_key;
sql1 = "SELECT rd.res_status_bo_key"
+ " FROM res_v_aanwezigrsv_deel rd"
+ " WHERE rd.res_rsv_ruimte_key = " + rsv_ruimte_key
+ " UNION "
+ "SELECT ra.res_status_bo_key"
+ " FROM res_v_aanwezigrsv_artikel ra"
+ " WHERE ra.res_rsv_ruimte_key = " + rsv_ruimte_key;
if (res_opstel_key != null)
{
sql +=" UNION "
+ "SELECT res_status_bo_key"
sql2 = "SELECT res_status_bo_key"
+ " FROM res_v_aanwezigrsv_ruimte rs"
+ " WHERE rs.res_rsv_ruimte_key = " + rsv_ruimte_key;
}
sql = "SELECT MAX(res_status_bo_key) max_bo"
+ " , MIN (res_status_bo_key) min_bo"
+ " FROM (" + sql + ")";
+ " FROM (" + sql1 + " UNION " + sql2 + ")";
oRs = Oracle.Execute( sql );
oRs = Oracle.Execute(sql);
rresult.min_bo = oRs("min_bo").Value;
rresult.max_bo = oRs("max_bo").Value;
oRs.Close();
@@ -993,6 +992,20 @@ res = {
rresult.canChangeCV = false;
rresult.readoReason = L("lcl_res_reado_completed"); // Alles is al verwerkt;
}
else
{ // CV of R kan ook afzonderlijk al de bo status 6 hebben en dus niet meer wijzigbaar zijn.
sql = "SELECT MIN (res_status_bo_key) min_bo"
+ " FROM (" + sql1 + ")";
oRs = Oracle.Execute(sql);
if (oRs("min_bo").Value && oRs("min_bo").Value == 6)
rresult.canChangeCV = false;
sql = "SELECT MIN (res_status_bo_key) min_bo"
+ " FROM (" + sql2 + ")";
oRs = Oracle.Execute(sql);
if (oRs("min_bo").Value && oRs("min_bo").Value == 6)
rresult.canChange = false;
}
if (rresult.canDelete)
{ // Hij mag geen onderdelen hebben met status 6 (verwerkt)

View File

@@ -176,7 +176,7 @@ function checkArtikelen(starttime_room, endtime_room)
$(".tab_cat_sched").each(function() // doorloop alle catering disciplines
{
var tbl=this;
var thisCatExpire = new Date(tbl.catExpire);
var thisCatExpire = new Date(parseInt(tbl.getAttribute("catExpire"), 10));
if (allGood)
$(".catline", tbl).each(function ()
{