Payé par
@@ -290,6 +290,7 @@ export default class TransactionCreate extends Vue {
mainCurrency: this.currency,
currencies: this.account.currencies,
transactionType: TransactionType.normal,
+ location: this.transaction.location,
exchange: await exchangeService.get(this.currency.code, date, currencies)
}
const response: PouchDB.Core.Response = hasId
diff --git a/src/services/MapService.ts b/src/services/MapService.ts
index 7d4698e..6eeb9c6 100644
--- a/src/services/MapService.ts
+++ b/src/services/MapService.ts
@@ -23,9 +23,7 @@ class MapService {
}
private url(latitude: number, longitude: number) {
- return `https://dev.virtualearth.net/REST/v1/Locations/${latitude},${longitude}?key=${
- this.key
- }`
+ return `https://dev.virtualearth.net/REST/v1/Locations/${latitude},${longitude}?key=${this.key}`
}
}
diff --git a/src/views/transactions/TransactionItem.vue b/src/views/transactions/TransactionItem.vue
index a1cb3b9..7197eaa 100644
--- a/src/views/transactions/TransactionItem.vue
+++ b/src/views/transactions/TransactionItem.vue
@@ -25,92 +25,96 @@
-
{{ transaction.date | fulldate }}
-
- Dépense payée par
- {{ transaction.payBy }}
- pour
- {{ payForLabel.join(', ') }}
- d'une somme de
- {{
- transaction.amount | money(transaction.mainCurrency)
- }} .
-
-
-
-
-
- Taux d'échange le {{ transaction.date | fulldate }}
-
-
-
-
-
- {{
- transaction.amount | money(transaction.mainCurrency)
- }}
-
-
-
-
- {{
- (transaction.amount *
- transaction.exchange.rates[currency.code])
- | moneypad(currency)
- }}
-
-
-
-
-
-
-
-
- {{
- 1 | money(transaction.mainCurrency)
- }}
-
-
-
-
- {{
- transaction.exchange.rates[currency.code]
- | moneypad(currency)
- }}
-
-
-
-
-
-
-
-
- {{
- $tc('transaction.money', currencies.length)
- }}
-
-
-
- {{ 1 | money(currency) }}
-
- {{
- (1 / transaction.exchange.rates[currency.code])
- | moneypad(transaction.mainCurrency)
- }}
-
-
-
-
+
+
+
{{ transaction.date | fulldate }}
+
+ Dépense payée par
+ {{ transaction.payBy }}
+
+ pour
+ {{ payForLabel.join(', ') }}
+
+
+ à {{ transaction.location.place }}
+
+ d'une somme de
+ {{
+ transaction.amount | money(transaction.mainCurrency)
+ }}
+ .
+
+
+
+
+
+ Taux d'échange
+
+
+
+
+
+ {{
+ transaction.amount | money(transaction.mainCurrency)
+ }}
+
+
+
+
+ {{
+ (transaction && transaction.amount) ||
+ (1 * getRate(currency.code)) | moneypad(currency)
+ }}
+
+
+
+
+
+
+
+
+ {{
+ 1 | money(transaction.mainCurrency)
+ }}
+
+
+
+
+ {{ getRate(currency.code) | moneypad(currency) }}
+
+
+
+
+
+
+
+
+ {{
+ $tc('transaction.money', currencies.length)
+ }}
+
+
+
+ {{ 1 | money(currency) }}
+
+ {{
+ (1 / getRate(currency.code))
+ | moneypad(transaction && transaction.mainCurrency)
+ }}
+
+
+
+
+
-
-
-
Le taux d'échange n'a pas pu
- être récupéré.
+
+
+ Le taux d'échange n'a pas pu être récupéré.
+
modifier
- supprimer
+ modifier
+
+
+ supprimer
+
@@ -227,6 +232,22 @@ export default class TransactionItem extends Vue {
}
}
+ public getRate(code: string) {
+ return (
+ (this.transaction &&
+ this.transaction.exchange &&
+ this.transaction.exchange.rates[code]) ||
+ 1
+ )
+ }
+
+ public uniqueUser() {
+ if (!this.transaction) {
+ return false
+ }
+ return this.transaction.payBy === this.payForLabel.join(',')
+ }
+
public get accountId(): string {
return (this.transaction && this.transaction.accountId) || ''
}
@@ -303,7 +324,8 @@ table.table {
.buttons {
margin-top: 15px;
}
-.pay-by {
+.pay-by,
+.pay-for {
font-weight: bold;
}
.numeric {