This commit is contained in:
admin
2026-02-07 20:04:42 +09:00
parent 331953bb7f
commit c60cbf2d9a
29 changed files with 1851 additions and 1246 deletions

View File

@@ -127,7 +127,7 @@ function recalcTotals() {
document.getElementById("totalDebit").innerText = formatNumber(finalDebit);
document.getElementById("totalCredit").innerText = formatNumber(finalCredit);
document.getElementById("diff").innerText = formatNumber(
finalDebit - finalCredit
finalDebit - finalCredit,
);
// 小計行を更新
@@ -144,7 +144,7 @@ function updateSubtotalRows() {
debit: sum.debit + Number(acc.opening_debit || 0),
credit: sum.credit + Number(acc.opening_credit || 0),
}),
{ debit: 0, credit: 0 }
{ debit: 0, credit: 0 },
);
// 対応する小計行を探して更新
@@ -167,7 +167,7 @@ async function loadOpeningBalances() {
accounts = data;
retainedEarnings = accounts.find(
(a) => a.account_name === "繰越利益剰余金" || a.account_name === "繰越利益"
(a) => a.account_name === "繰越利益剰余金" || a.account_name === "繰越利益",
);
const tbody = document.querySelector("#balanceTable tbody");
@@ -224,7 +224,7 @@ async function loadOpeningBalances() {
debit: sum.debit + Number(acc.opening_debit || 0),
credit: sum.credit + Number(acc.opening_credit || 0),
}),
{ debit: 0, credit: 0 }
{ debit: 0, credit: 0 },
);
const totalTr = document.createElement("tr");
@@ -243,14 +243,12 @@ async function loadOpeningBalances() {
});
// 年度锁定チェック
fetch(
`http://127.0.0.1:18080/opening-balances/lock-status?fiscal_year=${year}`
)
fetch(`/opening-balances/lock-status?fiscal_year=${year}`)
.then((res) => res.json())
.then((data) => {
isLocked = data.is_locked;
document.querySelector(
"button[onclick='saveOpeningBalances()']"
"button[onclick='saveOpeningBalances()']",
).disabled = isLocked;
if (isLocked) {
alert("この会計年度の期首残高は確定されています。");
@@ -273,7 +271,7 @@ async function saveOpeningBalances() {
(a) =>
a.account_name !== "繰越利益剰余金" &&
a.account_name !== "繰越利益" &&
(Number(a.opening_debit) !== 0 || Number(a.opening_credit) !== 0)
(Number(a.opening_debit) !== 0 || Number(a.opening_credit) !== 0),
)
.map((a) => ({
account_id: a.account_id,
@@ -282,7 +280,7 @@ async function saveOpeningBalances() {
}));
try {
await fetch("http://127.0.0.1:18080/opening-balances", {
await fetch(`/opening-balances`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({