refactor: refs #5586 Optimized SQL negativeBases #2007

Merged
guillermo merged 12 commits from 5586-optimizeNegativeBases into dev 2024-02-20 06:28:05 +00:00
Member
No description provided.
guillermo added 1 commit 2024-02-08 10:36:46 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
974228eedd
refactor: refs #5586 Optimized SQL negativeBases
guillermo added 1 commit 2024-02-13 11:28:56 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
42de1a7e51
Merge branch 'dev' into 5586-optimizeNegativeBases
guillermo added 1 commit 2024-02-13 11:49:50 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
bdc6192a7c
refactor: refs #5586 Optimized SQL negativeBases
guillermo requested review from jgallego 2024-02-13 11:50:04 +00:00
jgallego requested changes 2024-02-13 11:53:55 +00:00
@ -56,4 +52,0 @@
FROM ticket t
WHERE shipped BETWEEN ? AND ?
AND refFk IS NULL`, [args.from, args.to]));
stmts.push(`CALL vn.ticket_getTax(NULL)`);
Owner

si lleves esta cridà funciona igual? a mes ha canviat nom de taules de tickte a filter..

si lleves esta cridà funciona igual? a mes ha canviat nom de taules de tickte a filter..
Author
Member

Sí, he respetat el alias taxableBase, falta que arregle els test de back que he vist que fallen

Sí, he respetat el alias taxableBase, falta que arregle els test de back que he vist que fallen
guillermo added 1 commit 2024-02-13 12:08:21 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
92261ebe0d
fix: refs #5586 Tests fix
guillermo added 1 commit 2024-02-14 06:03:49 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
142c1bf7bd
Merge branch 'dev' into 5586-optimizeNegativeBases
guillermo requested review from jgallego 2024-02-14 06:03:50 +00:00
jgallego requested changes 2024-02-14 06:34:49 +00:00
@ -83,4 +65,0 @@
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
JOIN account.user u ON u.id = w.id
LEFT JOIN (
SELECT ticketFk, taxableBase
Owner

açò valida que ninguna de les bases imponibles siguen < 0 per separat es a dir si un ticket suma 100 y te una base imponible -20 y laltra 120 es un error, en el teu plantejament mos la colarien

açò valida que ninguna de les bases imponibles siguen < 0 **per separat** es a dir si un ticket suma 100 y te una base imponible -20 y laltra 120 es un error, en el teu plantejament mos la colarien
Author
Member
@carlosap
guillermo marked this conversation as resolved
guillermo requested review from carlosap 2024-02-14 06:35:29 +00:00
guillermo added 1 commit 2024-02-15 06:48:26 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
05b7c37b94
fix: refs #5586 Rollback
guillermo added 1 commit 2024-02-15 06:50:05 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
46a1ad35b5
Merge branch 'dev' into 5586-optimizeNegativeBases
guillermo added 2 commits 2024-02-15 06:51:42 +00:00
guillermo requested review from jgallego 2024-02-15 08:07:17 +00:00
jgallego requested changes 2024-02-15 08:17:31 +00:00
@ -96,0 +84,4 @@
GROUP BY ticketFk
HAVING taxableBase < 0
) negativeBase ON negativeBase.ticketFk = t.id
WHERE t.shipped BETWEEN ? AND util.dayEnd(?)
Owner

posar una funcio en el where pot fer que no puga indexar, revisa be que vaja rapid

posar una funcio en el where pot fer que no puga indexar, revisa be que vaja rapid
Author
Member

Funciona mes rapid que antes.

Funciona mes rapid que antes.
guillermo marked this conversation as resolved
@ -96,0 +87,4 @@
WHERE t.shipped BETWEEN ? AND util.dayEnd(?)
AND t.refFk IS NULL
AND c.typeFk IN ('normal','trust')
GROUP BY t.clientFk, t.totalWithoutVat
Owner

un ticket que tinga 2 bases imponibles ha de tindre dos linies, amb este group by ho fusiona en una..

un ticket que tinga 2 bases imponibles ha de tindre dos linies, amb este group by ho fusiona en una..
guillermo marked this conversation as resolved
guillermo added 1 commit 2024-02-15 08:37:43 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
5a0ce700b3
fix: refs #5586 Requested changes
guillermo requested review from jgallego 2024-02-15 08:38:37 +00:00
jgallego approved these changes 2024-02-15 08:51:16 +00:00
guillermo added 1 commit 2024-02-15 09:18:15 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
256aa76e23
Merge branch 'dev' into 5586-optimizeNegativeBases
carlosap approved these changes 2024-02-19 09:41:50 +00:00
guillermo added 1 commit 2024-02-20 06:26:20 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
6daa7a03ff
Merge branch 'dev' into 5586-optimizeNegativeBases
guillermo merged commit 4d2637764e into dev 2024-02-20 06:28:05 +00:00
guillermo deleted branch 5586-optimizeNegativeBases 2024-02-20 06:28:05 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 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#2007
No description provided.