Skip to content

Commit

Permalink
changes done for incidents full summery report
Browse files Browse the repository at this point in the history
  • Loading branch information
YujithIsura committed Jul 8, 2020
1 parent 5797638 commit b5b4420
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions templates/incidents/complaints/full_summary_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ module.exports = data => {
th {
border-bottom: none !important;
}
input {
border: 0;
border-bottom: 1px solid black;
border-style: dotted;
background: none;
width: 62%;
margin-top: 5px;
text-align: center;
}
.bold {
font-weight: bold;
}
Expand All @@ -60,7 +51,7 @@ module.exports = data => {
</style>
</head>
<body class="document-border">
<div class="container">
<div>
<div class="row">
<div class="col-12">
<table class="table table-bordered">
Expand Down Expand Up @@ -97,7 +88,7 @@ module.exports = data => {
</tr>
</thead>
<tbody>
${generateRows(data.complaintsPast24hours)}
${generateRows(data.complaints)}
</tbody>
</table>
</div>
Expand All @@ -111,25 +102,31 @@ module.exports = data => {
};

function generateRows(rowData) {
var i = 1;
return `<tr>
<td>${i++}</td>
<td>${rowData.national.disputes}</td>
<td>${rowData.national.disputes}</td>
<td>${rowData.national.disputes}</td>
<td>${rowData.national.violationOfLaws}</td>
<td>${rowData.national.others}</td>
<td>${rowData.national.amount}</td>
<td>${rowData.national.others}</td>
<td>${rowData.national.amount}</td>
<td>${rowData.national.others}</td>
<td>${rowData.national.amount}</td>
<td>${rowData.national.others}</td>
<td>${rowData.national.amount}</td>
<td>${rowData.national.others}</td>
<td>${rowData.national.amount}</td>
<td>${rowData.national.others}</td>
<td>${rowData.national.others}</td>
<td>${rowData.national.amount}</td>
var j = 1;
let rowCollection = "";
for (let i = 0; i < rowData.length; i++) {
let row = "";
row = `<tr>
<td>${j++}</td>
<td>${rowData[i].complaintNo}</td>
<td>${rowData[i].channelLtr}</td>
<td>${rowData[i].channelTel}</td>
<td>${rowData[i].channelFax}</td>
<td>${rowData[i].channelMail}</td>
<td>${rowData[i].complaintDate}</td>
<td>${rowData[i].reporter}</td>
<td>${rowData[i].location}</td>
<td>${rowData[i].complainSummery}</td>
<td>${rowData[i].violentAction}</td>
<td>${rowData[i].violationOfElectionLaw}</td>
<td>${rowData[i].other}</td>
<td>${rowData[i].law}</td>
<td>${rowData[i].medium}</td>
<td>${rowData[i].critical}</td>
<td>${rowData[i].reportedParty}</td>
<td>${rowData[i].progress}</td>
</tr>`;
}
rowCollection += row;
}
return rowCollection;
}

0 comments on commit b5b4420

Please sign in to comment.