Fix bug for printing one-off product labels
This commit is contained in:
parent
d090338ba5
commit
242d37c95d
|
@ -28,6 +28,7 @@
|
|||
</div>
|
||||
|
||||
${h.form(request.current_route_url())}
|
||||
${h.csrf_token(request)}
|
||||
|
||||
% for name, display in printer.required_settings.iteritems():
|
||||
<div class="field-wrapper">
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
$('.newgrid-wrapper .grid-header .tools select').selectmenu();
|
||||
|
||||
$('.newgrid-wrapper').on('click', 'a.print_label', function() {
|
||||
var tr = $(this).parents('tr:first');
|
||||
var quantity = $('table.label-printing #label-quantity');
|
||||
if (isNaN(quantity.val())) {
|
||||
alert("You must provide a valid label quantity.");
|
||||
|
@ -52,11 +53,10 @@
|
|||
} else {
|
||||
quantity = quantity.val();
|
||||
var data = {
|
||||
product: get_uuid(this),
|
||||
product: tr.data('uuid'),
|
||||
profile: $('#label-profile').val(),
|
||||
quantity: quantity
|
||||
};
|
||||
console.log(data);
|
||||
$.get('${url('products.print_labels')}', data, function(data) {
|
||||
if (data.error) {
|
||||
alert("An error occurred while attempting to print:\n\n" + data.error);
|
||||
|
|
Loading…
Reference in a new issue