Bug 20830: Make sure a fund is selected when ordering from a stage file
authorOlivier Crouzet <kohateam@univ-lyon3.fr>
Mon, 11 Mar 2019 14:00:23 +0000 (15:00 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 25 Apr 2019 13:23:55 +0000 (14:23 +0100)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8cb24d65849aa881a0e6eb74271ca2d9c7ea455c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt

index bdfeb15..ac128b0 100644 (file)
 
                 }
 
+        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();