Skip to content

Commit

Permalink
feat: add Salary Type field
Browse files Browse the repository at this point in the history
  • Loading branch information
krantheman committed Aug 23, 2023
1 parent ffa97ee commit a65b7d5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
10 changes: 9 additions & 1 deletion hrms/hr/doctype/job_opening/job_opening.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"lower_range",
"upper_range",
"column_break_20",
"salary_type",
"publish_salary_range"
],
"fields": [
Expand Down Expand Up @@ -231,12 +232,19 @@
"fieldname": "closed_on",
"fieldtype": "Date",
"label": "Closed On"
},
{
"default": "Per Month",
"fieldname": "salary_type",
"fieldtype": "Select",
"label": "Salary Type",
"options": "Per Hour\nPer Day\nPer Week\nPer Month\nPer Year\nPer Sale"
}
],
"icon": "fa fa-bookmark",
"idx": 1,
"links": [],
"modified": "2023-08-23 11:48:22.678542",
"modified": "2023-08-23 15:55:02.233809",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Opening",
Expand Down
1 change: 1 addition & 0 deletions hrms/hr/doctype/job_opening/job_opening.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def get_job_openings(
"upper_range",
"currency",
"job_application_route",
"salary_type",
]

filters = filters or {}
Expand Down
32 changes: 22 additions & 10 deletions hrms/hr/doctype/job_opening/templates/job_opening_row.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
<div class="my-5">
<h3>{{ doc.job_title }}</h3>
<p>{{ doc.description }}</p>
<div class="py-12 px-4">
<h3 class="mt-0">{{ doc.job_title }}</h3>
<p>{{ doc.description or _("No description") }}</p>
{%- if doc.publish_salary_range -%}
<p><b>{{_("Salary range per month")}}: </b>{{ frappe.format_value(frappe.utils.flt(doc.lower_range), currency=doc.currency) }} - {{ frappe.format_value(frappe.utils.flt(doc.upper_range), currency=doc.currency) }}</p>
<p>
<b>{{_("Salary Range ")}} ({{_(doc.salary_type)}}): </b>{{
frappe.format_value(frappe.utils.flt(doc.lower_range),
currency=doc.currency) }} - {{
frappe.format_value(frappe.utils.flt(doc.upper_range),
currency=doc.currency) }}
</p>
{% endif %}
<div>
{%- if doc.job_application_route -%}
<a class='btn btn-primary'
href='/{{doc.job_application_route}}/new?job_title={{ doc.name }}'>
{{ _("Apply Now") }}</a>
<a
class="btn btn-primary"
href="/{{doc.job_application_route}}/new?job_title={{ doc.name }}"
>
{{ _("Apply Now") }}</a
>
{% else %}
<a class='btn btn-primary'
href='/job_application/new?job_title={{ doc.name }}'>
{{ _("Apply Now") }}</a>
<a
class="btn btn-primary"
href="/job_application/new?job_title={{ doc.name }}"
>
{{ _("Apply Now") }}</a
>
{% endif %}
</div>
</div>

0 comments on commit a65b7d5

Please sign in to comment.