Merge branch 'feature/budgetmonfin' into feature/labels

This commit is contained in:
2023-07-03 12:16:41 +02:00
15 changed files with 2482 additions and 639 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ $config['allow_get_array'] = TRUE;
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
$config['log_threshold'] = 1;
/*
|--------------------------------------------------------------------------
@@ -8,7 +8,6 @@ class Bestemmingen extends MY_Controller{
"monpas/Toewijzingen_model",
"monfin2/Finuitgavetypes_model",
"monfin2/Finbestemmingen_model",
"monfin2/Finsoorten_model",
"monfin2/Finsubsoorten_model");
$this->load->model($models);
@@ -23,7 +22,7 @@ class Bestemmingen extends MY_Controller{
$org = $this->Organisaties_model->get_record_by_id($this->globorgid);
$targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid);
$kalenderjaren = $this->Kalenderjaren_model->getkalenderjarenMetMax($targetjaar);
$kalenderjaren = $this->Kalenderjaren_model->getkalenderjaren();
if ($this->Autorisaties_model->check_autorisatie($this->userrole, WRITER) > 0 ) {$writer = true;}
@@ -52,12 +51,11 @@ class Bestemmingen extends MY_Controller{
function getBestemmingen(){
if($this->Autorisaties_model->check_autorisatie($this->userrole, READER) <=0) {
$jaartoewijzing =array();
$bestedingen = array();
$jaarclosed = TRUE;
}
else {
$orgid = $this->globorgid;
$jaarnr = $this->input->post('jaarnr');
$jaarnr = $this->clean_input('jaarnr');
$jaarclosed = FALSE;
$jaartoewijzing = $this->Toewijzingen_model->gettoewijzingperjaar($orgid, $jaarnr);
if ($jaartoewijzing){
@@ -72,7 +70,7 @@ class Bestemmingen extends MY_Controller{
}
$basisbestemmingen = $this->Finbestemmingen_model->get_bestemmingen($orgid,$jaarnr,"BASIS");
$extrabestemmingen = $this->Finbestemmingen_model->get_bestemmingen($orgid,$jaarnr,"EXTRA");
$opmerking = $this->Bestedingopmerkingen_model->getopmerking($orgid, $jaarnr);
};
@@ -89,11 +87,25 @@ class Bestemmingen extends MY_Controller{
$bestemmingID = $this->clean_input("id");
$targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid);
$bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true);
if ($targetjaar == $bestemmingjaar){
$this->Finbestemmingen_model->update_record(['bedrag'=>$this->input->post('bedrag')], $bestemmingID);
}
// if ($targetjaar >= $bestemmingjaar){
$this->Finbestemmingen_model->update_record(['bedrag'=>$this->clean_input('bedrag')], $bestemmingID);
// }
$record = $this->Finbestemmingen_model->get_record_by_id($bestemmingID);
json_encode(['record'=>$record]);
}
function updatebudget(){
// TODO check autorisatie
$bestemmingID = $this->clean_input("id");
$targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid);
$bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true);
// if ($targetjaar >= $bestemmingjaar) {
$this->Finbestemmingen_model->update_record(['budget' => $this->clean_input('budget')], $bestemmingID);
// }
}
function saveopmerking(){
// TODO check autorisatie
$orgid = $this->globorgid;
@@ -22,35 +22,56 @@ class Monfin2overzicht extends MY_Controller{
$kalenderjaarnr = $this->clean_input("jaarnr");
$uitgavetypes = $this->Finuitgavetypes_model->get_uitgavetypes();
$budgetten = $this->Toewijzingen_model->gettoewijzingperjaar($orgid, $kalenderjaarnr);
$totbudget = 0;
$totbesteed = 0;
$basis = array();
$extra = array();
$sompersoort = array();
$schooltot = 0;
$opmerking = '';
if ($budgetten){
// $totbudget = $budgetten->basis + $budgetten->extra ;
$budgetten->totaal = ROUND(($budgetten->basis + $budgetten->extra)/100);
$budgetten->basis = ROUND($budgetten->basis / 100);
$budgetten->extra = Round($budgetten->extra/ 100);
if ($budgetten) {
$budgetten->totaal = ROUND(($budgetten->basis + $budgetten->extra) / 100);
$budgetten->basis = ROUND($budgetten->basis / 100);
$budgetten->extra = Round($budgetten->extra / 100);
}
else{
$budgetten = new stdClass();
$budgetten->totaal = 0;
$budgetten->basis = 0;
$budgetten->extra = 0;
}
$basis = $this->Finbestemmingen_model->get_bestemmingen($orgid, $kalenderjaarnr,"BASIS");
$extra = $this->Finbestemmingen_model->get_bestemmingen($orgid, $kalenderjaarnr,"EXTRA");
$sombasisperuitgavetype = $this->get_som_per_uitgavetype($basis, $uitgavetypes);
$somextraperuitgavetype = $this->get_som_per_uitgavetype($extra, $uitgavetypes);
$totsomperuitgavetype = $this->sommeer_per_uitgavetype($sombasisperuitgavetype,$somextraperuitgavetype, $uitgavetypes);
$totbesteed = $this->sommeeralles($totsomperuitgavetype);
$basis = $this->get_som_regel($basis);
$extra = $this->get_som_regel($extra);
// todo
$totsomperuitgavetype = $this->sommeer_per_uitgavetype($sombasisperuitgavetype,$somextraperuitgavetype, $uitgavetypes);
$totbesteed = $this->sommeeralles($totsomperuitgavetype, 'BEDRAG');
$totgebudgeteerd = $this->sommeeralles($totsomperuitgavetype, 'BUDGET');
$sommen = $this->get_som_per_regel($basis, $budgetten->basis, $sombasisperuitgavetype[0]);
$basis = $sommen['soorten'];
$sombudgetpct = $sommen['sombudgetpct'];
$sombedragpct = $sommen['sombedragpct'];
$sommenex = $this->get_som_per_regel($extra, $budgetten->extra, $somextraperuitgavetype[0]);
$extra = $sommenex['soorten'];
$sombudgetpctex = $sommenex['sombudgetpct'];
$sombedragpctex = $sommenex['sombedragpct'];
// todo
// bereken budget - besteding verschil per basis/extra/overig
$budgetten->basisverschil = number_format($budgetten->basis - $sombasisperuitgavetype[3]->som, 0, ',' , '.' );
$budgetten->extraverschil = number_format($budgetten->extra - $somextraperuitgavetype[3]->som, 0, ',' , '.' );
$budgetten->totaalverschil = $budgetten->totaal - ($sombasisperuitgavetype[3]->som +$somextraperuitgavetype[3]->som);
// todo
$budgetten->basisverschil = number_format($budgetten->basis - $sombasisperuitgavetype[0]->som, 0, ',' , '.' );
$budgetten->extraverschil = number_format($budgetten->extra - $somextraperuitgavetype[0]->som, 0, ',' , '.' );
$budgetten->totaalverschil = $budgetten->totaal - ($sombasisperuitgavetype[0]->som +$somextraperuitgavetype[0]->som);
$budgetten->basisbudgetpct = number_format($sombudgetpct, 1,',', '.');
$budgetten->basisbedragpct = number_format($sombedragpct, 1,',', '.');
$budgetten->extrabudgetpct = number_format($sombudgetpctex, 1,',', '.');
$budgetten->extrabedragpct = number_format($sombedragpctex, 1,',', '.');
$bedrag = $budgetten->totaal > 0 ? ($totbesteed/$budgetten->totaal) *100: 0;
$budgetten->totbedragbudgetkaal = $bedrag;
$budgetten->totbedragbudgetpct = number_format($bedrag, 1, ',', '.');
$bedrag2 = $budgetten->totaal > 0 ?($totgebudgeteerd/$budgetten->totaal)*100 : 0;
$budgetten->totbudgetpct = number_format($bedrag2, 1, ',', '.');
// todo
// zorg dat alle getallen geformateerd zijn met een duizendtalscheidingsteken
$budgetten->totaal = number_format($budgetten->totaal, 0 , ',' , '.');
$budgetten->basis = number_format($budgetten->basis , 0 , ',' , '.');
@@ -58,34 +79,50 @@ class Monfin2overzicht extends MY_Controller{
foreach($sombasisperuitgavetype as $sompertype){
$sompertype->som = number_format($sompertype->som,0, ',' , '.' );
}
$sompertype->budgetsom = number_format($sompertype->budgetsom,0, ',' , '.' );
}
foreach($somextraperuitgavetype as $sompertype){
$sompertype->som = number_format($sompertype->som,0, ',' , '.' );
}
$sompertype->budgetsom = number_format($sompertype->budgetsom,0, ',' , '.' );
}
foreach($totsomperuitgavetype as $sompertype){
$sompertype->som = number_format($sompertype->som,0, ',' , '.' );
}
$sompertype->budgetsom = number_format($sompertype->budgetsom,0, ',' , '.' );
$schooltot = array( 'budget' => $budgetten->totaal ,
}
$schooltot = array( 'budget' => $budgetten->totaal ,
"bestemd" => number_format($totbesteed, 0, ',' , '.' ),
"gebudget" => number_format($totgebudgeteerd, 0, ',' , '.' ),
"verschil" => number_format($budgetten->totaalverschil, 0, ',' , '.' ));
$opmerking = $this->Bestedingopmerkingen_model->getopmerking($orgid, $kalenderjaarnr);
}; // if budgetten
// }; // if budgetten
if (! isset($sombasisperuitgavetype)) $sombasisperuitgavetype = 0;
if (! isset($somextraperuitgavetype)) $somextraperuitgavetype = 0;
if (! isset($totsomperuitgavetype)) $totsomperuitgavetype = 0;
if (! isset($schooltot)) $schooltot = 0;
echo json_encode(array('uitgavetypes' =>$uitgavetypes,
'basis' =>$basis,
'extra' =>$extra,
'sombasisperuitgavetype' =>$sombasisperuitgavetype,
'somextraperuitgavetype' =>$somextraperuitgavetype,
'totsomperuitgavetype' =>$totsomperuitgavetype,
'schooltotaal' => $schooltot,
'budgetten' => $budgetten,
'opmerking' => $opmerking));
'basis' =>$basis,
'extra' =>$extra,
'sombasisperuitgavetype' =>$sombasisperuitgavetype,
'somextraperuitgavetype' =>$somextraperuitgavetype,
'totsomperuitgavetype' =>$totsomperuitgavetype,
'schooltotaal' => $schooltot,
'budgetten' => $budgetten,
'opmerking' => $opmerking));
}
function getschoolbedragenNieuw(){
@@ -103,24 +140,24 @@ class Monfin2overzicht extends MY_Controller{
} else {
$budgetten = $this->Toewijzingen_model->gettoewijzingperjaar($orgid, $kalenderjaarnr);
}
$totbudget = 0;
$totbesteed = 0;
$basis = array();
$extra = array();
$sompersoort = array();
$schooltot = 0;
$opmerking = '';
if ($budgetten){
if ($soortoverzicht == 3){
$budgetten->totaal = ROUND(($budgetten->basis + $budgetten->extra));
$budgetten->basis = ROUND($budgetten->basis );
$budgetten->extra = ROUND($budgetten->extra);
} else {
$budgetten->totaal = ROUND(($budgetten->basis + $budgetten->extra)/100);
$budgetten->basis = ROUND($budgetten->basis / 100);
$budgetten->extra = ROUND($budgetten->extra/ 100);
}
if ($budgetten) {
if ($soortoverzicht == 3) {
$budgetten->totaal = ROUND(($budgetten->basis + $budgetten->extra));
$budgetten->basis = ROUND($budgetten->basis);
$budgetten->extra = ROUND($budgetten->extra);
} else {
$budgetten->totaal = ROUND(($budgetten->basis + $budgetten->extra) / 100);
$budgetten->basis = ROUND($budgetten->basis / 100);
$budgetten->extra = ROUND($budgetten->extra / 100);
}
if ($soortoverzicht == 3){
$basis = $this->Finbestemmingen_model->get_bestemmingen_over_orgs($orgid, $suborgslist, $kalenderjaarnr,"BASIS");
$extra = $this->Finbestemmingen_model->get_bestemmingen_over_orgs($orgid, $suborgslist, $kalenderjaarnr,"EXTRA");
@@ -132,15 +169,47 @@ class Monfin2overzicht extends MY_Controller{
$sombasisperuitgavetype = $this->get_som_per_uitgavetype($basis, $uitgavetypes);
$somextraperuitgavetype = $this->get_som_per_uitgavetype($extra, $uitgavetypes);
$totsomperuitgavetype = $this->sommeer_per_uitgavetype($sombasisperuitgavetype,$somextraperuitgavetype, $uitgavetypes);
$totbesteed = $this->sommeeralles($totsomperuitgavetype);
$basis = $this->get_som_regel($basis);
$extra = $this->get_som_regel($extra);
$totbesteed = $this->sommeeralles($totsomperuitgavetype, 'BEDRAG');
$totgebudgeteerd = $this->sommeeralles($totsomperuitgavetype, 'BUDGET');
$sommen = $this->get_som_per_regel($basis, $budgetten->basis, $sombasisperuitgavetype[0]);
$basis = $sommen['soorten'];
// $somgebudgetpct = $sommen['somgebudgetpct'];
$sombudgetpct = $sommen['sombudgetpct'];
$sombedragpct = $sommen['sombedragpct'];
// $sombedragbudgetpct = $sommen['sombedragbudgetpct'];
$sommenex = $this->get_som_per_regel($extra, $budgetten->extra, $somextraperuitgavetype[0] );
$extra = $sommenex['soorten'];
// $somgebudgetpctex = $sommenex['somgebudgetpct'];
$sombudgetpctex = $sommenex['sombudgetpct'];
$sombedragpctex = $sommenex['sombedragpct'];
// $sombedragbudgetpctex = $sommen['sombedragbudgetpct'];
// todo
// bereken budget - besteding verschil per basis/extra/overig
$budgetten->basisverschil = number_format($budgetten->basis - $sombasisperuitgavetype[3]->som, 0, ',' , '.' );
$budgetten->extraverschil = number_format($budgetten->extra - $somextraperuitgavetype[3]->som, 0, ',' , '.' );
$budgetten->totaalverschil = $budgetten->totaal - ($sombasisperuitgavetype[3]->som +$somextraperuitgavetype[3]->som);
// todo
$budgetten->basisbudgetpct = number_format($sombudgetpct, 2,',', '.');
// $budgetten->basisgebudgetpct = number_format($somgebudgetpct, 2,',', '.');
$budgetten->basisbedragpct = number_format($sombedragpct, 2,',', '.');
// $budgetten->basisbedragbudgetpct = number_format($sombedragbudgetpct, 2,',', '.');
$budgetten->extrabudgetpct = number_format($sombudgetpctex, 2,',', '.');
// $budgetten->extragebudgetpct = number_format($somgebudgetpctex, 2,',', '.');
$budgetten->extrabedragpct = number_format($sombedragpctex, 2,',', '.');
// $budgetten->extrabedragbudgetpct = number_format($sombedragbudgetpctex, 2,',', '.');
$bedrag = $budgetten->totaal > 0 ? ($totbesteed/$budgetten->totaal) *100: 0;
$budgetten->totbedragbudgetkaal = $bedrag;
$budgetten->totbedragbudgetpct = number_format($bedrag, 2, ',', '.');
$budgetten->totbedragpct = $totbesteed > 0 ? '100,00': 0;
$bedrag2 = $budgetten->totaal > 0 ?($totgebudgeteerd/$budgetten->totaal)*100 : 0;
$budgetten->totbudgetpct = number_format($bedrag2, 2, ',', '.');
// todo
// zorg dat alle getallen geformateerd zijn met een duizendtalscheidingsteken
$budgetten->totaal = number_format($budgetten->totaal, 0 , ',' , '.');
$budgetten->basis = number_format($budgetten->basis , 0 , ',' , '.');
@@ -148,16 +217,23 @@ class Monfin2overzicht extends MY_Controller{
foreach($sombasisperuitgavetype as $sompertype){
$sompertype->som = number_format($sompertype->som,0, ',' , '.' );
}
$sompertype->budgetsom = number_format($sompertype->budgetsom,0, ',' , '.' );
}
foreach($somextraperuitgavetype as $sompertype){
$sompertype->som = number_format($sompertype->som,0, ',' , '.' );
}
$sompertype->budgetsom = number_format($sompertype->budgetsom,0, ',' , '.' );
}
foreach($totsomperuitgavetype as $sompertype){
$sompertype->som = number_format($sompertype->som,0, ',' , '.' );
}
$sompertype->budgetsom = number_format($sompertype->budgetsom,0, ',' , '.' );
}
$schooltot = array( 'budget' => $budgetten->totaal ,
"bestemd" => number_format($totbesteed, 0, ',' , '.' ),
"gebudget" => number_format($totgebudgeteerd, 0, ',' , '.' ),
"verschil" => number_format($budgetten->totaalverschil, 0, ',' , '.' ));
if ($soortoverzicht == 3){
@@ -166,9 +242,9 @@ class Monfin2overzicht extends MY_Controller{
$opmerking = $this->Bestedingopmerkingen_model->getopmerking($orgid, $kalenderjaarnr);
}
}; // if budgetten
if (! isset($sombasisperuitgavetype)) $sombasisperuitgavetype = 0;
if (! isset($somextraperuitgavetype)) $somextraperuitgavetype = 0;
if (! isset($totsomperuitgavetype)) $totsomperuitgavetype = 0;
if (! isset($sombasisperuitgavetype)) $sombasisperuitgavetype = false;
if (! isset($somextraperuitgavetype)) $somextraperuitgavetype = false;
if (! isset($totsomperuitgavetype)) $totsomperuitgavetype = false;
if (! isset($schooltot)) $schooltot = 0;
echo json_encode(array('uitgavetypes' =>$uitgavetypes,
@@ -181,46 +257,86 @@ class Monfin2overzicht extends MY_Controller{
'budgetten' => $budgetten,
'opmerking' => $opmerking));
}
function sommeeralles($totsomperuitgavetype){
$totsom =0;
if ($totsomperuitgavetype){
foreach($totsomperuitgavetype as $som){
if ($som->code != "REGELSOM"){
$totsom += $som->som;
}
}
}
return $totsom;
}
function get_som_regel($soorten){
if ($soorten){
foreach($soorten as $soort){
if ($soort->subsoorten){
foreach ($soort->subsoorten as $subsoort){
$som = 0;
if ($subsoort->uitgavetypes){
foreach($subsoort->uitgavetypes as $uitgavetype){
if ($uitgavetype && $uitgavetype->bedrag){
$som += $uitgavetype->bedrag;
$uitgavetype->bedrag = number_format($uitgavetype->bedrag,0,',','.');
}
}
}
$subsoort->uitgavetypes[3]= new stdClass;
$subsoort->uitgavetypes[3]->bedrag =number_format($som,0, ',' , '.');
$subsoort->uitgavetypes[3]->code ='REGELSOM';
function sommeeralles($totsomperuitgavetype, $soort)
{
$totsom = 0;
if ($totsomperuitgavetype) {
foreach ($totsomperuitgavetype as $som) {
if ($som->code == 'TOTAAL') {
if ($soort == 'BUDGET') $totsom += $som->budgetsom;
else $totsom += $som->som;
}
}
return $totsom;
}
}
function get_som_per_regel($soorten, $budget, $uitgaven ){
$sombudgetpct = 0;
$sombedragpct = 0;
foreach($soorten ? : [] as $soort){
foreach ($soort->subsoorten ? : [] as $subsoort){
$budgetpct = 0;
$budgetpctformat = 0;
$bedragpct = 0;
$bedragpctformat = 0;
$personeel = empty($subsoort->uitgavetypes[1]->bedrag) ? 0 : floatval($subsoort->uitgavetypes[1]->bedrag);
$materieel = empty($subsoort->uitgavetypes[2]->bedrag) ? 0 : floatval($subsoort->uitgavetypes[2]->bedrag);
$scholing = empty($subsoort->uitgavetypes[3]->bedrag) ? 0 : floatval($subsoort->uitgavetypes[3]->bedrag);
$totaal = empty($subsoort->uitgavetypes[0]->bedrag) || floatval($subsoort->uitgavetypes[0]->bedrag) == 0 ? $personeel + $materieel + $scholing : floatval($subsoort->uitgavetypes[0]->bedrag);
$subsoort->uitgavetypes[0]->bedragform = $totaal == 0 ? '': number_format($totaal, 0, ',', '.');
$subsoort->uitgavetypes[0]->bedrag = $totaal == 0 ? '': number_format($totaal, 2, '.', '');
$subsoort->uitgavetypes[1]->bedragform = $personeel == 0 ? '': number_format($personeel, 0, ',', '.');
$subsoort->uitgavetypes[2]->bedragform = $materieel == 0 ? '': number_format($materieel, 0, ',', '.');
$subsoort->uitgavetypes[3]->bedragform = $scholing == 0 ? '': number_format($scholing, 0, ',', '.');
if(!empty($uitgaven->som && $uitgaven->som != 0)) {
$bedragpct = ($totaal / $uitgaven->som) * 100;
$bedragpctformat = number_format($bedragpct, 1, ',', '.');
}
$totbudget = empty($subsoort->uitgavetypes[0]->budget) ? 0 : floatval($subsoort->uitgavetypes[0]->budget);
$persbudget = empty($subsoort->uitgavetypes[1]->budget) ? 0 : floatval($subsoort->uitgavetypes[1]->budget);
$matbudget = empty($subsoort->uitgavetypes[2]->budget) ? 0 : floatval($subsoort->uitgavetypes[2]->budget);
$schoolbudget = empty($subsoort->uitgavetypes[3]->budget) ? 0 : floatval($subsoort->uitgavetypes[3]->budget);
$subsoort->uitgavetypes[0]->budgetform = $totbudget == 0 ? '': number_format($totbudget, 0, ',', '.');
$subsoort->uitgavetypes[1]->budgetform = $persbudget == 0 ? '': number_format($persbudget, 0, ',', '.');
$subsoort->uitgavetypes[2]->budgetform = $matbudget == 0 ? '': number_format($matbudget, 0, ',', '.');
$subsoort->uitgavetypes[3]->budgetform = $schoolbudget == 0 ? '': number_format($schoolbudget, 0, ',', '.');
if(! empty($subsoort->uitgavetypes[0]->budget) && ! empty($budget)) {
$budgetpct = ($totbudget/ $budget) * 100;
$budgetpctformat = number_format($budgetpct, 1, ',', '.');
}
$verschil = $totbudget - $totaal;
$subsoort->uitgavetypes[0]->verschilfloat = $verschil;
$subsoort->uitgavetypes[0]->verschil = $verschil == 0 ? '' : number_format($verschil, 0,',', '.');
$subsoort->uitgavetypes[0]->budgetpct = $budgetpct == 0 ? '' : $budgetpctformat;
$subsoort->uitgavetypes[0]->bedragpct = $bedragpct == 0 ? '' : $bedragpctformat;
$restant = $totbudget-$persbudget - $matbudget- $schoolbudget;
$subsoort->uitgavetypes[0]->budgetrestant = $restant == 0 ? '' : $restant;
$sombudgetpct =$sombudgetpct + $budgetpct;
$sombedragpct = $sombedragpct +$bedragpct;
}
}
}
}
return $soorten;
return [
'soorten' =>$soorten,
'sombudgetpct' => $sombudgetpct,
'sombedragpct' => $sombedragpct,
];
}
function sommeer_per_uitgavetype($sombasis,$somextra,$uitgavetypes){
$somtot = [];
$regelsom =0;
$regelsom2 = 0;
if ($uitgavetypes){
$index =0;
foreach($uitgavetypes as $uitgavetype){
@@ -228,65 +344,78 @@ class Monfin2overzicht extends MY_Controller{
$somtot[$index]->code = $uitgavetype->code;
$somtot[$index]->naam = $uitgavetype->naam;
$somtot[$index]->som =0;
$somtot[$index]->budgetsom =0;
foreach($sombasis as $basis){
if ($basis->code == $somtot[$index]->code) $somtot[$index]->som += $basis->som;
if ($basis->code == $somtot[$index]->code) {
$somtot[$index]->som += $basis->som;
$somtot[$index]->budgetsom += $basis->budgetsom;
}
}
foreach($somextra as $basis){
if ($basis->code == $somtot[$index]->code) $somtot[$index]->som += $basis->som;
if ($basis->code == $somtot[$index]->code) {
$somtot[$index]->som += $basis->som;
$somtot[$index]->budgetsom += $basis->budgetsom;
}
}
$regelsom += $somtot[$index]->som;
$regelsom2 += $somtot[$index]->budgetsom;
$index += 1;
}
$somtot[$index] = new stdClass;
$somtot[$index]->code = "REGELSOM";
$somtot[$index]->naam = "Som";
$somtot[$index]->som = $regelsom;
// $somtot[$index] = new stdClass;
// $somtot[$index]->code = "REGELSOM";
// $somtot[$index]->naam = "Som";
// $somtot[$index]->som = $regelsom;
// $somtot[$index]->budgetsom = $regelsom2;
}
return $somtot;
}
function get_som_per_uitgavetype($basis,$uitgavetypes){
$sombasis = [];
if ($uitgavetypes){
foreach($uitgavetypes as $uitgavetype){
$sombasis[$uitgavetype->code]= new stdClass;
$sombasis[$uitgavetype->code]->naam= $uitgavetype->naam;
$sombasis[$uitgavetype->code]->som=0;
}
if ($basis){
foreach($basis as $soort){
if ($soort->subsoorten){
foreach ($soort->subsoorten as $subsoort){
if ($subsoort->uitgavetypes){
foreach($subsoort->uitgavetypes as $uitgavetype) {
$sombasis[$uitgavetype->code]->som += $uitgavetype->bedrag;
} //foreach
}// if uitgavetypes
}//foreach subsoort
}//if subsoort
}//foreach basis
} // if basis
} // if uitgavetypes
$somasarray=[];
$index = 0;
$regelsom=0;
foreach($uitgavetypes as $uitgavetype){
$somasarray[$index ] = new stdClass;
$somasarray[$index]->code = $uitgavetype->code;
$somasarray[$index]->naam = $sombasis[$uitgavetype->code]->naam;
$somasarray[$index ]->som = round($sombasis[$uitgavetype->code]->som,0);
$regelsom += $somasarray[$index ]->som;
$index += 1;
};
$somasarray[$index] = new stdClass;
$somasarray[$index]->code ="REGELSOM";
$somasarray[$index]->naam = "Som";
$somasarray[$index]->som = $regelsom;
return $somasarray;
}
function get_som_per_uitgavetype($basis,$uitgavetypes){
$sombasis = [];
if ($uitgavetypes){
foreach($uitgavetypes as $uitgavetype) {
$sombasis[$uitgavetype->code] = new stdClass;
$sombasis[$uitgavetype->code]->naam = $uitgavetype->naam;
$sombasis[$uitgavetype->code]->som = 0;
$sombasis[$uitgavetype->code]->budgetsom = 0;
foreach ($basis ? $basis : [] as $soort) {
foreach ($soort->subsoorten ? $soort->subsoorten : [] as $subsoort) {
foreach ($subsoort->uitgavetypes ? $subsoort->uitgavetypes : [] as $kostenpost) {
if ($kostenpost->code == $uitgavetype->code) {
$sombasis[$uitgavetype->code]->som += floatval($kostenpost->bedrag);
$sombasis[$uitgavetype->code]->budgetsom += floatval($kostenpost->budget);
}
} //foreach
}//foreach subsoort
}//foreach basis
}
} // if uitgavetypes
$somasarray=[];
$index = 0;
$regelsom=0;
$regelsom2 = 0;
$regelsom3 = 0;
foreach($uitgavetypes as $uitgavetype){
$somasarray[$index ] = new stdClass;
$somasarray[$index]->code = $uitgavetype->code;
$somasarray[$index]->naam = $sombasis[$uitgavetype->code]->naam;
$somasarray[$index ]->som = round($sombasis[$uitgavetype->code]->som,0);
$somasarray[$index ]->budgetsom = round($sombasis[$uitgavetype->code]->budgetsom,0);
if($index != 0) {
$regelsom += $somasarray[$index]->som;
$regelsom2 += $somasarray[$index ]->budgetsom;
}
$index += 1;
};
$somasarray[0]->som = $regelsom;
$somasarray[0]->budgetrestant = $somasarray[0]->budgetsom - $regelsom2;
return $somasarray;
}
function getbestuursbedragen(){
$targetorgid = $this->clean_input('orgid');
@@ -466,16 +595,18 @@ class Monfin2overzicht extends MY_Controller{
$targetorgid = $this->clean_input('orgid');
$kalenderjaarnr = $this->clean_input("jaarnr");
$targetorg = $this->Organisaties_model->get_record_by_id($targetorgid);
list($targetorg->pms,$otherorgs) = $this->get_bestuur_pms($targetorgid, $kalenderjaarnr);
$sumother = $this->getsumotherpms($otherorgs);
$sumtot = $this->getsumtotpms($targetorg, $sumother);
list($targetorg->pms, $targetorg->bud, $targetorg->kleur, $otherorgs) = $this->get_bestuur_pms($targetorgid, $kalenderjaarnr);
$sumother = $this->getsumotherpms($otherorgs);
$sumtot = $this->getsumtotpms($targetorg, $sumother);
$targetorg->pms = $this->format_all_bedragen($targetorg->pms);
$sumother = $this->format_all_bedragen($sumother);
$sumtot = $this->format_all_bedragen($sumtot);
$targetorg->pms = $this->format_all_bedragen($targetorg->pms, 5);
$targetorg->bud = $this->format_all_bedragen($targetorg->bud, 5);
$sumother = $this->format_all_bedragen($sumother, 11);
$sumtot = $this->format_all_bedragen($sumtot, 11);
if ($otherorgs){
foreach($otherorgs as $otherorg){
$otherorg->pms = $this->format_all_bedragen($otherorg->pms);
$otherorg->pms = $this->format_all_bedragen($otherorg->pms, 5);
$otherorg->bud = $this->format_all_bedragen($otherorg->bud, 5);
}
}
@@ -484,63 +615,147 @@ class Monfin2overzicht extends MY_Controller{
'sumother' => $sumother,
'sumtot' => $sumtot]);
}
function format_all_bedragen($pms){
for ($i = 0 ; $i <=5; $i++){
function format_all_bedragen($pms, $lengte){
for ($i = 0 ; $i <=$lengte; $i++){
if ($pms[$i] >0 ) $pms[$i]=number_format($pms[$i], 0, ',' , '.');
else $pms[$i]='';
}
return $pms;
}
private function get_bestuur_pms($targetorgid, $kalenderjaarnr){
$pms = $this->Finbestemmingen_model->get_pms($targetorgid, $kalenderjaarnr);
$targetorg->pms[0] = 0;
$targetorg->pms[1] = 0;
$targetorg->pms[2] = 0;
$targetorg->pms[3] = 0;
$targetorg->pms[4] = 0;
$targetorg->pms[5] = 0;
if ($pms){
foreach($pms as $uitgave){
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype=="PERSONEEL") $targetorg->pms[0] += $uitgave->bedrag;
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype=="MATERIEEL") $targetorg->pms[1] += $uitgave->bedrag;
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype=="SCHOLING") $targetorg->pms[2] += $uitgave->bedrag;
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype=="PERSONEEL") $targetorg->pms[3] += $uitgave->bedrag;
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype=="MATERIEEL") $targetorg->pms[4] += $uitgave->bedrag;
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype=="SCHOLING") $targetorg->pms[5] += $uitgave->bedrag;
}
}
private function get_bestuur_pms($targetorgid, $kalenderjaarnr)
{
$pms = $this->Finbestemmingen_model->get_pms($targetorgid, $kalenderjaarnr);
$targetorg = new stdClass();
$targetorg->pms[0] = 0;
$targetorg->pms[1] = 0;
$targetorg->pms[2] = 0;
$targetorg->pms[3] = 0;
$targetorg->pms[4] = 0;
$targetorg->pms[5] = 0;
$targetorg->bud[0] = 0;
$targetorg->bud[1] = 0;
$targetorg->bud[2] = 0;
$targetorg->bud[3] = 0;
$targetorg->bud[4] = 0;
$targetorg->bud[5] = 0;
$targetorg->kleur[0] = 'black';
$targetorg->kleur[1] = 'black';
$targetorg->kleur[2] = 'black';;
$targetorg->kleur[3] = 'black';
$targetorg->kleur[4] = 'black';
$targetorg->kleur[5] = 'black';
if ($pms) {
foreach ($pms as $uitgave) {
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype == "PERSONEEL") {
$targetorg->pms[0] += $uitgave->bedrag;
$targetorg->bud[0] += $uitgave->budget;
$targetorg->pms[0] > $targetorg->bud[0] ? $targetorg->kleur[0] = 'red' : 'black';
}
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype == "MATERIEEL") {
$targetorg->pms[1] += $uitgave->bedrag;
$targetorg->bud[1] += $uitgave->budget;
$targetorg->pms[1] > $targetorg->bud[1] ? $targetorg->kleur[1] = 'red' : 'black';
}
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype == "SCHOLING") {
$targetorg->pms[2] += $uitgave->bedrag;
$targetorg->bud[2] += $uitgave->budget;
$targetorg->pms[2] > $targetorg->bud[2] ? $targetorg->kleur[2] = 'red' : 'black';
}
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype == "PERSONEEL") {
$targetorg->pms[3] += $uitgave->bedrag;
$targetorg->bud[3] += $uitgave->budget;
$targetorg->pms[3] > $targetorg->bud[3] ? $targetorg->kleur[3] = 'red' : 'black';
}
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype == "MATERIEEL") {
$targetorg->pms[4] += $uitgave->bedrag;
$targetorg->bud[4] += $uitgave->budget;
$targetorg->pms[4] > $targetorg->bud[4] ? $targetorg->kleur[4] = 'red' : 'black';
}
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype == "SCHOLING") {
$targetorg->pms[5] += $uitgave->bedrag;
$targetorg->bud[5] += $uitgave->budget;
$targetorg->pms[5] > $targetorg->bud[5] ? $targetorg->kleur[5] = 'red' : 'black';
}
}
}
$organisaties = $this->Organisaties_model->getorgs2($targetorgid);
$organisaties = $this->Organisaties_model->getorgs2($targetorgid);
if ($organisaties) {
foreach ($organisaties as $organisatie) {
$org_plus_subs = $this->getorgids($organisatie->orgid);
if (!$org_plus_subs) {
$org_plus_subs = $organisatie->orgid;
};
$pms = $this->Finbestemmingen_model->get_pms($org_plus_subs, $kalenderjaarnr);
$organisatie->pms[0] = 0;
$organisatie->pms[1] = 0;
$organisatie->pms[2] = 0;
$organisatie->pms[3] = 0;
$organisatie->pms[4] = 0;
$organisatie->pms[5] = 0;
$organisatie->bud[0] = 0;
$organisatie->bud[1] = 0;
$organisatie->bud[2] = 0;
$organisatie->bud[3] = 0;
$organisatie->bud[4] = 0;
$organisatie->bud[5] = 0;
$organisatie->kleur[0] = 'black';
$organisatie->kleur[1] = 'black';
$organisatie->kleur[2] = 'black';
$organisatie->kleur[3] = 'black';
$organisatie->kleur[4] = 'black';
$organisatie->kleur[5] = 'black';
if ($pms) {
foreach ($pms as $uitgave) {
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype == "PERSONEEL") {
$organisatie->pms[0] += $uitgave->bedrag;
$organisatie->bud[0] += $uitgave->budget;
}
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype == "MATERIEEL") {
$organisatie->pms[1] += $uitgave->bedrag;
$organisatie->bud[1] += $uitgave->budget;
}
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype == "SCHOLING") {
$organisatie->pms[2] += $uitgave->bedrag;
$organisatie->bud[2] += $uitgave->budget;
}
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype == "PERSONEEL") {
$organisatie->pms[3] += $uitgave->bedrag;
$organisatie->bud[3] += $uitgave->budget;
}
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype == "MATERIEEL") {
$organisatie->pms[4] += $uitgave->bedrag;
$organisatie->bud[4] += $uitgave->budget;
}
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype == "SCHOLING") {
$organisatie->pms[5] += $uitgave->bedrag;
$organisatie->bud[5] += $uitgave->budget;
}
}
if ($organisaties){
foreach($organisaties as $organisatie){
$org_plus_subs = $this->getorgids($organisatie->orgid);
if (! $org_plus_subs) {$org_plus_subs = $organisatie->orgid;};
$pms = $this->Finbestemmingen_model->get_pms($org_plus_subs, $kalenderjaarnr);
$organisatie->pms[0] = 0;
$organisatie->pms[1] = 0;
$organisatie->pms[2] = 0;
$organisatie->pms[3] = 0;
$organisatie->pms[4] = 0;
$organisatie->pms[5] = 0;
if ($pms){
foreach($pms as $uitgave){
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype=="PERSONEEL") $organisatie->pms[0] += $uitgave->bedrag;
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype=="MATERIEEL") $organisatie->pms[1] += $uitgave->bedrag;
if ($uitgave->categorie == "BASIS" && $uitgave->uitgavetype=="SCHOLING") $organisatie->pms[2] += $uitgave->bedrag;
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype=="PERSONEEL") $organisatie->pms[3] += $uitgave->bedrag;
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype=="MATERIEEL") $organisatie->pms[4] += $uitgave->bedrag;
if ($uitgave->categorie == "EXTRA" && $uitgave->uitgavetype=="SCHOLING") $organisatie->pms[5] += $uitgave->bedrag;
}
}
}
}; // if organisaties
return [$targetorg->pms , $organisaties];
}
}
if ($organisatie->pms[0] > $organisatie->bud[0]) $organisatie->kleur[0] = 'red';
if ($organisatie->pms[1] > $organisatie->bud[1]) $organisatie->kleur[1] = 'red';
if ($organisatie->pms[2] > $organisatie->bud[2]) $organisatie->kleur[2] = 'red';
if ($organisatie->pms[3] > $organisatie->bud[3]) $organisatie->kleur[3] = 'red';
if ($organisatie->pms[4] > $organisatie->bud[4]) $organisatie->kleur[4] = 'red';
if ($organisatie->pms[5] > $organisatie->bud[4]) $organisatie->kleur[5] = 'red';
}; // if organisaties
return [$targetorg->pms, $targetorg->bud, $targetorg->kleur, $organisaties];
}
}
function getsumtotpms($targetorg, $sumother){
$sumtot = [];
@@ -551,6 +766,18 @@ class Monfin2overzicht extends MY_Controller{
$sumtot[3] = $targetorg->pms[3] + $sumother[3];
$sumtot[4] = $targetorg->pms[4] + $sumother[4];
$sumtot[5] = $targetorg->pms[5] + $sumother[5];
$sumtot[6] = $targetorg->bud[0] + $sumother[6];
$sumtot[7] = $targetorg->bud[1] + $sumother[7];
$sumtot[8] = $targetorg->bud[2] + $sumother[8];
$sumtot[9] = $targetorg->bud[3] + $sumother[9];
$sumtot[10] = $targetorg->bud[4] + $sumother[10];
$sumtot[11] = $targetorg->bud[5] + $sumother[11];
$sumtot[12] = $sumtot[0] > $sumtot[6] ? 'red' : 'black';
$sumtot[13] = $sumtot[1] > $sumtot[7] ? 'red' : 'black';
$sumtot[14] = $sumtot[2] > $sumtot[8] ? 'red' : 'black';
$sumtot[15] = $sumtot[3] > $sumtot[9] ? 'red' : 'black';
$sumtot[16] = $sumtot[4] > $sumtot[10] ? 'red' : 'black';
$sumtot[17] = $sumtot[5] > $sumtot[11] ? 'red' : 'black';
return $sumtot;
}
@@ -563,16 +790,46 @@ class Monfin2overzicht extends MY_Controller{
$sumother[3] = 0;
$sumother[4] = 0;
$sumother[5] = 0;
$sumother[6] = 0;
$sumother[7] = 0;
$sumother[8] = 0;
$sumother[9] = 0;
$sumother[10] = 0;
$sumother[11] = 0;
$sumother[12] = 'black';
$sumother[13] = 'black';
$sumother[14] = 'black';
$sumother[15] = 'black';
$sumother[16] = 'black';
$sumother[17] = 'black';
foreach($otherorgs as $org){
if ($org->pms){
$sumother[0] += $org->pms[0];
$sumother[1] += $org->pms[1];
$sumother[2] += $org->pms[2];
$sumother[3] += $org->pms[3];
$sumother[4] += $org->pms[4];
$sumother[5] += $org->pms[5];
}
$sumother[6] += $org->bud[0];
$sumother[7] += $org->bud[1];
$sumother[8] += $org->bud[2];
$sumother[9] += $org->bud[3];
$sumother[10] += $org->bud[4];
$sumother[11] += $org->bud[5];
}
foreach($otherorgs as $org){
if ($org->pms){
if( $sumother[0] > $sumother[6]) $sumother[12] = 'red';
if( $sumother[1] > $sumother[7]) $sumother[13] = 'red';
if( $sumother[2] > $sumother[8]) $sumother[14] = 'red';
if( $sumother[3] > $sumother[9]) $sumother[15] = 'red';
if( $sumother[4] > $sumother[10]) $sumother[16] = 'red';
if( $sumother[5] > $sumother[11]) $sumother[17] = 'red';
}
}
return $sumother;
}
@@ -272,14 +272,11 @@ class Streefcijfers extends MY_Controller{
}
}
$orgversie = $this->Orgversies_model->getOrgVersie($this->globorgid, $module);
if($orgversie) {
$ambitie = $this->Ambities_model->mh_get_ambities($module, $this->globorgid, $orgversie->orgversieID);
if ($ambitie) $ambities = array_merge($ambities, $ambitie);
else {
$standaardSWVNodig = true;
}
$ambitie = $this->Ambities_model->mh_get_ambities($module, $this->globorgid, $this->globorgid);
if($ambitie) $ambities = array_merge($ambities,$ambitie);
else{
$standaardSWVNodig = true;
$orgversie = $this->Orgversies_model->getOrgVersie($this->globorgid, $module);
}
}
@@ -386,7 +383,6 @@ class Streefcijfers extends MY_Controller{
if (!$this->userid) die;
$orgversieid = $this->clean_input("orgversieid");
$id = false;
if($this->super == false) {
$result = $this->Autorisatienivos_model->checkmanage($this->userid, $this->globorgid);
+5 -1
View File
@@ -80,7 +80,11 @@ class MY_Controller extends CI_Controller{
// public $version = '1.18.08';// kleurenfout
// public $version = '1.19.00';// ambities per org
// public $version = '1.19.01';// compactdiv met orgid ipv globorg
public $version = '1.19.05';// ambities per org incl kamerversies
// public $version = '1.19.05';// ambities per org incl kamerversies
// public $version = '1.19.06';// monfin met budgetten
// public $version = '1.20.03';// monfin met budgetten
// public $version = '1.20.04';// monfin met budgetten update
public $version = '1.20.07';// monfin met budgetten update hogere kalenderjaren
public $partituurid;
public $globProfielVersieID = 1;
public $userid; //id of the user that is logged in
@@ -10,7 +10,9 @@ class Finbestemmingen_model extends MY_Model{
function __construct(){
parent::__construct();
$models = array('shared/Organisaties_model',
"monfin2/Finuitgavetypes_model");
"monfin2/Finuitgavetypes_model"
);
$this->load->model($models);
}
@@ -33,6 +35,9 @@ class Finbestemmingen_model extends MY_Model{
WHERE finsoort_id = {$soortID}";
return $this->get_query_result();
}
function get_overig_subsoorten($soortID,$orgID){
$this->sql = "SELECT id as subsoortID,
omschrijving as naam
@@ -56,13 +61,36 @@ class Finbestemmingen_model extends MY_Model{
foreach($soorten as $soort){
$soort->subsoorten = $this->get_subsoorten($soort->soortID);
if ($soort->subsoorten){
foreach($soort->subsoorten as $subsoort){
// haal per uitgavetypes de bedragen op
if ($uitgavetypes){
foreach($uitgavetypes as $uitgavetype){
$subsoort->uitgavetypes[] = $this->get_bedrag_per_type($orgID, $jaarnr,$subsoort->subsoortID,$uitgavetype->code);
}
}
foreach($soort->subsoorten as $index =>$subsoort){
// haal per uitgavetypes de bedragen op
if ($uitgavetypes) {
$restantbudget = 0;
foreach ($uitgavetypes as $uitgavetype) {
$subsoort->uitgavetypes[] = $this->get_bedrag_per_type($orgID, $jaarnr, $subsoort->subsoortID, $uitgavetype->code);
}
if (count($subsoort->uitgavetypes) > 0) {
$restantbudget = floatval(str_replace(',' , '' , $subsoort->uitgavetypes[0]->budget)) -
floatval(str_replace(',' , '' , $subsoort->uitgavetypes[1]->budget)) -
floatval(str_replace(',' , '' , $subsoort->uitgavetypes[2]->budget)) -
floatval(str_replace(',' , '' , $subsoort->uitgavetypes[3]->budget));
$restantbudget = number_format($restantbudget, 2);
}
$restant = new stdClass();
$restant->id = '0';
$restant->bedrag = '0.00';
$restant->budget = $restantbudget;
$restant->code = 'RESTANT';
$subsoort->uitgavetypes[] = $restant;
}
}
}// if subsoorten
}
@@ -87,7 +115,8 @@ class Finbestemmingen_model extends MY_Model{
// haal per uitgavetypes de bedragen op
if ($uitgavetypes){
foreach($uitgavetypes as $uitgavetype){
$subsoort->uitgavetypes[] = $this->get_bedrag_per_type_over_orgs($orglist, $jaarnr,$subsoort->subsoortID,$uitgavetype->code);
$result = $this->get_bedrag_per_type_over_orgs($orglist, $jaarnr,$subsoort->subsoortID,$uitgavetype->code);
$subsoort->uitgavetypes[] = $result;
}
}
}
@@ -121,19 +150,10 @@ class Finbestemmingen_model extends MY_Model{
// }// if subsoorten
// }
// }// if soorten
// return $soorten;
// return $soorten;
// }
function setSomSubsoort($orgid, $jaarnr, $categorie){
$this->sql = "SELECT FORMAT(SUM(bedrag) / 100,2) as totaal
FROM finbestemmingen B
JOIN finsubsoorten SUB ON B.subsoort_id = SUB.id
JOIN finsoorten S ON SUB.finsoort_id = S.id
WHERE B.organisatie_id = {$orgid}
AND B.kalenderjaar = {$jaarnr}
AND S.categorie = '{$categorie}' ";
return $this->get_query_row('totaal');
}
function getUitgavenPerSubsoortSchool($orgid, $jaarnr){
@@ -164,6 +184,7 @@ class Finbestemmingen_model extends MY_Model{
function get_bedrag_per_type($orgid, $jaarnr,$subsoortID, $uitgavetype){
$this->sql = "SELECT id,
FORMAT(bedrag / 100,2) as bedrag,
FORMAT(budget / 100,2) as budget,
uitgavetype as code
FROM finbestemmingen
WHERE organisatie_id = {$orgid}
@@ -176,27 +197,39 @@ class Finbestemmingen_model extends MY_Model{
"kalenderjaar" =>$jaarnr,
"subsoort_id" =>$subsoortID,
"uitgavetype" =>$uitgavetype,
"bedrag" =>0];
"bedrag" =>0,
"budget" =>0];
$this->insert_record($data);
$row = $this->get_query_row();
}
if ($row) $row->bedrag = str_replace(',' , '' , $row->bedrag);
if ($row) {
$row->bedrag = str_replace(',' , '' , $row->bedrag);
$row->budget = str_replace(',' , '' , $row->budget);
}
return $row;
}
function get_bedrag_per_type_over_orgs($orglist, $jaarnr,$subsoortID, $uitgavetype){
$this->sql = "SELECT id,
FORMAT(sum(bedrag) / 100,2) as bedrag,
FORMAT(sum(budget) / 100,2) as budget,
uitgavetype as code
FROM finbestemmingen
WHERE organisatie_id in ({$orglist})
AND kalenderjaar = {$jaarnr }
AND subsoort_id = {$subsoortID}
AND uitgavetype = '{$uitgavetype}' ";
$row= $this->get_query_row();
$row= $this->get_query_row();
if ($row) $row->bedrag = str_replace(',' , '' , $row->bedrag);
if ($row) $row->budget = str_replace(',' , '' , $row->budget);
return $row;
}
@@ -245,7 +278,8 @@ class Finbestemmingen_model extends MY_Model{
return $this->get_query_row('bedrag');
}
function get_pms($orgids, $kalenderjaarnr){
$this->sql = " SELECT round(sum(bedrag/100) ) AS bedrag,
$this->sql = " SELECT round(sum(FB.bedrag/100) ) AS bedrag,
round(sum(FB.budget/100)) AS budget,
uitgavetype,
FS.categorie,
FB.organisatie_id
@@ -48,7 +48,7 @@ class Licenties_model extends MY_Model{
JOIN tb_cluster C on C.id = M.cluster_id
WHERE O.id = {$orgid}
AND actief = 1
GROUP BY C.naam ";
GROUP BY C.id ";
return $this->get_query_result();
}
@@ -0,0 +1,120 @@
<div class="modal fade" id="modFindetails" role="dialog" >
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header" style="background-color: #968026; color:#FFFFFF ">
<h4>Uitsplitsing budget </h4>
</div>
<div class="modal-body">
<div data-bind="with: selectedSubsoort() ? selectedSubsoort() : '' ">
<p style="font-weight: bold" data-bind="text: naam "></p>
<br>
<table style="border 1px solid #ebebeb; font-size: small">
<tr style="background-color: #e0ce85">
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px;"
data-bind=" text: uitgavetypes[0].code "
>
</td>
<!-- ko if: naam != 'Basisondersteuning gebudgetteerd' && naam != 'Extra ondersteuning gebudgetteerd' && naam != 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[0].budget.replace(/\./g,'') ) || Number(uitgavetypes[0].budget) ==0 ? '' : uitgavetypes[0].budgetform "
>
</td>
<!-- /ko -->
<!-- ko if: naam == 'Basisondersteuning gebudgetteerd' || naam == 'Extra ondersteuning gebudgetteerd' || naam == 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[0].budgetsom.replace(/\./g,'') ) || Number(uitgavetypes[0].budgetsom) ==0 ? '' : uitgavetypes[0].budgetsom "
>
</td>
<!-- /ko -->
</tr>
<tr>
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; "
data-bind=" text: uitgavetypes[1].code "
>
</td>
<!-- ko if: naam != 'Basisondersteuning gebudgetteerd' && naam != 'Extra ondersteuning gebudgetteerd' && naam != 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[1].budget.replace(/\./g,'') ) || Number(uitgavetypes[1].budget) ==0 ? '' : uitgavetypes[1].budgetform "
>
</td>
<!-- /ko -->
<!-- ko if: naam == 'Basisondersteuning gebudgetteerd' || naam == 'Extra ondersteuning gebudgetteerd' || naam == 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[1].budgetsom.replace(/\./g,'') ) || Number(uitgavetypes[1].budgetsom) ==0 ? '' : uitgavetypes[1].budgetsom "
>
</td>
<!-- /ko -->
</tr>
<tr>
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; "
data-bind=" text: uitgavetypes[2].code "
>
</td>
<!-- ko if: naam != 'Basisondersteuning gebudgetteerd' && naam != 'Extra ondersteuning gebudgetteerd' && naam != 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[2].budget.replace(/\./g,'') ) || Number(uitgavetypes[2].budget) ==0 ? '' : uitgavetypes[2].budgetform "
>
</td>
<!-- /ko -->
<!-- ko if: naam == 'Basisondersteuning gebudgetteerd' || naam == 'Extra ondersteuning gebudgetteerd' || naam == 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[2].budgetsom.replace(/\./g,'') ) || Number(uitgavetypes[2].budgetsom) ==0 ? '' : uitgavetypes[2].budgetsom "
>
</td>
<!-- /ko -->
</tr>
<tr>
<tr>
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; "
data-bind=" text: uitgavetypes[3].code "
>
</td>
<!-- ko if: naam != 'Basisondersteuning gebudgetteerd' && naam != 'Extra ondersteuning gebudgetteerd' && naam != 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[3].budget.replace(/\./g,'') ) || Number(uitgavetypes[3].budget) ==0 ? '' : uitgavetypes[3].budgetform "
>
</td>
<!-- /ko -->
<!-- ko if: naam == 'Basisondersteuning gebudgetteerd' || naam == 'Extra ondersteuning gebudgetteerd' || naam == 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: isNaN(uitgavetypes[3].budgetsom.replace(/\./g,'') ) || Number(uitgavetypes[3].budgetsom) ==0 ? '' : uitgavetypes[3].budgetsom "
>
</td>
<!-- /ko -->
</tr>
<tr>
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; "
>restant
</td>
<!-- ko if: naam != 'Basisondersteuning gebudgetteerd' && naam != 'Extra ondersteuning gebudgetteerd' && naam != 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb;text-align: right "
data-bind=" text: isNaN(uitgavetypes[0].budget.replace(/\./g,'') ) || Number(uitgavetypes[0].budget) ==0 || uitgavetypes[0].budgetrestant == '0'? '' : uitgavetypes[0].budgetrestant "
>
</td>
<!-- /ko -->
<!-- ko if: naam == 'Basisondersteuning gebudgetteerd' || naam == 'Extra ondersteuning gebudgetteerd' || naam == 'Totaal gebudgetteerd' -->
<td style="text-transform: lowercase; border: 1px solid #ebebeb; border-top: 3px solid #ebebeb; width: 100px; text-align: right "
data-bind=" text: uitgavetypes[0].budgetrestant "
>
</td>
<!-- /ko -->
</tr>
</table>
</div>
</div>
<div class="modal-footer">
<button style="width: 80px;"
data-dismiss="modal">sluit
</button>
</div>
</div>
</div>
</div>
@@ -9,7 +9,7 @@
<span style="margin-right: 20px;"
data-bind="text: 'Dit jaar is financieel afgesloten', visible: jaarclosed()"><span>
</h4>
<div data-bind="visible: !jaartoewijzing()">
<div data-bind="visible: ! jaartoewijzing()">
<p>Er zijn nog geen budgetgegevens voor dit kalenderjaar</p>
</div>
</div>
@@ -23,105 +23,328 @@
Basisondersteuning
</h4>
<div data-bind="visible: basisgeopend()">
<table class="lstable" style="width : 100%; font-size:0.9em">
<colgroup>
<col style="width:40%">
<col span='3' style="width: 18%">
</colgroup>
<table class="lstable" style="width : 100%; font-size:0.9em; position: relative">
<thead style="position: sticky; top: 0" >
<tr>
<th style="width:29%"></th>
<th style="width:5%"></th>
<th style="width: 11%"></th>
<th style="width: 11%"></th>
<th style="width: 11%"></th>
<th style="width: 11%"></th>
<th style="width:11%"></th>
<th style="width:11%"></th>
</tr>
<tr class="blokheader" >
<th colspan="2" style="background-color: #968026; border: none; " >
</th>
<!-- ko foreach: uitgavetypes -->
<th style="text-align:right; padding-right: 5px; background-color: #968026;" data-bind="style: {'borderRight' : code == 'TOTAAL' ? '2px solid #ffffff' : 'none' } ">
<span data-bind="text: code == 'TOTAAL' ? code : code == 'SCHOLING' ? 'SUBTOTALEN' : ' ' "></span>
</th>
<!-- /ko -->
<th class="blokheader"
style="text-align: right;
padding-right: 5px;
padding-bottom: 5px;
background-color: #968026;
border-left: 2px solid #ffffff;
border-right: 2px solid #ffffff;">
<span >Restant
</span>
</th>
<th class="blokheader" style="text-align: right; padding-right:5px; padding-bottom: 5px; background-color: #968026;">
<span>Percentage</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting
">
</i>
</th>
</tr>
<tr class="blokheader2" style=" text-align:left; padding-left:5px; ">
<th colspan="2" style="background-color: #968026; border: none;">
</th>
<!-- ko foreach: $root.uitgavetypes -->
<th style="text-align:right; border-right: 2px solid #ffffff; background-color: #968026;padding-right: 5px;"
data-bind="style: {'borderTop' : code != 'TOTAAL' ? '2px solid #ffffff' : 'none', }">
<span data-bind="text: code != 'TOTAAL' ? code : ' ' ">
</span>
</th>
<!-- /ko -->
<th class="blokheader2" style="border-right: 2px solid #ffffff; border-top: none; background-color: #968026;">
</th>
<th class="blokheader2" style="background-color: #968026; border-top: none;">
</th>
</tr>
</thead>
<tbody data-bind="foreach: basissoorten">
<tr class="blokheader" style="text-align:left; padding-left:5px">
<td style="width: 40%" data-bind="text:naam"></td>
<!-- ko foreach: $root.uitgavetypes -->
<td style="text-align:right" data-bind="text:code"> </td>
<!-- /ko -->
</tr>
<!-- ko foreach:subsoorten -->
<tr>
<tr class="blokheader">
<td class="blokheader" colspan="8" data-bind="text: naam" style="text-align: left; border: 2px solid #ffffff"></td>
</tr>
<!-- ko foreach:subsoorten -->
<tr>
<td data-bind="text: naam"></td>
<td style="text-align: left; color: #008028 ">budget</td>
<!-- ko foreach: uitgavetypes() -->
<!-- ko if (code == $root.uitgavetypes()[$index()].code) -->
<td style="text-align: right">
<td style="text-align: right; padding-top: 1px; vertical-align: top ">
<!-- ko if : code != 'RESTANT' -->
<input class="decimal"
style="width: 200px;max-width:100%"
data-bind="textInput: formatted,event:{change:$root.fSaveBedrag} ,
enable: $root.targetjaar() == $root.selectedKalenderjaar().jaarnr && ! $root.jaarclosed()" />
</td>
<!-- /ko -->
<!-- /ko -->
</tr>
style="width: 145px; max-width: 98%; background-color: #e6ffee; font-size: 0.9em"
data-bind="textInput: budgetFormat,
event:{change:$root.fSaveBudget.bind($data, $parent.subsoortID, 'BASIS') } ,
enable: ! $root.jaarclosed() && (code == 'TOTAAL' || Number($parent.uitgavetypes()[0].budget()) > 0),
style : {'backgroundColor' : code == 'TOTAAL' ? '#e6ffee' : Number($parent.uitgavetypes()[0].budget()) > 0 ? '#e6ffee' : '#cccccc' } "
/>
<!-- /ko -->
<!-- ko if : code == 'RESTANT' -->
<span class="decimal"
style="width: 145px; max-width: 98%; font-size: 0.9em; color: #008028"
data-bind="text: budgetFormat" >
</span>
<!-- /ko -->
</td>
<!-- /ko -->
<td style="padding: 0; padding-top: 1px; vertical-align: top">
<div style="width: 98%;height: 24px;
font-size: 0.9em; font-family: sans-serif, verdana; padding-left: 2px; padding-top: 2px; color: #008028;
padding-bottom: 2px; margin: 0; text-align: right; padding-right: 3px;">
<span data-bind="text: budgetpctFormat() ,
visible: ! $root.jaarclosed() ">
</span>
</div>
</td>
</tr>
<tr >
<td ></td>
<td style="text-align: left; color:#003e80; ">uitgaven</td>
<!-- ko foreach: uitgavetypes() -->
<td style="text-align: right; padding-bottom: 10px;">
<!-- ko if: code != 'RESTANT' && code != 'TOTAAL'-->
<input class="decimal"
style="width: 145px; max-width:98%; background-color: #e6f2ff"
data-bind="textInput: bedragFormat,
style: { color : Number(budget()) < Number(bedrag()) ? '#ff0000' : '#000000' },
event: {change:$root.fSaveBedrag.bind($data, $parent.subsoortID, 'BASIS' )} ,
enable: ! $root.jaarclosed()" />
<!-- /ko -->
<!-- ko if: code == 'RESTANT' || code == 'TOTAAL'-->
<span class="decimal"
style="width: 145px; max-width:98%"
data-bind="text: bedragFormat,
style: { color : Number(budget()) < Number(bedrag()) ? '#ff0000' : '#000000',
fontSize : code == 'TOTAAL' ? 'small' : 'normal' },
">
</span>
<!-- /ko -->
</td>
<!-- /ko -->
<td style="padding: 0; vertical-align: top">
<div style="width: 98%;height: 24px; color:#003e80;
font-size: 0.9em; font-family: sans-serif, verdana; padding-left: 2px; padding-top: 2px;
padding-bottom: 2px; margin: 0; text-align: right; padding-right: 3px;">
<span data-bind="text: bedragpctFormat,
visible: ! $root.jaarclosed()">
</span>
</div>
</td>
</tr>
<!-- /ko -->
</tbody> <!-- FOREACH basissoorten -->
</table>
</div> <!-- visible basisgeopend -->
<p style="margin-bottom:0px; background-color:#f8f8f8; padding-left:10px; padding-top:10px;">
<span style="display:inline-block; width: 200px;" >Totaal basisondersteuning </span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: totaalbasis">
</div> <!-- visible basisgeopend -->
<p style="margin-bottom:0; background-color:#f8f8f8; padding-left:10px; padding-top:10px;">
<span style="display:inline-block; width: 250px; font-weight: bold" >Basisondersteuning </span>
<br>
<span style="display:inline-block; width: 250px;" >Uitgaven </span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: totaalbasis">
</span>
</p>
<p style="margin-top:0px; background-color:#f8f8f8; padding-left:10px; padding-bottom:10px; border-bottom:3px solid #dddddd">
<span style="display:inline-block; width: 200px" >Budget</span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: jaartoewijzing() ? jaartoewijzing().basis : '' ">
<span data-bind="text: totbasispct() == '0,0' ? '' : '(' + totbasispct() + '% van het totaalbudget)' ">
</span>
</p>
<br>
<span style="display:inline-block; width: 250px" >Gebudgeteerd per kostenpost</span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: gebudgetbasis ">
</span>
<span data-bind= "text: gebudgetbasispct()== '0,0' ? '' : '(' + gebudgetbasispct() + '% van het totaalbudget)' "></span>
<br>
<span style="display:inline-block; width: 250px" >Totaalbudget</span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: jaartoewijzing() ? jaartoewijzing().basis : '' ">
</span>
</p>
<!-- **************** extra ondersteuning *************** -->
<h4><button class="openbutton" data-bind="css: {closebutton: extrageopend()}, click: fToggle.bind($data,2)"></button>
Extra ondersteuning
</h4>
<div data-bind="visible: extrageopend()">
<table class="lstable" style="width : 100%; font-size:0.9em">
<colgroup>
<col style="width:40%">
<col span='3' style="width: 18%">
</colgroup>
<tbody data-bind="foreach: extrasoorten">
<tr class="blokheader" style="text-align:left; padding-left:5px">
<td style="width: 40%" data-bind="text:naam"></td>
<!-- ko foreach: $root.uitgavetypes -->
<td style="text-align:right" data-bind="text:code"> </td>
<!-- /ko -->
</tr>
<!-- ko foreach:subsoorten -->
<tr >
<td data-bind="text: naam"></td>
<!-- ko foreach: uitgavetypes() -->
<!-- ko if (code == $root.uitgavetypes()[$index()].code) -->
<td style="text-align: right">
<input class="decimal"
style="width: 200px;max-width:100%"
data-bind="textInput: formatted, event:{change:$root.fSaveBedrag} ,
enable: $root.targetjaar() == $root.selectedKalenderjaar().jaarnr && ! $root.jaarclosed()" />
</td>
<!-- /ko -->
<!-- /ko -->
<table class="lstable" style="width : 100%; font-size:0.9em; position: relative;">
<thead style="position: sticky; top: 100px;">
<tr>
<th style="width:29%"></th>
<th style="width:5%"></th>
<th style="width: 11%"></th>
<th style="width: 11%"></th>
<th style="width: 11%"></th>
<th style="width:11%"></th>
<th style="width:11%"></th>
<th style="width:11%"></th>
</tr>
<tr class="blokheader" style=" text-align:left; padding-left:5px; ">
<th colspan='2' style=" background-color: #968026; border: none ">
</th>
</tr>
<!-- /ko -->
</tbody> <!-- FOREACH extrasoorten -->
<!-- ko foreach: uitgavetypes -->
<th style="text-align:right; background-color: #968026; padding-right: 5px;" data-bind="style: {'borderRight' : code == 'TOTAAL' ? '2px solid #ffffff' : 'none' } ">
<span data-bind="text: code == 'TOTAAL' ? code : code == 'SCHOLING' ? 'SUBTOTALEN' : ' ' "></span>
</th>
<!-- /ko -->
<th class="blokheader"
style="text-align: right;
padding-right: 5px;
padding-bottom: 5px;
background-color: #968026;
border-left: 2px solid #ffffff;
border-right: 2px solid #ffffff;">
Restant
</th>
<th class="blokheader" style="text-align: right; padding-right:5px; padding-bottom: 5px; background-color: #968026">
<span >Percentage</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting">
</i>
</th>
</tr>
<tr class="blokheader2" style=" text-align:left; padding-left:5px; ">
<th colspan="2" style=" background-color: #968026; border: none;">
</th>
<!-- ko foreach: $root.uitgavetypes -->
<th style="text-align:right; border-right: 2px solid #ffffff; background-color: #968026; padding-right: 5px;"
data-bind="style: {'borderTop' : code != 'TOTAAL' ? '2px solid #ffffff' : 'none', }" >
<span data-bind="text: code != 'TOTAAL' ? code : ' ' "></span>
</th>
<!-- /ko -->
<th class="blokheader2" style="border-right: 2px solid #ffffff; background-color: background-color: #968026; border-top: none;">
</th>
<th class="blokheader2" style="background-color: background-color: #968026; border-top: none;">
</th>
</tr>
</thead>
<tbody data-bind="foreach: extrasoorten">
<tr class="blokheader">
<td class="blokheader" colspan="8" data-bind="text: naam" style="text-align: left; border: 2px solid #ffffff"></td>
</tr>
<!-- ko foreach:subsoorten -->
<tr>
<td data-bind="text: naam"></td>
<td style="text-align: left; color: #008028 ">budget</td>
<!-- ko foreach: uitgavetypes() -->
<td style="text-align: right; padding-top: 1px; vertical-align: top ">
<!-- ko if : code != 'RESTANT' -->
<input class="decimal"
style="width: 145px; max-width: 98%; background-color: #e6ffee"
data-bind="textInput: budgetFormat,
event:{change:$root.fSaveBudget.bind($data, $parent.subsoortID, 'EXTRA') } ,
enable: ! $root.jaarclosed()"
/>
<!-- /ko -->
<!-- ko if : code == 'RESTANT' -->
<span class="decimal"
data-bind="text: budget" >
</span>
<!-- /ko -->
</td>
<!-- /ko -->
<td style="padding: 0; padding-top: 1px; vertical-align: top">
<div style="width: 98%;height: 24px;
font-size: 0.9em; font-family: sans-serif, verdana; padding-left: 2px; padding-top: 2px;
padding-bottom: 2px; margin: 0; text-align: right; padding-right: 3px;">
<span data-bind="text: budgetpctFormat() ,
visible: ! $root.jaarclosed() ">
</span>
</div>
</td>
</tr>
<tr >
<td ></td>
<td style="text-align: left; color:#003e80; ">uitgaven</td>
<!-- ko foreach: uitgavetypes() -->
<td style="text-align: right; padding-top: 1px; vertical-align: top ">
<!-- ko if: code != 'RESTANT' && code != 'TOTAAL'-->
<input class="decimal"
style="width: 145px; max-width:98%; background-color: #e6f2ff"
data-bind="textInput: bedragFormat,
style: { color : Number(budget()) < Number(bedrag()) ? '#ff0000' : '#000000'},
event: {change:$root.fSaveBedrag.bind($data, $parent.subsoortID, 'BASIS' )} ,
enable: ! $root.jaarclosed()" />
<!-- /ko -->
<!-- ko if: code == 'RESTANT' || code == 'TOTAAL'-->
<span class="decimal"
data-bind="text: bedragFormat,
style: { color : Number(budget()) < Number(bedrag()) ? '#ff0000' : '#000000'}" >
</span>
<!-- /ko -->
</td>
<!-- /ko -->
<td style="padding: 0; vertical-align: top">
<div style="width: 98%;height: 24px;
font-size: 0.9em; font-family: sans-serif, verdana; padding-left: 2px; padding-top: 2px;
padding-bottom: 2px; margin: 0; text-align: right; padding-right: 3px;">
<span data-bind="text: bedragpctFormat,
visible: ! $root.jaarclosed()">
</span>
</div>
</td>
</tr>
<!-- /ko -->
</tbody>
<!-- FOREACH extrasoorten -->
</table>
</div> <!-- visible extrageopend -->
<p style="margin-bottom:0px; background-color:#f8f8f8; padding-left:10px; padding-top:10px;">
<span style="display:inline-block; width: 200px;" >Totaal extra ondersteuning </span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: totaalextra">
</div> <!-- visible extrageopend -->
<p style="margin-bottom:0; background-color:#f8f8f8; padding-left:10px; padding-top:10px;">
<span style="display:inline-block; width: 250px; font-weight: bold" >Extra ondersteuning </span>
<br>
<span style="display:inline-block; width: 250px;" >Uitgaven </span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: totaalextra">
</span>
</p>
<p style="margin-top:0px; background-color:#f8f8f8; padding-left:10px; padding-bottom:10px; border-bottom:3px solid #dddddd">
<span style="display:inline-block; width: 200px" >Budget</span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: jaartoewijzing() ? jaartoewijzing().extra : '' ">
<span data-bind="text: totextrapct() =='0,0' ? '' : '(' + totextrapct() + '% van het totaalbudget)'"></span>
<br>
<span style="display:inline-block; width: 250px" >Gebudgeteerd per kostenpost</span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: gebudgetextra() ">
</span>
<span data-bind="text: gebudgetextrapct() =='0,0' ? '' : '(' + gebudgetextrapct() + '% van het totaalbudget)' "></span>
<br>
<span style="display:inline-block; width: 250px" >Totaalbudget</span>
<span style="display:inline-block; width: 100px; text-align:right"
data-bind="text: jaartoewijzing() ? jaartoewijzing().extra : '' ">
</span>
</p>
<p style="margin-top:20px">Opmerkingen</p>
<textarea style="width:100%"
data-bind="textInput: opmerking, event:{input: fSaveOpmerking}"></textarea>
</div> <!-- als onderscheid tussen basis en extra is gemaakt bij budgetten, maar dat moet vanaf nu-->
</div> <!-- col sm 12 als jaartoewijzing-->
</div>
@@ -1,184 +1,753 @@
<div class="col-sm-12 mainpagina" id ="pagmonfinoverzicht2">
<div class="col-sm-3" style="padding:0px">
<table class="lstable" style="width:100%;">
<colgroup>
<col span='4' style="width: 18px">
<col style="width: 220px">
</colgroup>
<tbody data-bind="foreach: orgs">
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) ,
<div class="col-sm-3" style="padding:0px">
<table class="lstable" style="width:100%;">
<colgroup>
<col span='4' style="width: 18px">
<col style="width: 220px">
</colgroup>
<tbody data-bind="foreach: orgs">
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) ,
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }">
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 4 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) && $parent.geopend(),
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 4 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) && $parent.geopend(),
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }">
<td></td>
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 3 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<td></td>
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 3 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) && $parent.geopend() && $parents[1].geopend(),
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) && $parent.geopend() && $parents[1].geopend(),
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }">
<td></td>
<td></td>
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 2 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: ((typeof id !== 'undefined' && id > 0) && $parent.geopend()) && $parents[1].geopend() && $parents[2].geopend(),
<td></td>
<td></td>
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 2 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: ((typeof id !== 'undefined' && id > 0) && $parent.geopend()) && $parents[1].geopend() && $parents[2].geopend(),
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }" >
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan = 1 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
</tbody>
</table>
</div>
<div class="col-sm-9" >
<p data-bind= "visible: !selectedOrg() ">Selecteer eerst een organisatie</p>
<h4 style="margin-top:0px;"> Kalenderjaar
<select data-bind="options: kalenderjaren,
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan = 1 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
</tbody>
</table>
</div>
<div class="col-sm-9" >
<p data-bind= "visible: !selectedOrg() ">Selecteer eerst een organisatie</p>
<h4 style="margin-top:0px;"> Kalenderjaar
<select data-bind="options: kalenderjaren,
optionsText: 'naam',
value: selectedKalenderjaar,
event: {change: fGetBedragen}">
</select>
<button class="printer" style="float:right" data-bind="click: fMaakPDF"></button>
</h4>
<p>
<div style="float:right; margin-right: 40px" data-bind="visible: (selectedOrg() &&selectedOrg().soort !=4)">
<input type='radio'
name='zelfjn' value='1'
data-bind="checked: zelfjanee, click: fGetBedragen" /> details eigen org.
<!-- ko if : selectedOrg() && selectedOrg().soort != 4 -->
<input type='radio' name='zelfjn' value='3' data-bind="checked: zelfjanee, click: fGetBedragen" /> details sub-org.
<!-- /ko -->
<input type='radio' name='zelfjn' value='2' data-bind="checked: zelfjanee, click: fGetBedragen" /> pers.mat.scholing
<input type='radio' name='zelfjn' value='0' data-bind="checked: zelfjanee, click: fGetBedragen" /> sub-organisaties
</select>
<button class="printer" style="float:right" data-bind="click: fMaakPDF"></button>
</h4>
</div>
</p>
<div id="finoverzichtpage">
<div data-bind="visible: zelfjanee() == 1 || zelfjanee() == 3 ">
<table style="width:100%">
<tr class="blokheader">
<td style="width:23px"></td>
<td class="naam2"
style="width: 250px: padding-right:0px; padding-left:3px;text-align:left">Basisondersteuning</td>
<!-- ko foreach: uitgavetypes-->
<td style="text-align:right;width:91px;font-size:0.9em" data-bind="text: naam"></td>
<!-- /ko -->
<td style="text-align:right;width:90px">Som</td>
<td style="text-align:right;width:90px">Budget</td>
<td style="text-align:right;width:90px">Verschil</td>
</tr>
<tr style="background-color:#ded0d7">
<td class="glyphicon"
data-bind="css:{'glyphicon-chevron-right': !basisgeopend(), 'glyphicon-chevron-down': basisgeopend()},click: fToggle.bind($data,'BASIS')">
</td>
<td class="naam2" style="text-align:left;width:250px;">Totaal basis</td>
<!-- ko foreach: sombasisperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<td style="text-align:right" data-bind="text : $root.budgetten().basis"></td>
<td style="text-align:right" data-bind="text : $root.budgetten().basisverschil"></td>
</tr>
<tbody data-bind="foreach:basis">
<tr data-bind="visible: $root.basisgeopend()">
<p>
<div style="float:right; margin-right: 40px" data-bind="visible: (selectedOrg() &&selectedOrg().soort !=4)">
<input type='radio'
name='zelfjn' value='1'
data-bind="checked: zelfjanee, click: fGetBedragen" /> details eigen org.
<!-- ko if : selectedOrg() && selectedOrg().soort != 4 -->
<input type='radio' name='zelfjn' value='3' data-bind="checked: zelfjanee, click: fGetBedragen" /> details sub-org.
<!-- /ko -->
<input type='radio' name='zelfjn' value='2' data-bind="checked: zelfjanee, click: fGetBedragen" /> pers.mat.scholing
<input type='radio' name='zelfjn' value='0' data-bind="checked: zelfjanee, click: fGetBedragen" /> sub-organisaties
<td colspan='8' style="padding-left:0px; padding-right:0px;">
<table style="width:100%">
<tbody data-bind="foreach: subsoorten">
<tr style="border-bottom:1px solid #ebebeb">
<td data-bind="text:naam" class="naam" style="padding:0px; width: 283px" > </td> <!-- -->
<td data-bind="text: isNaN(uitgavetypes[0].bedrag.replace(/\./g,'') ) || uitgavetypes[0].bedrag ==0 ? '' : uitgavetypes[0].bedrag" style="text-align:right;width:98px"> </td>
<td data-bind="text: isNaN(uitgavetypes[1].bedrag.replace(/\./g,'') ) || uitgavetypes[1].bedrag ==0 ? '' : uitgavetypes[1].bedrag" style="text-align:right;width:91px"> </td>
<td data-bind="text: isNaN(uitgavetypes[2].bedrag.replace(/\./g,'') ) || uitgavetypes[2].bedrag ==0 ? '' : uitgavetypes[2].bedrag" style="text-align:right;width:91px"> </td>
<td data-bind="text: isNaN(uitgavetypes[3].bedrag.replace(/\./g,'') ) || uitgavetypes[3].bedrag ==0 ? '' : uitgavetypes[3].bedrag" style="text-align:right;width:91px"> </td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</div>
</p>
<div id="finoverzichtpage">
<div data-bind="visible: zelfjanee() == 1 || zelfjanee() == 3 ">
<table style=" font-size: 13px; width:100%">
<thead class="blokheader">
<tr class="blokheader">
<th style="background-color: #968026; width: 2%;"></th>
<th class="naam2"
style="padding: 3px; width: 22%; vertical-align:bottom; background-color: #968026;">Basisondersteuning
</th>
<!-- ko foreach: uitgavetypes-->
<th style="writing-mode: vertical-rl; padding: 3px; width: 9%; vertical-align:text-top; text-align: right; font-size:0.9em; background-color: #968026;" ><span data-bind="text: naam == 'Totaal' ? 'SOM UITGAVEN' : naam "></span>
<i class="fa fa-info-circle"
data-bind="click: $parent.fToelichting.bind($data, 'KOSTEN')">
</i>
</th>
<!--/ko -->
<th style="width: 9%; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top;text-align:right; background-color: #968026;"><span>som budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'BUDGET')">
</i>
</th>
<th style="text-align:right; background-color: #968026; width: 2%">
</th>
<th style="writing-mode: vertical-rl; padding: 3px; width: 9%; vertical-align:text-top; text-align:right; background-color: #968026;"><span>verschil</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'VERSCHIL')">
</i>
</th>
<th style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; width:9%; background-color: #968026; font-size: 12px;"><span>% uitgaven</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%UITGAVEN')">
</i>
</th>
<th style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; width:9%; background-color: #968026; font-size: 12px;"><span>% budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%BUDGET')">
</i>
</th>
</tr>
</thead>
<tbody >
<tr style="background-color:#ded0d7">
<td class="glyphicon"
data-bind="css:{'glyphicon-chevron-right': !basisgeopend(), 'glyphicon-chevron-down': basisgeopend()},click: fToggle.bind($data,'BASIS')">
</td>
<td class="naam2" style="text-align:left;">Totaal basis</td>
<!--ko if: sombasisperuitgavetype() -->
<!-- ko foreach: sombasisperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<!-- ko foreach: sombasisperuitgavetype()-->
<!-- ko if: $index() ==0 -->
<td style="text-align:right" data-bind="text: budgetsom"></td>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
<!--ko if: ! sombasisperuitgavetype() -->
<!-- ko foreach: uitgavetypes-->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td ><i class="fa fa-info-circle"
data-bind="visible: $root.schooltotaal().budget > 0,
click: $root.fOpenDetails.bind($data, 'BASIS') "
></i></td>
<td style="text-align:right"
data-bind="text : $root.budgetten() ?$root.budgetten().basisverschil : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().basisverschil) < 0 ? 'red' : 'black' } ">
</td>
<tr class="blokheader">
<td></td>
<td style="padding-right:0px; padding-left:3px;text-align:left">Extra ondersteuning</td>
<!-- ko foreach: uitgavetypes-->
<td style="text-align:right ;font-size:0.9em" data-bind="text: naam"></td>
<!-- /ko -->
<td style="text-align:right" >Som</td>
<td style="text-align:right">Budget</td>
<td style="text-align:right">Verschil</td>
</tr>
<tr style="background-color:#ded0d7">
<td class="glyphicon"
data-bind="css:{'glyphicon-chevron-right': !extrageopend(), 'glyphicon-chevron-down': extrageopend()},click: fToggle.bind($data,'EXTRA')"></td>
<td style="text-align:left;width:250px;">Totaal extra</td>
<!-- ko foreach: somextraperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<td style="text-align:right" data-bind="text : $root.budgetten().extra"></td>
<td style="text-align:right" data-bind="text : $root.budgetten().extraverschil"></td>
</tr>
<tbody data-bind="foreach:extra">
<tr data-bind="visible: $root.extrageopend()">
<td style="text-align:right" data-bind="text: $root.budgetten() ? $root.budgetten().basisbedragpct : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().basisverschil) < 0 ? 'red' : 'black' }">
</td>
<td style="text-align:right" data-bind="text : $root.budgetten() ?$root.budgetten().basisbudgetpct : '0,00' "></td>
</tr>
<!-- ko foreach: basis -->
<!-- ko if: $root.basisgeopend() -->
<!-- ko foreach: subsoorten -->
<tr style="border-bottom:1px solid #ebebeb">
<td></td>
<td data-bind="text:naam" class="naam" style="padding:0;" > </td>
<td data-bind="text: uitgavetypes[0].bedragform ,
style: {color: uitgavetypes[0].budget && Number(uitgavetypes[0].budgetform) < Number(uitgavetypes[0].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:98px ">
</td>
<td data-bind="text: uitgavetypes[1].bedragform,
style: {color: uitgavetypes[1].budget && Number(uitgavetypes[1].budgetform) < Number(uitgavetypes[1].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:91px ">
</td>
<td data-bind="text: uitgavetypes[2].bedragform,
style: {color: uitgavetypes[2].budget && Number(uitgavetypes[2].budgetform) <Number(uitgavetypes[2].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text: uitgavetypes[3].bedragform,
style: {color: uitgavetypes[3].budget && Number(uitgavetypes[3].budgetform) < Number(uitgavetypes[3].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text: uitgavetypes[0].budgetform"
style="text-align:right;width:91px"></td>
<td ><i class="fa fa-info-circle"
data-bind="visible: Number(uitgavetypes[0].budgetform)> 0,
click: $root.fOpenDetails.bind($data, 'DETAIL')">
</i>
</td>
<td data-bind="text: Number(uitgavetypes[0].verschilfloat) == 0 ? '' : uitgavetypes[0].verschil ,
style: {color: Number(uitgavetypes[0].verschilfloat)< 0 ? 'red': 'black'}"
style="text-align:right; ">
</td>
<td style="text-align:right;" data-bind="text: uitgavetypes[0].bedragpct,
style: {color: Number(uitgavetypes[0].verschil.form)< 0 ? 'red': 'black'}">
</td>
<td style="text-align:right;" data-bind="text: Number(uitgavetypes[0].budgetform) > 0 ? uitgavetypes[0].budgetpct : '' "></td>
</tr>
<!--/ko-->
<!--/ko-->
<!--/ko-->
</tbody>
<tbody class="blokheader">
<tr class="blokheader">
<td style="background-color: #968026;"></td>
<td class="naam2"
style="padding: 3px; vertical-align:bottom; background-color: #968026;">Extra ondersteuning</td>
<!-- ko foreach: uitgavetypes-->
<td style="writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; text-align: right; background-color: #968026;" >
<span data-bind="text: naam == 'Totaal' ? 'SOM UITGAVEN' : naam "></span>
<i class="fa fa-info-circle"
data-bind="click: $parent.fToelichting.bind($data, 'KOSTEN')">
</i>
</td>
<!-- /ko -->
<td style="writing-mode: vertical-rl; padding: 3px; vertical-align:text-top;text-align:right; background-color: #968026;">
<span>som budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'BUDGET')">
</i>
</td>
<td style="text-align:right; background-color: #968026;">
</td>
<td style="writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; text-align:right; background-color: #968026;">
<span>verschil</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'VERSCHIL')">
</i>
</td>
<td style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; background-color: #968026; font-size: 12px;">
<span>% uitgaven</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%UITGAVEN')">
</i>
</td>
<td style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; background-color: #968026; font-size: 12px;">
<span>% budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%BUDGET')">
</i>
</td>
</tr>
</tbody>
<tbody>
<tr style="background-color:#ded0d7">
<td class="glyphicon"
data-bind="css:{'glyphicon-chevron-right': !extrageopend(), 'glyphicon-chevron-down': extrageopend()},click: fToggle.bind($data,'EXTRA')">
</td>
<td class="naam2" style="text-align:left;">Totaal extra</td>
<!-- ko if: somextraperuitgavetype() -->
<!-- ko foreach: somextraperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<!-- ko foreach: somextraperuitgavetype()-->
<!-- ko if: $index() ==0 -->
<td style="text-align:right" data-bind="text: budgetsom"></td>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
<!-- ko if : ! somextraperuitgavetype() -->
<!-- ko foreach: uitgavetypes -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td><i class="fa fa-info-circle"
data-bind="visible: $root.schooltotaal().budget > 0,
click: $root.fOpenDetails.bind($data, 'EXTRA') "
></i>
</td>
<td style="text-align:right"
data-bind="text : $root.budgetten() ?$root.budgetten().extraverschil : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().extraverschil) < 0 ? 'red' : 'black' } ">
</td>
<td style="text-align:right" data-bind="text: $root.budgetten() ? $root.budgetten().extrabedragpct : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().extraverschil) < 0 ? 'red' : 'black' }">
</td>
<td style="text-align:right" data-bind="text : $root.budgetten() ?$root.budgetten().extrabudgetpct : '0,00' "></td>
</tr>
<!-- ko foreach: extra -->
<!-- ko if: $root.extrageopend() -->
<!-- ko foreach: subsoorten -->
<tr style="border-bottom:1px solid #ebebeb">
<td></td>
<td data-bind="text:naam" class="naam" style="padding:0;" > </td>
<td data-bind="text : uitgavetypes[0].bedragform,
style: {color: uitgavetypes[0].budget && Number(uitgavetypes[0].budgetform ) < Number(uitgavetypes[0].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:98px ">
</td>
<td data-bind="text: uitgavetypes[1].bedragform,
style: {color: uitgavetypes[1].budget && Number(uitgavetypes[1].budgetform) < Number(uitgavetypes[1].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:91px ">
</td>
<td data-bind="text: : uitgavetypes[2].bedragform,
style: {color: uitgavetypes[2].budget && Number(uitgavetypes[2].budgetform) <Number(uitgavetypes[2].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text:uitgavetypes[3].bedragform,
style: {color: uitgavetypes[3].budget && Number(uitgavetypes[3].budgeform) < Number(uitgavetypes[3].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text: uitgavetypes[0].budgetform" style="text-align:right;width:91px"></td>
<td ><i class="fa fa-info-circle"
data-bind="visible: Number(uitgavetypes[3].budgetform)> 0,
click: $root.fOpenDetails.bind($data, 'EXTRA')">
</i>
</td>
<td data-bind="text: Number(uitgavetypes[0].verschilfloat) == 0 ? uitgavetypes[0].verschil : ' ' ,
style: {color: Number(uitgavetypes[0].verschilfloat< 0 ? 'red': 'black'}"
style="text-align:right; ">
</td>
<td style="text-align:right;" data-bind="text: uitgavetypes[0].bedragpct,
style: {color: Number(uitgavetypes[0].verschilform)< 0 ? 'red': 'black'}">
</td>
<td style="text-align:right;" data-bind="text: Number(uitgavetypes[0].budgetform) > 0 ? uitgavetypes[0].budgetpct : '' "></td>
</tr>
<!--/ko-->
<!--/ko-->
<!--/ko-->
</tbody>
<tbody>
<tr style="background-color:#f8f8f8">
<td></td>
<td style="text-align:left">Totaal</td>
<!-- ko if: totsomperuitgavetype() -->
<!-- ko foreach: totsomperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<!-- /ko -->
<!-- ko if: ! totsomperuitgavetype() -->
<!-- ko foreach: uitgavetypes-->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" data-bind="text: $root.budgetten() ? $root.schooltotaal().budget : '0,00'">
</td>
<td ><i class="fa fa-info-circle"
data-bind="visible: $root.schooltotaal().budget > 0,
click: $root.fOpenDetails.bind($data, 'TOTAAL') ">
</i>
</td>
<td style="text-align:right"
data-bind="text: $root.schooltotaal() && $root.schooltotaal().verschil ? $root.schooltotaal().verschil : '0,00',
style : {color: $root.schooltotaal() && Number($root.schooltotaal().verschil) < 0 ? 'red' : 'black' }">
</td>
<td style="text-align:right"
data-bind="text: $root.budgetten() &&parseFloat($root.budgetten().totbedragbudgetkaal) > 0 ? $root.budgetten().totbedragbudgetpct : '0,00' ,
style: {color: parseFloat($root.budgetten().totbedragbudgetkaal) > 100 ? 'red' : 'black'}" >
</td>
<td style="text-align:right"
data-bind="text: $root.budgetten() ? $root.budgetten().totbudgetpct: '0,00' ">
</td>
</tr>
</tbody>
</table>
<div data-bind="visible: opmerking()" style="margin-top: 20px">
<p>Opmerkingen</p>
<p data-bind="text: opmerking"></p>
</div>
</div> <!-- visible -->
<div data-bind="visible: zelfjanee() == 0 && (selectedOrg() && selectedOrg().soort != 4) ">
<?php $this->load->view("monpas/pages/monfin2/overorgs.php"); ?>
</div>
<div data-bind="visible: zelfjanee() == 2 && (selectedOrg() && selectedOrg().soort != 4) ">
<?php $this->load->view("monpas/pages/monfin2/pmsorgs.php"); ?>
</div>
</div> <!-- holder voor pdf -->
</div> <!-- col sm 9 -->
<?php $this->load->view("monpas/modals/findetails_modal"); ?>
</div><div class="col-sm-12 mainpagina" id ="pagmonfinoverzicht2">
<div class="col-sm-3" style="padding:0px">
<table class="lstable" style="width:100%;">
<colgroup>
<col span='4' style="width: 18px">
<col style="width: 220px">
</colgroup>
<tbody data-bind="foreach: orgs">
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) ,
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }">
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 4 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) && $parent.geopend(),
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }">
<td></td>
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 3 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: (typeof id !== 'undefined' && id > 0) && $parent.geopend() && $parents[1].geopend(),
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }">
<td></td>
<td></td>
<td class="openbutton" data-bind="click: $root.fToggleOrg, css: { closebutton: geopend()}"></td>
<td colspan = 2 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- ko foreach: suborgs -->
<tr data-bind= "visible: ((typeof id !== 'undefined' && id > 0) && $parent.geopend()) && $parents[1].geopend() && $parents[2].geopend(),
css:{selected: ($root.selectedOrg() && id == $root.selectedOrg().id) }" >
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan = 1 data-bind="text: (typeof fnaam !== 'undefined') ? fnaam : '' , click: $root.fSetSelected"></td>
</tr>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
</tbody>
</table>
</div>
<div class="col-sm-9" >
<p data-bind= "visible: !selectedOrg() ">Selecteer eerst een organisatie</p>
<h4 style="margin-top:0px;"> Kalenderjaar
<select data-bind="options: kalenderjaren,
optionsText: 'naam',
value: selectedKalenderjaar,
event: {change: fGetBedragen}">
</select>
<button class="printer" style="float:right" data-bind="click: fMaakPDF"></button>
</h4>
<p>
<div style="float:right; margin-right: 40px" data-bind="visible: (selectedOrg() &&selectedOrg().soort !=4)">
<input type='radio'
name='zelfjn' value='1'
data-bind="checked: zelfjanee, click: fGetBedragen" /> details eigen org.
<!-- ko if : selectedOrg() && selectedOrg().soort != 4 -->
<input type='radio' name='zelfjn' value='3' data-bind="checked: zelfjanee, click: fGetBedragen" /> details sub-org.
<!-- /ko -->
<input type='radio' name='zelfjn' value='2' data-bind="checked: zelfjanee, click: fGetBedragen" /> pers.mat.scholing
<input type='radio' name='zelfjn' value='0' data-bind="checked: zelfjanee, click: fGetBedragen" /> sub-organisaties
</div>
</p>
<div id="finoverzichtpage">
<div data-bind="visible: zelfjanee() == 1 || zelfjanee() == 3 ">
<table style=" font-size: 13px; width:100%">
<thead class="blokheader">
<tr class="blokheader">
<th style="background-color: #968026; width: 2%;"></th>
<th class="naam2"
style="padding: 3px; width: 22%; vertical-align:bottom; background-color: #968026;">Basisondersteuning</th>
<!-- ko foreach: uitgavetypes-->
<th style="writing-mode: vertical-rl; padding: 3px; width: 8%; vertical-align:text-top; text-align: right; font-size:0.9em; background-color: #968026;" ><span data-bind="text: naam"></span>
<i class="fa fa-info-circle"
data-bind="click: $parent.fToelichting.bind($data, 'KOSTEN')">
</i>
</th>
<!-- /ko -->
<th style="writing-mode: vertical-rl; width: 8%; padding: 3px; vertical-align:text-top;text-align:right; background-color: #968026;"><span>som uitgaven</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'SOM')">
</i>
</th>
<th style="width: 8%; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top;text-align:right; background-color: #968026;"><span>som budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'BUDGET')">
</i>
</th>
<th style="text-align:right; background-color: #968026; width: 2%">
</th>
<th style="writing-mode: vertical-rl; padding: 3px; width: 8%; vertical-align:text-top; text-align:right; background-color: #968026;"><span>verschil</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'VERSCHIL')">
</i>
</th>
<th style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; width:8%; background-color: #968026; font-size: 12px;"><span>% uitgaven</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%UITGAVEN')">
</i>
</th>
<th style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; width:8%; background-color: #968026; font-size: 12px;"><span>% budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%BUDGET')">
</i>
</th>
</tr>
</thead>
<tbody >
<tr style="background-color:#ded0d7">
<td class="glyphicon"
data-bind="css:{'glyphicon-chevron-right': !basisgeopend(), 'glyphicon-chevron-down': basisgeopend()},click: fToggle.bind($data,'BASIS')">
</td>
<td class="naam2" style="text-align:left;">Totaal basis</td>
<!--ko if: sombasisperuitgavetype() -->
<!-- ko foreach: sombasisperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<!-- /ko -->
<!--ko if: ! sombasisperuitgavetype() -->
<!-- ko foreach: uitgavetypes -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" data-bind="text : $root.budgetten() ?$root.budgetten().basis : '0,00' "></td>
<td ><i class="fa fa-info-circle"
data-bind="visible: $root.schooltotaal().budget > 0,
click: $root.fOpenDetails.bind($data, 'BASIS') "
></i></td>
<td style="text-align:right"
data-bind="text : $root.budgetten() ?$root.budgetten().basisverschil : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().basisverschil) < 0 ? 'red' : 'black' } ">
</td>
<td style="text-align:right" data-bind="text: $root.budgetten() ? $root.budgetten().basisbedragpct : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().basisverschil) < 0 ? 'red' : 'black' }">
</td>
<td style="text-align:right" data-bind="text : $root.budgetten() ?$root.budgetten().basisbudgetpct : '0,00' "></td>
</tr>
<!-- ko foreach: basis -->
<!-- ko if: $root.basisgeopend() -->
<!-- ko foreach: subsoorten -->
<tr style="border-bottom:1px solid #ebebeb">
<td></td>
<td data-bind="text:naam" class="naam" style="padding:0;" > </td>
<td data-bind="text: uitgavetypes[0].bedragformat,
style: {color: uitgavetypes[0].budget && Number(uitgavetypes[0].budgetform) ) < Number(uitgavetypes[0].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:98px ">
</td>
<td data-bind="text: uitgavetypes[1].bedragformat,
style: {color: uitgavetypes[1].budget && Number(uitgavetypes[1].budgetform) < Number(uitgavetypes[1].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:91px ">
</td>
<td data-bind="text: uitgavetypes[2].bedragformat,
style: {color: uitgavetypes[2].budget && Number(uitgavetypes[2].budgetform) <Number(uitgavetypes[2].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text: uitgavetypes[3].bedragformat,
style: {color: uitgavetypes[3].budget && Number(uitgavetypes[3].budgetform) < Number(uitgavetypes[3].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text: uitgavetypes[3].budgetformat" style="text-align:right;width:91px"></td>
<td ><i class="fa fa-info-circle"
data-bind="visible: Number(uitgavetypes[3].budgetform)> 0,
click: $root.fOpenDetails.bind($data, 'DETAIL')">
</i>
</td>
<td data-bind="text: uitgavetypes[3].verschilformat ,
style: {color: Number(uitgavetypes[3].verschil.format)< 0 ? 'red': 'black'}"
style="text-align:right; ">
</td>
<td style="text-align:right;" data-bind="text: uitgavetypes[3].bedragpct,
style: {color: Number(uitgavetypes[3].verschilformat)< 0 ? 'red': 'black'}">
</td>
<td style="text-align:right;" data-bind="text: uitgavetypes[3].budgetpct "></td>
</tr>
<!--/ko-->
<!--/ko-->
<!--/ko-->
</tbody>
<tbody class="blokheader">
<tr class="blokheader">
<td style="background-color: #968026;"></td>
<td class="naam2"
style="padding: 3px; vertical-align:bottom; background-color: #968026;">Extra ondersteuning</td>
<!-- ko foreach: uitgavetypes-->
<td style="writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; text-align: right; background-color: #968026;" >
<span data-bind="text: naam"></span>
<i class="fa fa-info-circle"
data-bind="click: $parent.fToelichting.bind($data, 'KOSTEN')">
</i>
</td>
<!-- /ko -->
<td style="writing-mode: vertical-rl; padding: 3px; vertical-align:text-top;text-align:right; background-color: #968026;">
<span>som</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'SOM')">
</i>
</td>
<td style="writing-mode: vertical-rl; padding: 3px; vertical-align:text-top;text-align:right; background-color: #968026;">
<span>Budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'BUDGET')">
</i>
</td>
<td style="text-align:right; background-color: #968026;">
</td>
<td style="writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; text-align:right; background-color: #968026;">
<span>Verschil</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, 'VERSCHIL')">
</i>
</td>
<td style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; background-color: #968026; font-size: 12px;">
<span>% uitgaven</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%UITGAVEN')">
</i>
</td>
<td style="text-align:right; writing-mode: vertical-rl; padding: 3px; vertical-align:text-top; background-color: #968026; font-size: 12px;">
<span>% budget</span>
<i class="fa fa-info-circle"
data-bind="click: fToelichting.bind($data, '%BUDGET')">
</i>
</td>
</tr>
</tbody>
<tbody>
<tr style="background-color:#ded0d7">
<td class="glyphicon"
data-bind="css:{'glyphicon-chevron-right': !extrageopend(), 'glyphicon-chevron-down': extrageopend()},click: fToggle.bind($data,'EXTRA')">
</td>
<td class="naam2" style="text-align:left;">Totaal extra</td>
<!-- ko if: somextraperuitgavetype() -->
<!-- ko foreach: somextraperuitgavetype() -->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<!-- /ko -->
<!-- ko if : ! somextraperuitgavetype() -->
<!-- ko foreach: uitgavetypes() -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" data-bind="text : $root.budgetten() ? $root.budgetten().extra : '0,00' "></td>
<td
><i class="fa fa-info-circle"
data-bind="visible: $root.schooltotaal().budget > 0,
click: $root.fOpenDetails.bind($data, 'EXTRA') "
></i>
</td>
<td style="text-align:right"
data-bind="text : $root.budgetten() ?$root.budgetten().extraverschil : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().extraverschil) < 0 ? 'red' : 'black' } ">
</td>
<td style="text-align:right" data-bind="text: $root.budgetten() ? $root.budgetten().extrabedragpct : '0,00',
style : {color: $root.budgetten() && Number($root.budgetten().extraverschil) < 0 ? 'red' : 'black' }">
</td>
<td style="text-align:right" data-bind="text : $root.budgetten() ?$root.budgetten().extrabudgetpct : '0,00' "></td>
</tr>
<!-- ko foreach: extra -->
<!-- ko if: $root.extrageopend() -->
<!-- ko foreach: subsoorten -->
<tr style="border-bottom:1px solid #ebebeb">
<td></td>
<td data-bind="text:naam" class="naam" style="padding:0;" > </td>
<td data-bind="text: uitgavetypes[0].bedragformat,
style: {color: uitgavetypes[0].budget && Number(uitgavetypes[0].budgetform ) < Number(uitgavetypes[0].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:98px ">
</td>
<td data-bind="text: uitgavetypes[1].bedragformat,
style: {color: uitgavetypes[1].budget && Number(uitgavetypes[1].budgetform) < Number(uitgavetypes[1].bedragform) ? 'red' : 'black' }"
style="text-align:right; width:91px ">
</td>
<td data-bind="text: i uitgavetypes[2].bedragformat,
style: {color: uitgavetypes[2].budget && Number(uitgavetypes[2].budgetform) <Number(uitgavetypes[2].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text: uitgavetypes[3].bedragformat,
style: {color: uitgavetypes[3].budget && Number(uitgavetypes[3].budgetform) < Number(uitgavetypes[3].bedragform) ? 'red' : 'black' }"
style="text-align:right;width:91px">
</td>
<td data-bind="text: uitgavetypes[3].budgetformat " style="text-align:right;width:91px"></td>
<td ><i class="fa fa-info-circle"
data-bind="visible: Number(uitgavetypes[3].budget.form))> 0,
click: $root.fOpenDetails.bind($data, 'EXTRA')">
</i>
</td>
<td data-bind="text: uitgavetypes[3].verschilformat ,
style: {color: Number(uitgavetypes[3].verschilform)< 0 ? 'red': 'black'}"
style="text-align:right; ">
</td>
<td style="text-align:right;" data-bind="text: uitgavetypes[3].bedragpct,
style: {color: Number(uitgavetypes[3].verschil.form)< 0 ? 'red': 'black'}">
</td>
<td style="text-align:right;" data-bind="text: uitgavetypes[3].budgetpct"></td>
</tr>
<!--/ko-->
<!--/ko-->
<!--/ko-->
</tbody>
<tbody>
<tr style="background-color:#f8f8f8">
<td></td>
<td style="text-align:left">Totaal</td>
<!-- ko if: totsomperuitgavetype() -->
<!-- ko foreach: totsomperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<!-- /ko -->
<!-- ko if: ! totsomperuitgavetype() -->
<!-- ko foreach: uitgavetypes-->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" >0,00</td>
<!-- /ko -->
<td style="text-align:right" data-bind="text: $root.budgetten() ? $root.schooltotaal().budget : '0,00'">
</td>
<td ><i class="fa fa-info-circle"
data-bind="visible: $root.schooltotaal().budget > 0,
click: $root.fOpenDetails.bind($data, 'TOTAAL') ">
</i>
</td>
<td style="text-align:right"
data-bind="text: $root.schooltotaal() && $root.schooltotaal().verschil ? $root.schooltotaal().verschil : '0,00',
style : {color: $root.schooltotaal() && Number($root.schooltotaal().verschil) < 0 ? 'red' : 'black' }">
</td>
<td style="text-align:right"
data-bind="text: $root.budgetten() &&parseFloat($root.budgetten().totbedragbudgetkaal) > 0 ? $root.budgetten().totbedragbudgetpct : '0,00' ,
style: {color: parseFloat($root.budgetten().totbedragbudgetkaal) > 100 ? 'red' : 'black'}" >
</td>
<td style="text-align:right"
data-bind="text: $root.budgetten() ? $root.budgetten().totbudgetpct: '0,00' ">
</td>
</tr>
</tbody>
</table>
<div data-bind="visible: opmerking()" style="margin-top: 20px">
<p>Opmerkingen</p>
<p data-bind="text: opmerking"></p>
</div>
</div> <!-- visible -->
<div data-bind="visible: zelfjanee() == 0 && (selectedOrg() && selectedOrg().soort != 4) ">
<?php $this->load->view("monpas/pages/monfin2/overorgs.php"); ?>
</div>
<div data-bind="visible: zelfjanee() == 2 && (selectedOrg() && selectedOrg().soort != 4) ">
<?php $this->load->view("monpas/pages/monfin2/pmsorgs.php"); ?>
</div>
</div> <!-- holder voor pdf -->
</div> <!-- col sm 9 -->
<?php $this->load->view("monpas/modals/findetails_modal"); ?>
<td colspan='8' style="padding-left:0px; padding-right:0px;">
<table style="width:100%">
<tbody data-bind="foreach: subsoorten">
<tr style="border-bottom:1px solid #ebebeb">
<td data-bind="text:naam" style="padding:0px;width:281px"> </td>
<td style="text-align:right;width:91px" data-bind="text: isNaN(uitgavetypes[0].bedrag.replace(/\./g,'')) || uitgavetypes[0].bedrag ==0 ? '' : uitgavetypes[0].bedrag"> </td>
<td style="text-align:right;width:91px" data-bind="text: isNaN(uitgavetypes[1].bedrag.replace(/\./g,'')) || uitgavetypes[1].bedrag ==0 ? '' : uitgavetypes[1].bedrag"> </td>
<td style="text-align:right;width:91px" data-bind="text: isNaN(uitgavetypes[2].bedrag.replace(/\./g,'')) || uitgavetypes[2].bedrag ==0 ? '' : uitgavetypes[2].bedrag"> </td>
<td style="text-align:right;width:91px" data-bind="text: isNaN(uitgavetypes[3].bedrag.replace(/\./g,'')) || uitgavetypes[3].bedrag ==0 ? '' : uitgavetypes[3].bedrag"> </td>
<td style="text-align:right;width:90px"></td>
<td style="text-align:right;width:90px"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
<tr style="background-color:#f8f8f8">
<td></td>
<td style="text-align:left">Totaal besteed</td>
<!-- ko foreach: totsomperuitgavetype-->
<td style="text-align:right" data-bind="text: som"></td>
<!-- /ko -->
<td style="text-align:right" data-bind="text: $root.schooltotaal().budget"></td>
<td style="text-align:right" data-bind="text: $root.schooltotaal().verschil"></td>
</tr>
</table>
<div data-bind="visible: opmerking()" style="margin-top: 20px">
<p>Opmerkingen</p>
<p data-bind="text: opmerking"></p>
</div>
</div> <!-- visible -->
<div data-bind="visible: zelfjanee() == 0 && (selectedOrg() && selectedOrg().soort != 4) ">
<?php $this->load->view("monpas/pages/monfin2/overorgs.php"); ?>
</div>
<div data-bind="visible: zelfjanee() == 2 && (selectedOrg() && selectedOrg().soort != 4) ">
<?php $this->load->view("monpas/pages/monfin2/pmsorgs.php"); ?>
</div>
</div> <!-- holder voor pdf -->
</div> <!-- col sm 9 -->
</div>
@@ -1,61 +1,175 @@
<table style="width:100%">
<thead>
<thead>
<tr>
<th style="width:25%"></th>
<th style="width:9%;"></th>
<th style="width:11%;" ></th>
<th style="width:11%; "></th>
<th style="width:11%; "></th>
<th style="width:11%; "></th>
<th style="width:11%; "></th>
<th style="width:11%; "></th>
</tr>
</thead>
<thead>
<tr class="blokheader">
<td></td>
<td colspan='3' style="text-align:center; padding-right:4px">Basisondersteuning</td>
<td colspan='4' style="text-align:center; padding-right:4px">Basisondersteuning</td>
<td colspan='3' style="text-align: center; border-left:1px solid #888888">Extra ondersteuning</td>
</tr>
</thead>
<thead>
<tr>
<th style="width:22%">Organisatie</th>
<th style="width:13%; text-align:right">Personeel</th>
<th style="width:13%; text-align:right">Materieel</th>
<th style="width:13%; text-align:right; border-right:1px solid #888888; padding-right:4px">Scholing</th>
<th style="width:13%; text-align:right">Personeel</th>
<th style="width:13%; text-align:right">Materieel</th>
<th style="width:13%; text-align:right">Scholing</th>
<tr style="background-color: #d6be5c">
<th style="background-color: #d6be5c">Organisatie</th>
<th style="background-color: #d6be5c"></th>
<th style="background-color: #d6be5c; text-align:right">Personeel</th>
<th style="background-color: #d6be5c; text-align:right">Materieel</th>
<th style="background-color: #d6be5c; text-align:right; border-right:1px solid #888888; padding-right:4px">Scholing</th>
<th style=" background-color: #d6be5c; text-align:right">Personeel</th>
<th style="background-color: #d6be5c; text-align:right">Materieel</th>
<th style="background-color: #d6be5c; text-align:right">Scholing</th>
</tr>
</thead>
<tbody data-bind="foreach: otherPMSOrgs">
<tr style="border-bottom: 1px dotted #999999">
<tr >
<td data-bind="text: fullname"></td>
<td style="text-align:right" data-bind="text: pms[0]"></td>
<td style="text-align:right" data-bind="text: pms[1]"></td>
<td style="text-align:right; border-right:1px solid #888888; padding-right:4px" data-bind="text: pms[2]"></td>
<td style="text-align:right;" data-bind="text: pms[3]"></td>
<td style="text-align:right;" data-bind="text: pms[4]"></td>
<td style="text-align:right" data-bind="text: pms[5]"></td>
<td style="color: #00802b;">budget</td>
<td style="background-color: #f5fff8;text-align:right" data-bind="text: bud[0]"></td>
<td style="background-color: #f5fff8;text-align:right" data-bind="text: bud[1]"></td>
<td style="background-color: #f5fff8;text-align:right; border-right:1px solid #888888; padding-right:4px" data-bind="text: bud[2]"></td>
<td style="background-color: #f5fff8;text-align:right;" data-bind="text: bud[3]"></td>
<td style="background-color: #f5fff8;text-align:right;" data-bind="text: bud[4]"></td>
<td style="background-color: #f5fff8;text-align:right" data-bind="text: bud[5]"></td>
</tr>
<tr style="border-bottom: 1px dotted #999999">
<td></td>
<td style="color: #003399">uitgaven</td>
<td style="background-color: #f5faff; text-align:right"
data-bind="text: pms[0],
style: {color: kleur[0]}"></td>
<td style="background-color: #f5faff; text-align:right"
data-bind="text: pms[1],
style: {color: kleur[1] }"></td>
<td style="background-color: #f5faff; text-align:right; border-right:1px solid #888888; padding-right:4px"
data-bind="text: pms[2],
style: {color: kleur[2] }">
</td>
<td style="background-color: #f5faff; text-align:right;"
data-bind="text: pms[3],
style: {color: kleur[3] }">
</td>
<td style="background-color: #f5faff; text-align:right;"
data-bind="text: pms[4],
style: {color: kleur[4] }">
</td>
<td style="background-color: #f5faff; text-align:right"
data-bind="text: pms[5],
style: {color: kleur[5] }">
</td>
</tr>
</tbody>
<tr style="background-color: #e7e2e5; font-style: italic">
<tr style="background-color: #e6ffee; ">
<td style="width:22%">Subtotaal</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[0]"></td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[1]">Materieel</td>
<td style="width:13%; text-align:right; border-right:1px solid #888888; padding-right:4px" data-bind="text: sumotherPMS()[2]">Scholing</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[3]">Personeel</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[4]">Materieel</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[5]">Scholing</td>
<td style="color: #00802b;">budget</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[6] == 0 ? ' ' : sumotherPMS()[6] "></td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[7]== 0 ? ' ' : sumotherPMS()[7] ">Materieel</td>
<td style="width:13%; text-align:right; border-right:1px solid #888888; padding-right:4px"
data-bind="text: sumotherPMS()[8]== 0 ? '' : sumotherPMS()[8]">Scholing</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[9] == 0 ? ' ' : sumotherPMS()[9] ">Personeel</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[10]== 0 ? ' ' : sumotherPMS()[10]">Materieel</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[11] == 0 ? ' ' : sumotherPMS()[11]">Scholing</td>
</tr>
<tr style="background-color: #e6f2ff; ">
<td ></td>
<td style="color: #003399">uitgaven</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[0] == 0 ? ' ' : sumotherPMS()[0] ,
style: {color: sumotherPMS()[12]}"></td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[1] == 0 ? ' ' : sumotherPMS()[1],
style: {color: sumotherPMS()[13]}">Materieel</td>
<td style="width:13%; text-align:right; border-right:1px solid #888888; padding-right:4px" data-bind="text: sumotherPMS()[2] == 0 ? ' ' : sumotherPMS()[2],
style: {color: sumotherPMS()[14]}">Scholing</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[3] == 0 ? ' ' : sumotherPMS()[3],
style: {color: sumotherPMS()[15]}">Personeel</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[4] == 0 ? ' ' : sumotherPMS()[4],
style: {color: sumotherPMS()[16]}">Materieel</td>
<td style="width:13%; text-align:right" data-bind="text: sumotherPMS()[5] == 0 ? ' ' : sumotherPMS()[5],
style: {color: sumotherPMS()[17]}">Scholing</td>
</tr>
<tr data-bind="with: pmsTargetOrg">
<td data-bind="text: naamkort"></td>
<td style="text-align:right" data-bind="text: pms[0]"></td>
<td style="text-align:right" data-bind="text: pms[1]"></td>
<td style="text-align:right; border-right:1px solid #888888; padding-right:4px" data-bind="text: pms[2]"></td>
<td style="text-align:right;" data-bind="text: pms[3]"></td>
<td style="text-align:right;" data-bind="text: pms[4]"></td>
<td style="text-align:right" data-bind="text: pms[5]"></td>
<td style="color: #00802b;">budget</td>
<td style="text-align:right; background-color: #f5fff8" data-bind="text: bud[0]"></td>
<td style="text-align:right; background-color: #f5fff8" data-bind="text: bud[1]"></td>
<td style="text-align:right; background-color: #f5fff8; border-right:1px solid #888888; padding-right:4px" data-bind="text: bud[2]"></td>
<td style="text-align:right;background-color: #f5fff8" data-bind="text: bud[3]"></td>
<td style="text-align:right; background-color: #f5fff8" data-bind="text: bud[4]"></td>
<td style="text-align:right; background-color: #f5fff8" data-bind="text: bud[5]"></td>
</tr>
<tr data-bind="with: pmsTargetOrg">
<td ></td>
<td style="color: #003399">uitgaven</td>
<td style="text-align:right; background-color: #f5faff;"
data-bind="text: pms[0],
style: {color: kleur[0]} "></td>
<td style="text-align:right; background-color: #f5faff;"
data-bind="text: pms[1],
style: {color: kleur[1]}"></td>
<td style="text-align:right; background-color: #f5faff; border-right:1px solid #888888; padding-right:4px"
data-bind="text: pms[2],
style: {color: kleur[2]}"></td>
<td style="text-align:right; background-color: #f5faff;"
data-bind="text: pms[3],
style: {color: kleur[3]}"></td>
<td style="text-align:right; background-color: #f5faff;"
data-bind="text: pms[4],
style: {color: kleur[4]}">
</td>
<td style="text-align:right; background-color: #f5faff;"
data-bind="text: pms[5],
style: {color: kleur[5]}"></td>
</tr>
<tr style="background-color: #e7e2e5; font-weight:bold">
<th style="width:22%">Totaal</th>
<th style="width:13%; text-align:right" data-bind="text: sumtotPMS()[0]">Personeel</th>
<th style="width:13%; text-align:right" data-bind="text: sumtotPMS()[1]">Materieel</th>
<th style="width:13%; text-align:right; border-right:1px solid #888888; padding-right:4px" data-bind="text: sumtotPMS()[2]">Scholing</th>
<th style="width:13%; text-align:right" data-bind="text: sumtotPMS()[3]">Personeel</th>
<th style="width:13%; text-align:right" data-bind="text: sumtotPMS()[4]">Materieel</th>
<th style="width:13%; text-align:right" data-bind="text: sumtotPMS()[5]">Scholing</th>
<tr style="background-color: #ccffdc; font-weight:bold">
<td style="width:22%">Totaal</td>
<td style="color: #00802b;">budget</td>
<td style="width:13%; text-align:right" data-bind="text: sumtotPMS()[6]">Personeel</td>
<td style="width:13%; text-align:right" data-bind="text: sumtotPMS()[7]">Materieel</td>
<td style="width:13%; text-align:right; border-right:1px solid #888888; padding-right:4px" data-bind="text: sumtotPMS()[8]">Scholing</td>
<td style="width:13%; text-align:right" data-bind="text: sumtotPMS()[9]">Personeel</td>
<td style="width:13%; text-align:right" data-bind="text: sumtotPMS()[10]">Materieel</td>
<td style="width:13%; text-align:right" data-bind="text: sumtotPMS()[11]">Scholing</td>
</tr>
<tr style="background-color: #cce6ff; font-weight:bold">
<td style="width:22%"></td>
<td style="color: #003399">uitgaven</td>
<td style="width:13%; text-align:right"
data-bind="text: sumtotPMS()[0],
style: {color: sumtotPMS()[12]} ">Personeel
</td>
<td style="width:13%; text-align:right"
data-bind="text: sumtotPMS()[1],
style: {color: sumtotPMS()[13]}">Materieel
</td>
<td style="width:13%; text-align:right; border-right:1px solid #888888; padding-right:4px"
data-bind="text: sumtotPMS()[2],
style: {color: sumtotPMS()[14]}">Scholing
</td>
<td style="width:13%; text-align:right"
data-bind="text: sumtotPMS()[3],
style: {color: sumtotPMS()[15]}">Personeel
</td>
<td style="width:13%; text-align:right"
data-bind="text: sumtotPMS()[4],
style: {color: sumtotPMS()[16]}">Materieel
</td>
<td style="width:13%; text-align:right"
data-bind="text: sumtotPMS()[5],
style: {color: sumtotPMS()[17]}">Scholing
</td>
</tr>
</table>