mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Make sure each source of transactions stores where it's from.
This commit is contained in:
parent
2afbef63aa
commit
b1cc17d96e
@ -73,6 +73,7 @@ class TransactionRequest extends Request
|
||||
'invoice_date' => $this->date('invoice_date'),
|
||||
'internal_reference' => $this->string('internal_reference'),
|
||||
'notes' => $this->string('notes'),
|
||||
'original-source' => sprintf('api-v%s', config('firefly.api_version')),
|
||||
'transactions' => $this->getTransactionData(),
|
||||
];
|
||||
|
||||
|
@ -104,7 +104,7 @@ class TransactionJournalFactory
|
||||
// store date meta fields (if present):
|
||||
$fields = ['sepa-cc', 'sepa-ct-op', 'sepa-ct-id', 'sepa-db', 'sepa-country', 'sepa-ep', 'sepa-ci', 'interest_date', 'book_date', 'process_date',
|
||||
'due_date', 'recurrence_id', 'payment_date', 'invoice_date', 'internal_reference', 'bunq_payment_id', 'importHash', 'importHashV2',
|
||||
'external_id', 'sepa-batch-id'];
|
||||
'external_id', 'sepa-batch-id','original-source'];
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$this->storeMeta($journal, $data, $field);
|
||||
|
@ -75,6 +75,7 @@ class JournalFormRequest extends Request
|
||||
'piggy_bank_name' => null,
|
||||
'bill_id' => null,
|
||||
'bill_name' => null,
|
||||
'original-source' => sprintf('gui-v%s', config('firefly.version')),
|
||||
|
||||
// transaction data:
|
||||
'transactions' => [
|
||||
|
@ -182,10 +182,10 @@ class ImportTransaction
|
||||
}
|
||||
|
||||
$meta = ['sepa-ct-id', 'sepa-ct-op', 'sepa-db', 'sepa-cc', 'sepa-country', 'sepa-batch-id', 'sepa-ep', 'sepa-ci', 'internal-reference', 'date-interest',
|
||||
'date-invoice', 'date-book', 'date-payment', 'date-process', 'date-due',];
|
||||
'date-invoice', 'date-book', 'date-payment', 'date-process', 'date-due','original-source'];
|
||||
Log::debug(sprintf('Now going to check role "%s".', $role));
|
||||
if (\in_array($role, $meta, true)) {
|
||||
Log::debug(sprintf('Role "%s" is in allowed meta roles, so store its value %s.', $role, $columnValue->getValue()));
|
||||
Log::debug(sprintf('Role "%s" is in allowed meta roles, so store its value "%s".', $role, $columnValue->getValue()));
|
||||
$this->meta[$role] = $columnValue->getValue();
|
||||
|
||||
return;
|
||||
|
@ -173,6 +173,7 @@ class StageImportDataHandler
|
||||
'external_id' => $paymentId,
|
||||
'notes' => null,
|
||||
'bunq_payment_id' => $paymentId,
|
||||
'original-source' => sprintf('bunq-v%s', config('firefly.version')),
|
||||
'transactions' => [
|
||||
// single transaction:
|
||||
[
|
||||
|
@ -61,6 +61,7 @@ class StageFinalHandler
|
||||
'piggy_bank_name' => null,
|
||||
'bill_id' => null,
|
||||
'bill_name' => null,
|
||||
'original-source' => sprintf('fake-import-v%s', config('firefly.version')),
|
||||
|
||||
// transaction data:
|
||||
'transactions' => [
|
||||
|
@ -235,7 +235,7 @@ class ImportableConverter
|
||||
'payment_date' => $this->convertDateValue($importable->meta['date-payment'] ?? null),
|
||||
'invoice_date' => $this->convertDateValue($importable->meta['date-invoice'] ?? null),
|
||||
'external_id' => $importable->externalId,
|
||||
|
||||
'original-source' => $importable->meta['original-source'] ?? null,
|
||||
// journal data:
|
||||
'description' => $importable->description,
|
||||
'piggy_bank_id' => null,
|
||||
|
@ -201,6 +201,12 @@ class MappingConverger
|
||||
Log::debug('Column skipped because value is empty.');
|
||||
}
|
||||
}
|
||||
// add a special column value for the "source"
|
||||
$columnValue = new ColumnValue;
|
||||
$columnValue->setValue(sprintf('csv-import-v%s', config('firefly.version')));
|
||||
$columnValue->setMappedValue(0);
|
||||
$columnValue->setRole('original-source');
|
||||
$return[] = $columnValue;
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
@ -189,6 +189,7 @@ class StageImportDataHandler
|
||||
'piggy_bank_name' => null,
|
||||
'bill_id' => null,
|
||||
'bill_name' => null,
|
||||
'original-source' => sprintf('spectre-v%s', config('firefly.version')),
|
||||
|
||||
// transaction data:
|
||||
'transactions' => [
|
||||
|
@ -173,6 +173,7 @@ class ImportDataHandler
|
||||
'piggy_bank_name' => null,
|
||||
'bill_id' => null,
|
||||
'bill_name' => null,
|
||||
'original-source' => sprintf('ynab-v%s', config('firefly.version')),
|
||||
|
||||
// transaction data:
|
||||
'transactions' => [
|
||||
|
Loading…
Reference in New Issue
Block a user