From c1125916f61e5f251b5e91ddd857709d0c6c8840 Mon Sep 17 00:00:00 2001 From: bernat Date: Sat, 31 Oct 2020 11:22:56 +0100 Subject: [PATCH 1/9] supplier basicData --- modules/supplier/front/basic-data/index.html | 42 +++++++++++++++++++ modules/supplier/front/basic-data/index.js | 10 +++++ .../supplier/front/basic-data/locale/es.yml | 2 + modules/supplier/front/index.js | 1 + modules/supplier/front/routes.json | 10 +++++ 5 files changed, 65 insertions(+) create mode 100644 modules/supplier/front/basic-data/index.html create mode 100644 modules/supplier/front/basic-data/index.js create mode 100644 modules/supplier/front/basic-data/locale/es.yml diff --git a/modules/supplier/front/basic-data/index.html b/modules/supplier/front/basic-data/index.html new file mode 100644 index 000000000..55239e25f --- /dev/null +++ b/modules/supplier/front/basic-data/index.html @@ -0,0 +1,42 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/modules/supplier/front/basic-data/index.js b/modules/supplier/front/basic-data/index.js new file mode 100644 index 000000000..447118ebb --- /dev/null +++ b/modules/supplier/front/basic-data/index.js @@ -0,0 +1,10 @@ +import ngModule from '../module'; +import Section from 'salix/components/section'; + +ngModule.vnComponent('vnSupplierBasicData', { + template: require('./index.html'), + controller: Section, + bindings: { + supplier: '<' + } +}); diff --git a/modules/supplier/front/basic-data/locale/es.yml b/modules/supplier/front/basic-data/locale/es.yml new file mode 100644 index 000000000..26067c3db --- /dev/null +++ b/modules/supplier/front/basic-data/locale/es.yml @@ -0,0 +1,2 @@ +Notes: Notas +Is Active: Es activo \ No newline at end of file diff --git a/modules/supplier/front/index.js b/modules/supplier/front/index.js index a4017bbd9..9fefd5b73 100644 --- a/modules/supplier/front/index.js +++ b/modules/supplier/front/index.js @@ -7,3 +7,4 @@ import './index/'; import './search-panel'; import './log'; import './summary'; +import './basic-data'; diff --git a/modules/supplier/front/routes.json b/modules/supplier/front/routes.json index 24e8d8692..fed6a688a 100644 --- a/modules/supplier/front/routes.json +++ b/modules/supplier/front/routes.json @@ -9,6 +9,7 @@ {"state": "supplier.index", "icon": "icon-supplier"} ], "card": [ + {"state": "supplier.card.basicData", "icon": "settings"}, {"state": "supplier.card.log", "icon": "history"} ] }, @@ -42,6 +43,15 @@ "state": "supplier.card.log", "component": "vn-supplier-log", "description": "Log" + }, { + "url": "/basic-data", + "state": "supplier.card.basicData", + "component": "vn-supplier-basic-data", + "description": "Basic data", + "acl": ["administrative"], + "params": { + "supplier": "$ctrl.supplier" + } } ] } \ No newline at end of file From b95de5d788ded19edd0c571967877dcda7e1f2cb Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 2 Nov 2020 17:42:46 +0100 Subject: [PATCH 2/9] waitForState minor refactor --- e2e/helpers/extensions.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 9cecbd7e5..8647483b0 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -123,15 +123,20 @@ let actions = { }, waitForState: async function(state) { - await this.waitFor(state => { + await this.waitForFunction(state => { let $state = angular.element(document.body).injector().get('$state'); return !$state.transition && $state.is(state); }, {}, state); + await this.waitForFunction(() => { + return angular.element(() => { + return true; + }); + }); await this.waitForSpinnerLoad(); }, waitForTransition: async function() { - await this.waitFor(() => { + await this.waitForFunction(() => { const $state = angular.element(document.body).injector().get('$state'); return !$state.transition; }); @@ -522,7 +527,7 @@ let actions = { }, waitForSpinnerLoad: async function() { - await this.waitFor('vn-topbar vn-spinner', {hidden: true}); + await this.waitForSelector('vn-topbar vn-spinner', {hidden: true}); }, waitForWatcherData: async function(selector) { From ead09940326ca949d51bf26e85ba32daf1e29292 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 5 Nov 2020 10:33:02 +0100 Subject: [PATCH 3/9] timeControlCalculate procedure updated --- db/changes/10250-curfew/00-ACL.sql | 3 +- .../10250-curfew/00-timeControlCalculate.sql | 43 +++++++++++++++++++ db/changes/10250/00-ACL.sql | 2 - e2e/paths/05-ticket/05_tracking_state.spec.js | 2 +- 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 db/changes/10250-curfew/00-timeControlCalculate.sql delete mode 100644 db/changes/10250/00-ACL.sql diff --git a/db/changes/10250-curfew/00-ACL.sql b/db/changes/10250-curfew/00-ACL.sql index c4987c405..90f673c67 100644 --- a/db/changes/10250-curfew/00-ACL.sql +++ b/db/changes/10250-curfew/00-ACL.sql @@ -1,3 +1,4 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Supplier', 'updateFiscalData', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Supplier', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Supplier', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierLog', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierContact', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); \ No newline at end of file diff --git a/db/changes/10250-curfew/00-timeControlCalculate.sql b/db/changes/10250-curfew/00-timeControlCalculate.sql new file mode 100644 index 000000000..90d9acca9 --- /dev/null +++ b/db/changes/10250-curfew/00-timeControlCalculate.sql @@ -0,0 +1,43 @@ +DROP PROCEDURE IF EXISTS `vn`.`timeControl_calculate`; +DELIMITER $$ +CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`timeControl_calculate`(vDatedFrom DATETIME, vDatedTo DATETIME) +BEGIN + SET @vIsOdd := TRUE; + SET @vUser := NULL; + SET @vDated := NULL; + + DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate; + + CREATE TEMPORARY TABLE tmp.timeControlCalculate + SELECT + userFk, + dated, + IF( timeWork >= 18000, @timeWork:=timeWork + 1200, @timeWork:=timeWork) timeWorkSeconds, + SEC_TO_TIME(@timeWork ) timeWorkSexagesimal, + @timeWork / 3600 timeWorkDecimal, + timed + FROM (SELECT SUM(timeWork) timeWork, + userFk, + dated, + GROUP_CONCAT(DATE_FORMAT(sub.timed,"%H:%i") ORDER BY sub.timed ASC SEPARATOR ' - ') timed + FROM (SELECT IF(@vUser = wtc.userFk, @vUser :=@vUser, @vUser := wtc.userFk), + IF(@vIsOdd, @vIsOdd := FALSE, @vIsOdd := TRUE), + IF(direction='in', @vIsOdd := TRUE, @vIsOdd := @vIsOdd), + IF(@vIsOdd, @vLastTimed:=UNIX_TIMESTAMP(timed),@vLastTimed:=@vLastTimed), + IF(@vIsOdd, 0, UNIX_TIMESTAMP(timed)-@vLastTimed) timeWork, + IF(direction='in', @vDated := DATE(wtc.timed), @vDated :=@vDated) dated, + wtc.timed timed, + wtc.userFk, + direction + FROM (SELECT DISTINCT(wtc.id), wtc.userFk, wtc.timed, wtc.direction + FROM workerTimeControl wtc + JOIN tmp.`user` w ON w.userFk = wtc.userFk + WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo + ORDER BY userFk, timed ASC + ) wtc + WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo + ) sub + GROUP BY userFk, dated + )sub2; +END$$ +DELIMITER ; \ No newline at end of file diff --git a/db/changes/10250/00-ACL.sql b/db/changes/10250/00-ACL.sql deleted file mode 100644 index c9d8fd456..000000000 --- a/db/changes/10250/00-ACL.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('supplier', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierContact', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); diff --git a/e2e/paths/05-ticket/05_tracking_state.spec.js b/e2e/paths/05-ticket/05_tracking_state.spec.js index d66067da8..d5db750b8 100644 --- a/e2e/paths/05-ticket/05_tracking_state.spec.js +++ b/e2e/paths/05-ticket/05_tracking_state.spec.js @@ -48,7 +48,7 @@ describe('Ticket Create new tracking state path', () => { }); it('should now access to the create state view by clicking the create floating button', async() => { - await page.waitFor('.vn-popup', {hidden: true}), + await page.waitFor('.vn-popup', {hidden: true}); await page.waitToClick(selectors.ticketTracking.createStateButton); await page.waitForState('ticket.card.tracking.edit'); }); From 8765a18bbbd60f23fd6f95b01039be50ce9e83eb Mon Sep 17 00:00:00 2001 From: bernat Date: Thu, 5 Nov 2020 11:46:15 +0100 Subject: [PATCH 4/9] fix supplier routes --- modules/supplier/front/routes.json | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/supplier/front/routes.json b/modules/supplier/front/routes.json index 6da70fefb..10727fecf 100644 --- a/modules/supplier/front/routes.json +++ b/modules/supplier/front/routes.json @@ -48,6 +48,7 @@ "state": "supplier.card.basicData", "component": "vn-supplier-basic-data", "description": "Basic data", + "acl": ["administrative"], "params": { "supplier": "$ctrl.supplier" } @@ -65,13 +66,7 @@ "state": "supplier.card.log", "component": "vn-supplier-log", "description": "Log" - }, { - "url": "/basic-data", - "state": "supplier.card.basicData", - "component": "vn-supplier-basic-data", - "description": "Basic data", - "acl": ["administrative"], - }, + }, { "url": "/contact", "state": "supplier.card.contact", From 18ed685c75fed92e045bed97b50d245eaa1fd4d1 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 5 Nov 2020 13:53:19 +0100 Subject: [PATCH 5/9] e2e path for supplier basic data --- e2e/helpers/selectors.js | 6 +- e2e/paths/13-supplier/02_basic_data.spec.js | 60 +++++++++++++++++++ ...{02_contact.spec.js => 04_contact.spec.js} | 0 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 e2e/paths/13-supplier/02_basic_data.spec.js rename e2e/paths/13-supplier/{02_contact.spec.js => 04_contact.spec.js} (100%) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 02c749b3c..3df6eec8c 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -925,7 +925,11 @@ export default { thirdContactDeleteButton: 'vn-supplier-contact div:nth-child(3) vn-icon-button[icon="delete"]' }, supplierBasicData: { - + alias: 'vn-supplier-basic-data vn-textfield[ng-model="$ctrl.supplier.nickname"]', + isOfficial: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isOfficial"]', + isActive: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isActive"]', + notes: 'vn-supplier-basic-data vn-textarea[ng-model="$ctrl.supplier.note"]', + saveButton: 'vn-supplier-basic-data button[type="submit"]', }, supplierFiscalData: { socialName: 'vn-supplier-fiscal-data vn-textfield[ng-model="$ctrl.supplier.name"]', diff --git a/e2e/paths/13-supplier/02_basic_data.spec.js b/e2e/paths/13-supplier/02_basic_data.spec.js new file mode 100644 index 000000000..1e283749d --- /dev/null +++ b/e2e/paths/13-supplier/02_basic_data.spec.js @@ -0,0 +1,60 @@ +import selectors from '../../helpers/selectors.js'; +import getBrowser from '../../helpers/puppeteer'; + +describe('Supplier basic data path', () => { + let browser; + let page; + + beforeAll(async() => { + browser = await getBrowser(); + page = browser.page; + await page.loginAndModule('administrative', 'supplier'); + await page.accessToSearchResult('1'); + await page.accessToSection('supplier.card.basicData'); + }); + + afterAll(async() => { + await browser.close(); + }); + + it('should edit the basic data', async() => { + await page.clearInput(selectors.supplierBasicData.alias); + await page.write(selectors.supplierBasicData.alias, 'Plants Nick SL'); + await page.waitToClick(selectors.supplierBasicData.isOfficial); + await page.waitToClick(selectors.supplierBasicData.isActive); + await page.write(selectors.supplierBasicData.notes, 'Some notes'); + + await page.waitToClick(selectors.supplierBasicData.saveButton); + const message = await page.waitForSnackbar(); + + expect(message.text).toBe('Data saved!'); + }); + + it('should reload the section', async() => { + await page.reloadSection('supplier.card.basicData'); + }); + + it('should check the alias was edited', async() => { + const result = await page.waitToGetProperty(selectors.supplierBasicData.alias, 'value'); + + expect(result).toEqual('Plants Nick SL'); + }); + + it('should check the isOffical checkbox is now unchecked', async() => { + const result = await page.checkboxState(selectors.supplierBasicData.isOfficial); + + expect(result).toBe('unchecked'); + }); + + it('should check the isActive checkbox is now unchecked', async() => { + const result = await page.checkboxState(selectors.supplierBasicData.isActive); + + expect(result).toBe('unchecked'); + }); + + it('should check the notes were edited', async() => { + const result = await page.waitToGetProperty(selectors.supplierBasicData.notes, 'value'); + + expect(result).toEqual('Some notes'); + }); +}); diff --git a/e2e/paths/13-supplier/02_contact.spec.js b/e2e/paths/13-supplier/04_contact.spec.js similarity index 100% rename from e2e/paths/13-supplier/02_contact.spec.js rename to e2e/paths/13-supplier/04_contact.spec.js From a4ad852390a90728fd5fe886057428c2e97f27f1 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 5 Nov 2020 13:59:24 +0100 Subject: [PATCH 6/9] translations refactor --- modules/supplier/front/basic-data/index.html | 4 ++-- modules/supplier/front/basic-data/locale/es.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/supplier/front/basic-data/index.html b/modules/supplier/front/basic-data/index.html index 55239e25f..03622cf38 100644 --- a/modules/supplier/front/basic-data/index.html +++ b/modules/supplier/front/basic-data/index.html @@ -18,11 +18,11 @@ diff --git a/modules/supplier/front/basic-data/locale/es.yml b/modules/supplier/front/basic-data/locale/es.yml index 26067c3db..c810be508 100644 --- a/modules/supplier/front/basic-data/locale/es.yml +++ b/modules/supplier/front/basic-data/locale/es.yml @@ -1,2 +1,3 @@ Notes: Notas -Is Active: Es activo \ No newline at end of file +Active: Activo +Official: Oficial \ No newline at end of file From 9b7edb0830ae363cf0484dcbf7f8a57d54da6e63 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 5 Nov 2020 14:18:48 +0100 Subject: [PATCH 7/9] updated path for log records --- e2e/paths/13-supplier/02_basic_data.spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/e2e/paths/13-supplier/02_basic_data.spec.js b/e2e/paths/13-supplier/02_basic_data.spec.js index 1e283749d..dfb33b6b0 100644 --- a/e2e/paths/13-supplier/02_basic_data.spec.js +++ b/e2e/paths/13-supplier/02_basic_data.spec.js @@ -57,4 +57,14 @@ describe('Supplier basic data path', () => { expect(result).toEqual('Some notes'); }); + + it('should navigate to the log section', async() => { + await page.accessToSection('supplier.card.log'); + }); + + it('should check the changes have been recorded', async() => { + const result = await page.waitToGetProperty('#newInstance:nth-child(3)', 'innerText'); + + expect(result).toEqual('note: Some notes'); + }); }); From 223c8a8528557b02b97a423b8a6b8f133a30038c Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 5 Nov 2020 15:58:02 +0100 Subject: [PATCH 8/9] stowaway test included + supplier contact refactor --- e2e/paths/05-ticket/12_descriptor.spec.js | 3 +-- e2e/paths/13-supplier/04_contact.spec.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/paths/05-ticket/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js index 8e99ec060..0df914bab 100644 --- a/e2e/paths/05-ticket/12_descriptor.spec.js +++ b/e2e/paths/05-ticket/12_descriptor.spec.js @@ -103,8 +103,7 @@ describe('Ticket descriptor path', () => { expect(message.text).toBe('Data saved!'); }); - xit(`should check the state of the stowaway ticket is embarked`, async() => { - await page.wait(500); + it(`should check the state of the stowaway ticket is embarked`, async() => { const state = await page.waitToGetProperty(selectors.ticketDescriptor.stateLabelValue, 'innerText'); expect(state).toEqual('State Embarcando'); diff --git a/e2e/paths/13-supplier/04_contact.spec.js b/e2e/paths/13-supplier/04_contact.spec.js index 9a102cf93..2140ec81b 100644 --- a/e2e/paths/13-supplier/04_contact.spec.js +++ b/e2e/paths/13-supplier/04_contact.spec.js @@ -69,6 +69,10 @@ describe('Supplier contact path', () => { it(`should remove the created contact`, async() => { await page.waitToClick(selectors.supplierContact.thirdContactDeleteButton, 'value'); + const result = await page.countElement(selectors.supplierContact.anyContact); + + expect(result).toEqual(2); + await page.waitToClick(selectors.supplierContact.saveButton); const message = await page.waitForSnackbar(); From 54d31f15bbfc2efd0ffa63fc1ae21613fc59f922 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 9 Nov 2020 14:53:26 +0100 Subject: [PATCH 9/9] fixed collection tests pollution --- .../spec/updateCollectionSale.spec.js | 57 +++++++++++++++++-- .../collection/updateCollectionSale.js | 17 +++--- modules/item/back/models/item-placement.json | 10 ++++ modules/item/back/models/item-shelving.json | 14 +++-- modules/ticket/back/models/sale-tracking.json | 6 ++ .../ticket/back/models/ticket-tracking.json | 38 ++++++++----- 6 files changed, 111 insertions(+), 31 deletions(-) diff --git a/back/methods/collection/spec/updateCollectionSale.spec.js b/back/methods/collection/spec/updateCollectionSale.spec.js index 2f150aba9..83b161a73 100644 --- a/back/methods/collection/spec/updateCollectionSale.spec.js +++ b/back/methods/collection/spec/updateCollectionSale.spec.js @@ -1,13 +1,62 @@ const app = require('vn-loopback/server/server'); -// #2495 updateCollectionSale reparar poluciĆ³n de unitarios -xdescribe('updateCollectionSale()', () => { - it('return a new collection', async() => { +describe('updateCollectionSale()', () => { + it('should return a new collection', async() => { + const sectorOneWarehouseID = 1; let ctx = {req: {accessToken: {userId: 106}}}; - let response = await app.models.Collection.updateCollectionSale(ctx, 1, 5, 5, 5, 1, 4, false, 'UXN', 1, 1); + ctx.args = { + sale: 1, + originalQuantity: 5, + quantity: 5, + quantityPicked: 5, + ticketFk: 1, + stateFk: 4, + isNicho: false, + shelvingFk: 'UXN', + itemFk: 1, + sectorFk: 1 + }; + let originalSaleTracking = await app.models.SaleTracking.findOne({ + where: { + saleFk: ctx.args.sale, + stateFk: ctx.args.stateFk + } + }); + let itemPlacement = await app.models.ItemPlacement.findOne({ + where: { + itemFk: ctx.args.itemFk, + warehouseFk: sectorOneWarehouseID + } + }); + const originalSale = await app.models.Sale.findById(ctx.args.sale); + const originalItemShelving = await app.models.ItemShelving.findOne({where: {shelvingFk: ctx.args.shelvingFk, itemFk: ctx.args.itemFk}}); + const originalTicketLastState = await app.models.TicketLastState.findById(ctx.args.ticketFk); + + let response = await app.models.Collection.updateCollectionSale(ctx); expect(response.length).toBeGreaterThan(0); expect(response[0][0].id).toEqual(1); expect(response[0][0].quantity).toEqual(5); + + // restores + if (originalSaleTracking) + await originalSaleTracking.save(); + else { + originalSaleTracking = await app.models.SaleTracking.findOne({ + where: { + saleFk: ctx.args.sale, + stateFk: ctx.args.stateFk + } + }); + await originalSaleTracking.destroy(); + } + await originalSale.save(); + const itemShelvingsToDestroy = await app.models.ItemShelving.find({where: {shelvingFk: ctx.args.shelvingFk, itemFk: ctx.args.itemFk}}); + for (itemShelving of itemShelvingsToDestroy) + await itemShelving.destroy(); + + await originalItemShelving.save(); + await originalTicketLastState.save(); + await itemPlacement.save(); }); }); diff --git a/back/methods/collection/updateCollectionSale.js b/back/methods/collection/updateCollectionSale.js index 01575c972..608250d18 100644 --- a/back/methods/collection/updateCollectionSale.js +++ b/back/methods/collection/updateCollectionSale.js @@ -65,25 +65,26 @@ module.exports = Self => { } }); - Self.updateCollectionSale = async(ctx, sale, originalQuantity, quantity, quantityPicked, ticketFk, stateFk, isNicho, shelvingFk, itemFk, sectorFk) => { + Self.updateCollectionSale = async ctx => { const userId = ctx.req.accessToken.userId; + const args = ctx.args; - if (originalQuantity == quantity) { + if (args.originalQuantity == args.quantity) { query = `CALL vn.collection_updateSale(?,?,?,?,?)`; - await Self.rawSql(query, [sale, originalQuantity, userId, stateFk, ticketFk]); + await Self.rawSql(query, [args.sale, args.originalQuantity, userId, args.stateFk, args.ticketFk]); } - if (!isNicho) { + if (!args.isNicho) { query = `CALL vn.collection_faults(?,?,?)`; - await Self.rawSql(query, [shelvingFk, quantityPicked, itemFk]); + await Self.rawSql(query, [args.shelvingFk, args.quantityPicked, args.itemFk]); } else { query = `CALL vn.sector_getWarehouse(?)`; - const [result] = await Self.rawSql(query, [sectorFk]); + const [result] = await Self.rawSql(query, [args.sectorFk]); query = `CALL vn.itemPlacementSave(?,?,?)`; - await Self.rawSql(query, [shelvingFk, quantityPicked, result[0]['warehouseFk']]); + await Self.rawSql(query, [args.shelvingFk, args.quantityPicked, result[0]['warehouseFk']]); } query = `CALL vn.sale_updateOriginalQuantity(?,?)`; - return await Self.rawSql(query, [sale, quantity]); + return await Self.rawSql(query, [args.sale, args.quantity]); }; }; diff --git a/modules/item/back/models/item-placement.json b/modules/item/back/models/item-placement.json index c2d779fcd..7bbb2dc91 100644 --- a/modules/item/back/models/item-placement.json +++ b/modules/item/back/models/item-placement.json @@ -7,8 +7,18 @@ } }, "properties": { + "id": { + "type": "Number", + "id": true + }, "code": { "type": "String" + }, + "itemFk": { + "type": "Number" + }, + "warehouseFk": { + "type": "Number" } }, "relations": { diff --git a/modules/item/back/models/item-shelving.json b/modules/item/back/models/item-shelving.json index 0fcc00f7e..f0391c565 100644 --- a/modules/item/back/models/item-shelving.json +++ b/modules/item/back/models/item-shelving.json @@ -8,18 +8,24 @@ }, "properties": { "id": { - "type": "number", + "type": "Number", "id": true, "description": "Identifier" }, "shelve": { - "type": "string" + "type": "String" + }, + "shelvingFk": { + "type": "String" + }, + "itemFk": { + "type": "Number" }, "deep": { - "type": "number" + "type": "Number" }, "quantity": { - "type": "number" + "type": "Number" }, "created": { "type": "Date" diff --git a/modules/ticket/back/models/sale-tracking.json b/modules/ticket/back/models/sale-tracking.json index 7936f827f..43b0df160 100644 --- a/modules/ticket/back/models/sale-tracking.json +++ b/modules/ticket/back/models/sale-tracking.json @@ -12,6 +12,12 @@ "type": "Number", "forceId": false }, + "saleFk": { + "type": "Number" + }, + "stateFk": { + "type": "Number" + }, "isChecked": { "type": "boolean" }, diff --git a/modules/ticket/back/models/ticket-tracking.json b/modules/ticket/back/models/ticket-tracking.json index 550df7d9c..c2c365013 100644 --- a/modules/ticket/back/models/ticket-tracking.json +++ b/modules/ticket/back/models/ticket-tracking.json @@ -5,22 +5,30 @@ "model": "TicketLog", "relation": "ticket", "showField": "stateFk" - }, - "options": { - "mysql": { - "table": "ticketTracking" - } - }, + }, + "options": { + "mysql": { + "table": "ticketTracking" + } + }, "properties": { - "id": { - "id": true, - "type": "Number", - "forceId": false - }, - "created": { - "type": "Date", - "required": false - } + "id": { + "id": true, + "type": "Number", + "forceId": false + }, + "created": { + "type": "Date" + }, + "ticketFk": { + "type": "Number" + }, + "stateFk": { + "type": "Number" + }, + "workerFk": { + "type": "Number" + } }, "relations": { "ticket": {