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