mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 18:25:00 -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;
|
||||
$tags = join(',', $journal->tags()->get()->pluck('tag')->toArray());
|
||||
/** @var Transaction $transaction */
|
||||
$transaction = $journal->transactions()->first();
|
||||
$amount = Steam::positive($transaction->amount);
|
||||
$foreignAmount = is_null($transaction->foreign_amount) ? null : Steam::positive($transaction->foreign_amount);
|
||||
$transaction = $journal->transactions()->first();
|
||||
$amount = Steam::positive($transaction->amount);
|
||||
$foreignAmount = is_null($transaction->foreign_amount) ? null : Steam::positive($transaction->foreign_amount);
|
||||
|
||||
$preFilled = [
|
||||
'description' => $journal->description,
|
||||
@ -109,6 +109,7 @@ class SingleController extends Controller
|
||||
'source_amount' => $amount,
|
||||
'destination_amount' => $foreignAmount,
|
||||
'foreign_amount' => $foreignAmount,
|
||||
'native_amount' => $foreignAmount,
|
||||
'amount_currency_id_amount' => $transaction->foreign_currency_id ?? 0,
|
||||
'date' => $journal->date->format('Y-m-d'),
|
||||
'budget_id' => $budgetId,
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/** global: Modernizr, accountInfo, currencyInfo, accountInfo, transferInstructions, what */
|
||||
|
||||
var countConversions = 0;
|
||||
|
||||
$(document).ready(function () {
|
||||
"use strict";
|
||||
setCommonAutocomplete();
|
||||
@ -118,6 +120,12 @@ function convertForeignToNative() {
|
||||
* @param 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);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,6 @@ function updateNativeCurrency(useAccountCurrency) {
|
||||
if (what !== 'transfer') {
|
||||
$('select[name="source_account_id"]').focus();
|
||||
}
|
||||
|
||||
validateCurrencyForTransfer();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user