From 540554a743add4c9692be71deb31c916021564f5 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Thu, 6 Oct 2011 16:13:51 -0400 Subject: [PATCH] Acq: better error message if trying to create PO without provider or agency Before now, if you leave either the provider or ordering agency fields blank in the "Create Purchase Order" dialog, you get a nonsensical warning about prepayment. This fixes that. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Bill Erickson --- Open-ILS/web/js/dojo/openils/acq/nls/acq.js | 3 ++- Open-ILS/web/js/ui/default/acq/common/li_table.js | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js index 2d89f12c28..8c2a505d10 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -78,5 +78,6 @@ "LOAD_TERMS_FIRST" : "You can't retrieve records until you've loaded a CSV file\nwith bibliographic IDs in the first column.", "SELECT_SEARCH_FIELD": "Select Search Field", "LIBRARY_INITIATED": "Library Initiated", - "DEL_LI_FROM_PO": "That item has already been ordered! Deleting it now will not revoke or modify any order that has been placed with a vendor. Deleting the item may put the system's idea of your purchase order in a state that is inconsistent with reality. Are you sure you mean to do this?" + "DEL_LI_FROM_PO": "That item has already been ordered! Deleting it now will not revoke or modify any order that has been placed with a vendor. Deleting the item may put the system's idea of your purchase order in a state that is inconsistent with reality. Are you sure you mean to do this?", + "CREATE_PO_INVALID": "A purchase order must have an ordering agency and a provider." } 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 2bf6bd8363..c758f6ad85 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 @@ -84,7 +84,11 @@ function AcqLiTable() { }; acqLitCreatePoSubmit.onClick = function() { - if (self._confirmPoPrepaySituation()) { + if (!self.createPoProviderSelector.attr("value") || + !self.createPoAgencySelector.attr("value")) { + alert(localeStrings.CREATE_PO_INVALID); + return false; + } else if (self._confirmPoPrepaySituation()) { acqLitPoCreateDialog.hide(); self._createPO(acqLitPoCreateDialog.getValues()); } else { -- 2.11.0