diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 9187e2871..78b0967b9 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1013,7 +1013,7 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric (4, 4, 1, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), (5, 1, 2, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), (6, 1, 3, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), - (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.44, 0, 0, 0, util.VN_CURDATE()), + (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.74, 0, 0, 0, util.VN_CURDATE()), (8, 4, 11, 'Melee weapon heavy shield 100cm', 10, 1.79, 0, 0, 0, util.VN_CURDATE()), (9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()), (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE()), @@ -2973,4 +2973,4 @@ INSERT INTO vn.XDiario (id, ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EU (3, 1.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T3333333 Tony Stark', NULL, 0.81, 8.07, 'T', '3333333', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1), (4, 2.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T4444444', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0), (5, 2.0, util.VN_CURDATE(), '2000000000', '4300001104', 'n/fra T4444444 Tony Stark', NULL, 8.07, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0), - (6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0); \ No newline at end of file + (6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0); diff --git a/db/tests/vn/item_getBalance.spec.js b/db/tests/vn/item_getBalance.spec.js index 2e24d5ce7..74e1e6659 100644 --- a/db/tests/vn/item_getBalance.spec.js +++ b/db/tests/vn/item_getBalance.spec.js @@ -6,13 +6,13 @@ describe('item_getBalance()', () => { let stmts = []; let params = { - warehouseFk: 1, - itemFk: 1 + itemFk: 1, + warehouseFk: 1 }; const conn = await app.models.Item.dataSource.connector; - stmts.push(new ParameterizedSQL('CALL vn.item_getBalance(?, ?)', [ + stmts.push(new ParameterizedSQL('CALL vn.item_getBalance(?, ?, NULL)', [ params.warehouseFk, params.itemFk ])); diff --git a/db/tests/vn/logAddWithUser.spec.js b/db/tests/vn/logAddWithUser.spec.js deleted file mode 100644 index 8711769d0..000000000 --- a/db/tests/vn/logAddWithUser.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -const app = require('vn-loopback/server/server'); -const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; - -describe('logAddWithUser()', () => { - it('should log any action taken by the user in a table ending in Log', async() => { - let stmts = []; - let stmt; - - stmts.push('START TRANSACTION'); - - let params = { - ticketFk: 1, - userId: 9, - actionCode: 'update', - targetEntity: 'ticket', - description: 'we are testing stuff' - }; - - stmt = new ParameterizedSQL('CALL vn.logAddWithUser(?, ?, ?, ?, ?)', [ - params.ticketFk, - params.userId, - params.actionCode, - params.targetEntity, - params.description - ]); - stmts.push(stmt); - - stmt = new ParameterizedSQL('SELECT * FROM vn.ticketLog WHERE description = ?', [ - params.description - ]); - let ticketLogIndex = stmts.push(stmt) - 1; - - stmts.push('ROLLBACK'); - - let sql = ParameterizedSQL.join(stmts, ';'); - let result = await app.models.Ticket.rawStmt(sql); - - savedDescription = result[ticketLogIndex][0].description; - - expect(savedDescription).toEqual(params.description); - }); -}); diff --git a/db/tests/vn/timeControl_calculateByUser.spec.js b/db/tests/vn/timeControl_calculateByUser.spec.js index 73e00ec3a..0b385d2c9 100644 --- a/db/tests/vn/timeControl_calculateByUser.spec.js +++ b/db/tests/vn/timeControl_calculateByUser.spec.js @@ -14,14 +14,6 @@ describe('timeControl_calculateByUser()', () => { let stmts = []; let stmt; - stmts.push('START TRANSACTION'); - - stmts.push(` - DROP TEMPORARY TABLE IF EXISTS - tmp.timeControlCalculate, - tmp.timeBusinessCalculate - `); - let params = { workerID: 1106, start: start, @@ -37,17 +29,15 @@ describe('timeControl_calculateByUser()', () => { let tableIndex = stmts.push('SELECT * FROM tmp.timeControlCalculate') - 1; - stmts.push('ROLLBACK'); - let sql = ParameterizedSQL.join(stmts, ';'); let result = await app.models.Ticket.rawStmt(sql); let [timeControlCalculateTable] = result[tableIndex]; - expect(timeControlCalculateTable.timeWorkSeconds).toEqual(29400); + expect(timeControlCalculateTable.timeWorkSeconds).toEqual(28200); }); - - it(`should return the worked hours between last sunday and monday`, async() => { + // #2261 + xit(`should return the worked hours between last sunday and monday`, async() => { let lastSunday = Date.vnNew(); let daysSinceSunday = lastSunday.getDay(); if (daysSinceSunday === 0) // this means today is sunday but you need the previous sunday :) @@ -65,13 +55,7 @@ describe('timeControl_calculateByUser()', () => { stmts.push('START TRANSACTION'); - stmts.push(` - DROP TEMPORARY TABLE IF EXISTS - tmp.timeControlCalculate, - tmp.timeBusinessCalculate - `); - - const workerID = 1107; + const workerID = 1108; stmt = new ParameterizedSQL(` INSERT INTO vn.workerTimeControl(userFk, timed, manual, direction) diff --git a/db/tests/vn/zone_getFromGeo.spec.js b/db/tests/vn/zone_getFromGeo.spec.js index 0dccf92cc..74b6e00cc 100644 --- a/db/tests/vn/zone_getFromGeo.spec.js +++ b/db/tests/vn/zone_getFromGeo.spec.js @@ -7,7 +7,7 @@ describe('zone zone_getFromGeo()', () => { let stmt; stmts.push('START TRANSACTION'); - let geoFk = 17; + let geoFk = 16; stmt = new ParameterizedSQL('CALL zone_getFromGeo(?)', [ geoFk, diff --git a/e2e/paths/05-ticket/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js index 55aec45fb..77f0e0459 100644 --- a/e2e/paths/05-ticket/06_basic_data_steps.spec.js +++ b/e2e/paths/05-ticket/06_basic_data_steps.spec.js @@ -75,7 +75,7 @@ describe('Ticket Edit basic data path', () => { const result = await page .waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText'); - expect(result).toContain('-€232.75'); + expect(result).toContain('-€228.25'); }); it(`should select a new reason for the changes made then click on finalize`, async() => { diff --git a/modules/ticket/back/methods/sale/specs/updatePrice.spec.js b/modules/ticket/back/methods/sale/specs/updatePrice.spec.js index 133be8de3..9d1403df0 100644 --- a/modules/ticket/back/methods/sale/specs/updatePrice.spec.js +++ b/modules/ticket/back/methods/sale/specs/updatePrice.spec.js @@ -108,7 +108,7 @@ describe('sale updatePrice()', () => { }}, options); expect(updatedSale.price).toBe(price); - expect(createdSaleComponent.value).toEqual(-2.04); + expect(createdSaleComponent.value).toEqual(-2.34); const updatedSalesPersonMana = await models.WorkerMana.findById(18, null, options);