From a6c2359e7a05933e1e2aefda0ef86b61f467a70a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch>
Date: Sun, 19 Apr 2015 20:24:05 +0200
Subject: [PATCH] Bug 14011 - Triggering slip print with enter key collides
 with 'barcode submitted'

To reproduce:

- submit empty checkout for triggering a slip print
- print the slip or cancel
- notice you can't read a new barcode into the field now,
  instead, the 'barcode submitted' message will be triggered each time
  you try

To test:
- apply patch
- try to reproduce issue
---
 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
index 233114d..0369361 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -64,13 +64,14 @@ function toggle_onsite_checkout(){
 
 $(document).ready(function() {
     $('#mainform').on('submit',function() {
-        $('#barcode').on('keypress',function(event) {
-            $('#barcodeSubmittedModal').modal();
-            event.preventDefault(); }
-        );
+        if (barcode && barcode.value) {
+            $('#barcode').on('keypress',function(event) {
+                $('#barcodeSubmittedModal').modal();
+                event.preventDefault(); }
+            );
+        }
     });
 
-
     [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
         // listen submit to trigger qslip on empty checkout
         $('#mainform').bind('submit',function() {
-- 
1.7.10.4