From: Bill Erickson Date: Tue, 13 Mar 2018 20:22:04 +0000 (-0400) Subject: LP#1750894 Invoice close date/by fields UI WIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1750894-invoice-close-date;p=working%2FEvergreen.git LP#1750894 Invoice close date/by fields UI WIP Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/acq/invoice/view.js b/Open-ILS/web/js/ui/default/acq/invoice/view.js index 8ace4b3b5a..4888d5e77a 100644 --- a/Open-ILS/web/js/ui/default/acq/invoice/view.js +++ b/Open-ILS/web/js/ui/default/acq/invoice/view.js @@ -1245,6 +1245,11 @@ function drawInvoicePane(parentNode, inv, args) { }, recv_method : {widgetValue : 'PPR'} }; + } else { + if (inv.closed_by()) { + dojo.mixin(override, + {closed_by: {widgetValue : inv.closed_by().usrname()}}); + } } dojo.mixin(override, { @@ -1286,6 +1291,10 @@ function drawInvoicePane(parentNode, inv, args) { ); + // Display the close date/by data for closed invoices. + var readOnly = inv && inv.close_date(); + var suppress = readOnly ? ['id'] : ['id', 'close_date', 'closed_by']; + pane = new openils.widget.EditPane({ fmObject : inv, paneStackCount : 2, @@ -1293,7 +1302,7 @@ function drawInvoicePane(parentNode, inv, args) { mode : (inv) ? 'edit' : 'create', hideActionButtons : true, overrideWidgetArgs : override, - readOnly : (inv) && inv.close_date(), + readOnly : readOnly, requiredFields : [ 'inv_ident', 'recv_date', @@ -1308,7 +1317,7 @@ function drawInvoicePane(parentNode, inv, args) { 'provider', 'shipper' ], - suppressFields : ['id', 'close_date', 'closed_by'] + suppressFields : suppress }); pane.startup();