diff --git a/erpnext/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js index af98fc7987a..65949bb18cc 100644 --- a/erpnext/templates/includes/product_page.js +++ b/erpnext/templates/includes/product_page.js @@ -29,10 +29,10 @@ frappe.ready(function() { .html(r.message.product_info.price.formatted_price_sales_uom + "
\ (" + r.message.product_info.price.formatted_price + " / " + r.message.product_info.uom + ")
"); - if(r.message.product_info.in_stock==0) { + if(r.message.product_info.in_stock===0) { $(".item-stock").html("
{{ _("Not in stock") }}
"); } - else if(r.message.product_info.in_stock==1) { + else if(r.message.product_info.in_stock===1) { var qty_display = "{{ _("In stock") }}"; if (r.message.product_info.show_stock_qty) { qty_display += " ("+r.message.product_info.stock_qty+")"; @@ -75,13 +75,13 @@ frappe.ready(function() { newVal = 0; if (btn.attr('data-dir') == 'up') { - newVal = parseInt(oldValue) + 1; + newVal = Number.parseInt(oldValue) + 1; } else if (btn.attr('data-dir') == 'dwn') { - if (parseInt(oldValue) > 1) { - newVal = parseInt(oldValue) - 1; + if (Number.parseInt(oldValue) > 1) { + newVal = Number.parseInt(oldValue) - 1; } else { - newVal = parseInt(oldValue); + newVal = Number.parseInt(oldValue); } } input.val(newVal);