added subName to fetched-tags #1246
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-03-22 15:05:15 +01:00
parent 6c9f1cfdfa
commit 4a4b997e1b
16 changed files with 93 additions and 21 deletions

View File

@ -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 ;

View File

@ -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,

View File

@ -1,5 +1,8 @@
<vn-horizontal>
<vn-one>{{::$ctrl.title}}</vn-one>
<vn-one ng-if="$ctrl.subName">
<h3>{{::$ctrl.subName}}</h3>
</vn-one>
<vn-auto>
<section
class="inline-tag ellipsize"

View File

@ -6,6 +6,7 @@ ngModule.component('vnFetchedTags', {
bindings: {
maxLength: '<',
item: '<',
title: '<'
title: '<',
subName: '<?'
}
});

View File

@ -12,6 +12,15 @@ vn-fetched-tags {
text-overflow: ellipsis;
min-width: 5em;
}
& > 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;

View File

@ -62,7 +62,8 @@
<vn-fetched-tags
max-length="6"
item="::item"
title="::item.name">
title="::item.name"
sub-name="::item.subName">
</vn-fetched-tags>
</vn-td>
<vn-td number>{{::item.stems}}</vn-td>

View File

@ -43,7 +43,8 @@
<vn-fetched-tags
max-length="6"
item="::row.item"
title="::row.item.name">
title="::row.item.name"
sub-name="::row.item.subName">
</vn-fetched-tags>
</vn-td>
<vn-td>{{::row.warehouse.name}}</vn-td>

View File

@ -70,11 +70,12 @@
</vn-td>
<vn-td expand>
<vn-fetched-tags
max-length="6"
item="::row.item"
title="::row.item.name">
</vn-fetched-tags>
</vn-td>
max-length="6"
item="::row.item"
title="::row.item.name"
sub-name="::row.item.subName">
</vn-fetched-tags>
</vn-td>
<vn-td number>{{::row.quantity}}</vn-td>
<vn-td number>{{::row.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{::row.quantity * row.price | currency: 'EUR':2}}</vn-td>

View File

@ -42,7 +42,8 @@
<vn-fetched-tags
max-length="6"
item="::row.item"
title="::row.item.name">
title="::row.item.name"
sub-name="::row.item.subName">
</vn-fetched-tags>
</vn-td>
<vn-td number>{{::row.quantity}}</vn-td>

View File

@ -51,7 +51,8 @@
<vn-fetched-tags
max-length="6"
item="::sale.item"
title="::sale.concept">
title="::sale.concept"
sub-name="::sale.item.subName">
</vn-fetched-tags>
</td>
<td rowspan="{{::sale.components.length + 1}}" number>

View File

@ -17,9 +17,9 @@
<td number>{{("000000"+sale.itemFk).slice(-6)}}</td>
<td expand>
<vn-fetched-tags
max-length="6"
item="::sale.item"
title="::sale.concept">
max-length="6"
item="::sale.item"
title="::sale.concept">
</vn-fetched-tags>
</td>
<td number>{{::sale.quantity}}</td>

View File

@ -37,7 +37,8 @@
<vn-fetched-tags
max-length="6"
item="::sale.item"
title="::sale.concept">
title="::sale.concept"
sub-name="::sale.item.subName">
</vn-fetched-tags>
</vn-td>
<vn-td number>{{::sale.quantity}}</vn-td>

View File

@ -41,7 +41,8 @@
<vn-fetched-tags
max-length="6"
item="::sale.item"
title="::sale.concept">
title="::sale.concept"
sub-name="::sale.item.subName">
</vn-fetched-tags>
</vn-td>
<vn-td>{{::sale.quantity}}</vn-td>

View File

@ -121,7 +121,8 @@
<vn-fetched-tags
max-length="6"
item="::sale.tags"
title="::sale.concept">
title="::sale.concept"
sub-name="::sale.subName">
</vn-fetched-tags>
</vn-td>
<vn-td number ng-if="$ctrl.isEditable">

View File

@ -97,7 +97,13 @@
</span>
</vn-td>
<vn-td number>{{::sale.quantity}}</vn-td>
<vn-td expand><vn-fetched-tags max-length="6" item="sale.item" title="sale.concept"/></vn-td>
<vn-td expand>
<vn-fetched-tags
max-length="6"
item="::sale.item"
title="::sale.concept"
sub-name="::sale.item.subName"/>
</vn-td>
<vn-td number>{{::sale.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{::sale.discount}} %</vn-td>
<vn-td number>{{::sale.quantity * sale.price | currency: 'EUR':2}}</vn-td>

View File

@ -38,7 +38,13 @@
{{sale.itemFk | zeroFill:6}}
</span>
</vn-td>
<vn-td expand><vn-fetched-tags max-length="6" item="::sale.item" title="::sale.concept"/></vn-td>
<vn-td expand>
<vn-fetched-tags
max-length="6"
item="::sale.item"
title="::sale.concept"
sub-name="::sale.item.subName"/>
</vn-td>
<vn-td number>{{::sale.quantity}}</vn-td>
<vn-td number>{{::sale.volume.m3 | number:3}}</vn-td>
</vn-tr>