Big update to properly support multi currencies.

This commit is contained in:
James Cole
2017-06-04 13:39:16 +02:00
parent 771ebde295
commit 82e74a2afd
34 changed files with 470 additions and 498 deletions

View File

@@ -291,6 +291,7 @@ class ImportStorage
'user_id' => $entry->user->id,
'transaction_type_id' => $entry->fields['transaction-type']->id,
'bill_id' => $billId,
// TODO update this transaction currency reference.
'transaction_currency_id' => $entry->fields['currency']->id,
'description' => $entry->fields['description'],
'date' => $entry->fields['date-transaction'],

View File

@@ -74,6 +74,7 @@ class ImportValidator
$entry = $this->setOpposingAccount($entry);
$entry = $this->cleanDescription($entry);
$entry = $this->setTransactionType($entry);
// TODO update this transaction currency reference.
$entry = $this->setTransactionCurrency($entry);
$newCollection->put($index, $entry);
@@ -383,6 +384,7 @@ class ImportValidator
*/
private function setTransactionCurrency(ImportEntry $entry): ImportEntry
{
// TODO update this transaction currency reference.
if (is_null($entry->fields['currency'])) {
/** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class);