7152-devToTest_2414 #2228
|
@ -58,17 +58,12 @@ module.exports = Self => {
|
|||
|
||||
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
|
||||
|
||||
if (tickets.length) await sendRocketTickets(tickets, $t);
|
||||
|
||||
return getCollection(id, tickets, sales, placements, myOptions);
|
||||
};
|
||||
async function sendRocketTickets(tickets, $t) {
|
||||
for (let ticket of tickets) {
|
||||
let observations = ticket.observaciones.split(' ');
|
||||
|
||||
for (let observation of observations) {
|
||||
const salesPerson = ticket.salesPersonFk;
|
||||
if (!observation.startsWith('#') && !observation.startsWith('@')) return;
|
||||
if (observation.startsWith('#') || observation.startsWith('@')) {
|
||||
await models.Chat.send(ctx,
|
||||
observation,
|
||||
$t('ticketCommercial', {ticket: ticket.ticketFk, salesPerson})
|
||||
|
@ -77,6 +72,9 @@ module.exports = Self => {
|
|||
}
|
||||
}
|
||||
|
||||
return getCollection(id, tickets, sales, placements, myOptions);
|
||||
};
|
||||
|
||||
async function getCollection(id, tickets, sales, placements, options) {
|
||||
const collection = {
|
||||
collectionFk: id,
|
||||
|
|
Loading…
Reference in New Issue