From: Steven Chan Date: Wed, 25 Jul 2012 20:45:40 +0000 (-0700) Subject: Fix LP1029095, Acq: Receive Items on an Invoice does not work with Line Item Alerts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dd10df8c96d744a62a06f3bef33f604022290a3b;p=contrib%2FConifer.git Fix LP1029095, Acq: Receive Items on an Invoice does not work with Line Item Alerts 1. Item reception was encountering a Javascript exception in the check_lineitem_alerts() helper function, because there was a mismatch between the input parameter name and the variable name actually used. 2. Also, took the opportunity to improve the performance of the for loop to scan through alerts. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/acq/invoice/receive.js b/Open-ILS/web/js/ui/default/acq/invoice/receive.js index 1ed65be7c3..d521335fcb 100644 --- a/Open-ILS/web/js/ui/default/acq/invoice/receive.js +++ b/Open-ILS/web/js/ui/default/acq/invoice/receive.js @@ -341,13 +341,15 @@ function ReceivableCopyTable() { function(o) { return Boolean(o.alert_text()); } ); - for (var i = 0; i < alert_notes.length; i++) { - if (this.user_has_acked[alert_notes[i].id()]) + var i, note, n_notes = alert_notes.length; + for (i = 0; i < n_notes; i++) { + note = alert_notes[i]; + if (this.user_has_acked[note.id()]) continue; - else if (!this.confirm_alert(li, alert_notes[i])) + else if (!this.confirm_alert(lineitem, note)) return false; else - this.user_has_acked[alert_notes[i].id()] = true; + this.user_has_acked[note.id()] = true; } return true;