BSSC#91004 E-mailnotificaties fiatteren ontbreken
svn path=/Website/branches/v2025.3/; revision=70653
This commit is contained in:
@@ -127,15 +127,20 @@ cnt = { setcontractstatus:
|
||||
// Tot welk bedrag is er al goedgekeurd.
|
||||
var sql = "SELECT cnt_contract_approved"
|
||||
+ " , cnt_contract_kosten"
|
||||
+ " , dp.cnt_disc_params_approve_new"
|
||||
+ " FROM cnt_contract c"
|
||||
+ " WHERE cnt_contract_key = " + cnt_key;
|
||||
+ " , cnt_disc_params dp"
|
||||
+ " WHERE cnt_contract_key = " + cnt_key
|
||||
+ " AND c.ins_discipline_key = dp.cnt_ins_discipline_key";
|
||||
var oRs = Oracle.Execute(sql);
|
||||
var kosten = oRs("cnt_contract_kosten").Value? oRs("cnt_contract_kosten").Value : 0;
|
||||
var approved = oRs("cnt_contract_approved").Value? oRs("cnt_contract_approved").Value : -1;
|
||||
var nieuwAltijdAccorderen = (oRs("cnt_disc_params_approve_new").Value == 1);
|
||||
oRs.Close();
|
||||
|
||||
var functie_code;
|
||||
if (kosten <= S("cnt_contract_limit1")) // Dit eerst testen i.v.m. Ter goedkeuring. Verder moet sowieso goedgekeurd worden.
|
||||
if (!kosten && nieuwAltijdAccorderen)
|
||||
functie_code = "WEB_CNTGO1";
|
||||
else if (kosten <= S("cnt_contract_limit1")) // Dit eerst testen i.v.m. Ter goedkeuring. Verder moet sowieso goedgekeurd worden.
|
||||
return []; // Het bedrag is lager als de eerste limiet. Het contract hoeft niet goed gekeurd te worden, dus een lege fiatteurs array teruggeven.
|
||||
else if ((S("cnt_approval_all") == 0 && approved <= S("cnt_contract_limit1")) || (S("cnt_approval_all") == 1 && kosten <= S("cnt_contract_limit2")))
|
||||
functie_code = "WEB_CNTGO1";
|
||||
@@ -1081,6 +1086,7 @@ cnt = { setcontractstatus:
|
||||
+ " , dp.cnt_disc_params_huurder"
|
||||
+ " , dp.cnt_disc_params_opties"
|
||||
+ " , dp.cnt_disc_params_ksverplicht"
|
||||
+ " , dp.cnt_disc_params_approve_new"
|
||||
+ " , cc.cnt_contract_mantel_key"
|
||||
+ " , mc.cnt_contract_nummer_intern mantelcontractnummer"
|
||||
+ " , mc.cnt_contract_omschrijving mantelomschrijving"
|
||||
@@ -1178,7 +1184,8 @@ cnt = { setcontractstatus:
|
||||
nnScope: oRs("nnScope").Value,
|
||||
isAbonnement: oRs("bes_disc_params_contract").Value == 1,
|
||||
magAutomatischVerlengen: oRs("cnt_disc_params_opties").Value == 1,
|
||||
openfinref: oRs("openfinref").Value > 0
|
||||
openfinref: oRs("openfinref").Value > 0,
|
||||
nieuwAltijdAccorderen: oRs("cnt_disc_params_approve_new").Value == 1
|
||||
};
|
||||
oRs.Close()
|
||||
|
||||
@@ -1248,7 +1255,8 @@ cnt = { setcontractstatus:
|
||||
|
||||
cresult.canGoedkeur1 = cresult.canWrite("WEB_CNTGO1") && // Heb ik de rechten om goed te keuren op dit niveau 1?
|
||||
terGoedkeuring && // Moet het contract gekeurd worden (juiste status)
|
||||
((S("cnt_approval_all") == 0 && cnt_info.kosten >= S("cnt_contract_limit1")) || // Zijn de kosten hoger als de limiet
|
||||
((!cnt_info.kosten && cnt_info.nieuwAltijdAccorderen) || // Zonder kosten toch accorderen?
|
||||
(S("cnt_approval_all") == 0 && cnt_info.kosten >= S("cnt_contract_limit1")) || // Zijn de kosten hoger als de limiet
|
||||
(S("cnt_approval_all") == 1 && cnt_info.kosten <= S("cnt_contract_limit2"))) && // Zijn de kosten onder mijn limiet om volledig goed te keuren
|
||||
cnt_info.approved <= S("cnt_contract_limit1"); // Welke goedkeur? 1, 2 of 3?
|
||||
cresult.canGoedkeur2 = cresult.canWrite("WEB_CNTGO2") &&
|
||||
|
||||
@@ -30,13 +30,11 @@ var isNew = (cnt_key < 0);
|
||||
|
||||
var sql = "SELECT cdp.cnt_srtcontract_type"
|
||||
+ " , cdp.cnt_disc_params_opties"
|
||||
+ " , cdp.cnt_disc_params_approve_new"
|
||||
+ " FROM cnt_disc_params cdp"
|
||||
+ " WHERE cdp.cnt_ins_discipline_key = " + cnt_disc_key;
|
||||
var oRs = Oracle.Execute(sql);
|
||||
var srtcontract_type = oRs("cnt_srtcontract_type").Value;
|
||||
var magAutomatischVerlengen = (oRs("cnt_disc_params_opties").Value & 1) == 1;
|
||||
var nieuwAltijdAccorderen = (oRs("cnt_disc_params_approve_new").Value == 1);
|
||||
var doapprove = S("cnt_contract_approval") == 1;
|
||||
oRs.Close();
|
||||
|
||||
@@ -71,14 +69,8 @@ else
|
||||
var authparams = user.checkAutorisation(autfunction);
|
||||
|
||||
// Als het approval mechanisme actief is dan altijd eerst naar status Nieuw(2),
|
||||
// Staat in het contractsoort dat een nieuw contract altijd geaccordeerd moet worden dan wordt de status "Ter goedkeuring" (3).
|
||||
// uitgezonderd de Mantel/Master contracten, die gaan altijd langs het goedkeuringsproces.
|
||||
var nieuw_cnt_status = 0;
|
||||
if (doapprove && srtcontract_type != 6)
|
||||
{
|
||||
nieuw_cnt_status = (nieuwAltijdAccorderen ? 3 : 2);
|
||||
}
|
||||
var cnt_info = { contract_status: nieuw_cnt_status };
|
||||
var cnt_info = { contract_status: (doapprove && srtcontract_type != 6? 2 : 0) }
|
||||
}
|
||||
|
||||
// Bestaat het contractnummer al?
|
||||
@@ -220,7 +212,6 @@ else
|
||||
}
|
||||
else
|
||||
// Zetten van de contact status. Indien het contract approval mechanisme actief is dan moet de contract status Nieuw(2) worden en anders Actief(0).
|
||||
// Staat in het contractsoort dat een nieuw contract altijd geaccordeerd moet worden dan wordt de status "Ter goedkeuring" (3).
|
||||
// Uitgezonderd de Mantel/Master contracten, die gaan altijd langs het goedkeuringsproces naar de status Actief(0).
|
||||
cnt.setcontractstatus(cnt_key, cnt_info.contract_status); // Zorgt ook voor tracking en daarmee notificatie.
|
||||
}
|
||||
|
||||
@@ -73,14 +73,14 @@ scaffolding(this_model,
|
||||
"icon": "fa-euro-sign",
|
||||
"fields": [
|
||||
"financialdata",
|
||||
"approvenew",
|
||||
"costtype",
|
||||
"costtypemandatory",
|
||||
"percentage",
|
||||
"margin",
|
||||
"approve",
|
||||
"invoicelimit",
|
||||
"schedule",
|
||||
"approvenew"
|
||||
"schedule"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user