updated reports
This commit is contained in:
Binary file not shown.
@@ -257,9 +257,23 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
// Populate table rows
|
||||
data.rows.forEach((row) => {
|
||||
const tr = document.createElement('tr');
|
||||
row.forEach((cell) => {
|
||||
row.forEach((cell, index) => {
|
||||
const td = document.createElement('td');
|
||||
|
||||
// Check if the header is "Date" and format the cell value
|
||||
if (data.headers[index].toLowerCase() === 'date' && cell) {
|
||||
const date = new Date(cell);
|
||||
if (!isNaN(date)) {
|
||||
// Format as yyyy-mm-dd
|
||||
const formattedDate = date.toISOString().split('T')[0];
|
||||
td.textContent = formattedDate;
|
||||
} else {
|
||||
td.textContent = cell; // Fallback if not a valid date
|
||||
}
|
||||
} else {
|
||||
td.textContent = cell;
|
||||
}
|
||||
|
||||
tr.appendChild(td);
|
||||
});
|
||||
tableBody.appendChild(tr);
|
||||
@@ -273,5 +287,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
tr.appendChild(td);
|
||||
tableBody.appendChild(tr);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -6,12 +6,12 @@
|
||||
<div class="card report-form-card">
|
||||
<h3>Rapoarte</h3>
|
||||
<div class="form-centered">
|
||||
<label class="report-description">Report 1 va exporta toate comenzile scanate la punctele de scanare calitate cu de acum 5 zile</label>
|
||||
<button class="btn report-btn" data-report="1">Raporteaza 5 zile de comenzi</button>
|
||||
<label class="report-description">Raport zilnic va exporta toate comenzile scanate la punctele de scanare calitate cu de acum 5 zile</label>
|
||||
<button class="btn report-btn" data-report="1">Raport zilnic de comenzi complet</button>
|
||||
</div>
|
||||
<div class="form-centered">
|
||||
<label class="report-description">This report: Report 2 exports all approved orders from the database.</label>
|
||||
<button class="btn report-btn" data-report="2">Report 2</button>
|
||||
<label class="report-description">Report 1 va exporta toate comenzile scanate la punctele de scanare calitate cu de acum 5 zile</label>
|
||||
<button class="btn report-btn" data-report="2">Raport 5 zile de comenzi complet</button>
|
||||
</div>
|
||||
<div class="form-centered">
|
||||
<label class="report-description">This report: Report 3 exports all rejected orders from the database.</label>
|
||||
|
||||
Reference in New Issue
Block a user