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 () {
|
||||
let transactionType = this.transactionType;
|
||||
// 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) {
|
||||
$(this.$refs.cur).text('');
|
||||
|
||||
@ -82,15 +79,35 @@
|
||||
$(this.$refs.cur).text(this.destination.currency_name);
|
||||
return;
|
||||
}
|
||||
// for normal transactions, the source leads the currency
|
||||
if (transactionType.toLowerCase() === 'withdrawal' ||
|
||||
transactionType.toLowerCase() === 'reconciliation' ||
|
||||
transactionType.toLowerCase() === 'transfer') {
|
||||
$(this.$refs.cur).text(this.source.currency_name);
|
||||
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);
|
||||
}
|
||||
// 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: {
|
||||
|
@ -21,14 +21,10 @@
|
||||
<template>
|
||||
<!--
|
||||
Show if:
|
||||
- more than one currency enabled, always show
|
||||
- if just one, but is deposit or withdrawal
|
||||
- one or more currencies.
|
||||
-->
|
||||
<div class="form-group" v-bind:class="{ 'has-error': hasError()}" v-if="
|
||||
this.enabledCurrencies.length > 1 ||
|
||||
(this.enabledCurrencies.length >= 1 && ('deposit' === this.transactionType.toLowerCase() || 'withdrawal' === this.transactionType.toLowerCase()))
|
||||
|
||||
">
|
||||
this.enabledCurrencies.length >= 1">
|
||||
<div class="col-sm-8 col-sm-offset-4 text-sm">
|
||||
{{ $t('form.foreign_amount') }}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user