LP#1942220: (follow-up) revert to legacy A/T for PO printing
authorGalen Charlton <gmc@equinoxOLI.org>
Fri, 29 Jul 2022 02:25:37 +0000 (02:25 +0000)
committerJane Sandberg <js7389@princeton.edu>
Sun, 2 Oct 2022 15:02:50 +0000 (08:02 -0700)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Open-ILS/src/eg2/src/app/staff/acq/po/print.component.ts

index d0f0ea3..3e5d676 100644 (file)
@@ -119,7 +119,15 @@ export class PrintComponent implements OnInit, AfterViewInit {
     }
 
     populatePreview(): Promise<any> {
-
+        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<any> {
@@ -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}
         });
+*/
     }
 }