diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b01b56a856..2c9a60c7c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,8 @@ repos: .*node_modules.*| .*boilerplate.*| erpnext/public/js/controllers/.*| - erpnext/templates/pages/order.js + erpnext/templates/pages/order.js| + erpnext/templates/includes/.* )$ - repo: https://github.com/PyCQA/flake8 diff --git a/erpnext/accounts/doctype/bank/bank.js b/erpnext/accounts/doctype/bank/bank.js index 6667193a54..83bd7fe862 100644 --- a/erpnext/accounts/doctype/bank/bank.js +++ b/erpnext/accounts/doctype/bank/bank.js @@ -102,7 +102,7 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink { } onScriptLoaded(me) { - me.linkHandler = Plaid.create({ + me.linkHandler = Plaid.create({ // eslint-disable-line no-undef env: me.plaid_env, token: me.token, onSuccess: me.plaid_success diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js index 3ba6bb9987..015e943b80 100644 --- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js +++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js @@ -96,7 +96,7 @@ erpnext.integrations.plaidLink = class plaidLink { } onScriptLoaded(me) { - me.linkHandler = Plaid.create({ + me.linkHandler = Plaid.create({ // eslint-disable-line no-undef clientName: me.client_name, product: me.product, env: me.plaid_env, diff --git a/erpnext/manufacturing/doctype/job_card/job_card.js b/erpnext/manufacturing/doctype/job_card/job_card.js index 8e9f542362..f1e6094813 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.js +++ b/erpnext/manufacturing/doctype/job_card/job_card.js @@ -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 = `