comaparison code optimization and cal sum/total mh dc and laying

This commit is contained in:
2026-01-20 16:33:45 +05:30
parent 90c18383da
commit 68a694d2c7
15 changed files with 286 additions and 34 deletions

View File

@@ -72,7 +72,12 @@ class SubcontractorBill:
for df in [self.df_tr, self.df_mh, self.df_dc, self.df_laying]:
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"])
@login_required
@@ -153,7 +158,7 @@ def client_vs_all_subcontractor():
if not RA_Bill_No:
flash("Please enter RA Bill No.", "danger")
return render_template("generate_comparison_client_vs_subcont.html", tables=tables, ra_val=ra_val)
return render_template("client_report.html", tables=tables, ra_val=ra_val)
clientBill = ClientBill()
clientBill.Fetch(RA_Bill_No=RA_Bill_No)
@@ -163,7 +168,7 @@ def client_vs_all_subcontractor():
# --- SAFETY CHECK: Verify data exists before merging ---
if clientBill.df_tr.empty and clientBill.df_mh.empty:
flash(f"No Client records found for RA Bill {RA_Bill_No}", "warning")
return render_template("generate_comparison_client_vs_subcont.html", tables=tables, ra_val=ra_val)
return render_template("client_report.html", tables=tables, ra_val=ra_val)
qty_cols = [...] # (Keep your existing list)
mh_dc_qty_cols = [...] # (Keep your existing list)