mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Configuration for import routine.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* CsvImporter.php
|
||||
* CsvSetup.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Import\Importer;
|
||||
namespace FireflyIII\Import\Setup;
|
||||
|
||||
|
||||
use ExpandedForm;
|
||||
@@ -28,11 +28,11 @@ use Log;
|
||||
use Symfony\Component\HttpFoundation\FileBag;
|
||||
|
||||
/**
|
||||
* Class CsvImporter
|
||||
* Class CsvSetup
|
||||
*
|
||||
* @package FireflyIII\Import\Importer
|
||||
*/
|
||||
class CsvImporter implements ImporterInterface
|
||||
class CsvSetup implements SetupInterface
|
||||
{
|
||||
const EXAMPLE_ROWS = 5;
|
||||
/** @var Account */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* ImporterInterface.php
|
||||
* SetupInterface.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Import\Importer;
|
||||
namespace FireflyIII\Import\Setup;
|
||||
|
||||
use FireflyIII\Import\Role\Map;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
@@ -17,11 +17,11 @@ use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\FileBag;
|
||||
|
||||
/**
|
||||
* Interface ImporterInterface
|
||||
* Interface SetupInterface
|
||||
*
|
||||
* @package FireflyIII\Import\Importer
|
||||
* @package FireflyIII\Import\Setup
|
||||
*/
|
||||
interface ImporterInterface
|
||||
interface SetupInterface
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -141,11 +141,18 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
}
|
||||
// remove group by
|
||||
$query->getQuery()->getQuery()->groups = null;
|
||||
$ids = $query->get(['transaction_journals.id'])->pluck('id')->toArray();
|
||||
|
||||
|
||||
|
||||
// that should do it:
|
||||
$sum = strval($query->sum('destination.amount'));
|
||||
$sum = $this->user->transactions()
|
||||
->whereIn('transaction_journal_id', $ids)
|
||||
->where('amount', '>', '0')
|
||||
->whereNull('transactions.deleted_at')
|
||||
->sum('amount');
|
||||
|
||||
return $sum;
|
||||
return strval($sum);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,13 @@ return [
|
||||
'field' => 'currency',
|
||||
'mapper' => 'TransactionCurrencies',
|
||||
],
|
||||
'external-id' => [
|
||||
'mappable' => false,
|
||||
'pre-process-map' => false,
|
||||
'converter' => 'ExternalId',
|
||||
'field' => 'external-id',
|
||||
],
|
||||
|
||||
'currency-symbol' => [
|
||||
'mappable' => true,
|
||||
'pre-process-map' => false,
|
||||
|
||||
Reference in New Issue
Block a user