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