[open-ils-commits] r17787 - in branches/rel_2_0/Open-ILS: src/perlmods/OpenILS/Application/Acq web/js/ui/default/acq/po (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 17 19:26:55 EDT 2010
Author: senator
Date: 2010-09-17 19:26:55 -0400 (Fri, 17 Sep 2010)
New Revision: 17787
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/view_po.js
Log:
Backport r17786, acq po activation failure improvements
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-09-17 23:23:06 UTC (rev 17786)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm 2010-09-17 23:26:55 UTC (rev 17787)
@@ -669,6 +669,13 @@
]);
}
+ unless ($lid->fund) {
+ $mgr->editor->event(
+ new OpenILS::Event("ACQ_FUND_NOT_FOUND") # close enough
+ );
+ return 0;
+ }
+
my $amount = $li->estimated_unit_price;
if($li->provider->currency_type ne $lid->fund->currency_type and !$no_translate) {
Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/view_po.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/view_po.js 2010-09-17 23:23:06 UTC (rev 17786)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/view_po.js 2010-09-17 23:26:55 UTC (rev 17787)
@@ -448,6 +448,7 @@
d.innerHTML = localeStrings.PO_CHECKING;
var warnings = [];
var stops = [];
+ var other = [];
fieldmapper.standardRequest(
["open-ils.acq", "open-ils.acq.purchase_order.activate.dry_run"], {
@@ -463,6 +464,8 @@
case "ACQ_FUND_EXCEEDS_WARN_PERCENT":
warnings.push(r);
break;
+ default:
+ other.push(r);
}
}
}
@@ -470,11 +473,16 @@
"oncomplete": function() {
/* XXX in the future, this might be tweaked to display info
* about more than one stop or warning event from the ML. */
- if (!(warnings.length || stops.length)) {
+ if (!(warnings.length || stops.length || other.length)) {
d.innerHTML = localeStrings.PO_COULD_ACTIVATE;
openils.Util.show(a, "inline");
} else {
- if (stops.length) {
+ if (other.length) {
+ /* XXX make the textcode part a tooltip one day */
+ d.innerHTML = localeStrings.NO + ": " +
+ other[0].desc + " (" + other[0].textcode + ")";
+ openils.Util.hide(a);
+ } else if (stops.length) {
d.innerHTML =
dojo.string.substitute(
localeStrings.PO_STOP_BLOCKS_ACTIVATION, [
More information about the open-ils-commits
mailing list