From c4ff568ec82a28e526358c5f2335fbc4d1afb95d Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Wed, 17 Jan 2018 14:28:06 +0100 Subject: [PATCH] model expense create and added into Item's basic data view --- client/item/routes.json | 67 +++++++++++++++++++++--- client/item/src/data/item-data.html | 63 ++++++++-------------- services/item/common/models/expence.json | 30 +++++++++++ services/item/common/models/item.json | 5 ++ services/item/server/model-config.json | 3 ++ 5 files changed, 121 insertions(+), 47 deletions(-) create mode 100644 services/item/common/models/expence.json diff --git a/client/item/routes.json b/client/item/routes.json index d871114d6..0e121f7c6 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -34,16 +34,71 @@ "description": "Basic data", "icon": "folder" } - }, { - "url" : "/image", - "state": "item.card.image", - "component": "vn-item-image", + },{ + "url" : "/tags", + "state": "item.card.tags", + "component": "vn-item-tags", "params": { "item": "$ctrl.item" }, "menu": { - "description": "Images", - "icon": "image" + "description": "Tags", + "icon": "folder" + } + },{ + "url" : "/historic", + "state": "item.card.historic", + "component": "vn-item-historic", + "params": { + "item": "$ctrl.item" + }, + "menu": { + "description": "Historic", + "icon": "folder" + } + },{ + "url" : "/niche", + "state": "item.card.niche", + "component": "vn-item-niche", + "params": { + "item": "$ctrl.item" + }, + "menu": { + "description": "Niche", + "icon": "folder" + } + },{ + "url" : "/botanical", + "state": "item.card.botanical", + "component": "vn-item-botanical", + "params": { + "item": "$ctrl.item" + }, + "menu": { + "description": "Botanical", + "icon": "folder" + } + },{ + "url" : "/picture", + "state": "item.card.picture", + "component": "vn-item-picture", + "params": { + "item": "$ctrl.item" + }, + "menu": { + "description": "Picture", + "icon": "folder" + } + }, { + "url" : "/barcode", + "state": "item.card.barcode", + "component": "vn-item-barcode", + "params": { + "item": "$ctrl.item" + }, + "menu": { + "description": "Barcode", + "icon": "folder" } } ] diff --git a/client/item/src/data/item-data.html b/client/item/src/data/item-data.html index 17c64e329..d965e5f33 100644 --- a/client/item/src/data/item-data.html +++ b/client/item/src/data/item-data.html @@ -16,46 +16,32 @@ Basic data - - - - - - - - - {{$parent.$parent.item.description}} - - - + - - + + + {{$parent.$parent.item.description}} + + + + + - + > - + url="/item/api/Expences" + label="Expence" + field="$ctrl.item.expenceFk" + > diff --git a/services/item/common/models/expence.json b/services/item/common/models/expence.json new file mode 100644 index 000000000..847b0fb82 --- /dev/null +++ b/services/item/common/models/expence.json @@ -0,0 +1,30 @@ +{ + "name": "Expence", + "base": "VnModel", + "options": { + "mysql": { + "table": "expence", + "database": "vn" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "description": "Identifier" + }, + "name": { + "type": "String" + }, + "isWithheld": { + "type": "Number" + } + }, + "relations": { + "taxType": { + "type": "belongsTo", + "model": "TaxType", + "foreignKey": "taxTypeFk" + } + } +} \ No newline at end of file diff --git a/services/item/common/models/item.json b/services/item/common/models/item.json index 070157c7e..3b0db4753 100644 --- a/services/item/common/models/item.json +++ b/services/item/common/models/item.json @@ -70,6 +70,11 @@ "type": "belongsTo", "model": "Intrastat", "foreignKey": "intrastatFk" + }, + "expence": { + "type": "belongsTo", + "model": "Expence", + "foreignKey": "expenceFk" } } } \ No newline at end of file diff --git a/services/item/server/model-config.json b/services/item/server/model-config.json index 43c9a80fe..8380de2bf 100644 --- a/services/item/server/model-config.json +++ b/services/item/server/model-config.json @@ -51,6 +51,9 @@ "TaxType": { "dataSource": "vn" }, + "Expence": { + "dataSource": "vn" + }, "Country": { "dataSource": "salix" }