mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
This commit is contained in:
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
2
public/v1/js/profile.js
vendored
2
public/v1/js/profile.js
vendored
File diff suppressed because one or more lines are too long
@@ -23,8 +23,7 @@
|
||||
Show if:
|
||||
- one or more currencies.
|
||||
-->
|
||||
<div class="form-group" v-bind:class="{ 'has-error': hasError()}" v-if="
|
||||
this.enabledCurrencies.length >= 1">
|
||||
<div class="form-group" v-bind:class="{ 'has-error': hasError()}" v-if="this.enabledCurrencies.length >= 1">
|
||||
<div class="col-sm-8 col-sm-offset-4 text-sm">
|
||||
{{ $t('form.foreign_amount') }}
|
||||
</div>
|
||||
@@ -62,7 +61,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
export default {
|
||||
name: "ForeignAmountSelect",
|
||||
|
||||
props: ['source', 'destination', 'transactionType', 'value', 'error', 'no_currency', 'title',],
|
||||
@@ -120,8 +119,8 @@
|
||||
this.enabledCurrencies = [];
|
||||
let destType = this.destination.type ? this.destination.type.toLowerCase() : 'invalid';
|
||||
let srcType = this.source.type ? this.source.type.toLowerCase() : 'invalid';
|
||||
let tType =this.transactionType ? this.transactionType.toLowerCase() : 'invalid';
|
||||
let liabilities = ['loan','debt','mortgage'];
|
||||
let tType = this.transactionType ? this.transactionType.toLowerCase() : 'invalid';
|
||||
let liabilities = ['loan', 'debt', 'mortgage'];
|
||||
let sourceIsLiability = liabilities.indexOf(srcType) !== -1;
|
||||
let destIsLiability = liabilities.indexOf(destType) !== -1;
|
||||
|
||||
@@ -129,17 +128,21 @@
|
||||
// console.log(destType + ' (dest) is a liability: ' + destIsLiability);
|
||||
|
||||
if (tType === 'transfer' || destIsLiability || sourceIsLiability) {
|
||||
//console.log('Source is liability OR dest is liability, OR transfer. Lock list on currency of destination.');
|
||||
console.log('Source is liability OR dest is liability, OR transfer. Lock list on currency of destination.');
|
||||
console.log('Length of currencies is ' + this.currencies.length);
|
||||
console.log(this.currencies);
|
||||
this.liability = true;
|
||||
// lock dropdown list on on currencyID of destination.
|
||||
for (const key in this.currencies) {
|
||||
if (this.currencies.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||
if (this.currencies[key].id === this.destination.currency_id) {
|
||||
console.log('this.currencies[key].id = ' + this.currencies[key].id);
|
||||
console.log('this.destination.currency_id = ' + this.destination.currency_id);
|
||||
if (parseInt(this.currencies[key].id) === parseInt(this.destination.currency_id)) {
|
||||
this.enabledCurrencies.push(this.currencies[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//console.log('Enabled currencies length is now ' + this.enabledCurrencies.length);
|
||||
console.log('Enabled currencies length is now ' + this.enabledCurrencies.length);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,11 +207,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(this.enabledCurrencies);
|
||||
console.log(this.enabledCurrencies);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
Reference in New Issue
Block a user