Skip to content

Commit 578dbe2

Browse files
fix: Show company currency in Employee advance summary report instead of default currency (#3417)
* fix: add currency option in advance amt & fetch currency from advance to show company currency saved in emp advance records * fix: add currency option in paid & claimed amount * fix: make company filter reqd --------- Co-authored-by: Nabin Hait <[email protected]>
1 parent 4a0de84 commit 578dbe2

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

hrms/hr/report/employee_advance_summary/employee_advance_summary.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ frappe.query_reports["Employee Advance Summary"] = {
2929
label: __("Company"),
3030
fieldtype: "Link",
3131
options: "Company",
32+
default: frappe.defaults.get_user_default("Company"),
33+
reqd: 1,
3234
},
3335
{
3436
fieldname: "status",

hrms/hr/report/employee_advance_summary/employee_advance_summary.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def execute(filters=None):
2828
advance.paid_amount,
2929
advance.claimed_amount,
3030
advance.status,
31+
advance.currency,
3132
]
3233
data.append(row)
3334

@@ -62,16 +63,32 @@ def get_columns():
6263
"label": _("Advance Amount"),
6364
"fieldname": "advance_amount",
6465
"fieldtype": "Currency",
66+
"options": "currency",
67+
"width": 120,
68+
},
69+
{
70+
"label": _("Paid Amount"),
71+
"fieldname": "paid_amount",
72+
"fieldtype": "Currency",
73+
"options": "currency",
6574
"width": 120,
6675
},
67-
{"label": _("Paid Amount"), "fieldname": "paid_amount", "fieldtype": "Currency", "width": 120},
6876
{
6977
"label": _("Claimed Amount"),
7078
"fieldname": "claimed_amount",
7179
"fieldtype": "Currency",
80+
"options": "currency",
7281
"width": 120,
7382
},
7483
{"label": _("Status"), "fieldname": "status", "fieldtype": "Data", "width": 120},
84+
{
85+
"label": _("Currency"),
86+
"fieldtype": "Link",
87+
"fieldname": "currency",
88+
"options": "Currency",
89+
"hidden": 1,
90+
"width": 120,
91+
},
7592
]
7693

7794

@@ -96,7 +113,7 @@ def get_advances(filters):
96113
conditions = get_conditions(filters)
97114
return frappe.db.sql(
98115
"""select name, employee, paid_amount, status, advance_amount, claimed_amount, company,
99-
posting_date, purpose
116+
posting_date, purpose, currency
100117
from `tabEmployee Advance`
101118
where docstatus<2 %s order by posting_date, name desc"""
102119
% conditions,

0 commit comments

Comments
 (0)