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