modules and payments management, bug fixes
This commit is contained in:
40
static/scripts/full-payments-table.js
Normal file
40
static/scripts/full-payments-table.js
Normal 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();
|
||||
});
|
||||
Reference in New Issue
Block a user