feat: refs #3199 Added one more scope ticketTotal #2447
No reviewers
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#2447
Loading…
Reference in New Issue
No description provided.
Delete Branch "3199-ticket_recalc_itemTaxCountry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat: refs #3199 Added more scopes ticket_recalcByScopeto WIP: feat: refs #3199 Added more scopes ticket_recalcByScopeWIP: feat: refs #3199 Added more scopes ticket_recalcByScopeto WIP: feat: refs #3199 Added one more scope ticketTotalWIP: feat: refs #3199 Added one more scope ticketTotalto feat: refs #3199 Added one more scope ticketTotal@ -21,0 +17,4 @@
SELECT DISTINCT t.id
FROM ticket t
JOIN sale s ON s.ticketFk = t.id
JOIN itemTaxCountry itc ON itc.itemFk = s.itemFk
Porque se hace JOIN con
itemTaxCountry
si no se utiliza ninguno de los campos de la tabla?Para filtrar por
itemFk
puede hacerse utilizando directamentes.itemFk
Porque quiero que tenga registro en la tabla
itemTaxCountry
, si no no tiene sentido@ -21,0 +19,4 @@
JOIN sale s ON s.ticketFk = t.id
JOIN itemTaxCountry itc ON itc.itemFk = s.itemFk
WHERE t.refFk IS NULL
AND DATE(t.shipped) > util.VN_CURDATE()
Si se pasa la columna
t.shipped
por la funcionDATE
no se utilizara el indice y la tablaticket
es demasiado grande como para aplicar filtros sin índice.Ademas, el filtro no aplica, ya que en caso de recalcular totales, queremos hacerlo de todos aquellos tickets no facturados.
@ -21,0 +22,4 @@
AND (
(vScope = 'client' AND t.clientFk = vId)
OR (vScope = 'address' AND t.addressFk = vId)
OR (vScope = 'item' AND itc.itemFk = vId)
Juan:
Generar una tabla temporal para que solo pase por sale y itemTaxCountry cuando sea vScope = 'item'.
vacaciones
@ -23,1 +26,3 @@
SET vDone = TRUE;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
CREATE OR REPLACE TEMPORARY TABLE tItems
pk y engine