Browse Source

added total poles in flagpolereport after total cost column

master
yoga-agoy 5 months ago
parent
commit
70490586ae
  1. 8
      src/main/resources/templates/modules/flagpoles/temporary_request.html

8
src/main/resources/templates/modules/flagpoles/temporary_request.html

@ -162,6 +162,7 @@
<th>Event Desc</th> <th>Event Desc</th>
<th>Event Date</th> <th>Event Date</th>
<th>Total Cost</th> <th>Total Cost</th>
<th>Total Poles</th>
<th>Status</th> <th>Status</th>
<th>History</th> <th>History</th>
<th>Uploaded Images</th> <th>Uploaded Images</th>
@ -515,6 +516,12 @@
filtered.forEach((row, index) => { filtered.forEach((row, index) => {
let status = determineStatus(row); let status = determineStatus(row);
let totalPoles = 0;
if (row.streets && row.streets.length > 0) {
row.streets.forEach(street => {
totalPoles += parseInt(street.no_of_poles) || 0;
});
}
tbody.append(` tbody.append(`
<tr> <tr>
<td>${index + 1}</td> <td>${index + 1}</td>
@ -525,6 +532,7 @@
<td>${formatValue(row.event_desc)}</td> <td>${formatValue(row.event_desc)}</td>
<td>${formatValue(row.event_date ? row.event_date.split('T')[0] : '')}</td> <td>${formatValue(row.event_date ? row.event_date.split('T')[0] : '')}</td>
<td>${formatValue(row.total_cost)}</td> <td>${formatValue(row.total_cost)}</td>
<td>${totalPoles}</td>
<td>${status}</td> <td>${status}</td>
<td> <td>
<button class="btn btn-secondary btn-sm" onclick="viewHistory('${row.refid}')">View History</button> <button class="btn btn-secondary btn-sm" onclick="viewHistory('${row.refid}')">View History</button>

Loading…
Cancel
Save