delete store Procedure
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 =================
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user