mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
@@ -74,7 +74,7 @@ class ConfigureRolesHandler implements FileConfigurationInterface
|
||||
if ('_ignore' !== $role) {
|
||||
++$assigned;
|
||||
}
|
||||
if (\in_array($role, ['amount', 'amount_credit', 'amount_debit'])) {
|
||||
if (\in_array($role, ['amount', 'amount_credit', 'amount_debit', 'amount_negated'])) {
|
||||
$hasAmount = true;
|
||||
}
|
||||
if ('foreign-currency-code' === $role) {
|
||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Import\Converter\Amount;
|
||||
use FireflyIII\Import\Converter\AmountCredit;
|
||||
use FireflyIII\Import\Converter\AmountDebit;
|
||||
use FireflyIII\Import\Converter\AmountNegated;
|
||||
use FireflyIII\Import\Converter\ConverterInterface;
|
||||
use Log;
|
||||
|
||||
@@ -51,6 +52,8 @@ class ImportTransaction
|
||||
public $amountCredit;
|
||||
/** @var string */
|
||||
public $amountDebit;
|
||||
/** @var string */
|
||||
public $amountNegated;
|
||||
/** @var int */
|
||||
public $billId;
|
||||
/** @var string */
|
||||
@@ -140,6 +143,7 @@ class ImportTransaction
|
||||
'account-number' => 'accountNumber',
|
||||
'amount_debit' => 'amountDebit',
|
||||
'amount_credit' => 'amountCredit',
|
||||
'amount_negated' => 'amountNegated',
|
||||
'amount' => 'amount',
|
||||
'amount_foreign' => 'foreignAmount',
|
||||
'bill-name' => 'billName',
|
||||
@@ -404,6 +408,11 @@ class ImportTransaction
|
||||
$converterClass = AmountCredit::class;
|
||||
$info['amount'] = $this->amountCredit;
|
||||
}
|
||||
if (null !== $this->amountNegated) {
|
||||
Log::debug('Amount NEGATED value is not NULL, assume this is the correct value (overrules Amount and AmountDebit and AmountCredit).');
|
||||
$converterClass = AmountNegated::class;
|
||||
$info['amount'] = $this->amountNegated;
|
||||
}
|
||||
$info['class'] = $converterClass;
|
||||
|
||||
return $info;
|
||||
|
Reference in New Issue
Block a user