. */ declare(strict_types=1); namespace FireflyIII\Import\Converter; use Log; /** * * Class BankDebitCredit */ class BankDebitCredit implements ConverterInterface { /** * Convert a value. * * @return mixed * * @param $value */ public function convert($value): int { Log::debug('Going to convert ', ['value' => $value]); $negative = [ 'D', // Old style Rabobank (NL). Short for "Debit" 'A', // New style Rabobank (NL). Short for "Af" 'DR', // https://old.reddit.com/r/FireflyIII/comments/bn2edf/generic_debitcredit_indicator/ 'Af', // ING (NL). 'Debet', // Triodos (NL) 'S', // "Soll", German term for debit ]; if (in_array(trim($value), $negative, true)) { return -1; } return 1; } }