def __init__(self, department='Gray', startdate='2019-01-01', enddate='2019-02-01'): super().__init__() self.department = myobjects.Department(department) self.startdate = startdate self.enddate = enddate self.employees = self.department.employees self.empids = [employee.id for employee in self.employees] self.setTransactions()
def getProductionData(self): self.proddata = [] prod = myobjects.Department("Production") for emp in prod.employees: tmp = {} emp.setAttendanceHalf(self.month, self.half) emp.calculatePay() tmp["name"] = emp.name self.meters = emp.meters self.redyeing = emp.redyeing tmp["total"] = emp.totalpay tmp["balance"] = emp.balance tmp["loans"] = emp.loans self.proddata.append(tmp)
def setDepartment(self, department): # print(department) self.department = myobjects.Department(department) self.employees = self.department.employees self.empids = [employee.id for employee in self.employees] self.setTransactions()
def loadDepartments(self): with sqlite3.connect('test2.db') as conn: deps = conn.execute( 'select * from departments where not department in ("Staff", "Production")' ).fetchall() self.departments = [myobjects.Department(x[0]) for x in deps]
def loadProductionData(self): self.production = myobjects.Department("Production").employees