added new changes
This commit is contained in:
2
.env
2
.env
@@ -3,7 +3,7 @@
|
||||
# -----------------------------
|
||||
FLASK_ENV=development
|
||||
FLASK_DEBUG=True
|
||||
FLASK_HOST='0.0.0.0'
|
||||
FLASK_HOST=0.0.0.0
|
||||
FLASK_PORT=5001
|
||||
|
||||
# -----------------------------
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -4,17 +4,6 @@
|
||||
<div class="container-fluid mt-4">
|
||||
<h2 class="mb-4">Client File Reports</h2>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<div class="card p-4 shadow-sm mb-5">
|
||||
<form method="POST">
|
||||
<label class="form-label fw-bold">RA Bill No</label>
|
||||
@@ -51,7 +40,8 @@
|
||||
Comparison</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" id="laying-tab" data-bs-toggle="tab" data-bs-target="#laying" type="button">Laying
|
||||
<button class="nav-link" id="laying-tab" data-bs-toggle="tab" data-bs-target="#laying"
|
||||
type="button">Laying
|
||||
& Bedding Comparison</button>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Contact Person</label>
|
||||
<label class="form-label">Contact Person Name</label>
|
||||
<input type="text" class="form-control" name="contact_person">
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,3 +7,5 @@ python-dotenv
|
||||
cryptography
|
||||
xlsxwriter
|
||||
matplotlib
|
||||
flask_sqlalchemy
|
||||
flask_migrate
|
||||
Reference in New Issue
Block a user