mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Catch some more weird exceptions.
This commit is contained in:
parent
f375934b41
commit
f6ecb143fe
2
public/v1/js/create_transaction.js
vendored
2
public/v1/js/create_transaction.js
vendored
File diff suppressed because one or more lines are too long
2
public/v1/js/edit_transaction.js
vendored
2
public/v1/js/edit_transaction.js
vendored
File diff suppressed because one or more lines are too long
@ -63,9 +63,6 @@
|
|||||||
changeData: function () {
|
changeData: function () {
|
||||||
let transactionType = this.transactionType;
|
let transactionType = this.transactionType;
|
||||||
// reset of all are empty:
|
// reset of all are empty:
|
||||||
//console.log('Type "' + transactionType + '"');
|
|
||||||
//console.log('Source "' + this.source.name + '"');
|
|
||||||
//console.log('Dest "' + this.destination.name + '"');
|
|
||||||
if (!transactionType && !this.source.name && !this.destination.name) {
|
if (!transactionType && !this.source.name && !this.destination.name) {
|
||||||
$(this.$refs.cur).text('');
|
$(this.$refs.cur).text('');
|
||||||
|
|
||||||
@ -82,15 +79,35 @@
|
|||||||
$(this.$refs.cur).text(this.destination.currency_name);
|
$(this.$refs.cur).text(this.destination.currency_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// for normal transactions, the source leads the currency
|
||||||
if (transactionType.toLowerCase() === 'withdrawal' ||
|
if (transactionType.toLowerCase() === 'withdrawal' ||
|
||||||
transactionType.toLowerCase() === 'reconciliation' ||
|
transactionType.toLowerCase() === 'reconciliation' ||
|
||||||
transactionType.toLowerCase() === 'transfer') {
|
transactionType.toLowerCase() === 'transfer') {
|
||||||
$(this.$refs.cur).text(this.source.currency_name);
|
$(this.$refs.cur).text(this.source.currency_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (transactionType === 'Deposit') {
|
// for deposits, the destination leads the currency
|
||||||
|
// but source must not be a liability
|
||||||
|
if (transactionType.toLowerCase() === 'deposit'
|
||||||
|
&&
|
||||||
|
!('debt' === this.source.type.toLowerCase() ||
|
||||||
|
'loan' === this.source.type.toLowerCase() ||
|
||||||
|
'mortgage' === this.source.type.toLowerCase()
|
||||||
|
)
|
||||||
|
) {
|
||||||
$(this.$refs.cur).text(this.destination.currency_name);
|
$(this.$refs.cur).text(this.destination.currency_name);
|
||||||
}
|
}
|
||||||
|
// for deposits, the destination leads the currency
|
||||||
|
// unless source is liability, then source leads:
|
||||||
|
if (transactionType.toLowerCase() === 'deposit'
|
||||||
|
&&
|
||||||
|
('debt' === this.source.type.toLowerCase() ||
|
||||||
|
'loan' === this.source.type.toLowerCase() ||
|
||||||
|
'mortgage' === this.source.type.toLowerCase()
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
$(this.$refs.cur).text(this.source.currency_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -21,14 +21,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--
|
<!--
|
||||||
Show if:
|
Show if:
|
||||||
- more than one currency enabled, always show
|
- one or more currencies.
|
||||||
- if just one, but is deposit or withdrawal
|
|
||||||
-->
|
-->
|
||||||
<div class="form-group" v-bind:class="{ 'has-error': hasError()}" v-if="
|
<div class="form-group" v-bind:class="{ 'has-error': hasError()}" v-if="
|
||||||
this.enabledCurrencies.length > 1 ||
|
this.enabledCurrencies.length >= 1">
|
||||||
(this.enabledCurrencies.length >= 1 && ('deposit' === this.transactionType.toLowerCase() || 'withdrawal' === this.transactionType.toLowerCase()))
|
|
||||||
|
|
||||||
">
|
|
||||||
<div class="col-sm-8 col-sm-offset-4 text-sm">
|
<div class="col-sm-8 col-sm-offset-4 text-sm">
|
||||||
{{ $t('form.foreign_amount') }}
|
{{ $t('form.foreign_amount') }}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user