mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
put back gdt sum into listTransactions
This commit is contained in:
parent
01b58d5f6b
commit
39ce3fcc0a
@ -274,8 +274,6 @@ class AppRequestsController extends AppController
|
|||||||
public function getBalance($session_id = 0)
|
public function getBalance($session_id = 0)
|
||||||
{
|
{
|
||||||
$this->viewBuilder()->setLayout('ajax');
|
$this->viewBuilder()->setLayout('ajax');
|
||||||
$this->response = $this->response->withType('application/json');
|
|
||||||
|
|
||||||
$login_result = $this->requestLogin($session_id, false);
|
$login_result = $this->requestLogin($session_id, false);
|
||||||
if($login_result !== true) {
|
if($login_result !== true) {
|
||||||
$this->set('body', $login_result);
|
$this->set('body', $login_result);
|
||||||
@ -306,16 +304,12 @@ class AppRequestsController extends AppController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$body['decay_date'] = $now;
|
$body['decay_date'] = $now;
|
||||||
$this->addAdminError("AppRequests", "getBalance", $body, $user['id']);
|
|
||||||
$this->set('body', $body);
|
$this->set('body', $body);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function listTransactions($page = 1, $count = 25, $orderDirection = 'ASC', $session_id = 0)
|
public function listTransactions($page = 1, $count = 25, $orderDirection = 'ASC', $session_id = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->viewBuilder()->setLayout('ajax');
|
$this->viewBuilder()->setLayout('ajax');
|
||||||
$this->response = $this->response->withType('application/json');
|
|
||||||
|
|
||||||
$startTime = microtime(true);
|
$startTime = microtime(true);
|
||||||
|
|
||||||
$login_result = $this->requestLogin($session_id, false);
|
$login_result = $this->requestLogin($session_id, false);
|
||||||
@ -331,6 +325,17 @@ class AppRequestsController extends AppController
|
|||||||
$transactionsTable = TableRegistry::getTableLocator()->get('Transactions');
|
$transactionsTable = TableRegistry::getTableLocator()->get('Transactions');
|
||||||
|
|
||||||
$stateBalancesTable->updateBalances($user['id']);
|
$stateBalancesTable->updateBalances($user['id']);
|
||||||
|
|
||||||
|
$gdtSum = 0;
|
||||||
|
|
||||||
|
$gdtEntries = $this->JsonRequestClient->sendRequestGDT(['email' => $user['email']], 'GdtEntries' . DS . 'sumPerEmailApi');
|
||||||
|
|
||||||
|
if('success' == $gdtEntries['state'] && 'success' == $gdtEntries['data']['state']) {
|
||||||
|
$gdtSum = intval($gdtEntries['data']['sum']);
|
||||||
|
} else {
|
||||||
|
$this->addAdminError('StateBalancesController', 'overview', $gdtEntries, $user['id'] ? $user['id'] : 0);
|
||||||
|
}
|
||||||
|
|
||||||
//echo "count: $count, page: $page<br>";
|
//echo "count: $count, page: $page<br>";
|
||||||
$limit = $count;
|
$limit = $count;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
@ -384,6 +389,7 @@ class AppRequestsController extends AppController
|
|||||||
'transactions' => $transactions,
|
'transactions' => $transactions,
|
||||||
'transactionExecutingCount' => $session->read('Transactions.executing'),
|
'transactionExecutingCount' => $session->read('Transactions.executing'),
|
||||||
'count' => $stateUserTransactionsQuery->count(),
|
'count' => $stateUserTransactionsQuery->count(),
|
||||||
|
'gdtSum' => $gdtSum,
|
||||||
'timeUsed' => microtime(true) - $startTime
|
'timeUsed' => microtime(true) - $startTime
|
||||||
];
|
];
|
||||||
$now = new FrozenTime();
|
$now = new FrozenTime();
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
$body['balance'] = $this->element('centToFloat', ['cent' => $body['balance'], 'precision' => 4]);
|
$body['balance'] = $this->element('centToFloat', ['cent' => $body['balance'], 'precision' => 4]);
|
||||||
$body['decay'] = $this->element('centToFloat', ['cent' => $body['decay'], 'precision' => 4]);
|
$body['decay'] = $this->element('centToFloat', ['cent' => $body['decay'], 'precision' => 4]);
|
||||||
|
$body['gdtSum'] = $this->element('centToFloat', ['cent' => $body['gdtSum'], 'precision' => 2]);
|
||||||
|
|
||||||
foreach($body['transactions'] as $i => $transaction) {
|
foreach($body['transactions'] as $i => $transaction) {
|
||||||
$useCeil = false;
|
$useCeil = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user