diff --git a/db/install/changes/10-ticketGetVisibleAvailable.sql b/db/install/changes/10-ticketGetVisibleAvailable.sql new file mode 100644 index 000000000..3d49d98d4 --- /dev/null +++ b/db/install/changes/10-ticketGetVisibleAvailable.sql @@ -0,0 +1,36 @@ +DROP PROCEDURE IF EXISTS vn.ticketGetVisibleAvailable; + +DELIMITER $$ +$$ +CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`ticketGetVisibleAvailable`( + vTicket INT) +BEGIN + DECLARE vVisibleCalc INT; + DECLARE vAvailableCalc INT; + DECLARE vShipped DATE; + DECLARE vWarehouse TINYINT; + DECLARE vAlertLevel INT; + + SELECT t.warehouseFk, t.shipped, ts.alertLevel INTO vWarehouse, vShipped, vAlertLevel + FROM ticket t + LEFT JOIN ticketState ts ON ts.ticketFk = vTicket + WHERE t.id = vTicket; + + IF vAlertLevel IS NULL OR vAlertLevel = 0 THEN + IF vShipped >= CURDATE() THEN + CALL cache.available_refresh(vAvailableCalc, FALSE, vWarehouse, vShipped); + END IF; + IF vShipped = CURDATE() THEN + CALL cache.visible_refresh(vVisibleCalc, FALSE, vWarehouse); + END IF; + END IF; + + SELECT s.id, s.itemFk, s.quantity, s.concept, s.price, s.reserved, s.discount, v.visible, av.available, it.image + FROM sale s + LEFT JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vVisibleCalc + LEFT JOIN cache.available av ON av.item_id = s.itemFk AND av.calc_id = vAvailableCalc + LEFT JOIN item it ON it.id = s.itemFk + WHERE s.ticketFk = vTicket + ORDER BY s.concept; +END$$ +DELIMITER ; diff --git a/e2e/paths/ticket-module/03_list_sale.spec.js b/e2e/paths/ticket-module/03_list_sale.spec.js index 2813bb988..54d63e26a 100644 --- a/e2e/paths/ticket-module/03_list_sale.spec.js +++ b/e2e/paths/ticket-module/03_list_sale.spec.js @@ -15,21 +15,21 @@ describe('Ticket List sale path', () => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText'); - expect(value).toContain('Red'); + expect(value).toContain('Yellow'); }); it('should confirm the first ticket sale contains the lenght', async() => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleText, 'innerText'); - expect(value).toContain('3'); + expect(value).toContain('5'); }); it('should confirm the first ticket sale contains the price', async() => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText'); - expect(value).toContain('1.30'); + expect(value).toContain('2.30'); }); it('should confirm the first ticket sale contains the discount', async() => { @@ -43,7 +43,7 @@ describe('Ticket List sale path', () => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText'); - expect(value).toContain('19.50'); + expect(value).toContain('23'); }); it('should navigate to the catalog by pressing the new item button', async() => { diff --git a/front/core/components/td-editable/style.scss b/front/core/components/td-editable/style.scss index 5fd042980..71162e906 100644 --- a/front/core/components/td-editable/style.scss +++ b/front/core/components/td-editable/style.scss @@ -1,11 +1,23 @@ @import "variables"; vn-td-editable { - cursor: pointer; + text { + cursor: pointer; + display: block + } + outline: none; position: relative; &:not([disabled="true"]) { cursor: initial; + + + text:hover::after { + font-family: 'salixfont'; + float: right; + content: '\e900'; + display: block + } } &.selected > .text { visibility: hidden; diff --git a/front/core/filters/dateTime.js b/front/core/filters/dateTime.js index de1506ead..fdda69870 100644 --- a/front/core/filters/dateTime.js +++ b/front/core/filters/dateTime.js @@ -9,9 +9,13 @@ dateTime.$inject = ['$filter']; export default function dateTime($filter) { return function(input, format) { - let value = new Date(input); - let offset = value.getTimezoneOffset() * 60000; - value.setTime(value.getTime() + offset); + let value; + if (input) { + value = new Date(input); + let offset = value.getTimezoneOffset() * 60000; + value.setTime(value.getTime() + offset); + } + return $filter('date')(value, format); }; } diff --git a/front/core/styles/salixfont.css b/front/core/styles/salixfont.css index 67ff48cb5..8e9a02963 100644 --- a/front/core/styles/salixfont.css +++ b/front/core/styles/salixfont.css @@ -23,240 +23,240 @@ -moz-osx-font-smoothing: grayscale; } -.icon-tax:before { - content: "\e901"; -} -.icon-notes:before { - content: "\e902"; -} -.icon-lineas:before { - content: "\e903"; -} -.icon-languaje:before { - content: "\e904"; -} -.icon-greuge:before { - content: "\e905"; +.icon-pets:before { + content: "\e94e"; } .icon-100:before { - content: "\e906"; -} -.icon-History:before { - content: "\e907"; -} -.icon-Inactivo:before { - content: "\e908"; -} -.icon-person:before { - content: "\e909"; -} -.icon-actions:before { - content: "\e90a"; -} -.icon-addperson:before { - content: "\e90b"; -} -.icon-albaran:before { - content: "\e90c"; -} -.icon-apps:before { - content: "\e90d"; -} -.icon-artificial:before { - content: "\e90e"; -} -.icon-barcode:before { - content: "\e90f"; -} -.icon-basket:before { - content: "\e910"; -} -.icon-bin:before { - content: "\e911"; -} -.icon-botanical:before { - content: "\e912"; -} -.icon-claims:before { - content: "\e913"; -} -.icon-clone:before { - content: "\e914"; -} -.icon-columnadd:before { - content: "\e915"; -} -.icon-columndelete:before { - content: "\e916"; -} -.icon-complementos:before { - content: "\e917"; -} -.icon-components:before { - content: "\e918"; -} -.icon-confeccion:before { - content: "\e919"; -} -.icon-consignatarios:before { - content: "\e91a"; -} -.icon-control:before { - content: "\e91b"; -} -.icon-credit:before { - content: "\e91c"; -} -.icon-deleteline:before { - content: "\e91d"; -} -.icon-delivery:before { - content: "\e91e"; -} -.icon-details:before { - content: "\e900"; -} -.icon-dfiscales:before { - content: "\e91f"; -} -.icon-doc:before { - content: "\e920"; -} -.icon-entrada:before { - content: "\e921"; -} -.icon-eye:before { - content: "\e922"; -} -.icon-flor:before { - content: "\e923"; -} -.icon-frozen:before { - content: "\e924"; -} -.icon-grid:before { - content: "\e925"; -} -.icon-headercol:before { - content: "\e926"; -} -.icon-info:before { - content: "\e927"; -} -.icon-item:before { - content: "\e928"; -} -.icon-linesprepaired:before { - content: "\e929"; -} -.icon-logout:before { - content: "\e92a"; -} -.icon-mana:before { - content: "\e92b"; -} -.icon-mandatory:before { - content: "\e92c"; -} -.icon-newalbaran:before { - content: "\e92d"; -} -.icon-newinvoices:before { - content: "\e92e"; -} -.icon-niche:before { - content: "\e92f"; -} -.icon-no036:before { - content: "\e930"; -} -.icon-noweb:before { - content: "\e931"; -} -.icon-onlinepayment:before { - content: "\e932"; -} -.icon-package:before { - content: "\e933"; -} -.icon-payment:before { - content: "\e934"; -} -.icon-pets:before { - content: "\e935"; -} -.icon-photo:before { - content: "\e936"; -} -.icon-planta:before { - content: "\e937"; -} -.icon-recovery:before { - content: "\e938"; -} -.icon-regentry:before { - content: "\e939"; -} -.icon-reserva:before { - content: "\e93a"; -} -.icon-revision:before { - content: "\e93b"; -} -.icon-riesgo:before { - content: "\e93c"; -} -.icon-services:before { - content: "\e93d"; -} -.icon-settings:before { - content: "\e93e"; -} -.icon-sign:before { - content: "\e93f"; -} -.icon-sms:before { content: "\e940"; } -.icon-solclaim:before { - content: "\e941"; +.icon-accessory:before { + content: "\e90a"; } -.icon-solunion:before { - content: "\e942"; +.icon-actions:before { + content: "\e900"; } -.icon-splitline:before { - content: "\e943"; +.icon-addperson:before { + content: "\e901"; } -.icon-stowaway:before { - content: "\e944"; +.icon-albaran:before { + content: "\e902"; } -.icon-supplier:before { - content: "\e945"; -} -.icon-tags:before { - content: "\e946"; -} -.icon-ticket:before { - content: "\e947"; -} -.icon-traceability:before { +.icon-apps:before { content: "\e948"; } -.icon-transaction:before { +.icon-artificial:before { + content: "\e903"; +} +.icon-barcode:before { + content: "\e904"; +} +.icon-basket:before { + content: "\e942"; +} +.icon-bin:before { + content: "\e905"; +} +.icon-botanical:before { + content: "\e906"; +} +.icon-bucket:before { + content: "\e907"; +} +.icon-claims:before { + content: "\e908"; +} +.icon-clone:before { + content: "\e909"; +} +.icon-columnadd:before { + content: "\e944"; +} +.icon-columndelete:before { + content: "\e90f"; +} +.icon-components:before { + content: "\e90b"; +} +.icon-consignatarios:before { + content: "\e90d"; +} +.icon-control:before { + content: "\e93f"; +} +.icon-credit:before { + content: "\e90e"; +} +.icon-delivery:before { + content: "\e910"; +} +.icon-details:before { + content: "\e911"; +} +.icon-disabled:before { + content: "\e91b"; +} +.icon-doc:before { + content: "\e913"; +} +.icon-entry:before { + content: "\e914"; +} +.icon-exit:before { + content: "\e947"; +} +.icon-eye:before { + content: "\e915"; +} +.icon-fiscal:before { + content: "\e912"; +} +.icon-flower:before { + content: "\e916"; +} +.icon-frozen:before { + content: "\e917"; +} +.icon-greenery:before { + content: "\e93c"; +} +.icon-greuge:before { + content: "\e918"; +} +.icon-grid:before { + content: "\e919"; +} +.icon-handmade:before { + content: "\e90c"; +} +.icon-history:before { + content: "\e91a"; +} +.icon-info:before { content: "\e949"; } -.icon-unavailable:before { +.icon-invoices1:before { content: "\e94a"; } -.icon-verde:before { +.icon-invoices:before { + content: "\e91c"; +} +.icon-item:before { + content: "\e941"; +} +.icon-languaje:before { + content: "\e91d"; +} +.icon-linedelete:before { + content: "\e946"; +} +.icon-lines:before { + content: "\e91e"; +} +.icon-linesplit:before { + content: "\e945"; +} +.icon-linesprepaired:before { content: "\e94b"; } -.icon-volume:before { +.icon-logout:before { + content: "\e91f"; +} +.icon-mana:before { + content: "\e920"; +} +.icon-mandatory:before { + content: "\e921"; +} +.icon-niche:before { + content: "\e922"; +} +.icon-no036:before { + content: "\e923"; +} +.icon-notes:before { + content: "\e924"; +} +.icon-noweb:before { + content: "\e925"; +} +.icon-onlinepayment:before { + content: "\e926"; +} +.icon-package:before { + content: "\e927"; +} +.icon-payment:before { + content: "\e928"; +} +.icon-person:before { + content: "\e929"; +} +.icon-photo:before { + content: "\e92a"; +} +.icon-plant:before { + content: "\e92b"; +} +.icon-recovery:before { + content: "\e92d"; +} +.icon-regentry:before { + content: "\e92e"; +} +.icon-reserve:before { + content: "\e92f"; +} +.icon-revision:before { content: "\e94c"; } -.icon-web:before { +.icon-risk:before { + content: "\e930"; +} +.icon-services:before { content: "\e94d"; } +.icon-settings:before { + content: "\e931"; +} +.icon-sms:before { + content: "\e932"; +} +.icon-solclaim:before { + content: "\e933"; +} +.icon-solunion:before { + content: "\e934"; +} +.icon-splur:before { + content: "\e935"; +} +.icon-stowaway:before { + content: "\e92c"; +} +.icon-supplier:before { + content: "\e936"; +} +.icon-tags:before { + content: "\e937"; +} +.icon-tax:before { + content: "\e938"; +} +.icon-ticket:before { + content: "\e939"; +} +.icon-traceability:before { + content: "\e93a"; +} +.icon-transaction:before { + content: "\e93b"; +} +.icon-volume:before { + content: "\e93d"; +} +.icon-web:before { + content: "\e93e"; +} .icon-worker:before { - content: "\e94e"; + content: "\e943"; } \ No newline at end of file diff --git a/front/core/styles/salixfont.eot b/front/core/styles/salixfont.eot deleted file mode 100644 index d02e74ae4..000000000 Binary files a/front/core/styles/salixfont.eot and /dev/null differ diff --git a/front/core/styles/salixfont.svg b/front/core/styles/salixfont.svg index 9c99d9457..d6654ec1e 100644 --- a/front/core/styles/salixfont.svg +++ b/front/core/styles/salixfont.svg @@ -3,87 +3,87 @@ Generated by IcoMoon - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/core/styles/salixfont.ttf b/front/core/styles/salixfont.ttf index 229075e35..7c0ac2492 100644 Binary files a/front/core/styles/salixfont.ttf and b/front/core/styles/salixfont.ttf differ diff --git a/front/core/styles/salixfont.woff b/front/core/styles/salixfont.woff index 97f55da68..2a9a880f5 100644 Binary files a/front/core/styles/salixfont.woff and b/front/core/styles/salixfont.woff differ diff --git a/modules/agency/front/basic-data/index.html b/modules/agency/front/basic-data/index.html index 4d0a67bdf..28ec35377 100644 --- a/modules/agency/front/basic-data/index.html +++ b/modules/agency/front/basic-data/index.html @@ -51,14 +51,14 @@ label="Price" field="$ctrl.zone.price" min="0.00" - step="0.20" + step="0.10" display-controls="false"> diff --git a/modules/agency/front/create/index.html b/modules/agency/front/create/index.html index 0a8c08207..ac6b76efd 100644 --- a/modules/agency/front/create/index.html +++ b/modules/agency/front/create/index.html @@ -53,14 +53,14 @@ label="Price" field="$ctrl.zone.price" min="0.00" - step="0.20" + step="0.10" display-controls="false"> diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index 6a8eac680..f92248037 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -23,6 +23,11 @@ module.exports = Self => { type: 'String', description: `If it's and integer searchs by id, otherwise it searchs by name`, http: {source: 'query'} + }, { + arg: 'id', + type: 'Integer', + description: 'Item id', + http: {source: 'query'} }, { arg: 'categoryFk', type: 'Integer', @@ -43,6 +48,11 @@ module.exports = Self => { type: 'Boolean', description: 'Whether the the item is o not active', http: {source: 'query'} + }, { + arg: 'salesPersonFk', + type: 'Integer', + description: 'The buyer of the item', + http: {source: 'query'} } ], returns: { @@ -70,8 +80,10 @@ module.exports = Self => { return {'i.description': {like: `%${value}%`}}; case 'categoryFk': return {'ic.id': value}; + case 'salesPersonFk': + return {'t.workerFk': value}; case 'typeFk': - return {'t.id': value}; + return {'i.typeFk': value}; case 'isActive': return {'i.isActive': value}; } @@ -94,18 +106,19 @@ module.exports = Self => { intr.description AS intrastat, i.stems, ori.code AS origin, t.name AS type, ic.name AS category, i.density, tc.description AS taxClass, - b.grouping, b.packing + b.grouping, b.packing, itn.code AS niche FROM item i - JOIN itemType t ON t.id = i.typeFk + LEFT JOIN itemType t ON t.id = i.typeFk LEFT JOIN itemCategory ic ON ic.id = t.categoryFk - JOIN worker w ON w.id = t.workerFk - JOIN account.user u ON u.id = w.userFk + LEFT JOIN worker w ON w.id = t.workerFk + LEFT JOIN account.user u ON u.id = w.userFk LEFT JOIN intrastat intr ON intr.id = i.intrastatFk LEFT JOIN producer pr ON pr.id = i.producerFk LEFT JOIN origin ori ON ori.id = i.originFk LEFT JOIN taxClass tc ON tc.id = i.taxClassFk LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk - LEFT JOIN vn.buy b ON b.id = lb.buy_id` + LEFT JOIN vn.buy b ON b.id = lb.buy_id + LEFT JOIN itemPlacement itn ON itn.itemFk = i.id AND itn.warehouseFk = t.warehouseFk` ); if (ctx.args.hasVisible === true) { @@ -118,17 +131,26 @@ module.exports = Self => { if (ctx.args.tags) { let i = 1; - for (let tag of ctx.args.tags) { - if (tag.value == null) continue; - let tAlias = `it${i++}`; - stmt.merge({ - sql: `JOIN itemTag ${tAlias} ON ${tAlias}.itemFk = i.id - AND ${tAlias}.tagFk = ? - AND ${tAlias}.value = ?`, - params: [tag.tagFk, tag.value] - }); + for (const tag of ctx.args.tags) { + const tAlias = `it${i++}`; + + if (tag.tagFk) { + stmt.merge({ + sql: `JOIN vn.itemTag ${tAlias} ON ${tAlias}.itemFk = i.id + AND ${tAlias}.tagFk = ? + AND ${tAlias}.value LIKE ?`, + params: [tag.tagFk, `%${tag.value}%`], + }); + } else { + stmt.merge({ + sql: `JOIN vn.itemTag ${tAlias} ON ${tAlias}.itemFk = i.id + AND ${tAlias}.value LIKE ?`, + params: [`%${tag.value}%`], + }); + } } } + stmt.merge(conn.makeSuffix(filter)); let itemsIndex = stmts.push(stmt) - 1; diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 5a2988537..88f8fb5bc 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -26,11 +26,13 @@ Packing Description Stems + Size + Niche Type Category Intrastat Origin - Sales person + Buyer Density Tax class Active @@ -65,6 +67,8 @@ {{::item.stems}} + {{::item.size}} + {{::item.niche}} {{::item.type}} {{::item.category}} {{::item.intrastat}} diff --git a/modules/item/front/search-panel/index.html b/modules/item/front/search-panel/index.html index e3cb1f3d2..fca01dc2a 100644 --- a/modules/item/front/search-panel/index.html +++ b/modules/item/front/search-panel/index.html @@ -46,6 +46,17 @@ label="Description" model="filter.description"> + + { arg: 'clientFk', type: 'Integer', description: `The client id` + }, { + arg: 'ticketFk', + type: 'Integer', + description: `The ticket id` }, { arg: 'agencyModeFk', type: 'Integer', @@ -78,6 +82,8 @@ module.exports = Self => { return {'o.agency_id': value}; case 'sourceApp': return {'o.source_app': value}; + case 'ticketFk': + return {'ort.ticketFk': value}; case 'isConfirmed': return {'o.confirmed': value ? 1 : 0}; case 'id': @@ -118,6 +124,12 @@ module.exports = Self => { LEFT JOIN worker wk ON wk.id = c.salesPersonFk LEFT JOIN account.user u ON u.id = wk.userFk LEFT JOIN company co ON co.id = o.company_id`); + + if (ctx.args && ctx.args.ticketFk) { + stmt.merge({ + sql: `LEFT JOIN orderTicket ort ON ort.orderFk = o.id` + }); + } stmt.merge(conn.makeSuffix(filter)); stmts.push(stmt); diff --git a/modules/order/front/search-panel/index.html b/modules/order/front/search-panel/index.html index 5f312992e..0af885a53 100644 --- a/modules/order/front/search-panel/index.html +++ b/modules/order/front/search-panel/index.html @@ -34,10 +34,10 @@ field="filter.workerFk" url="/client/api/Clients/activeWorkersWithRole" search-function="{firstName: $search}" + show-field="nickname" value-field="id" where="{role: 'employee'}" label="Sales person"> - {{firstName}} {{name}} @@ -50,6 +50,13 @@ model="filter.to"> + + + + { expect(sales.length).toEqual(4); expect(sales[0].tags).toBeDefined(); - expect(sales[1].claim).toBeDefined(); + expect(sales[1].tags).toBeDefined(); + expect(sales[2].tags).toBeDefined(); + expect(sales[3].tags).toBeDefined(); + expect(sales[2].claim).toBeDefined(); }); }); diff --git a/modules/ticket/back/methods/ticket/summary.js b/modules/ticket/back/methods/ticket/summary.js index b47d325cd..2b1d8711c 100644 --- a/modules/ticket/back/methods/ticket/summary.js +++ b/modules/ticket/back/methods/ticket/summary.js @@ -113,7 +113,7 @@ module.exports = Self => { where: { ticketFk: ticketFk }, - order: 'itemFk ASC', + order: 'concept', include: [ {relation: 'item'}, {relation: 'claimBeginning'}