From 290c0eb225eb0ccf4b35137a6052d50a4e5082d3 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 11 Jun 2020 09:56:59 +1000 Subject: [PATCH] Add barcode javascript file --- .../static/script/inventree/barcode.js | 22 +++++++++++++++++++ InvenTree/templates/base.html | 1 + 2 files changed, 23 insertions(+) create mode 100644 InvenTree/InvenTree/static/script/inventree/barcode.js diff --git a/InvenTree/InvenTree/static/script/inventree/barcode.js b/InvenTree/InvenTree/static/script/inventree/barcode.js new file mode 100644 index 0000000000..77ccf17c6e --- /dev/null +++ b/InvenTree/InvenTree/static/script/inventree/barcode.js @@ -0,0 +1,22 @@ + +/* + * Pass barcode data to the server. + */ +function scanBarcode(barcode, options={}) { + + console.log('Sending barcode data:'); + console.log(barcode); + + inventreePut( + '/api/barcode/', + { + 'barcode': barcode, + }, + { + method: 'POST', + success: function(response, status) { + console.log(response); + }, + } + ); +} \ No newline at end of file diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html index 63487eb625..745b93d5b2 100644 --- a/InvenTree/templates/base.html +++ b/InvenTree/templates/base.html @@ -107,6 +107,7 @@ InvenTree +