This commit is contained in:
parent
a04167f3f1
commit
99d65804e8
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE `vn`.`ticketRequest` MODIFY COLUMN `itemFk` double DEFAULT NULL NOT NULL;
|
|
@ -26,6 +26,7 @@
|
||||||
<vn-th field="ticketFk" number>Ticket ID</vn-th>
|
<vn-th field="ticketFk" number>Ticket ID</vn-th>
|
||||||
<vn-th field="shipped" expand>Shipped</vn-th>
|
<vn-th field="shipped" expand>Shipped</vn-th>
|
||||||
<vn-th field="description" filter-enabled="false" expand>Description</vn-th>
|
<vn-th field="description" filter-enabled="false" expand>Description</vn-th>
|
||||||
|
<vn-th field="requesterFk" expand>Requester</vn-th>
|
||||||
<vn-th field="quantity" number editable>Requested</vn-th>
|
<vn-th field="quantity" number editable>Requested</vn-th>
|
||||||
<vn-th field="price" number>Price</vn-th>
|
<vn-th field="price" number>Price</vn-th>
|
||||||
<vn-th field="attenderName">Atender</vn-th>
|
<vn-th field="attenderName">Atender</vn-th>
|
||||||
|
@ -51,6 +52,13 @@
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td title="{{::request.description}}" expand>{{::request.description}}</vn-td>
|
<vn-td title="{{::request.description}}" expand>{{::request.description}}</vn-td>
|
||||||
|
<vn-td number>
|
||||||
|
<span
|
||||||
|
class="link"
|
||||||
|
ng-click="workerDescriptor.show($event, request.requesterFk)">
|
||||||
|
{{::request.requesterName}}
|
||||||
|
</span>
|
||||||
|
</vn-td>
|
||||||
<vn-td number>{{::request.quantity}}</vn-td>
|
<vn-td number>{{::request.quantity}}</vn-td>
|
||||||
<vn-td number>{{::request.price | currency: 'EUR':2}}</vn-td>
|
<vn-td number>{{::request.price | currency: 'EUR':2}}</vn-td>
|
||||||
<vn-td>
|
<vn-td>
|
||||||
|
|
|
@ -99,6 +99,8 @@ module.exports = Self => {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 'pending':
|
case 'pending':
|
||||||
return {'tr.isOk': null};
|
return {'tr.isOk': null};
|
||||||
|
case 'accepted':
|
||||||
|
return {'tr.isOk': 1};
|
||||||
default:
|
default:
|
||||||
return {'tr.isOk': value};
|
return {'tr.isOk': value};
|
||||||
}
|
}
|
||||||
|
@ -122,8 +124,7 @@ module.exports = Self => {
|
||||||
filter = mergeFilters(filter, {where});
|
filter = mergeFilters(filter, {where});
|
||||||
|
|
||||||
const stmt = new ParameterizedSQL(
|
const stmt = new ParameterizedSQL(
|
||||||
`SELECT
|
`SELECT tr.id,
|
||||||
tr.id,
|
|
||||||
tr.ticketFk,
|
tr.ticketFk,
|
||||||
tr.quantity,
|
tr.quantity,
|
||||||
tr.price,
|
tr.price,
|
||||||
|
@ -133,18 +134,19 @@ module.exports = Self => {
|
||||||
tr.saleFk,
|
tr.saleFk,
|
||||||
tr.requesterFk,
|
tr.requesterFk,
|
||||||
tr.isOk,
|
tr.isOk,
|
||||||
s.quantity AS saleQuantity,
|
s.quantity saleQuantity,
|
||||||
s.itemFk,
|
s.itemFk,
|
||||||
i.name AS itemDescription,
|
i.name itemDescription,
|
||||||
t.shipped,
|
t.shipped,
|
||||||
DATE(t.shipped) AS shippedDate,
|
DATE(t.shipped) shippedDate,
|
||||||
t.nickname,
|
t.nickname,
|
||||||
t.warehouseFk,
|
t.warehouseFk,
|
||||||
t.clientFk,
|
t.clientFk,
|
||||||
w.name AS warehouse,
|
w.name warehouse,
|
||||||
u.nickname AS salesPersonNickname,
|
u.nickname salesPersonNickname,
|
||||||
ua.name AS attenderName,
|
ua.name attenderName,
|
||||||
c.salesPersonFk
|
c.salesPersonFk,
|
||||||
|
ua2.name requesterName
|
||||||
FROM ticketRequest tr
|
FROM ticketRequest tr
|
||||||
LEFT JOIN ticketWeekly tw on tw.ticketFk = tr.ticketFk
|
LEFT JOIN ticketWeekly tw on tw.ticketFk = tr.ticketFk
|
||||||
LEFT JOIN ticket t ON t.id = tr.ticketFk
|
LEFT JOIN ticket t ON t.id = tr.ticketFk
|
||||||
|
@ -155,9 +157,12 @@ module.exports = Self => {
|
||||||
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
|
LEFT JOIN worker wk ON wk.id = c.salesPersonFk
|
||||||
LEFT JOIN account.user u ON u.id = wk.id
|
LEFT JOIN account.user u ON u.id = wk.id
|
||||||
LEFT JOIN worker wka ON wka.id = tr.attenderFk
|
LEFT JOIN worker wka ON wka.id = tr.attenderFk
|
||||||
LEFT JOIN account.user ua ON ua.id = wka.id`);
|
LEFT JOIN account.user ua ON ua.id = wka.id
|
||||||
|
LEFT JOIN account.user ua2 ON ua2.id = tr.requesterFk`);
|
||||||
stmt.merge(conn.makeSuffix(filter));
|
stmt.merge(conn.makeSuffix(filter));
|
||||||
|
|
||||||
|
console.log(stmt);
|
||||||
|
|
||||||
return conn.executeStmt(stmt, myOptions);
|
return conn.executeStmt(stmt, myOptions);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue