mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 10:39:28 +00:00
Fix #10815
This commit is contained in:
@@ -327,6 +327,7 @@ class AccountEnrichment implements EnrichmentInterface
|
||||
$openingBalance = null;
|
||||
$pcOpeningBalance = null;
|
||||
}
|
||||
$meta['current_balance_date'] =$this->getDate();
|
||||
$meta['balances'] = [
|
||||
'current_balance' => $currentBalance,
|
||||
'pc_current_balance' => $pcCurrentBalance,
|
||||
@@ -378,13 +379,17 @@ class AccountEnrichment implements EnrichmentInterface
|
||||
|
||||
public function setDate(?Carbon $date): void
|
||||
{
|
||||
if(null !== $date) {
|
||||
$date->endOfDay();
|
||||
Log::debug(sprintf('Date is now %s', $date->toW3cString()));
|
||||
}
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
public function getDate(): Carbon
|
||||
{
|
||||
if (null === $this->date) {
|
||||
return today();
|
||||
return now();
|
||||
}
|
||||
|
||||
return $this->date;
|
||||
|
@@ -78,10 +78,6 @@ class AccountTransformer extends AbstractTransformer
|
||||
$zoomLevel = $account->meta['location']['zoom_level'] ?? null;
|
||||
$order = $account->order;
|
||||
|
||||
// date (for balance etc.)
|
||||
$date = $this->getDate();
|
||||
$date->endOfDay();
|
||||
|
||||
// get primary currency as fallback:
|
||||
$currency = $this->primary; // assume primary currency
|
||||
if ($hasCurrencySettings) {
|
||||
@@ -141,7 +137,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
'debt_amount' => $account->meta['balances']['debt_amount'],
|
||||
'pc_debt_amount' => $account->meta['balances']['pc_debt_amount'],
|
||||
|
||||
'current_balance_date' => $date->toAtomString(),
|
||||
'current_balance_date' => $account->meta['current_balance_date']->toAtomString(),
|
||||
'notes' => $account->meta['notes'] ?? null,
|
||||
'monthly_payment_date' => $monthlyPaymentDate,
|
||||
'credit_card_type' => $creditCardType,
|
||||
|
Reference in New Issue
Block a user