This commit is contained in:
parent
ccc386454c
commit
ba64dbbe46
|
@ -2,7 +2,7 @@
|
|||
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('salePreparingList', {
|
||||
Self.remoteMethod('filter', {
|
||||
description: 'Returns a list with the lines of a ticket and its different states of preparation',
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
|
@ -24,12 +24,12 @@ module.exports = Self => {
|
|||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/:id/salePreparingList`,
|
||||
path: `/:id/filter`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.salePreparingList = async(id, filter, options) => {
|
||||
Self.filter = async(id, filter, options) => {
|
||||
const conn = Self.dataSource.connector;
|
||||
const myOptions = {};
|
||||
|
||||
|
@ -44,24 +44,17 @@ module.exports = Self => {
|
|||
stmt = new ParameterizedSQL(
|
||||
`SELECT t.clientFk,
|
||||
t.shipped,
|
||||
a.nickname,
|
||||
s.ticketFk,
|
||||
s.itemFk,
|
||||
s.quantity,
|
||||
s.concept,
|
||||
s.reserved,
|
||||
s.id saleFk,
|
||||
i.size,
|
||||
i.inkFk,
|
||||
i.stems,
|
||||
i.image,
|
||||
i.subName,
|
||||
b.grouping,
|
||||
IF(stPrevious.saleFk,TRUE,FALSE) as isPreviousSelected,
|
||||
stPrevious.isChecked as isPrevious,
|
||||
stPrepared.isChecked as isPrepared,
|
||||
stControled.isChecked as isControled,
|
||||
ib.code as barcode,
|
||||
(MAX(sgd.id) IS NOT NULL) AS hasSaleGroupDetail,
|
||||
p.code AS parkingCode,
|
||||
i.value5,
|
||||
|
@ -71,15 +64,12 @@ module.exports = Self => {
|
|||
i.value9,
|
||||
i.value10
|
||||
FROM vn.ticket t
|
||||
JOIN vn.address a ON a.id = t.addressFk
|
||||
JOIN vn.sale s ON s.ticketFk = t.id
|
||||
JOIN vn.item i ON i.id = s.itemFk
|
||||
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk
|
||||
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
||||
LEFT JOIN vn.saleTracking stPrevious ON stPrevious.saleFk = s.id AND stPrevious.stateFk = 26
|
||||
LEFT JOIN vn.saleTracking stPrepared ON stPrepared.saleFk = s.id AND stPrepared.stateFk = 14
|
||||
LEFT JOIN vn.saleTracking stControled ON stControled.saleFk = s.id AND stControled.stateFk = 8
|
||||
LEFT JOIN vn.itemBarcode ib ON ib.itemFk = i.id
|
||||
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
LEFT JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||
LEFT JOIN vn.parking p ON p.id = sg.parkingFk
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/sale-tracking/salePreparingList')(Self);
|
||||
require('../methods/sale-tracking/filter')(Self);
|
||||
require('../methods/sale-tracking/listSaleTracking')(Self);
|
||||
require('../methods/sale-tracking/replace')(Self);
|
||||
require('../methods/sale-tracking/delete')(Self);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<vn-crud-model
|
||||
vn-id="model"
|
||||
url="SaleTrackings/{{$ctrl.$params.id}}/salePreparingList"
|
||||
url="SaleTrackings/{{$ctrl.$params.id}}/filter"
|
||||
limit="20"
|
||||
data="$ctrl.sales"
|
||||
order="concept ASC, quantity DESC"
|
||||
|
@ -28,7 +28,7 @@
|
|||
'none': !sale.hasSaleGroupDetail,
|
||||
}"
|
||||
class="circleState"
|
||||
vn-tooltip="has saleGroupDetail"
|
||||
vn-tooltip="sale group detail"
|
||||
>
|
||||
</vn-chip>
|
||||
<vn-chip
|
||||
|
@ -37,7 +37,7 @@
|
|||
'none': !sale.isPreviousSelected,
|
||||
}"
|
||||
class="circleState"
|
||||
vn-tooltip="is previousSelected"
|
||||
vn-tooltip="previous selected"
|
||||
vn-click-stop="$ctrl.clickPreviousSelected($index)">
|
||||
</vn-chip>
|
||||
<vn-chip
|
||||
|
@ -46,7 +46,7 @@
|
|||
'none': !sale.isPrevious,
|
||||
}"
|
||||
class="circleState"
|
||||
vn-tooltip="is previous"
|
||||
vn-tooltip="previous"
|
||||
vn-click-stop="$ctrl.clickPrevious($index)">
|
||||
</vn-chip>
|
||||
<vn-chip
|
||||
|
@ -55,7 +55,7 @@
|
|||
'none': !sale.isPrepared,
|
||||
}"
|
||||
class="circleState"
|
||||
vn-tooltip="is prepared"
|
||||
vn-tooltip="prepared"
|
||||
vn-click-stop="$ctrl.clickPrepared($index)">
|
||||
</vn-chip>
|
||||
<vn-chip
|
||||
|
@ -64,7 +64,7 @@
|
|||
'none': !sale.isControled,
|
||||
}"
|
||||
class="circleState"
|
||||
vn-tooltip="is controled"
|
||||
vn-tooltip="checked"
|
||||
vn-click-stop="$ctrl.clickControled($index)">
|
||||
</vn-chip>
|
||||
</vn-td>
|
||||
|
@ -93,12 +93,12 @@
|
|||
<vn-td actions>
|
||||
<vn-icon-button
|
||||
vn-click-stop="$ctrl.showSaleTracking(sale)"
|
||||
vn-tooltip="Sale tracking"
|
||||
vn-tooltip="Log states"
|
||||
icon="history">
|
||||
</vn-icon-button>
|
||||
<vn-icon-button
|
||||
vn-click-stop="$ctrl.showItemShelvingSale(sale)"
|
||||
vn-tooltip="ItemShelvings sale"
|
||||
vn-tooltip="Shelvings sale"
|
||||
icon="icon-inventory">
|
||||
</vn-icon-button>
|
||||
</vn-td>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
ItemShelvings sale: Carros línea
|
||||
has saleGroupDetail: tiene detalle grupo lineas
|
||||
is previousSelected: es previa seleccionada
|
||||
is previous: es previa
|
||||
is prepared: esta preparado
|
||||
is controled: esta controlado
|
||||
Shelvings sale: Carros línea
|
||||
Log states: Historial estados
|
||||
sale group detail: detalle grupo lineas
|
||||
previous selected: previa seleccionado
|
||||
previous: previa
|
||||
prepared: preparado
|
||||
checked: revisado
|
||||
|
|
Loading…
Reference in New Issue