Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
b140f69614
|
@ -95,7 +95,7 @@ module.exports = Self => {
|
||||||
t.id ticketFk,
|
t.id ticketFk,
|
||||||
co.country,
|
co.country,
|
||||||
t.clientFk,
|
t.clientFk,
|
||||||
sub.id hasCmrDms,
|
IF(sub.id, TRUE, FALSE) hasCmrDms,
|
||||||
DATE(t.shipped) shipped
|
DATE(t.shipped) shipped
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||||
|
|
|
@ -142,12 +142,12 @@ module.exports = Self => {
|
||||||
const changes = ctx.data || ctx.instance;
|
const changes = ctx.data || ctx.instance;
|
||||||
const orgData = ctx.currentInstance;
|
const orgData = ctx.currentInstance;
|
||||||
|
|
||||||
const socialName = changes.name || orgData.name;
|
const name = changes.name || orgData.name;
|
||||||
const hasChanges = orgData && changes;
|
const hasChanges = orgData && changes;
|
||||||
const socialNameChanged = hasChanges
|
const nameChanged = hasChanges
|
||||||
&& orgData.socialName != socialName;
|
&& orgData.name != name;
|
||||||
|
|
||||||
if ((socialNameChanged) && !isAlpha(socialName))
|
if ((nameChanged) && !isAlpha(name))
|
||||||
throw new UserError('The social name has an invalid format');
|
throw new UserError('The social name has an invalid format');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -67,8 +67,12 @@ module.exports = Self => {
|
||||||
const sales = await models.Sale.find(salesFilter, myOptions);
|
const sales = await models.Sale.find(salesFilter, myOptions);
|
||||||
const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
|
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 now = Date.vnNew();
|
||||||
const [firstTicketId] = ticketsIds;
|
|
||||||
|
|
||||||
const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
|
const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue