From 8e4d6a13cd194e51dee190427848106a97f2549c Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Fri, 1 Mar 2019 17:39:35 +0100 Subject: [PATCH] Bug 20830: Make sure a fund is selected when ordering from staged file --- .../intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index cd2a053..3cdb337 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -137,6 +137,19 @@ return false; } + if (! $("#all_budget_id").val() ) { + // If there is no default fund + var error = 0; + $(".selected [name='budget_id']").each(function(){ + if (!$(this).val()) { + error++; + } + }); + if ( error > 0 ) { + alert(_("Some budgets are not defined in item records")); + return false; + } + } return disableUnchecked($(this)); }); -- 2.1.4