[ADD] PAYROLL : Option to add the currency symbol as prefix or postfix from settings page (#339)

This commit is contained in:
Horilla
2024-09-18 15:44:01 +05:30
parent 9c7d3cfef5
commit 9e04372f6a
15 changed files with 486 additions and 158 deletions

View File

@@ -18,7 +18,11 @@ def default_currency(request):
settings.currency_symbol = "$"
settings.save()
symbol = models.PayrollSettings.objects.first().currency_symbol
return {"currency": request.session.get("currency", symbol)}
position = models.PayrollSettings.objects.first().position
return {
"currency": request.session.get("currency", symbol),
"position": request.session.get("position", position),
}
def host(request):

View File

@@ -18,9 +18,19 @@ from payroll.models.models import FilingStatus
class PayrollSettings(HorillaModel):
"""
Payroll settings model"""
Payroll settings model
"""
choices = [
("prefix", _("Prefix")),
("postfix", _("Postfix")),
]
currency_symbol = models.CharField(null=True, default="$", max_length=5)
position = models.CharField(
max_length=15, null=True, choices=choices, default="postfix"
)
company_id = models.ForeignKey(
Company, null=True, editable=False, on_delete=models.PROTECT
)

View File

@@ -36,17 +36,32 @@
{% if allowance.based_on == "basic_pay" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.rate}}% of {{allowance.get_based_on_display}}</span>
{% endif %}
{% if allowance.based_on == "attendance" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.per_attendance_fixed_amount}} {{currency}} {% trans "Amount Per Attendance" %}</span>
{% endif %}
{% if allowance.based_on == "shift_id" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.shift_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.shift_id}}</span>
{% endif %}
{% if allowance.based_on == "work_type_id" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.work_type_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.work_type_id}}</span>
{% endif %}
{% if allowance.based_on == "overtime" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.amount_per_one_hr}} {{currency}} {% trans "Amount Per One Hour" %}</span>
{% if position == "postfix" %}
{% if allowance.based_on == "attendance" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.per_attendance_fixed_amount}} {{currency}} {% trans "Amount Per Attendance" %}</span>
{% endif %}
{% if allowance.based_on == "shift_id" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.shift_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.shift_id}}</span>
{% endif %}
{% if allowance.based_on == "work_type_id" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.work_type_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.work_type_id}}</span>
{% endif %}
{% if allowance.based_on == "overtime" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.amount_per_one_hr}} {{currency}} {% trans "Amount Per One Hour" %}</span>
{% endif %}
{% else %}
{% if allowance.based_on == "attendance" %}
<span class="oh-timeoff-modal__stat-title">{{currency}} {{allowance.per_attendance_fixed_amount}} {% trans "Amount Per Attendance" %}</span>
{% endif %}
{% if allowance.based_on == "shift_id" %}
<span class="oh-timeoff-modal__stat-title"> {{currency}} {{allowance.shift_per_attendance_amount}} {% trans "Amount Per" %} {{allowance.shift_id}}</span>
{% endif %}
{% if allowance.based_on == "work_type_id" %}
<span class="oh-timeoff-modal__stat-title">{{currency}} {{allowance.work_type_per_attendance_amount}} {% trans "Amount Per" %} {{allowance.work_type_id}}</span>
{% endif %}
{% if allowance.based_on == "overtime" %}
<span class="oh-timeoff-modal__stat-title">{{currency}} {{allowance.amount_per_one_hr}} {% trans "Amount Per One Hour" %}</span>
{% endif %}
{% endif %}
{% endif %}

View File

@@ -76,17 +76,32 @@
{% if allowance.based_on == "basic_pay" %}
<span class="oh-timeoff-modal__stat-count">{{allowance.rate}}% of {{allowance.get_based_on_display}}</span>
{% endif %}
{% if allowance.based_on == "attendance" %}
<span class="oh-timeoff-modal__stat-count">{{allowance.per_attendance_fixed_amount}} {{currency}} {% trans "Amount Per Attendance" %}</span>
{% endif %}
{% if allowance.based_on == "shift_id" %}
<span class="oh-timeoff-modal__stat-count">{{allowance.shift_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.shift_id}}</span>
{% endif %}
{% if allowance.based_on == "work_type_id" %}
<span class="oh-timeoff-modal__stat-count">{{allowance.work_type_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.work_type_id}}</span>
{% endif %}
{% if allowance.based_on == "overtime" %}
<span class="oh-timeoff-modal__stat-count">{{allowance.amount_per_one_hr}} {{currency}} {% trans "Amount Per One Hour" %}</span>
{% if position == "postfix" %}
{% if allowance.based_on == "attendance" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.per_attendance_fixed_amount}} {{currency}} {% trans "Amount Per Attendance" %}</span>
{% endif %}
{% if allowance.based_on == "shift_id" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.shift_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.shift_id}}</span>
{% endif %}
{% if allowance.based_on == "work_type_id" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.work_type_per_attendance_amount}} {{currency}} {% trans "Amount Per" %} {{allowance.work_type_id}}</span>
{% endif %}
{% if allowance.based_on == "overtime" %}
<span class="oh-timeoff-modal__stat-title">{{allowance.amount_per_one_hr}} {{currency}} {% trans "Amount Per One Hour" %}</span>
{% endif %}
{% else %}
{% if allowance.based_on == "attendance" %}
<span class="oh-timeoff-modal__stat-title">{{currency}} {{allowance.per_attendance_fixed_amount}} {% trans "Amount Per Attendance" %}</span>
{% endif %}
{% if allowance.based_on == "shift_id" %}
<span class="oh-timeoff-modal__stat-title"> {{currency}} {{allowance.shift_per_attendance_amount}} {% trans "Amount Per" %} {{allowance.shift_id}}</span>
{% endif %}
{% if allowance.based_on == "work_type_id" %}
<span class="oh-timeoff-modal__stat-title">{{currency}} {{allowance.work_type_per_attendance_amount}} {% trans "Amount Per" %} {{allowance.work_type_id}}</span>
{% endif %}
{% if allowance.based_on == "overtime" %}
<span class="oh-timeoff-modal__stat-title">{{currency}} {{allowance.amount_per_one_hr}} {% trans "Amount Per One Hour" %}</span>
{% endif %}
{% endif %}
{% endif %}
</div>

View File

@@ -147,7 +147,11 @@
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable" >
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent" style = "cursor: default;">
<h6 class="ms-4 m-2 fw-bold">{% trans "Total Payslips Genarated :" %} <b><span class="payslip-number"></span></b></h6>
<h6 class="ms-4 m-2 fw-bold">{% trans "Total Amount :" %} <b>{{currency}} <span class="payslip-amount"></span></b></h6>
{% if position == "prefix" %}
<h6 class="ms-4 m-2 fw-bold">{% trans "Total Amount :" %} <b>{{currency}} <span class="payslip-amount"></span></b></h6>
{% else %}
<h6 class="ms-4 m-2 fw-bold">{% trans "Total Amount :" %} <b><span class="payslip-amount"></span> {{currency}}</b></h6>
{% endif %}
<h5 class="ms-4 m-2 fw-bold" style="color:#9C4000">{% trans "Department Total Amount" %}</h5>
<hr class="line">
<ul id="department_total" style="height: 286px; overflow-y: auto; list-style: disc;"></ul>

View File

@@ -33,13 +33,21 @@
<span class="oh-timeoff-modal__stat-title fw-bold text-dark mt-2 mb-1">{% trans "Amount" %}</span>
{% if deduction.update_compensation %}
{% if deduction.is_fixed %}
<span class="oh-timeoff-modal__stat-title">{{deduction.amount}}{{currency}} Deduct From {{deduction.get_update_compensation_display}}</span>
{% if position == "prefix" %}
<span class="oh-timeoff-modal__stat-title">{{currency}}{{deduction.amount}} {% trans "Deduct From" %} {{deduction.get_update_compensation_display}}</span>
{% else %}
<span class="oh-timeoff-modal__stat-title">{{deduction.amount}}{{currency}} {% trans "Deduct From" %} {{deduction.get_update_compensation_display}}</span>
{% endif %}
{% else %}
<span class="oh-timeoff-modal__stat-title">{{deduction.rate}}% {% trans "of" %} {{deduction.get_update_compensation_display}}</span>
{% endif %}
{% else %}
{% if deduction.is_fixed %}
{% if position == "prefix" %}
<span class="oh-timeoff-modal__stat-title ">{{currency}}{{deduction.amount}}</span>
{% else %}
<span class="oh-timeoff-modal__stat-title ">{{deduction.amount}}{{currency}}</span>
{% endif %}
{% else %}
<span class="oh-timeoff-modal__stat-title">{% trans "Employer Rate :" %} {{deduction.employer_rate}}% {% trans "of" %} {{deduction.get_based_on_display}}</span>
<span class="oh-timeoff-modal__stat-title">{% trans "Employee Rate :" %} {{deduction.rate}}% {% trans "of" %} {{deduction.get_based_on_display}}</span>

View File

@@ -70,15 +70,24 @@
<span class="oh-timeoff-modal__stat-title">{% trans "Amount" %}</span>
{% if deduction.update_compensation %}
{% if deduction.is_fixed %}
<span class="oh-timeoff-modal__stat-count">{{deduction.amount}}{{currency}} Deduct From
{% if position == "prefix" %}
<span class="oh-timeoff-modal__stat-count">{{currency}} {{deduction.amount}} {% trans "Deduct From" %}
{{deduction.get_update_compensation_display}}</span>
{% else %}
<span class="oh-timeoff-modal__stat-count">{{deduction.amount}} {{currency}} {% trans "Deduct From" %}
{{deduction.get_update_compensation_display}}</span>
{% endif %}
{% else %}
<span class="oh-timeoff-modal__stat-count">{{deduction.rate}}% {% trans "of" %}
{{deduction.get_update_compensation_display}}</span>
{% endif %}
{% else %}
{% if deduction.is_fixed %}
<span class="oh-timeoff-modal__stat-count">{{deduction.amount}}{{currency}}</span>
{% if position == "prefix" %}
<span class="oh-timeoff-modal__stat-count">{{currency}} {{deduction.amount}}</span>
{% else %}
<span class="oh-timeoff-modal__stat-count">{{deduction.amount}} {{currency}}</span>
{% endif %}
{% else %}
<span class="oh-timeoff-modal__stat-count">{% trans "Employer Rate :" %} {{deduction.employer_rate}}% {% trans "of" %} {{deduction.get_based_on_display}}</span>
<span class="oh-timeoff-modal__stat-count">{% trans "Employee Rate :" %} {{deduction.rate}}% {% trans "of" %} {{deduction.get_based_on_display}}</span>
@@ -90,7 +99,11 @@
<div class="oh-timeoff-modal__stat">
<span class="oh-timeoff-modal__stat-title">{% trans "Has Maximum Limit" %}</span>
{% if deduction.has_max_limit %}
<span class="oh-timeoff-modal__stat-count">{{deduction.maximum_amount}} {{currency}} {% trans "For working days on a month" %}</span>
{% if position == "prefix" %}
<span class="oh-timeoff-modal__stat-count">{{currency}} {{deduction.maximum_amount}} {% trans "For working days on a month" %}</span>
{% else %}
<span class="oh-timeoff-modal__stat-count">{{deduction.maximum_amount}} {{currency}} {% trans "For working days on a month" %}</span>
{% endif %}
{% else %}
<span class="oh-timeoff-modal__stat-count">{% trans "No" %}</span>
{% endif %}

View File

@@ -102,15 +102,27 @@
<div class="oh-sticky-table__td">
{{payslip.group_name}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% if position == "prefix" %}{% endif %}
<div class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% else %}
<div class="oh-sticky-table__td">
{{payslip.gross_pay|floatformat:2}} {{currency}}
</div>
<div class="oh-sticky-table__td">
{{payslip.deduction|floatformat:2}} {{currency}}
</div>
<div class="oh-sticky-table__td">
{{payslip.net_pay|floatformat:2}} {{currency}}
</div>
{% endif %}
<div class="oh-sticky-table__td">
<div class="oh-btn-group" >
<form action="{% url 'create-payslip' %}" style="display: inline;" method="post">

View File

@@ -141,15 +141,27 @@
<div data-cell-index="4" class="oh-sticky-table__td">
{{payslip.group_name}}
</div>
<div data-cell-index="5" class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div data-cell-index="6" class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div data-cell-index="7" class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% if position == "prefix" %}
<div data-cell-index="5" class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div data-cell-index="6" class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div data-cell-index="7" class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% else %}
<div data-cell-index="5" class="oh-sticky-table__td">
{{payslip.gross_pay|floatformat:2}} {{currency}}
</div>
<div data-cell-index="6" class="oh-sticky-table__td">
{{payslip.deduction|floatformat:2}} {{currency}}
</div>
<div data-cell-index="7" class="oh-sticky-table__td">
{{payslip.net_pay|floatformat:2}} {{currency}}
</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">

View File

@@ -97,15 +97,27 @@
{% endfor %}
</select>
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% if position == "prefix" %}
<div class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% else %}
<div class="oh-sticky-table__td">
{{payslip.gross_pay|floatformat:2}} {{currency}}
</div>
<div class="oh-sticky-table__td">
{{payslip.deduction|floatformat:2}} {{currency}}
</div>
<div class="oh-sticky-table__td">
{{payslip.net_pay|floatformat:2}} {{currency}}
</div>
{% endif %}
<div class="oh-sticky-table__td">
<div class="oh-btn-group">
<a href="{% url 'view-created-payslip' payslip.id %}" type="button" title="{% trans 'View' %}" class="oh-btn oh-btn--light-bkg w-50"> <ion-icon name="eye-outline"></ion-icon></a>

View File

@@ -51,16 +51,28 @@
<div class="oh-payslip__netpay" style="text-align:left; border-radius: 15px; border: 1px solid hsl(213,22%,84%);">
<div style="border-radius: 15px; background-color: #d2f8d7; padding: 10px; border-left: 3px solid #00cc66;">
<span class="oh-payslip__netpay-amount">{{ currency }}{{ net_pay|floatformat:2 }}</span>
{% if position == "prefix" %}
<span class="oh-payslip__netpay-amount">{{ currency }} {{ net_pay|floatformat:2 }}</span>
{% else %}
<span class="oh-payslip__netpay-amount">{{ net_pay|floatformat:2 }} {{ currency }}</span>
{% endif %}
<span class="oh-payslip__netpay-title">{% trans "Employee Net Pay" %}</span>
</div>
<div class="payslip__netpay__summary">
<span class="oh-payslip__netpay-title">{% trans "Actual Basic Pay" %} <small style="margin-left:36px; font-weight:bold;">: {{currency}} {{instance.contract_wage}}</small></span>
{% if position == "prefix" %}
<span class="oh-payslip__netpay-title">{% trans "Actual Basic Pay" %} <small style="margin-left:36px; font-weight:bold;">: {{currency}} {{instance.contract_wage}}</small></span>
{% else %}
<span class="oh-payslip__netpay-title">{% trans "Actual Basic Pay" %} <small style="margin-left:36px; font-weight:bold;">: {{instance.contract_wage}} {{currency}}</small></span>
{% endif %}
<span class="oh-payslip__netpay-title">{% trans "Paid Days" %} <small style="margin-left:86px;font-weight:bold;">: {{paid_days}}</small> </span>
<span class="oh-payslip__netpay-title">{% trans "LOP Days" %} <small style="margin-left:93px ;font-weight:bold;">: {{unpaid_days}}</small> </span>
<span class="oh-payslip__netpay-title">
{% trans "Updated Basic Pay" %}
<small style="margin-left:20px;font-weight:bold;">: {{currency}} {{basic_pay|floatformat:2}}
{% if position == "prefix" %}
<small style="margin-left:20px;font-weight:bold;">: {{currency}} {{basic_pay|floatformat:2}}
{% else %}
<small style="margin-left:20px;font-weight:bold;">: {{basic_pay|floatformat:2}} {{currency}}
{% endif %}
<br><i style="font-style: italic; margin-left: 10px; font-weight: normal;"><ion-icon name="information-circle-outline" style="color:blue;"></ion-icon>{% trans "The payslip is calculated based on the updated basic pay" %}</i>
@@ -98,16 +110,28 @@
>
{% trans "Basic Pay" %}
</td>
<td class="oh-payslip__table-td" colspan="2">
{{currency}}{{basic_pay|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td" colspan="2">
{{currency}} {{basic_pay|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td" colspan="2">
{{basic_pay|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% for allowance in allowances %}
<tr>
<td class="oh-payslip__table-td">{{allowance.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{allowance.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{allowance.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{allowance.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
@@ -119,9 +143,15 @@
>
{% trans "Total Gross Pay" %}
</th>
<th class="oh-payslip__table-tf">
{{currency}}{{gross_pay|floatformat:2}}
</th>
{% if position == "prefix" %}
<th class="oh-payslip__table-tf">
{{currency}} {{gross_pay|floatformat:2}}
</th>
{% else %}
<th class="oh-payslip__table-tf">
{{gross_pay|floatformat:2}} {{currency}}
</th>
{% endif %}
</tr>
</tfoot>
</table>
@@ -146,60 +176,108 @@
<tbody class="oh-payslip__table-tbody">
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{% trans "Loss of Pay" %}</td>
<td class="oh-payslip__table-td">
{{currency}}{{loss_of_pay|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{loss_of_pay|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{loss_of_pay|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% for deduction in basic_pay_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in gross_pay_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in pretax_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in post_tax_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{% trans "Federal Tax" %}</td>
<td class="oh-payslip__table-td">
{{currency}}{{federal_tax|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{federal_tax|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{federal_tax|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% for deduction in tax_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in net_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
@@ -211,9 +289,15 @@
>
{% trans "Total Deductions" %}
</th>
<th class="oh-payslip__table-tf">
{{currency}}{{total_deductions|floatformat:2}}
</th>
{% if position == "prefix" %}
<th class="oh-payslip__table-tf">
{{currency}} {{total_deductions|floatformat:2}}
</th>
{% else %}
<th class="oh-payslip__table-tf">
{{total_deductions|floatformat:2}} {{currency}}
</th>
{% endif %}
</tr>
</tfoot>
</table>
@@ -231,9 +315,11 @@
</p>
</div>
<div class="oh-payslip__net-payable-right">
<span class="oh-payslip__net-payable-amount"
>{{currency}}{{net_pay|floatformat:2}}</span
>
{% if position == "prefix" %}
<span class="oh-payslip__net-payable-amount">{{currency}} {{net_pay|floatformat:2}}</span>
{% else %}
<span class="oh-payslip__net-payable-amount">{{net_pay|floatformat:2}} {{currency}}</span>
{% endif %}
</div>
</div>
</div>

View File

@@ -87,9 +87,11 @@
<span class="oh-payslip__netpay-title"
>{% trans "Employee Net Pay :" %}</span
>
<span class="oh-payslip__netpay-amount"
>{{currency}}{{net_pay|floatformat:2}}</span
>
{% if position == "prefix" %}
<span class="oh-payslip__netpay-amount">{{currency}} {{net_pay|floatformat:2}}</span>
{% else %}
<span class="oh-payslip__netpay-amount">{{net_pay|floatformat:2}} {{currency}}</span>
{% endif %}
</div>
<div class="oh-payslip__user-detail">
<h3 class="oh-payslip__employee-title">
@@ -150,16 +152,28 @@
>
{% trans "Basic Pay" %}
</td>
<td class="oh-payslip__table-td">
{{currency}}{{basic_pay|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{basic_pay|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{basic_pay|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% for allowance in all_allowances %}
<tr>
<td class="oh-payslip__table-td">{{allowance.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{allowance.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{allowance.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{allowance.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
@@ -171,9 +185,15 @@
>
{% trans "Total Gross Pay" %}
</th>
<th class="oh-payslip__table-tf">
{{currency}}{{gross_pay|floatformat:2}}
</th>
{% if position == "prefix" %}
<th class="oh-payslip__table-tf">
{{currency}} {{gross_pay|floatformat:2}}
</th>
{% else %}
<th class="oh-payslip__table-tf">
{{gross_pay|floatformat:2}} {{currency}}
</th>
{% endif %}
</tr>
</tfoot>
</table>
@@ -188,69 +208,123 @@
<tbody class="oh-payslip__table-tbody">
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{% trans "Loss of Pay" %}</td>
<td class="oh-payslip__table-td">
{{currency}}{{loss_of_pay|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{loss_of_pay|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{loss_of_pay|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% for deduction in basic_pay_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td"><td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in gross_pay_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in pretax_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in post_tax_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{% trans "Federal Tax" %}</td>
<td class="oh-payslip__table-td">
{{currency}}{{federal_tax|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{federal_tax|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{federal_tax|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% for deduction in tax_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %} {% for deduction in net_deductions %}
<tr class="oh-payslip__table-tr">
<td class="oh-payslip__table-td">{{deduction.title}}</td>
<td class="oh-payslip__table-td">
{{currency}}{{deduction.amount|floatformat:2}}
</td>
{% if position == "prefix" %}
<td class="oh-payslip__table-td">
{{currency}} {{deduction.amount|floatformat:2}}
</td>
{% else %}
<td class="oh-payslip__table-td">
{{deduction.amount|floatformat:2}} {{currency}}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
<tfoot class="oh-payslip__table-tfoot">
<tr class="oh-payslip__table-tr">
<th class="oh-payslip__table-tf">{% trans "Total Deductions" %}</th>
<th class="oh-payslip__table-tf">
{{currency}}{{total_deductions|floatformat:2}}
</th>
{% if position == "prefix" %}
<th class="oh-payslip__table-tf">
{{currency}} {{total_deductions|floatformat:2}}
</th>
{% else %}
<th class="oh-payslip__table-tf">
{{total_deductions|floatformat:2}} {{currency}}
</th>
{% endif %}
</tr>
</tfoot>
</table>
@@ -268,9 +342,15 @@
>{% trans "Gross Earnings - Total Deductions" %}</span
>
</th>
<th class="oh-payslip__table-th" style="font-size: 14px">
{{currency}}{{net_pay|floatformat:2}}
</th>
{% if position == "prefix" %}
<th class="oh-payslip__table-th" style="font-size: 14px">
{{currency}} {{net_pay|floatformat:2}}
</th>
{% else %}
<th class="oh-payslip__table-th" style="font-size: 14px">
{{net_pay|floatformat:2}} {{currency}}
</th>
{% endif %}
</tr>
</thead>
</table>

View File

@@ -136,15 +136,27 @@
<div data-cell-index="4" class="oh-sticky-table__td">
{{payslip.group_name}}
</div>
<div data-cell-index="5" class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div data-cell-index="6" class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div data-cell-index="7" class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% if position == "prefix" %}
<div data-cell-index="5" class="oh-sticky-table__td">
{{currency}} {{payslip.gross_pay|floatformat:2}}
</div>
<div data-cell-index="6" class="oh-sticky-table__td">
{{currency}} {{payslip.deduction|floatformat:2}}
</div>
<div data-cell-index="7" class="oh-sticky-table__td">
{{currency}} {{payslip.net_pay|floatformat:2}}
</div>
{% else %}
<div data-cell-index="5" class="oh-sticky-table__td">
{{payslip.gross_pay|floatformat:2}} {{currency}}
</div>
<div data-cell-index="6" class="oh-sticky-table__td">
{{payslip.deduction|floatformat:2}} {{currency}}
</div>
<div data-cell-index="7" class="oh-sticky-table__td">
{{payslip.net_pay|floatformat:2}} {{currency}}
</div>
{% endif %}
{% 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 %}"

View File

@@ -5,11 +5,17 @@
<div class="oh-inner-sidebar-content__header mt-4">
<h2 class="oh-inner-sidebar-content__title">{% trans "Currency" %}</h2>
</div>
<div class="oh-label__info" for="currency_symbol">
{% comment %} <div class="oh-label__info" for="currency_symbol">
<label class="oh-label" for="currency_symbol">{% trans "Currency Symbol" %}</label>
</div>
<input type="text" name="currency_symbol" value="{{currency_form.instance.currency_symbol}}" maxlength="5" class="oh-input w-25" placeholder="Currency Symbol" required="" id="id_currency_symbol">
{% if perms.payroll.change_payrollsettings %}
<div class="oh-label__info" for="position">
<label class="oh-label" for="position">{% trans "Position" %}</label>
</div>
<span class="select2-selection--multiple w-25" >{{ currency_form.position }}</span>
{% if perms.payroll.change_payrollsettings %}
<button
style="display: inline;margin-left: 10px;"
type="submit"
@@ -17,6 +23,33 @@
>
{% trans "Save Changes" %}
</button>
{% endif %}
{% endif %} {% endcomment %}
<div>
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-3">
<div class="oh-input-group">
<div class="oh-label__info" for="currency_symbol">
<label class="oh-label" for="currency_symbol">{% trans "Currency Symbol" %}</label>
</div>
<input type="text" name="currency_symbol" value="{{currency_form.instance.currency_symbol}}" maxlength="5" class="oh-input w-100" placeholder="Currency Symbol" required="" id="id_currency_symbol">
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-3">
<div class="oh-input-group">
<div class="oh-label__info" for="position">
<label class="oh-label" for="position">{% trans "Position" %}</label>
</div>
<span class="select2-selection--multiple w-25" >{{ currency_form.position }}</span>
</div>
</div>
{% if perms.payroll.change_payrollsettings %}
<div class="d-flex align-items-end col-sm-12 col-md-12 col-lg-3">
<button type="submit" class="oh-btn oh-btn--secondary mt-2 mr-0 oh-btn--w-100-resp">{% trans 'Save Changes' %}</button>
</div>
{% endif %}
</div>
</div>
<div class="oh-inner-sidebar-content__footer"></div>
</form>

View File

@@ -26,12 +26,24 @@
<div class="oh-sticky-table__td">
{{ tax_bracket.tax_rate|stringformat:".2f" }}%
</div>
<div class="oh-sticky-table__td">
{{currency}}{{ tax_bracket.min_income|stringformat:".2f" }}
</div>
<div class="oh-sticky-table__td">
{{currency}}{{ tax_bracket.get_display_max_income|stringformat:".2f" }}
</div>
{% if position == "prefix" %}
<div class="oh-sticky-table__td">
{{currency}} {{ tax_bracket.min_income|stringformat:".2f" }}
</div>
{% else %}
<div class="oh-sticky-table__td">
{{ tax_bracket.min_income|stringformat:".2f" }} {{currency}}
</div>
{% endif %}
{% if position == "prefix" %}
<div class="oh-sticky-table__td">
{{currency}} {{ tax_bracket.get_display_max_income|stringformat:".2f" }}
</div>
{% else %}
<div class="oh-sticky-table__td">
{{ tax_bracket.get_display_max_income|stringformat:".2f" }} {{currency}}
</div>
{% endif %}
{% if perms.payroll.change_taxbracket %}
<div class="oh-sticky-table__td">
<div class="oh-btn-group">