Add barcode javascript file

This commit is contained in:
Oliver Walters 2020-06-11 09:56:59 +10:00
parent bc31cc550e
commit 290c0eb225
2 changed files with 23 additions and 0 deletions

View File

@ -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);
},
}
);
}

View File

@ -107,6 +107,7 @@ InvenTree
<script type='text/javascript' src="{% static 'script/inventree/modals.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/sidenav.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/barcode.js' %}"></script>
<script type='text/javascript' src="{% url 'bom.js' %}"></script>
<script type='text/javascript' src="{% url 'company.js' %}"></script>