Skip to content

Commit b4ec901

Browse files
Análisis del submódulo de Asistencia, Vacaciones y Rendimiento de gastos (#780)
* trans: translations * feat: dominio HR Asistencia, Vacaciones y Rendimiento de Gastos * feat: desocultamiento * feat: solicitud de viaje * trans: leave application * trans; * trans * fix: Earned Leave allocation from Leave Policy Assignment * trans * trans * trans * trans * Issue 560 refactor employee leave balance (#787) * refactor: Employee Leave Balance Report - incorrect opening balance on boundary allocation dates - carry forwarded leaves accounted in leaves allocated column, should be part of opening balance - leaves allocated column also adds expired leave allocations causing negative balances, should only consider non-expiry records (cherry picked from commit 538b64b) * fix: expired leaves not calculated properly because of newly created expiry ledger entries (cherry picked from commit 1ea749c) * refactor: Leaves Taken calculation - fix issue where Leaves Taken also adds leaves expiring on boundary date as leaves taken, causing ambiguity - remove unnecessary `skip_expiry_leaves` function - `get_allocation_expiry` considering cancelled entries too (cherry picked from commit 26b40e7) * refactor: balance in Balance Summary report near allocation expiry date - Leave Balance shows minimum leaves remaining after comparing with remaining days for allocation expiry causing ambiguity - refactor remaining leaves calculation to return both, actual leave balance and balance for consumption - show actual balance in leave application, use balance for consumption only in validations (cherry picked from commit 55ac851) * fix: sort imports, sider issues (cherry picked from commit b5c686a) * fix: show actual balance instead of consumption balance in opening balance - not changing opening balance based on remaining days (cherry picked from commit dbfa463) * test: employee leave balance report - fix expired leaves calculation when filters span across 2 different allocation periods (cherry picked from commit c050ce4) * chore: remove unused imports, sort imports, fix sider (cherry picked from commit c7d5949) * test: Employee Leave Balance Summary (cherry picked from commit 88141d6) * fix: leave application dashboard - total leaves allocated considering cancelled leaves - optional plural for leave category labels - show dashboard only once from date is set, else it fetches all allocations till date and generates incorrect balance - change pending leaves to 'Leaves Pending Approval' for better context - update labels in Salary Slip Leave Details table (cherry picked from commit 942511c) * fix: earned leave policy assignment test (cherry picked from commit aaa1ae9) * test: fix test `test_leave_balance_near_allocaton_expiry` (cherry picked from commit a58dfec) * test: get leave details for leave application dashboard (cherry picked from commit 3f3b176) * fix: add type hints for employee leave balance report (cherry picked from commit 430bf00) * feat: split ledger entries for applications created across allocations - fix: ledger entry for expiring cf leaves not considering holidays (cherry picked from commit c0f1e26) * fix: clearer validation/warning messages for insufficient balance in leave application (cherry picked from commit a504ffc) * test: leave application validations (cherry picked from commit 6755d6e) * fix: boundary determination for separate ledger entries (cherry picked from commit 7023915) * test: separate leave ledger entries for leave applications across allocations (cherry picked from commit 97b7b50) * chore: linter issue (cherry picked from commit 921d6b2) --------- Co-authored-by: Rucha Mahabal <[email protected]> --------- Co-authored-by: Rucha Mahabal <[email protected]>
1 parent 67b1668 commit b4ec901

File tree

63 files changed

+1321
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1321
-335
lines changed

erpnext/domains/hr_asistencia_vacaciones.py renamed to erpnext/domains/hr_asistencia_vacaciones_rendimiento_gastos.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
data = {
44
'modules': [
5-
'HR Asistencia y Vacaciones'
5+
'HR Asistencia, Vacaciones y Rendimiento de Gastos'
66
],
77
}

erpnext/domains/hr_reclutamiento_capacitacion_gastos.py

-7
This file was deleted.

erpnext/education/doctype/student_attendance/student_attendance.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def validate_is_holiday(self):
9292
frappe.bold(formatdate(self.date))))
9393

9494
def get_holiday_list(company=None):
95-
if not frappe.db.exists("Has Domain", {"domain": 'HR Asistencia y Vacaciones'}):
95+
if not frappe.db.exists("Has Domain", {"domain": 'HR Asistencia, Vacaciones y Rendimiento de Gastos'}):
9696
return None
9797

9898
if not company:

erpnext/hooks.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@
115115
'RMA': 'erpnext.domains.rma',
116116
'Retail Avanzado': 'erpnext.domains.retail_avanzado',
117117
'Servicios Google': 'erpnext.domains.servicios_google',
118-
'HR Asistencia y Vacaciones': 'erpnext.domains.hr_asistencia_vacaciones',
119-
'HR Reclutamiento, Capacitacion y Gastos': 'erpnext.domains.hr_reclutamiento_capacitacion_gastos',
120118
'Build': 'erpnext.domains.build',
121119
'Pagos360': 'erpnext.domains.pagos360',
122120
'Mercadolibre': 'erpnext.domains.mercadolibre',
@@ -128,7 +126,8 @@
128126
'Compreahora': 'erpnext.domains.compreahora',
129127
'Usuario de Ventas Reducido': 'erpnext.domains.usuario_ventas_reducido',
130128
'Usuario de Soporte Reducido': 'erpnext.domains.usuario_soporte_reducido',
131-
'Usuario de Proyecto Reducido':'erpnext.domains.usuario_proyecto_reducido',
129+
'Usuario de Proyecto Reducido': 'erpnext.domains.usuario_proyecto_reducido',
130+
'HR Asistencia, Vacaciones y Rendimiento de Gastos': 'erpnext.domains.hr_asistencia_vacaciones_rendimiento_gastos',
132131
}
133132

134133
website_generators = ["Item Group", "Website Item", "BOM", "Sales Partner",

erpnext/hr/doctype/appraisal/appraisal.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"index_web_pages_for_search": 1,
202202
"is_submittable": 1,
203203
"links": [],
204-
"modified": "2021-05-12 20:01:58.902166",
204+
"modified": "2021-05-12 21:01:58.902166",
205205
"modified_by": "Administrator",
206206
"module": "HR",
207207
"name": "Appraisal",
@@ -246,7 +246,7 @@
246246
"write": 1
247247
}
248248
],
249-
"restrict_to_domain": "HR Reclutamiento, Capacitacion y Gastos",
249+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
250250
"search_fields": "status, employee, employee_name",
251251
"sort_field": "modified",
252252
"sort_order": "DESC",

erpnext/hr/doctype/appraisal_template/appraisal_template.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"icon": "icon-file-text",
4747
"idx": 1,
4848
"links": [],
49-
"modified": "2021-05-12 20:01:59.271381",
49+
"modified": "2021-05-12 21:01:59.271381",
5050
"modified_by": "Administrator",
5151
"module": "HR",
5252
"name": "Appraisal Template",
@@ -67,7 +67,7 @@
6767
"role": "Employee"
6868
}
6969
],
70-
"restrict_to_domain": "HR Reclutamiento, Capacitacion y Gastos",
70+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
7171
"sort_field": "modified",
7272
"sort_order": "DESC"
7373
}

erpnext/hr/doctype/attendance/attendance.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"idx": 1,
206206
"is_submittable": 1,
207207
"links": [],
208-
"modified": "2021-05-12 20:01:54.473452",
208+
"modified": "2021-05-12 21:01:54.473452",
209209
"modified_by": "Administrator",
210210
"module": "HR",
211211
"name": "Attendance",
@@ -253,7 +253,7 @@
253253
"write": 1
254254
}
255255
],
256-
"restrict_to_domain": "HR Asistencia y Vacaciones",
256+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
257257
"search_fields": "employee,employee_name,attendance_date,status",
258258
"sort_field": "modified",
259259
"sort_order": "DESC",

erpnext/hr/doctype/attendance_request/attendance_request.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
],
120120
"is_submittable": 1,
121121
"links": [],
122-
"modified": "2021-05-12 20:01:54.807226",
122+
"modified": "2021-05-12 21:01:54.807226",
123123
"modified_by": "Administrator",
124124
"module": "HR",
125125
"name": "Attendance Request",
@@ -183,7 +183,7 @@
183183
"write": 1
184184
}
185185
],
186-
"restrict_to_domain": "HR Asistencia y Vacaciones",
186+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
187187
"sort_field": "modified",
188188
"sort_order": "DESC",
189189
"title_field": "employee_name",

erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
],
115115
"is_submittable": 1,
116116
"links": [],
117-
"modified": "2021-05-12 20:01:53.391272",
117+
"modified": "2021-05-12 21:01:53.391272",
118118
"modified_by": "Administrator",
119119
"module": "HR",
120120
"name": "Compensatory Leave Request",
@@ -172,7 +172,7 @@
172172
"write": 1
173173
}
174174
],
175-
"restrict_to_domain": "HR Asistencia y Vacaciones",
175+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
176176
"sort_field": "modified",
177177
"sort_order": "DESC",
178178
"title_field": "employee_name",

erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
}
6666
],
6767
"links": [],
68-
"modified": "2021-05-12 20:01:56.379840",
68+
"modified": "2021-05-12 21:01:56.379840",
6969
"modified_by": "Administrator",
7070
"module": "HR",
7171
"name": "Daily Work Summary Group",
@@ -85,7 +85,7 @@
8585
}
8686
],
8787
"quick_entry": 1,
88-
"restrict_to_domain": "HR Asistencia y Vacaciones",
88+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
8989
"sort_field": "modified",
9090
"sort_order": "DESC"
9191
}

erpnext/hr/doctype/department/department.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"description": "Days for which Holidays are blocked for this department.",
7474
"fieldname": "leave_block_list",
7575
"fieldtype": "Link",
76-
"hidden": 1,
7776
"in_list_view": 1,
7877
"label": "Leave Block List",
7978
"options": "Leave Block List"
@@ -145,7 +144,7 @@
145144
"idx": 1,
146145
"is_tree": 1,
147146
"links": [],
148-
"modified": "2023-01-09 14:57:33.875494",
147+
"modified": "2023-07-31 12:58:08.462456",
149148
"modified_by": "Administrator",
150149
"module": "HR",
151150
"name": "Department",

erpnext/hr/doctype/department_approver/department_approver.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ def get_approvers(doctype, txt, searchfield, start, page_len, filters):
4444

4545
if filters.get("doctype") == "Leave Application":
4646
parentfield = "leave_approvers"
47-
field_name = "Leave Approver"
47+
field_name = _("Leave Approver")
4848
elif filters.get("doctype") == "Expense Claim":
4949
parentfield = "expense_approvers"
50-
field_name = "Expense Approver"
50+
field_name = _("Expense Approver")
5151
elif filters.get("doctype") == "Shift Request":
5252
parentfield = "shift_request_approver"
53-
field_name = "Shift Request Approver"
53+
field_name = _("Shift Request Approver")
5454
if department_list:
5555
for d in department_list:
5656
approvers += frappe.db.sql("""select user.name, user.first_name, user.last_name from
@@ -63,7 +63,8 @@ def get_approvers(doctype, txt, searchfield, start, page_len, filters):
6363
if len(approvers) == 0:
6464
error_msg = _("Please set {0} for the Employee: {1}").format(field_name, frappe.bold(employee.employee_name))
6565
if department_list:
66-
error_msg += _(" or for Department: {0}").format(frappe.bold(employee_department))
67-
frappe.throw(error_msg, title=_(field_name + " Missing"))
66+
error_msg += " " + _("or for Department: {0}").format(frappe.bold(employee_department))
67+
frappe.throw(error_msg, title=_("{0} Missing").format(field_name))
68+
6869

6970
return set(tuple(approver) for approver in approvers)

erpnext/hr/doctype/employee/employee.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,6 @@
756756
"collapsible": 1,
757757
"fieldname": "attendance_and_leave_details",
758758
"fieldtype": "Section Break",
759-
"hidden": 1,
760759
"label": "Attendance and Leave Details"
761760
},
762761
{
@@ -829,7 +828,7 @@
829828
"idx": 24,
830829
"image_field": "image",
831830
"links": [],
832-
"modified": "2022-08-11 15:28:59.782180",
831+
"modified": "2023-07-31 12:56:37.591515",
833832
"modified_by": "Administrator",
834833
"module": "HR",
835834
"name": "Employee",

erpnext/hr/doctype/employee_advance/employee_advance.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"amended_from",
3131
"column_break_18",
3232
"advance_account",
33-
"mode_of_payment"
33+
"mode_of_payment",
34+
"travel_request"
3435
],
3536
"fields": [
3637
{
@@ -196,11 +197,18 @@
196197
"precision": "9",
197198
"print_hide": 1,
198199
"reqd": 1
200+
},
201+
{
202+
"fieldname": "travel_request",
203+
"fieldtype": "Link",
204+
"label": "Travel Request",
205+
"options": "Travel Request",
206+
"read_only": 1
199207
}
200208
],
201209
"is_submittable": 1,
202210
"links": [],
203-
"modified": "2021-09-11 18:38:38.617478",
211+
"modified": "2023-08-01 08:07:59.242651",
204212
"modified_by": "Administrator",
205213
"module": "HR",
206214
"name": "Employee Advance",
@@ -233,7 +241,7 @@
233241
"write": 1
234242
}
235243
],
236-
"restrict_to_domain": "HR Reclutamiento, Capacitacion y Gastos",
244+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
237245
"search_fields": "employee,employee_name",
238246
"sort_field": "modified",
239247
"sort_order": "DESC",

erpnext/hr/doctype/employee_advance/employee_advance.py

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def validate(self):
2727
validate_active_employee(self.employee)
2828
self.set_status()
2929

30+
def on_submit(self):
31+
if self.travel_request:
32+
frappe.db.set_value('Travel Request', self.travel_request, 'employee_advance', self.name)
33+
3034
def on_cancel(self):
3135
self.ignore_linked_doctypes = ('GL Entry')
3236

erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ def get_data():
66
'fieldname': 'employee_advance',
77
'non_standard_fieldnames': {
88
'Payment Entry': 'reference_name',
9-
'Journal Entry': 'reference_name'
9+
'Journal Entry': 'reference_name',
1010
},
1111
'transactions': [
1212
{
1313
'items': ['Expense Claim']
1414
},
1515
{
16-
'items': ['Payment Entry', 'Journal Entry']
16+
'items': ['Payment Entry', 'Journal Entry', 'Travel Request']
1717
}
1818
]
1919
}

erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"hide_toolbar": 1,
7272
"issingle": 1,
7373
"links": [],
74-
"modified": "2021-05-12 20:01:54.184685",
74+
"modified": "2021-05-12 21:01:54.184685",
7575
"modified_by": "Administrator",
7676
"module": "HR",
7777
"name": "Employee Attendance Tool",
@@ -84,7 +84,7 @@
8484
"write": 1
8585
}
8686
],
87-
"restrict_to_domain": "HR Asistencia y Vacaciones",
87+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
8888
"sort_field": "modified",
8989
"sort_order": "DESC"
9090
}

erpnext/hr/doctype/employee_checkin/employee_checkin.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
}
108108
],
109109
"links": [],
110-
"modified": "2021-05-12 20:01:55.298451",
110+
"modified": "2021-05-12 21:01:55.298451",
111111
"modified_by": "Administrator",
112112
"module": "HR",
113113
"name": "Employee Checkin",
@@ -201,7 +201,7 @@
201201
"role": "Employee"
202202
}
203203
],
204-
"restrict_to_domain": "HR Asistencia y Vacaciones",
204+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
205205
"sort_field": "modified",
206206
"sort_order": "ASC",
207207
"title_field": "employee_name",

erpnext/hr/doctype/expense_claim/expense_claim.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
"idx": 1,
380380
"is_submittable": 1,
381381
"links": [],
382-
"modified": "2021-11-22 16:26:57.787838",
382+
"modified": "2021-11-23 16:26:57.787838",
383383
"modified_by": "Administrator",
384384
"module": "HR",
385385
"name": "Expense Claim",
@@ -441,7 +441,7 @@
441441
"write": 1
442442
}
443443
],
444-
"restrict_to_domain": "HR Reclutamiento, Capacitacion y Gastos",
444+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
445445
"search_fields": "employee,employee_name",
446446
"show_name_in_global_search": 1,
447447
"sort_field": "modified",

erpnext/hr/doctype/expense_taxes_and_charges/expense_taxes_and_charges.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"fieldname": "account_head",
3030
"fieldtype": "Link",
3131
"in_list_view": 1,
32-
"label": "Account Head",
32+
"label": "Cuenta contable",
3333
"oldfieldname": "account_head",
3434
"oldfieldtype": "Link",
3535
"options": "Account",
@@ -61,7 +61,7 @@
6161
"fieldname": "rate",
6262
"fieldtype": "Float",
6363
"in_list_view": 1,
64-
"label": "Rate",
64+
"label": "Al\u00edcuota",
6565
"oldfieldname": "rate",
6666
"oldfieldtype": "Currency"
6767
},
@@ -102,7 +102,7 @@
102102
],
103103
"istable": 1,
104104
"links": [],
105-
"modified": "2021-05-12 19:59:12.974975",
105+
"modified": "2023-08-01 11:13:52.620713",
106106
"modified_by": "Administrator",
107107
"module": "HR",
108108
"name": "Expense Taxes and Charges",

erpnext/hr/doctype/holiday_list/holiday_list.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@
112112
"icon": "fa fa-calendar",
113113
"idx": 1,
114114
"links": [],
115-
"modified": "2022-06-22 15:13:55.735097",
115+
"modified": "2022-06-22 16:13:55.735097",
116116
"modified_by": "Administrator",
117117
"module": "HR",
118-
"restrict_to_domain": "HR Asistencia y Vacaciones",
118+
"restrict_to_domain": "HR Asistencia, Vacaciones y Rendimiento de Gastos",
119119
"name": "Holiday List",
120120
"owner": "Administrator",
121121
"permissions": [

0 commit comments

Comments
 (0)