This commit is contained in:
parent
8f7caa1183
commit
7d2e98267f
|
@ -1,38 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
$$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`saleTracking_new`(
|
|
||||||
vSaleFK INT,
|
|
||||||
vIsChecked BOOLEAN,
|
|
||||||
vOriginalQuantity INT,
|
|
||||||
vWorkerFk INT,
|
|
||||||
vState VARCHAR(50),
|
|
||||||
vIsScanned BOOLEAN)
|
|
||||||
BEGIN
|
|
||||||
/**
|
|
||||||
* Modifica registro de saleTracking
|
|
||||||
*
|
|
||||||
* @param vSaleFK Identificador del registro a modificar
|
|
||||||
* @param vIsChecked Indica si la línea ha sido pulsada
|
|
||||||
* @param vOriginalQuantity Cantidad original
|
|
||||||
* @param vWorkerFk Identificador del trabajador
|
|
||||||
* @param vAction Identificador de la acción realizada
|
|
||||||
* @param vState Identificador del estado a modificar
|
|
||||||
* @param vIsScanned Identificador si se ha escaneado automáticamente o manual
|
|
||||||
*/
|
|
||||||
|
|
||||||
REPLACE vn.saleTracking(saleFk,
|
|
||||||
isChecked,
|
|
||||||
originalQuantity,
|
|
||||||
workerFk,
|
|
||||||
stateFk,
|
|
||||||
isScanned)
|
|
||||||
SELECT vSaleFK,
|
|
||||||
vIsChecked,
|
|
||||||
vOriginalQuantity,
|
|
||||||
IFNULL(vWorkerFk, vn.getUser()),
|
|
||||||
s.id,
|
|
||||||
vIsScanned
|
|
||||||
FROM vn.state s
|
|
||||||
WHERE s.code = vState COLLATE utf8_unicode_ci;
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -1,3 +1,4 @@
|
||||||
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||||
VALUES
|
VALUES
|
||||||
('SaleTracking', 'deleteSaleGroupDetail', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
('SaleTracking', 'deleteSaleGroupDetail', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||||
|
('SaleTracking', 'replaceOrCreate', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
|
@ -67,9 +67,13 @@ module.exports = Self => {
|
||||||
JOIN vn.sale s ON s.ticketFk = t.id
|
JOIN vn.sale s ON s.ticketFk = t.id
|
||||||
JOIN vn.item i ON i.id = s.itemFk
|
JOIN vn.item i ON i.id = s.itemFk
|
||||||
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk
|
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk
|
||||||
LEFT JOIN vn.saleTracking stPrevious ON stPrevious.saleFk = s.id AND stPrevious.stateFk = 26
|
LEFT JOIN vn.state st ON TRUE
|
||||||
LEFT JOIN vn.saleTracking stPrepared ON stPrepared.saleFk = s.id AND stPrepared.stateFk = 14
|
LEFT JOIN vn.saleTracking stPrevious ON stPrevious.saleFk = s.id
|
||||||
LEFT JOIN vn.saleTracking stControled ON stControled.saleFk = s.id AND stControled.stateFk = 8
|
AND stPrevious.stateFk = (SELECT id FROM vn.state WHERE code = 'PREVIOUS_PREPARATION')
|
||||||
|
LEFT JOIN vn.saleTracking stPrepared ON stPrepared.saleFk = s.id
|
||||||
|
AND stPrepared.stateFk = (SELECT id FROM vn.state WHERE code = 'PREPARED')
|
||||||
|
LEFT JOIN vn.saleTracking stControled ON stControled.saleFk = s.id
|
||||||
|
AND stControled.stateFk = (SELECT id FROM vn.state s2 WHERE code = 'CHECKED')
|
||||||
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
|
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||||
LEFT JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk
|
LEFT JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||||
LEFT JOIN vn.parking p ON p.id = sg.parkingFk
|
LEFT JOIN vn.parking p ON p.id = sg.parkingFk
|
||||||
|
|
Loading…
Reference in New Issue