added docker and chnages of from model changes commits
This commit is contained in:
@@ -3,7 +3,6 @@ import mysql.connector
|
||||
import pandas as pd
|
||||
import io
|
||||
|
||||
|
||||
class AOHandler:
|
||||
|
||||
def __init__(self):
|
||||
@@ -49,7 +48,6 @@ class AOHandler:
|
||||
self.cursor.callproc("InsertAO", values)
|
||||
self.conn.commit()
|
||||
|
||||
|
||||
# UPDATE AO RECORD by AO id
|
||||
def update_ao(self, id, data):
|
||||
fields = [
|
||||
@@ -193,8 +191,6 @@ class AOHandler:
|
||||
print("MySQL Error →", e)
|
||||
return None
|
||||
|
||||
|
||||
|
||||
# CLOSE CONNECTION
|
||||
def close(self):
|
||||
self.cursor.close()
|
||||
|
||||
@@ -3,7 +3,6 @@ import mysql.connector
|
||||
import pandas as pd
|
||||
import io
|
||||
|
||||
|
||||
class CITHandler:
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -1,21 +1,43 @@
|
||||
# import mysql.connector
|
||||
# import os
|
||||
|
||||
# # Database Config
|
||||
# class DBConfig:
|
||||
# MYSQL_HOST = os.getenv("DB_HOST")
|
||||
# MYSQL_USER = os.getenv("DB_USER")
|
||||
# MYSQL_PASSWORD = os.getenv("DB_PASSWORD")
|
||||
# MYSQL_DB = os.getenv("DB_NAME")
|
||||
|
||||
# @staticmethod
|
||||
# def get_db_connection():
|
||||
# """
|
||||
# Returns a MySQL connection object.
|
||||
# """
|
||||
# return mysql.connector.connect(
|
||||
# host=DBConfig.MYSQL_HOST,
|
||||
# user=DBConfig.MYSQL_USER,
|
||||
# password=DBConfig.MYSQL_PASSWORD,
|
||||
# database=DBConfig.MYSQL_DB
|
||||
# )
|
||||
|
||||
|
||||
import mysql.connector
|
||||
import os
|
||||
|
||||
# Database Config
|
||||
class DBConfig:
|
||||
MYSQL_HOST = os.getenv("DB_HOST")
|
||||
MYSQL_USER = os.getenv("DB_USER")
|
||||
MYSQL_PASSWORD = os.getenv("DB_PASSWORD")
|
||||
MYSQL_DB = os.getenv("DB_NAME")
|
||||
|
||||
class DBConfig:
|
||||
@staticmethod
|
||||
def get_db_connection():
|
||||
"""
|
||||
Returns a MySQL connection object.
|
||||
Create and return a MySQL database connection
|
||||
using environment variables.
|
||||
"""
|
||||
|
||||
return mysql.connector.connect(
|
||||
host=DBConfig.MYSQL_HOST,
|
||||
user=DBConfig.MYSQL_USER,
|
||||
password=DBConfig.MYSQL_PASSWORD,
|
||||
database=DBConfig.MYSQL_DB
|
||||
host=os.getenv("DB_HOST", "db"), # Docker service name
|
||||
port=int(os.getenv("DB_PORT", 3306)),
|
||||
user=os.getenv("DB_USER", "root"),
|
||||
password=os.getenv("DB_PASSWORD", "root"),
|
||||
database=os.getenv("DB_NAME", "test_income_taxdb"),
|
||||
autocommit=False
|
||||
)
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import mysql.connector
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
import io
|
||||
from flask import send_file, render_template, request
|
||||
|
||||
from AppCode.Config import DBConfig
|
||||
from AppCode.YearGet import YearGet
|
||||
|
||||
|
||||
class ITRHandler:
|
||||
@@ -14,7 +12,6 @@ class ITRHandler:
|
||||
self.conn = DBConfig.get_db_connection()
|
||||
self.cursor = self.conn.cursor(dictionary=True)
|
||||
|
||||
|
||||
# GET ALL ITR RECORDS using stored procedure "GetAllItr"
|
||||
def get_all_itr(self):
|
||||
self.cursor.callproc("GetAllItr")
|
||||
@@ -52,7 +49,7 @@ class ITRHandler:
|
||||
'tax_payable', 'surcharge', 'edu_cess',
|
||||
'total_tax_payable', 'mat_credit_created', 'mat_credit_utilized',
|
||||
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs',
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks'
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks','created_at'
|
||||
]
|
||||
values = [data.get(col, 0) for col in columns]
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from AppCode.Config import DBConfig
|
||||
import mysql.connector
|
||||
|
||||
class MatCreditHandler:
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user