8355-testToMaster #3336

Merged
alexm merged 241 commits from 8355-testToMaster into master 2025-01-07 06:44:57 +00:00
3 changed files with 4 additions and 4 deletions
Showing only changes of commit c9cf96676b - Show all commits

View File

@ -15,11 +15,11 @@ describe('invoiceIn corrective()', () => {
await tx.rollback(); await tx.rollback();
}); });
it('La función corrective debería devolver un id cuando se ejecuta correctamente', async() => { it('should return an id when executed correctly', async() => {
const originalId = 1; const originalId = 1;
const invoiceReason = 3; const invoiceReason = 3;
const invoiceType = 2; const invoiceType = 2;
const invoiceClass = 1; const invoiceClass = 8;
const cloneId = await models.InvoiceIn.corrective(ctx, const cloneId = await models.InvoiceIn.corrective(ctx,
originalId, invoiceReason, invoiceType, invoiceClass, options); originalId, invoiceReason, invoiceType, invoiceClass, options);

View File

@ -2,7 +2,7 @@ const UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.observe('before save', async function(ctx) { Self.observe('before save', async function(ctx) {
if (ctx.newInstance) return; if (ctx.isNewInstance) return;
const models = Self.app.models; const models = Self.app.models;
const invoiceIn = await models.InvoiceIn.findById(ctx.currentInstance.invoiceInFk); const invoiceIn = await models.InvoiceIn.findById(ctx.currentInstance.invoiceInFk);

View File

@ -21,7 +21,7 @@ module.exports = Self => {
}); });
Self.observe('before save', async function(ctx) { Self.observe('before save', async function(ctx) {
if (ctx.newInstance) return; if (ctx.isNewInstance) return;
const changes = ctx.data || ctx.instance; const changes = ctx.data || ctx.instance;
const orgData = ctx.currentInstance; const orgData = ctx.currentInstance;