mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
check if type is set
This commit is contained in:
parent
8ddec8e067
commit
89bf681f48
@ -12,6 +12,9 @@ $body['gdtSum'] = $this->element('centToFloat', ['cent' => $body['gdtSum'], 'pre
|
|||||||
|
|
||||||
foreach($body['transactions'] as $i => $transaction) {
|
foreach($body['transactions'] as $i => $transaction) {
|
||||||
$useCeil = false;
|
$useCeil = false;
|
||||||
|
if(!isset($transaction['type'])) {
|
||||||
|
$body = ['state' => 'error', 'msg' => 'transaction without type found', 'details' => $transaction];
|
||||||
|
} else {
|
||||||
if($transaction['type'] == 'decay') {
|
if($transaction['type'] == 'decay') {
|
||||||
$useCeil = true;
|
$useCeil = true;
|
||||||
}
|
}
|
||||||
@ -22,6 +25,7 @@ foreach($body['transactions'] as $i => $transaction) {
|
|||||||
if(isset($transaction['decay'])) {
|
if(isset($transaction['decay'])) {
|
||||||
$body['transactions'][$i]['decay']['balance'] = $this->element('centToFloat', ['cent' => $transaction['decay']['balance'], 'precision' => 4]);
|
$body['transactions'][$i]['decay']['balance'] = $this->element('centToFloat', ['cent' => $transaction['decay']['balance'], 'precision' => 4]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?><?= json_encode($body) ?>
|
?><?= json_encode($body) ?>
|
||||||
Loading…
x
Reference in New Issue
Block a user