From 0ef8b1b1d3b273a12817df4cfc91f448495686e1 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 --- 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 d2b69f4c28..9e29f0f99e 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -84,5 +84,6 @@ "ADD_LI_TO_PO_BAD_PO_STATE" : "The selected PO has already been activated", "ADD_LI_TO_PO_BAD_LI_STATE" : "The selected lineitem is not in a state that can be added to a purchase order", "INVOICE_NUMBER": "Invoice #${0}", - "COPIES_TO_RECEIVE": "Number of copies to receive: " + "COPIES_TO_RECEIVE": "Number of copies to receive: ", + "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 1178515e1d..49593fb377 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