From f1afe16c9ef69c3deeda8874625d76597c83b764 Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 21 Feb 2019 14:24:27 +0100 Subject: [PATCH 1/5] icon not showing correctly fixed --- front/core/directives/uvc.html | 1 - 1 file changed, 1 deletion(-) diff --git a/front/core/directives/uvc.html b/front/core/directives/uvc.html index f7b559cd9..0248aefc1 100644 --- a/front/core/directives/uvc.html +++ b/front/core/directives/uvc.html @@ -2,7 +2,6 @@
Date: Fri, 22 Feb 2019 08:32:18 +0100 Subject: [PATCH 2/5] item barcode to item created --- .../methods/item-barcode/specs/toItem.spec.js | 10 +++++++ .../item/back/methods/item-barcode/toItem.js | 28 +++++++++++++++++++ modules/item/back/models/item-barcode.js | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 modules/item/back/methods/item-barcode/specs/toItem.spec.js create mode 100644 modules/item/back/methods/item-barcode/toItem.js diff --git a/modules/item/back/methods/item-barcode/specs/toItem.spec.js b/modules/item/back/methods/item-barcode/specs/toItem.spec.js new file mode 100644 index 000000000..9e81dc590 --- /dev/null +++ b/modules/item/back/methods/item-barcode/specs/toItem.spec.js @@ -0,0 +1,10 @@ +const app = require('vn-loopback/server/server'); + +describe('item-barcode toItem()', () => { + it('should return the same number if there is a barcode and a item with the same ID', async() => { + let barcode = 3; + let result = await app.models.ItemBarcode.toItem(barcode); + + expect(result).toBe(3); + }); +}); diff --git a/modules/item/back/methods/item-barcode/toItem.js b/modules/item/back/methods/item-barcode/toItem.js new file mode 100644 index 000000000..0fbbf4508 --- /dev/null +++ b/modules/item/back/methods/item-barcode/toItem.js @@ -0,0 +1,28 @@ +module.exports = Self => { + Self.remoteMethod('toItem', { + description: 'Returns last entries', + accessType: 'READ', + accepts: [{ + arg: 'barcode', + type: 'Number', + required: true, + description: 'barcode' + }], + returns: { + type: 'Number', + root: true + }, + http: { + path: `/:barcode/toItem`, + verb: 'GET' + } + }); + + Self.toItem = async barcode => { + let query = `SELECT vn.barcodeToItem(?)`; + let [item] = await Self.rawSql(query, [barcode]); + if (item) + item = Object.values(item); + return item[0]; + }; +}; diff --git a/modules/item/back/models/item-barcode.js b/modules/item/back/models/item-barcode.js index 094701113..b608a7fe9 100644 --- a/modules/item/back/models/item-barcode.js +++ b/modules/item/back/models/item-barcode.js @@ -1,4 +1,6 @@ module.exports = Self => { + require('../methods/item-barcode/toItem')(Self); + Self.validatesUniquenessOf('code', { message: `Barcode must be unique` }); From 6c46400d3d8b86d8917ada5d4f8e0b2a4e279bbf Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 22 Feb 2019 08:52:30 +0100 Subject: [PATCH 3/5] checkbox styles fixed --- front/core/components/check/style.scss | 6 +----- front/core/components/table/style.scss | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/front/core/components/check/style.scss b/front/core/components/check/style.scss index 5ddd56fa3..ade79c4c5 100644 --- a/front/core/components/check/style.scss +++ b/front/core/components/check/style.scss @@ -16,10 +16,6 @@ vn-check { } md-checkbox { - margin-bottom: 0 - } - - md-checkbox .md-label { - margin-bottom: .5em; + margin-bottom: 0.8em } } diff --git a/front/core/components/table/style.scss b/front/core/components/table/style.scss index 54b40db6d..33e2ee06a 100644 --- a/front/core/components/table/style.scss +++ b/front/core/components/table/style.scss @@ -174,4 +174,7 @@ vn-table { float: right; margin: 0!important; } + md-checkbox { + margin: 0; + } } \ No newline at end of file From 93701427316407503d2a46fb24b9b09c93b675ae Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 22 Feb 2019 12:43:08 +0100 Subject: [PATCH 4/5] styles fixed --- modules/ticket/front/sale-checked/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/sale-checked/index.html b/modules/ticket/front/sale-checked/index.html index 3c8a925c2..968d69af2 100644 --- a/modules/ticket/front/sale-checked/index.html +++ b/modules/ticket/front/sale-checked/index.html @@ -20,7 +20,7 @@ - + From ea9d194368ba974021794bb1bf6343f711e2acb3 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 22 Feb 2019 13:18:53 +0100 Subject: [PATCH 5/5] traduction added --- modules/item/front/descriptor/index.html | 2 +- modules/item/front/descriptor/locale/es.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/item/front/descriptor/index.html b/modules/item/front/descriptor/index.html index a0d6404f5..d0c89e9e1 100644 --- a/modules/item/front/descriptor/index.html +++ b/modules/item/front/descriptor/index.html @@ -95,7 +95,7 @@ Regularize stock