refs #7531 Modify zone_getAddresses #2675
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#2675
Loading…
Reference in New Issue
No description provided.
Delete Branch "7531-Modify-zone_getAddresses"
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?
@ -3,2 +3,3 @@
vSelf INT,
vLanded DATE
vDated DATE,
vDepartment INT
vDepartmentFk
@ -12,6 +13,7 @@ BEGIN
*
* @param vSelf Id de zona
* @param vDated Fecha de entrega
* @param vDepartment Departamento del trabajador
vDepartmentFk Id de departamento
@ -22,34 +24,47 @@ BEGIN
WHERE id NOT IN (
notHasTicket crec que te sobra
@ -26,1 +27,4 @@
WHERE landed BETWEEN vDated AND util.dayEnd(vDated)
)
),
hasTicketShippedToday AS (
hasTickets (today no es correcte perque li pots pasar una altra fetxa que no siga hui)
@ -26,1 +28,4 @@
)
),
hasTicketShippedToday AS (
SELECT clientFk,
Aço queda mes net aixina:
@ -27,0 +31,4 @@
SELECT clientFk,
IF (COUNT(*) > 0, TRUE, FALSE) hasTicketShipped
FROM vn.ticket
WHERE shipped BETWEEN vDated AND util.dayEnd(vDated)
Si li preguntares i volia per shipped ok
@ -53,0 +42,4 @@
u.name username,
aai.invoiced,
cnb.lastShipped,
ht.hasTicketShipped
IF(ht.clientFk, TRUE, FALSE) hasTicket
@ -53,0 +58,4 @@
LEFT JOIN vn.annualAverageInvoiced aai ON aai.clientFk = c.id
JOIN vn.clientType ct ON ct.code = c.typeFk
JOIN vn.businessType bt ON bt.code = c.businessTypeFk
LEFT JOIN hasTicketShippedToday ht ON ht.clientFk = c.id
hasTickets
@ -53,0 +63,4 @@
AND c.isActive
AND ct.code = 'normal'
AND bt.code <> 'worker'
AND d.id = vDepartment
vDepartmentFk
@ -53,0 +50,4 @@
AND c.isActive
AND ct.code = 'normal'
AND bt.code <> 'worker'
AND d.id = vDepartmentFk
Soporta que pueda ser null:
(d.id = vDepartmentFk OR NOT vDepartmentFk)
Cert, també demana els que no tinguen comercial/departament assignat. Ho modifique.