feat: opcion 'sin contrato' para enviar numeroContrato null en TNS
- Agrega columna sin_contrato en tabla contratos (migration automatica) - Contrato 040 marcado excluir=0, sin_contrato=1 en seed - load_sin_contrato_set() retorna contratos que deben ir con null - generar_rda_paciente acepta sin_contrato_set y fuerza numeroContrato=null - Automation paso 2 y 3 pasan sin_contrato_set al generador - Pagina contratos: columna y toggle "Sin contrato", checkbox en modal editar Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
eeabb6268e
commit
9f2bd5164e
@@ -68,6 +68,7 @@
|
||||
<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">Sin Contrato</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-semibold text-gray-500 uppercase">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -105,7 +106,20 @@
|
||||
</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 }})"
|
||||
<form method="POST" action="/contratos/toggle-sin-contrato/{{ c.id }}" class="inline">
|
||||
{% if c.sin_contrato %}
|
||||
<button type="submit" class="inline-flex items-center gap-1 px-2.5 py-1 bg-yellow-100 text-yellow-700 hover:bg-yellow-200 rounded-full text-xs font-medium transition-colors" title="numeroContrato: null en JSON">
|
||||
<i class="fas fa-unlink text-xs"></i> Sin contrato
|
||||
</button>
|
||||
{% else %}
|
||||
<button type="submit" class="inline-flex items-center gap-1 px-2.5 py-1 bg-gray-100 text-gray-400 hover:bg-gray-200 rounded-full text-xs font-medium transition-colors">
|
||||
<i class="fas fa-link text-xs"></i> Normal
|
||||
</button>
|
||||
{% endif %}
|
||||
</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 }})"
|
||||
class="text-blue-600 hover:text-blue-800 mr-3 text-xs">
|
||||
<i class="fas fa-edit"></i> Editar
|
||||
</button>
|
||||
@@ -161,9 +175,15 @@
|
||||
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-2">
|
||||
<input type="checkbox" name="excluir" id="edit-excluir" value="1" class="rounded">
|
||||
<label for="edit-excluir" class="text-sm text-gray-700">Excluir del envío TNS</label>
|
||||
<div class="flex items-center gap-6">
|
||||
<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>
|
||||
</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>
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex justify-end space-x-3 pt-2">
|
||||
<button type="button" onclick="closeEdit()"
|
||||
@@ -180,13 +200,14 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function openEdit(id, nc, nit, tu, desc, excluir) {
|
||||
function openEdit(id, nc, nit, tu, desc, excluir, sinContrato) {
|
||||
document.getElementById('edit-form').action = '/contratos/update/' + id;
|
||||
document.getElementById('edit-nc').value = nc;
|
||||
document.getElementById('edit-nit').value = nit;
|
||||
document.getElementById('edit-tu').value = tu;
|
||||
document.getElementById('edit-desc').value = desc;
|
||||
document.getElementById('edit-excluir').checked = excluir === 1;
|
||||
document.getElementById('edit-sin-contrato').checked = sinContrato === 1;
|
||||
document.getElementById('edit-modal').classList.remove('hidden');
|
||||
}
|
||||
function closeEdit() {
|
||||
|
||||
Reference in New Issue
Block a user