refs #5328 mod funcion createTicketRefund
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
34a9b3768c
commit
eaf425fb51
|
@ -11,7 +11,7 @@ module.exports = Self => {
|
|||
{
|
||||
arg: 'servicesIds',
|
||||
type: ['number']
|
||||
}
|
||||
},
|
||||
],
|
||||
returns: {
|
||||
type: ['number'],
|
||||
|
@ -110,11 +110,13 @@ module.exports = Self => {
|
|||
}
|
||||
};
|
||||
|
||||
async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, myOptions) {
|
||||
async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, myOptions, vTicketId) {
|
||||
const models = Self.app.models;
|
||||
|
||||
const filter = {include: {relation: 'address'}};
|
||||
const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
|
||||
const query = `CALL vn.ticket_recalc(?)`;
|
||||
const [result] = await Self.rawSql(query, [vTicketId]);
|
||||
|
||||
const refundTicket = await models.Ticket.create({
|
||||
clientFk: ticket.clientFk,
|
||||
|
@ -131,7 +133,7 @@ module.exports = Self => {
|
|||
await models.TicketRefund.create({
|
||||
refundTicketFk: refundTicket.id,
|
||||
originalTicketFk: ticket.id,
|
||||
}, myOptions);
|
||||
}, myOptions, [result]);
|
||||
|
||||
return refundTicket;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue