tussenopslag

This commit is contained in:
2024-03-03 20:02:18 +01:00
parent 8b50a10e7b
commit c3aa042801
8 changed files with 59 additions and 26 deletions
@@ -399,20 +399,21 @@ class Monfin2overzicht extends MY_Controller{
$regelsom2 = 0;
$regelsom3 = 0;
foreach($uitgavetypes as $uitgavetype){
$somasarray[$index ] = new stdClass;
$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;
$regelsom2 += $somasarray[$index]->budgetsom;
}
$index += 1;
};
$somasarray[0]->som = $regelsom;
$somasarray[0]->budgetrestant = $somasarray[0]->budgetsom - $regelsom2;
$somasarray[0]->budgetsom = $regelsom2;
$somasarray[0]->budgetrestant = $regelsom - $regelsom2;
return $somasarray;
}
@@ -426,14 +427,18 @@ class Monfin2overzicht extends MY_Controller{
$subtot->extra =0;
$subtot->som =0;
$subtot->budget =0;
$subtot->gebudget = 0;
$subtot->verschil =0;
$subtot->verschilGeb =0;
$grandtot = new stdClass;
$grandtot->basis =0;
$grandtot->extra =0;
$grandtot->som =0;
$grandtot->budget =0;
$grandtot->gebudget =0;
$grandtot->verschil =0;
$grandtot->verschilGeb =0;
$targetorg = $this->Organisaties_model->get_record_by_id($targetorgid);
$targetorg->bestemmingen = $this->get_bestuur_bestemmingen($targetorgid, $kalenderjaarnr);
@@ -457,19 +462,28 @@ class Monfin2overzicht extends MY_Controller{
$others[$index]->naam = $organisatie->brin.'-'.$organisatie->naamkort;
$others[$index]->id = $organisatie->id;
$others[$index]->budget = $this->get_budgetten_inclusief($orgids, $kalenderjaarnr);
$others[$index]->gebudget = $this->Finbestemmingen_model->get_gebudgeteerd_totbedrag_over_orgs($orgids, $kalenderjaarnr);
$others[$index]->gebudgetForm = number_format($others[$index]->gebudget,0 , ',' , '.');
$others[$index]->bestemmingen = $this->get_bestemmingen_inclusief($orgids, $kalenderjaarnr);
$others[$index]->verschil = $others[$index]->budget->totaal - $others[$index]->bestemmingen->som;
$others[$index]->verschilGeb = $others[$index]->gebudget - $others[$index]->bestemmingen->som;
$others[$index]->formVerschil = number_format($others[$index]->verschil, 0 ,',' , '.' );
$others[$index]->verschilGebForm = number_format($others[$index]->verschilGeb,0 , ',' , '.');
$subtot->basis += $others[$index]->bestemmingen->basis;
$subtot->extra += $others[$index]->bestemmingen->extra;
$subtot->som += $others[$index]->bestemmingen->som;
$subtot->budget += $others[$index]->budget->totaal;
$subtot->gebudget += $others[$index]->gebudget;
$subtot->verschil += $others[$index]->verschil;
$subtot->verschilGeb += $others[$index]->verschilGeb;
$grandtot->basis += $others[$index]->bestemmingen->basis;
$grandtot->extra += $others[$index]->bestemmingen->extra;
$grandtot->som += $others[$index]->bestemmingen->som;
$grandtot->budget += $others[$index]->budget->totaal;
$grandtot->gebudget += $others[$index]->gebudget;
$grandtot->verschil += $others[$index]->verschil;
$grandtot->verschilGeb += $others[$index]->verschilGeb;
$index += 1;
}
}
@@ -482,13 +496,17 @@ class Monfin2overzicht extends MY_Controller{
$subtot->extra = number_format($subtot->extra,0 , ',' , '.');
$subtot->som = number_format($subtot->som,0 , ',' , '.');
$subtot->budget = number_format($subtot->budget,0 , ',' , '.');
$subtot->gebudget = number_format($subtot->gebudget,0 , ',' , '.');
$subtot->verschil = number_format($subtot->verschil,0 , ',' , '.');
$subtot->verschilGeb = number_format($subtot->verschilGeb,0 , ',' , '.');
$grandtot->basis = number_format($grandtot->basis,0 , ',' , '.');
$grandtot->extra = number_format($grandtot->extra,0 , ',' , '.');
$grandtot->som = number_format($grandtot->som,0 , ',' , '.');
$grandtot->budget = number_format($grandtot->budget,0 , ',' , '.');
$grandtot->gebudget = number_format($grandtot->gebudget,0 , ',' , '.');
$grandtot->verschil = number_format($grandtot->verschil,0 , ',' , '.');
$grandtot->verschilGeb = number_format($grandtot->verschilGeb,0 , ',' , '.');
// $result = $this->get_orgs_bestemmingen($orgids, $kalenderjaarnr);
echo json_encode(['targetorg' =>$targetorg,
@@ -522,6 +540,9 @@ class Monfin2overzicht extends MY_Controller{
return $budgetten;
}
private function getorgids($orgid){
$organisaties = array();
$level2 = array();