updated
This commit is contained in:
Binary file not shown.
@@ -312,7 +312,18 @@ def get_report_data():
|
|||||||
""", (five_days_ago.strftime('%Y-%m-%d'),))
|
""", (five_days_ago.strftime('%Y-%m-%d'),))
|
||||||
rows = cursor.fetchall()
|
rows = cursor.fetchall()
|
||||||
print("Fetched rows for report 4 (non-zero quality_code, last 5 days):", rows)
|
print("Fetched rows for report 4 (non-zero quality_code, last 5 days):", rows)
|
||||||
data["headers"] = ["Id", "Operator Code", "CP Full Code", "OC1 Code", "OC2 Code", "Quality Code", "Date", "Time", "Approved Quantity", "Rejected Quantity"]
|
data["headers"] = ["Id", "Operator Code", "CP Base Code", "OC1 Code", "OC2 Code", "Quality Code", "Date", "Time", "Approved Quantity", "Rejected Quantity"]
|
||||||
|
data["rows"] = [[str(cell) if isinstance(cell, (datetime, timedelta)) else cell for cell in row] for row in rows]
|
||||||
|
|
||||||
|
elif report == "5": # Logic for the 5-ft report (all rows)
|
||||||
|
cursor.execute("""
|
||||||
|
SELECT Id, operator_code, CP_base_code, CP_full_code, OC1_code, OC2_code, quality_code, date, time, approved_quantity, rejected_quantity
|
||||||
|
FROM scan1_orders
|
||||||
|
ORDER BY date DESC, time DESC
|
||||||
|
""")
|
||||||
|
rows = cursor.fetchall()
|
||||||
|
print("Fetched rows for report 5 (all rows):", rows)
|
||||||
|
data["headers"] = ["Id", "Operator Code", "CP Base Code", "CP Full Code", "OC1 Code", "OC2 Code", "Quality Code", "Date", "Time", "Approved Quantity", "Rejected Quantity"]
|
||||||
data["rows"] = [[str(cell) if isinstance(cell, (datetime, timedelta)) else cell for cell in row] for row in rows]
|
data["rows"] = [[str(cell) if isinstance(cell, (datetime, timedelta)) else cell for cell in row] for row in rows]
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
<button class="btn report-btn" data-report="4">Raport Articole cu defecte in ultimile 5 zile</button>
|
<button class="btn report-btn" data-report="4">Raport Articole cu defecte in ultimile 5 zile</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-centered">
|
<div class="form-centered">
|
||||||
<label class="report-description">This report: Report 5 exports a summary of all orders from the database.</label>
|
<label class="report-description">Raportarea tuturor intrarilor din baza de date</label>
|
||||||
<button class="btn report-btn" data-report="5">Report 5</button>
|
<button class="btn report-btn" data-report="5">Raporteaza bazade date</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-centered last-buttons">
|
<div class="form-centered last-buttons">
|
||||||
<label class="export-description">Export current report as:</label>
|
<label class="export-description">Export current report as:</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user