tussenstand
This commit is contained in:
@@ -42,6 +42,13 @@ class Monfin2overzicht extends MY_Controller{
|
||||
$basis = $this->Finbestemmingen_model->get_bestemmingen($orgid, $kalenderjaarnr,"BASIS");
|
||||
$extra = $this->Finbestemmingen_model->get_bestemmingen($orgid, $kalenderjaarnr,"EXTRA");
|
||||
|
||||
// echo json_encode([
|
||||
// 'basis' => $basis,
|
||||
// 'extra' =>$extra
|
||||
// ]);
|
||||
//
|
||||
// return;
|
||||
|
||||
$sombasisperuitgavetype = $this->get_som_per_uitgavetype($basis, $uitgavetypes);
|
||||
$somextraperuitgavetype = $this->get_som_per_uitgavetype($extra, $uitgavetypes);
|
||||
$totsomperuitgavetype = $this->sommeer_per_uitgavetype($sombasisperuitgavetype,$somextraperuitgavetype, $uitgavetypes);
|
||||
@@ -291,12 +298,12 @@ class Monfin2overzicht extends MY_Controller{
|
||||
$budgetsom = 0;
|
||||
foreach($subsoort->uitgavetypes ? : [] as $uitgavetype){
|
||||
if ($uitgavetype->bedrag){
|
||||
$som += $uitgavetype->bedrag;
|
||||
$som += isset($uitgavetype->bedrag) && floatval($uitgavetype->bedrag) > 0 ? floatval($uitgavetype->bedrag): 0;
|
||||
$uitgavetype->bedrag = number_format($uitgavetype->bedrag,0,',','.');
|
||||
}
|
||||
if ($uitgavetype->budget){
|
||||
$budgetsom += $uitgavetype->budget;
|
||||
$uitgavetype->budget = number_format($uitgavetype->budget,0,',','.');
|
||||
$budgetsom += is_numeric($uitgavetype->budget) ? $uitgavetype->budget: 0;
|
||||
$uitgavetype->budget =is_numeric($uitgavetype->budget) ? number_format($uitgavetype->budget,0,',','.'): '0,00';
|
||||
}
|
||||
}
|
||||
$subsoort->uitgavetypes[3]= new stdClass;
|
||||
@@ -371,50 +378,48 @@ class Monfin2overzicht extends MY_Controller{
|
||||
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;
|
||||
$sombasis[$uitgavetype->code]->budgetsom = 0;
|
||||
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 $uitgavetype) {
|
||||
|
||||
$sombasis[$uitgavetype->code]->som += ($uitgavetype->bedrag ?: 0);
|
||||
$sombasis[$uitgavetype->code]->budgetsom += ($uitgavetype->budget ?: 0);
|
||||
} //foreach
|
||||
}//foreach subsoort
|
||||
}//foreach basis
|
||||
}
|
||||
} // if uitgavetypes
|
||||
$somasarray=[];
|
||||
$index = 0;
|
||||
$regelsom=0;
|
||||
$regelsom2 = 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);
|
||||
$index += 1;
|
||||
};
|
||||
$regelsom = $somasarray[0]->som;
|
||||
$regelsom2 = $somasarray[0 ]->budgetsom;
|
||||
|
||||
$somasarray[$index] = new stdClass;
|
||||
$somasarray[$index]->code ="REGELSOM";
|
||||
$somasarray[$index]->naam = "Som";
|
||||
$somasarray[$index]->som = $regelsom;
|
||||
foreach($basis ? $basis : [] as $soort){
|
||||
foreach ($soort->subsoorten ? $soort->subsoorten : [] as $subsoort){
|
||||
foreach($subsoort->uitgavetypes ? $subsoort->uitgavetypes :[] as $kostenpost) {
|
||||
$sombasis[$uitgavetype->code]->som += is_numeric($kostenpost->bedrag)? floatval($kostenpost->bedrag): 0;
|
||||
$sombasis[$uitgavetype->code]->budgetsom += is_numeric($kostenpost->budget) ? floatval($kostenpost->budget): 0;
|
||||
} //foreach
|
||||
}//foreach subsoort
|
||||
}//foreach basis
|
||||
} // if uitgavetypes
|
||||
$somasarray=[];
|
||||
$index = 0;
|
||||
$regelsom=0;
|
||||
$regelsom2 = 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);
|
||||
$regelsom += $somasarray[$index ]->som;
|
||||
$regelsom2 += $somasarray[$index ]->budgetsom;
|
||||
$index += 1;
|
||||
};
|
||||
$somasarray[$index] = new stdClass;
|
||||
$somasarray[$index]->code ="REGELSOM";
|
||||
$somasarray[$index]->naam = "Som";
|
||||
$somasarray[$index]->som = $regelsom;
|
||||
$somasarray[$index]->budgetsom = $regelsom2;
|
||||
|
||||
return $somasarray;
|
||||
}
|
||||
|
||||
return $somasarray;
|
||||
}
|
||||
|
||||
function getbestuursbedragen(){
|
||||
$targetorgid = $this->clean_input('orgid');
|
||||
|
||||
@@ -64,26 +64,26 @@ class Finbestemmingen_model extends MY_Model{
|
||||
foreach($soort->subsoorten as $index =>$subsoort){
|
||||
// haal per uitgavetypes de bedragen op
|
||||
if ($uitgavetypes) {
|
||||
$restant = 0;
|
||||
|
||||
$restantbudget = 0;
|
||||
foreach ($uitgavetypes as $uitgavetype) {
|
||||
|
||||
$subsoort->uitgavetypes[] = $this->get_bedrag_per_type($orgID, $jaarnr, $subsoort->subsoortID, $uitgavetype->code);
|
||||
}
|
||||
if (count($subsoort->uitgavetypes) > 0) {
|
||||
$restant = number_format(0, 2);
|
||||
$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);
|
||||
}
|
||||
$subsoort->uitgavetypes[] = [
|
||||
'id' => '0',
|
||||
'bedrag' => $restant,
|
||||
'budget' => $restantbudget,
|
||||
'code' => 'RESTANT',
|
||||
];
|
||||
$restant = new stdClass();
|
||||
$restant->id = '0';
|
||||
$restant->bedrag = '0.00';
|
||||
$restant->budget = $restantbudget;
|
||||
$restant->code = 'RESTANT';
|
||||
|
||||
$subsoort->uitgavetypes[] = $restant;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,22 +76,39 @@
|
||||
<th class="naam2"
|
||||
style="padding: 3px; width: 22%; vertical-align:bottom; background-color: #968026;">Basisondersteuning</th>
|
||||
<!-- ko foreach: uitgavetypes-->
|
||||
<!--ko if: naam != 'TOTAAL' -->
|
||||
<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>
|
||||
<!--/ko-->
|
||||
<!-- ko foreach: uitgavetypes-->
|
||||
<!--ko if: naam == 'TOTAAL' -->
|
||||
<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>som uitgaven</span>
|
||||
<i class="fa fa-info-circle"
|
||||
data-bind="click: fToelichting.bind($data, 'BUDGET')">
|
||||
data-bind="click: $parent.fToelichting.bind($data, 'SOM')">
|
||||
</i>
|
||||
</th>
|
||||
|
||||
<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>som budget</span>
|
||||
<i class="fa fa-info-circle"
|
||||
data-bind="click: $parent.fToelichting.bind($data, 'BUDGET')">
|
||||
</i>
|
||||
</th>
|
||||
<!-- /ko -->
|
||||
<!-- /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>
|
||||
@@ -119,17 +136,23 @@
|
||||
<td class="naam2" style="text-align:left;">Totaal basis</td>
|
||||
<!--ko if: sombasisperuitgavetype() -->
|
||||
<!-- ko foreach: sombasisperuitgavetype-->
|
||||
<!--ko if: $index() != 0 -->
|
||||
|
||||
<td style="text-align:right" data-bind="text: som"></td>
|
||||
<!--/ko-->
|
||||
<!-- /ko -->
|
||||
<!-- /ko -->
|
||||
|
||||
<!--ko if: ! sombasisperuitgavetype() -->
|
||||
<!-- ko foreach: uitgavetypes-->
|
||||
<td style="text-align:right" >0,00</td>
|
||||
<!--ko if: sombasisperuitgavetype() -->
|
||||
<!-- ko foreach: sombasisperuitgavetype-->
|
||||
<!--ko if: $index() == 0 -->
|
||||
|
||||
<td style="text-align:right" data-bind="text: som"></td>
|
||||
<!--/ko-->
|
||||
<!-- /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,
|
||||
@@ -153,25 +176,25 @@
|
||||
<tr style="border-bottom:1px solid #ebebeb">
|
||||
<td></td>
|
||||
<td data-bind="text:naam" class="naam" style="padding:0;" > </td>
|
||||
<td data-bind="text: isNaN(uitgavetypes[0].bedrag.replace(/\./g,'') ) || uitgavetypes[0].bedrag ==0 ? '' : uitgavetypes[0].bedrag,
|
||||
style: {color: uitgavetypes[0].budget && Number(uitgavetypes[0].budget.replace(/\./g,'') ) < Number(uitgavetypes[0].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
<td data-bind="text: isNaN(uitgavetypes[1].bedrag.replace(/\./g,'') ) || uitgavetypes[1].bedrag ==0 ? '' : uitgavetypes[1].bedrag,
|
||||
style: {color: uitgavetypes[1].budget && Number(uitgavetypes[1].budget.replace(/\./g,'') ) < Number(uitgavetypes[1].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
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: {color: uitgavetypes[1].budget && Number(uitgavetypes[1].budget.replace(/\./g,'')) < Number(uitgavetypes[1].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
<td data-bind="text: isNaN(uitgavetypes[2].bedrag.replace(/\./g,'') ) || uitgavetypes[2].bedrag ==0 ? '' : uitgavetypes[2].bedrag,
|
||||
style: {color: uitgavetypes[2].budget && Number(uitgavetypes[2].budget.replace(/\./g,'')) < Number(uitgavetypes[2].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
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: {color: uitgavetypes[2].budget && Number(uitgavetypes[2].budget.replace(/\./g,'')) <Number(uitgavetypes[2].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
<td data-bind="text: isNaN(uitgavetypes[3].bedrag.replace(/\./g,'') ) || uitgavetypes[3].bedrag ==0 ? '' : uitgavetypes[3].bedrag,
|
||||
style: {color: uitgavetypes[3].budget && Number(uitgavetypes[3].budget.replace(/\./g,'')) <Number(uitgavetypes[3].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
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: {color: uitgavetypes[3].budget && Number(uitgavetypes[3].budget.replace(/\./g,'')) < Number(uitgavetypes[3].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
<td data-bind="text: isNaN(uitgavetypes[0].bedrag.replace(/\./g,'') ) || uitgavetypes[0].bedrag ==0 ? '' : uitgavetypes[0].bedrag,
|
||||
style: {color: uitgavetypes[0].budget && Number(uitgavetypes[0].budget.replace(/\./g,'')) < Number(uitgavetypes[0].bedrag.replace(/\./g,'')) ? 'red' : 'black' }"
|
||||
style="text-align:right;width:91px">
|
||||
</td>
|
||||
<td data-bind="text: isNaN(uitgavetypes[3].budget.replace(/\./g,'') ) || uitgavetypes[3].budget ==0 ? '' : uitgavetypes[3].budget" style="text-align:right;width:91px"></td>
|
||||
<td data-bind="text: isNaN(uitgavetypes[0].budget.replace(/\./g,'') ) || uitgavetypes[0].budget ==0 ? '' : uitgavetypes[0].budget" style="text-align:right;width:91px"></td>
|
||||
<td ><i class="fa fa-info-circle"
|
||||
data-bind="visible: Number(uitgavetypes[3].budget.replace(/\./g,''))> 0,
|
||||
data-bind="visible: Number(uitgavetypes[0].budget.replace(/\./g,''))> 0,
|
||||
click: $root.fOpenDetails.bind($data, 'DETAIL')">
|
||||
</i>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user