mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 14:41:20 +00: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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ return [
|
||||
*
|
||||
*/
|
||||
'import_roles' => [
|
||||
'_ignore' => [
|
||||
'_ignore' => [
|
||||
'mappable' => false,
|
||||
'pre-process-map' => false,
|
||||
'field' => 'ignored',
|
||||
@@ -59,41 +59,48 @@ return [
|
||||
|
||||
|
||||
],
|
||||
'bill-id' => [
|
||||
'bill-id' => [
|
||||
'mappable' => true,
|
||||
'pre-process-map' => false,
|
||||
'field' => 'bill',
|
||||
'converter' => 'BillId',
|
||||
'mapper' => 'Bills',
|
||||
],
|
||||
'bill-name' => [
|
||||
'bill-name' => [
|
||||
'mappable' => true,
|
||||
'pre-process-map' => false,
|
||||
'field' => 'bill',
|
||||
'converter' => 'BillName',
|
||||
'mapper' => 'Bills',
|
||||
],
|
||||
'currency-id' => [
|
||||
'currency-id' => [
|
||||
'mappable' => true,
|
||||
'pre-process-map' => false,
|
||||
'field' => 'currency',
|
||||
'converter' => 'CurrencyId',
|
||||
'mapper' => 'TransactionCurrencies',
|
||||
],
|
||||
'currency-name' => [
|
||||
'currency-name' => [
|
||||
'mappable' => true,
|
||||
'pre-process-map' => false,
|
||||
'converter' => 'CurrencyName',
|
||||
'field' => 'currency',
|
||||
'mapper' => 'TransactionCurrencies',
|
||||
],
|
||||
'currency-code' => [
|
||||
'currency-code' => [
|
||||
'mappable' => true,
|
||||
'pre-process-map' => false,
|
||||
'converter' => 'CurrencyCode',
|
||||
'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,
|
||||
@@ -113,7 +120,7 @@ return [
|
||||
'converter' => 'Date',
|
||||
'field' => 'date',
|
||||
],
|
||||
'date-interest' => [
|
||||
'date-interest' => [
|
||||
'mappable' => false,
|
||||
'pre-process-map' => false,
|
||||
'converter' => 'Date',
|
||||
@@ -125,7 +132,7 @@ return [
|
||||
'converter' => 'Date',
|
||||
'field' => 'date-book',
|
||||
],
|
||||
'date-process' => [
|
||||
'date-process' => [
|
||||
'mappable' => false,
|
||||
'pre-process-map' => false,
|
||||
'converter' => 'Date',
|
||||
|
||||
Reference in New Issue
Block a user