From 7eab262175e45985075be1874ae355bf2c8f25e6 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Tue, 30 Jan 2018 08:59:43 +0100 Subject: [PATCH] CRUD item basic data finish --- client/item/src/card/item-card.js | 4 +++- client/item/src/data/item-data.html | 17 +++++++++++++++++ services/item/common/models/item.json | 5 +++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/client/item/src/card/item-card.js b/client/item/src/card/item-card.js index 063910369..35e8323b4 100644 --- a/client/item/src/card/item-card.js +++ b/client/item/src/card/item-card.js @@ -14,7 +14,9 @@ class ItemCard { {relation: "origin"}, {relation: "ink"}, {relation: "producer"}, - {relation: "intrastat"} + {relation: "intrastat"}, + {relation: "expence"}, + {relation: "taxClass"} ] }; this.$http.get(`/item/api/Items/${this.$state.params.id}?filter=${JSON.stringify(filter)}`).then( diff --git a/client/item/src/data/item-data.html b/client/item/src/data/item-data.html index 35fbf0b1a..16deded6c 100644 --- a/client/item/src/data/item-data.html +++ b/client/item/src/data/item-data.html @@ -23,6 +23,7 @@ show-field="name" value-field="id" field="$ctrl.item.typeFk" + initial-data="$ctrl.item.itemType" > @@ -35,6 +36,7 @@ field="$ctrl.item.intrastatFk" order="description ASC" filter-search="{where: {description: {regexp: 'search'}} }" + initial-data="$ctrl.item.intrastat" > {{$parent.$parent.item.description}} @@ -49,13 +51,28 @@ show-field="name" value-field="id" field="$ctrl.item.originFk" + initial-data="$ctrl.item.origin" > + + {{$parent.$parent.item.description}} + + diff --git a/services/item/common/models/item.json b/services/item/common/models/item.json index 3b0db4753..8cfc618ba 100644 --- a/services/item/common/models/item.json +++ b/services/item/common/models/item.json @@ -75,6 +75,11 @@ "type": "belongsTo", "model": "Expence", "foreignKey": "expenceFk" + }, + "taxClass": { + "type": "belongsTo", + "model": "TaxClass", + "foreignKey": "taxClassFk" } } } \ No newline at end of file