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