added new changes

This commit is contained in:
2026-01-23 13:09:51 +05:30
parent 71ce8ca819
commit 5b557efd80
6 changed files with 15 additions and 27 deletions

2
.env
View File

@@ -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
# -----------------------------

View File

@@ -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)

View File

@@ -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":

View File

@@ -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>
@@ -76,9 +66,9 @@
{{ tables.laying|safe }}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
{% endblock %}
</div>
{% endblock %}

View File

@@ -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>

View File

@@ -7,3 +7,5 @@ python-dotenv
cryptography
xlsxwriter
matplotlib
flask_sqlalchemy
flask_migrate