dev #1731

Merged
jgallego merged 105 commits from dev into test 2023-08-31 09:13:29 +00:00
3 changed files with 10 additions and 6 deletions
Showing only changes of commit b140f69614 - Show all commits

View File

@ -95,7 +95,7 @@ module.exports = Self => {
t.id ticketFk,
co.country,
t.clientFk,
sub.id hasCmrDms,
IF(sub.id, TRUE, FALSE) hasCmrDms,
DATE(t.shipped) shipped
FROM ticket t
JOIN ticketState ts ON ts.ticketFk = t.id

View File

@ -142,12 +142,12 @@ module.exports = Self => {
const changes = ctx.data || ctx.instance;
const orgData = ctx.currentInstance;
const socialName = changes.name || orgData.name;
const name = changes.name || orgData.name;
const hasChanges = orgData && changes;
const socialNameChanged = hasChanges
&& orgData.socialName != socialName;
const nameChanged = hasChanges
&& orgData.name != name;
if ((socialNameChanged) && !isAlpha(socialName))
if ((nameChanged) && !isAlpha(name))
throw new UserError('The social name has an invalid format');
});
};

View File

@ -67,8 +67,12 @@ module.exports = Self => {
const sales = await models.Sale.find(salesFilter, myOptions);
const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
let [firstTicketId] = ticketsIds;
if (!firstTicketId) {
[ticketServices] = await models.TicketService.find({where: {id: {inq: servicesIds}}}, myOptions);
firstTicketId = ticketServices.ticketFk;
}
const now = Date.vnNew();
const [firstTicketId] = ticketsIds;
const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);