mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #738
This commit is contained in:
parent
bd924b993b
commit
2609f3425b
@ -107,7 +107,8 @@ class SplitController extends Controller
|
|||||||
// account array to display currency info:
|
// account array to display currency info:
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
foreach ($accountList as $account) {
|
foreach ($accountList as $account) {
|
||||||
$accountArray[$account->id] = $account;
|
$accountArray[$account->id] = $account;
|
||||||
|
$accountArray[$account->id]['currency_id'] = intval($account->getMeta('currency_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ class SplitController extends Controller
|
|||||||
compact(
|
compact(
|
||||||
'subTitleIcon', 'currencies', 'optionalFields',
|
'subTitleIcon', 'currencies', 'optionalFields',
|
||||||
'preFilled', 'subTitle', 'uploadSize', 'assetAccounts',
|
'preFilled', 'subTitle', 'uploadSize', 'assetAccounts',
|
||||||
'budgets', 'journal','accountArray'
|
'budgets', 'journal', 'accountArray'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** global: originalSum, accounting, what, Modernizr */
|
/** global: originalSum, accounting, what, Modernizr, currencySymbol */
|
||||||
|
|
||||||
var destAccounts = {};
|
var destAccounts = {};
|
||||||
var srcAccounts = {};
|
var srcAccounts = {};
|
||||||
@ -231,13 +231,14 @@ function calculateSum() {
|
|||||||
sum = Math.round(sum * 100) / 100;
|
sum = Math.round(sum * 100) / 100;
|
||||||
left = Math.round(left * 100) / 100;
|
left = Math.round(left * 100) / 100;
|
||||||
|
|
||||||
|
|
||||||
$('.amount-warning').remove();
|
$('.amount-warning').remove();
|
||||||
if (sum !== originalSum) {
|
if (sum !== originalSum) {
|
||||||
var holder = $('#journal_amount_holder');
|
var holder = $('#journal_amount_holder');
|
||||||
var par = holder.find('p.form-control-static');
|
var par = holder.find('p.form-control-static');
|
||||||
$('<span>').text(' (' + accounting.formatMoney(sum) + ')').addClass('text-danger amount-warning').appendTo(par);
|
$('<span>').text(' (' + accounting.formatMoney(sum, currencySymbol) + ')').addClass('text-danger amount-warning').appendTo(par);
|
||||||
// also add what's left to divide (or vice versa)
|
// also add what's left to divide (or vice versa)
|
||||||
$('<span>').text(' (' + accounting.formatMoney(left) + ')').addClass('text-danger amount-warning').appendTo(par);
|
$('<span>').text(' (' + accounting.formatMoney(left, currencySymbol) + ')').addClass('text-danger amount-warning').appendTo(par);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -250,7 +250,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# amount#}
|
{# amount#}
|
||||||
|
{% if transaction.foreign_amount != null %}
|
||||||
<div class="col-lg-1 col-md-5 col-sm-12 col-xs-12">
|
<div class="col-lg-1 col-md-5 col-sm-12 col-xs-12">
|
||||||
|
{% else %}
|
||||||
|
<div class="col-lg-2 col-md-5 col-sm-12 col-xs-12">
|
||||||
|
{% endif %}
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-addon">{{ transaction.transaction_currency_symbol }}</div>
|
<div class="input-group-addon">{{ transaction.transaction_currency_symbol }}</div>
|
||||||
<input type="number" name="transactions[{{ loop.index0 }}][amount]" value="{{ transaction.amount }}"
|
<input type="number" name="transactions[{{ loop.index0 }}][amount]" value="{{ transaction.amount }}"
|
||||||
@ -261,21 +265,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# foreign amount #}
|
{# foreign amount #}
|
||||||
|
{% if transaction.foreign_amount != null %}
|
||||||
<div class="col-lg-1 col-md-7 col-sm-12 col-xs-12">
|
<div class="col-lg-1 col-md-7 col-sm-12 col-xs-12">
|
||||||
{% if transaction.foreign_amount != null %}
|
<div class="input-group">
|
||||||
|
<div class="input-group-addon">{{ transaction.foreign_currency_symbol }}</div>
|
||||||
|
<input type="number" name="transactions[{{ loop.index0 }}][foreign_amount]"
|
||||||
|
value="{{ transaction.foreign_amount }}"
|
||||||
|
class="form-control" autocomplete="off" step="any">
|
||||||
|
</div>
|
||||||
|
<input type="hidden"
|
||||||
|
name="transactions[{{ loop.index0 }}][foreign_currency_id]"
|
||||||
|
value="{{ transaction.foreign_currency_id }}">
|
||||||
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-addon">{{ transaction.foreign_currency_symbol }}</div>
|
|
||||||
<input type="number" name="transactions[{{ loop.index0 }}][foreign_amount]"
|
|
||||||
value="{{ transaction.foreign_amount }}"
|
|
||||||
class="form-control" autocomplete="off" step="any">
|
|
||||||
</div>
|
|
||||||
<input type="hidden"
|
|
||||||
name="transactions[{{ loop.index0 }}][foreign_currency_id]"
|
|
||||||
value="{{ transaction.foreign_currency_id }}">
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# budget #}
|
{# budget #}
|
||||||
{% if preFilled.what == 'withdrawal' %}
|
{% if preFilled.what == 'withdrawal' %}
|
||||||
@ -330,7 +333,15 @@
|
|||||||
<link href="css/jquery-ui/jquery-ui.theme.min.css" type="text/css" rel="stylesheet" media="all">
|
<link href="css/jquery-ui/jquery-ui.theme.min.css" type="text/css" rel="stylesheet" media="all">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
<script type="text/javascript" src="{{ route('javascript.currencies') }}?ext=.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var currencySymbol = 'x';
|
||||||
|
{% if preFilled.what == 'withdrawal' or preFilled.what == 'transfer' %}
|
||||||
|
currencySymbol = currencyInfo[{{ accountArray[preFilled.journal_source_account_id].currency_id }}].symbol;
|
||||||
|
{% endif %}
|
||||||
|
{% if preFilled.what == 'deposit' %}
|
||||||
|
currencySymbol = currencyInfo[{{ accountArray[preFilled.journal_destination_account_id].currency_id }}].symbol;
|
||||||
|
{% endif %}
|
||||||
var originalSum = {{ preFilled.journal_amount }};
|
var originalSum = {{ preFilled.journal_amount }};
|
||||||
var what = "{{ preFilled.what }}";
|
var what = "{{ preFilled.what }}";
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user