zet-lib 1.2.96 → 1.2.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/zReport.js +6 -5
- package/package.json +1 -1
package/lib/zReport.js
CHANGED
|
@@ -42,7 +42,8 @@ zReport.reportData = (filename, data, sessions = {}) => {
|
|
|
42
42
|
let excelData = {}
|
|
43
43
|
let excelValue = {}
|
|
44
44
|
let tableModel = {}
|
|
45
|
-
let
|
|
45
|
+
let excelQuery = data.excel_query || {}
|
|
46
|
+
let dataForExcel = excelQuery.excel
|
|
46
47
|
let dataCallback = data.callback || []
|
|
47
48
|
let callback = {}
|
|
48
49
|
let objQuery = {}
|
|
@@ -577,7 +578,7 @@ zReport.dataHTMLList = async () => {
|
|
|
577
578
|
if (row.excel) {
|
|
578
579
|
action += `<button title="setup Report" onclick="location.href='/zreports/setup/${row.id}'" data-id="${row.id}" class="btn image-button boxy-small" type="button"><img src="/assets/icons/settings-filled.svg" class="icons-bg-black"></button>`
|
|
579
580
|
}
|
|
580
|
-
action += `<button title="edit Report" onclick="location.href='/zreports/
|
|
581
|
+
action += `<button title="edit Report" onclick="location.href='/zreports/update/${row.id}'" class="btn image-button boxy-small" type="button"><img src="/assets/icons/pencil.svg" class="icons-bg-black"></button>`
|
|
581
582
|
action += `<button title="delete Report" onclick="deletereport('${row.id}')" data-id="${row.id}" class="btn image-button boxy-small" type="button"><img src="/assets/icons/trash.svg" class="icons-bg-black"></button>`
|
|
582
583
|
childReport += `<tr><td>${index + 1}. </td><td>${row.title}</td><td><a href="/uploads/zreports/${row.excel}">Excel File</a></td><td>${action}</td></tr>`
|
|
583
584
|
})
|
|
@@ -672,16 +673,16 @@ zReport.filterReport = async (req, res) => {
|
|
|
672
673
|
let data = [],
|
|
673
674
|
rows = []
|
|
674
675
|
if (id == '') {
|
|
675
|
-
rows = await connection.query('select * from
|
|
676
|
+
rows = await connection.query('select * from zreports where company_id = ? and parent_id IS NULL', [companyId])
|
|
676
677
|
} else {
|
|
677
|
-
rows = await connection.results({ table: '
|
|
678
|
+
rows = await connection.results({ table: 'zreports', where: { id: id, company_id: companyId } })
|
|
678
679
|
}
|
|
679
680
|
|
|
680
681
|
console.log(rows)
|
|
681
682
|
for (var i = 0; i < rows.length; i++) {
|
|
682
683
|
var row = rows[i]
|
|
683
684
|
//rows.forEach(async function (row) {
|
|
684
|
-
let reportsRow = await connection.results({ table: '
|
|
685
|
+
let reportsRow = await connection.results({ table: 'zreports', where: { parent_id: row.id } })
|
|
685
686
|
console.log(reportsRow)
|
|
686
687
|
let filterHtml = reportsRow.length > 0 ? `<form method="post" action="/zreport" >` : ''
|
|
687
688
|
let filters = JSON.parse(row.filter) || []
|