mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #2876
This commit is contained in:
parent
55175da316
commit
1e7de48f59
2
public/v1/js/app.js
vendored
2
public/v1/js/app.js
vendored
File diff suppressed because one or more lines are too long
@ -121,6 +121,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
|
<!-- -->
|
||||||
<amount
|
<amount
|
||||||
:source="transaction.source_account"
|
:source="transaction.source_account"
|
||||||
:destination="transaction.destination_account"
|
:destination="transaction.destination_account"
|
||||||
@ -221,6 +222,10 @@
|
|||||||
}
|
}
|
||||||
return amount;
|
return amount;
|
||||||
},
|
},
|
||||||
|
roundNumber(amount, decimals) {
|
||||||
|
let multiplier = Math.pow(10, decimals);
|
||||||
|
return Math.round(amount * multiplier) / multiplier;
|
||||||
|
},
|
||||||
selectedSourceAccount(index, model) {
|
selectedSourceAccount(index, model) {
|
||||||
if (typeof model === 'string') {
|
if (typeof model === 'string') {
|
||||||
// cant change types, only name.
|
// cant change types, only name.
|
||||||
@ -367,20 +372,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.transactions.push({
|
this.transactions.push({
|
||||||
transaction_journal_id: transaction.transaction_journal_id,
|
transaction_journal_id: transaction.transaction_journal_id,
|
||||||
description: transaction.description,
|
description: transaction.description,
|
||||||
date: transaction.date.substr(0, 10),
|
date: transaction.date.substr(0, 10),
|
||||||
amount: this.positiveAmount(transaction.amount),
|
amount: this.roundNumber(this.positiveAmount(transaction.amount), transaction.currency_decimal_places),
|
||||||
category: transaction.category_name,
|
category: transaction.category_name,
|
||||||
errors: {
|
errors: {
|
||||||
source_account: [],
|
source_account: [],
|
||||||
destination_account: [],
|
destination_account: [],
|
||||||
description: [],
|
description: [],
|
||||||
amount: [],
|
amount: [],
|
||||||
date: [],
|
date: [],
|
||||||
budget_id: [],
|
budget_id: [],
|
||||||
foreign_amount: [],
|
foreign_amount: [],
|
||||||
category: [],
|
category: [],
|
||||||
piggy_bank: [],
|
piggy_bank: [],
|
||||||
tags: [],
|
tags: [],
|
||||||
// custom fields:
|
// custom fields:
|
||||||
@ -409,7 +414,7 @@
|
|||||||
notes: transaction.notes
|
notes: transaction.notes
|
||||||
},
|
},
|
||||||
foreign_amount: {
|
foreign_amount: {
|
||||||
amount: this.positiveAmount(transaction.foreign_amount),
|
amount: this.roundNumber(this.positiveAmount(transaction.foreign_amount), transaction.foreign_currency_decimal_places),
|
||||||
currency_id: transaction.foreign_currency_id
|
currency_id: transaction.foreign_currency_id
|
||||||
},
|
},
|
||||||
source_account: {
|
source_account: {
|
||||||
|
Loading…
Reference in New Issue
Block a user