Merge branch 'master' into 7969-plantTray
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Pako Natek 2024-09-17 10:53:44 +00:00
commit 8b8c64ed65
3 changed files with 22 additions and 19 deletions

View File

@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setVolume`(
)
BEGIN
/**
* Update the volume ticket
* Update the volume ticket.
*
* @param vSelf Ticket id
*/

View File

@ -4,26 +4,36 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setVolumeIte
)
BEGIN
/**
* Update the volume tickets of item
* Update the volume of tickets containing the item.
*
* @param vSelf Ticket id
* @param vItemFk Item id
*/
CREATE OR REPLACE TEMPORARY TABLE tTicket
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT t.id, SUM(s.quantity * ic.cm3delivery / 1000000) volume
DECLARE vTicket INT;
DECLARE vDone BOOL;
DECLARE vTickets CURSOR FOR
SELECT DISTINCT t.id
FROM sale s
JOIN ticket t ON t.id = s.ticketFk
JOIN itemCost ic ON ic.itemFk = s.itemFk
AND ic.warehouseFk = t.warehouseFk
WHERE s.itemFk = vItemFk
AND t.shipped >= util.VN_CURDATE()
GROUP BY t.id;
AND t.refFk IS NULL;
UPDATE ticket t
JOIN tTicket tt ON tt.id = t.id
SET t.volume = tt.volume;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DROP TEMPORARY TABLE tTicket;
OPEN vTickets;
l: LOOP
FETCH vTickets INTO vTicket;
IF vDone THEN
LEAVE l;
END IF;
CALL ticket_setVolume(vTicket);
END LOOP l;
CLOSE vTickets;
END$$
DELIMITER ;

View File

@ -349,13 +349,6 @@
message="Recalculate components">
</vn-confirm>
<!-- Client balance popup-->
<vn-client-balance-create
vn-id="balance-create"
company-fk="$ctrl.vnConfig.companyFk"
client-fk="$ctrl.ticket.client.id">
</vn-client-balance-create>
<!-- Send pdf to tablet -->
<vn-confirm
vn-id="pdfToTablet"