Huidige scripts in de NVKH database en beschrijvingen.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
//exec last execution: Thu Nov 09 2023 14:00:49 GMT+0100 (Midden-Europese standaardtijd)
|
||||
|
||||
$me = Entity\This();
|
||||
|
||||
logAdd(log);
|
||||
|
||||
logAdd(log, 'info', 'Ophalen naberekeningsscript voor één jaar');
|
||||
$jaar_calc_script = configGet('script-bereken-nascholingstotaal-voor-jaar');
|
||||
|
||||
logAdd(log, 'info', 'Ophalen naberekeningsscript voor de jaren');
|
||||
$jaren_calc_script = configGet('script-bereken-nascholingstotalen');
|
||||
|
||||
logAdd(log, 'info', 'Leden ophalen bij dit script');
|
||||
$contacts = Entity\GetRelated($me, 'contacts', 1000, 'lidnummer', 'asc');
|
||||
$n = Array\Length($contacts);
|
||||
logAdd(log, 'info', $n, ' Leden');
|
||||
|
||||
$i = 0;
|
||||
while($i < $n,
|
||||
$contact = array\at($contacts, $i);
|
||||
$contact_id = Attr($contact, 'id');
|
||||
|
||||
logAdd(log, 'warning', 'Lid: ', Attr($contact, 'lidnummer'), ' - ', Attr($contact, 'name'));
|
||||
|
||||
logAdd(log, 'Ophalen nascholingstotalen');
|
||||
$nascholingstotalen = Entity\GetRelated($contact, 'nascholingstotalen', 1000, 'jaar', 'asc');
|
||||
logAdd(log, 'opgehaald');
|
||||
|
||||
$m = array\length($nascholingstotalen);
|
||||
logAdd(log, 'info', ' #nascholingstotalen: ', $m);
|
||||
$j = 0;
|
||||
while($j < $m,
|
||||
$nascholingstotaal = array\at($nascholingstotalen, $j);
|
||||
$year = Attr($nascholingstotaal, 'jaar');
|
||||
logAdd(log, 'info', ' Herberekenen jaar: ', $year);
|
||||
Exec($jaar_calc_script);
|
||||
$j = $j + 1;
|
||||
);
|
||||
|
||||
logAdd(log, 'info', 'Totalen herberekenen');
|
||||
Exec($jaren_calc_script);
|
||||
|
||||
$i = $i + 1;
|
||||
);
|
||||
Reference in New Issue
Block a user