[UPDT] EMPLOYEE : Employee work info updation issue fixes in individual and bulk update and new database issues fixes

This commit is contained in:
Horilla
2024-05-16 14:26:44 +05:30
parent 9f468a4e64
commit a247b9ec3e
10 changed files with 338 additions and 298 deletions

View File

@@ -301,27 +301,57 @@ class EmployeeWorkInformationForm(ModelForm):
if isinstance(field, forms.ModelChoiceField) and field.label in field_names:
if field.label is not None:
field_name = field_names.get(field.label)
if field.queryset.model != Employee and field_name:
translated_label = _(field.label)
empty_label = _("---Choose {label}---").format(
label=translated_label
)
self.fields[label] = forms.ChoiceField(
choices=[("", empty_label)]
+ list(field.queryset.values_list("id", f"{field_name}")),
required=field.required,
label=translated_label,
initial=field.initial,
widget=forms.Select(
attrs={
"class": "oh-select oh-select-2 select2-hidden-accessible",
"onchange": f'onDynamicCreate(this.value,"{urls.get(field.label)}");',
}
),
)
self.fields[label].choices += [
("create", _("Create New {} ").format(translated_label))
]
# print(field.label)
if field.label == "Department":
if field.queryset.model != Employee and field_name:
translated_label = _(field.label)
empty_label = _("---Choose {label}---").format(
label=translated_label
)
self.fields[label] = forms.ChoiceField(
choices=[("", empty_label)]
+ list(
field.queryset.values_list("id", f"{field_name}")
),
required=field.required,
label=translated_label,
initial=field.initial,
widget=forms.Select(
attrs={
"class": "oh-select oh-select-2 select2-hidden-accessible",
"onchange": f'onDynamicCreateDep(this.value,"{urls.get(field.label)}");',
}
),
)
self.fields[label].choices += [
("create", _("Create New {} ").format(translated_label))
]
else:
if field.queryset.model != Employee and field_name:
translated_label = _(field.label)
empty_label = _("---Choose {label}---").format(
label=translated_label
)
self.fields[label] = forms.ChoiceField(
choices=[("", empty_label)]
+ list(
field.queryset.values_list("id", f"{field_name}")
),
required=field.required,
label=translated_label,
initial=field.initial,
widget=forms.Select(
attrs={
"class": "oh-select oh-select-2 select2-hidden-accessible",
"onchange": f'onDynamicCreate(this.value,"{urls.get(field.label)}");',
}
),
)
self.fields[label].choices += [
("create", _("Create New {} ").format(translated_label))
]
def clean(self):
cleaned_data = super().clean()

View File

@@ -80,7 +80,7 @@
<hr class="mt-5 mb-3">
<div class="w-100 d-flex align-items-center justify-content-end">
<button type="submit" class="oh-btn oh-btn--secondary oh-btn--w-100-resp">
{% trans "Save Changes" %}
{% trans "Save" %}
</button>
</div>
</form>

View File

@@ -177,14 +177,12 @@
</div>
</div>
</div>
<hr class="mt-5 mb-3 d-flex flex-row-reverse w-100" />
<div class="row d-flex flex-row-reverse">
<div class="col-lg-2 ">
<button type="submit" class="oh-btn oh-btn--secondary">
{% trans "Save Changes" %}
</button>
<hr class="mt-5 mb-3">
<div class="w-100 d-flex align-items-center justify-content-end">
<button type="submit" class="oh-btn oh-btn--secondary oh-btn--w-100-resp">
{% trans "Save" %}
</button>
</div>
</div>
</form>
</div>
</div>

View File

@@ -1,84 +1,86 @@
{% load i18n %}
<div class="oh-general__tab-target oh-profile-section mb-4 d-none" id="bank">
<div class="oh-profile-section__card">
<form method='post' action="" >
<div id="bankMessage">
</div>
{% csrf_token %}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.bank_name.id_for_label}}">{% trans "Bank Name" %}</label>
{{bank_form.bank_name}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.account_number.id_for_label}}">{% trans "Account Number" %}</label>
{{bank_form.account_number}}
{{bank_form.account_number.errors}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.branch.id_for_label}}">{% trans "Branch" %}</label>
{{bank_form.branch}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.any_other_code1.id_for_label}}">{% trans "Bank Code" %} #1</label>
{{bank_form.any_other_code1}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.address.id_for_label}}">{% trans "Bank Address" %}</label>
{{bank_form.address}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label" for="country">{% trans "Country" %}</label>
<select name="country" class="oh-select-2 w-100 country" id="country">
<option value="{{bank_form.instance.country}}" selected>{{bank_form.instance.county}}</option>
</select>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-wrapper">
<div class="oh-general__tab-target oh-profile-section mb-4 d-none" id="bank">
<div class="oh-profile-section__card">
<form method='post' action="" >
<div id="bankMessage">
</div>
{% csrf_token %}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="state">{% trans "State" %}</label>
<select name="state" class="oh-select-2 w-100 country" id="state">
<option value="{{bank_form.instance.state}}" selected>{{bank_form.instance.state}}</option>
</select>
<label class="oh-label" for="{{bank_form.bank_name.id_for_label}}">{% trans "Bank Name" %}</label>
{{bank_form.bank_name}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.account_number.id_for_label}}">{% trans "Account Number" %}</label>
{{bank_form.account_number}}
{{bank_form.account_number.errors}}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.city.id_for_label}}">{% trans "City" %}</label>
{{bank_form.city}}
<label class="oh-label" for="{{bank_form.branch.id_for_label}}">{% trans "Branch" %}</label>
{{bank_form.branch}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.any_other_code1.id_for_label}}">{% trans "Bank Code" %} #1</label>
{{bank_form.any_other_code1}}
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.any_other_code2.id_for_label}}">{% trans "Bank Code" %} #2</label>
{{bank_form.any_other_code2}}
<label class="oh-label" for="{{bank_form.address.id_for_label}}">{% trans "Bank Address" %}</label>
{{bank_form.address}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<label class="oh-label" for="country">{% trans "Country" %}</label>
<select name="country" class="oh-select-2 w-100 country" id="country">
<option value="{{bank_form.instance.country}}" selected>{{bank_form.instance.county}}</option>
</select>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="state">{% trans "State" %}</label>
<select name="state" class="oh-select-2 w-100 country" id="state">
<option value="{{bank_form.instance.state}}" selected>{{bank_form.instance.state}}</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.city.id_for_label}}">{% trans "City" %}</label>
{{bank_form.city}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{bank_form.any_other_code2.id_for_label}}">{% trans "Bank Code" %} #2</label>
{{bank_form.any_other_code2}}
</div>
</div>
</div>
<hr class="mt-5 mb-3">
<div class="w-100 d-flex align-items-center justify-content-end">
<button type="submit" class="oh-btn oh-btn--secondary oh-btn--w-100-resp">
{% trans "Save" %}
</button>
</div>
</form>
</div>
<hr class="mt-5 mb-3">
<div class="w-100 d-flex align-items-center justify-content-end">
<button type="submit" class="oh-btn oh-btn--secondary oh-btn--w-100-resp">
{% trans "Save Changes" %}
</button>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -195,13 +195,11 @@
</div>
</div>
</div>
<hr class="mt-5 mb-3 d-flex flex-row-reverse" />
<div class="row d-flex flex-row-reverse">
<div class="col-lg-2">
<button type="submit" class="oh-btn oh-btn--secondary">
{% trans "Save Changes" %}
<hr class="mt-5 mb-3">
<div class="w-100 d-flex align-items-center justify-content-end">
<button type="submit" class="oh-btn oh-btn--secondary oh-btn--w-100-resp">
{% trans "Save" %}
</button>
</div>
</div>
</form>
</div>

View File

@@ -1,224 +1,233 @@
{% load i18n %}
<div
class="oh-general__tab-target oh-profile-section mb-4 d-none"
id="work"
data-select2-id="select2-data-work"
>
<div class="oh-wrapper">
<div
class="oh-modal"
id="dynamicCreateModal"
role="dialog"
aria-hidden="true"
class="oh-general__tab-target oh-profile-section mb-4 d-none"
id="work"
data-select2-id="select2-data-work"
>
<div
class="oh-modal__dialog"
style="max-width: 550px"
id="dynamicCreateModalBody"
></div>
</div>
<span
name=""
id="dynamicDept"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'department-creation' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicJobPosition"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'job-position-creation' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicJobRole"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'job-role-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicWorkType"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'work-type-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicEmployeeType"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'employee-type-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicShift"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'employee-shift-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<div class="oh-profile-section__card" data-select2-id="select2-data-29-vht3">
<div id="workMessage"></div>
<form method="post" action="">
{{history_form.as_history_modal}} {% csrf_token %}
<div class="row" data-select2-id="select2-data-27-19z8">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.department_id.id_for_label}}">{% trans "Department" %}</label>
{{work_form.department_id}}
</div>
</div>
<div
class="col-12 col-sm-12 col-md-12 col-lg-6"
data-select2-id="select2-data-26-o2rs"
>
<div class="oh-input-group" data-select2-id="select2-data-25-5380">
<label class="oh-label" for="{{work_form.job_position_id.id_for_label}}">{% trans "Job Position" %}</label>
{{work_form.job_position_id}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
class="oh-modal"
id="dynamicCreateModal"
role="dialog"
aria-hidden="true"
>
<div
class="oh-modal__dialog"
style="max-width: 550px"
id="dynamicCreateModalBody"
></div>
</div>
<span
name=""
id="dynamicDept"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'department-creation' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicJobPosition"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'job-position-creation' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicJobRole"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'job-role-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicWorkType"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'work-type-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicEmployeeType"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'employee-type-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<span
name=""
id="dynamicShift"
style="display: none"
data-toggle="oh-modal-toggle"
data-target="#dynamicCreateModal"
hx-get="{% url 'employee-shift-create' %}?dynamic=true"
hx-target="#dynamicCreateModalBody"
></span>
<div class="oh-profile-section__card" data-select2-id="select2-data-29-vht3">
<div id="workMessage"></div>
<form method="post" action="">
{{history_form.as_history_modal}} {% csrf_token %}
<div class="row" data-select2-id="select2-data-27-19z8">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.job_role_id.id_for_label}}">{% trans "Job Role" %}</label>
{{work_form.job_role_id}}
<label class="oh-label" for="{{work_form.department_id.id_for_label}}">{% trans "Department" %}</label>
{{work_form.department_id}}
</div>
</div>
<div
class="col-12 col-sm-12 col-md-12 col-lg-6"
data-select2-id="select2-data-26-o2rs"
>
<div class="oh-input-group" data-select2-id="select2-data-25-5380">
<label class="oh-label" for="{{work_form.job_position_id.id_for_label}}">{% trans "Job Position" %}</label>
{{work_form.job_position_id}}
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.shift_id.id_for_label}}">{% trans "Shift Information" %}</label>
{{work_form.shift_id}}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.job_role_id.id_for_label}}">{% trans "Job Role" %}</label>
{{work_form.job_role_id}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.shift_id.id_for_label}}">{% trans "Shift Information" %}</label>
{{work_form.shift_id}}
</div>
</div>
</div>
</div>
<div class="row" data-select2-id="select2-data-27-95a0">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.work_type_id.id_for_label}}">{% trans "Work Type" %}</label>
{{work_form.work_type_id}}
<div class="row" data-select2-id="select2-data-27-95a0">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.work_type_id.id_for_label}}">{% trans "Work Type" %}</label>
{{work_form.work_type_id}}
</div>
</div>
<div
class="col-12 col-sm-12 col-md-12 col-lg-6"
data-select2-id="select2-data-26-u84a"
>
<div class="oh-input-group" data-select2-id="select2-data-25-5l0x">
<label class="oh-label" for="{{work_form.employee_type_id.id_for_label}}">{% trans "Employee Type" %}</label>
{{work_form.employee_type_id}}
</div>
</div>
</div>
<div
class="col-12 col-sm-12 col-md-12 col-lg-6"
data-select2-id="select2-data-26-u84a"
>
<div class="oh-input-group" data-select2-id="select2-data-25-5l0x">
<label class="oh-label" for="{{work_form.employee_type_id.id_for_label}}">{% trans "Employee Type" %}</label>
{{work_form.employee_type_id}}
<div class="row" data-select2-id="select2-data-39-3q9c">
<div
class="col-12 col-sm-12 col-md-12 col-lg-6"
data-select2-id="select2-data-38-ofph"
>
<div class="oh-input-group" data-select2-id="select2-data-37-p4f9">
<label class="oh-label" for="{{work_form.reporting_manager_id.id_for_label}}">{% trans "Reporting Manager" %}</label>
{{work_form.reporting_manager_id}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.company_id.id_for_label}}">{% trans "Company" %}</label>
{{work_form.company_id}}
</div>
</div>
</div>
</div>
<div class="row" data-select2-id="select2-data-39-3q9c">
<div
class="col-12 col-sm-12 col-md-12 col-lg-6"
data-select2-id="select2-data-38-ofph"
>
<div class="oh-input-group" data-select2-id="select2-data-37-p4f9">
<label class="oh-label" for="{{work_form.reporting_manager_id.id_for_label}}">{% trans "Reporting Manager" %}</label>
{{work_form.reporting_manager_id}}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.location.id_for_label}}">{% trans "Work Location" %}</label>
{{work_form.location}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.email.id_for_label}}" for="workEmail"
>{% trans "Work Email" %}</label
>
{{work_form.email}}
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.company_id.id_for_label}}">{% trans "Company" %}</label>
{{work_form.company_id}}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.date_joining.id_for_label}}" for="startDate"
>{% trans "Joining Date" %}</label
>
{{work_form.date_joining}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.contract_end_date.id_for_label}}" for="endDate"
>{% trans "Contract End Date" %}</label
>
{{work_form.contract_end_date}}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.location.id_for_label}}">{% trans "Work Location" %}</label>
{{work_form.location}}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.basic_salary.id_for_label}}">{% trans "Basic Salary" %}</label>
{{work_form.basic_salary}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.salary_hour.id_for_label}}" for="workEmail"
>{% trans "Salary Per Hour" %}</label
>
{{work_form.salary_hour}}
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.email.id_for_label}}" for="workEmail"
>{% trans "Work Email" %}</label
>
{{work_form.email}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.date_joining.id_for_label}}" for="startDate"
>{% trans "Joining Date" %}</label
>
{{work_form.date_joining}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.contract_end_date.id_for_label}}" for="endDate"
>{% trans "Contract End Date" %}</label
>
{{work_form.contract_end_date}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.basic_salary.id_for_label}}">{% trans "Basic Salary" %}</label>
{{work_form.basic_salary}}
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.salary_hour.id_for_label}}" for="workEmail"
>{% trans "Salary Per Hour" %}</label
>
{{work_form.salary_hour}}
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.tags.id_for_label}}">{% trans "Employee tag" %}</label>
{{work_form.tags}}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label" for="{{work_form.tags.id_for_label}}">{% trans "Employee tag" %}</label>
{{work_form.tags}}
</div>
</div>
</div>
</div>
<hr class="mt-5 mb-3" />
<div class="w-100 d-flex align-items-center justify-content-end">
<button
type="submit"
class="oh-btn oh-btn--secondary oh-btn--w-100-resp"
>
{% trans "Save Changes" %}
</button>
</div>
</form>
<hr class="mt-5 mb-3" />
<div class="w-100 d-flex align-items-center justify-content-end">
<button
type="submit"
class="oh-btn oh-btn--secondary oh-btn--w-100-resp"
>
{% trans "Save" %}
</button>
</div>
</form>
</div>
</div>
</div>
<script>
function onDynamicCreate(value, id) {
if (value == "create") {
$(id).click();
}
}
function onDynamicCreateDep(value, id) {
if (value == "create") {
$(id).click();
}
else {
var departmentId = value; // Get the selected department ID
console.log('---------------------------')
console.log(departmentId)
// Make AJAX request to fetch available job positions for the selected department
$.ajax({
@@ -239,6 +248,7 @@
text: value
}));
});
$('#id_job_position_id').change();
}
});
}

View File

@@ -58,6 +58,7 @@
text: value
}));
});
$('#id_job_position_id').change();
}
});

View File

@@ -27,7 +27,7 @@
{% trans "Allowances" %}
</div>
</div>
{% if perms.payroll.add_allowance %}
{% if perms.payroll.add_allowance and active_contracts %}
<button title="Add Bonus" class="oh-btn oh-btn--secondary-outline oh-stop-prop oh-accordion-meta__btn p-2" title="Add" hx-get="{% url "add-bonus" %}?employee_id={{employee.id}}" hx-target="#addBonusModalBody" data-target="#addBonusModal" data-toggle="oh-modal-toggle">
<ion-icon class="md hydrated" name="add-outline" role="img" aria-label="add outline"></ion-icon>
</button>

View File

@@ -1,7 +1,7 @@
{% load static %} {% load i18n %}
{% load audit_filters %}
<div class="row">
{% if history %}
{% if employee.employee_work_info.tracking %}
{% for history in employee.employee_work_info.tracking %}
<div class="oh-history__container">
<div class="oh-history_date oh-card__title oh-card__title--sm fw-bold me-2">

View File

@@ -1090,7 +1090,8 @@ def employee_view(request):
update_fields = BulkUpdateFieldForm()
data_dict = parse_qs(previous_data)
get_key_instances(Employee, data_dict)
emp = Employee.objects.all()
emp = Employee.objects.filter()
return render(
request,
"employee_personal_info/employee_view.html",