From f9cd8a272da9f097ba1259a005b636ff0956d286 Mon Sep 17 00:00:00 2001 From: Olivier Crouzet Date: Mon, 11 Mar 2019 15:00:23 +0100 Subject: [PATCH] Bug 20830: Make sure a fund is selected when ordering from a stage file Signed-off-by: Martin Renvoize Signed-off-by: Chris Cormack Signed-off-by: Nick Clemens (cherry picked from commit 8cb24d65849aa881a0e6eb74271ca2d9c7ea455c) Signed-off-by: Martin Renvoize --- .../prog/en/modules/acqui/addorderiso2709.tt | 14 ++++++++++++++ 1 file changed, 14 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 bdfeb15518..ac128b06ac 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -77,6 +77,20 @@ } + 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)); }); $('#tabs').tabs(); -- 2.39.5