[UPDT] PAYROLL: Dashboard alignment, contract form help text and design updates
This commit is contained in:
@@ -139,7 +139,7 @@ class Contract(models.Model):
|
||||
)
|
||||
|
||||
contract_name = models.CharField(
|
||||
max_length=250, help_text=_("Contract Title"), verbose_name=_("Contract")
|
||||
max_length=250, help_text=_("Contract Title."), verbose_name=_("Contract")
|
||||
)
|
||||
employee_id = models.ForeignKey(
|
||||
Employee,
|
||||
@@ -221,8 +221,16 @@ class Contract(models.Model):
|
||||
)
|
||||
contract_document = models.FileField(upload_to="uploads/", null=True, blank=True)
|
||||
is_active = models.BooleanField(default=True)
|
||||
deduct_leave_from_basic_pay = models.BooleanField(
|
||||
default=True, verbose_name=_("Deduct From Basic Pay"), help_text=_("Take all the deduction from basic pay.")
|
||||
)
|
||||
notice_period_in_month = models.IntegerField(
|
||||
default=3,
|
||||
help_text="Notice period in total months.",
|
||||
validators=[min_zero],
|
||||
)
|
||||
calculate_daily_leave_amount = models.BooleanField(
|
||||
default=True, verbose_name=_("Calculate Daily Leave Amount")
|
||||
default=True, verbose_name=_("Calculate Daily Leave Amount"), help_text=_("Leave amount will be calculated by dividing the basic pay by number of working days.")
|
||||
)
|
||||
deduction_for_one_leave_amount = models.FloatField(
|
||||
null=True,
|
||||
@@ -230,14 +238,6 @@ class Contract(models.Model):
|
||||
default=0,
|
||||
verbose_name=_("Deduction For One Leave Amount"),
|
||||
)
|
||||
deduct_leave_from_basic_pay = models.BooleanField(
|
||||
default=True, verbose_name=_("Deduct From Basic Pay")
|
||||
)
|
||||
notice_period_in_month = models.IntegerField(
|
||||
default=3,
|
||||
help_text="Notice period in total months",
|
||||
validators=[min_zero],
|
||||
)
|
||||
|
||||
note = models.TextField(null=True, blank=True,max_length=255)
|
||||
created_at = models.DateTimeField(auto_now_add=True, null=True)
|
||||
|
||||
@@ -235,13 +235,17 @@ $(document).ready(function () {
|
||||
department_total = response.department_total;
|
||||
if (department_total.length != 0) {
|
||||
$("#department_total").html("");
|
||||
$("#department_total").show()
|
||||
$("#department_total_empty").hide()
|
||||
$.each(department_total, function (key, value) {
|
||||
$("#department_total").append(
|
||||
`<li class='m-3 department' style = 'cursor: pointer;''><span class='department_item'>${value["department"]}</span>: <span> ${value["amount"]}</span></li>`
|
||||
);
|
||||
});
|
||||
} else {
|
||||
$("#department_total").html(
|
||||
$("#department_total").hide()
|
||||
$("#department_total_empty").show()
|
||||
$("#department_total_empty").html(
|
||||
`<div style="display:flex;align-items: center;justify-content: center; padding-top:50px" class="">
|
||||
<div style="" class="">
|
||||
<img style="display: block;width: 70px;margin: 10px auto ;" src="/static/images/ui/money.png" class="" alt=""/>
|
||||
|
||||
@@ -19,23 +19,44 @@
|
||||
</div>
|
||||
|
||||
{% for field in form.visible_fields %}
|
||||
{% if field.name != 'contract_status' %}
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="oh-label__info" for="id_{{ field.name }}">
|
||||
<label class="oh-label" for="id_{{ field.name }}">{% trans field.label %}</label>
|
||||
{% if field.help_text != "" %}
|
||||
<span class="oh-info mr-2" title = "{{ field.help_text|safe }}">
|
||||
</span>
|
||||
|
||||
{% if field.name != 'contract_status' %}
|
||||
|
||||
{% if field.name == 'note' %}
|
||||
<div class="col-12 col-md-12">
|
||||
<div class="oh-label__info" for="id_{{ field.name }}">
|
||||
<label class="oh-label" for="id_{{ field.name }}">{% trans field.label %}</label>
|
||||
{% if field.help_text != "" %}
|
||||
<span class="oh-info mr-2" title = "{{ field.help_text|safe }}">
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if field.field.widget.input_type == "checkbox" %} {{ field.errors }}
|
||||
<div class="oh-switch" style="width: 30px">
|
||||
{{ field|add_class:"oh-switch__checkbox" }}
|
||||
</div>
|
||||
{% else %} {{ field|add_class:"form-control" }} {% endif %}
|
||||
{{field.errors}}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="oh-label__info" for="id_{{ field.name }}">
|
||||
<label class="oh-label" for="id_{{ field.name }}">{% trans field.label %}</label>
|
||||
{% if field.help_text != "" %}
|
||||
<span class="oh-info mr-2" title = "{{ field.help_text|safe }}">
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if field.field.widget.input_type == "checkbox" %} {{ field.errors }}
|
||||
<div class="oh-switch" style="width: 30px">
|
||||
{{ field|add_class:"oh-switch__checkbox" }}
|
||||
</div>
|
||||
{% else %} {{ field|add_class:"form-control" }} {% endif %}
|
||||
{{field.errors}}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if field.field.widget.input_type == "checkbox" %} {{ field.errors }}
|
||||
<div class="oh-switch" style="width: 30px">
|
||||
{{ field|add_class:"oh-switch__checkbox" }}
|
||||
</div>
|
||||
{% else %} {{ field|add_class:"form-control" }} {% endif %}
|
||||
{{field.errors}}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -147,7 +147,8 @@
|
||||
<h6 class="ms-4 m-2 fw-bold">{% trans "Total Amount :" %} <b>{{currency}} <span class="payslip-amount"></span></b></h6>
|
||||
<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: 260px; overflow-y: auto; list-style: disc;"></ul>
|
||||
<ul id="department_total" style="height: 286px; overflow-y: auto; list-style: disc;"></ul>
|
||||
<ul id="department_total_empty" style="height: 232px; overflow-y: auto; list-style: disc;"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user