Created
November 30, 2024 08:22
-
-
Save fujimogn/8554ef0ea70299bfdcb1ec8fe8b55751 to your computer and use it in GitHub Desktop.
freee人事労務 - 給与・賞与の振込 振込件数を表示
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name freee人事労務 - 給与・賞与の振込 振込件数を表示 | |
// @namespace https:// miraius.co.jp | |
// @version 2024-02-25 | |
// @description 振込依頼ファイルの出力で従業員名の横に何件目かを表示する(振込方法複数非対応) | |
// @author fujimogn | |
// @match https://p.secure.freee.co.jp/docs/remittance_form | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=freee.co.jp | |
// @grant none | |
// @run-at document-idle | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const checkAndExecute = setInterval(() => { | |
const els = document.querySelectorAll('table.payroll-table tr.payroll-table__row'); | |
if (els) { | |
clearInterval(checkAndExecute); | |
let i = 0; | |
els.forEach((el) => { | |
if(i>0){ | |
const childrenWithClass = el.querySelectorAll(".payroll-table__col"); | |
if (childrenWithClass.length > 1) { // 2番目の要素が存在するか確認 | |
const secondChild = childrenWithClass[1]; // 2番目の要素を取得 | |
secondChild.innerHTML = '<span style="line-height:normal;background:rgba(135,131,120,.15);color:#5764eb;border-radius:4px;font-size:85%;padding:0.2em 0.4em;margin-right: 1em;" >' + i + '</span>' + secondChild.innerHTML | |
} | |
} | |
i++; | |
}); | |
} | |
}, 500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment