diff --git a/db/install/changes/ticketGetVisibleAvailable.sql b/db/install/changes/ticketGetVisibleAvailable.sql new file mode 100644 index 000000000..9ead5a3cd --- /dev/null +++ b/db/install/changes/ticketGetVisibleAvailable.sql @@ -0,0 +1,39 @@ +USE `vn`; +DROP procedure IF EXISTS `ticketGetVisibleAvailable`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` PROCEDURE `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, it.subName + 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/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index b71b3de1a..e0673a9fd 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -100,8 +100,8 @@ module.exports = Self => { `SELECT i.id, i.image, i.name, i.description, i.size, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7, i.tag8, i.value8, - i.tag9, i.value9, i.tag10, i.value10, i.isActive, - t.name type, u.nickname userNickname, + i.tag9, i.value9, i.tag10, i.value10, i.subName, + i.isActive, t.name type, u.nickname userNickname, t.name type, u.id userId, intr.description AS intrastat, i.stems, ori.code AS origin, t.name AS type, diff --git a/modules/item/front/fetched-tags/index.html b/modules/item/front/fetched-tags/index.html index 818296a80..78420c79f 100644 --- a/modules/item/front/fetched-tags/index.html +++ b/modules/item/front/fetched-tags/index.html @@ -1,5 +1,8 @@ {{::$ctrl.title}} + +

{{::$ctrl.subName}}

+
vn-one:nth-child(2) h3 { + color: $color-font-secondary; + text-transform: uppercase; + line-height: initial; + text-align: center; + font-size: 1em + } + & > vn-auto { display: flex; padding-left: .4em; @@ -39,7 +48,7 @@ vn-fetched-tags { flex-direction: column; & > vn-one { - padding-bottom: .2em; + padding-bottom: .2em } & > vn-auto { white-space: initial; diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 76bb017f2..41de6da18 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -62,7 +62,8 @@ + title="::item.name" + sub-name="::item.subName"> {{::item.stems}} diff --git a/modules/order/front/line/index.html b/modules/order/front/line/index.html index b95ef945c..2e53ad51d 100644 --- a/modules/order/front/line/index.html +++ b/modules/order/front/line/index.html @@ -43,7 +43,8 @@ + title="::row.item.name" + sub-name="::row.item.subName"> {{::row.warehouse.name}} diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html index 15bd5b3a4..c4450469b 100644 --- a/modules/order/front/summary/index.html +++ b/modules/order/front/summary/index.html @@ -70,11 +70,12 @@ - - + max-length="6" + item="::row.item" + title="::row.item.name" + sub-name="::row.item.subName"> + + {{::row.quantity}} {{::row.price | currency: 'EUR':2}} {{::row.quantity * row.price | currency: 'EUR':2}} diff --git a/modules/order/front/volume/index.html b/modules/order/front/volume/index.html index 359e9e37b..5b081783e 100644 --- a/modules/order/front/volume/index.html +++ b/modules/order/front/volume/index.html @@ -42,7 +42,8 @@ + title="::row.item.name" + sub-name="::row.item.subName"> {{::row.quantity}} diff --git a/modules/ticket/front/component/index.html b/modules/ticket/front/component/index.html index 9274a4c18..67f225946 100644 --- a/modules/ticket/front/component/index.html +++ b/modules/ticket/front/component/index.html @@ -51,7 +51,8 @@ + title="::sale.concept" + sub-name="::sale.item.subName"> diff --git a/modules/ticket/front/data/step-two/index.html b/modules/ticket/front/data/step-two/index.html index e343ad9e9..12da56584 100644 --- a/modules/ticket/front/data/step-two/index.html +++ b/modules/ticket/front/data/step-two/index.html @@ -17,9 +17,9 @@ {{("000000"+sale.itemFk).slice(-6)}} + max-length="6" + item="::sale.item" + title="::sale.concept"> {{::sale.quantity}} diff --git a/modules/ticket/front/sale-checked/index.html b/modules/ticket/front/sale-checked/index.html index 968d69af2..00eeb2981 100644 --- a/modules/ticket/front/sale-checked/index.html +++ b/modules/ticket/front/sale-checked/index.html @@ -37,7 +37,8 @@ + title="::sale.concept" + sub-name="::sale.item.subName"> {{::sale.quantity}} diff --git a/modules/ticket/front/sale-tracking/index.html b/modules/ticket/front/sale-tracking/index.html index a8284c571..9093ebdba 100644 --- a/modules/ticket/front/sale-tracking/index.html +++ b/modules/ticket/front/sale-tracking/index.html @@ -41,7 +41,8 @@ + title="::sale.concept" + sub-name="::sale.item.subName"> {{::sale.quantity}} diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index bfc98a9d9..479ac8f09 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -121,7 +121,8 @@ + title="::sale.concept" + sub-name="::sale.subName"> diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 733a4228b..1cb9713d5 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -97,7 +97,13 @@ {{::sale.quantity}} - + + + {{::sale.price | currency: 'EUR':2}} {{::sale.discount}} % {{::sale.quantity * sale.price | currency: 'EUR':2}} diff --git a/modules/ticket/front/volume/index.html b/modules/ticket/front/volume/index.html index 34de1e470..ee00d025a 100644 --- a/modules/ticket/front/volume/index.html +++ b/modules/ticket/front/volume/index.html @@ -38,7 +38,13 @@ {{sale.itemFk | zeroFill:6}} - + + + {{::sale.quantity}} {{::sale.volume.m3 | number:3}}