mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 02:45:58 +00:00
Code for #660
This commit is contained in:
@@ -361,17 +361,19 @@ class ImportStorage
|
|||||||
|
|
||||||
// create new transactions. This is something that needs a rewrite for multiple/split transactions.
|
// create new transactions. This is something that needs a rewrite for multiple/split transactions.
|
||||||
$sourceData = [
|
$sourceData = [
|
||||||
'account_id' => $accounts['source']->id,
|
'account_id' => $accounts['source']->id,
|
||||||
'transaction_journal_id' => $journal->id,
|
'transaction_journal_id' => $journal->id,
|
||||||
'description' => null,
|
'transaction_currency_id' => $journal->transaction_currency_id,
|
||||||
'amount' => bcmul($amount, '-1'),
|
'description' => null,
|
||||||
|
'amount' => bcmul($amount, '-1'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$destinationData = [
|
$destinationData = [
|
||||||
'account_id' => $accounts['destination']->id,
|
'account_id' => $accounts['destination']->id,
|
||||||
'transaction_journal_id' => $journal->id,
|
'transaction_currency_id' => $journal->transaction_currency_id,
|
||||||
'description' => null,
|
'transaction_journal_id' => $journal->id,
|
||||||
'amount' => $amount,
|
'description' => null,
|
||||||
|
'amount' => $amount,
|
||||||
];
|
];
|
||||||
|
|
||||||
$one = Transaction::create($sourceData);
|
$one = Transaction::create($sourceData);
|
||||||
@@ -383,7 +385,7 @@ class ImportStorage
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($two->id)) {
|
if (is_null($two->id)) {
|
||||||
Log::error('Could not create transaction 1.', $two->getErrors()->all());
|
Log::error('Could not create transaction 2.', $two->getErrors()->all());
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,12 +16,15 @@ use FireflyIII\Exceptions\FireflyException;
|
|||||||
use FireflyIII\Import\Mapper\MapperInterface;
|
use FireflyIII\Import\Mapper\MapperInterface;
|
||||||
use FireflyIII\Import\MapperPreProcess\PreProcessorInterface;
|
use FireflyIII\Import\MapperPreProcess\PreProcessorInterface;
|
||||||
use FireflyIII\Import\Specifics\SpecificInterface;
|
use FireflyIII\Import\Specifics\SpecificInterface;
|
||||||
|
use FireflyIII\Models\ImportJob;
|
||||||
use League\Csv\Reader;
|
use League\Csv\Reader;
|
||||||
use Log;
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trait CsvImportSupportTrait
|
* Trait CsvImportSupportTrait
|
||||||
*
|
*
|
||||||
|
* @property ImportJob $job
|
||||||
|
*
|
||||||
* @package FireflyIII\Support\Import
|
* @package FireflyIII\Support\Import
|
||||||
*/
|
*/
|
||||||
trait CsvImportSupportTrait
|
trait CsvImportSupportTrait
|
||||||
|
Reference in New Issue
Block a user