fix errors
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
0579c563b9
commit
34126119e2
|
@ -29,22 +29,13 @@ module.exports = Self => {
|
|||
|
||||
Self.getSales = async(filter, id, options) => {
|
||||
const models = Self.app.models;
|
||||
|
||||
const myOptions = {};
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
// let newFilter;
|
||||
// if (filter && filter.order) {
|
||||
// const filterOrder = filter.order;
|
||||
// const saleColumns = ['itemFk', 'quantity', 'concept', 'price', 'discount'];
|
||||
|
||||
// for (const saleColum of saleColumns) {
|
||||
// if (filterOrder.includes(saleColum)) return newFilter = filter.order;
|
||||
// else newFilter = 'concept';
|
||||
// }
|
||||
// }
|
||||
// console.log(newFilter);
|
||||
console.log(filter);
|
||||
const sales = await models.Sale.find({
|
||||
include: {
|
||||
relation: 'item',
|
||||
|
@ -70,7 +61,7 @@ module.exports = Self => {
|
|||
}
|
||||
},
|
||||
where: {ticketFk: id},
|
||||
order: newFilter
|
||||
order: 'concept'
|
||||
}, myOptions);
|
||||
|
||||
// Get items available
|
||||
|
@ -126,7 +117,7 @@ module.exports = Self => {
|
|||
if (salesWithLogs.includes(sale.id))
|
||||
sale.$hasLogs = true;
|
||||
}
|
||||
|
||||
console.log(sales);
|
||||
return sales;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue