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