Beispiel #1
0
 def get_all_employees():
     db_employees = visions.Viwpremployees("ID, Name", status="Active").fetch_all_dict()
     employees = []
     for row in db_employees:
         employee = VisionsEmployee(row["ID"], row["Name"])
         employees.append(employee)
     return employees
Beispiel #2
0
 def get_employees_for_import():
     db_employees = visions.Viwpremployees("ID, FirstName, LastName, EmployeeSSN", status="Active").fetch_all_dict()
     employees = []
     for row in db_employees:
         employee = VisionsImportEmployee(row["ID"], row["FirstName"], row["LastName"], row["EmployeeSSN"])
         if Employee.should_import_employee(employee):
             employees.append(employee)
     return employees
Beispiel #3
0
 def update_employee_from_visions(self):
     visions_user = User.objects.get(username="******")
     update_field(self, "employee_id",
                  visions.Viwpremployees().EmployeeID(self.visions_id),
                  visions_user)
     update_field(self, "first_name",
                  visions.Viwpremployees().FirstName(self.visions_id),
                  visions_user)
     update_field(self, "last_name",
                  visions.Viwpremployees().LastName(self.visions_id),
                  visions_user)
     update_field(self, "middle_name",
                  visions.Viwpremployees().MiddleName(self.visions_id),
                  visions_user)
     update_field(self, "birth_date",
                  visions.Viwpremployees().BirthDate(self.visions_id),
                  visions_user)
     update_field(self, "start_date",
                  visions.Viwpremployees().HireDate(self.visions_id),
                  visions_user)
     update_field(self, "ssn",
                  visions.Viwpremployees().EmployeeSSN(self.visions_id),
                  visions_user)
     ethnicity = visions.Viwpremployees().PREthnicOrigin(self.visions_id)
     clean_ethnicity = False
     if ethnicity == "Not Hispanic or Latino":
         clean_ethnicity = "Non-Hispanic"
     if ethnicity == "Hispanic or Latino":
         clean_ethnicity = "Hispanic"
     if clean_ethnicity:
         update_field(self, "ethnicity", clean_ethnicity, visions_user)
     race = visions.Viwpremployees().tblHRMasterEthnicityID(self.visions_id)
     if race == 1:
         update_field(self, "race_white", True, visions_user)
         update_field(self, "race_black", False, visions_user)
         update_field(self, "race_american_indian", False, visions_user)
         update_field(self, "race_asian", False, visions_user)
         update_field(self, "race_islander", False, visions_user)
     if race == 2:
         update_field(self, "race_white", False, visions_user)
         update_field(self, "race_black", True, visions_user)
         update_field(self, "race_american_indian", False, visions_user)
         update_field(self, "race_asian", False, visions_user)
         update_field(self, "race_islander", False, visions_user)
     if race == 3:
         update_field(self, "race_white", True, visions_user)
         update_field(self, "race_black", False, visions_user)
         update_field(self, "race_american_indian", False, visions_user)
         update_field(self, "race_asian", False, visions_user)
         update_field(self, "race_islander", False, visions_user)
     if race == 4:
         update_field(self, "race_white", False, visions_user)
         update_field(self, "race_black", False, visions_user)
         update_field(self, "race_american_indian", True, visions_user)
         update_field(self, "race_asian", False, visions_user)
         update_field(self, "race_islander", False, visions_user)
     if race == 5:
         update_field(self, "race_white", False, visions_user)
         update_field(self, "race_black", False, visions_user)
         update_field(self, "race_american_indian", False, visions_user)
         update_field(self, "race_asian", True, visions_user)
         update_field(self, "race_islander", False, visions_user)
     if race == 6:
         update_field(self, "race_white", False, visions_user)
         update_field(self, "race_black", False, visions_user)
         update_field(self, "race_american_indian", False, visions_user)
         update_field(self, "race_asian", False, visions_user)
         update_field(self, "race_islander", True, visions_user)
     gender = visions.Viwpremployees().Gender(self.visions_id)
     if gender == 1:
         update_field(self, "gender", "M", visions_user)
     if gender == 2:
         update_field(self, "gender", "F", visions_user)
Beispiel #4
0
 def get_employee(id):
     return VisionsEmployee(id, visions.Viwpremployees().Name(id))
Beispiel #5
0
 def verify_employee(visions_id):
     if not visions.Viwpremployees().ID(visions_id):
         return False
     return True