intros
gitea/salix/pipeline/pr-master This commit looks good
Details
gitea/salix/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
bd82bb011a
commit
788f334e70
|
@ -1,4 +1,3 @@
|
|||
/* eslint max-len: ["error", { "code": 150 }]*/
|
||||
const models = require('vn-loopback/server/server').models;
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
|
@ -29,7 +28,16 @@ describe('InvoiceOut transferInvoice()', () => {
|
|||
try {
|
||||
const {clientFk: oldClient} = await models.InvoiceOut.findById(id, {fields: ['clientFk']});
|
||||
const invoicesBefore = await models.InvoiceOut.find({}, options);
|
||||
const result = await models.InvoiceOut.transferInvoice(ctx, id, 'T4444444', newClient, 1, 1, 1, true, options);
|
||||
const result = await models.InvoiceOut.transferInvoice(
|
||||
ctx,
|
||||
id,
|
||||
'T4444444',
|
||||
newClient,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
true,
|
||||
options);
|
||||
const invoicesAfter = await models.InvoiceOut.find({}, options);
|
||||
const rectificativeInvoice = invoicesAfter[invoicesAfter.length - 2];
|
||||
const newInvoice = invoicesAfter[invoicesAfter.length - 1];
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint max-len: ["error", { "code": 160 }]*/
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
|
@ -53,7 +52,17 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.transferInvoice = async(ctx, id, refFk, newClientFk, cplusRectificationTypeFk, siiTypeInvoiceOutFk, invoiceCorrectionTypeFk, makeInvoice, options) => {
|
||||
Self.transferInvoice = async(
|
||||
ctx,
|
||||
id,
|
||||
refFk,
|
||||
newClientFk,
|
||||
cplusRectificationTypeFk,
|
||||
siiTypeInvoiceOutFk,
|
||||
invoiceCorrectionTypeFk,
|
||||
makeInvoice,
|
||||
options
|
||||
) => {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {userId: ctx.req.accessToken.userId};
|
||||
let invoiceId;
|
||||
|
|
Loading…
Reference in New Issue