Esempio n. 1
0
 def __variables__(self):
     self.ID = self.table.item(self.row, 0).text()
     self.connUser = connUser()
     self.connDB = connDB(self.table.widget.windows.CURRENT_YEAR)
 def __connUser__(self):
     self.connUser = connUser()
 def __connector__(self):
     self.connUser = connUser()
     self.connBusiness = connBusiness()
     self.connInfo = connInfo()
Esempio n. 4
0
from pandas import DataFrame
from os import listdir
from setting import databaseMain
import connector.connTotal as connTotal
from connector.connBusiness import connBusiness
from connector.connUser import connUser

CONN_BUSINESS = connBusiness()
CONN_USER = connUser()


def returnTotalPerYear(column=False):
    listNumbers = CONN_BUSINESS.returnNumbers()
    listBusiness = CONN_BUSINESS.returnBusinesses()
    listYears = listdir(databaseMain)
    columns = ['사업명']+[f"{year.replace('.db', '')}년" for year in listYears]+['합계']
    if column:
        return columns
    else:
        resultTotal = []
        for number, business in zip(listNumbers, listBusiness):
            yearTotal = []
            for idx, year in enumerate(listYears):
                year = year.replace('.db', '')
                listYears[idx] = year
                dateColumns = connTotal.returnColumns(year)[8:]
                businessPerYear = connTotal.returnBusinesses(year)
                if business in businessPerYear:
                    sumQuery = f"SUM(`{'`), SUM(`'.join(dateColumns)}`)"
                    query = f"Select {sumQuery} from Main Where `번호`='{number}' and `적용상태_사업`='적용' and `적용상태_부서원`='적용';"
                    value = sum(connTotal.runQuery_return(year, query))
 def __connector__(self):
     self.connUser = connUser()
     self.connDB = connDB(self.widget.windows.CURRENT_YEAR)
Esempio n. 6
0
 def __variables__(self):
     self.ID = self.table.item(self.row, 0).text()
     self.connUser = connUser()
Esempio n. 7
0
 def __init__(self, year):
     self.year = year
     self.path = f"{setting.databaseMain}/{year}.db"
     self.connUser = connUser()
     self.connBusiness = connBusiness()