update
This commit is contained in:
@@ -7,12 +7,12 @@ from model.Block import Block
|
||||
from model.Utilities import HtmlHelper
|
||||
|
||||
block_bp = Blueprint('block', __name__)
|
||||
|
||||
block = Block()
|
||||
# --- Add Block page -------
|
||||
@block_bp.route('/add_block', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def add_block():
|
||||
block = Block()
|
||||
# block = Block()
|
||||
|
||||
if request.method == 'POST':
|
||||
block.AddBlock(request)
|
||||
@@ -62,7 +62,7 @@ def get_districts(state_id):
|
||||
@login_required
|
||||
def check_block():
|
||||
|
||||
block = Block()
|
||||
# block = Block()
|
||||
return block.CheckBlock(request)
|
||||
|
||||
|
||||
@@ -70,8 +70,8 @@ def check_block():
|
||||
@login_required
|
||||
def edit_block(block_id):
|
||||
|
||||
block = Block()
|
||||
|
||||
|
||||
# block = Block()
|
||||
if request.method == 'POST':
|
||||
block.EditBlock(request, block_id)
|
||||
block.resultMessage
|
||||
@@ -90,7 +90,10 @@ def edit_block(block_id):
|
||||
for rs in cursor.stored_results():
|
||||
states = rs.fetchall()
|
||||
|
||||
cursor.callproc("GetAllDistrictsData")
|
||||
# cursor.callproc("GetAllDistrictsData")
|
||||
# for rs in cursor.stored_results():
|
||||
# districts = rs.fetchall()
|
||||
cursor.callproc("GetAllDistricts")
|
||||
for rs in cursor.stored_results():
|
||||
districts = rs.fetchall()
|
||||
|
||||
@@ -111,7 +114,7 @@ def edit_block(block_id):
|
||||
@login_required
|
||||
def delete_block(block_id):
|
||||
|
||||
block = Block()
|
||||
# block = Block()
|
||||
block.DeleteBlock(request, block_id)
|
||||
|
||||
return redirect(url_for('block.add_block'))
|
||||
@@ -84,7 +84,9 @@ def show_table(filename):
|
||||
subcontractor_data = result.fetchone()
|
||||
|
||||
if not subcontractor_data:
|
||||
cursor.callproc('InsertSubcontractor', [file_info['Subcontractor']])
|
||||
# cursor.callproc('InsertSubcontractor', [file_info['Subcontractor']])
|
||||
# connection.commit()
|
||||
cursor.callproc('SaveContractor', [file_info.get('Subcontractor'),None,None,None,None,None,None,None,None])
|
||||
connection.commit()
|
||||
cursor.callproc('GetSubcontractorByName', [file_info['Subcontractor']])
|
||||
for result in cursor.stored_results():
|
||||
@@ -370,21 +372,23 @@ def save_data():
|
||||
# if not invoice_id:
|
||||
print(" extra payment :", PMC_No,Total_Amount,UTR, subcontractor_id)
|
||||
|
||||
cursor.execute(
|
||||
"""
|
||||
INSERT INTO invoice (PMC_No,Contractor_Id) VALUES (%s, %s);
|
||||
""",
|
||||
(PMC_No, subcontractor_id)
|
||||
)
|
||||
connection.commit()
|
||||
|
||||
cursor.execute(
|
||||
"SELECT invoice_id FROM invoice WHERE PMC_No=%s AND Contractor_Id =%s ORDER BY invoice_id DESC LIMIT 1",
|
||||
(PMC_No, subcontractor_id)
|
||||
)
|
||||
row = cursor.fetchone()
|
||||
invoice_id = row[0] if row else None
|
||||
# cursor.execute(
|
||||
# """
|
||||
# INSERT INTO invoice (PMC_No,Contractor_Id) VALUES (%s, %s);
|
||||
# """,
|
||||
# (PMC_No, subcontractor_id)
|
||||
# )
|
||||
# connection.commit()
|
||||
|
||||
# cursor.execute(
|
||||
# "SELECT invoice_id FROM invoice WHERE PMC_No=%s AND Contractor_Id =%s ORDER BY invoice_id DESC LIMIT 1",
|
||||
# (PMC_No, subcontractor_id)
|
||||
# )
|
||||
# row = cursor.fetchone()
|
||||
cursor.callproc("insertExtrapaymet",(PMC_No, subcontractor_id))
|
||||
for result in cursor.stored_results():
|
||||
row = result.fetchone()
|
||||
invoice_id = row[0] if row else None
|
||||
# insert payment
|
||||
cursor.callproc(
|
||||
"SavePayment",
|
||||
@@ -405,8 +409,8 @@ def save_data():
|
||||
# Add inoice id in payment table
|
||||
# cursor.callproc("SavePayment",(PMC_No, Invoice_No, Payment_Amount, TDS_Payment_Amount, Total_Amount, UTR, invoice_id))
|
||||
|
||||
if not village_id:
|
||||
village_id = None
|
||||
# if not village_id:
|
||||
# village_id = None
|
||||
# cursor.callproc('InsertOrUpdateInPayment', (
|
||||
# PMC_No,
|
||||
# village_id,
|
||||
|
||||
@@ -5,12 +5,12 @@ from model.GST import GST
|
||||
|
||||
hold_bp = Blueprint("hold_types", __name__)
|
||||
|
||||
|
||||
hold = HoldTypes()
|
||||
# ---------------- ADD HOLD TYPE ----------------
|
||||
@hold_bp.route('/add_hold_type', methods=['GET','POST'])
|
||||
@login_required
|
||||
def add_hold_type():
|
||||
hold = HoldTypes()
|
||||
# hold = HoldTypes()
|
||||
|
||||
if request.method == 'POST':
|
||||
hold.AddHoldType(request)
|
||||
@@ -30,7 +30,7 @@ def add_hold_type():
|
||||
@login_required
|
||||
def check_hold_type():
|
||||
|
||||
hold = HoldTypes()
|
||||
# hold = HoldTypes()
|
||||
return hold.CheckHoldType(request) # if exists
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ def check_hold_type():
|
||||
@login_required
|
||||
def edit_hold_type(id):
|
||||
|
||||
hold = HoldTypes()
|
||||
# hold = HoldTypes()
|
||||
|
||||
if request.method == 'POST':
|
||||
hold.EditHoldType(request, id) # ✅
|
||||
@@ -58,7 +58,7 @@ def edit_hold_type(id):
|
||||
@login_required
|
||||
def delete_hold_type(id):
|
||||
|
||||
hold = HoldTypes()
|
||||
# hold = HoldTypes()
|
||||
hold.DeleteHoldType(request, id) # ✅
|
||||
|
||||
return redirect(url_for("hold_types.add_hold_type"))
|
||||
|
||||
@@ -3,13 +3,13 @@ from flask_login import login_required
|
||||
from model.State import State
|
||||
|
||||
state_bp = Blueprint('state', __name__)
|
||||
|
||||
state = State()
|
||||
# ----- State page ------
|
||||
@state_bp.route('/add_state', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def add_state():
|
||||
|
||||
state = State()
|
||||
# state = State()
|
||||
|
||||
if request.method == 'POST':
|
||||
state.AddState(request=request)
|
||||
@@ -24,7 +24,7 @@ def add_state():
|
||||
@login_required
|
||||
def check_state():
|
||||
|
||||
state = State()
|
||||
# state = State()
|
||||
|
||||
return state.CheckState(request=request)
|
||||
|
||||
@@ -33,7 +33,7 @@ def check_state():
|
||||
@login_required
|
||||
def deleteState(id):
|
||||
|
||||
state = State()
|
||||
# state = State()
|
||||
|
||||
state.DeleteState(request=request, id=id)
|
||||
|
||||
@@ -47,7 +47,7 @@ def deleteState(id):
|
||||
@login_required
|
||||
def editState(id):
|
||||
|
||||
state = State()
|
||||
# state = State()
|
||||
|
||||
if request.method == 'POST':
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@ from model.State import State
|
||||
|
||||
# Create Blueprint
|
||||
village_bp = Blueprint('village', __name__)
|
||||
|
||||
village = Village()
|
||||
|
||||
# ------------------------- Add Village -------------------------
|
||||
@village_bp.route('/add_village', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def add_village():
|
||||
|
||||
village = Village()
|
||||
# village = Village()
|
||||
|
||||
if request.method == 'POST':
|
||||
village.AddVillage(request=request)
|
||||
@@ -79,14 +79,14 @@ def get_blocks(district_id):
|
||||
@village_bp.route('/check_village', methods=['POST'])
|
||||
@login_required
|
||||
def check_village():
|
||||
village = Village()
|
||||
# village = Village()
|
||||
return village.CheckVillage(request=request)
|
||||
|
||||
|
||||
@village_bp.route('/delete_village/<int:village_id>')
|
||||
@login_required
|
||||
def delete_village(village_id):
|
||||
village = Village()
|
||||
# village = Village()
|
||||
village.DeleteVillage(request=request, village_id=village_id)
|
||||
|
||||
# ✅ Convert resultMessage to string if it's a Response or tuple
|
||||
@@ -112,7 +112,7 @@ def delete_village(village_id):
|
||||
@login_required
|
||||
def edit_village(village_id):
|
||||
|
||||
village = Village()
|
||||
# village = Village()
|
||||
|
||||
if request.method == 'POST':
|
||||
|
||||
|
||||
Reference in New Issue
Block a user