JBAS-1967 Display ERP close date in invoice UI
authorBill Erickson <berickxx@gmail.com>
Thu, 12 Apr 2018 20:03:54 +0000 (16:03 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Display the new ERP close date field for staff in the invoice UI when
either the invoice is closed or a value is present.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/acq/invoice/view.js

index 4dda75c..e3d66c7 100644 (file)
@@ -1268,6 +1268,8 @@ function drawInvoicePane(parentNode, inv, args) {
         }
     }
 
+    dojo.mixin(override, {erp_export_date : {readOnly: true}});
+
     dojo.mixin(override, {
         provider : { 
             dijitArgs : { 
@@ -1310,6 +1312,12 @@ 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'];
+    
+    // Only hide the ERP export date when the invoice is still open
+    // and no value is present.  A re-opened invoice can have an export
+    // date and we want that to be visible.
+    if (!readOnly && (!inv || !inv.erp_export_date())) 
+        suppress.push('erp_export_date');
 
     pane = new openils.widget.EditPane({
         fmObject : inv,