mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed #658
This commit is contained in:
parent
19774f32c2
commit
de9728895e
@ -95,9 +95,9 @@ class SingleController extends Controller
|
|||||||
$categoryName = is_null($category) ? '' : $category->name;
|
$categoryName = is_null($category) ? '' : $category->name;
|
||||||
$tags = join(',', $journal->tags()->get()->pluck('tag')->toArray());
|
$tags = join(',', $journal->tags()->get()->pluck('tag')->toArray());
|
||||||
/** @var Transaction $transaction */
|
/** @var Transaction $transaction */
|
||||||
$transaction = $journal->transactions()->first();
|
$transaction = $journal->transactions()->first();
|
||||||
$amount = Steam::positive($transaction->amount);
|
$amount = Steam::positive($transaction->amount);
|
||||||
$foreignAmount = is_null($transaction->foreign_amount) ? null : Steam::positive($transaction->foreign_amount);
|
$foreignAmount = is_null($transaction->foreign_amount) ? null : Steam::positive($transaction->foreign_amount);
|
||||||
|
|
||||||
$preFilled = [
|
$preFilled = [
|
||||||
'description' => $journal->description,
|
'description' => $journal->description,
|
||||||
@ -109,6 +109,7 @@ class SingleController extends Controller
|
|||||||
'source_amount' => $amount,
|
'source_amount' => $amount,
|
||||||
'destination_amount' => $foreignAmount,
|
'destination_amount' => $foreignAmount,
|
||||||
'foreign_amount' => $foreignAmount,
|
'foreign_amount' => $foreignAmount,
|
||||||
|
'native_amount' => $foreignAmount,
|
||||||
'amount_currency_id_amount' => $transaction->foreign_currency_id ?? 0,
|
'amount_currency_id_amount' => $transaction->foreign_currency_id ?? 0,
|
||||||
'date' => $journal->date->format('Y-m-d'),
|
'date' => $journal->date->format('Y-m-d'),
|
||||||
'budget_id' => $budgetId,
|
'budget_id' => $budgetId,
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
/** global: Modernizr, accountInfo, currencyInfo, accountInfo, transferInstructions, what */
|
/** global: Modernizr, accountInfo, currencyInfo, accountInfo, transferInstructions, what */
|
||||||
|
|
||||||
|
var countConversions = 0;
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
setCommonAutocomplete();
|
setCommonAutocomplete();
|
||||||
@ -118,6 +120,12 @@ function convertForeignToNative() {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
function updateNativeAmount(data) {
|
function updateNativeAmount(data) {
|
||||||
|
// if native amount is already filled in, even though we do this for the first time:
|
||||||
|
// don't overrule it.
|
||||||
|
if(countConversions === 0 && $('#ffInput_native_amount').val().length > 0) {
|
||||||
|
countConversions++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
$('#ffInput_native_amount').val(data.amount);
|
$('#ffInput_native_amount').val(data.amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,6 @@ function updateNativeCurrency(useAccountCurrency) {
|
|||||||
if (what !== 'transfer') {
|
if (what !== 'transfer') {
|
||||||
$('select[name="source_account_id"]').focus();
|
$('select[name="source_account_id"]').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
validateCurrencyForTransfer();
|
validateCurrencyForTransfer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user