Auto commit for release 'develop' on 2024-05-16

This commit is contained in:
github-actions
2024-05-16 07:22:12 +02:00
parent 4eb5873353
commit c9d9ecede4
2 changed files with 18 additions and 21 deletions

View File

@@ -31,8 +31,8 @@ use Illuminate\Support\Facades\Log;
class AccountBalanceCalculator class AccountBalanceCalculator
{ {
private function __construct()
private function __construct() { {
// no-op // no-op
} }
@@ -44,17 +44,17 @@ class AccountBalanceCalculator
*/ */
public static function recalculateAll(): void public static function recalculateAll(): void
{ {
$object = new self; $object = new self();
$object->recalculateLatest(null); $object->recalculateLatest(null);
//$object->recalculateJournals(null, null); // $object->recalculateJournals(null, null);
} }
public static function recalculateForJournal(TransactionJournal $transactionJournal): void public static function recalculateForJournal(TransactionJournal $transactionJournal): void
{ {
$object = new self; $object = new self();
foreach ($transactionJournal->transactions as $transaction) { foreach ($transactionJournal->transactions as $transaction) {
$object->recalculateLatest($transaction->account); $object->recalculateLatest($transaction->account);
//$object->recalculateJournals($transaction->account, $transactionJournal); // $object->recalculateJournals($transaction->account, $transactionJournal);
} }
} }
@@ -119,8 +119,8 @@ class AccountBalanceCalculator
$sumForeignAmount = $row->sum_foreign_amount; $sumForeignAmount = $row->sum_foreign_amount;
// first create for normal currency: // first create for normal currency:
$entry = $this->getAccountBalanceByAccount($account, $transactionCurrency); $entry = $this->getAccountBalanceByAccount($account, $transactionCurrency);
$entry->balance = bcadd($entry->balance, $sumAmount); $entry->balance = bcadd($entry->balance, $sumAmount);
$entry->save(); $entry->save();
// then do foreign amount, if present: // then do foreign amount, if present:
@@ -155,11 +155,6 @@ class AccountBalanceCalculator
* 1. Dus dan search je eerst naar die SUM, som alle transactions eerder dan (niet inclusief) de journal. * 1. Dus dan search je eerst naar die SUM, som alle transactions eerder dan (niet inclusief) de journal.
* 2. En vanaf daar pak je alle journals op of na de journal (dus ook de journal zelf) en begin je door te tellen. * 2. En vanaf daar pak je alle journals op of na de journal (dus ook de journal zelf) en begin je door te tellen.
* 3. Elke voorbij gaande journal entry "balance_after_journal" geef je een update of voeg je toe. * 3. Elke voorbij gaande journal entry "balance_after_journal" geef je een update of voeg je toe.
*
* @param Account|null $account
* @param TransactionJournal|null $transactionJournal
*
* @return void
*/ */
private function recalculateJournals(?Account $account, ?TransactionJournal $transactionJournal): void private function recalculateJournals(?Account $account, ?TransactionJournal $transactionJournal): void
{ {
@@ -170,7 +165,7 @@ class AccountBalanceCalculator
if (null !== $account) { if (null !== $account) {
$query->where('transactions.account_id', $account->id); $query->where('transactions.account_id', $account->id);
} }
if(null !== $account && null !== $transactionJournal) { if (null !== $account && null !== $transactionJournal) {
$query->where('transaction_journals.date', '>=', $transactionJournal->date); $query->where('transaction_journals.date', '>=', $transactionJournal->date);
$amounts = $this->getStartAmounts($account, $transactionJournal); $amounts = $this->getStartAmounts($account, $transactionJournal);
} }
@@ -212,8 +207,10 @@ class AccountBalanceCalculator
// order by transaction_journals.date desc // order by transaction_journals.date desc
} }
private function getStartAmounts(Account $account, TransactionJournal $journal): array { private function getStartAmounts(Account $account, TransactionJournal $journal): array
die('here we are'); {
exit('here we are');
return []; return [];
} }
} }

10
composer.lock generated
View File

@@ -10420,16 +10420,16 @@
}, },
{ {
"name": "mockery/mockery", "name": "mockery/mockery",
"version": "1.6.11", "version": "1.6.12",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/mockery/mockery.git", "url": "https://github.com/mockery/mockery.git",
"reference": "81a161d0b135df89951abd52296adf97deb0723d" "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mockery/mockery/zipball/81a161d0b135df89951abd52296adf97deb0723d", "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699",
"reference": "81a161d0b135df89951abd52296adf97deb0723d", "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -10499,7 +10499,7 @@
"security": "https://github.com/mockery/mockery/security/advisories", "security": "https://github.com/mockery/mockery/security/advisories",
"source": "https://github.com/mockery/mockery" "source": "https://github.com/mockery/mockery"
}, },
"time": "2024-03-21T18:34:15+00:00" "time": "2024-05-16T03:13:13+00:00"
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",