coati-payroll 0.0.2__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 +415 -0
- coati_payroll/app.py +95 -0
- coati_payroll/audit_helpers.py +904 -0
- coati_payroll/auth.py +123 -0
- coati_payroll/cli.py +1318 -0
- coati_payroll/config.py +219 -0
- coati_payroll/demo_data.py +813 -0
- coati_payroll/enums.py +278 -0
- coati_payroll/forms.py +1769 -0
- coati_payroll/formula_engine/__init__.py +81 -0
- coati_payroll/formula_engine/ast/__init__.py +110 -0
- coati_payroll/formula_engine/ast/ast_visitor.py +259 -0
- coati_payroll/formula_engine/ast/expression_evaluator.py +228 -0
- coati_payroll/formula_engine/ast/safe_operators.py +131 -0
- coati_payroll/formula_engine/ast/type_converter.py +172 -0
- coati_payroll/formula_engine/data_sources.py +752 -0
- coati_payroll/formula_engine/engine.py +247 -0
- coati_payroll/formula_engine/exceptions.py +52 -0
- coati_payroll/formula_engine/execution/__init__.py +24 -0
- coati_payroll/formula_engine/execution/execution_context.py +52 -0
- coati_payroll/formula_engine/execution/step_executor.py +62 -0
- coati_payroll/formula_engine/execution/variable_store.py +59 -0
- coati_payroll/formula_engine/novelty_codes.py +206 -0
- coati_payroll/formula_engine/results/__init__.py +20 -0
- coati_payroll/formula_engine/results/execution_result.py +59 -0
- coati_payroll/formula_engine/steps/__init__.py +30 -0
- coati_payroll/formula_engine/steps/assignment_step.py +71 -0
- coati_payroll/formula_engine/steps/base_step.py +48 -0
- coati_payroll/formula_engine/steps/calculation_step.py +42 -0
- coati_payroll/formula_engine/steps/conditional_step.py +122 -0
- coati_payroll/formula_engine/steps/step_factory.py +58 -0
- coati_payroll/formula_engine/steps/tax_lookup_step.py +45 -0
- coati_payroll/formula_engine/tables/__init__.py +24 -0
- coati_payroll/formula_engine/tables/bracket_calculator.py +51 -0
- coati_payroll/formula_engine/tables/table_lookup.py +161 -0
- coati_payroll/formula_engine/tables/tax_table.py +32 -0
- coati_payroll/formula_engine/validation/__init__.py +24 -0
- coati_payroll/formula_engine/validation/schema_validator.py +37 -0
- coati_payroll/formula_engine/validation/security_validator.py +52 -0
- coati_payroll/formula_engine/validation/tax_table_validator.py +205 -0
- coati_payroll/formula_engine_examples.py +153 -0
- coati_payroll/i18n.py +54 -0
- coati_payroll/initial_data.py +613 -0
- coati_payroll/interes_engine.py +450 -0
- coati_payroll/liquidacion_engine/__init__.py +25 -0
- coati_payroll/liquidacion_engine/engine.py +267 -0
- coati_payroll/locale_config.py +165 -0
- coati_payroll/log.py +138 -0
- coati_payroll/model.py +2410 -0
- coati_payroll/nomina_engine/__init__.py +87 -0
- coati_payroll/nomina_engine/calculators/__init__.py +30 -0
- coati_payroll/nomina_engine/calculators/benefit_calculator.py +79 -0
- coati_payroll/nomina_engine/calculators/concept_calculator.py +254 -0
- coati_payroll/nomina_engine/calculators/deduction_calculator.py +105 -0
- coati_payroll/nomina_engine/calculators/exchange_rate_calculator.py +51 -0
- coati_payroll/nomina_engine/calculators/perception_calculator.py +75 -0
- coati_payroll/nomina_engine/calculators/salary_calculator.py +86 -0
- coati_payroll/nomina_engine/domain/__init__.py +27 -0
- coati_payroll/nomina_engine/domain/calculation_items.py +52 -0
- coati_payroll/nomina_engine/domain/employee_calculation.py +53 -0
- coati_payroll/nomina_engine/domain/payroll_context.py +44 -0
- coati_payroll/nomina_engine/engine.py +188 -0
- coati_payroll/nomina_engine/processors/__init__.py +28 -0
- coati_payroll/nomina_engine/processors/accounting_processor.py +171 -0
- coati_payroll/nomina_engine/processors/accumulation_processor.py +90 -0
- coati_payroll/nomina_engine/processors/loan_processor.py +227 -0
- coati_payroll/nomina_engine/processors/novelty_processor.py +42 -0
- coati_payroll/nomina_engine/processors/vacation_processor.py +67 -0
- coati_payroll/nomina_engine/repositories/__init__.py +32 -0
- coati_payroll/nomina_engine/repositories/acumulado_repository.py +83 -0
- coati_payroll/nomina_engine/repositories/base_repository.py +40 -0
- coati_payroll/nomina_engine/repositories/config_repository.py +102 -0
- coati_payroll/nomina_engine/repositories/employee_repository.py +34 -0
- coati_payroll/nomina_engine/repositories/exchange_rate_repository.py +58 -0
- coati_payroll/nomina_engine/repositories/novelty_repository.py +54 -0
- coati_payroll/nomina_engine/repositories/planilla_repository.py +52 -0
- coati_payroll/nomina_engine/results/__init__.py +24 -0
- coati_payroll/nomina_engine/results/error_result.py +28 -0
- coati_payroll/nomina_engine/results/payroll_result.py +53 -0
- coati_payroll/nomina_engine/results/validation_result.py +39 -0
- coati_payroll/nomina_engine/services/__init__.py +22 -0
- coati_payroll/nomina_engine/services/accounting_voucher_service.py +708 -0
- coati_payroll/nomina_engine/services/employee_processing_service.py +173 -0
- coati_payroll/nomina_engine/services/payroll_execution_service.py +374 -0
- coati_payroll/nomina_engine/services/snapshot_service.py +295 -0
- coati_payroll/nomina_engine/validators/__init__.py +31 -0
- coati_payroll/nomina_engine/validators/base_validator.py +48 -0
- coati_payroll/nomina_engine/validators/currency_validator.py +50 -0
- coati_payroll/nomina_engine/validators/employee_validator.py +87 -0
- coati_payroll/nomina_engine/validators/period_validator.py +44 -0
- coati_payroll/nomina_engine/validators/planilla_validator.py +136 -0
- coati_payroll/plugin_manager.py +176 -0
- coati_payroll/queue/__init__.py +33 -0
- coati_payroll/queue/driver.py +127 -0
- coati_payroll/queue/drivers/__init__.py +22 -0
- coati_payroll/queue/drivers/dramatiq_driver.py +268 -0
- coati_payroll/queue/drivers/huey_driver.py +390 -0
- coati_payroll/queue/drivers/noop_driver.py +54 -0
- coati_payroll/queue/selector.py +121 -0
- coati_payroll/queue/tasks.py +764 -0
- coati_payroll/rate_limiting.py +83 -0
- coati_payroll/rbac.py +183 -0
- coati_payroll/report_engine.py +512 -0
- coati_payroll/report_export.py +208 -0
- coati_payroll/schema_validator.py +167 -0
- coati_payroll/security.py +77 -0
- coati_payroll/static/styles.css +1044 -0
- coati_payroll/system_reports.py +573 -0
- coati_payroll/templates/auth/login.html +189 -0
- coati_payroll/templates/base.html +283 -0
- coati_payroll/templates/index.html +227 -0
- coati_payroll/templates/macros.html +146 -0
- coati_payroll/templates/modules/calculation_rule/form.html +78 -0
- coati_payroll/templates/modules/calculation_rule/index.html +102 -0
- coati_payroll/templates/modules/calculation_rule/schema_editor.html +1159 -0
- coati_payroll/templates/modules/carga_inicial_prestacion/form.html +170 -0
- coati_payroll/templates/modules/carga_inicial_prestacion/index.html +170 -0
- coati_payroll/templates/modules/carga_inicial_prestacion/reporte.html +193 -0
- coati_payroll/templates/modules/config_calculos/index.html +44 -0
- coati_payroll/templates/modules/configuracion/index.html +90 -0
- coati_payroll/templates/modules/currency/form.html +47 -0
- coati_payroll/templates/modules/currency/index.html +64 -0
- coati_payroll/templates/modules/custom_field/form.html +62 -0
- coati_payroll/templates/modules/custom_field/index.html +78 -0
- coati_payroll/templates/modules/deduccion/form.html +1 -0
- coati_payroll/templates/modules/deduccion/index.html +1 -0
- coati_payroll/templates/modules/employee/form.html +254 -0
- coati_payroll/templates/modules/employee/index.html +76 -0
- coati_payroll/templates/modules/empresa/form.html +74 -0
- coati_payroll/templates/modules/empresa/index.html +71 -0
- coati_payroll/templates/modules/exchange_rate/form.html +47 -0
- coati_payroll/templates/modules/exchange_rate/import.html +93 -0
- coati_payroll/templates/modules/exchange_rate/index.html +114 -0
- coati_payroll/templates/modules/liquidacion/index.html +58 -0
- coati_payroll/templates/modules/liquidacion/nueva.html +51 -0
- coati_payroll/templates/modules/liquidacion/ver.html +91 -0
- coati_payroll/templates/modules/payroll_concepts/audit_log.html +146 -0
- coati_payroll/templates/modules/percepcion/form.html +1 -0
- coati_payroll/templates/modules/percepcion/index.html +1 -0
- coati_payroll/templates/modules/planilla/config.html +190 -0
- coati_payroll/templates/modules/planilla/config_deducciones.html +129 -0
- coati_payroll/templates/modules/planilla/config_empleados.html +116 -0
- coati_payroll/templates/modules/planilla/config_percepciones.html +113 -0
- coati_payroll/templates/modules/planilla/config_prestaciones.html +118 -0
- coati_payroll/templates/modules/planilla/config_reglas.html +120 -0
- coati_payroll/templates/modules/planilla/ejecutar_nomina.html +106 -0
- coati_payroll/templates/modules/planilla/form.html +197 -0
- coati_payroll/templates/modules/planilla/index.html +144 -0
- coati_payroll/templates/modules/planilla/listar_nominas.html +91 -0
- coati_payroll/templates/modules/planilla/log_nomina.html +135 -0
- coati_payroll/templates/modules/planilla/novedades/form.html +177 -0
- coati_payroll/templates/modules/planilla/novedades/index.html +170 -0
- coati_payroll/templates/modules/planilla/ver_nomina.html +477 -0
- coati_payroll/templates/modules/planilla/ver_nomina_empleado.html +231 -0
- coati_payroll/templates/modules/plugins/index.html +71 -0
- coati_payroll/templates/modules/prestacion/form.html +1 -0
- coati_payroll/templates/modules/prestacion/index.html +1 -0
- coati_payroll/templates/modules/prestacion_management/dashboard.html +150 -0
- coati_payroll/templates/modules/prestacion_management/initial_balance_bulk.html +195 -0
- coati_payroll/templates/modules/prestamo/approve.html +156 -0
- coati_payroll/templates/modules/prestamo/condonacion.html +249 -0
- coati_payroll/templates/modules/prestamo/detail.html +443 -0
- coati_payroll/templates/modules/prestamo/form.html +203 -0
- coati_payroll/templates/modules/prestamo/index.html +150 -0
- coati_payroll/templates/modules/prestamo/pago_extraordinario.html +211 -0
- coati_payroll/templates/modules/prestamo/tabla_pago_pdf.html +181 -0
- coati_payroll/templates/modules/report/admin_index.html +125 -0
- coati_payroll/templates/modules/report/detail.html +129 -0
- coati_payroll/templates/modules/report/execute.html +266 -0
- coati_payroll/templates/modules/report/index.html +95 -0
- coati_payroll/templates/modules/report/permissions.html +64 -0
- coati_payroll/templates/modules/settings/index.html +274 -0
- coati_payroll/templates/modules/shared/concept_form.html +201 -0
- coati_payroll/templates/modules/shared/concept_index.html +145 -0
- coati_payroll/templates/modules/tipo_planilla/form.html +70 -0
- coati_payroll/templates/modules/tipo_planilla/index.html +68 -0
- coati_payroll/templates/modules/user/form.html +65 -0
- coati_payroll/templates/modules/user/index.html +76 -0
- coati_payroll/templates/modules/user/profile.html +81 -0
- coati_payroll/templates/modules/vacation/account_detail.html +149 -0
- coati_payroll/templates/modules/vacation/account_form.html +52 -0
- coati_payroll/templates/modules/vacation/account_index.html +68 -0
- coati_payroll/templates/modules/vacation/dashboard.html +156 -0
- coati_payroll/templates/modules/vacation/initial_balance_bulk.html +149 -0
- coati_payroll/templates/modules/vacation/initial_balance_form.html +93 -0
- coati_payroll/templates/modules/vacation/leave_request_detail.html +158 -0
- coati_payroll/templates/modules/vacation/leave_request_form.html +61 -0
- coati_payroll/templates/modules/vacation/leave_request_index.html +98 -0
- coati_payroll/templates/modules/vacation/policy_detail.html +176 -0
- coati_payroll/templates/modules/vacation/policy_form.html +152 -0
- coati_payroll/templates/modules/vacation/policy_index.html +79 -0
- coati_payroll/templates/modules/vacation/register_taken_form.html +178 -0
- coati_payroll/translations/en/LC_MESSAGES/messages.mo +0 -0
- coati_payroll/translations/en/LC_MESSAGES/messages.po +7283 -0
- coati_payroll/translations/es/LC_MESSAGES/messages.mo +0 -0
- coati_payroll/translations/es/LC_MESSAGES/messages.po +7374 -0
- coati_payroll/vacation_service.py +451 -0
- coati_payroll/version.py +18 -0
- coati_payroll/vistas/__init__.py +64 -0
- coati_payroll/vistas/calculation_rule.py +307 -0
- coati_payroll/vistas/carga_inicial_prestacion.py +423 -0
- coati_payroll/vistas/config_calculos.py +72 -0
- coati_payroll/vistas/configuracion.py +87 -0
- coati_payroll/vistas/constants.py +17 -0
- coati_payroll/vistas/currency.py +112 -0
- coati_payroll/vistas/custom_field.py +120 -0
- coati_payroll/vistas/employee.py +305 -0
- coati_payroll/vistas/empresa.py +153 -0
- coati_payroll/vistas/exchange_rate.py +341 -0
- coati_payroll/vistas/liquidacion.py +205 -0
- coati_payroll/vistas/payroll_concepts.py +580 -0
- coati_payroll/vistas/planilla/__init__.py +38 -0
- coati_payroll/vistas/planilla/association_routes.py +238 -0
- coati_payroll/vistas/planilla/config_routes.py +158 -0
- coati_payroll/vistas/planilla/export_routes.py +175 -0
- coati_payroll/vistas/planilla/helpers/__init__.py +34 -0
- coati_payroll/vistas/planilla/helpers/association_helpers.py +161 -0
- coati_payroll/vistas/planilla/helpers/excel_helpers.py +29 -0
- coati_payroll/vistas/planilla/helpers/form_helpers.py +97 -0
- coati_payroll/vistas/planilla/nomina_routes.py +488 -0
- coati_payroll/vistas/planilla/novedad_routes.py +227 -0
- coati_payroll/vistas/planilla/routes.py +145 -0
- coati_payroll/vistas/planilla/services/__init__.py +26 -0
- coati_payroll/vistas/planilla/services/export_service.py +687 -0
- coati_payroll/vistas/planilla/services/nomina_service.py +233 -0
- coati_payroll/vistas/planilla/services/novedad_service.py +126 -0
- coati_payroll/vistas/planilla/services/planilla_service.py +34 -0
- coati_payroll/vistas/planilla/validators/__init__.py +18 -0
- coati_payroll/vistas/planilla/validators/planilla_validators.py +40 -0
- coati_payroll/vistas/plugins.py +45 -0
- coati_payroll/vistas/prestacion.py +272 -0
- coati_payroll/vistas/prestamo.py +808 -0
- coati_payroll/vistas/report.py +432 -0
- coati_payroll/vistas/settings.py +29 -0
- coati_payroll/vistas/tipo_planilla.py +134 -0
- coati_payroll/vistas/user.py +172 -0
- coati_payroll/vistas/vacation.py +1045 -0
- coati_payroll-0.0.2.dist-info/LICENSE +201 -0
- coati_payroll-0.0.2.dist-info/METADATA +581 -0
- coati_payroll-0.0.2.dist-info/RECORD +243 -0
- coati_payroll-0.0.2.dist-info/WHEEL +5 -0
- coati_payroll-0.0.2.dist-info/entry_points.txt +2 -0
- coati_payroll-0.0.2.dist-info/top_level.txt +1 -0
coati_payroll/enums.py
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Copyright 2025 BMO Soluciones, S.A.
|
|
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.
|
|
14
|
+
"""Enumerations for type safety using Python 3.11+ StrEnum.
|
|
15
|
+
|
|
16
|
+
This module defines string-based enums using Python 3.11's StrEnum class,
|
|
17
|
+
which provides better type safety and autocompletion compared to plain strings.
|
|
18
|
+
|
|
19
|
+
StrEnum was introduced in Python 3.11 and automatically generates string values
|
|
20
|
+
from member names when values aren't explicitly provided.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
# <-------------------------------------------------------------------------> #
|
|
26
|
+
# Standard library
|
|
27
|
+
# <-------------------------------------------------------------------------> #
|
|
28
|
+
from enum import StrEnum
|
|
29
|
+
|
|
30
|
+
# <-------------------------------------------------------------------------> #
|
|
31
|
+
# Third party libraries
|
|
32
|
+
# <-------------------------------------------------------------------------> #
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# <-------------------------------------------------------------------------> #
|
|
36
|
+
# Third party libraries
|
|
37
|
+
# <-------------------------------------------------------------------------> #
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class FormulaType(StrEnum):
|
|
41
|
+
"""Types of formulas for calculating payroll concepts."""
|
|
42
|
+
|
|
43
|
+
FIJO = "fijo" # Fixed amount
|
|
44
|
+
PORCENTAJE = "porcentaje" # Percentage
|
|
45
|
+
PORCENTAJE_SALARIO = "porcentaje_salario" # Percentage of salary
|
|
46
|
+
PORCENTAJE_BRUTO = "porcentaje_bruto" # Percentage of gross
|
|
47
|
+
FORMULA = "formula" # Complex formula using FormulaEngine
|
|
48
|
+
REGLA_CALCULO = "regla_calculo" # Uses linked ReglaCalculo for calculation
|
|
49
|
+
HORAS = "horas" # Based on hours
|
|
50
|
+
DIAS = "dias" # Based on days
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class StepType(StrEnum):
|
|
54
|
+
"""Types of calculation steps in FormulaEngine schemas."""
|
|
55
|
+
|
|
56
|
+
CALCULATION = "calculation" # Mathematical calculation
|
|
57
|
+
CONDITIONAL = "conditional" # If/else logic
|
|
58
|
+
TAX_LOOKUP = "tax_lookup" # Tax table lookup
|
|
59
|
+
ASSIGNMENT = "assignment" # Variable assignment
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class NominaEstado(StrEnum):
|
|
63
|
+
"""States of a payroll run (Nomina).
|
|
64
|
+
|
|
65
|
+
All states are valid and permanent. Once a nomina reaches a state, it remains
|
|
66
|
+
in that state unless explicitly changed (e.g., ERROR can be retried, which
|
|
67
|
+
changes it to CALCULANDO).
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
CALCULANDO = "calculando" # Calculating in background
|
|
71
|
+
GENERADO = "generado" # Generated but not approved
|
|
72
|
+
APROBADO = "aprobado" # Approved and ready to apply
|
|
73
|
+
APLICADO = "aplicado" # Applied/executed
|
|
74
|
+
PAGADO = "pagado" # Paid out (synonym for APLICADO, for compatibility)
|
|
75
|
+
ANULADO = "anulado" # Cancelled/voided
|
|
76
|
+
ERROR = "error" # Error during calculation (valid permanent state, can be retried)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class AdelantoEstado(StrEnum):
|
|
80
|
+
"""States of a loan or salary advance."""
|
|
81
|
+
|
|
82
|
+
BORRADOR = "borrador" # Draft - not yet submitted
|
|
83
|
+
PENDIENTE = "pendiente" # Pending approval
|
|
84
|
+
APROBADO = "aprobado" # Approved and active
|
|
85
|
+
APLICADO = "aplicado" # Applied/disbursed (paid out to employee)
|
|
86
|
+
PAGADO = "pagado" # Fully paid off (all installments completed)
|
|
87
|
+
RECHAZADO = "rechazado" # Rejected
|
|
88
|
+
CANCELADO = "cancelado" # Cancelled
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class AdelantoTipo(StrEnum):
|
|
92
|
+
"""Types of advances/loans."""
|
|
93
|
+
|
|
94
|
+
ADELANTO = "adelanto" # Salary advance
|
|
95
|
+
PRESTAMO = "prestamo" # Loan with optional interest
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class TipoInteres(StrEnum):
|
|
99
|
+
"""Interest rate types for loans."""
|
|
100
|
+
|
|
101
|
+
NINGUNO = "ninguno" # No interest
|
|
102
|
+
SIMPLE = "simple" # Simple interest
|
|
103
|
+
COMPUESTO = "compuesto" # Compound interest
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class MetodoAmortizacion(StrEnum):
|
|
107
|
+
"""Amortization methods for loans with interest."""
|
|
108
|
+
|
|
109
|
+
FRANCES = "frances" # French method - constant payment (cuota constante)
|
|
110
|
+
ALEMAN = "aleman" # German method - constant amortization (amortización constante)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class VacacionEstado(StrEnum):
|
|
114
|
+
"""States of vacation requests."""
|
|
115
|
+
|
|
116
|
+
PENDIENTE = "pendiente" # Pending approval
|
|
117
|
+
APROBADO = "aprobado" # Approved
|
|
118
|
+
RECHAZADO = "rechazado" # Rejected
|
|
119
|
+
DISFRUTADO = "disfrutado" # Taken/enjoyed
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class TipoUsuario(StrEnum):
|
|
123
|
+
"""User types in the system."""
|
|
124
|
+
|
|
125
|
+
ADMIN = "admin" # Administrator
|
|
126
|
+
HHRR = "hhrr" # Human Resources
|
|
127
|
+
AUDIT = "audit" # Auditor
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class EstadoAprobacion(StrEnum):
|
|
131
|
+
"""Approval states for payroll concepts (percepciones, deducciones, prestaciones)."""
|
|
132
|
+
|
|
133
|
+
BORRADOR = "borrador" # Draft - not yet approved
|
|
134
|
+
APROBADO = "aprobado" # Approved and ready for use
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class TipoDetalle(StrEnum):
|
|
138
|
+
"""Types of payroll detail entries."""
|
|
139
|
+
|
|
140
|
+
INGRESO = "ingreso" # Income/perception
|
|
141
|
+
DEDUCCION = "deduccion" # Deduction
|
|
142
|
+
PRESTACION = "prestacion" # Employer benefit
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class Periodicidad(StrEnum):
|
|
146
|
+
"""Payroll periodicities."""
|
|
147
|
+
|
|
148
|
+
MENSUAL = "mensual" # Monthly
|
|
149
|
+
QUINCENAL = "quincenal" # Biweekly
|
|
150
|
+
SEMANAL = "semanal" # Weekly
|
|
151
|
+
DIARIO = "diario" # Daily
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class NovedadEstado(StrEnum):
|
|
155
|
+
"""States of a payroll novelty (novedad)."""
|
|
156
|
+
|
|
157
|
+
PENDIENTE = "pendiente" # Pending - not yet executed
|
|
158
|
+
EJECUTADA = "ejecutada" # Executed - nomina has been applied
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class TipoAcumulacionPrestacion(StrEnum):
|
|
162
|
+
"""Types of benefit accumulation periods."""
|
|
163
|
+
|
|
164
|
+
MENSUAL = "mensual" # Settled monthly (e.g., INSS, INATEC)
|
|
165
|
+
ANUAL = "anual" # Accumulated annually (e.g., 13th month)
|
|
166
|
+
VIDA_LABORAL = "vida_laboral" # Accumulated over employment lifetime (e.g., severance)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class CargaInicialEstado(StrEnum):
|
|
170
|
+
"""States for initial benefit balance loading."""
|
|
171
|
+
|
|
172
|
+
BORRADOR = "borrador" # Draft - not yet applied
|
|
173
|
+
APLICADO = "aplicado" # Applied - transferred to accumulated table
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class TipoTransaccionPrestacion(StrEnum):
|
|
177
|
+
"""Transaction types for accumulated benefits."""
|
|
178
|
+
|
|
179
|
+
SALDO_INICIAL = "saldo_inicial" # Initial balance
|
|
180
|
+
ADICION = "adicion" # Addition (increase)
|
|
181
|
+
DISMINUCION = "disminucion" # Decrease (reduction)
|
|
182
|
+
AJUSTE = "ajuste" # Adjustment (can be positive or negative)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
# ============================================================================
|
|
186
|
+
# Vacation Module Enums
|
|
187
|
+
# ============================================================================
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class AccrualMethod(StrEnum):
|
|
191
|
+
"""Methods for vacation accrual calculation."""
|
|
192
|
+
|
|
193
|
+
PERIODIC = "periodic" # Fixed amount per period (monthly, annually, etc.)
|
|
194
|
+
PROPORTIONAL = "proportional" # Based on worked days/hours
|
|
195
|
+
SENIORITY = "seniority" # Tiered by years of service
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
class AccrualFrequency(StrEnum):
|
|
199
|
+
"""Frequency of vacation accrual."""
|
|
200
|
+
|
|
201
|
+
MONTHLY = "monthly" # Monthly accrual
|
|
202
|
+
BIWEEKLY = "biweekly" # Every two weeks
|
|
203
|
+
ANNUAL = "annual" # Once per year
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class AccrualBasis(StrEnum):
|
|
207
|
+
"""Basis for proportional accrual calculation."""
|
|
208
|
+
|
|
209
|
+
DAYS_WORKED = "days_worked" # Based on days actually worked
|
|
210
|
+
HOURS_WORKED = "hours_worked" # Based on hours worked
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class VacationLedgerType(StrEnum):
|
|
214
|
+
"""Types of vacation ledger entries."""
|
|
215
|
+
|
|
216
|
+
ACCRUAL = "accrual" # Earned vacation time
|
|
217
|
+
USAGE = "usage" # Vacation time taken
|
|
218
|
+
ADJUSTMENT = "adjustment" # Manual adjustment (+ or -)
|
|
219
|
+
EXPIRATION = "expiration" # Expired vacation time
|
|
220
|
+
PAYOUT = "payout" # Paid out vacation (e.g., on termination)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class VacationUnitType(StrEnum):
|
|
224
|
+
"""Unit types for vacation balances."""
|
|
225
|
+
|
|
226
|
+
DAYS = "days" # Calendar or working days
|
|
227
|
+
HOURS = "hours" # Hours
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class ExpirationRule(StrEnum):
|
|
231
|
+
"""Rules for vacation expiration."""
|
|
232
|
+
|
|
233
|
+
NEVER = "never" # Vacation never expires
|
|
234
|
+
FISCAL_YEAR_END = "fiscal_year_end" # Expires at fiscal year end
|
|
235
|
+
ANNIVERSARY = "anniversary" # Expires on employment anniversary
|
|
236
|
+
CUSTOM_DATE = "custom_date" # Custom expiration date
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
# ============================================================================
|
|
240
|
+
# Reports Module Enums
|
|
241
|
+
# ============================================================================
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
class ReportType(StrEnum):
|
|
245
|
+
"""Types of reports in the system.
|
|
246
|
+
|
|
247
|
+
System reports are pre-defined, optimized reports built into the core.
|
|
248
|
+
Custom reports are user-defined reports created through the UI.
|
|
249
|
+
|
|
250
|
+
"""
|
|
251
|
+
|
|
252
|
+
SYSTEM = "system" # System-defined report
|
|
253
|
+
CUSTOM = "custom" # User-defined custom report
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class ReportStatus(StrEnum):
|
|
257
|
+
"""Administrative status of a report.
|
|
258
|
+
|
|
259
|
+
Controls whether a report is available for execution.
|
|
260
|
+
|
|
261
|
+
"""
|
|
262
|
+
|
|
263
|
+
ENABLED = "enabled" # Report is available for execution
|
|
264
|
+
DISABLED = "disabled" # Report is not available
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class ReportExecutionStatus(StrEnum):
|
|
268
|
+
"""Status of a report execution.
|
|
269
|
+
|
|
270
|
+
Tracks the lifecycle of a report execution from queued to completed.
|
|
271
|
+
|
|
272
|
+
"""
|
|
273
|
+
|
|
274
|
+
QUEUED = "queued" # Report execution is queued
|
|
275
|
+
RUNNING = "running" # Report is currently executing
|
|
276
|
+
COMPLETED = "completed" # Report execution completed successfully
|
|
277
|
+
FAILED = "failed" # Report execution failed
|
|
278
|
+
CANCELLED = "cancelled" # Report execution was cancelled
|