iteracion 2

This commit is contained in:
Nachou-u
2026-09-07 18:44:32 -03:00
parent a103a47ae6
commit 09a3f6fb37
93 changed files with 7394 additions and 349 deletions
+28
View File
@@ -0,0 +1,28 @@
{% extends 'base.html' %}
{% block content %}
<section class="page-view active">
<div class="view-header">
<div class="view-title">
<h2><i data-lucide="user-plus" style="color:var(--efintel-blue);"></i> {{ title }}</h2>
<p>Alta y modificación de ficha de colaborador en el sistema de remuneraciones EFINTEL.</p>
</div>
<div>
<a href="{% url 'payroll:employee_list' %}" class="btn-primary" style="background:var(--efintel-gray); text-decoration:none;">
<i data-lucide="arrow-left" style="width:16px;"></i> Volver
</a>
</div>
</div>
<div class="data-card" style="max-width:850px; margin:0 auto; padding:2rem;">
<form method="post" class="modern-form">
{% csrf_token %}
{% include "partials/_form_grid.html" %}
<div style="margin-top:1.5rem; display:flex; gap:1rem; justify-content:flex-end;">
<a href="{% url 'payroll:employee_list' %}" class="btn-secondary" style="text-decoration:none;">Cancelar</a>
<button type="submit" class="btn-primary"><i data-lucide="save" style="width:16px;"></i> Guardar Ficha de Colaborador</button>
</div>
</form>
</div>
</section>
{% endblock %}
+60
View File
@@ -0,0 +1,60 @@
{% extends 'base.html' %}
{% load humanize %}
{% block content %}
<section class="page-view active">
<div class="view-header">
<div class="view-title">
<h2><i data-lucide="users" style="color:var(--efintel-blue);"></i> Maestro de Colaboradores — Remuneraciones</h2>
<p>Ficha del colaborador, contratos, previsión (AFP/Fonasa/Isapre), y cuenta bancaria de abono.</p>
</div>
<div>
<a href="{% url 'payroll:employee_create' %}" class="btn-primary" style="text-decoration:none;">
<i data-lucide="user-plus" style="width:16px;"></i> + Nuevo Colaborador
</a>
</div>
</div>
<div class="data-card" x-data="{ search: '' }">
<div style="padding:1rem; border-bottom:1px solid var(--border-color);">
<input type="text" x-model="search" placeholder="Buscar por Nombre, RUT o Cargo..." class="form-control" style="width:100%; max-width:400px;">
</div>
<table class="data-table">
<thead>
<tr>
<th>RUT</th>
<th>Colaborador</th>
<th>Cargo</th>
<th>Tipo Contrato</th>
<th>Sueldo Base (CLP)</th>
<th>Previsión (AFP / Salud)</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
{% for emp in employees %}
<tr x-show="search === '' || '{{ emp.full_name|lower }} {{ emp.rut|lower }} {{ emp.job_title|lower }}'.includes(search.toLowerCase())">
<td><strong>{{ emp.rut }}</strong></td>
<td>{{ emp.full_name }}</td>
<td>{{ emp.job_title }}</td>
<td><span class="badge badge-blue">{{ emp.get_contract_type_display }}</span></td>
<td>${{ emp.base_salary_clp|floatformat:"0"|intcomma }} CLP</td>
<td>{{ emp.get_afp_display }} / {{ emp.get_health_system_display }}</td>
<td>
<a href="{% url 'payroll:employee_edit' emp.pk %}" class="btn-primary" style="padding:0.25rem 0.5rem; font-size:0.75rem; text-decoration:none;">
Editar Ficha
</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="7" style="text-align:center; padding:2rem; color:var(--text-secondary);">
No hay colaboradores registrados. <a href="{% url 'payroll:employee_create' %}">Registrar el primero</a>.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
{% endblock %}
+28
View File
@@ -0,0 +1,28 @@
{% extends 'base.html' %}
{% block content %}
<section class="page-view active">
<div class="view-header">
<div class="view-title">
<h2><i data-lucide="cpu" style="color:var(--efintel-blue);"></i> {{ title|default:"Motor de Cálculo Mensual de Remuneraciones" }}</h2>
<p>Procesamiento de sueldos imponibles, leyes sociales (AFP, Salud, AFC) y retenciones de impuestos.</p>
</div>
<div>
<a href="{% url 'payroll:slip_list' %}" class="btn-primary" style="background:var(--efintel-gray); text-decoration:none;">
<i data-lucide="arrow-left" style="width:16px;"></i> Volver
</a>
</div>
</div>
<div class="data-card" style="max-width:750px; margin:0 auto; padding:2rem;">
<form method="post" class="modern-form">
{% csrf_token %}
{% include "partials/_form_grid.html" %}
<div style="margin-top:1.5rem; display:flex; gap:1rem; justify-content:flex-end;">
<a href="{% url 'payroll:slip_list' %}" class="btn-secondary" style="text-decoration:none;">Cancelar</a>
<button type="submit" class="btn-primary"><i data-lucide="zap" style="width:16px;"></i> Ejecutar Motor de Cálculo</button>
</div>
</form>
</div>
</section>
{% endblock %}
+28
View File
@@ -0,0 +1,28 @@
{% extends 'base.html' %}
{% block content %}
<section class="page-view active">
<div class="view-header">
<div class="view-title">
<h2><i data-lucide="cpu" style="color:var(--efintel-blue);"></i> Motor de Cálculo Mensual de Remuneraciones</h2>
<p>Procesamiento masivo o individual de liquidaciones, leyes sociales (AFP, Fonasa/Isapre) e impuestos.</p>
</div>
<div>
<a href="{% url 'payroll:slip_list' %}" class="btn-primary" style="background:var(--efintel-gray); text-decoration:none;">
<i data-lucide="arrow-left" style="width:16px;"></i> Volver
</a>
</div>
</div>
<div class="data-card" style="max-width:750px; margin:0 auto; padding:2rem;">
<form method="post" class="modern-form">
{% csrf_token %}
{% include "partials/_form_grid.html" %}
<div style="margin-top:1.5rem; display:flex; gap:1rem; justify-content:flex-end;">
<a href="{% url 'payroll:slip_list' %}" class="btn-secondary" style="text-decoration:none;">Cancelar</a>
<button type="submit" class="btn-primary"><i data-lucide="zap" style="width:16px;"></i> Ejecutar Motor de Cálculo</button>
</div>
</form>
</div>
</section>
{% endblock %}
+94
View File
@@ -0,0 +1,94 @@
{% extends 'base.html' %}
{% load humanize %}
{% block content %}
<section class="page-view active">
<div class="view-header">
<div class="view-title">
<h2><i data-lucide="file-check" style="color:var(--efintel-blue);"></i> Liquidaciones de Sueldo Mensuales</h2>
<p>Procesamiento mensual de haberes, descuentos, emisión en PDF y libro de remuneraciones (LRE).</p>
</div>
<div style="display:flex; gap:0.5rem;">
<a href="{% url 'payroll:slip_generate' %}" class="btn-primary" style="text-decoration:none;">
<i data-lucide="cpu" style="width:16px;"></i> Generar Cálculo Mensual
</a>
<a href="{% url 'payroll:export_previred' %}" class="btn-primary" style="background:#107c41; text-decoration:none;">
<i data-lucide="download" style="width:16px;"></i> Archivo Previred
</a>
</div>
</div>
<div class="data-card" x-data="{ search: '' }">
<div style="padding:1rem; border-bottom:1px solid var(--border-color); display:flex; gap:1rem; align-items:flex-end;">
<form method="get" style="display:flex; gap:1rem; align-items:flex-end;">
<div>
<label style="font-size:0.8rem; font-weight:600; color:var(--text-secondary);">Mes</label>
<select name="month" class="form-control" style="min-width:120px;">
<option value="">Todos</option>
<option value="1" {% if selected_month == '1' %}selected{% endif %}>Enero</option>
<option value="2" {% if selected_month == '2' %}selected{% endif %}>Febrero</option>
<option value="3" {% if selected_month == '3' %}selected{% endif %}>Marzo</option>
<option value="4" {% if selected_month == '4' %}selected{% endif %}>Abril</option>
<option value="5" {% if selected_month == '5' %}selected{% endif %}>Mayo</option>
<option value="6" {% if selected_month == '6' %}selected{% endif %}>Junio</option>
<option value="7" {% if selected_month == '7' %}selected{% endif %}>Julio</option>
<option value="8" {% if selected_month == '8' %}selected{% endif %}>Agosto</option>
<option value="9" {% if selected_month == '9' %}selected{% endif %}>Septiembre</option>
<option value="10" {% if selected_month == '10' %}selected{% endif %}>Octubre</option>
<option value="11" {% if selected_month == '11' %}selected{% endif %}>Noviembre</option>
<option value="12" {% if selected_month == '12' %}selected{% endif %}>Diciembre</option>
</select>
</div>
<div>
<label style="font-size:0.8rem; font-weight:600; color:var(--text-secondary);">Año</label>
<input type="number" name="year" value="{{ selected_year }}" class="form-control" min="2000" max="2100" style="width:100px;">
</div>
<div>
<button type="submit" class="btn-primary" style="padding:0.5rem 1rem;">Filtrar</button>
</div>
</form>
<div style="flex:1;"></div>
<div>
<label style="font-size:0.8rem; font-weight:600; color:var(--text-secondary);">Buscar Colaborador</label>
<input type="text" x-model="search" placeholder="Nombre o RUT..." class="form-control" style="min-width:250px;">
</div>
</div>
<table class="data-table">
<thead>
<tr>
<th>Mes/Año</th>
<th>Colaborador</th>
<th>Haberes Imponibles</th>
<th>Descuentos</th>
<th>Sueldo Líquido (CLP)</th>
<th>Firma Electrónica</th>
</tr>
</thead>
<tbody>
{% for slip in slips %}
<tr x-show="search === '' || '{{ slip.employee.full_name|lower }} {{ slip.employee.rut|lower }}'.includes(search.toLowerCase())">
<td><strong>{{ slip.month }}/{{ slip.year }}</strong></td>
<td>{{ slip.employee.full_name }}</td>
<td>${{ slip.taxable_earnings_clp|floatformat:"0"|intcomma }} CLP</td>
<td>${{ slip.total_deductions_clp|floatformat:"0"|intcomma }} CLP</td>
<td><strong>${{ slip.net_salary_clp|floatformat:"0"|intcomma }} CLP</strong></td>
<td>
{% if slip.is_signed %}
<span class="badge badge-emerald">Firmada</span>
{% else %}
<span class="badge badge-turquoise">Pendiente Firma</span>
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" style="text-align:center; padding:2rem; color:var(--text-secondary);">
No hay liquidaciones emitidas para el periodo actual.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
{% endblock %}