mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #1088
This commit is contained in:
parent
0ae8418f32
commit
f326f08f7b
@ -220,7 +220,7 @@ class UpgradeDatabase extends Command
|
||||
|
||||
// when mismatch in transaction:
|
||||
if (!(intval($transaction->transaction_currency_id) === intval($currency->id))) {
|
||||
$transaction->foreign_currency_id = $transaction->transaction_currency_id;
|
||||
$transaction->foreign_currency_id = intval($transaction->transaction_currency_id);
|
||||
$transaction->foreign_amount = $transaction->amount;
|
||||
$transaction->transaction_currency_id = $currency->id;
|
||||
$transaction->save();
|
||||
|
@ -272,7 +272,7 @@ class TransactionController extends Controller
|
||||
$return = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$currencyId = $transaction->transaction_currency_id;
|
||||
$currencyId = intval($transaction->transaction_currency_id);
|
||||
|
||||
// save currency information:
|
||||
if (!isset($return[$currencyId])) {
|
||||
|
@ -121,10 +121,10 @@ trait ImportSupport
|
||||
{
|
||||
$transaction = new Transaction;
|
||||
$transaction->account_id = $parameters['account'];
|
||||
$transaction->transaction_journal_id = $parameters['id'];
|
||||
$transaction->transaction_currency_id = $parameters['currency'];
|
||||
$transaction->transaction_journal_id = intval($parameters['id']);
|
||||
$transaction->transaction_currency_id = intval($parameters['currency']);
|
||||
$transaction->amount = $parameters['amount'];
|
||||
$transaction->foreign_currency_id = $parameters['foreign_currency'];
|
||||
$transaction->foreign_currency_id = intval($parameters['foreign_currency']);
|
||||
$transaction->foreign_amount = $parameters['foreign_amount'];
|
||||
$transaction->save();
|
||||
if (null === $transaction->id) {
|
||||
|
@ -184,11 +184,11 @@ class Steam
|
||||
$modified = null === $entry->modified ? '0' : strval($entry->modified);
|
||||
$foreignModified = null === $entry->modified_foreign ? '0' : strval($entry->modified_foreign);
|
||||
$amount = '0';
|
||||
if ($currencyId === $entry->transaction_currency_id || 0 === $currencyId) {
|
||||
if ($currencyId === intval($entry->transaction_currency_id) || 0 === $currencyId) {
|
||||
// use normal amount:
|
||||
$amount = $modified;
|
||||
}
|
||||
if ($currencyId === $entry->foreign_currency_id) {
|
||||
if ($currencyId === intval($entry->foreign_currency_id)) {
|
||||
// use foreign amount:
|
||||
$amount = $foreignModified;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user