Merge branch 'master' into 7969-plantTray
gitea/salix/pipeline/pr-master This commit looks good
Details
gitea/salix/pipeline/pr-master This commit looks good
Details
This commit is contained in:
commit
8b8c64ed65
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue