mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Import routine can handle new SEPA fields and many new date fields. See #1248
This commit is contained in:
@@ -54,6 +54,8 @@ class ImportJournal
|
||||
public $hash;
|
||||
/** @var array */
|
||||
public $metaDates = [];
|
||||
/** @var array */
|
||||
public $metaFields = [];
|
||||
/** @var string */
|
||||
public $notes = '';
|
||||
/** @var ImportAccount */
|
||||
@@ -192,6 +194,18 @@ class ImportJournal
|
||||
case 'account-id':
|
||||
$this->asset->setAccountId($array);
|
||||
break;
|
||||
case 'sepa-cc':
|
||||
case 'sepa-ct-op':
|
||||
case 'sepa-ct-id':
|
||||
case 'sepa-db':
|
||||
case 'sepa-country':
|
||||
case 'sepa-ep':
|
||||
case 'sepa-ci':
|
||||
$value = trim(strval($array['value']));
|
||||
if (strlen($value) > 0) {
|
||||
$this->metaFields[$array['role']] = $value;
|
||||
}
|
||||
break;
|
||||
case 'amount':
|
||||
$this->amount = $array;
|
||||
break;
|
||||
@@ -252,12 +266,6 @@ class ImportJournal
|
||||
case 'description':
|
||||
$this->description .= $array['value'];
|
||||
break;
|
||||
case 'sepa-ct-op':
|
||||
case 'sepa-ct-id':
|
||||
case 'sepa-db':
|
||||
$this->notes .= ' ' . $array['value'];
|
||||
$this->notes = trim($this->notes);
|
||||
break;
|
||||
case 'note':
|
||||
$this->notes .= ' ' . $array['value'];
|
||||
$this->notes = trim($this->notes);
|
||||
@@ -265,6 +273,9 @@ class ImportJournal
|
||||
case 'external-id':
|
||||
$this->externalId = $array['value'];
|
||||
break;
|
||||
case 'internal-reference':
|
||||
$this->metaFields['internal_reference'] = $array['value'];
|
||||
break;
|
||||
case '_ignore':
|
||||
break;
|
||||
case 'ing-debit-credit':
|
||||
@@ -299,6 +310,15 @@ class ImportJournal
|
||||
case 'date-process':
|
||||
$this->metaDates['process_date'] = $array['value'];
|
||||
break;
|
||||
case 'date-due':
|
||||
$this->metaDates['due_date'] = $array['value'];
|
||||
break;
|
||||
case 'date-payment':
|
||||
$this->metaDates['payment_date'] = $array['value'];
|
||||
break;
|
||||
case 'date-invoice':
|
||||
$this->metaDates['invoice_date'] = $array['value'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user