2847 - Driver route now shows item packaging type
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-06-21 09:10:47 +00:00
parent 5238ebfd9d
commit 3ae520d247
6 changed files with 184 additions and 172 deletions

View File

@ -18,13 +18,8 @@
"acquireTimeout": 20000 "acquireTimeout": 20000
}, },
"osticket": { "osticket": {
"connector": "vn-mysql", "connector": "memory",
"database": "vn", "timezone": "local"
"debug": false,
"host": "localhost",
"port": "3306",
"username": "root",
"password": "root"
}, },
"tempStorage": { "tempStorage": {
"name": "tempStorage", "name": "tempStorage",

View File

@ -59,6 +59,8 @@ class Controller extends Summary {
stateColor(ticket) { stateColor(ticket) {
const ticketState = ticket.ticketState; const ticketState = ticket.ticketState;
if (!ticketState) return;
if (ticketState.code === 'OK') if (ticketState.code === 'OK')
return 'success'; return 'success';
else if (ticketState.code === 'FREE') else if (ticketState.code === 'FREE')

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html v-bind:lang="$i18n.locale"> <html v-bind:lang="$i18n.locale">
<body> <body>
<table class="grid"> <table class="grid">
<tbody> <tbody>
@ -91,6 +92,7 @@
<th width="50%">{{$t('client')}}</th> <th width="50%">{{$t('client')}}</th>
<th class="number">{{$t('address')}}</th> <th class="number">{{$t('address')}}</th>
<th class="number">{{$t('packages')}}</th> <th class="number">{{$t('packages')}}</th>
<th>{{$t('packagingType')}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -99,12 +101,14 @@
<td class="number">{{ticket.id}}</td> <td class="number">{{ticket.id}}</td>
<td width="50%">{{ticket.clientFk}} {{ticket.addressName}}</td> <td width="50%">{{ticket.clientFk}} {{ticket.addressName}}</td>
<td v-if="ticket.addressFk" class="number"> <td v-if="ticket.addressFk" class="number">
{{ticket.addressFk.toString().substr(0, ticket.addressFk.toString().length - 3)}} {{ticket.addressFk.toString().substr(0,
ticket.addressFk.toString().length - 3)}}
<span class="black-container"> <span class="black-container">
{{ticket.addressFk.toString().substr(-3, 3)}} {{ticket.addressFk.toString().substr(-3, 3)}}
</span> </span>
</td> </td>
<td class="number">{{ticket.packages}}</td> <td class="number">{{ticket.packages}}</td>
<td>{{ticket.itemPackingTypes}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -151,13 +155,12 @@
</div> </div>
</div> </div>
<!-- Footer block --> <!-- Footer block -->
<report-footer id="pageFooter" <report-footer id="pageFooter" v-bind:left-text="$t('routeId', [routeId])" v-bind="$props">
v-bind:left-text="$t('routeId', [routeId])"
v-bind="$props">
</report-footer> </report-footer>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</body> </body>
</html> </html>

View File

@ -30,7 +30,7 @@ module.exports = {
return this.rawSqlFromDef('routes', [routesId]); return this.rawSqlFromDef('routes', [routesId]);
}, },
fetchTickets(routesId) { fetchTickets(routesId) {
return this.rawSqlFromDef('tickets', [routesId]); return this.rawSqlFromDef('tickets', [routesId, routesId]);
} }
}, },
components: { components: {

View File

@ -10,6 +10,7 @@ order: Orden
client: Cliente client: Cliente
address: Consignatario address: Consignatario
packages: Bultos packages: Bultos
packagingType: Encajado
street: Dirección street: Dirección
postcode: Código Postal postcode: Código Postal
city: Ciudad city: Ciudad

View File

@ -18,7 +18,8 @@ SELECT
am.name ticketAgency, am.name ticketAgency,
tob.description, tob.description,
s.shipFk, s.shipFk,
u.nickName salesPersonName u.nickName salesPersonName,
ipkg.itemPackingTypes
FROM route r FROM route r
LEFT JOIN ticket t ON t.routeFk = r.id LEFT JOIN ticket t ON t.routeFk = r.id
LEFT JOIN address a ON a.id = t.addressFk LEFT JOIN address a ON a.id = t.addressFk
@ -30,5 +31,15 @@ FROM route r
LEFT JOIN warehouse wh ON wh.id = t.warehouseFk LEFT JOIN warehouse wh ON wh.id = t.warehouseFk
LEFT JOIN agencyMode am ON am.id = t.agencyModeFk LEFT JOIN agencyMode am ON am.id = t.agencyModeFk
LEFT JOIN stowaway s ON s.id = t.id LEFT JOIN stowaway s ON s.id = t.id
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 (?) WHERE r.id IN (?)
ORDER BY t.priority, t.id GROUP BY t.id
) ipkg ON ipkg.ticketFk = t.id
WHERE r.id IN (?)
ORDER BY t.priority, t.id;