added modelconfig.json for models in the commit 60f3bfc
and new procedure 04.ticketVolume
This commit is contained in:
parent
5e01ab1a9f
commit
ab3ead6a28
|
@ -0,0 +1,30 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `ticketVolume`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`ticketVolume`(IN vTicketId INT)
|
||||
BEGIN
|
||||
DECLARE vWarehouseId INTEGER;
|
||||
DECLARE vShippedDate DATE;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS ticketVolume;
|
||||
SELECT warehouseFk, shipped INTO vWarehouseId,vShippedDate FROM vn.ticket WHERE id = vTicketId;
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS ticketVolume ENGINE MEMORY
|
||||
|
||||
SELECT itemFk,quantity, concept, VolUd as m3_uni, volume as m3, @m3:= @m3 + ifnull(volume,0) as m3_total
|
||||
FROM
|
||||
(
|
||||
SELECT round(r.cm3 / 1000000,3) as VolUd ,s.quantity, round(r.cm3 * s.quantity / 1000000,3) as volume,
|
||||
s.itemFk, s.concept, @m3:= 0, @vol:=0, t.agencyModeFk
|
||||
FROM sale s
|
||||
JOIN vn.ticket t on t.id = s.ticketFk
|
||||
JOIN bi.rotacion r ON r.Id_Article = s.itemFk AND r.warehouse_id = t.warehouseFk
|
||||
WHERE s.ticketFk = vTicketId
|
||||
) sub;
|
||||
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -19,6 +19,12 @@
|
|||
},
|
||||
"SaleChecked": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ComponentRate": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"SaleComponent": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue