Skip to content

Firefly III: a personal finances manager

Last minute sanity check.

James Cole7f459df9e9ed
diff --git a/app/Import/Object/ImportBill.php b/app/Import/Object/ImportBill.php
index aacc6e33b5..19364f9df6 100644
--- a/app/Import/Object/ImportBill.php
+++ b/app/Import/Object/ImportBill.php
@@ -255,18 +255,24 @@ class ImportBill
}
$data = [
- 'name' => $name,
- 'match' => $name,
- 'amount_min' => bcmul($this->amount, '0.9'),
- 'amount_max' => bcmul($this->amount, '1.1'),
- 'user_id' => $this->user->id,
- 'date' => date('Y-m-d'),
- 'repeat_freq' => 'monthly',
- 'skip' => '0',
- 'automatch' => '0',
- 'active' => '1',
+ 'name' => $name,
+ 'match' => $name,
+ 'amount_min' => bcmul($this->amount, '0.9'),
+ 'amount_max' => bcmul($this->amount, '1.1'),
+ 'user_id' => $this->user->id,
+ 'date' => date('Y-m-d'),
+ 'repeat_freq' => 'monthly',
+ 'skip' => '0',
+ 'transaction_currency_id' => 1,
+ 'automatch' => '0',
+ 'active' => '1',
];
+ $currency = app('amount')->getDefaultCurrencyByUser($this->user);
+ if (null !== $currency) {
+ $data['transaction_currency_id'] = $currency->id;
+ }
+
Log::debug('Found no bill so must create one ourselves. Assume default values.', $data);
$result = $this->repository->store($data);
if (null !== $result) {
diff --git a/app/Services/Bunq/Object/MonetaryAccountBank.php b/app/Services/Bunq/Object/MonetaryAccountBank.php
index 86a0d738a7..6360cb289f 100644
--- a/app/Services/Bunq/Object/MonetaryAccountBank.php
+++ b/app/Services/Bunq/Object/MonetaryAccountBank.php
@@ -176,7 +176,7 @@ class MonetaryAccountBank extends BunqObject
'monetary_account_profile' => $this->monetaryAccountProfile->toArray(),
'setting' => $this->setting->toArray(),
'overdraft_limit' => $this->overdraftLimit->toArray(),
- 'avatar' => null === $this->avatar ? null : $this->avatar->toArray()->toArray(),
+ 'avatar' => null === $this->avatar ? null : $this->avatar->toArray(),
'reason' => $this->reason,
'reason_description' => $this->reasonDescription,
'alias' => [],