From fe0ce53008f3582d59ea754096c31cca33e02377 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 1 Feb 2021 17:29:26 -0500 Subject: [PATCH] LP1929741 Zero-copy and no-assets PO activation And summary layout improvements. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- .../src/app/staff/acq/po/summary.component.html | 155 ++++++++++++--------- .../eg2/src/app/staff/acq/po/summary.component.ts | 32 +++-- 2 files changed, 109 insertions(+), 78 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html index d7442b90da..758fc30779 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html @@ -8,49 +8,11 @@
-
+
PO ID:
-
{{poId}}
+
{{poId}}
-
-
PO Name:
-
- - - - - {{po().name()}} - -
-
-
- -
-
-
Lineitems:
-
{{po().lineitem_count()}}
-
- -
-
-
-
Activated:
-
- {{po().order_date() | date:'short'}} - N/A -
-
-
+
Status:
@@ -109,33 +71,60 @@
-
-
-
- Notes ({{po().notes().length}}) - | - Invoices ({{invoiceCount}}) - | - Create Invoice - | - EDI Messages ({{ediMessageCount}}) - | - History - | - Print - - | - Cancel Order - - - | - Activate Order - + +
+
+
PO Name:
+
+ + + + + {{po().name()}} + +
+
+
+
Activated:
+
+ {{po().order_date() | date:'short'}} + N/A +
+
+
+ + + +
+
+
Lineitems:
+
{{po().lineitem_count()}}
+
+
+
+ + +
+
+
+
@@ -158,6 +147,40 @@
+
+ +
diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts index 0a77bb827b..21799f28d8 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts @@ -37,6 +37,7 @@ export class PoSummaryComponent implements OnInit { ediMessageCount = 0; invoiceCount = 0; showNotes = false; + zeroCopyActivate = false; canActivate: boolean = null; activationBlocks: EgEvent[] = []; @@ -159,9 +160,13 @@ export class PoSummaryComponent implements OnInit { return; } + const options = { + zero_copy_activate: this.zeroCopyActivate + }; + this.net.request('open-ils.acq', 'open-ils.acq.purchase_order.activate.dry_run', - this.auth.token(), this.poId + this.auth.token(), this.poId, null, options ).pipe(tap(resp => { @@ -176,27 +181,30 @@ export class PoSummaryComponent implements OnInit { } this.canActivate = false; - - // TODO More logic likely needed here to handle zero-copy - // activation / ACQ_LINEITEM_NO_COPIES }); } - activatePo() { - // TODO This code bypasses the Vandelay UI and force-loads the records. - + activatePo(noAssets?: boolean) { this.activationEvent = null; this.progressDialog.open(); this.progressDialog.update({max: this.po().lineitem_count() * 3}); + // Bypass any Vandelay choices and force-load all records. + // TODO: Add intermediate Vandelay options. + const vandelay = { + import_no_match: true, + queue_name: `ACQ ${new Date().toISOString()}` + }; + + const options = { + zero_copy_activate: this.zeroCopyActivate, + no_assets: noAssets + }; + this.net.request( 'open-ils.acq', 'open-ils.acq.purchase_order.activate', - this.auth.token(), this.poId, { - // Import all records, no merging, etc. - import_no_match: true, - queue_name: `ACQ ${new Date().toISOString()}` - } + this.auth.token(), this.poId, vandelay, options ).subscribe(resp => { const evt = this.evt.parse(resp); -- 2.11.0