feat: excluir_ventas independiente por contrato
- Nueva columna excluir_ventas en tabla contratos (migración automática) - load_excluded_ventas_set() para filtrar en /ventas - Toggle independiente en /contratos para RDA y Ventas por separado - Modal edición con checkbox excluir_ventas - 040 marcado excluir_rda=1, excluir_ventas=0 en seed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
af71968c7f
commit
f103d536c7
@@ -67,7 +67,8 @@
|
||||
<th class="px-4 py-3 text-left text-xs font-semibold text-gray-500 uppercase">NIT Empresa</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-semibold text-gray-500 uppercase">Tipo Usuario</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-semibold text-gray-500 uppercase">Descripción</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-semibold text-gray-500 uppercase">Envío TNS</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-semibold text-gray-500 uppercase">Excluir RDA</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-semibold text-gray-500 uppercase">Excluir Ventas</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-semibold text-gray-500 uppercase">Sin Contrato</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-semibold text-gray-500 uppercase">Acciones</th>
|
||||
</tr>
|
||||
@@ -105,6 +106,19 @@
|
||||
{% endif %}
|
||||
</form>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<form method="POST" action="/contratos/toggle-excluir-ventas/{{ c.id }}" class="inline">
|
||||
{% if c.excluir_ventas %}
|
||||
<button type="submit" class="inline-flex items-center gap-1 px-2.5 py-1 bg-red-100 text-red-700 hover:bg-red-200 rounded-full text-xs font-medium transition-colors">
|
||||
<i class="fas fa-ban text-xs"></i> Excluido
|
||||
</button>
|
||||
{% else %}
|
||||
<button type="submit" class="inline-flex items-center gap-1 px-2.5 py-1 bg-emerald-100 text-emerald-700 hover:bg-emerald-200 rounded-full text-xs font-medium transition-colors">
|
||||
<i class="fas fa-check text-xs"></i> Activo
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<form method="POST" action="/contratos/toggle-sin-contrato/{{ c.id }}" class="inline">
|
||||
{% if c.sin_contrato %}
|
||||
@@ -119,7 +133,7 @@
|
||||
</form>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<button onclick="openEdit({{ c.id }}, '{{ c.numero_contrato }}', '{{ c.nit_empresa }}', '{{ c.tipo_usuario }}', '{{ c.descripcion }}', {{ c.excluir }}, {{ c.sin_contrato }})"
|
||||
<button onclick="openEdit({{ c.id }}, '{{ c.numero_contrato }}', '{{ c.nit_empresa }}', '{{ c.tipo_usuario }}', '{{ c.descripcion }}', {{ c.excluir }}, {{ c.sin_contrato }}, {{ c.excluir_ventas }})"
|
||||
class="text-blue-600 hover:text-blue-800 mr-3 text-xs">
|
||||
<i class="fas fa-edit"></i> Editar
|
||||
</button>
|
||||
@@ -175,14 +189,18 @@
|
||||
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="flex flex-wrap items-center gap-4">
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" name="excluir" id="edit-excluir" value="1" class="rounded">
|
||||
<span class="text-sm text-gray-700">Excluir del envío TNS</span>
|
||||
<span class="text-sm text-gray-700">Excluir RDA <span class="text-xs text-red-500">(bloquea transacción/automation)</span></span>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" name="excluir_ventas" id="edit-excluir-ventas" value="1" class="rounded">
|
||||
<span class="text-sm text-gray-700">Excluir Ventas <span class="text-xs text-red-500">(bloquea /ventas)</span></span>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" name="sin_contrato" id="edit-sin-contrato" value="1" class="rounded">
|
||||
<span class="text-sm text-gray-700">Enviar sin contrato <span class="text-xs text-yellow-600">(numeroContrato: null)</span></span>
|
||||
<span class="text-sm text-gray-700">Sin contrato <span class="text-xs text-yellow-600">(numeroContrato: null)</span></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex justify-end space-x-3 pt-2">
|
||||
@@ -200,7 +218,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function openEdit(id, nc, nit, tu, desc, excluir, sinContrato) {
|
||||
function openEdit(id, nc, nit, tu, desc, excluir, sinContrato, excluirVentas) {
|
||||
document.getElementById('edit-form').action = '/contratos/update/' + id;
|
||||
document.getElementById('edit-nc').value = nc;
|
||||
document.getElementById('edit-nit').value = nit;
|
||||
@@ -208,6 +226,7 @@ function openEdit(id, nc, nit, tu, desc, excluir, sinContrato) {
|
||||
document.getElementById('edit-desc').value = desc;
|
||||
document.getElementById('edit-excluir').checked = excluir === 1;
|
||||
document.getElementById('edit-sin-contrato').checked = sinContrato === 1;
|
||||
document.getElementById('edit-excluir-ventas').checked = excluirVentas === 1;
|
||||
document.getElementById('edit-modal').classList.remove('hidden');
|
||||
}
|
||||
function closeEdit() {
|
||||
|
||||
Reference in New Issue
Block a user