From b5ba0fa47f5a19d5277326cdbba21d5ba951745c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 1 Oct 2015 11:51:43 -0400 Subject: [PATCH] LP#1501516 PO lineitem 'paid' indicator Display a new "paid" label for each lineitem within a purchase order whose items have all been invoiced (or canceled). Signed-off-by: Bill Erickson Signed-off-by: Christine Burns Signed-off-by: Kathy Lussier --- Open-ILS/src/templates/acq/common/li_table.tt2 | 1 + Open-ILS/web/js/ui/default/acq/common/li_table.js | 14 ++++++++++++++ Open-ILS/web/js/ui/default/acq/po/view_po.js | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2 index 5dbba8e4b6..40546c8d07 100644 --- a/Open-ILS/src/templates/acq/common/li_table.tt2 +++ b/Open-ILS/src/templates/acq/common/li_table.tt2 @@ -187,6 +187,7 @@ + diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 4eda19721b..68d9a672d6 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -775,6 +775,20 @@ function AcqLiTable() { dojo.query('[name=expand_inline_copies]', row)[0].onclick = function() {self.drawInlineCopies(li.id())}; + var sum; + if (sum = li.order_summary()) { // assignment + // Only show the paid label if at least one copy is invoiced. + // In other words, a lineitem whose every copy is canceled + // is not "paid off" + if (sum.invoice_count() > 0) { + if (sum.item_count() == ( + sum.invoice_count() + sum.cancel_count())) { + // Lineitem is fully paid. Display the paid-off label + openils.Util.show(nodeByName('paid', row), 'inline'); + } + } + } + this.drawOrderIdentSelector(li, row); if (!this.skipInitialEligibilityCheck) diff --git a/Open-ILS/web/js/ui/default/acq/po/view_po.js b/Open-ILS/web/js/ui/default/acq/po/view_po.js index 10e063ed7f..53989cc2da 100644 --- a/Open-ILS/web/js/ui/default/acq/po/view_po.js +++ b/Open-ILS/web/js/ui/default/acq/po/view_po.js @@ -483,7 +483,12 @@ function init2() { params: [ openils.User.authtoken, [{purchase_order:poId}, {"order_by": {"jub": "id ASC"}}], - {flesh_attrs:true, flesh_notes:true, flesh_cancel_reason:true, clear_marc:true} + { flesh_attrs : true, + flesh_notes : true, + flesh_cancel_reason : true, + flesh_order_summary : true, + clear_marc:true + } ], onresponse: function(r) { liTable.show('list'); -- 2.11.0