[open-ils-commits] r9913 -
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jun 22 23:16:38 EDT 2008
Author: erickson
Date: 2008-06-22 23:16:36 -0400 (Sun, 22 Jun 2008)
New Revision: 9913
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js
Log:
verify some state info before editing PO
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js 2008-06-23 03:04:30 UTC (rev 9912)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/li_search.js 2008-06-23 03:16:36 UTC (rev 9913)
@@ -88,11 +88,14 @@
var rowIdx = selected[idx];
var id = liGrid.model.getRow(rowIdx).id;
for(var i = 0; i < lineitems.length; i++) {
- if(lineitems[i].id() == id)
+ var li = lineitems[i];
+ if(li.id() == id && !li.purchase_order() && li.state == 'approved')
selList.push(lineitems[i]);
}
}
+ if(selList.length == 0) return;
+
openils.acq.PO.create(po,
function(poId) {
updateLiList(poId, selList);
@@ -108,8 +111,6 @@
if(idx >= selList.length)
return location.href = 'view/' + poId;
var li = selList[idx];
- if(li.purchase_order())
- return _updateLiList(poId, selList, ++idx);
li.purchase_order(poId);
new openils.acq.Lineitems({lineitem:li}).update(
function(stat) {
More information about the open-ils-commits
mailing list