mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add barcode javascript file
This commit is contained in:
parent
bc31cc550e
commit
290c0eb225
22
InvenTree/InvenTree/static/script/inventree/barcode.js
Normal file
22
InvenTree/InvenTree/static/script/inventree/barcode.js
Normal 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);
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user