refs #6498 procRefactor6 #2134

Merged
ivanm merged 8 commits from 6499-procRefactor6 into dev 2024-03-21 11:03:33 +00:00
Member
No description provided.
ivanm added 2 commits 2024-03-05 12:48:10 +00:00
ivanm changed title from 6499-procRefactor6 to 6498-procRefactor6 2024-03-05 12:50:16 +00:00
ivanm changed title from 6498-procRefactor6 to 6499-procRefactor6 2024-03-05 12:50:49 +00:00
ivanm changed title from 6499-procRefactor6 to 6498-procRefactor6 2024-03-05 13:09:04 +00:00
ivanm added 1 commit 2024-03-05 13:35:37 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
f215ce5f05
refs #6498 Delete procedures vn2008 and grant vn procs
ivanm added 1 commit 2024-03-06 08:02:45 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
354ecfaa16
refs #6498 Arreglar grant y tabs
ivanm requested review from guillermo 2024-03-06 08:04:48 +00:00
guillermo requested changes 2024-03-06 10:04:03 +00:00
@ -0,0 +1,100 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`absoluteInventoryHistory`(
vItemFk INT, vWarehouse INT, vDate DATETIME)
Member

Esto separalo, tipo:

   vItemFk INT,
   vWarehouse INT,
   vDate DATETIME
)
Esto separalo, tipo: ``` vItemFk INT, vWarehouse INT, vDate DATETIME ) ```
@ -0,0 +8,4 @@
* hasta una fecha determinada.
*
* @param vItemFk Id de artículo
* @param vWarehouse Almacén
Member

Cambiar nombre de variable a vWarehouseFk y comentario a Id de almacén

Cambiar nombre de variable a vWarehouseFk y comentario a `Id de almacén`
guillermo marked this conversation as resolved
@ -0,0 +12,4 @@
* @param vDate Fecha
*/
DECLARE vCalculatedInventory INT;
DECLARE vToday DATETIME;
Member
DECLARE vToday DATETIME DEFAULT util.VN_CURDATE();
``` DECLARE vToday DATETIME DEFAULT util.VN_CURDATE(); ```
guillermo marked this conversation as resolved
@ -0,0 +14,4 @@
DECLARE vCalculatedInventory INT;
DECLARE vToday DATETIME;
SET vToday = util.VN_CURDATE();
Member

Quitar linea

Quitar linea
guillermo marked this conversation as resolved
@ -0,0 +23,4 @@
SELECT tr.landed `date`,
b.quantity input,
NULL `output`,
(tr.isReceived != FALSE) ok,
Member
tr.isReceived ok,
``` tr.isReceived ok, ```
guillermo marked this conversation as resolved
@ -0,0 +33,4 @@
JOIN travel tr ON tr.id = e.travelFk
JOIN supplier s ON s.id = e.supplierFk
WHERE tr.landed >= '2001-01-01'
AND s.id <> 4
Member

No poner números a pelo en el código, para ello:

AND s.id <> (SELECT supplierFk FROM inventoryConfig)
No poner números a pelo en el código, para ello: ``` AND s.id <> (SELECT supplierFk FROM inventoryConfig) ```
@ -0,0 +61,4 @@
SELECT t.shipped `date`,
NULL input,
m.quantity `output`,
(m.isPicked <> 0 OR t.isLabeled <> 0 OR t.refFk IS NOT NULL) ok,
Member
(m.isPicked OR t.isLabeled OR t.refFk IS NOT NULL)
``` (m.isPicked OR t.isLabeled OR t.refFk IS NOT NULL) ```
@ -0,0 +69,4 @@
FROM sale m
JOIN ticket t ON t.id = m.ticketFk
JOIN client c ON c.id = t.clientFk
WHERE t.shipped >= '2001-01-01'
Member

'2001-01-01' repetido en el código, crear variable con DEFAULT '2001-01-01'

'2001-01-01' repetido en el código, crear variable con DEFAULT '2001-01-01'
@ -0,0 +75,4 @@
) t1
ORDER BY `date`, input DESC, ok DESC;
SELECT sum(input) - sum(`output`) INTO vCalculatedInventory
Member

sum en mayuscula

sum en mayuscula
@ -0,0 +80,4 @@
WHERE `date` < vDate;
SELECT p1.*, NULL v_virtual
FROM(
Member

Espacio entre el FROM y el (

Espacio entre el FROM y el (
guillermo marked this conversation as resolved
@ -0,0 +28,4 @@
SELECT tr.landed `date`,
c.quantity input,
NULL `output`,
IF(warehouseInFk = 44, 1, warehouseInFk) warehouse,
Member

warehouseInFk warehouse

warehouseInFk warehouse
guillermo marked this conversation as resolved
@ -0,0 +29,4 @@
c.quantity input,
NULL `output`,
IF(warehouseInFk = 44, 1, warehouseInFk) warehouse,
(tr.isReceived <> FALSE) ok,
Member

tr.isReceived

`tr.isReceived`
@ -0,0 +31,4 @@
IF(warehouseInFk = 44, 1, warehouseInFk) warehouse,
(tr.isReceived <> FALSE) ok,
e.invoiceNumber reference,
e.id id
Member

e.id

e.id
@ -0,0 +38,4 @@
WHERE tr.landed >= vDateInventory
AND c.itemFk = vItemFk
AND NOT e.isRaid
AND c.quantity <> 0
Member

AND c.quantity

`AND c.quantity`
@ -0,0 +46,4 @@
tr.warehouseOutFk warehouse,
tr.isDelivered ok,
e.invoiceNumber reference,
e.id id
Member

Quitar alias siempre a partir del segundo select cuando se haga un UNION

Quitar alias siempre a partir del segundo select cuando se haga un UNION
@ -0,0 +53,4 @@
WHERE tr.shipped >= vDateInventory
AND c.itemFk = vItemFk
AND NOT e.isRaid
AND c.quantity <> 0
Member

c.quantity

`c.quantity`
@ -0,0 +70,4 @@
JOIN warehouse ON warehouse.id = history.warehouse
ORDER BY `date`, input DESC, ok DESC;
DROP TEMPORARY TABLE IF EXISTS tMultipleHistory2;
Member

Poner todo en un solo drop

Poner todo en un solo drop
@ -0,0 +156,4 @@
input, `output`, ok, reference, id
FROM tMultipleHistory8
) sub
ORDER BY `date`, BOGinput IS NULL, VNHinput IS NULL, ALGinput IS NULL, MADinput IS NULL, MCFinput IS NULL, VILinput IS NULL, BARinput IS NULL;
Member

Añadir sangria

Añadir sangria
ivanm added 1 commit 2024-03-06 11:47:20 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
7947d6644e
refs #6498 Correcion errores
ivanm added 1 commit 2024-03-06 14:19:17 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
6b2533cfb1
refs #6498 correccion errores 2
ivanm requested review from guillermo 2024-03-06 14:21:49 +00:00
guillermo approved these changes 2024-03-11 13:36:30 +00:00
guillermo added 1 commit 2024-03-11 13:36:38 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
516b4b364f
Merge branch 'dev' into 6499-procRefactor6
guillermo changed title from 6498-procRefactor6 to refs #6498 procRefactor6 2024-03-11 13:40:08 +00:00
ivanm added 1 commit 2024-03-21 10:39:08 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
c33c90aefe
Merge branch 'dev' into 6499-procRefactor6
ivanm merged commit 268c63ce8f into dev 2024-03-21 11:03:33 +00:00
ivanm deleted branch 6499-procRefactor6 2024-03-21 11:03:34 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#2134
No description provided.