fix(HR) : Filter Leave Type based on allocation for a particular employee (#22050)
* table was showing empty with just headers when no leaves allocated, fixed template code * added filters on Leave Type based on leave allocation for a particular employee and to/from dates
This commit is contained in:
parent
7544160374
commit
40694c98aa
@ -67,6 +67,13 @@ frappe.ui.form.on("Leave Application", {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
frm.dashboard.show();
|
frm.dashboard.show();
|
||||||
|
frm.set_query('leave_type', function(){
|
||||||
|
return {
|
||||||
|
filters : [
|
||||||
|
['leave_type_name', 'in', Object.keys(leave_details)]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
{% if data %}
|
{% if not jQuery.isEmptyObject(data) %}
|
||||||
<h5 style="margin-top: 20px;"> {{ __("Allocated Leaves") }} </h5>
|
<h5 style="margin-top: 20px;"> {{ __("Allocated Leaves") }} </h5>
|
||||||
<table class="table table-bordered small">
|
<table class="table table-bordered small">
|
||||||
<thead>
|
<thead>
|
||||||
@ -11,7 +11,6 @@
|
|||||||
<th style="width: 16%" class="text-right">{{ __("Pending Leaves") }}</th>
|
<th style="width: 16%" class="text-right">{{ __("Pending Leaves") }}</th>
|
||||||
<th style="width: 16%" class="text-right">{{ __("Available Leaves") }}</th>
|
<th style="width: 16%" class="text-right">{{ __("Available Leaves") }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for(const [key, value] of Object.entries(data)) { %}
|
{% for(const [key, value] of Object.entries(data)) { %}
|
||||||
@ -26,6 +25,6 @@
|
|||||||
{% } %}
|
{% } %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% } else { %}
|
{% else %}
|
||||||
<p style="margin-top: 30px;"> No Leaves have been allocated. </p>
|
<p style="margin-top: 30px;"> No Leaves have been allocated. </p>
|
||||||
{% } %}
|
{% endif %}
|
Loading…
x
Reference in New Issue
Block a user