Skip to content

Commit

Permalink
feature(Employee)
Browse files Browse the repository at this point in the history
- auto insert the base grade when Grade is Selected

closes #7236
  • Loading branch information
lomamech committed Mar 5, 2024
1 parent 5a3f897 commit b53c72c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/modules/employees/registration/employees.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
<ui-select
name="grade"
ng-model="EmployeeCtrl.employee.grade_uuid"
on-select="EmployeeCtrl.onSelectGrade($item)"
required>
<ui-select-match placeholder="{{ 'FORM.SELECT.GRADE' | translate }}">
<span>{{$select.selected.format}}</span>
Expand Down
5 changes: 5 additions & 0 deletions client/src/modules/employees/registration/employees.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function EmployeeController(Employees, Services, Grades, Functions, Titles, Cred
const { saveAsEmployee } = $state.params;

vm.enterprise = Session.enterprise;
vm.onSelectGrade = onSelectGrade;

vm.isUpdating = $state.params.uuid;
vm.updateEditLabel = vm.isUpdating
Expand Down Expand Up @@ -90,6 +91,10 @@ function EmployeeController(Employees, Services, Grades, Functions, Titles, Cred
employee.displayAge = moment().diff(employee.dob, 'years');
}

function onSelectGrade(element) {
vm.employee.individual_salary = element.basic_salary;
}

// Expose lenths from util
vm.length20 = util.length20;

Expand Down

0 comments on commit b53c72c

Please sign in to comment.