refactor(Batch): use const instead of var

(cherry picked from commit 7a7a2132855e496a0b1d51698cdb7d675c527650)
This commit is contained in:
barredterra 2024-01-23 15:02:42 +01:00 committed by Mergify
parent a97b8fd876
commit fe41e2a341

View File

@ -52,7 +52,7 @@ frappe.ui.form.on('Batch', {
// sort by qty
r.message.sort(function(a, b) { a.qty > b.qty ? 1 : -1 });
var rows = $('<div></div>').appendTo(section);
const rows = $('<div></div>').appendTo(section);
// show
(r.message || []).forEach(function(d) {
@ -76,7 +76,7 @@ frappe.ui.form.on('Batch', {
// move - ask for target warehouse and make stock entry
rows.find('.btn-move').on('click', function() {
var $btn = $(this);
const $btn = $(this);
const fields = [
{
fieldname: 'to_warehouse',
@ -115,7 +115,7 @@ frappe.ui.form.on('Batch', {
// split - ask for new qty and batch ID (optional)
// and make stock entry via batch.batch_split
rows.find('.btn-split').on('click', function() {
var $btn = $(this);
const $btn = $(this);
frappe.prompt([{
fieldname: 'qty',
label: __('New Batch Qty'),