From 0ca1749757c42eec8366774ed860444c03daa9de Mon Sep 17 00:00:00 2001 From: akashbhome Date: Sat, 4 Apr 2026 14:48:19 +0530 Subject: [PATCH] hold issue solve --- logs/activity.log | 10 ++++++++++ model/UnifiedReportService.py | 4 +++- templates/subcontractor_report.html | 9 ++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/logs/activity.log b/logs/activity.log index cee3aac..7e10b01 100644 --- a/logs/activity.log +++ b/logs/activity.log @@ -9581,3 +9581,13 @@ Timestamp: 2026-04-04 14:09:44 | User: Unknown | Action: Search Contractor | Det Timestamp: 2026-04-04 14:14:02 | User: Unknown | Action: Search Contractor | Details: Timestamp: 2026-04-04 14:14:02 | User: Unknown | Action: Search Contractor | Details: Timestamp: 2026-04-04 14:14:04 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:20:27 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:20:27 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:20:29 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:27:50 | User: Unknown | Action: Edit Payment | Details: +Timestamp: 2026-04-04 14:29:42 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:29:42 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:29:44 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:35:59 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:35:59 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-04-04 14:36:00 | User: Unknown | Action: Search Contractor | Details: diff --git a/model/UnifiedReportService.py b/model/UnifiedReportService.py index 799fc96..eebcd79 100644 --- a/model/UnifiedReportService.py +++ b/model/UnifiedReportService.py @@ -58,6 +58,8 @@ class UnifiedReportService: payments = ReportHelper.execute_sp(cursor,'GetPayments',[contractor_id]) or [] + print(payments) + # ================= HOLD AMOUNTS ================= hold_amounts = ReportHelper.execute_sp(cursor,'GetHoldAmountsByContractor',[contractor_id]) or [] @@ -97,7 +99,7 @@ class UnifiedReportService: "sum_gst_final_amt": sum(r.get("Final_Amount", 0) or 0 for r in gst_rel), "sum_gst_total_amt": sum(r.get("Total_Amount", 0) or 0 for r in gst_rel), "sum_pay_total_amt": sum(Decimal(r.get("Total_amount") or 0) for r in payments), - "sum_pay_payment_amt": sum(Decimal(r.get("Total_amount") or 0) for r in payments), # same as above if you want + "sum_pay_payment_amt": sum(Decimal(r.get("Payment_Amount") or 0) for r in payments), # same as above if you want "sum_pay_tds_payment_amt": sum(Decimal(r.get("TDS_Payment_Amount") or 0) for r in payments), } diff --git a/templates/subcontractor_report.html b/templates/subcontractor_report.html index 630f6c2..4262b46 100644 --- a/templates/subcontractor_report.html +++ b/templates/subcontractor_report.html @@ -178,9 +178,9 @@ {{ total.get('sum_invo_on_commission', 0) }} {{ total.get('sum_invo_hydro_test', 0) }} - {% for ht in hold_types %} - {{ total.sum_invo_hold_amt}} - {% endfor %} + {% if hold_types %} + {{ total.sum_invo_hold_amt}} + {% endif %} {{ total.get('sum_invo_gst_sd_amt', 0) }} {{ total.sum_invo_final_amt }} @@ -326,8 +326,7 @@ Total - - 0.00 + {{total["sum_pay_payment_amt"]}} {{total["sum_pay_tds_payment_amt"]}} {{total["sum_pay_total_amt"]}}