#4466 InvoiceIn Rectification #1902
|
@ -110,9 +110,7 @@ module.exports = Self => {
|
||||||
foreignValue: dueDated.foreignValue,
|
foreignValue: dueDated.foreignValue,
|
||||||
}, myOptions));
|
}, myOptions));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (isRectification) {
|
|
||||||
for (let intrastat of invoiceInIntrastat) {
|
for (let intrastat of invoiceInIntrastat) {
|
||||||
promises.push(models.InvoiceInIntrastat.create({
|
promises.push(models.InvoiceInIntrastat.create({
|
||||||
jorgep marked this conversation as resolved
|
|||||||
invoiceInFk: clone.id,
|
invoiceInFk: clone.id,
|
||||||
|
|
|
@ -70,19 +70,11 @@ describe('Ticket cloning - clone function', () => {
|
||||||
|
|
||||||
it('should create a ticket without sales', async() => {
|
it('should create a ticket without sales', async() => {
|
||||||
const servicesIds = [4];
|
const servicesIds = [4];
|
||||||
const tx = await models.Sale.beginTransaction({});
|
|
||||||
const options = {transaction: tx};
|
const tickets = await models.Sale.clone(ctx, null, servicesIds, false, false, options);
|
||||||
try {
|
|
||||||
const tickets = await models.Sale.clone(ctx, null, servicesIds, false, options);
|
|
||||||
const refundedTicket = await getTicketRefund(tickets[0].id, options);
|
const refundedTicket = await getTicketRefund(tickets[0].id, options);
|
||||||
|
|
||||||
expect(refundedTicket).toBeDefined();
|
expect(refundedTicket).toBeDefined();
|
||||||
|
|
||||||
await tx.rollback();
|
|
||||||
} catch (e) {
|
|
||||||
await tx.rollback();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
En este cas faria una if else