#4466 InvoiceIn Rectification #1902

Merged
jorgep merged 20 commits from 4466-invoiceInRectificated into dev 2024-02-06 07:49:20 +00:00
2 changed files with 4 additions and 14 deletions
Showing only changes of commit 05478b43f2 - Show all commits

View File

@ -110,9 +110,7 @@ module.exports = Self => {
foreignValue: dueDated.foreignValue,
}, myOptions));
}
}
if (isRectification) {
} else {
for (let intrastat of invoiceInIntrastat) {
promises.push(models.InvoiceInIntrastat.create({
jorgep marked this conversation as resolved
Review

En este cas faria una if else

En este cas faria una if else
invoiceInFk: clone.id,

View File

@ -70,19 +70,11 @@ describe('Ticket cloning - clone function', () => {
it('should create a ticket without sales', async() => {
const servicesIds = [4];
const tx = await models.Sale.beginTransaction({});
const options = {transaction: tx};
try {
const tickets = await models.Sale.clone(ctx, null, servicesIds, false, options);
const refundedTicket = await getTicketRefund(tickets[0].id, options);
expect(refundedTicket).toBeDefined();
const tickets = await models.Sale.clone(ctx, null, servicesIds, false, false, options);
const refundedTicket = await getTicketRefund(tickets[0].id, options);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
expect(refundedTicket).toBeDefined();
});
});