Merge pull request '7161DeleteitemTrash' (!2273) from 7161DeleteitemTrash into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2273 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
aed875743a
|
@ -13,6 +13,7 @@ BEGIN
|
|||
* @param vQuantity a dar de alta/baja
|
||||
* @param vAddressFk id address
|
||||
*/
|
||||
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vClientFk INT;
|
||||
DECLARE vDefaultCompanyFk INT;
|
||||
|
@ -23,17 +24,17 @@ BEGIN
|
|||
|
||||
SELECT DEFAULT(companyFk) INTO vDefaultCompanyFk
|
||||
FROM vn.ticket LIMIT 1;
|
||||
|
||||
IF vAddressFk IS NULL THEN
|
||||
|
||||
IF vAddressFk IS NULL THEN
|
||||
SELECT pc.shortageAddressFk INTO vAddressShortage
|
||||
FROM productionConfig pc ;
|
||||
ELSE
|
||||
ELSE
|
||||
SET vAddressShortage = vAddressFk;
|
||||
END IF;
|
||||
|
||||
SELECT a.clientFk INTO vClientFk
|
||||
FROM address a
|
||||
WHERE a.id = vAddressFk;
|
||||
WHERE a.id = vAddressShortage;
|
||||
|
||||
SELECT t.id INTO vTicketFk
|
||||
FROM ticket t
|
||||
|
@ -65,7 +66,7 @@ BEGIN
|
|||
INSERT INTO sale(ticketFk, itemFk, concept, quantity)
|
||||
SELECT vTicketFk,
|
||||
vItemFk,
|
||||
CONCAT(longName,' ', worker_getCode(), ' ', LEFT(CAST(util.VN_NOW() AS TIME),5)),
|
||||
name,
|
||||
vQuantity
|
||||
FROM item
|
||||
WHERE id = vItemFk;
|
||||
|
|
Loading…
Reference in New Issue