[UPDT] PAYROLL : Payslip status permission updation in list view of employee instance

This commit is contained in:
Horilla
2024-04-09 10:05:31 +05:30
parent 405cffffd7
commit 30edcda2b3

View File

@@ -145,18 +145,24 @@
<div data-cell-index="7" class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
<div data-cell-index="3" class="oh-sticky-table__td" onclick="event.preventDefault();">
<select name="status" data-instance-id="{{payslip.id}}" hx-trigger="change" hx-post="{% url 'payslip-status-update' payslip.id %}"
hx-target="#payslips-table" hx-vals='{"view":"table"}'
style="color: hsl(0,0%,11%); background-color: transparent; border: none; height: 100%; border: 1px solid transparent;">
{% for opt in payslip.status_choices %}
<option value="{{opt.0}}"{% if opt.0 == payslip.status %}selected{% endif %}>{{opt.1}}</option>
{% endfor %}
</select>
</div>
<div class="oh-sticky-table__td oh-sticky-table__right"style="width: 251px !important;">
{% if perms.payroll.add_payslip %}
<div data-cell-index="3" class="oh-sticky-table__td" onclick="event.preventDefault();">
<select name="status" data-instance-id="{{payslip.id}}" hx-trigger="change" hx-post="{% url 'payslip-status-update' payslip.id %}"
hx-target="#payslips-table" hx-vals='{"view":"table"}'
style="color: hsl(0,0%,11%); background-color: transparent; border: none; height: 100%; border: 1px solid transparent;">
{% for opt in payslip.status_choices %}
<option value="{{opt.0}}"{% if opt.0 == payslip.status %}selected{% endif %}>{{opt.1}}</option>
{% endfor %}
</select>
</div>
{% else %}
<div data-cell-index="3" class="oh-sticky-table__td">
{{payslip.get_status_display}}
</div>
{% endif %}
<div class="oh-sticky-table__td oh-sticky-table__right"style="width: 251px !important;">
<div class="oh-btn-group">
<form action="{% url 'payslip-pdf' payslip.id %}" method='post' class="w-75">
<form action="{% url 'payslip-pdf' payslip.id %}" method='post' class="w-100">
{% csrf_token %}
<button type='submit' title="{% trans 'Download' %}" class="oh-btn oh-btn--light-bkg w-100"> <ion-icon name="download"></ion-icon></button>
</form>