Bug #157 Sumario de item mostrar iva

This commit is contained in:
Daniel Herrero 2018-03-08 09:47:56 +01:00
parent 94bbbef2d0
commit 80b22a4e7d
2 changed files with 29 additions and 3 deletions

View File

@ -32,14 +32,20 @@
</vn-one> </vn-one>
<vn-one margin-medium> <vn-one margin-medium>
<vn-vertical> <vn-vertical>
<h5 translate>Tags</h5> <h5 translate>Tax</h5>
<p ng-repeat="tag in $ctrl.tags track by tag.id"> <p ng-repeat="tax in $ctrl.taxes track by $index">
<span translate>{{tag.tag.name}}</span>: <b>{{tag.value}}</b> <span translate>{{tax.country.country}}</span>: <b>{{tax.taxClass.description}}</b>
</p> </p>
</vn-vertical> </vn-vertical>
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-one margin-medium>
<h5 translate>Tags</h5>
<p ng-repeat="tag in $ctrl.tags track by tag.id">
<span translate>{{tag.tag.name}}</span>: <b>{{tag.value}}</b>
</p>
</vn-one>
<vn-one margin-medium> <vn-one margin-medium>
<vn-vertical> <vn-vertical>
<h5 translate>Nicho</h5> <h5 translate>Nicho</h5>

View File

@ -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() { _getBotanical() {
let filter = { let filter = {
where: {itemFk: this.item.id}, where: {itemFk: this.item.id},
@ -58,6 +77,7 @@ class ItemSummary {
this._getTags(); this._getTags();
this._getBarcodes(); this._getBarcodes();
this._getNiches(); this._getNiches();
this._getTaxes();
if (!this.item.botanical) if (!this.item.botanical)
this._getBotanical(); this._getBotanical();
} }