4804-ticket.descriptor_sms #1217

Merged
vicent merged 12 commits from 4804-ticket.descriptor_sms into dev 2022-12-21 11:30:02 +00:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit af87fc2d53 - Show all commits

View File

@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethodCtx('getChanges', {
description: 'Check if a ticket is editable',
description: 'Get changues in the sales of a ticket',
accessType: 'READ',
accepts: [{
arg: 'id',
@ -39,8 +39,8 @@ module.exports = Self => {
const newQuantity = ticketLog.newInstance ? ticketLog.newInstance.quantity : null;
if (ticketLog.changedModel == 'Sale' && isUpdate && ticketLog.newInstance.quantity) {
const item = await models.Item.findById(ticketLog.changedModelId, null, myOptions);
changes.push(`${item.name} cambia de ${oldQuantity} a ${newQuantity}`);
const sale = await models.Sale.findById(ticketLog.changedModelId, null, myOptions);
changes.push(`${sale.concept} cambia de ${oldQuantity} a ${newQuantity}`);
}
if (ticketLog.changedModel == 'Ticket' && isUpdate && ticketLog.newInstance.quantity)