modules and payments management, bug fixes

This commit is contained in:
Ivan
2024-01-21 01:09:36 +03:00
parent 983a579dc8
commit fdd2308437
13 changed files with 1853 additions and 52 deletions

View File

@@ -0,0 +1,40 @@
$(document).ready(function () {
const createTable = () => {
const table = document.getElementById("paymentsTable");
const tbody = table.querySelector("tbody");
// Очищаем таблицу
tbody.innerHTML = "";
payments.forEach((payment) => {
const row = document.createElement("tr");
row.setAttribute(
"onclick",
`location.href = '/project/codes/settings/payment/` + payment.id + `'`
);
const name = document.createElement("td");
name.textContent = payment.name;
row.appendChild(name);
const amount = document.createElement("td");
amount.textContent = payment.amount;
row.appendChild(amount);
const paid = document.createElement("td");
if (payment.paid) {
paid.textContent = "Да";
} else {
paid.textContent = "Нет";
}
row.appendChild(paid);
const lastupdate = document.createElement("td");
lastupdate.textContent = payment.lastupdate;
row.appendChild(lastupdate);
tbody.appendChild(row);
});
};
createTable();
});