Merge pull request #36147 from deepeshgarg007/eslint

refactor(ci): add eslint and update linting confs
This commit is contained in:
Deepesh Garg
2023-07-24 20:55:07 +05:30
committed by GitHub
161 changed files with 1502 additions and 2918 deletions

View File

@@ -344,6 +344,28 @@ frappe.ui.form.on('Job Card', {
if(frm.doc.__islocal)
return;
function setCurrentIncrement() {
currentIncrement += 1;
return currentIncrement;
}
function updateStopwatch(increment) {
var hours = Math.floor(increment / 3600);
var minutes = Math.floor((increment - (hours * 3600)) / 60);
var seconds = increment - (hours * 3600) - (minutes * 60);
$(section).find(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());
$(section).find(".minutes").text(minutes < 10 ? ("0" + minutes.toString()) : minutes.toString());
$(section).find(".seconds").text(seconds < 10 ? ("0" + seconds.toString()) : seconds.toString());
}
function initialiseTimer() {
const interval = setInterval(function() {
var current = setCurrentIncrement();
updateStopwatch(current);
}, 1000);
}
frm.dashboard.refresh();
const timer = `
<div class="stopwatch" style="font-weight:bold;margin:0px 13px 0px 2px;
@@ -365,28 +387,6 @@ frappe.ui.form.on('Job Card', {
currentIncrement += moment(frappe.datetime.now_datetime()).diff(moment(frm.doc.started_time),"seconds");
initialiseTimer();
}
function initialiseTimer() {
const interval = setInterval(function() {
var current = setCurrentIncrement();
updateStopwatch(current);
}, 1000);
}
function updateStopwatch(increment) {
var hours = Math.floor(increment / 3600);
var minutes = Math.floor((increment - (hours * 3600)) / 60);
var seconds = increment - (hours * 3600) - (minutes * 60);
$(section).find(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());
$(section).find(".minutes").text(minutes < 10 ? ("0" + minutes.toString()) : minutes.toString());
$(section).find(".seconds").text(seconds < 10 ? ("0" + seconds.toString()) : seconds.toString());
}
function setCurrentIncrement() {
currentIncrement += 1;
return currentIncrement;
}
}
},

View File

@@ -624,7 +624,7 @@ erpnext.work_order = {
if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))) {
frm.has_finish_btn = true;
var finish_btn = frm.add_custom_button(__('Finish'), function() {
let finish_btn = frm.add_custom_button(__('Finish'), function() {
erpnext.work_order.make_se(frm, 'Manufacture');
});
@@ -648,7 +648,7 @@ erpnext.work_order = {
}
} else {
if ((flt(doc.produced_qty) < flt(doc.qty))) {
var finish_btn = frm.add_custom_button(__('Finish'), function() {
let finish_btn = frm.add_custom_button(__('Finish'), function() {
erpnext.work_order.make_se(frm, 'Manufacture');
});
finish_btn.addClass('btn-primary');
@@ -756,13 +756,14 @@ erpnext.work_order = {
},
make_consumption_se: function(frm, backflush_raw_materials_based_on) {
let max = 0;
if(!frm.doc.skip_transfer){
var max = (backflush_raw_materials_based_on === "Material Transferred for Manufacture") ?
max = (backflush_raw_materials_based_on === "Material Transferred for Manufacture") ?
flt(frm.doc.material_transferred_for_manufacturing) - flt(frm.doc.produced_qty) :
flt(frm.doc.qty) - flt(frm.doc.produced_qty);
// flt(frm.doc.qty) - flt(frm.doc.material_transferred_for_manufacturing);
} else {
var max = flt(frm.doc.qty) - flt(frm.doc.produced_qty);
max = flt(frm.doc.qty) - flt(frm.doc.produced_qty);
}
frappe.call({

View File

@@ -1,4 +1,4 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line

View File

@@ -1,4 +1,4 @@
/* eslint-disable */
frappe.listview_settings['Workstation'] = {
// add_fields: ["status"],
// filters:[["status","=", "Open"]]

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["BOM Explorer"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["BOM Operations Time"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Epoch Consulting and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["BOM Stock Calculated"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["BOM Variance Report"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Cost of Poor Quality Report"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Downtime Analysis"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Exponential Smoothing Forecasting"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Job Card Summary"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Process Loss Report"] = {
filters: [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Production Analytics"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Production Plan Summary"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Production Planning Report"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Quality Inspection Summary"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Work Order Consumed Materials"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Work Order Stock Report"] = {
"filters": [

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Work Order Summary"] = {
"filters": [