fix: populate FIN from Employee.passport_number
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ff629e7124
commit
cc55c02999
|
|
@ -137,11 +137,19 @@ def get_aggregated_employee_data(company, from_date, to_date):
|
||||||
agg["total_deduction"] += flt(ss.total_deduction)
|
agg["total_deduction"] += flt(ss.total_deduction)
|
||||||
agg["net_pay"] += flt(ss.net_pay)
|
agg["net_pay"] += flt(ss.net_pay)
|
||||||
|
|
||||||
|
# Get FIN (passport_number) from Employee doctype
|
||||||
|
employee_ids = list(employee_map.keys())
|
||||||
|
fin_map = {}
|
||||||
|
if employee_ids:
|
||||||
|
fin_data = frappe.get_all("Employee", filters={"name": ["in", employee_ids]}, fields=["name", "passport_number"])
|
||||||
|
fin_map = {d.name: d.passport_number for d in fin_data}
|
||||||
|
|
||||||
# Build child table rows with original fieldnames
|
# Build child table rows with original fieldnames
|
||||||
result = []
|
result = []
|
||||||
for agg in employee_map.values():
|
for agg in employee_map.values():
|
||||||
child_row = {
|
child_row = {
|
||||||
"soyadadataadı": agg["employee_name"],
|
"soyadadataadı": agg["employee_name"],
|
||||||
|
"fin": fin_map.get(agg["employee"], ""),
|
||||||
"gəlirlərcəmi": agg["gross_pay"],
|
"gəlirlərcəmi": agg["gross_pay"],
|
||||||
# vergiməbləği intentionally not filled
|
# vergiməbləği intentionally not filled
|
||||||
"hesablanmışmdsshaqqı": (flt(agg.get(_DSMF_ISCI, 0)) + flt(agg.get(_DSMF_SIRKET, 0))) * 3,
|
"hesablanmışmdsshaqqı": (flt(agg.get(_DSMF_ISCI, 0)) + flt(agg.get(_DSMF_SIRKET, 0))) * 3,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue