[UPDT] PAYROLL: Updated payroll module by adding latest styles

This commit is contained in:
Horilla
2025-05-10 17:05:49 +05:30
parent ef0b700916
commit 3db7917273
11 changed files with 92 additions and 369 deletions

View File

@@ -454,7 +454,7 @@ def calculate_tax_deduction(*_args, **kwargs):
deductions.exclude(one_time_date__lt=start_date)
.exclude(one_time_date__gt=end_date)
.exclude(update_compensation__isnull=False)
).distinct()
)
deductions_amt = []
serialized_deductions = []
for deduction in deductions:
@@ -515,16 +515,14 @@ def calculate_pre_tax_deduction(*_args, **kwargs):
include_active_employees=True, is_pretax=True, is_tax=False
).exclude(exclude_employees=employee)
deductions = (
specific_deductions | conditional_deduction | active_employee_deduction
).distinct()
deductions = specific_deductions | conditional_deduction | active_employee_deduction
deductions = (
deductions.exclude(one_time_date__lt=start_date)
.exclude(one_time_date__gt=end_date)
.exclude(update_compensation__isnull=False)
)
# Installment deductions
installments = deductions.filter(is_installment=True).distinct()
installments = deductions.filter(is_installment=True)
pre_tax_deductions = []
pre_tax_deductions_amt = []
@@ -624,16 +622,14 @@ def calculate_post_tax_deduction(*_args, **kwargs):
active_employee_deduction = models.Deduction.objects.filter(
include_active_employees=True, is_pretax=False, is_tax=False
).exclude(exclude_employees=employee)
deductions = (
specific_deductions | conditional_deduction | active_employee_deduction
).distinct()
deductions = specific_deductions | conditional_deduction | active_employee_deduction
deductions = (
deductions.exclude(one_time_date__lt=start_date)
.exclude(one_time_date__gt=end_date)
.exclude(update_compensation__isnull=False)
)
# Installment deductions
installments = deductions.filter(is_installment=True).distinct()
installments = deductions.filter(is_installment=True)
post_tax_deductions = []
post_tax_deductions_amt = []
@@ -821,7 +817,7 @@ def calculate_based_on_gross_pay(*_args, **kwargs):
gross_pay = calculate_gross_pay(**kwargs)
rate = component.rate
amount = gross_pay["gross_pay"] * rate / 100
amount = compute_limit(component, amount,day_dict)
amount = compute_limit(component, amount, day_dict)
return amount
@@ -847,7 +843,7 @@ def calculate_based_on_taxable_gross_pay(*_args, **kwargs):
taxable_gross_pay = taxable_gross_pay["taxable_gross_pay"]
rate = component.rate
amount = taxable_gross_pay * rate / 100
amount = compute_limit(component, amount,day_dict)
amount = compute_limit(component, amount, day_dict)
return amount

View File

@@ -1,48 +0,0 @@
{% extends 'index.html' %} {% block content %} {% load i18n %} {% load static %}
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">{% trans "Allowances" %}</h1>
</div>
<div class="oh-main__titlebar oh-main__titlebar--right">
<div class="oh-main__titlebar-button-container">
<div class="oh-btn-group ml-2">
{% if perms.payroll.add_allowance %}
<div>
<a
class="oh-btn oh-btn--secondary oh-btn--shadow"
href="{% url 'create-allowance' %}"
>
<ion-icon
class="me-2 md hydrated"
name="add-outline"
role="img"
aria-label="add outline"
></ion-icon
>{% trans "Create" %}</a
>
</div>
{% endif %}
</div>
</div>
</div>
</section>
<div
class="oh-wrapper-main"
>
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style=" width: 190px;height: 190px;" src="{% static 'images/ui/allowance.png' %}" class="oh-404__image mb-4" alt="Page not found. 404."/>
<h5 class="oh-404__subtitle">{% trans "No allowance has been allocated." %}</h5>
</div>
</div>
</main>
</div>
</div>
{% endblock content %}

View File

@@ -114,17 +114,11 @@
{% include 'payroll/allowance/card_allowance.html' %}
{% endif %}
{% else %}
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style="width: 150px; height: 150px" src="{% static 'images/ui/payment.png' %}"
class="oh-404__image mb-4" alt="Page not found. 404." />
<h5 class="oh-404__subtitle">
{% trans "There are currently no allowances to consider." %}
</h5>
</div>
</div>
</main>
<div class="oh-empty">
<img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
<h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
<p class="oh-empty__subtitle">{% trans "There are currently no allowances to consider." %}</p>
</div>
{% endif %}
</div>
</div>

View File

@@ -132,13 +132,9 @@
{% endif %}
</div>
{% else %}
<div class="oh-modal__dialog-header">
<button type="button" class="oh-modal__close" data-dismiss="oh-modal" aria-label="Close" data-toggle="oh-modal-toggle">
<ion-icon name="close-outline"></ion-icon>
</button>
<img style="width: 150px; height: 150px;margin-left: 30%;" src="{% static 'images/ui/payment.png' %}" class="oh-404__image mb-4" alt="Page not found. 404."/>
<h5 class="oh-404__subtitle">
{% trans "There are currently no allowances to consider." %}
</h5>
<div class="oh-empty">
<img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
<h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
<p class="oh-empty__subtitle">{% trans "There are currently no allowances to consider." %}</p>
</div>
{% endif %}

View File

@@ -1,54 +1,29 @@
{% extends 'index.html' %} {% block content %} {% load static %} {% load i18n %}
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<section class="oh-wrapper oh-main__topbar">
<div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">{% trans "Contracts" %}</h1>
<a
class="oh-main__titlebar-search-toggle"
role="button"
aria-label="Toggle Search"
@click="searchShow = !searchShow"
>
<ion-icon
name="search-outline"
class="oh-main__titlebar-serach-icon"
></ion-icon>
</a>
<h1 class="oh-main__titlebar-title fw-bold">{% trans "Contracts" %}</h1>
</div>
<div class="oh-main__titlebar oh-main__titlebar--right">
<div class="oh-main__titlebar-button-container">
<div class="oh-btn-group ml-2">
{% if perms.payroll.add_contract %}
<div>
<a
class="oh-btn oh-btn--secondary oh-btn--shadow"
href="{% url 'contract-create' %}"
>
<ion-icon class="me-2" name="add-outline"></ion-icon>
{% trans "Create" %}
</a>
<div class="oh-main__titlebar-button-container">
<div class="oh-btn-group ml-2">
{% if perms.payroll.add_contract %}
<div>
<a class="oh-btn oh-btn--secondary oh-btn--shadow" href="{% url 'contract-create' %}">
<ion-icon class="me-2" name="add-outline"></ion-icon>
{% trans "Create" %}
</a>
</div>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</section>
</main>
</section>
<div
class="oh-wrapper-main"
>
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style=" width: 190px;height: 190px;" src="{% static 'images/ui/no_request.png' %}" class="oh-404__image mb-4" alt="Page not found. 404."/>
<h5 class="oh-404__subtitle">{% trans "There have been no contracts signed." %}</h5>
</div>
</div>
</main>
</div>
<div class="oh-empty">
<img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
<h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
<p class="oh-empty__subtitle">{% trans "There have been no contracts signed." %}</p>
</div>
{% endblock content %}

View File

@@ -1,50 +0,0 @@
{% extends 'index.html' %} {% block content %} {% load i18n %} {% load static %}
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">{% trans "Deductions" %}</h1>
</div>
<div class="oh-main__titlebar oh-main__titlebar--right">
<div class="oh-main__titlebar-button-container">
<div class="oh-btn-group ml-2">
{% if perms.payroll.add_deduction %}
<div>
<a
class="oh-btn oh-btn--secondary oh-btn--shadow"
data-toggle="oh-modal-toggle"
data-target="#deductionModal"
href="{% url 'create-deduction' %}"
>
<ion-icon
class="me-2 md hydrated"
name="add-outline"
role="img"
aria-label="add outline"
></ion-icon
>{% trans "Create" %}</a
>
</div>
{% endif %}
</div>
</div>
</div>
</section>
<div
class="oh-wrapper-main"
>
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style=" width: 190px;height: 190px;" src="{% static 'images/ui/deduction.png' %}" class="oh-404__image mb-4" alt="Page not found. 404."/>
<h5 class="oh-404__subtitle">{% trans "No deduction has been included." %}</h5>
</div>
</div>
</main>
</div>
</div>
{% endblock content %}

View File

@@ -110,17 +110,11 @@
{% include 'payroll/deduction/card_deduction.html' %}
{% endif %}
{% else %}
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style="width: 150px; height: 150px" src="{% static 'images/ui/deduction_icon.png' %}"
class="oh-404__image mb-4" alt="Page not found. 404." />
<h5 class="oh-404__subtitle">
{% trans "There are currently no deductions to consider." %}
</h5>
</div>
</div>
</main>
<div class="oh-empty">
<img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
<h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
<p class="oh-empty__subtitle">{% trans "There are currently no deductions to consider." %}</p>
</div>
{% endif %}
</div>
</div>

View File

@@ -1,51 +0,0 @@
{% extends 'index.html' %} {% block content %} {% load static %}{% load i18n %}
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">{% trans "Payslip" %}</h1>
</div>
<div class="oh-main__titlebar-button-container">
{% if perms.payroll.add_payslip %}
<div class="oh-btn-group ml-2">
<div class="oh-dropdown" x-data="{open: false}">
<button class="oh-btn oh-btn--dropdown " @click="open = !open" @click.outside="open = false">
{% trans "Actions" %}
</button>
<div class="oh-dropdown__menu oh-dropdown__menu--right" x-show="open" style="display: none; cursor:pointer;">
<ul class="oh-dropdown__items">
<li class="oh-dropdown__item">
<a class="oh-dropdown__link" data-toggle="oh-modal-toggle" data-target="#objectCreateModal"
hx-get="{% url 'generate-payslip' %}" hx-target="#objectCreateModalTarget">
{% trans "Generate" %}
</a>
</li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if perms.payroll.add_payslip %}
<div class="oh-btn-group ml-2">
<div>
<a class="oh-btn oh-btn--secondary oh-btn--shadow" data-toggle="oh-modal-toggle"
data-target="#objectCreateModal" hx-get="{% url 'create-payslip' %}"
hx-target="#objectCreateModalTarget">
<ion-icon class="me-2 md hydrated" name="add-outline" role="img" aria-label="add outline"></ion-icon>
{% trans "Create" %}
</a>
</div>
</div>
{% endif %}
</div>
</section>
<div class="oh-wrapper-main">
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style="width: 190px;height: 190px;" src="{% static 'images/ui/no-money.png' %}" class="oh-404__image mb-4" alt="Page not found. 404." />
<h5 class="oh-404__subtitle">{% trans "No payslips have been generated." %}</h5>
</div>
</div>
</main>
</div>
{% endblock content %}

View File

@@ -264,21 +264,11 @@
</div>
</div>
{% else %}
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img
style="width: 150px; height: 150px"
src="{% static 'images/ui/salary.png' %}"
class="oh-404__image mb-4"
alt="Page not found. 404."
/>
<h5 class="oh-404__subtitle">
{% trans "There are currently no payslips to consider." %}
</h5>
</div>
<div class="oh-empty">
<img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
<h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
<p class="oh-empty__subtitle">{% trans "No payslips have been generated." %}</p>
</div>
</main>
{% endif %}
<div id="messageContainer"></div>

View File

@@ -1,42 +0,0 @@
{% extends 'index.html' %}
{% block content %}
{% load i18n %}
{% load static %}
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">{% trans "Filing Status" %}</h1>
</div>
<div class="oh-main__titlebar oh-main__titlebar--right">
<div class="oh-main__titlebar-button-container">
<div class="oh-btn-group ml-2">
<div>
<a class="oh-btn oh-btn--secondary oh-btn--shadow"
data-toggle="oh-modal-toggle"
data-target="#objectCreateModal"
hx-get = "{% url 'create-filing-status' %}"
hx-target="#objectCreateModalTarget"
>
<ion-icon class="me-2" name="add-outline"></ion-icon>{% trans "Create" %}</a>
</div>
</div>
</div>
</main>
<div
class="oh-wrapper-main"
>
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<div class="oh-wrapper">
<div class="oh-404">
<img style=" width: 190px;height: 190px;" src="{% static 'images/ui/tax.png' %}" class="oh-404__image mb-4" alt="Page not found. 404."/>
<h5 class="oh-404__subtitle">{% trans "No tax filing status has been recorded." %}</h5>
</div>
</div>
</main>
</div>
</div>
{% endblock content %}

View File

@@ -1,91 +1,60 @@
{% extends 'index.html' %} {% block content %} {% load static %} {% load i18n %}
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">
{% trans "Filing Status" %}
</h1>
<a
class="oh-main__titlebar-search-toggle"
role="button"
aria-label="Toggle Search"
@click="searchShow = !searchShow"
>
<ion-icon
name="search-outline"
class="oh-main__titlebar-serach-icon"
></ion-icon>
</a>
</div>
<div class="oh-main__titlebar oh-main__titlebar--right">
{% if status %}
<div
class="oh-input-group oh-input__search-group"
:class="searchShow ? 'oh-input__search-group--show' : ''"
>
<ion-icon
name="search-outline"
class="oh-input-group__icon oh-input-group__icon--left"
></ion-icon>
<input
name="search"
type="text"
class="oh-input oh-input__icon"
aria-label="Search Input"
placeholder="{% trans 'Search' %}"
hx-get="{% url 'filing-status-search' %}"
hx-target="#FilingStatusList"
hx-trigger="keyup delay:500ms"
/>
</div>
{% endif %} {% if perms.payroll.add_filingstatus %}
<div class="oh-main__titlebar-button-container">
<div class="oh-btn-group ml-2">
<div>
<a
class="oh-btn oh-btn--secondary oh-btn--shadow"
data-toggle="oh-modal-toggle"
data-target="#objectCreateModal"
hx-get="{% url 'create-filing-status' %}"
hx-target="#objectCreateModalTarget"
>
<ion-icon name="add-outline"></ion-icon>
{% trans "Create" %}
<section class="oh-wrapper oh-main__topbar" x-data="{searchShow: false}">
<div class="oh-main__titlebar oh-main__titlebar--left">
<h1 class="oh-main__titlebar-title fw-bold">
{% trans "Filing Status" %}
</h1>
<a class="oh-main__titlebar-search-toggle" role="button" aria-label="Toggle Search"
@click="searchShow = !searchShow">
<ion-icon name="search-outline" class="oh-main__titlebar-serach-icon"></ion-icon>
</a>
</div>
</div>
</div>
{% endif %}
<div class="oh-main__titlebar oh-main__titlebar--right">
{% if status %}
<div class="oh-input-group oh-input__search-group"
:class="searchShow ? 'oh-input__search-group--show' : ''">
<ion-icon name="search-outline" class="oh-input-group__icon oh-input-group__icon--left"></ion-icon>
<input name="search" type="text" class="oh-input oh-input__icon" aria-label="Search Input"
placeholder="{% trans 'Search' %}" hx-get="{% url 'filing-status-search' %}"
hx-target="#FilingStatusList" hx-trigger="keyup delay:500ms" />
</div>
{% endif %}
{% if perms.payroll.add_filingstatus %}
<div class="oh-main__titlebar-button-container">
<div class="oh-btn-group ml-2">
<div>
<a class="oh-btn oh-btn--secondary oh-btn--shadow" data-toggle="oh-modal-toggle"
data-target="#objectCreateModal" hx-get="{% url 'create-filing-status' %}"
hx-target="#objectCreateModalTarget">
<ion-icon name="add-outline"></ion-icon>
{% trans "Create" %}
</a>
</div>
</div>
</div>
{% endif %}
</div>
</section>
<div id="FilingStatusList" class="oh-wrapper">
{% if status %}
{% include 'payroll/tax/filing_status_list.html' %}
{% else %}
<div class="oh-empty">
<img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
<h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
<p class="oh-empty__subtitle">{% trans "No tax filing status has been recorded." %}</p>
</div>
{% endif %}
</div>
</section>
<div id="FilingStatusList" class="oh-wrapper">
{% if status %}
{% include 'payroll/tax/filing_status_list.html' %}
{% else %}
<div class="oh-wrapper">
<div class="oh-404">
<img
style="width: 190px; height: 190px"
src="{% static 'images/ui/tax.png' %}"
class="oh-404__image mb-4"
alt="Page not found. 404."
/>
<h5 class="oh-404__subtitle">
{% trans "No tax filing status has been recorded." %}
</h5>
</div>
</div>
{% endif %}
</div>
</main>
<script>
$(document).ready(function () {
$(".oh-accordion-meta__header").click(function () {
var target = $(this).data("target");
$(this).toggleClass("oh-accordion-meta__header--show");
$(target).toggleClass("d-none");
$(document).ready(function () {
$(".oh-accordion-meta__header").click(function () {
var target = $(this).data("target");
$(this).toggleClass("oh-accordion-meta__header--show");
$(target).toggleClass("d-none");
});
});
});
</script>
{% endblock content %}