summaryrefslogtreecommitdiff
path: root/maconomy/repositories.py
diff options
context:
space:
mode:
Diffstat (limited to 'maconomy/repositories.py')
-rw-r--r--maconomy/repositories.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/maconomy/repositories.py b/maconomy/repositories.py
index fb143e8..2dcb019 100644
--- a/maconomy/repositories.py
+++ b/maconomy/repositories.py
@@ -1,5 +1,5 @@
import cx_Oracle
-from maconomy.models import Employee, Timesheet
+from maconomy.models import Timesheet
def create_db(config):
user = config.get("db", "user")
@@ -17,7 +17,7 @@ class DBRepository:
class TimeRegistrationRepository(DBRepository):
def all_active(self):
- query = """SELECT e.EMPLOYEENUMBER,e.NAME1,e.ELECTRONICMAILADDRESS, t.WEEKNUMBER, t.SUBMITTED, t.APPROVED from EMPLOYEE e
+ query = """SELECT e.EMPLOYEENUMBER,e.NAME1,e.ELECTRONICMAILADDRESS, t.WEEKNUMBER, t.SUBMITTED, t.APPROVED, e.SUPERIOREMPLOYEE from EMPLOYEE e
LEFT OUTER JOIN TIMESHEETHEADER t
ON e.EMPLOYEENUMBER = t.EMPLOYEENUMBER
and t.PERIODSTART=to_char(trunc(sysdate-7, 'IW'),'YYYY.MM.DD')
@@ -31,5 +31,5 @@ class TimeRegistrationRepository(DBRepository):
res = self.cursor.execute(query)
rows = res.fetchall()
- return [(Employee(r), Timesheet(r[3:])) for r in rows]
+ return [Timesheet.from_result(r) for r in rows]