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="shipped" expand>Shipped</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="price" number>Price</vn-th>
|
||||
<vn-th field="attenderName">Atender</vn-th>
|
||||
|
@ -51,6 +52,13 @@
|
|||
</span>
|
||||
</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.price | currency: 'EUR':2}}</vn-td>
|
||||
<vn-td>
|
||||
|
|
|
@ -99,6 +99,8 @@ module.exports = Self => {
|
|||
switch (value) {
|
||||
case 'pending':
|
||||
return {'tr.isOk': null};
|
||||
case 'accepted':
|
||||
return {'tr.isOk': 1};
|
||||
default:
|
||||
return {'tr.isOk': value};
|
||||
}
|
||||
|
@ -122,8 +124,7 @@ module.exports = Self => {
|
|||
filter = mergeFilters(filter, {where});
|
||||
|
||||
const stmt = new ParameterizedSQL(
|
||||
`SELECT
|
||||
tr.id,
|
||||
`SELECT tr.id,
|
||||
tr.ticketFk,
|
||||
tr.quantity,
|
||||
tr.price,
|
||||
|
@ -133,18 +134,19 @@ module.exports = Self => {
|
|||
tr.saleFk,
|
||||
tr.requesterFk,
|
||||
tr.isOk,
|
||||
s.quantity AS saleQuantity,
|
||||
s.quantity saleQuantity,
|
||||
s.itemFk,
|
||||
i.name AS itemDescription,
|
||||
i.name itemDescription,
|
||||
t.shipped,
|
||||
DATE(t.shipped) AS shippedDate,
|
||||
DATE(t.shipped) shippedDate,
|
||||
t.nickname,
|
||||
t.warehouseFk,
|
||||
t.clientFk,
|
||||
w.name AS warehouse,
|
||||
u.nickname AS salesPersonNickname,
|
||||
ua.name AS attenderName,
|
||||
c.salesPersonFk
|
||||
w.name warehouse,
|
||||
u.nickname salesPersonNickname,
|
||||
ua.name attenderName,
|
||||
c.salesPersonFk,
|
||||
ua2.name requesterName
|
||||
FROM ticketRequest tr
|
||||
LEFT JOIN ticketWeekly tw on tw.ticketFk = 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 account.user u ON u.id = wk.id
|
||||
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));
|
||||
|
||||
console.log(stmt);
|
||||
|
||||
return conn.executeStmt(stmt, myOptions);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue