7199-devToTest_2316 #2287
|
@ -1,3 +1,9 @@
|
|||
td{
|
||||
overflow: hidden;
|
||||
max-width: 100px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
SELECT
|
||||
r.id,
|
||||
r.m3,
|
||||
r.created,
|
||||
r.time,
|
||||
u.nickName userNickName,
|
||||
v.tradeMark vehicleTradeMark,
|
||||
v.model vehicleModel,
|
||||
v.numberPlate plateNumber,
|
||||
IFNULL(s.name, am.name) AS agencyName
|
||||
FROM route r
|
||||
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
||||
LEFT JOIN worker w ON w.id = r.workerFk
|
||||
LEFT JOIN account.user u ON u.id = w.id
|
||||
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
|
||||
LEFT JOIN agency a ON a.id = am.agencyFk
|
||||
LEFT JOIN supplierAgencyTerm sa ON sa.agencyFk = a.id
|
||||
LEFT JOIN supplier s ON s.id = sa.supplierFk
|
||||
WHERE r.id IN(?)
|
||||
SELECT r.id,
|
||||
r.m3,
|
||||
r.created,
|
||||
r.time,
|
||||
u.nickName userNickName,
|
||||
v.tradeMark vehicleTradeMark,
|
||||
v.model vehicleModel,
|
||||
v.numberPlate plateNumber,
|
||||
IFNULL(s.name, am.name) agencyName
|
||||
FROM route r
|
||||
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
||||
LEFT JOIN worker w ON w.id = r.workerFk
|
||||
LEFT JOIN account.user u ON u.id = w.id
|
||||
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
|
||||
LEFT JOIN agency a ON a.id = am.agencyFk
|
||||
LEFT JOIN supplierAgencyTerm sa ON sa.agencyFk = a.id
|
||||
LEFT JOIN supplier s ON s.id = sa.supplierFk
|
||||
WHERE r.id IN(?)
|
||||
|
|
|
@ -1,43 +1,42 @@
|
|||
SELECT
|
||||
t.nickname addressName,
|
||||
t.packages,
|
||||
t.priority,
|
||||
t.id,
|
||||
t.clientFk,
|
||||
t.companyFk,
|
||||
t.routeFk,
|
||||
if(a.phone, a.phone, c.phone) AS phone,
|
||||
if(a.mobile, a.mobile, c.mobile) AS mobile,
|
||||
wh.name warehouseName,
|
||||
a.city,
|
||||
a.street,
|
||||
a.postalCode,
|
||||
LPAD(a.id, 5, '0') AS addressFk,
|
||||
p.name province,
|
||||
0 AS import,
|
||||
am.name ticketAgency,
|
||||
tob.description,
|
||||
u.nickName salesPersonName,
|
||||
ipkg.itemPackingTypes
|
||||
FROM route r
|
||||
JOIN ticket t ON t.routeFk = r.id
|
||||
LEFT JOIN address a ON a.id = t.addressFk
|
||||
LEFT JOIN client c ON c.id = t.clientFk
|
||||
LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE())
|
||||
LEFT JOIN account.user u ON u.id = w.id
|
||||
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3
|
||||
LEFT JOIN province p ON a.provinceFk = p.id
|
||||
LEFT JOIN warehouse wh ON wh.id = t.warehouseFk
|
||||
LEFT JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
LEFT JOIN (
|
||||
SELECT t.id AS ticketFk,
|
||||
GROUP_CONCAT(DISTINCT(i.itemPackingTypeFk)) AS itemPackingTypes
|
||||
FROM route r
|
||||
JOIN ticket t ON t.routeFk = r.id
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
WHERE r.id IN (?)
|
||||
GROUP BY t.id
|
||||
) ipkg ON ipkg.ticketFk = t.id
|
||||
WHERE r.id IN (?)
|
||||
ORDER BY t.priority, t.id;
|
||||
SELECT t.nickname addressName,
|
||||
t.packages,
|
||||
t.priority,
|
||||
t.id,
|
||||
t.clientFk,
|
||||
t.companyFk,
|
||||
t.routeFk,
|
||||
if(a.phone, a.phone, c.phone) phone,
|
||||
if(a.mobile, a.mobile, c.mobile) mobile,
|
||||
wh.name warehouseName,
|
||||
a.city,
|
||||
a.street,
|
||||
a.postalCode,
|
||||
LPAD(a.id, 5, '0') addressFk,
|
||||
p.name province,
|
||||
0 import,
|
||||
am.name ticketAgency,
|
||||
tob.description,
|
||||
u.nickName salesPersonName,
|
||||
ipkg.itemPackingTypes
|
||||
FROM route r
|
||||
JOIN ticket t ON t.routeFk = r.id
|
||||
LEFT JOIN address a ON a.id = t.addressFk
|
||||
LEFT JOIN client c ON c.id = t.clientFk
|
||||
LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE())
|
||||
LEFT JOIN account.user u ON u.id = w.id
|
||||
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3
|
||||
LEFT JOIN province p ON a.provinceFk = p.id
|
||||
LEFT JOIN warehouse wh ON wh.id = t.warehouseFk
|
||||
LEFT JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
LEFT JOIN (
|
||||
SELECT t.id AS ticketFk,
|
||||
GROUP_CONCAT(DISTINCT(i.itemPackingTypeFk)) AS itemPackingTypes
|
||||
FROM route r
|
||||
JOIN ticket t ON t.routeFk = r.id
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
WHERE r.id IN (?)
|
||||
GROUP BY t.id
|
||||
) ipkg ON ipkg.ticketFk = t.id
|
||||
WHERE r.id IN (?)
|
||||
ORDER BY t.priority, t.id;
|
Loading…
Reference in New Issue