coati-payroll 0.0.11__py3-none-any.whl → 0.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of coati-payroll might be problematic. Click here for more details.
- coati_payroll/__init__.py +7 -17
- coati_payroll/app.py +2 -13
- coati_payroll/audit_helpers.py +2 -13
- coati_payroll/auth.py +2 -13
- coati_payroll/cli.py +17 -14
- coati_payroll/config.py +2 -13
- coati_payroll/demo_data.py +2 -13
- coati_payroll/enums.py +2 -13
- coati_payroll/forms.py +7 -13
- coati_payroll/formula_engine/__init__.py +14 -13
- coati_payroll/formula_engine/ast/__init__.py +16 -1
- coati_payroll/formula_engine/ast/ast_visitor.py +15 -17
- coati_payroll/formula_engine/ast/expression_evaluator.py +12 -14
- coati_payroll/formula_engine/ast/safe_operators.py +16 -15
- coati_payroll/formula_engine/ast/type_converter.py +17 -17
- coati_payroll/formula_engine/data_sources.py +3 -13
- coati_payroll/formula_engine/engine.py +12 -13
- coati_payroll/formula_engine/exceptions.py +13 -13
- coati_payroll/formula_engine/execution/__init__.py +15 -13
- coati_payroll/formula_engine/execution/execution_context.py +12 -13
- coati_payroll/formula_engine/execution/step_executor.py +12 -14
- coati_payroll/formula_engine/execution/variable_store.py +13 -13
- coati_payroll/formula_engine/novelty_codes.py +3 -13
- coati_payroll/formula_engine/results/__init__.py +14 -13
- coati_payroll/formula_engine/results/execution_result.py +47 -35
- coati_payroll/formula_engine/steps/__init__.py +14 -14
- coati_payroll/formula_engine/steps/assignment_step.py +12 -13
- coati_payroll/formula_engine/steps/base_step.py +13 -13
- coati_payroll/formula_engine/steps/calculation_step.py +12 -13
- coati_payroll/formula_engine/steps/conditional_step.py +12 -13
- coati_payroll/formula_engine/steps/step_factory.py +11 -13
- coati_payroll/formula_engine/steps/tax_lookup_step.py +12 -13
- coati_payroll/formula_engine/tables/__init__.py +14 -13
- coati_payroll/formula_engine/tables/bracket_calculator.py +12 -13
- coati_payroll/formula_engine/tables/table_lookup.py +12 -14
- coati_payroll/formula_engine/tables/tax_table.py +13 -13
- coati_payroll/formula_engine/validation/__init__.py +14 -13
- coati_payroll/formula_engine/validation/schema_validator.py +12 -14
- coati_payroll/formula_engine/validation/security_validator.py +12 -13
- coati_payroll/formula_engine/validation/tax_table_validator.py +12 -13
- coati_payroll/formula_engine_examples.py +2 -13
- coati_payroll/i18n.py +2 -13
- coati_payroll/initial_data.py +2 -13
- coati_payroll/interes_engine.py +2 -13
- coati_payroll/liquidacion_engine/__init__.py +2 -13
- coati_payroll/liquidacion_engine/engine.py +2 -13
- coati_payroll/locale_config.py +2 -13
- coati_payroll/migrations/20260125_032900_initial_migration.py +2 -14
- coati_payroll/migrations/__init__.py +2 -13
- coati_payroll/model.py +83 -82
- coati_payroll/nomina_engine/__init__.py +2 -13
- coati_payroll/nomina_engine/calculators/__init__.py +2 -13
- coati_payroll/nomina_engine/calculators/benefit_calculator.py +2 -13
- coati_payroll/nomina_engine/calculators/concept_calculator.py +2 -1
- coati_payroll/nomina_engine/calculators/deduction_calculator.py +2 -13
- coati_payroll/nomina_engine/calculators/exchange_rate_calculator.py +2 -13
- coati_payroll/nomina_engine/calculators/perception_calculator.py +2 -13
- coati_payroll/nomina_engine/calculators/salary_calculator.py +2 -13
- coati_payroll/nomina_engine/domain/__init__.py +2 -13
- coati_payroll/nomina_engine/domain/calculation_items.py +2 -13
- coati_payroll/nomina_engine/domain/employee_calculation.py +2 -13
- coati_payroll/nomina_engine/domain/payroll_context.py +2 -13
- coati_payroll/nomina_engine/engine.py +2 -13
- coati_payroll/nomina_engine/processors/__init__.py +2 -13
- coati_payroll/nomina_engine/processors/accounting_processor.py +2 -13
- coati_payroll/nomina_engine/processors/accumulation_processor.py +2 -13
- coati_payroll/nomina_engine/processors/loan_processor.py +2 -13
- coati_payroll/nomina_engine/processors/novelty_processor.py +2 -13
- coati_payroll/nomina_engine/processors/vacation_processor.py +2 -13
- coati_payroll/nomina_engine/repositories/__init__.py +2 -13
- coati_payroll/nomina_engine/repositories/acumulado_repository.py +2 -13
- coati_payroll/nomina_engine/repositories/base_repository.py +2 -13
- coati_payroll/nomina_engine/repositories/config_repository.py +2 -13
- coati_payroll/nomina_engine/repositories/employee_repository.py +2 -13
- coati_payroll/nomina_engine/repositories/exchange_rate_repository.py +2 -13
- coati_payroll/nomina_engine/repositories/novelty_repository.py +2 -13
- coati_payroll/nomina_engine/repositories/planilla_repository.py +2 -13
- coati_payroll/nomina_engine/results/__init__.py +2 -13
- coati_payroll/nomina_engine/results/error_result.py +2 -13
- coati_payroll/nomina_engine/results/payroll_result.py +2 -13
- coati_payroll/nomina_engine/results/validation_result.py +2 -13
- coati_payroll/nomina_engine/services/__init__.py +2 -13
- coati_payroll/nomina_engine/services/accounting_voucher_service.py +2 -13
- coati_payroll/nomina_engine/services/employee_processing_service.py +2 -13
- coati_payroll/nomina_engine/services/payroll_execution_service.py +2 -13
- coati_payroll/nomina_engine/validators/__init__.py +2 -13
- coati_payroll/nomina_engine/validators/base_validator.py +2 -13
- coati_payroll/nomina_engine/validators/currency_validator.py +2 -13
- coati_payroll/nomina_engine/validators/employee_validator.py +2 -13
- coati_payroll/nomina_engine/validators/period_validator.py +2 -13
- coati_payroll/nomina_engine/validators/planilla_validator.py +2 -13
- coati_payroll/queue/__init__.py +2 -13
- coati_payroll/queue/driver.py +2 -13
- coati_payroll/queue/drivers/__init__.py +2 -13
- coati_payroll/queue/drivers/dramatiq_driver.py +9 -16
- coati_payroll/queue/drivers/huey_driver.py +2 -13
- coati_payroll/queue/drivers/noop_driver.py +2 -13
- coati_payroll/queue/selector.py +2 -13
- coati_payroll/queue/tasks.py +13 -20
- coati_payroll/rate_limiting.py +2 -13
- coati_payroll/rbac.py +12 -19
- coati_payroll/report_engine.py +2 -13
- coati_payroll/report_export.py +2 -13
- coati_payroll/schema_validator.py +2 -13
- coati_payroll/security.py +2 -13
- coati_payroll/static/schema_editor.js +862 -0
- coati_payroll/static/styles.css +5 -0
- coati_payroll/system_reports.py +2 -13
- coati_payroll/templates/auth/login.html +5 -0
- coati_payroll/templates/base.html +5 -1
- coati_payroll/templates/index.html +5 -0
- coati_payroll/templates/macros.html +5 -0
- coati_payroll/templates/modules/calculation_rule/form.html +5 -0
- coati_payroll/templates/modules/calculation_rule/index.html +5 -0
- coati_payroll/templates/modules/calculation_rule/schema_editor.html +292 -974
- coati_payroll/templates/modules/carga_inicial_prestacion/form.html +5 -0
- coati_payroll/templates/modules/carga_inicial_prestacion/index.html +5 -0
- coati_payroll/templates/modules/carga_inicial_prestacion/reporte.html +5 -0
- coati_payroll/templates/modules/config_calculos/index.html +5 -0
- coati_payroll/templates/modules/configuracion/index.html +24 -27
- coati_payroll/templates/modules/currency/form.html +5 -0
- coati_payroll/templates/modules/currency/index.html +5 -0
- coati_payroll/templates/modules/custom_field/form.html +5 -0
- coati_payroll/templates/modules/custom_field/index.html +5 -0
- coati_payroll/templates/modules/deduccion/form.html +5 -0
- coati_payroll/templates/modules/deduccion/index.html +5 -0
- coati_payroll/templates/modules/employee/form.html +5 -0
- coati_payroll/templates/modules/employee/index.html +5 -0
- coati_payroll/templates/modules/empresa/form.html +5 -0
- coati_payroll/templates/modules/empresa/index.html +5 -0
- coati_payroll/templates/modules/exchange_rate/form.html +5 -0
- coati_payroll/templates/modules/exchange_rate/import.html +5 -0
- coati_payroll/templates/modules/exchange_rate/index.html +5 -0
- coati_payroll/templates/modules/liquidacion/index.html +5 -0
- coati_payroll/templates/modules/liquidacion/nueva.html +5 -0
- coati_payroll/templates/modules/liquidacion/ver.html +5 -0
- coati_payroll/templates/modules/payroll_concepts/audit_log.html +5 -0
- coati_payroll/templates/modules/percepcion/form.html +5 -0
- coati_payroll/templates/modules/percepcion/index.html +5 -0
- coati_payroll/templates/modules/planilla/config.html +5 -0
- coati_payroll/templates/modules/planilla/config_deducciones.html +5 -0
- coati_payroll/templates/modules/planilla/config_empleados.html +5 -0
- coati_payroll/templates/modules/planilla/config_percepciones.html +5 -0
- coati_payroll/templates/modules/planilla/config_prestaciones.html +5 -0
- coati_payroll/templates/modules/planilla/config_reglas.html +5 -0
- coati_payroll/templates/modules/planilla/ejecutar_nomina.html +5 -0
- coati_payroll/templates/modules/planilla/form.html +5 -0
- coati_payroll/templates/modules/planilla/index.html +5 -0
- coati_payroll/templates/modules/planilla/listar_nominas.html +5 -0
- coati_payroll/templates/modules/planilla/log_nomina.html +5 -0
- coati_payroll/templates/modules/planilla/novedades/form.html +5 -0
- coati_payroll/templates/modules/planilla/novedades/index.html +5 -0
- coati_payroll/templates/modules/planilla/ver_nomina.html +5 -0
- coati_payroll/templates/modules/planilla/ver_nomina_empleado.html +5 -0
- coati_payroll/templates/modules/plugins/index.html +5 -0
- coati_payroll/templates/modules/prestacion/form.html +5 -0
- coati_payroll/templates/modules/prestacion/index.html +5 -0
- coati_payroll/templates/modules/prestacion_management/dashboard.html +5 -0
- coati_payroll/templates/modules/prestacion_management/initial_balance_bulk.html +5 -0
- coati_payroll/templates/modules/prestamo/approve.html +5 -0
- coati_payroll/templates/modules/prestamo/condonacion.html +5 -0
- coati_payroll/templates/modules/prestamo/detail.html +5 -0
- coati_payroll/templates/modules/prestamo/form.html +5 -0
- coati_payroll/templates/modules/prestamo/index.html +5 -0
- coati_payroll/templates/modules/prestamo/pago_extraordinario.html +5 -0
- coati_payroll/templates/modules/prestamo/tabla_pago_pdf.html +5 -0
- coati_payroll/templates/modules/report/admin_index.html +5 -0
- coati_payroll/templates/modules/report/detail.html +5 -0
- coati_payroll/templates/modules/report/execute.html +5 -0
- coati_payroll/templates/modules/report/index.html +5 -0
- coati_payroll/templates/modules/report/permissions.html +5 -0
- coati_payroll/templates/modules/settings/index.html +5 -0
- coati_payroll/templates/modules/shared/concept_form.html +19 -12
- coati_payroll/templates/modules/shared/concept_index.html +39 -27
- coati_payroll/templates/modules/tipo_planilla/form.html +5 -0
- coati_payroll/templates/modules/tipo_planilla/index.html +5 -0
- coati_payroll/templates/modules/user/form.html +5 -0
- coati_payroll/templates/modules/user/index.html +5 -0
- coati_payroll/templates/modules/user/profile.html +5 -0
- coati_payroll/templates/modules/vacation/account_detail.html +5 -0
- coati_payroll/templates/modules/vacation/account_form.html +5 -0
- coati_payroll/templates/modules/vacation/account_index.html +5 -0
- coati_payroll/templates/modules/vacation/dashboard.html +5 -0
- coati_payroll/templates/modules/vacation/initial_balance_bulk.html +5 -0
- coati_payroll/templates/modules/vacation/initial_balance_form.html +5 -0
- coati_payroll/templates/modules/vacation/leave_request_detail.html +5 -0
- coati_payroll/templates/modules/vacation/leave_request_form.html +5 -0
- coati_payroll/templates/modules/vacation/leave_request_index.html +5 -0
- coati_payroll/templates/modules/vacation/policy_detail.html +5 -0
- coati_payroll/templates/modules/vacation/policy_form.html +5 -0
- coati_payroll/templates/modules/vacation/policy_index.html +5 -0
- coati_payroll/templates/modules/vacation/register_taken_form.html +5 -0
- coati_payroll/translations/en/LC_MESSAGES/messages.mo +0 -0
- coati_payroll/translations/en/LC_MESSAGES/messages.po +2963 -3561
- coati_payroll/vacation_service.py +2 -13
- coati_payroll/version.py +3 -14
- coati_payroll/vistas/__init__.py +2 -13
- coati_payroll/vistas/calculation_rule.py +14 -24
- coati_payroll/vistas/carga_inicial_prestacion.py +2 -13
- coati_payroll/vistas/config_calculos.py +2 -13
- coati_payroll/vistas/configuracion.py +29 -39
- coati_payroll/vistas/constants.py +2 -13
- coati_payroll/vistas/currency.py +2 -13
- coati_payroll/vistas/custom_field.py +2 -13
- coati_payroll/vistas/employee.py +2 -13
- coati_payroll/vistas/empresa.py +2 -13
- coati_payroll/vistas/exchange_rate.py +2 -13
- coati_payroll/vistas/liquidacion.py +2 -13
- coati_payroll/vistas/payroll_concepts.py +2 -13
- coati_payroll/vistas/planilla/__init__.py +2 -13
- coati_payroll/vistas/planilla/association_routes.py +8 -17
- coati_payroll/vistas/planilla/config_routes.py +2 -13
- coati_payroll/vistas/planilla/export_routes.py +28 -35
- coati_payroll/vistas/planilla/helpers/__init__.py +2 -13
- coati_payroll/vistas/planilla/helpers/association_helpers.py +2 -13
- coati_payroll/vistas/planilla/helpers/excel_helpers.py +2 -13
- coati_payroll/vistas/planilla/helpers/form_helpers.py +2 -13
- coati_payroll/vistas/planilla/nomina_routes.py +2 -13
- coati_payroll/vistas/planilla/novedad_routes.py +2 -13
- coati_payroll/vistas/planilla/routes.py +2 -13
- coati_payroll/vistas/planilla/services/__init__.py +2 -13
- coati_payroll/vistas/planilla/services/export_service.py +4 -15
- coati_payroll/vistas/planilla/services/nomina_service.py +2 -13
- coati_payroll/vistas/planilla/services/novedad_service.py +3 -16
- coati_payroll/vistas/planilla/services/planilla_service.py +2 -13
- coati_payroll/vistas/planilla/validators/__init__.py +2 -13
- coati_payroll/vistas/planilla/validators/planilla_validators.py +2 -13
- coati_payroll/vistas/prestacion.py +2 -13
- coati_payroll/vistas/prestamo.py +2 -13
- coati_payroll/vistas/report.py +2 -13
- coati_payroll/vistas/settings.py +2 -13
- coati_payroll/vistas/tipo_planilla.py +2 -13
- coati_payroll/vistas/user.py +2 -13
- coati_payroll/vistas/vacation.py +15 -13
- coati_payroll/wsgi_server.py +37 -0
- {coati_payroll-0.0.11.dist-info → coati_payroll-0.0.13.dist-info}/METADATA +11 -4
- coati_payroll-0.0.13.dist-info/RECORD +248 -0
- coati_payroll/translations/es/LC_MESSAGES/messages.mo +0 -0
- coati_payroll/translations/es/LC_MESSAGES/messages.po +0 -7374
- coati_payroll-0.0.11.dist-info/RECORD +0 -248
- {coati_payroll-0.0.11.dist-info → coati_payroll-0.0.13.dist-info}/LICENSE +0 -0
- {coati_payroll-0.0.11.dist-info → coati_payroll-0.0.13.dist-info}/WHEEL +0 -0
- {coati_payroll-0.0.11.dist-info → coati_payroll-0.0.13.dist-info}/entry_points.txt +0 -0
- {coati_payroll-0.0.11.dist-info → coati_payroll-0.0.13.dist-info}/top_level.txt +0 -0
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Routes for Excel export operations."""
|
|
15
4
|
|
|
16
5
|
from flask import flash, redirect, send_file, url_for
|
|
@@ -25,6 +14,10 @@ from coati_payroll.vistas.planilla.services import ExportService
|
|
|
25
14
|
|
|
26
15
|
# Constants
|
|
27
16
|
ROUTE_VER_NOMINA = "planilla.ver_nomina"
|
|
17
|
+
MESSAGE_EXCEL_NOT_AVAILABLE = "Excel export no disponible. Instale openpyxl."
|
|
18
|
+
MESSAGE_NOMINA_NOT_BELONG = "La nómina no pertenece a esta planilla."
|
|
19
|
+
ROUTE_LISTAR_NOMINAS = "planilla.listar_nominas"
|
|
20
|
+
MIMETYPE_EXCEL = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
28
21
|
|
|
29
22
|
|
|
30
23
|
@planilla_bp.route("/<planilla_id>/nomina/<nomina_id>/exportar-excel")
|
|
@@ -33,21 +26,21 @@ ROUTE_VER_NOMINA = "planilla.ver_nomina"
|
|
|
33
26
|
def exportar_nomina_excel(planilla_id: str, nomina_id: str):
|
|
34
27
|
"""Export nomina to Excel with employee details and calculations."""
|
|
35
28
|
if not check_openpyxl_available():
|
|
36
|
-
flash(_(
|
|
29
|
+
flash(_(MESSAGE_EXCEL_NOT_AVAILABLE), "warning")
|
|
37
30
|
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
38
31
|
|
|
39
32
|
planilla = db.get_or_404(Planilla, planilla_id)
|
|
40
33
|
nomina = db.get_or_404(Nomina, nomina_id)
|
|
41
34
|
|
|
42
35
|
if nomina.planilla_id != planilla_id:
|
|
43
|
-
flash(_(
|
|
44
|
-
return redirect(url_for(
|
|
36
|
+
flash(_(MESSAGE_NOMINA_NOT_BELONG), "error")
|
|
37
|
+
return redirect(url_for(ROUTE_LISTAR_NOMINAS, planilla_id=planilla_id))
|
|
45
38
|
|
|
46
39
|
try:
|
|
47
40
|
output, filename = ExportService.exportar_nomina_excel(planilla, nomina)
|
|
48
41
|
return send_file(
|
|
49
42
|
output,
|
|
50
|
-
mimetype=
|
|
43
|
+
mimetype=MIMETYPE_EXCEL,
|
|
51
44
|
as_attachment=True,
|
|
52
45
|
download_name=filename,
|
|
53
46
|
)
|
|
@@ -62,21 +55,21 @@ def exportar_nomina_excel(planilla_id: str, nomina_id: str):
|
|
|
62
55
|
def exportar_prestaciones_excel(planilla_id: str, nomina_id: str):
|
|
63
56
|
"""Export benefits (prestaciones) to Excel separately."""
|
|
64
57
|
if not check_openpyxl_available():
|
|
65
|
-
flash(_(
|
|
58
|
+
flash(_(MESSAGE_EXCEL_NOT_AVAILABLE), "warning")
|
|
66
59
|
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
67
60
|
|
|
68
61
|
planilla = db.get_or_404(Planilla, planilla_id)
|
|
69
62
|
nomina = db.get_or_404(Nomina, nomina_id)
|
|
70
63
|
|
|
71
64
|
if nomina.planilla_id != planilla_id:
|
|
72
|
-
flash(_(
|
|
73
|
-
return redirect(url_for(
|
|
65
|
+
flash(_(MESSAGE_NOMINA_NOT_BELONG), "error")
|
|
66
|
+
return redirect(url_for(ROUTE_LISTAR_NOMINAS, planilla_id=planilla_id))
|
|
74
67
|
|
|
75
68
|
try:
|
|
76
69
|
output, filename = ExportService.exportar_prestaciones_excel(planilla, nomina)
|
|
77
70
|
return send_file(
|
|
78
71
|
output,
|
|
79
|
-
mimetype=
|
|
72
|
+
mimetype=MIMETYPE_EXCEL,
|
|
80
73
|
as_attachment=True,
|
|
81
74
|
download_name=filename,
|
|
82
75
|
)
|
|
@@ -91,15 +84,15 @@ def exportar_prestaciones_excel(planilla_id: str, nomina_id: str):
|
|
|
91
84
|
def exportar_comprobante_excel(planilla_id: str, nomina_id: str):
|
|
92
85
|
"""Export summarized accounting voucher (comprobante contable) to Excel."""
|
|
93
86
|
if not check_openpyxl_available():
|
|
94
|
-
flash(_(
|
|
95
|
-
return redirect(url_for(
|
|
87
|
+
flash(_(MESSAGE_EXCEL_NOT_AVAILABLE), "warning")
|
|
88
|
+
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
96
89
|
|
|
97
90
|
planilla = db.get_or_404(Planilla, planilla_id)
|
|
98
91
|
nomina = db.get_or_404(Nomina, nomina_id)
|
|
99
92
|
|
|
100
93
|
if nomina.planilla_id != planilla_id:
|
|
101
|
-
flash(_(
|
|
102
|
-
return redirect(url_for(
|
|
94
|
+
flash(_(MESSAGE_NOMINA_NOT_BELONG), "error")
|
|
95
|
+
return redirect(url_for(ROUTE_LISTAR_NOMINAS, planilla_id=planilla_id))
|
|
103
96
|
|
|
104
97
|
# Check if comprobante exists
|
|
105
98
|
from coati_payroll.model import ComprobanteContable
|
|
@@ -108,7 +101,7 @@ def exportar_comprobante_excel(planilla_id: str, nomina_id: str):
|
|
|
108
101
|
|
|
109
102
|
if not comprobante:
|
|
110
103
|
flash(_("No existe comprobante contable para esta nómina. Debe recalcular la nómina."), "error")
|
|
111
|
-
return redirect(url_for(
|
|
104
|
+
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
112
105
|
|
|
113
106
|
# Check for configuration warnings
|
|
114
107
|
if comprobante.advertencias:
|
|
@@ -121,13 +114,13 @@ def exportar_comprobante_excel(planilla_id: str, nomina_id: str):
|
|
|
121
114
|
output, filename = ExportService.exportar_comprobante_excel(planilla, nomina)
|
|
122
115
|
return send_file(
|
|
123
116
|
output,
|
|
124
|
-
mimetype=
|
|
117
|
+
mimetype=MIMETYPE_EXCEL,
|
|
125
118
|
as_attachment=True,
|
|
126
119
|
download_name=filename,
|
|
127
120
|
)
|
|
128
121
|
except Exception as e:
|
|
129
122
|
flash(_("Error al exportar comprobante: {}").format(str(e)), "error")
|
|
130
|
-
return redirect(url_for(
|
|
123
|
+
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
131
124
|
|
|
132
125
|
|
|
133
126
|
@planilla_bp.route("/<planilla_id>/nomina/<nomina_id>/exportar-comprobante-detallado-excel")
|
|
@@ -136,15 +129,15 @@ def exportar_comprobante_excel(planilla_id: str, nomina_id: str):
|
|
|
136
129
|
def exportar_comprobante_detallado_excel(planilla_id: str, nomina_id: str):
|
|
137
130
|
"""Export detailed accounting voucher per employee to Excel."""
|
|
138
131
|
if not check_openpyxl_available():
|
|
139
|
-
flash(_(
|
|
140
|
-
return redirect(url_for(
|
|
132
|
+
flash(_(MESSAGE_EXCEL_NOT_AVAILABLE), "warning")
|
|
133
|
+
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
141
134
|
|
|
142
135
|
planilla = db.get_or_404(Planilla, planilla_id)
|
|
143
136
|
nomina = db.get_or_404(Nomina, nomina_id)
|
|
144
137
|
|
|
145
138
|
if nomina.planilla_id != planilla_id:
|
|
146
|
-
flash(_(
|
|
147
|
-
return redirect(url_for(
|
|
139
|
+
flash(_(MESSAGE_NOMINA_NOT_BELONG), "error")
|
|
140
|
+
return redirect(url_for(ROUTE_LISTAR_NOMINAS, planilla_id=planilla_id))
|
|
148
141
|
|
|
149
142
|
# Check if comprobante exists
|
|
150
143
|
from coati_payroll.model import ComprobanteContable
|
|
@@ -153,7 +146,7 @@ def exportar_comprobante_detallado_excel(planilla_id: str, nomina_id: str):
|
|
|
153
146
|
|
|
154
147
|
if not comprobante:
|
|
155
148
|
flash(_("No existe comprobante contable para esta nómina. Debe recalcular la nómina."), "error")
|
|
156
|
-
return redirect(url_for(
|
|
149
|
+
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
157
150
|
|
|
158
151
|
# Check for configuration warnings
|
|
159
152
|
if comprobante.advertencias:
|
|
@@ -166,10 +159,10 @@ def exportar_comprobante_detallado_excel(planilla_id: str, nomina_id: str):
|
|
|
166
159
|
output, filename = ExportService.exportar_comprobante_detallado_excel(planilla, nomina)
|
|
167
160
|
return send_file(
|
|
168
161
|
output,
|
|
169
|
-
mimetype=
|
|
162
|
+
mimetype=MIMETYPE_EXCEL,
|
|
170
163
|
as_attachment=True,
|
|
171
164
|
download_name=filename,
|
|
172
165
|
)
|
|
173
166
|
except Exception as e:
|
|
174
167
|
flash(_("Error al exportar comprobante detallado: {}").format(str(e)), "error")
|
|
175
|
-
return redirect(url_for(
|
|
168
|
+
return redirect(url_for(ROUTE_VER_NOMINA, planilla_id=planilla_id, nomina_id=nomina_id))
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Helper functions for planilla views."""
|
|
15
4
|
|
|
16
5
|
from coati_payroll.vistas.planilla.helpers.form_helpers import (
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Helper functions for managing planilla associations."""
|
|
15
4
|
|
|
16
5
|
from sqlalchemy import func, select
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Excel helper functions for planilla views."""
|
|
15
4
|
|
|
16
5
|
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Form helper functions for planilla views."""
|
|
15
4
|
|
|
16
5
|
from coati_payroll.model import db, TipoPlanilla, Moneda, Empresa, NominaEmpleado, Percepcion, Deduccion
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Routes for nomina execution and management."""
|
|
15
4
|
|
|
16
5
|
from datetime import date
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Routes for managing novedades (novelties)."""
|
|
15
4
|
|
|
16
5
|
from flask import flash, redirect, render_template, request, url_for
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Main routes for planilla management."""
|
|
15
4
|
|
|
16
5
|
from flask import flash, redirect, render_template, url_for
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Services for planilla business logic."""
|
|
15
4
|
|
|
16
5
|
from coati_payroll.vistas.planilla.services.planilla_service import PlanillaService
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Service for Excel export operations."""
|
|
15
4
|
|
|
16
5
|
from io import BytesIO
|
|
@@ -396,7 +385,7 @@ class ExportService:
|
|
|
396
385
|
"""
|
|
397
386
|
openpyxl_classes = check_openpyxl_available()
|
|
398
387
|
if not openpyxl_classes:
|
|
399
|
-
raise ImportError(
|
|
388
|
+
raise ImportError(ERROR_OPENPYXL_NOT_AVAILABLE)
|
|
400
389
|
|
|
401
390
|
Workbook, Font, Alignment, PatternFill, Border, Side = openpyxl_classes
|
|
402
391
|
|
|
@@ -585,7 +574,7 @@ class ExportService:
|
|
|
585
574
|
"""
|
|
586
575
|
openpyxl_classes = check_openpyxl_available()
|
|
587
576
|
if not openpyxl_classes:
|
|
588
|
-
raise ImportError(
|
|
577
|
+
raise ImportError(ERROR_OPENPYXL_NOT_AVAILABLE)
|
|
589
578
|
|
|
590
579
|
Workbook, Font, Alignment, PatternFill, Border, Side = openpyxl_classes
|
|
591
580
|
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Service for nomina business logic."""
|
|
15
4
|
|
|
16
5
|
from datetime import date, timedelta
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Service for novedad business logic."""
|
|
15
4
|
|
|
16
5
|
from decimal import Decimal
|
|
@@ -67,9 +56,7 @@ class NovedadService:
|
|
|
67
56
|
|
|
68
57
|
if fecha_novedad:
|
|
69
58
|
if fecha_novedad < nomina.periodo_inicio or fecha_novedad > nomina.periodo_fin:
|
|
70
|
-
return False, _(
|
|
71
|
-
"La fecha de la novedad debe estar dentro del período de la nómina " "({} a {})."
|
|
72
|
-
).format(
|
|
59
|
+
return False, _("La fecha de la novedad debe estar dentro del período de la nómina ({} a {}).").format(
|
|
73
60
|
nomina.periodo_inicio.strftime("%d/%m/%Y"),
|
|
74
61
|
nomina.periodo_fin.strftime("%d/%m/%Y"),
|
|
75
62
|
)
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Service for planilla business logic."""
|
|
15
4
|
|
|
16
5
|
from coati_payroll.model import Planilla
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Validators for planilla business logic."""
|
|
15
4
|
|
|
16
5
|
from coati_payroll.vistas.planilla.validators.planilla_validators import PlanillaValidator
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Business logic validators for planilla operations."""
|
|
15
4
|
|
|
16
5
|
from coati_payroll.model import Planilla, Empleado
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Prestacion (Benefits) module views.
|
|
15
4
|
|
|
16
5
|
This module provides views for managing benefits including a dashboard
|
coati_payroll/vistas/prestamo.py
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Views for managing loans and salary advances (Préstamos y Adelantos).
|
|
15
4
|
|
|
16
5
|
This module handles:
|
coati_payroll/vistas/report.py
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Report management routes."""
|
|
15
4
|
|
|
16
5
|
from __future__ import annotations
|
coati_payroll/vistas/settings.py
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Settings page to consolidate administrative options."""
|
|
15
4
|
|
|
16
5
|
from __future__ import annotations
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Payroll Type (TipoPlanilla) CRUD routes."""
|
|
15
4
|
|
|
16
5
|
from __future__ import annotations
|
coati_payroll/vistas/user.py
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""User CRUD routes."""
|
|
15
4
|
|
|
16
5
|
from __future__ import annotations
|
coati_payroll/vistas/vacation.py
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 - 2026 BMO Soluciones, S.A.
|
|
14
3
|
"""Vacation module views.
|
|
15
4
|
|
|
16
5
|
This module provides views for managing vacation policies, accounts, and leave requests.
|
|
@@ -334,6 +323,19 @@ def leave_request_new():
|
|
|
334
323
|
from coati_payroll.forms import VacationLeaveRequestForm
|
|
335
324
|
|
|
336
325
|
form = VacationLeaveRequestForm()
|
|
326
|
+
# Asignar choices de empleados activos antes de validar
|
|
327
|
+
empleados = (
|
|
328
|
+
db.session.execute(
|
|
329
|
+
db.select(Empleado)
|
|
330
|
+
.filter(Empleado.activo.is_(True))
|
|
331
|
+
.order_by(Empleado.primer_apellido, Empleado.primer_nombre)
|
|
332
|
+
)
|
|
333
|
+
.scalars()
|
|
334
|
+
.all()
|
|
335
|
+
)
|
|
336
|
+
form.empleado_id.choices = [("", _("-- Seleccionar Empleado --"))] + [
|
|
337
|
+
(e.id, f"{e.codigo_empleado} - {e.primer_nombre} {e.primer_apellido}") for e in empleados
|
|
338
|
+
]
|
|
337
339
|
|
|
338
340
|
if form.validate_on_submit():
|
|
339
341
|
# Validate that employee has a vacation account
|