Fix: Cambios solicitados. Parte 1
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 6m18s
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 6m18s
This commit is contained in:
@@ -61,13 +61,13 @@ namespace GestionIntegral.Api.Data.Repositories.Distribucion
|
||||
}
|
||||
if (fechaDesde.HasValue)
|
||||
{
|
||||
sqlBuilder.Append(" AND sb.FechaRemito >= @FechaDesdeParam"); // O FechaEstado según el contexto del filtro
|
||||
sqlBuilder.Append(" AND sb.FechaRemito >= @FechaDesdeParam");
|
||||
parameters.Add("FechaDesdeParam", fechaDesde.Value.Date);
|
||||
}
|
||||
if (fechaHasta.HasValue)
|
||||
{
|
||||
sqlBuilder.Append(" AND sb.FechaRemito <= @FechaHastaParam"); // O FechaEstado
|
||||
parameters.Add("FechaHastaParam", fechaHasta.Value.Date.AddDays(1).AddTicks(-1)); // Hasta el final del día
|
||||
sqlBuilder.Append(" AND sb.FechaRemito <= @FechaHastaParam");
|
||||
parameters.Add("FechaHastaParam", fechaHasta.Value.Date);
|
||||
}
|
||||
|
||||
sqlBuilder.Append(" ORDER BY sb.FechaRemito DESC, sb.NroBobina;");
|
||||
@@ -224,14 +224,12 @@ namespace GestionIntegral.Api.Data.Repositories.Distribucion
|
||||
|
||||
if (actual == null) throw new KeyNotFoundException("Bobina no encontrada para eliminar.");
|
||||
|
||||
// --- INICIO DE CAMBIO EN VALIDACIÓN ---
|
||||
// Permitir eliminar si está Disponible (1) o Dañada (3)
|
||||
if (actual.IdEstadoBobina != 1 && actual.IdEstadoBobina != 3)
|
||||
{
|
||||
_logger.LogWarning("Intento de eliminar bobina {IdBobina} que no está en estado 'Disponible' o 'Dañada'. Estado actual: {EstadoActual}", idBobina, actual.IdEstadoBobina);
|
||||
return false; // Devolver false si no cumple la condición para ser eliminada
|
||||
}
|
||||
// --- FIN DE CAMBIO EN VALIDACIÓN ---
|
||||
|
||||
const string sqlDelete = "DELETE FROM dbo.bob_StockBobinas WHERE Id_Bobina = @IdBobinaParam";
|
||||
const string sqlInsertHistorico = @"
|
||||
|
||||
Reference in New Issue
Block a user