modification of report, froms, models
This commit is contained in:
@@ -38,8 +38,9 @@ class MatCreditHandler:
|
||||
(
|
||||
data["financial_year"],
|
||||
data["mat_credit"],
|
||||
data["opening_balance"],
|
||||
data["balance"],
|
||||
data.get("remarks", "")
|
||||
data.get("remarks", "update on manually on mat credit from ui")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -68,20 +69,21 @@ class MatCreditHandler:
|
||||
# AUTO SAVE MAT FROM ITR (MAIN LOGIC)
|
||||
# --------------------------------------------------
|
||||
@staticmethod
|
||||
def save_from_itr(year, mat_created, mat_utilized, remarks="Auto from"):
|
||||
def save_from_itr(year, mat_created, opening_balance, mat_utilized, remarks):
|
||||
conn = DBConfig.get_db_connection()
|
||||
cur = conn.cursor(dictionary=True)
|
||||
|
||||
try:
|
||||
mat_created = float(mat_created or 0)
|
||||
opening_balance = float(mat_created or 0)
|
||||
mat_utilized = float(mat_utilized or 0)
|
||||
|
||||
balance = mat_created - mat_utilized
|
||||
balance = opening_balance + mat_created - mat_utilized
|
||||
|
||||
# Save / Update MAT Credit
|
||||
cur.callproc(
|
||||
"SaveOrUpdateMatCredit",
|
||||
(year, mat_created, balance, remarks)
|
||||
(year, mat_created, opening_balance, balance, remarks)
|
||||
)
|
||||
|
||||
mat_id = None
|
||||
|
||||
Reference in New Issue
Block a user