From 59922fa38f77672393598aad70b31939a949db4c Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 29 Jul 2022 02:25:37 +0000 Subject: [PATCH] LP#1942220: (follow-up) revert to legacy A/T for PO printing Signed-off-by: Galen Charlton Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../eg2/src/app/staff/acq/po/print.component.ts | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/print.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/po/print.component.ts index d0f0ea3e1b..3e5d676b11 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/print.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/print.component.ts @@ -119,7 +119,15 @@ export class PrintComponent implements OnInit, AfterViewInit { } populatePreview(): Promise { - + return this.net.request( + 'open-ils.acq', + 'open-ils.acq.purchase_order.format', + this.auth.token(), this.po.id(), 'html' + ).toPromise().then(response => { + this.outlet.innerHTML = response.template_output().data(); + }); +// TODO: add enough fleshing so that server-side print templates can be used +/* return this.printer.compileRemoteTemplate({ templateName: 'purchase_order', printContext: 'default', @@ -128,6 +136,7 @@ export class PrintComponent implements OnInit, AfterViewInit { }).then(response => { this.outlet.innerHTML = response.content; }); +*/ } addLiPrintNotes(): Promise { @@ -167,11 +176,24 @@ export class PrintComponent implements OnInit, AfterViewInit { }); } + return this.net.request( + 'open-ils.acq', + 'open-ils.acq.purchase_order.format', + this.auth.token(), this.po.id(), 'html' + ).toPromise().then(response => { + this.printer.print({ + printContext: 'default', + text: response.template_output().data() + }); + }); +// TODO: add enough fleshing so that server-side print templates can be used +/* this.printer.print({ templateName: 'purchase_order', printContext: 'default', contextData: {po: this.po} }); +*/ } } -- 2.11.0