[FIX] PAYROLL: Fixed contract sortby issues
This commit is contained in:
@@ -43,8 +43,8 @@
|
||||
</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Contract" %}</div>
|
||||
<div data-cell-index="1" data-cell-title='{% trans "Employee" %}'
|
||||
class="oh-sticky-table__th {% if request.sort_option.order == '-employee_id' %}arrow-up {% elif request.sort_option.order == 'employee_id' %}arrow-down {% else %} arrow-up-down {% endif %}"
|
||||
hx-target="#payroll-contract-container" hx-get="{% url 'contract-filter' %}?{{pd}}&orderby=employee_id"
|
||||
class="oh-sticky-table__th {% if request.sort_option.order == '-employee_id__employee_first_name' %}arrow-up {% elif request.sort_option.order == 'employee_id__employee_first_name' %}arrow-down {% else %} arrow-up-down {% endif %}"
|
||||
hx-target="#payroll-contract-container" hx-get="{% url 'contract-filter' %}?{{pd}}&orderby=employee_id__employee_first_name"
|
||||
>{% trans "Employee" %}</div>
|
||||
<div data-cell-index="2" data-cell-title='{% trans "Start Date" %}'
|
||||
class="oh-sticky-table__th {% if request.sort_option.order == '-contract_start_date' %}arrow-up {% elif request.sort_option.order == 'contract_start_date' %}arrow-down {% else %} arrow-up-down {% endif %}"
|
||||
|
||||
@@ -329,12 +329,12 @@ def contract_filter(request):
|
||||
template = "payroll/contract/group_by.html"
|
||||
|
||||
else:
|
||||
contracts = sortby(request, contracts, "orderby")
|
||||
contracts = paginator_qry(contracts, request.GET.get("page"))
|
||||
contract_ids_json = json.dumps(
|
||||
[instance.id for instance in contracts.object_list]
|
||||
)
|
||||
|
||||
contracts = sortby(request, contracts, "orderby")
|
||||
data_dict = parse_qs(query_string)
|
||||
get_key_instances(Contract, data_dict)
|
||||
keys_to_remove = [key for key, value in data_dict.items() if value == ["unknown"]]
|
||||
|
||||
Reference in New Issue
Block a user