From 3bb89e02133d4cea7b3019aa7a2f3c5541f8b085 Mon Sep 17 00:00:00 2001
From: Dmitriy Petrov
Date: Sat, 9 May 2020 20:55:30 +0300
Subject: [PATCH] RCW-7 created a method for converting the price to two
characters and added it to different components
---
receipt-web/src/components/ReceiptCard.vue | 10 ++++++----
.../pages/ReceiptPage/ReceiptItems.vue | 9 ++++++++-
.../pages/ReceiptPage/ReceiptMeta.vue | 5 +++--
receipt-web/src/components/utils/truncated.js | 17 +++++++++++++++++
4 files changed, 34 insertions(+), 7 deletions(-)
create mode 100644 receipt-web/src/components/utils/truncated.js
diff --git a/receipt-web/src/components/ReceiptCard.vue b/receipt-web/src/components/ReceiptCard.vue
index 1ffab38..37841f7 100644
--- a/receipt-web/src/components/ReceiptCard.vue
+++ b/receipt-web/src/components/ReceiptCard.vue
@@ -6,7 +6,7 @@
{{date.format("DD.MM.YYYY HH:mm")}}
- {{receipt.sum}} рублей.
+ {{totalSum}} рублей.
Открыть
@@ -14,7 +14,8 @@
-
diff --git a/receipt-web/src/components/pages/ReceiptPage/ReceiptItems.vue b/receipt-web/src/components/pages/ReceiptPage/ReceiptItems.vue
index 7487825..017fe31 100644
--- a/receipt-web/src/components/pages/ReceiptPage/ReceiptItems.vue
+++ b/receipt-web/src/components/pages/ReceiptPage/ReceiptItems.vue
@@ -11,12 +11,14 @@
{{item.text}} |
{{item.price}} р. |
- × {{item.amount}} |
+ × {{totalSum(item.amount)}} |
diff --git a/receipt-web/src/components/pages/ReceiptPage/ReceiptMeta.vue b/receipt-web/src/components/pages/ReceiptPage/ReceiptMeta.vue
index b8298ca..0ff9a4a 100644
--- a/receipt-web/src/components/pages/ReceiptPage/ReceiptMeta.vue
+++ b/receipt-web/src/components/pages/ReceiptPage/ReceiptMeta.vue
@@ -9,7 +9,8 @@