dev #1731

Merged
jgallego merged 105 commits from dev into test 2023-08-31 09:13:29 +00:00
3 changed files with 9 additions and 42 deletions
Showing only changes of commit 7d2e98267f - Show all commits

View File

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

View File

@ -1,3 +1,4 @@
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('SaleTracking', 'deleteSaleGroupDetail', 'WRITE', 'ALLOW', 'ROLE', 'employee');
('SaleTracking', 'deleteSaleGroupDetail', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
('SaleTracking', 'replaceOrCreate', 'WRITE', 'ALLOW', 'ROLE', 'employee');

View File

@ -67,9 +67,13 @@ module.exports = Self => {
JOIN vn.sale s ON s.ticketFk = t.id
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 vn.saleTracking stPrevious ON stPrevious.saleFk = s.id AND stPrevious.stateFk = 26
LEFT JOIN vn.saleTracking stPrepared ON stPrepared.saleFk = s.id AND stPrepared.stateFk = 14
LEFT JOIN vn.saleTracking stControled ON stControled.saleFk = s.id AND stControled.stateFk = 8
LEFT JOIN vn.state st ON TRUE
LEFT JOIN vn.saleTracking stPrevious ON stPrevious.saleFk = s.id
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.saleGroup sg ON sg.id = sgd.saleGroupFk
LEFT JOIN vn.parking p ON p.id = sg.parkingFk