diff --git a/controllers/excel_upload_controller.py b/controllers/excel_upload_controller.py index c2b6b73..23d95f8 100644 --- a/controllers/excel_upload_controller.py +++ b/controllers/excel_upload_controller.py @@ -66,14 +66,14 @@ def show_table(filename): errors.append(f"State '{file_info['State']}' is not valid. Please add it.") if state_data: - cursor.callproc('GetDistrictByNameAndStates', [file_info['District'], state_data['State_ID']]) + cursor.callproc('GetDistrictByNameAndState', [file_info['District'], state_data['State_ID']]) # Change GetDistrictByNameAndStates to GetDistrictByNameAndState for result in cursor.stored_results(): district_data = result.fetchone() if not district_data: errors.append(f"District '{file_info['District']}' is not valid under state '{file_info['State']}'.") if district_data: - cursor.callproc('GetBlockByNameAndDistricts', [file_info['Block'], district_data['District_ID']]) + cursor.callproc('GetBlockByNameAndDistrict', [file_info['Block'], district_data['District_id']]) #Change District_ID to District_id and GetBlockByNameAndDistricts to GetBlockByNameAndDistrict for result in cursor.stored_results(): block_data = result.fetchone() if not block_data: diff --git a/controllers/invoice_controller.py b/controllers/invoice_controller.py index 0beaaf1..8c03c3c 100644 --- a/controllers/invoice_controller.py +++ b/controllers/invoice_controller.py @@ -1,6 +1,3 @@ - - - # controllers/invoice_controller.py from flask import Blueprint, request, jsonify, render_template diff --git a/controllers/payment_controller.py b/controllers/payment_controller.py index 3973f36..ed10850 100644 --- a/controllers/payment_controller.py +++ b/controllers/payment_controller.py @@ -72,15 +72,13 @@ def edit_payment(payment_id): Paymentmodel.call_update_payment_proc(payment_id, pmc_no, invoice_no, amount, tds_amount, total_amount, utr) # Update inpayment - connection = Paymentmodel.get_connection() - cursor = connection.cursor() - cursor.callproc( - 'UpdateInpaymentByPMCInvoiceUTR', - [amount, tds_amount, total_amount, pmc_no, invoice_no, utr] -) - connection.commit() - cursor.close() - connection.close() + # connection = Paymentmodel.get_connection() + # cursor = connection.cursor() + # cursor.callproc('UpdateInpaymentByPMCInvoiceUTR',[amount, tds_amount, total_amount, pmc_no, invoice_no, utr]) + + # connection.commit() + # cursor.close() + # connection.close() return redirect(url_for('payment_bp.add_payment')) diff --git a/controllers/pmc_report_controller.py b/controllers/pmc_report_controller.py index ee05092..9b7313f 100644 --- a/controllers/pmc_report_controller.py +++ b/controllers/pmc_report_controller.py @@ -1,10 +1,7 @@ from flask import Blueprint, render_template, send_from_directory from flask_login import login_required - from model.PmcReport import PmcReport - - pmc_report_bp = Blueprint("pmc_report", __name__) # ---------------- Contractor Report by pmc no ---------------- diff --git a/controllers/report_controller.py b/controllers/report_controller.py index e8d6d15..55afc03 100644 --- a/controllers/report_controller.py +++ b/controllers/report_controller.py @@ -52,10 +52,6 @@ def contractor_report(contractor_id): # return ReportHelper().download_report(contractor_id=contractor_id) - - - - @report_bp.route('/download_report/') def download_report(contractor_id): output_file, error = ReportHelper.create_contractor_report(contractor_id) diff --git a/logs/activity.log b/logs/activity.log index 4914a3d..87b18c6 100644 --- a/logs/activity.log +++ b/logs/activity.log @@ -8061,3 +8061,207 @@ Timestamp: 2026-03-28 15:49:00 | User: Unknown | Action: Data saved | Details: Timestamp: 2026-03-28 15:49:00 | User: Unknown | Action: Data saved | Details: Timestamp: 2026-03-28 15:49:06 | User: Unknown | Action: Search Contractor | Details: Timestamp: 2026-03-28 15:49:08 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:06:32 | User: Unknown | Action: Login | Details: +Timestamp: 2026-03-30 11:06:39 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:06:40 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:06:42 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:08:00 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:08:00 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:08:00 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:08:02 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:08:02 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:08:04 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 11:10:15 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 11:10:30 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 13:21:03 | User: Unknown | Action: Check State | Details: +Timestamp: 2026-03-30 13:21:08 | User: Unknown | Action: Check State | Details: +Timestamp: 2026-03-30 13:21:09 | User: Unknown | Action: Check State | Details: +Timestamp: 2026-03-30 13:21:09 | User: Unknown | Action: Check State | Details: +Timestamp: 2026-03-30 13:21:11 | User: Unknown | Action: Add State | Details: +Timestamp: 2026-03-30 13:21:26 | User: Unknown | Action: Edit State | Details: +Timestamp: 2026-03-30 13:21:32 | User: Unknown | Action: Delete State | Details: +Timestamp: 2026-03-30 13:21:45 | User: Unknown | Action: Check Item | Details: +Timestamp: 2026-03-30 13:21:45 | User: Unknown | Action: Check Item | Details: +Timestamp: 2026-03-30 13:21:45 | User: Unknown | Action: Check Item | Details: +Timestamp: 2026-03-30 13:21:46 | User: Unknown | Action: Check Item | Details: +Timestamp: 2026-03-30 13:21:47 | User: Unknown | Action: Check Item | Details: +Timestamp: 2026-03-30 13:21:48 | User: Unknown | Action: Check Item | Details: +Timestamp: 2026-03-30 13:21:49 | User: Unknown | Action: Check Item | Details: +Timestamp: 2026-03-30 13:21:49 | User: Unknown | Action: Add Item | Details: +Timestamp: 2026-03-30 13:22:03 | User: Unknown | Action: Edit Item | Details: +Timestamp: 2026-03-30 13:22:12 | User: Unknown | Action: Delete Item | Details: +Timestamp: 2026-03-30 13:22:26 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:26 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:32 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:33 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:33 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:33 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:33 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:33 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:35 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 13:22:35 | User: Unknown | Action: Add Block | Details: +Timestamp: 2026-03-30 13:22:49 | User: Unknown | Action: Edit Block | Details: +Timestamp: 2026-03-30 13:22:54 | User: Unknown | Action: Delete Block | Details: +Timestamp: 2026-03-30 13:23:10 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:23:10 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:23:12 | User: Unknown | Action: Add Village | Details: +Timestamp: 2026-03-30 13:23:39 | User: Unknown | Action: Edit Village | Details: +Timestamp: 2026-03-30 13:23:49 | User: Unknown | Action: Delete Village | Details: +Timestamp: 2026-03-30 13:24:09 | User: Unknown | Action: Add Subcontractor | Details: +Timestamp: 2026-03-30 13:24:23 | User: Unknown | Action: Get hold type | Details: +Timestamp: 2026-03-30 13:25:09 | User: Unknown | Action: Add invoice | Details: +Timestamp: 2026-03-30 13:25:11 | User: Unknown | Action: Get hold type | Details: +Timestamp: 2026-03-30 13:25:29 | User: Unknown | Action: Edit invoice | Details: +Timestamp: 2026-03-30 13:25:32 | User: Unknown | Action: Get hold type | Details: +Timestamp: 2026-03-30 13:26:08 | User: Unknown | Action: Add Payment | Details: +Timestamp: 2026-03-30 13:27:00 | User: Unknown | Action: Add GSTRelease | Details: +Timestamp: 2026-03-30 13:27:00 | User: Unknown | Action: Add GST Release | Details: +Timestamp: 2026-03-30 13:27:27 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:27:28 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:27:29 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:34:29 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:34:41 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:34:58 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:37:16 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:38:25 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:39:45 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:46:29 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:46:31 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 13:46:50 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 13:46:53 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 13:47:08 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:47:08 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:47:10 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:47:42 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 13:48:00 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:48:01 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:48:01 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:48:11 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:48:32 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:48:34 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 13:48:39 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 13:49:17 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 13:49:41 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:41 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:41 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:43 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:45 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:45 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:46 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:46 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:46 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:48 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:48 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:49:51 | User: Unknown | Action: Add Village | Details: +Timestamp: 2026-03-30 13:50:08 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:50:08 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:50:11 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:50:11 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 13:53:57 | User: Unknown | Action: Check Village | Details: +Timestamp: 2026-03-30 14:00:00 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 14:00:01 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 14:00:05 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 14:26:11 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 14:26:12 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 14:26:38 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 14:53:18 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 15:10:21 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 15:14:03 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 15:14:05 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 15:14:11 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 15:19:11 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 15:26:09 | User: Unknown | Action: Download PMC Report | Details: +Timestamp: 2026-03-30 15:51:15 | User: Unknown | Action: Login | Details: +Timestamp: 2026-03-30 15:51:32 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 15:51:32 | User: Unknown | Action: Check Block | Details: +Timestamp: 2026-03-30 15:51:32 | User: Unknown | Action: Add Block | Details: +Timestamp: 2026-03-30 15:51:44 | User: Unknown | Action: Edit Block | Details: +Timestamp: 2026-03-30 15:51:50 | User: Unknown | Action: Delete Block | Details: +Timestamp: 2026-03-30 15:56:11 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 15:56:14 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 15:56:14 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 15:56:14 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 15:56:14 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 15:56:14 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 15:56:14 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 15:56:14 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 15:56:22 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 15:56:22 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 15:56:24 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:52 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:52 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:52 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:53 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:53 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:53 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:54 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:54 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:03:56 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:05:06 | User: Unknown | Action: Upload Excel File | Details: +Timestamp: 2026-03-30 16:05:10 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:10 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:10 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:10 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:11 | User: Unknown | Action: Data saved | Details: +Timestamp: 2026-03-30 16:05:18 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:05:19 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:05:21 | User: Unknown | Action: Search Contractor | Details: +Timestamp: 2026-03-30 16:05:24 | User: Unknown | Action: Search Contractor | Details: diff --git a/model/Block.py b/model/Block.py index 640ab0c..f93869f 100644 --- a/model/Block.py +++ b/model/Block.py @@ -32,22 +32,14 @@ class Block: district_id = request.form.get('district_Id') block_name = request.form.get('block_Name', '').strip() - block.AddItem(request=request, parentid=district_id, childname=block_name, storedprocfetch="GetBlockByNameAndDistricts", storedprocadd="SaveBlock" ) + block.AddItem(request=request, parentid=district_id, childname=block_name, storedprocfetch="GetBlockByNameAndDistrict", storedprocadd="SaveBlock" ) # Change GetBlockByNameAndDistricts to GetBlockByNameAndDistrict self.isSuccess = block.isSuccess self.resultMessage = block.resultMessage return # ---------------------------------------------------------- # Get All Blocks - # ---------------------------------------------------------- - # def GetAllBlocks(self): - - # block = ItemCRUD(itemType=ItemCRUDType.Block) - # blocksdata = block.GetAllData(request=request, storedproc="GetAllBlock") - # self.isSuccess = block.isSuccess - # self.resultMessage = block.resultMessage - # return blocksdata - + # ---------------------------------------------------------- def GetAllBlocks(self, request): block = ItemCRUD(itemType=ItemCRUDType.Block) @@ -60,15 +52,6 @@ class Block: # ---------------------------------------------------------- # Check Block Exists # ---------------------------------------------------------- - - # def CheckBlock(self, request): - # block = ItemCRUD(itemType=ItemCRUDType.Block) - # block_name = request.json.get('block_Name', '').strip() - # district_id = request.json.get('district_Id') - # result = block.CheckItem(request=request, parentid=district_id, childname=block_name, storedprocfetch="GetBlockByNameAndDistrict") - # self.isSuccess = block.isSuccess - # self.resultMessage = block.resultMessage - # return result def CheckBlock(self, request): block = ItemCRUD(itemType=ItemCRUDType.Block) data = request.get_json(silent=True) or request.form @@ -88,21 +71,6 @@ class Block: # ---------------------------------------------------------- # Get Block By ID # ---------------------------------------------------------- - # def GetBlockByID(self, id): - - # block = ItemCRUD(itemType=ItemCRUDType.Village) - # blockdata = block.GetAllData(id=id,storedproc="GetBlockDataByID") - # self.isSuccess = block.isSuccess - # self.resultMessage = block.resultMessage - # print("akash"+blockdata) - # return blockdata - - # def GetBlockByID(self,request,id): - # block = ItemCRUD(itemType=ItemCRUDType.Block) - # blockdata = block.GetDataByID(request=request,id=id,storedproc="GetBlockDataByID") - # self.isSuccess = block.isSuccess - # self.resultMessage = block.resultMessage - # return blockdata def GetBlockByID(self, id): block = ItemCRUD(itemType=ItemCRUDType.Block) @@ -119,17 +87,6 @@ class Block: # ---------------------------------------------------------- # Update Block # ---------------------------------------------------------- - # def EditBlock(self, request, block_id): - - # block = ItemCRUD(itemType=ItemCRUDType.Block) - - # district_id = request.form.get('district_Id') - # block_name = request.form.get('block_Name', '').strip() - - # block.EditItem(request=request, childid=block_id, parentid=district_id, childname=block_name, storedprocadd="UpdateBlockById" ) - # self.isSuccess = block.isSuccess - # self.resultMessage = block.resultMessage - # return def EditBlock(self, request, block_id): block = ItemCRUD(itemType=ItemCRUDType.Block) diff --git a/model/ContractorInfo.py b/model/ContractorInfo.py index edfa3cd..4e89806 100644 --- a/model/ContractorInfo.py +++ b/model/ContractorInfo.py @@ -1,6 +1,3 @@ - - - from mysql.connector import Error import config from datetime import datetime @@ -17,7 +14,7 @@ class ContractorInfo: try: connection = config.get_db_connection() with connection.cursor(dictionary=True, buffered=True) as cursor: - cursor.callproc('GetContractorInfoById', [self.ID]) + cursor.callproc('GetContractorInfo', [self.ID]) #Change GetContractorInfoById to GetContractorInfo # Get the first result set for result in cursor.stored_results(): self.contInfo = result.fetchone() diff --git a/model/PmcReport.py b/model/PmcReport.py index 83e5b63..a05ae4b 100644 --- a/model/PmcReport.py +++ b/model/PmcReport.py @@ -16,7 +16,6 @@ class PmcReport: cursor = connection.cursor(dictionary=True, buffered=True) try: - pmc_info = ReportHelper.execute_sp(cursor, 'GetContractorInfoByPmcNo', [pmc_no], True) if not pmc_info: @@ -30,17 +29,24 @@ class PmcReport: invoices = [] hold_amount_total = 0 - if hold_type_ids: - hold_type_ids_str = ",".join(map(str, hold_type_ids)) - cursor.callproc( + # if hold_type_ids: + # hold_type_ids_str = ",".join(map(str, hold_type_ids)) + # cursor.callproc( + # 'GetInvoices_WithHold', + # [pmc_no, pmc_info["Contractor_Id"], hold_type_ids_str] + # ) + # else: + # cursor.callproc( + # 'GetInvoices_NoHold', + # [pmc_no, pmc_info["Contractor_Id"]] + # ) + + hold_type_ids_str = ",".join(map(str, hold_type_ids)) + cursor.callproc( 'GetInvoices_WithHold', [pmc_no, pmc_info["Contractor_Id"], hold_type_ids_str] ) - else: - cursor.callproc( - 'GetInvoices_NoHold', - [pmc_no, pmc_info["Contractor_Id"]] - ) + for result in cursor.stored_results(): invoices = result.fetchall() @@ -49,9 +55,7 @@ class PmcReport: total_invo_final = sum(row.get('Final_Amount', 0) or 0 for row in invoices) - gst_rel = ReportHelper.execute_sp(cursor, 'GetGSTReleaseByPMC', [pmc_no]) - total_gst_basic = sum(row.get('basic_amount', 0) or 0 for row in gst_rel) total_gst_final = sum(row.get('final_amount', 0) or 0 for row in gst_rel) @@ -60,9 +64,6 @@ class PmcReport: credit_note = ReportHelper.execute_sp(cursor, 'GetCreditNoteByPMC', [pmc_no]) payments = ReportHelper.execute_sp(cursor, 'GetPaymentsByPMC', [pmc_no]) - - - total_pay_amount = sum(row.get('Payment_Amount', 0) or 0 for row in payments) total_pay_total = sum(row.get('Total_amount', 0) or 0 for row in payments) @@ -133,7 +134,6 @@ class PmcReport: cursor, 'GetHoldTypesByContractor', [contractor_info["Contractor_Id"]] ) - print("hold_types::::",hold_types) hold_type_map = { ht['hold_type_id']: ht['hold_type'] for ht in hold_types @@ -143,12 +143,9 @@ class PmcReport: cursor, 'GetInvoicesAndGstReleaseByPmcNo', [pmc_no] ) - print("invoices:::",invoices) - credit_notes = ReportHelper.execute_sp( cursor, 'NewGetCreditNotesByPMCNo', [pmc_no] ) - print("credit_notes:::",credit_notes) hold_amounts = ReportHelper.execute_sp( cursor, 'GetHoldAmountsByContractor', @@ -170,7 +167,6 @@ class PmcReport: if pmc: credit_note_map.setdefault(pmc, []).append(cn) - gst_map = {} for gst in gst_releases: pmc = gst.get("PMC_No") @@ -248,8 +244,6 @@ class PmcReport: # GST release placeholders (will add real GST below) row += ["", ""] - print("11111::",row) - sheet.append(row) for pmc, cn_list in credit_note_map.items(): @@ -267,7 +261,6 @@ class PmcReport: cn.get("Total_Amount", ""), cn.get("UTR", "") ] - print("22222::", cn_row) sheet.append(cn_row) # ================= GST RELEASE ROWS ================= @@ -287,7 +280,6 @@ class PmcReport: gst.get("Total_Amount", ""), gst.get("UTR", "") ] - print("33333::",gst_row) sheet.append(gst_row) # ================= AUTO WIDTH ================= diff --git a/model/Village.py b/model/Village.py index d6f0bb2..d2e2068 100644 --- a/model/Village.py +++ b/model/Village.py @@ -85,7 +85,7 @@ class Village: request=request, parentid=block_id, childname=village_name, - storedprocfetch="GetVillageByNameAndBlocks" + storedprocfetch="GetVillageByNameAndBlock" # Change GetVillageByNameAndBlocks to GetVillageByNameAndBlock ) self._set_status(self.village) return result diff --git a/static/download/Contractor_Report_1.xlsx b/static/download/Contractor_Report_1.xlsx index 6a683e3..e79374f 100644 Binary files a/static/download/Contractor_Report_1.xlsx and b/static/download/Contractor_Report_1.xlsx differ diff --git a/static/download/Contractor_Report_2.xlsx b/static/download/Contractor_Report_2.xlsx index 4b99f07..20af16d 100644 Binary files a/static/download/Contractor_Report_2.xlsx and b/static/download/Contractor_Report_2.xlsx differ diff --git a/static/download/Contractor_Report_3.xlsx b/static/download/Contractor_Report_3.xlsx index ebf7e3d..debf465 100644 Binary files a/static/download/Contractor_Report_3.xlsx and b/static/download/Contractor_Report_3.xlsx differ diff --git a/static/download/Contractor_Report_4.xlsx b/static/download/Contractor_Report_4.xlsx index a70ea73..a850d5f 100644 Binary files a/static/download/Contractor_Report_4.xlsx and b/static/download/Contractor_Report_4.xlsx differ diff --git a/static/download/Contractor_Report_6.xlsx b/static/download/Contractor_Report_6.xlsx new file mode 100644 index 0000000..8f6b025 Binary files /dev/null and b/static/download/Contractor_Report_6.xlsx differ diff --git a/static/download/Contractor_Report_7.xlsx b/static/download/Contractor_Report_7.xlsx new file mode 100644 index 0000000..e9d3de3 Binary files /dev/null and b/static/download/Contractor_Report_7.xlsx differ diff --git a/templates/show_excel_file.html b/templates/show_excel_file.html index 19b8903..2e11b0c 100644 --- a/templates/show_excel_file.html +++ b/templates/show_excel_file.html @@ -59,7 +59,8 @@ - + +