From 80b22a4e7dd1160e9c9cc71df01dcb13715cc629 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Thu, 8 Mar 2018 09:47:56 +0100 Subject: [PATCH] Bug #157 Sumario de item mostrar iva --- client/item/src/summary/item-summary.html | 12 +++++++++--- client/item/src/summary/item-summary.js | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/client/item/src/summary/item-summary.html b/client/item/src/summary/item-summary.html index 71c5c720b..7ad31fd9d 100644 --- a/client/item/src/summary/item-summary.html +++ b/client/item/src/summary/item-summary.html @@ -32,14 +32,20 @@ -
Tags
-

- {{tag.tag.name}}: {{tag.value}} +

Tax
+

+ {{tax.country.country}}: {{tax.taxClass.description}}

+ +
Tags
+

+ {{tag.tag.name}}: {{tag.value}} +

+
Nicho
diff --git a/client/item/src/summary/item-summary.js b/client/item/src/summary/item-summary.js index 054a5d0f3..401d70f0a 100644 --- a/client/item/src/summary/item-summary.js +++ b/client/item/src/summary/item-summary.js @@ -17,6 +17,25 @@ class ItemSummary { }); } + _getTaxes() { + let filter = { + fields: ['id', 'countryFk', 'taxClassFk'], + include: [{ + relation: 'country', + scope: {fields: ['country']} + }, { + relation: 'taxClass', + scope: {fields: ['id', 'description']} + }] + }; + + let urlFilter = encodeURIComponent(JSON.stringify(filter)); + let url = `/item/api/Items/${this.item.id}/taxes?filter=${urlFilter}`; + this.$http.get(url).then(json => { + this.taxes = json.data; + }); + } + _getBotanical() { let filter = { where: {itemFk: this.item.id}, @@ -58,6 +77,7 @@ class ItemSummary { this._getTags(); this._getBarcodes(); this._getNiches(); + this._getTaxes(); if (!this.item.botanical) this._getBotanical(); }