MARX#90078: Opdracht-actiestatus via API1 bij 'onderbroken/AFR' bij de (FO)BO kunnen zetten.
svn path=/Website/trunk/; revision=70810
This commit is contained in:
@@ -121,6 +121,7 @@ for (var i = 0; i < opdrachten.length; i++)
|
||||
var onderwerp = XMLval(opdrachten[i], "onderwerp"); // NEW
|
||||
var opdr_kpn = XMLval(opdrachten[i], "kostenplaats");
|
||||
var flag = parseInt(XMLval(opdrachten[i], "flag"), 10);
|
||||
var actiecode = parseInt(XMLval(opdrachten[i], "actiecode"), 10);
|
||||
|
||||
var txt_mut_datum = XMLval(opdrachten[i], "mut_datum"); // UPD
|
||||
var opdrstatus = XMLval(opdrachten[i], "status"); // UPD
|
||||
@@ -920,9 +921,20 @@ for (var i = 0; i < opdrachten.length; i++)
|
||||
}
|
||||
}
|
||||
|
||||
if (resultcode == -1 && !isNaN(actiecode) && actiecode >= 0)
|
||||
{ // Actie code.
|
||||
var mld_info = this_opdr.mld_info;
|
||||
var params = { action2BO: (actiecode & 1) == 1,
|
||||
action2UITV: (actiecode & 4) == 4,
|
||||
notifyBO: (actiecode & 128) == 128,
|
||||
notifyUITV: (actiecode & 512) == 51,
|
||||
replyToAll: this_opdr.myRole === 1 && (actiecode & 4) == 4,
|
||||
isResponse: false};
|
||||
var result = mld.setActiecode(mld_opdr, this_opdr, params);
|
||||
}
|
||||
|
||||
if (resultcode == -1) // Nog steeds geen fouten.
|
||||
{
|
||||
|
||||
var tracking_key = coalesce(coalesce(status_tracking_key, datum_tracking_key), update_tracking_key); // volgorde van belangrijkheid
|
||||
add_note(tracking_key); // voor als nog niet eerder gebeurd
|
||||
|
||||
@@ -932,7 +944,7 @@ for (var i = 0; i < opdrachten.length; i++)
|
||||
{
|
||||
var logtxt = "api_opdrsoap fail.\nResultcode: {0}\nReturntekst: {1}\nOpdracht: {2}\nOldstatus: {3}".format(resultcode, resulttekst, opdrid, oldstatus);
|
||||
if (resulttekst.match(/^Not authorized/)) // Dit komt heel vaak voor door updates op gesloten opdrachten.
|
||||
__Log(logtxt); // Het vervuilt de logfile veel te veel
|
||||
__Log(logtxt); // Het vervuilt de logfile veel te veel
|
||||
else
|
||||
__DoLog(logtxt, "#00FF00");
|
||||
}
|
||||
|
||||
@@ -3107,6 +3107,57 @@ mld = {
|
||||
return summarystring;
|
||||
},
|
||||
|
||||
setActiecode:
|
||||
function (mld_opdr, this_opdr, params)
|
||||
{
|
||||
var result = {};
|
||||
var newActiecode = 0;
|
||||
if (mld_opdr.actiecode & 1 && this_opdr.myRole === 4 || params.notifyBO) { // Als de actie bij de BO staat, of als de BO genotificeerd gaat worden
|
||||
newActiecode += 128; // BO attentie
|
||||
}
|
||||
if (mld_opdr.actiecode & 4 && this_opdr.myRole !== 4 || params.notifyUITV) { // Als de actie bij de UITV staat, of als de UITV genotificeerd gaat worden
|
||||
newActiecode += 512; // UITV attentie
|
||||
}
|
||||
|
||||
if (S("mld_opdr_actiecode") > 0) // Doen we pingpong?
|
||||
{
|
||||
if (this_opdr.myRole === 4) { // Uitvoerder
|
||||
if ((params.action2BO && !(mld_opdr.actiecode & 1)) || (!params.has_action2BO && mld_opdr.actiecode & 1)) { // 'Actie' naar BO
|
||||
newActiecode += 1; // + BO
|
||||
} else {
|
||||
newActiecode += 4; // + UITV
|
||||
}
|
||||
} else { // if (this_opdr.myRole === 1 || this_opdr.myRole === 2), FE of FOBO
|
||||
// Een openstaande vraag is beantwoord, of de actie is bij de uitvoerder gezet, of de BO heeft de actie niet teruggepakt;
|
||||
if ((params.replyToAll || params.isResponse || params.action2UITV) || (mld_opdr.actiecode & 4 && !params.action2BO)) {
|
||||
newActiecode += 4; // + UITV
|
||||
} else {
|
||||
newActiecode += 1; // + BO
|
||||
}
|
||||
}
|
||||
} // if 'doen we opdracht ping pong'
|
||||
|
||||
{ // Opdracht actiecode
|
||||
var sql = "UPDATE mld_opdr"
|
||||
+ " SET mld_opdr_actiecode = " + newActiecode
|
||||
+ (this_opdr.myRole === 2
|
||||
? " , mld_opdr_laatstgezien = SYSDATE" // Als ik een FOBO ben, dan heb ik deze opdracht nu dus ook gezien
|
||||
: "")
|
||||
+ " WHERE mld_opdr_key = " + mld_opdr.opdr_key;
|
||||
Oracle.Execute(sql);
|
||||
result.parent_reload = newActiecode != mld_opdr.actiecode;
|
||||
} // \Opdracht actiecode
|
||||
|
||||
if (newActiecode & 1 && !(mld_opdr.actiecode & 1)) { // Actie veranderd naar [B]O, dus ook ORDA2B
|
||||
shared.trackaction("ORDA2B", mld_opdr.opdr_key);
|
||||
}
|
||||
|
||||
if (newActiecode & 4 && !(mld_opdr.actiecode & 4)) { // Actie veranderd naar [U]ITV, dus ook ORDA2U
|
||||
shared.trackaction("ORDA2U", mld_opdr.opdr_key);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
// Levert een veld (label + waarde) met een klikbare verwijzing naar een gerefereerde entiteit
|
||||
// Dat is de entiteit waarop deze melding betrekking heeft, bijvoorbeeld bij klachten of KTO.
|
||||
referentielink:
|
||||
@@ -4167,7 +4218,7 @@ mld = {
|
||||
result.typeopdr_contract = oRs("mld_typeopdr_contract").Value;
|
||||
result.typeopdr_kosten_verplicht = oRs("mld_typeopdr_kosten_verplicht").Value || 0; // Opdracht kosten verplicht (bitwise) bij (0 = niet verplicht, 1 = save + 2 = afmelden, 4 = afronden).
|
||||
result.typeopdr_fvs = oRs("mld_typeopdr_fvs").Value;
|
||||
result.typeopdr_afronden = oRs("mld_typeopdr_afronden").Value;
|
||||
result.typeopdr_afronden = oRs("mld_typeopdr_afronden").Value;
|
||||
oRs.Close();
|
||||
}
|
||||
var uitvoerende_key = params.uitvoerende_key || -1;
|
||||
@@ -6006,6 +6057,7 @@ mld = {
|
||||
+ " AND o.mld_statusopdr_key IN (3, 4, 5, 8, 10)"
|
||||
var ooRs = Oracle.Execute(osql);
|
||||
lopende_offertes = ooRs("aantal").Value > 0;
|
||||
ooRs.Close();
|
||||
|
||||
// Laatste opdracht volgnummer van een melding ophalen. Om te checken of er na de offerteaanvraag nog een uitvoeringsopdracht is gekomen.
|
||||
var osql = "SELECT MAX (mld_opdr_bedrijfopdr_volgnr) lastopdrachtvolgnr"
|
||||
|
||||
@@ -30,50 +30,7 @@ function _set_actiecode(params, jsondata) {
|
||||
var result = {};
|
||||
_translate_for_api(params, jsondata);
|
||||
|
||||
var newActiecode = 0;
|
||||
if (mld_opdr.actiecode & 1 && this_opdr.myRole === 4 || params.notifyBO) { // Als de actie bij de BO staat, of als de BO genotificeerd gaat worden
|
||||
newActiecode += 128; // BO attentie
|
||||
}
|
||||
if (mld_opdr.actiecode & 4 && this_opdr.myRole !== 4 || params.notifyUITV) { // Als de actie bij de UITV staat, of als de UITV genotificeerd gaat worden
|
||||
newActiecode += 512; // UITV attentie
|
||||
}
|
||||
|
||||
if (S("mld_opdr_actiecode") > 0) // Doen we pingpong?
|
||||
{
|
||||
if (this_opdr.myRole === 4) { // Uitvoerder
|
||||
if ((params.action2BO && !(mld_opdr.actiecode & 1)) || (!params.has_action2BO && mld_opdr.actiecode & 1)) { // 'Actie' naar BO
|
||||
newActiecode += 1; // + BO
|
||||
} else {
|
||||
newActiecode += 4; // + UITV
|
||||
}
|
||||
} else { // if (this_opdr.myRole === 1 || this_opdr.myRole === 2), FE of FOBO
|
||||
// Een openstaande vraag is beantwoord, of de actie is bij de uitvoerder gezet, of de BO heeft de actie niet teruggepakt;
|
||||
if ((params.replyToAll || params.isResponse || params.action2UITV) || (mld_opdr.actiecode & 4 && !params.action2BO)) {
|
||||
newActiecode += 4; // + UITV
|
||||
} else {
|
||||
newActiecode += 1; // + BO
|
||||
}
|
||||
}
|
||||
} // if 'doen we opdracht ping pong'
|
||||
|
||||
{ // Opdracht actiecode
|
||||
var sql = "UPDATE mld_opdr"
|
||||
+ " SET mld_opdr_actiecode = " + newActiecode
|
||||
+ (this_opdr.myRole === 2
|
||||
? " , mld_opdr_laatstgezien = SYSDATE" // Als ik een FOBO ben, dan heb ik deze opdracht nu dus ook gezien
|
||||
: "")
|
||||
+ " WHERE mld_opdr_key = " + opdr_key;
|
||||
Oracle.Execute(sql);
|
||||
result.parent_reload = newActiecode != mld_opdr.actiecode;
|
||||
} // \Opdracht actiecode
|
||||
|
||||
if (newActiecode & 1 && !(mld_opdr.actiecode & 1)) { // Actie veranderd naar [B]O, dus ook ORDA2B
|
||||
shared.trackaction("ORDA2B", opdr_key);
|
||||
}
|
||||
|
||||
if (newActiecode & 4 && !(mld_opdr.actiecode & 4)) { // Actie veranderd naar [U]ITV, dus ook ORDA2U
|
||||
shared.trackaction("ORDA2U", opdr_key);
|
||||
}
|
||||
result = mld.setActiecode(mld_opdr, this_opdr, params);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user