diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 8c1a3c8bc..fb71f091f 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -125,14 +125,14 @@ INSERT INTO `vn`.`warehouseAlias`(`id`, `name`) (1, 'Main Warehouse'), (2, 'Silla'); -INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`, `hasStowaway`, `hasDms`, `hasComission`, `aliasFk`, `countryFk`) +INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`, `hasStowaway`, `hasDms`, `hasComission`, `aliasFk`, `countryFk`, `hasProduction`) VALUES - (1, 'Warehouse One', 'ALG', 1, 1, 1, 1, 1, 1, 1, 2, 1), - (2, 'Warehouse Two', NULL, 1, 1, 1, 1, 0, 0, 1, 2, 13), - (3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1), - (4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1), - (5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1), - (13, 'Inventory', NULL, 1, 1, 1, 0, 0, 0, 0, 2, 1); + (1, 'Warehouse One', 'ALG', 1, 1, 1, 1, 1, 1, 1, 2, 1, 1), + (2, 'Warehouse Two', NULL, 1, 1, 1, 1, 0, 0, 1, 2, 13, 1), + (3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1, 1), + (4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1, 1), + (5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1, 1), + (13, 'Inventory', NULL, 1, 1, 1, 0, 0, 0, 0, 2, 1, 0); INSERT INTO `vn`.`sector`(`id`, `description`, `warehouseFk`, `isPreviousPreparedByPacking`, `code`, `pickingPlacement`, `path`) VALUES @@ -845,7 +845,7 @@ INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `create (7, 2, 4, 71, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), NULL, 1, 1, 18, NULL, 94), (8, 3, 5, 71, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), NULL, 1, 1, 18, NULL, 94), (9, 3, 6, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), NULL, 1, 1, 18, NULL, 94), - (10, 7, 7, 71, CURDATE(), NULL, 1, 1, 18, NULL, 94); + (10, 7, 7, 71, NOW(), NULL, 1, 1, 18, NULL, 94); INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`, `created`, `pvp`) VALUES @@ -2408,4 +2408,6 @@ INSERT INTO `vn`.`expeditionScan` (`id`, `expeditionFk`, `scanned`, `palletFk`) (7, 7, CURDATE(), 1), (8, 8, CURDATE(), 1), (9, 9, CURDATE(), 1), - (10, 10, CURDATE(), 1); \ No newline at end of file + (10, 10, CURDATE(), 1); + +CALL `cache`.`last_buy_refresh`(FALSE); \ No newline at end of file diff --git a/db/tests/cache/last_buy_refresh.spec.js b/db/tests/cache/last_buy_refresh.spec.js index 0036e2762..71a9c3872 100644 --- a/db/tests/cache/last_buy_refresh.spec.js +++ b/db/tests/cache/last_buy_refresh.spec.js @@ -3,22 +3,18 @@ const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; describe('last_buy_refresh()', () => { it(`should store some data on cache.last_buy`, async() => { - let stmts = []; - let stmt; + const stmts = []; stmts.push('START TRANSACTION'); - stmt = new ParameterizedSQL('CALL cache.last_buy_refresh(true)'); - stmts.push(stmt); - - let lastBuyTableIndex = stmts.push(`SELECT * FROM cache.last_buy ORDER BY item_id ASC`) - 1; + const lastBuyTableIndex = stmts.push(`SELECT * FROM cache.last_buy ORDER BY item_id ASC`) - 1; stmts.push('ROLLBACK'); - let sql = ParameterizedSQL.join(stmts, ';'); - let result = await app.models.Ticket.rawStmt(sql); + const sql = ParameterizedSQL.join(stmts, ';'); + const result = await app.models.Ticket.rawStmt(sql); - let lastBuyTable = result[lastBuyTableIndex]; + const lastBuyTable = result[lastBuyTableIndex]; expect(lastBuyTable.length).toEqual(12); diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index d59e34e64..cbf9e3b6a 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -115,7 +115,6 @@ module.exports = Self => { const stmts = []; let stmt; - stmts.push('CALL cache.last_buy_refresh(FALSE)'); stmts.push('CALL cache.visible_refresh(@calc_id, FALSE, 1)'); stmt = new ParameterizedSQL(` diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index 7063c386e..cff36a223 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -127,7 +127,6 @@ module.exports = Self => { filter = mergeFilters(filter, {where}); const stmts = []; - stmts.push('CALL cache.last_buy_refresh(FALSE)'); const stmt = new ParameterizedSQL( `SELECT i.id, diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 1546aee0e..6483a906a 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -223,7 +223,8 @@ module.exports = Self => { MINUTE(z.hour) AS zoneMinute, z.name AS zoneName, z.id AS zoneFk, - CAST(z.hour AS CHAR) AS hour + CAST(z.hour AS CHAR) AS hour, + TIME_FORMAT(zed.etc, '%H:%i') AS practicalHour FROM ticket t LEFT JOIN invoiceOut io ON t.refFk = io.ref LEFT JOIN zone z ON z.id = t.zoneFk @@ -235,7 +236,8 @@ module.exports = Self => { LEFT JOIN state st ON st.id = ts.stateFk LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN worker wk ON wk.id = c.salesPersonFk - LEFT JOIN account.user u ON u.id = wk.userFk`); + LEFT JOIN account.user u ON u.id = wk.userFk + LEFT JOIN zoneEstimatedDelivery zed ON zed.zoneFk = t.zoneFk`); if (args.orderFk) { stmt.merge({ diff --git a/modules/monitor/front/index/locale/es.yml b/modules/monitor/front/index/locale/es.yml index 160392245..4eef3c93f 100644 --- a/modules/monitor/front/index/locale/es.yml +++ b/modules/monitor/front/index/locale/es.yml @@ -6,4 +6,6 @@ Delete selected elements: Eliminar los elementos seleccionados All the selected elements will be deleted. Are you sure you want to continue?: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar? Component lack: Faltan componentes Minimize/Maximize: Minimizar/Maximizar -Problems: Problemas \ No newline at end of file +Problems: Problemas +Theoretical: Teórica +Practical: Práctica \ No newline at end of file diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index 2d2c5fa78..82adf2765 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -37,8 +37,9 @@ Client Salesperson Date - Hour - Closure + Prep. + Theoretical + Practical Province State Zone @@ -112,6 +113,7 @@ {{::ticket.shipped | date: 'HH:mm'}} {{::ticket.zoneLanding | date: 'HH:mm'}} + {{::ticket.practicalHour | date: 'HH:mm'}} {{::ticket.province}}