mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix the fake import routine.
This commit is contained in:
parent
055673370b
commit
8fd5b45a72
@ -305,7 +305,7 @@ class TransactionJournalFactory
|
||||
$transactionFactory->setCurrency($sourceCurrency);
|
||||
$transactionFactory->setForeignCurrency($sourceForeignCurrency);
|
||||
$transactionFactory->setReconciled($row['reconciled'] ?? false);
|
||||
$transactionFactory->createNegative($row['amount'], $row['foreign_amount']);
|
||||
$transactionFactory->createNegative((string)$row['amount'], $row['foreign_amount']);
|
||||
|
||||
// and the destination one:
|
||||
/** @var TransactionFactory $transactionFactory */
|
||||
@ -316,7 +316,7 @@ class TransactionJournalFactory
|
||||
$transactionFactory->setCurrency($destCurrency);
|
||||
$transactionFactory->setForeignCurrency($destForeignCurrency);
|
||||
$transactionFactory->setReconciled($row['reconciled'] ?? false);
|
||||
$transactionFactory->createPositive($row['amount'], $row['foreign_amount']);
|
||||
$transactionFactory->createPositive((string)$row['amount'], $row['foreign_amount']);
|
||||
|
||||
// verify that journal has two transactions. Otherwise, delete and cancel.
|
||||
// TODO this can't be faked so it can't be tested.
|
||||
|
@ -67,18 +67,22 @@ class StageFinalHandler
|
||||
// transaction data:
|
||||
'transactions' => [
|
||||
[
|
||||
'currency_id' => null,
|
||||
'currency_code' => 'EUR',
|
||||
'description' => null,
|
||||
'amount' => random_int(500, 5000) / 100,
|
||||
'budget_id' => null,
|
||||
'budget_name' => null,
|
||||
'category_id' => null,
|
||||
'category_name' => null,
|
||||
'source_id' => null,
|
||||
'source_name' => 'Checking Account',
|
||||
'destination_id' => null,
|
||||
'destination_name' => 'Random expense account #' . random_int(1, 10000),
|
||||
'type' => 'withdrawal',
|
||||
'date' => Carbon::now()->format('Y-m-d'),
|
||||
'currency_id' => null,
|
||||
'currency_code' => 'EUR',
|
||||
'description' => 'Some random description #' . random_int(1, 10000),
|
||||
'amount' => random_int(500, 5000) / 100,
|
||||
'tags' => [],
|
||||
'user' => $this->importJob->user_id,
|
||||
'budget_id' => null,
|
||||
'budget_name' => null,
|
||||
'category_id' => null,
|
||||
'category_name' => null,
|
||||
'source_id' => null,
|
||||
'source_name' => 'Checking Account',
|
||||
'destination_id' => null,
|
||||
'destination_name' => 'Random expense account #' . random_int(1, 10000),
|
||||
'foreign_currency_id' => null,
|
||||
'foreign_currency_code' => null,
|
||||
'foreign_amount' => null,
|
||||
@ -112,9 +116,13 @@ class StageFinalHandler
|
||||
// transaction data:
|
||||
'transactions' => [
|
||||
[
|
||||
'type' => 'transfer',
|
||||
'user' => $this->importJob->user_id,
|
||||
'date' => '2017-02-28',
|
||||
'currency_id' => null,
|
||||
'currency_code' => 'EUR',
|
||||
'description' => null,
|
||||
'tags' => [],
|
||||
'description' => 'Saving money for February',
|
||||
'amount' => '140',
|
||||
'budget_id' => null,
|
||||
'budget_name' => null,
|
||||
|
Loading…
Reference in New Issue
Block a user