added new changes
This commit is contained in:
@@ -28,8 +28,8 @@ def bar_chart():
|
||||
plt.figure()
|
||||
plt.bar(categories, values)
|
||||
plt.title("Work Category Report")
|
||||
plt.xlabel("Category")
|
||||
plt.ylabel("Count")
|
||||
plt.xlabel("test Category")
|
||||
plt.ylabel("test Quantity")
|
||||
|
||||
|
||||
return plot_to_base64(plt)
|
||||
|
||||
@@ -73,10 +73,6 @@ class SubcontractorBill:
|
||||
if not df.empty:
|
||||
df.drop(columns=drop_cols, errors="ignore", inplace=True)
|
||||
|
||||
print(":::-- TR. EX --:::",self.df_tr,"\n")
|
||||
print(":::--MH EX--:::",self.df_mh,"\n")
|
||||
print(":::--MH DC--:::",self.df_dc,"\n")
|
||||
print(":::--Laying--:::",self.df_laying,"\n")
|
||||
|
||||
# --- subcontractor report only ---
|
||||
@file_report_bp.route("/Subcontractor_report", methods=["GET", "POST"])
|
||||
@@ -96,7 +92,7 @@ def report_file():
|
||||
|
||||
if not subcontractor_id:
|
||||
flash("Please select a subcontractor.", "danger")
|
||||
return render_template("report.html", subcontractors=subcontractors)
|
||||
return render_template("subcontractor_report.html", subcontractors=subcontractors)
|
||||
|
||||
subcontractor = Subcontractor.query.get(subcontractor_id)
|
||||
bill_gen = SubcontractorBill()
|
||||
@@ -107,13 +103,13 @@ def report_file():
|
||||
else:
|
||||
if not ra_bill_no:
|
||||
flash("Please enter an RA Bill Number.", "danger")
|
||||
return render_template("report.html", subcontractors=subcontractors)
|
||||
return render_template("subcontractor_report.html", subcontractors=subcontractors)
|
||||
bill_gen.Fetch(RA_Bill_No=ra_bill_no, subcontractor_id=subcontractor_id)
|
||||
file_name = f"{subcontractor.subcontractor_name}_RA_{ra_bill_no}_Report.xlsx"
|
||||
|
||||
if bill_gen.df_tr.empty and bill_gen.df_mh.empty and bill_gen.df_dc.empty:
|
||||
flash("No data found for this selection.", "warning")
|
||||
return render_template("report.html", subcontractors=subcontractors)
|
||||
return render_template("subcontractor_report.html", subcontractors=subcontractors)
|
||||
|
||||
# If download is clicked, return file immediately
|
||||
if action == "download":
|
||||
|
||||
Reference in New Issue
Block a user