-
Notifications
You must be signed in to change notification settings - Fork 715
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allocated Leaves Scedule on form dashboard
- Loading branch information
1 parent
8fd4da4
commit 078bc6d
Showing
2 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 9 additions & 19 deletions
28
hrms/hr/doctype/leave_allocation/leave_allocation_dashboard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
|
||
{% if not jQuery.isEmptyObject(data) %} | ||
{% if monthly_leaves %} | ||
<table class="table table-bordered small"> | ||
<thead> | ||
<tr> | ||
<th style="width: 16%">{{ __("Leave Type") }}</th> | ||
<th style="width: 16%" class="text-right">{{ __("Total Allocated Leaves") }}</th> | ||
<th style="width: 16%" class="text-right">{{ __("Expired Leaves") }}</th> | ||
<th style="width: 16%" class="text-right">{{ __("Used Leaves") }}</th> | ||
<th style="width: 16%" class="text-right">{{ __("Leaves Pending Approval") }}</th> | ||
<th style="width: 16%" class="text-right">{{ __("Available Leaves") }}</th> | ||
<th style="width: 50%">{{ __("Month") }}</th> | ||
<th style="width: 50%">{{ __("No. of Leaves") }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for(const [key, value] of Object.entries(data)) { %} | ||
{% let color = cint(value["remaining_leaves"]) > 0 ? "green" : "red" %} | ||
<tr> | ||
<td> {%= key %} </td> | ||
<td class="text-right"> {%= value["total_leaves"] %} </td> | ||
<td class="text-right"> {%= value["expired_leaves"] %} </td> | ||
<td class="text-right"> {%= value["leaves_taken"] %} </td> | ||
<td class="text-right"> {%= value["leaves_pending_approval"] %} </td> | ||
<td class="text-right" style="color: {{ color }}"> {%= value["remaining_leaves"] %} </td> | ||
</tr> | ||
{% for(const value of months) { %} {% %} | ||
<tr> | ||
<td>{%= value %}</td> | ||
<td>{%= monthly_leaves %}</td> | ||
</tr> | ||
{% } %} | ||
</tbody> | ||
</table> | ||
{% else %} | ||
<p style="margin-top: 30px;"> No Leave has been allocated. </p> | ||
<p style="margin-top: 30px">No Leave has been allocated.</p> | ||
{% endif %} |