Employee Management
Employee Model Overview
Each employee record includes:| Field | Type | Description |
|---|---|---|
user | OneToOneField | Optional link to system user account |
nombre | CharField(100) | Full name |
cargo | CharField(100) | Job title/position |
salario | DecimalField(10,2) | Base salary |
fecha_contratacion | DateField | Hire date |
estado | CharField | Status (see below) |
tipo_contrato | CharField | Contract type (see below) |
email | EmailField | Contact email (optional) |
telefono | CharField(20) | Phone number (validated format) |
direccion | TextField | Home address (optional) |
Employee Status Options
Employees can have one of five statuses:- activo: Currently working
- inactivo: No longer employed
- vacaciones: On vacation leave
- permiso: Temporary leave of absence
- suspendido: Suspended from duties
Contract Types
Supported employment arrangements:- tiempo_completo: Full-time employment
- medio_tiempo: Part-time employment
- temporal: Temporary/seasonal contract
- por_proyecto: Project-based contract
Employees can be linked to system user accounts for access control. If linked, their role is automatically pulled from the user’s
userprofile.rol.Adding Employees
Enter Basic Information
- Full name (
nombre) - Job title (
cargo) - optional if linked to system user - Base salary (
salario) - Hire date (
fecha_contratacion)
Set Employment Details
- Status: Select from
activo,inactivo, etc. - Contract Type: Choose the employment arrangement
Link User Account (Optional)
If this employee needs system access, link their user account. This syncs their role automatically.
Managing Bonuses (Bonificaciones)
Bonuses are additional recurring or one-time payments beyond base salary.Bonus Structure
| Field | Type | Description |
|---|---|---|
empleado | ForeignKey | Associated employee |
nombre | CharField(100) | Bonus name (e.g., “Performance Bonus”) |
monto | DecimalField(10,2) | Bonus amount |
recurrente | BooleanField | Recurring monthly bonus? |
fecha_inicio | DateField | Start date |
fecha_fin | DateField | End date (optional for ongoing) |
activa | BooleanField | Is bonus currently active? |
created_by | ForeignKey | User who created the bonus |
modified_by | ForeignKey | User who last modified it |
Adding a Bonus
Define Bonus Details
- Name: Descriptive title (e.g., “Sales Commission”)
- Amount: Bonus value
- Recurring: Check if this bonus applies every pay period
- Start Date: When the bonus begins
- End Date: Optional - leave blank for ongoing bonuses
The
esta_vigente property automatically checks if a bonus is currently valid based on dates and active status.Calculating Total Salary
The employee model provides a method to calculate total compensation:Payment Tracking (Pagos)
Record all payments made to employees:Payment Types
- salario: Regular salary payment
- bono: Bonus payment
- vacaciones: Vacation pay
- liquidacion: Final settlement payment
- otro: Other payment types
Recording Payments
Enter Payment Details
- Date: Payment date (defaults to today)
- Amount: Payment amount
- Type: Select payment type
- Description: Optional notes
Payment Model
| Field | Type | Description |
|---|---|---|
empleado | ForeignKey | Employee receiving payment |
fecha_pago | DateField | Payment date |
monto | DecimalField(10,2) | Payment amount |
tipo | CharField | Payment type (choices above) |
descripcion | TextField | Optional details |
comprobante | FileField | Payment receipt file |
created_by | ForeignKey | User who recorded payment |
modified_by | ForeignKey | User who last modified |
fecha_creacion | DateTimeField | Created timestamp |
fecha_modificacion | DateTimeField | Last updated timestamp |
Employee Properties
The employee model includes helpful properties:antiguedad (Seniority)
Automatically calculates years of service:
tiene_usuario (Has User)
Checks if employee has a linked system account:
usuario_activo (Active User)
Verifies if linked user account is active:
Payroll Reports
Generate comprehensive payroll reports:Report Contents
- Total active employees
- Total salary commitments
- Distribution by contract type
- Detailed employee list with:
- Name, position, contract type
- Base salary
- Years of service
Generating Payroll Reports
Best Practices
Regular Status Updates
Regular Status Updates
Update employee status promptly when they go on leave, vacation, or are suspended to ensure accurate payroll calculations.
Document All Payments
Document All Payments
Always attach payment receipts (
comprobante) for audit compliance and to resolve disputes.Review Bonuses Quarterly
Review Bonuses Quarterly
Check active bonuses every quarter to deactivate expired ones and ensure current bonuses are accurate.
Link System Users
Link System Users
Connect employee records to user accounts for seamless permission management and role synchronization.
Track Seniority
Track Seniority
Use the
antiguedad property for annual reviews, raises, and recognition programs.Validation Rules
Phone Number Format
Phone numbers must match the pattern:+?1?\d{9,15}$
- Optional country code (+)
- 9-15 digits
- Example: +573222271308
Integration with Reports
Payroll data integrates with the general reports module:- Nominas Report: Detailed employee and salary breakdown
- General Report: Includes payroll as part of operational expenses
For financial analysis, payroll expenses can be compared against sales in the General Report type.
Troubleshooting
Bonus Not Included in Total Salary
Bonus Not Included in Total Salary
Verify the bonus is marked as
activa=True and the date range is current. Use the esta_vigente property to check validity.Cannot Link User Account
Cannot Link User Account
Ensure the user account exists and is not already linked to another employee (OneToOne constraint).
Payment Not in Report
Payment Not in Report
Check that the payment date falls within the report period and that you’ve regenerated the report after adding payments.
Phone Validation Error
Phone Validation Error
Use international format with country code (e.g., +57 for Colombia). Ensure 9-15 digits total.
Next Steps: Learn about Expense Tracking and Reports.
