This commit is contained in:
parent
ac4aea7d38
commit
82f14e62ad
|
@ -44,6 +44,7 @@ module.exports = Self => {
|
|||
Self.makePdf = async function(id, options) {
|
||||
const fields = ['id', 'hasPdf', 'ref'];
|
||||
const invoiceOut = await Self.findById(id, {fields}, options);
|
||||
console.log('Recoge invoiceOut?');
|
||||
const invoiceReport = new print.Report('invoice', {
|
||||
reference: invoiceOut.ref
|
||||
});
|
||||
|
|
|
@ -51,7 +51,7 @@ module.exports = Self => {
|
|||
myOptions
|
||||
);
|
||||
|
||||
if (tx && !options) await tx.commit();
|
||||
if (tx) await tx.commit();
|
||||
|
||||
return refundsTicket[0];
|
||||
} catch (e) {
|
||||
|
|
|
@ -79,7 +79,7 @@ module.exports = function(Self) {
|
|||
}
|
||||
if (tx) {
|
||||
for (const invoiceId of invoicesIds)
|
||||
await models.InvoiceOut.makePdfAndNotify(ctx, invoiceId, null, myOptions);
|
||||
await models.InvoiceOut.makePdfAndNotify(ctx, invoiceId, null);
|
||||
}
|
||||
|
||||
return invoicesIds;
|
||||
|
|
|
@ -6,9 +6,7 @@ module.exports = {
|
|||
name: 'invoice',
|
||||
mixins: [vnReport],
|
||||
async serverPrefetch() {
|
||||
console.log(this.reference);
|
||||
this.invoice = await this.findOneFromDef('invoice', [this.reference]);
|
||||
console.log(this.invoice);
|
||||
|
||||
this.checkMainEntity(this.invoice);
|
||||
this.client = await this.findOneFromDef('client', [this.reference]);
|
||||
|
|
Loading…
Reference in New Issue