-cambios en validacion de uso de Secciones Almacen, Serie,Lote, Caducidad

This commit is contained in:
rrene
2020-05-13 12:34:06 -07:00
parent e80335be56
commit 552154d81d
25 changed files with 8255 additions and 5106 deletions

View File

@@ -25,6 +25,7 @@ Public Class ClsContabilidad
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'REGISTRAR CONEXIONES ABIERTAS
Private CveConexion As Integer = 0
Public Property CvePrePolizaDetalle As Integer
#End Region
#Region " P R O P I E D A D E S"
@@ -899,11 +900,17 @@ Public Class ClsContabilidad
.Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
.Add("@CveCreditoDetalle", SqlDbType.Int).Value = CveCreditoDetalle
.Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto
.Add("@CvePrePolizaDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
CvePrePolizaDetalle = SqlAdapter.SelectCommand.Parameters("@CvePrePolizaDetalle").Value.ToString.ToEntero
If CvePrePolizaDetalle > 0 Then
Retorno = True
End If
Catch ex1 As SqlException
If ex1.Message.Contains("50015;") Then
OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)

View File

@@ -80,7 +80,7 @@ Public Class ClsInventarios
Public Property CveSubProyectoInventario As Integer
Public Property SubProyecto As String
Public Property SubProyectoInventario As String
Public Property SerieLote As String
Public Property Serie As String
Public Property Guia As String
Public Property TipoCambio As Double
Public Property FolioVenta As String
@@ -98,6 +98,7 @@ Public Class ClsInventarios
Public Property CveCliente As Integer
Public Property CveClienteSucursal As Integer
Public Property NombreCliente As String
Public Property CveProveedor As Integer
Public Property DepartamentoEntrega As String
Public Property PedidoContrato As String
Public Property GastoIndirecto As Double
@@ -568,22 +569,11 @@ Public Class ClsInventarios
#End Region
#Region " SECCIONES ALMACENES "
Public Function GetSeccionesAlmacenes() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_INV_SeccionesAlmacenesGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el Catálogo de Secciones de Almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateSeccion(CveSeccion As Integer, Seccion As String, Estatus As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_INV_SeccionesAlmacenesUpdate")
DataAdapter("PA_Inv_SeccionesAlmacenesUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSeccion", SqlDbType.Int).Value = CveSeccion
@@ -606,10 +596,11 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetSeccionesAlmacenes(CveSeccion As Integer) As Boolean
Public Function GetSeccionesAlmacenes(CveEmpresa As Integer, CveSeccion As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_SeccionesAlmacenesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSeccion", SqlDbType.Int).Value = CveSeccion
End With
Try
@@ -824,6 +815,7 @@ Public Class ClsInventarios
CveCliente = If(dr("CveCliente").ToString.ToEntero > 0, dr("CveCliente").ToString.ToEntero, -1)
CveClienteSucursal = If(dr("CveClienteSucursal").ToString.ToEntero > 0, dr("CveClienteSucursal").ToString.ToEntero, -1)
NombreCliente = dr("Nombre").ToString
CveProveedor = If(dr("CveProveedor").ToString.ToEntero > 0, dr("CveProveedor").ToString.ToEntero, -1)
DepartamentoEntrega = dr("DepartamentoEntrega").ToString
PedidoContrato = dr("PedidoContrato").ToString
TienePrePoliza = dr("TienePrePoliza").ToString.ToEntero
@@ -1260,37 +1252,38 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function AddMovimientoDetalle(CveMovimiento As Integer, Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Decimal, CveAF As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional SerieLote As String = "",
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1, Optional FechaCaducidad As Date = MinFecha,
Public Function AddMovimientoDetalle(CveMovimiento As Integer, Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Decimal, Optional CveAF As Integer = -1,
Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha,
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1,
Optional CostoIndirecto As Decimal = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
Optional Lote As String = "", Optional Batch As String = "", Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1) As Boolean
Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@CveUM", SqlDbType.Int).Value = CveUM
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@CveUM", SqlDbType.Int).Value = CveUM
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@PU", SqlDbType.Decimal).Value = PU
.Add("@PUTC", SqlDbType.Decimal).Value = PUTC
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CostoIndirecto", SqlDbType.Decimal).Value = CostoIndirecto
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Lote", SqlDbType.VarChar).Value = Lote
.Add("@Batch", SqlDbType.VarChar).Value = Batch
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveMovimientoDetalleEntrada", SqlDbType.Int).Value = CveMovimientoDetalleEntrada
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
.Add("@CostoIndirecto", SqlDbType.Decimal).Value = CostoIndirecto
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
.Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = CveOrdenCompraDetalle
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@CveMovimientoDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@EsInterno", SqlDbType.Int).Value = EsInterno
.Add("@CveMovimientoDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
@@ -1313,7 +1306,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function UpdateMovimientoDetalle(Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Double, CveAF As Integer, CveMovimientoDetalle As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional SerieLote As String = "",
Public Function UpdateMovimientoDetalle(Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Double, CveAF As Integer, CveMovimientoDetalle As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "",
Optional Observaciones As String = "-1", Optional PUTC As Double = -1, Optional CveUsuarioModifico As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1328,7 +1321,7 @@ Public Class ClsInventarios
.Add("@PUTC", SqlDbType.Money).Value = PUTC
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With
@@ -1765,8 +1758,10 @@ Public Class ClsInventarios
#Region " INVENTARIOS - EXISTENCIAS "
Public Function GetExistenciasPS(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
Optional FechaMovto As String = "-1",
Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha,
Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1,
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Decimal
Dim Retorno As Decimal = -1
@@ -1784,9 +1779,9 @@ Public Class ClsInventarios
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Lote", SqlDbType.VarChar).Value = Lote
.Add("@Batch", SqlDbType.VarChar).Value = Batch
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
@@ -1816,9 +1811,10 @@ Public Class ClsInventarios
End Function
Public Function GetExistenciasProducto(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional Caducidad As Date = MinFecha) As Boolean
Optional FechaMovto As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional Serie As String = "-1", Optional Lote As String = "-1", Optional Caducidad As Date = MinFecha,
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1,
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_ExistenciasGet")
@@ -1827,20 +1823,19 @@ Public Class ClsInventarios
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Lote", SqlDbType.VarChar).Value = Lote
.Add("@Batch", SqlDbType.VarChar).Value = Batch
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Lote", SqlDbType.VarChar).Value = Lote
.Add("@Caducidad", SqlDbType.Date).Value = Caducidad
.Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
.Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
.Add("@Caducidad", SqlDbType.Date).Value = Caducidad
.Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output
End With
Try
@@ -1852,21 +1847,18 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetExistenciasPSSerie(SerieLote As String, CveAlmacen As Integer, CveEmpresa As Integer, Optional FechaMovto As String = "-1") As Decimal
If SerieLote = "" Then Return 0
Public Function GetExistenciasPSSerie(Serie As String, CveAlmacen As Integer, CveEmpresa As Integer, Optional CveSeccionAlmacen As Integer = -1) As Decimal
If Serie = "" Then Return 0
Dim Retorno As Decimal = 0
If FechaMovto = "-1" Then
FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd"))
End If
DataAdapter("PA_Inv_ExistenciasPSSerieGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
' .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
.Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output
@@ -1889,13 +1881,13 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetCostoPSSerie(CvePS As Integer, SerieLote As String, CveAlmacen As Integer, CveEmpresa As Integer) As Decimal
Public Function GetCostoPSSerie(CvePS As Integer, Serie As String, CveAlmacen As Integer, CveEmpresa As Integer) As Decimal
Dim Retorno As Decimal = 0
DataAdapter("PA_Inv_CostoPSSerieGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@Costo", SqlDbType.Money).Direction = ParameterDirection.Output
@@ -1958,7 +1950,7 @@ Public Class ClsInventarios
Public Function GetExistenciasPSEmpaque(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1977,7 +1969,7 @@ Public Class ClsInventarios
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Lote", SqlDbType.VarChar).Value = Lote
.Add("@Batch", SqlDbType.VarChar).Value = Batch
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
@@ -2024,7 +2016,7 @@ Public Class ClsInventarios
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al momento de vericar la existencia de los productos por xml.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
OnError("Ocurrió un error al momento de verificar la existencia de los productos por xml.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
@@ -2422,7 +2414,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function AddInventarioFisicoDetalle(CveInventarioFisico As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double, SerieLote As String, CveUsuario As Integer) As Boolean
Public Function AddInventarioFisicoDetalle(CveInventarioFisico As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double, Serie As String, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoDetalleAdd")
@@ -2432,7 +2424,7 @@ Public Class ClsInventarios
.Add("@CveUM", SqlDbType.Int).Value = CveUM
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Estatus", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -2444,7 +2436,7 @@ Public Class ClsInventarios
Retorno = True
ElseIf SqlAdapter.SelectCommand.Parameters("@Estatus").Value.ToString.ToEntero = 2 Then
Retorno = False
Alert($"Ya existe la Serie <b>{SerieLote}</b> en el inventario actual.", TipoMensaje.MsgAdvertencia)
Alert($"Ya existe la Serie <b>{Serie}</b> en el inventario actual.", TipoMensaje.MsgAdvertencia)
End If
Catch Ex1 As SqlException
@@ -2839,15 +2831,16 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function SerieLoteRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean
Public Function SerieRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1, Optional CveSeccionAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_SerieLoteRecomendadoGet")
DataAdapter("PA_Inv_SerieRecomendadoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With
@@ -2855,15 +2848,15 @@ Public Class ClsInventarios
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener la Serie/Lote recomendado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
OnError("Ocurrió un error al obtener la Serie recomendado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function LoteBatchRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean
Public Function LoteRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_LoteBatchRecomendadoGet")
DataAdapter("PA_Inv_LoteRecomendadoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
@@ -3014,7 +3007,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetEstatusVentaPorSurir(CveVenta As Integer) As Boolean
Public Function GetEstatusVentaPorSurtir(CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EstatusVentaPorSurtirGet")
@@ -3358,7 +3351,7 @@ Public Class ClsInventarios
End Function
#Region " INVENTARIOS - COSTO PS "
Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, SerieLote As String, FechaFin As Datetime, Optional CveSubProyecto As Integer = -1, Optional CveTipoAlmacen As Integer = 1) As Decimal
Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, Serie As String, FechaFin As DateTime, Optional CveSubProyecto As Integer = -1, Optional CveTipoAlmacen As Integer = 1) As Decimal
Dim Retorno As Decimal = -1D
DataAdapter("PA_Inv_PSCostoGet")
@@ -3366,7 +3359,7 @@ Public Class ClsInventarios
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
@@ -4734,41 +4727,60 @@ Public Class ClsInventarios
#Region "MOVIMIENTOS DETALLE SECCION ALMACEN"
Public Function AddMovimientosDetalleSeccionesAlmacen(CveMovimientoDetalle As Integer, CveSeccionAlmacen As Integer, Cantidad As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetMovimientosDetalleSeccionesAlmacen(CveSeccionAlmacen As Integer, CveAlmacen As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean
Public Function GetMovimientosDetalleSeccionesAlmacen(CveAlmacen As Integer, CveClasificacion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenGet")
DataAdapter("PA_Inv_MovimientosDetalleAjusteSeccionesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
OnError("Ocurrió un error al obtener movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
'Public Function AddMovimientosDetalleSeccionesAlmacen(CveMovimientoDetalle As Integer, CveSeccionAlmacen As Integer, Cantidad As Decimal) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenAdd")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle
' .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
' .Add("@Cantidad", SqlDbType.Float).Value = Cantidad
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
'Public Function GetMovimientosDetalleSeccionesAlmacen(CveSeccionAlmacen As Integer, CveAlmacen As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenGet")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
' .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
' .Add("@CvePS", SqlDbType.Int).Value = CvePS
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
Public Function GetExistenciaSeccionAlmacen(CveVenta As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_ExistenciaSeccionAlmacenGet")
@@ -4786,23 +4798,23 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetKardexSeccionAlmacen(CvePS As Integer, CveAlmacen As Integer, CveSeccionAlmacen As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_KardexSeccionAlmacenGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el kardex de seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
'Public Function GetKardexSeccionAlmacen(CvePS As Integer, CveAlmacen As Integer, CveSeccionAlmacen As Integer, CveEmpresa As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_Inv_KardexSeccionAlmacenGet")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CvePS", SqlDbType.Int).Value = CvePS
' .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
' .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al obtener el kardex de seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
Public Function AddProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionAdd")

View File

@@ -1345,7 +1345,27 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function UpdateAplicaSeccionAlmacen(CvePS As Integer, CveEmpresa As Integer, AplicaSeccionAlmacen As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ProductosServiciosSeccionAlmacenUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@AplicaSeccionAlmacen", SqlDbType.Bit).Value = AplicaSeccionAlmacen
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Catch ex As Exception
OnError("Ocurrió un error al actualizar aplica seccion almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetMarcas(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -1346,8 +1346,8 @@ Public Class WS_PuntoVenta
Dim objInventario As New ClsInventarios
Dim Respuesta As New RespuestaWS
If objInventario.GetSeccionesAlmacenes(-1) Then
Respuesta.Datos = objInventario.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa))
If objInventario.GetSeccionesAlmacenes(CveEmpresa, -1) Then
Respuesta.Datos = objInventario.DtResultados '.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa))
Respuesta.Datos.TableName = "Inv_SeccionesAlmacenes"
Respuesta.HuboError = False
End If

View File

@@ -194,7 +194,7 @@
Dim Objinventarios As New ClsInventarios
If Objinventarios.GetAlmacenes(-1, -1, -1, -1) Then Application("GlobalDTAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTAlmacen") = Nothing
If Objinventarios.GetSeccionesAlmacenes(-1) Then Application("GlobalDTSeccionAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTSeccionAlmacen") = Nothing
If Objinventarios.GetSeccionesAlmacenes(-1, -1) Then Application("GlobalDTSeccionAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTSeccionAlmacen") = Nothing
If Objinventarios.GetTiposAlmacenes Then Application("GlobalDTTipoAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTTipoAlmacen") = Nothing
If Objinventarios.GetConceptos Then Application("GlobalDTInvConceptos") = Objinventarios.DtResultados Else Application("GlobalDTInvConceptos") = Nothing
Objinventarios.Dispose()

View File

@@ -0,0 +1,70 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="AjustesSeccionAlmacen.aspx.vb" Inherits="Inventarios_AjustesSeccionAlmacen" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Ajustes de Productos en Secciones de Almacen
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltraEntrega" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption ">
<label class="col-md-1 truncate" style="text-align: right;">Almacen:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlAlmacen" runat="server" DataValueField="CveAlmacen" DataTextField="Almacen" class="select2me" Width="300px"></asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="text-align: right;">Clasificacion:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlClasificaciones" runat="server" DataValueField="CveClasificacion" DataTextField="Clasificacion" class="select2me" Width="300px" ></asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel runat="server" ID="UppD" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvD" DataKeyNames="CvePS,CveUM,CveAlmacen,PU,Existencia,Serie,CveSeccionAlmacen,FechaCaducidad,Lote" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Sección Actual" DataField="AlmacenSeccion" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Existencia" DataField="Existencia" DataFormatString="{0:#,###.##}" ItemStyle-Width="5%" />
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="Chk" Checked="true" runat="server" ></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nueva Seccion" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:DropDownList ID="DDlS" runat="server" Width="150px" DataValueField="CveAlmacenSeccion" DataTextField="AlmacenSeccion" class="select2me"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="BtnCambiarSeccion" runat="server" Text="Cambiar Sección" CssClass="btn btn-primary" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,144 @@

Imports System.Data
Imports Extensiones
Partial Class Inventarios_AjustesSeccionAlmacen
Inherits ClsPaginas
Private Sub Inventarios_AjustesSeccionAlmacen_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
End If
End Sub
Private Sub CargaCombos()
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
DdlAlmacen.DataBind()
DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificaciones.DataBind()
DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjInv As New ClsInventarios
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvD.DataSource = ObjInv.DtResultados
End If
ObjInv.Dispose()
GvD.DataBind()
UppD.Update()
End Sub
Private Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvD.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCDropDownList("DDlS").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
e.Row.FCDropDownList("DDlS").DataBind()
End If
End Sub
Private Sub BtnCambiarSeccion_Click(sender As Object, e As EventArgs) Handles BtnCambiarSeccion.Click
Dim ObjInventario As New ClsInventarios
Dim ObjPS As New ClsProductosServicios(ObjInventario.IniciaTransacSQL)
Dim Dtt As DataTable = Nothing
Dim CveMovimientoEntrada As Integer = 0
Dim Folio = 0
Dim ErrorMovInv As Boolean = False
Dim TextoError = ""
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero
Dim Fecha As Date = DateTime.Now
'AGREGAMOS LA ENTRADA
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:="", Modulo:="ASA/G1")
Folio = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
TextoError = "No se pudo generar el movimiento de salida correctamente"
ErrorMovInv = True
Else
Dim CveMovimientoDetalleEntrada As Integer = 0
Dim Cont As Integer = 0
For Each gvr As GridViewRow In GvD.Rows
'que este seleccionado y que tenga diferente seccion
If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCDropDownList("DDlS").SelectedValue.ToEntero <> gvr.DataKey("CveSeccionAlmacen").ToEntero Then
If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then
ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True)
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.DataKey("Existencia").ToDecimal, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, -1, CveSeccionAlmacen:=gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=gvr.DataKey("Serie"), Lote:=gvr.DataKey("Lote"), FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
End If
Next
If Not ErrorMovInv Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 2, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ASA/G1")
Dim ind As Integer = 0
For Each Row As DataRow In resultado.Rows
Dim CvePS = Row("CvePS").ToString().ToEntero()
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
Dim CveSeccionAlmacen As Integer = GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal()
Dim Serie As String = Row("Serie").ToString()
Dim Lote As String = Row("Lote").ToString()
Dim FechaCaducidad As Date = IfNull(Row("FechaCaducidad"), MinFecha).ToString.ToDate
'actualizamos el PS, para que tenga el aplica seccion
ObjPS.UpdateAplicaSeccionAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True)
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
ind += 1
Next
resultado.Dispose()
Else
TextoError = "No se pudo registrar el movimiento"
ErrorMovInv = True
End If
End If
End If
If Not ErrorMovInv Then
ObjInventario.Commit()
cargadatos
Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion)
Else
ObjInventario.RollBack()
Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgError)
End If
ObjInventario.Dispose()
End Sub
End Class

View File

@@ -86,9 +86,8 @@
<div class="row">
<label class="col-md-2">Cliente:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCliente" OnSelectedIndexChanged="DdlCliente_SelectedIndexChanged" AutoPostBack="true" Width="150px" AppendDataBoundItems="true" runat="server" DataTextField="Nombre" DataValueField="CveCliente" CssClass="form-control input-sm select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCliente" runat="server" ControlToValidate="DdlCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECliente" runat="server" HighlightCssClass="vco" TargetControlID="RFVCliente" Width="350px"></ajax:ValidatorCalloutExtender>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" OnSelectedIndexChanged="DdlCliente_SelectedIndexChanged" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;">
</ADS:Dropdownlost>
</div>
<label class="col-md-2">Vendedor:</label>
<div class="col-md-3">
@@ -210,6 +209,12 @@
<asp:Button Text="" ID="BtnSerieAddNew" OnClick="BtnSerieAddNew_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
<td runat="server" id="TdSeccionAlmacen" visible="false">
<asp:Panel runat="server" DefaultButton="BtnSeccionAddNew">
<asp:DropDownlist runat="server" DataTextField="Seccion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me" />
</asp:Panel>
</td>
<td align="center">
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="Texto" ValidationGroup="GrpAgregar" Text="Agregar" />
</td>
@@ -232,7 +237,7 @@
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="90px" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
ssss
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
@@ -391,7 +396,7 @@
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="20%" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacenDestino_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
ssss
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -421,73 +426,6 @@
</ajax:TabContainer>
<%--SECCION DE ALMACEN--%>
<div id="DModalSeccionAlmacen" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalSeccionAlmacen" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="LtlSeccionAlmacen" Text="Sección Almacen" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidadSeccion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCantidadSeccion" runat="server" ControlToValidate="TxtCantidadSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCantidadSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCantidadSeccion"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
<label for="<%= TxtCantidadSeccion.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
<div class="col-md-4" runat="server" id="DivSeccionAlmacenOrigen">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacenOrigen" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacenOrigen" runat="server" ControlToValidate="DdlSeccionAlmacenOrigen" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen Origen''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoSeccionAlmacenOrigen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacenOrigen"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacenOrigen.ClientID.ToString()%>">Sección Almacen O.:</label>
</div>
</div>
<div class="col-md-4" runat="server" id="DivSeccionAlmacenDestino" visible="false">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacenDestino" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacenDestino" runat="server" ControlToValidate="DdlSeccionAlmacenDestino" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen Destino''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacenDestino" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacenDestino"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacenDestino.ClientID.ToString()%>">Sección Almacen D.:</label>
</div>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAddSeccionAlmacen" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " OnClick="LnkAddSeccionAlmacen_Click" data-placement="top" ToolTip="Agregar Sección Almacen" runat="server" ValidationGroup="VgmSeccion"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvSeccion" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
AutoGenerateColumns="False" EmptyDataText="No se han agregado datos"
DataKeyNames="Consec">
<Columns>
<asp:BoundField DataField="CantidadSeccionAlmacen" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="SeccionAlmacenOrigen" HeaderText="Sección Almacen Origen" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="SeccionAlmacenDestino" HeaderText="Sección Almacen Destino" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarSeccion" runat="server" OnClick="LnkEliminarSeccion_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la sección?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -136,8 +136,7 @@ Partial Class Inventarios_Apartados
CantidadTotal = 0
IndexSeccionAlmacen = 0
CvePS = 0
CreaDtSeccionAlmacen()
CargaDdlAlmacen()
TipoSeccionAlmacen = 0
GvDatos.Columns(5).Visible = UsuarioActual.Empresa.Funcionalidad(563) = "1"
@@ -166,9 +165,20 @@ Partial Class Inventarios_Apartados
CargaPS()
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlCliente.DataBind()
DdlCliente.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlClientes.setEsWebService(True)
Else
DdlClientes.setEsWebService(False)
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
'DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
'DdlCliente.DataBind()
'DdlCliente.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlClienteDesapartado.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClienteDesapartado.DataBind()
@@ -255,7 +265,7 @@ Partial Class Inventarios_Apartados
TxtnSerieLote.Visible = False
If DdlProducto2.SelectedValue.ToEntero > 0 Then
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 5 ", "PSCodigo").Rows.Count > 0 Then
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 5 OR AplicaSerie = 1 ", "PSCodigo").Rows.Count > 0 Then
ThSerieLote.Visible = True
TdSerieLote.Visible = True
TxtnSerieLote.Visible = True
@@ -269,9 +279,7 @@ Partial Class Inventarios_Apartados
UpDatos.Update()
End Sub
Private Function isWhitFamily() As Boolean
Return (UsuarioActual.CveEmpresa = 66)
End Function
Protected Sub DdlClasificacion_GV(sender As Object, e As System.EventArgs)
Dim pDdlClasificacion As DropDownList = CType(sender, DropDownList)
Dim pDdlProducto As DropDownList = CType(pDdlClasificacion.NamingContainer.FindControl("DdlProducto"), DropDownList)
@@ -345,7 +353,7 @@ Partial Class Inventarios_Apartados
End Sub
Private Sub SeleccionaVendedor()
DdlVendedor.SelectedValue = "-1"
DdlVendedor.SelectedValueExist(GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveVendedor", $"CveCliente = {DdlCliente.SelectedValue}"))
DdlVendedor.SelectedValueExist(GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveVendedor", $"CveCliente = {DdlClientes.SelectedValue}"))
End Sub
#End Region
@@ -650,7 +658,7 @@ Partial Class Inventarios_Apartados
'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:="", CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, CveCliente:=DdlCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero)
Observaciones:=TxtObservaciones.Text.Trim, Recibio:="", CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, CveCliente:=DdlClientes.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero)
FolioSalida = ObjInventario.Folio
Dim Cont As Integer = 0
If CveMovimientoSalida <= 0 Then
@@ -662,16 +670,7 @@ Partial Class Inventarios_Apartados
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 1").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -683,7 +682,7 @@ Partial Class Inventarios_Apartados
AlmacenEntrada = DdlAlmacenDestino.SelectedValue.ToEntero
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:="-1",
CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida, CveCliente:=DdlCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero)
CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida, CveCliente:=DdlClientes.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero)
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
TextoError = "No se pudo generar el movimiento de entrada correctamente"
@@ -691,20 +690,11 @@ Partial Class Inventarios_Apartados
Else
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 1").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -754,7 +744,7 @@ Partial Class Inventarios_Apartados
DdlSubProyecto.SelectedValue = "-1"
CargaAlmacenes()
DdlCliente.SelectedValue = "-1"
DdlClientes.SelectedValue = "-1"
SeleccionaVendedor()
CargadoDeMov = False
@@ -910,16 +900,6 @@ Partial Class Inventarios_Apartados
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 2").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
End If
Cont += 1
@@ -938,20 +918,10 @@ Partial Class Inventarios_Apartados
Else
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 2").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -989,203 +959,6 @@ Partial Class Inventarios_Apartados
#End Region
#Region "SECCION ALMACEN"
Private Sub CreaDtSeccionAlmacen()
DtSeccionAlmacen = New DataTable
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenOrigen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenDestino", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer))
DtSeccionAlmacen.Columns.Add("SeccionAlmacenOrigen", GetType(String))
DtSeccionAlmacen.Columns.Add("SeccionAlmacenDestino", GetType(String))
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
DtSeccionAlmacen.Columns.Add("TipoSeccionAlmacen", GetType(Integer))
End Sub
Private Sub CargaDdlAlmacen()
DdlSeccionAlmacenOrigen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacenOrigen.DataBind()
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacenDestino.DataBind()
End Sub
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
If Not DdlAlmacenOrigen.SelectedValue.ToEntero > 0 Then
Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen origen.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If Not DdlAlmacenDestino.SelectedValue.ToEntero > 0 AndAlso Not ChkTransitorio.Checked Then
' Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen destino.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
GvSeccion.Columns(2).Visible = True
DivSeccionAlmacenDestino.Visible = True
DivSeccionAlmacenOrigen.Visible = True
GvSeccion.Columns(1).Visible = True
CantidadTotal = gvRow.DataKey("Cantidad").ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CvePS = gvRow.DataKey("CvePS").ToEntero
TipoSeccionAlmacen = 1
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
End Sub
Protected Sub LnkSeccionAlmacenDestino_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveAlmacenApartado = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen IN (9) AND Estatus = 'Activo' And CveSubProyecto = {DdlSubProyectoDesapartado.SelectedValue.ToEntero}").ToEntero
If Not CveAlmacenApartado > 0 Then
Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen destino.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DivSeccionAlmacenOrigen.Visible = True
DivSeccionAlmacenDestino.Visible = True
GvSeccion.Columns(1).Visible = True
GvSeccion.Columns(2).Visible = True
CantidadTotal = gvRow.FCTextBox("TxtCantidad").Text.ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CvePS = gvRow.DataKey("CvePS").ToEntero
TipoSeccionAlmacen = 2
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
End Sub
Private Sub CargaSeccionAlmacen()
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
GvSeccion.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}")
GvSeccion.DataBind()
TxtCantidadSeccion.Text = ""
DdlSeccionAlmacenOrigen.SelectedIndex = 0
DdlSeccionAlmacenDestino.SelectedIndex = 0
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
If CantidadRestante = 0 Then
RVTxtCantidad.MaximumValue = "1"
TxtCantidadSeccion.Enabled = False
Else
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
TxtCantidadSeccion.Enabled = True
End If
If TipoSeccionAlmacen = 1 Then
If CantidadTotalSeccion > 0 Then
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = False
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
Else
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = True
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = ""
End If
If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
DdlAlmacenOrigen.Enabled = False
DdlAlmacenOrigen.ToolTip = "Cuenta con sección almacen"
Else
DdlAlmacenOrigen.Enabled = True
DdlAlmacenOrigen.ToolTip = ""
End If
UpDatos.Update()
ElseIf TipoSeccionAlmacen = 2 Then
If CantidadTotalSeccion > 0 Then
GvDatosDesapartado.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").Enabled = False
GvDatosDesapartado.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").ToolTip = "Cuenta con sección almacen"
Else
GvDatosDesapartado.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").Enabled = True
GvDatosDesapartado.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").ToolTip = ""
End If
UpDatosDesapartado.Update()
End If
UpModalSeccionAlmacen.Update()
End Sub
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
Dim CveAlmacenApartado As Integer = 0
If TipoSeccionAlmacen = 2 Then
CveAlmacenApartado = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen IN (9) AND Estatus = 'Activo' And CveSubProyecto = {DdlSubProyectoDesapartado.SelectedValue.ToEntero}").ToEntero
End If
Dim ObjInv As New ClsInventarios
Dim CantidadDisponible As Decimal = 0
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacenOrigen.SelectedValue.ToEntero, If(TipoSeccionAlmacen = 1, DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenApartado),
CvePS, UsuarioActual.CveEmpresa) Then
If ObjInv.DtResultados.Rows.Count > 0 Then
CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
End If
End If
ObjInv.Dispose()
CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacenOrigen = {DdlSeccionAlmacenOrigen.SelectedValue} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Row As DataRow = Nothing
DtSeccionAlmacen.AcceptChanges()
Row = DtSeccionAlmacen.NewRow
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
Row("CveSeccionAlmacenOrigen") = DdlSeccionAlmacenOrigen.SelectedValue.ToEntero
Row("SeccionAlmacenOrigen") = DdlSeccionAlmacenOrigen.SelectedItem.Text
Row("CveSeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedValue.ToEntero
Row("SeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedItem.Text
Row("CvePS") = CvePS
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
Row("TipoSeccionAlmacen") = TipoSeccionAlmacen
DtSeccionAlmacen.Rows.Add(Row)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim Index As Integer = 0
For Each Dr As DataRow In DtSeccionAlmacen.Rows
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
Exit For
End If
Index += 1
Next
DtSeccionAlmacen.Rows.RemoveAt(Index)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
' If Not CveVentaSurtir > 0 Then
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' Dim ObjInv As New ClsInventarios
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
' End If
' ObjInv.Dispose()
' GvVerSeccionesAlmacen.DataBind()
' UpVerSeccionesAlmacen.Update()
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
'End Sub
#End Region

View File

@@ -0,0 +1,870 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntregaAlmacen.aspx.vb" Inherits="Inventarios_EntregaAlmacen" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style type="text/css">
.gvInventario tr td:nth-child(4) {
width: 6% !important
}
.gvInventario tr td:nth-child(2) {
width: 1% !important
}
.gvInventario tr th:nth-child(4) {
width: 6% !important
}
.gvInventario tr th:nth-child(2) {
width: 1% !important
}
.gvInventario tr td:nth-child(4) {
width: 18% !important;
text-align: center !important;
}
.gvInventario tr th:nth-child(4) {
width: 18% !important
}
.gvEscondeColumna tr td:nth-child(3) {
display: none;
}
.gvEscondeColumna tr th:nth-child(3) {
display: none;
}
.btn.default:hover {
background-color: lightgray
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Entrega Almacén (Surtir Mercancia)
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#EntregaAlmacen">&nbsp;</a>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<%--FILTROS--%>
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server" DefaultButton="BtnBuscar">
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Cliente:
<ADS:Dropdownlost ID="DdlClientes" CssClassDdl="select2me" runat="server" CssStyle="width: 350px;" DataTextField="NombreComercial" Onselectedindexchange="DdlCliente_SelectedIndexChanged" DataValueField="CveCliente"></ADS:Dropdownlost>
<%--<asp:DropDownList ID="DdlClientes" runat="server" DataValueField="CveCliente" DataTextField="Nombre" OnSelectedIndexChanged="DdlCliente_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="350px"></asp:DropDownList>--%>
</li>
<li>Serie-Folio:
<asp:DropDownList ID="DdlFolio" runat="server" DataValueField="CveVenta" DataTextField="SerieFolio" CssClass="form-control input-sm select2me" Width="250px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVFolio" runat="server" ControlToValidate="DdlFolio" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpBuscar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFolio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolio" Width="300px"></ajax:ValidatorCalloutExtender>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" OnClick="BtnBuscar_Click" ValidationGroup="GrpBuscar" class="btn btn-primary" />
<%--<a href="javascript:;" class="expand"></a>--%>
</div>
</div>
<div class="portlet-body" style="display: none;">
<%--<ul class="list-inline">
<li>Descripcion:
<asp:Label ID="lbDescripcion" runat="server"></asp:Label>
</li>
</ul>--%>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row" style="margin-left: 0px; margin-right: 0px;">
<div class="col-md-6">
<%--DATOS DE LA VENTA--%>
<div class="row" style="margin-left: 0px; margin-right: 0px;">
<asp:UpdatePanel ID="UpVenta" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Venta a surtir</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<table style="width:100%">
<tr>
<td style="width: 150px;">Cliente:</td>
<td>
<asp:Label Text="" ID="LbCliente" runat="server" />
</td>
</tr>
<tr>
<td>Folio:</td>
<td>
<asp:HyperLink ID="HLFolio" Target="_blank" runat="server" />
<%--<asp:Label Text="" ID="LbFolio" runat="server" />--%>
</td>
</tr>
<tr>
<td>Observaciones Grales:</td>
<td>
<asp:Label Text="" ID="LbObservaciones" runat="server" />
</td>
</tr>
<tr>
<td>Observaciones Almacén:</td>
<td>
<asp:Label Text="" ID="LbObservacionesAlmacen" runat="server" />
</td>
</tr>
</table>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<%--DATOS DEL MOVIMIENTO--%>
<div class="row" style="margin-left: 0px; margin-right: 0px;">
<asp:UpdatePanel ID="UpGenerales" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos del movimiento</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<table style="width:100%">
<tr>
<td>Almacén:</td>
<td>
<asp:DropDownList ID="DdlAlmacen" runat="server" DataTextField="Almacen" AppendDataBoundItems="true" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="320px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAlmacen" runat="server" ControlToValidate="DdlAlmacen" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacen" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Fecha:</td>
<td>
<div style="display: inline-block; vertical-align: text-bottom;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RangeValidator ID="RVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="No puede registrar una fecha anterior a este dia." Type="Date" ValidationGroup="GrpGuardar" />
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha3" runat="server" HighlightCssClass="vco" TargetControlID="RVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</td>
</tr>
<tr>
<td>Guía:</td>
<td>
<asp:TextBox ID="TxtGuia" runat="server" CssClass="form-control input-sm" MaxLength="20" Width="320px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Observaciones:</td>
<td>
<asp:TextBox ID="TxtObservaciones" TextMode="MultiLine" Rows="2" CssClass="form-control input-sm" runat="server" MaxLength="200"></asp:TextBox>
</td>
</tr>
<tr id="DivTransitorio1" runat="server" visible="false">
<td>Transitorio:</td>
<td>
<asp:CheckBox ID="ChkTransitorio" AutoPostBack="true" OnCheckedChanged="ChkTransitorio_CheckedChanged" CssClass="md-checksd" runat="server" />
</td>
</tr>
<tr id="DivTransitorio2" runat="server" visible="false">
<td colspan="2" class="row">
<label class="col-md-3">Responsable:</label>
<div class="col-md-3">
<asp:TextBox runat="server" Text="" ID="TxtResponsable" Width="90%" />
</div>
<label class="col-md-3">Almacen Transitorio:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Style="width: 150px !important;"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAlmacenTransitorio" runat="server" ControlToValidate="DdlAlmacenTransitorio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacén Transitorio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAlmacenTransitorio" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenTransitorio" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<asp:UpdatePanel ID="UpPendientes" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-6">
<div class="row">
<%--PENDIENTES DE SURTIR--%>
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ventas por surtir</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<asp:Panel runat="server" DefaultButton="BtnConsultarPendientes">
<code>
<asp:Literal Text="" runat="server" ID="LtActualizado" />
</code>
&nbsp;
<b>Sucursal:</b>
<asp:DropDownList ID="DdlSubProyectos" runat="server" CssClass="form-control input-sm select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="90px"></asp:DropDownList>
<asp:TextBox ID="TxtFechaPendientes" runat="server" CausesValidation="true" MaxLength="10" ValidationGroup="GrpPendientes" Width="70px" ClientIDMode="Static"></asp:TextBox>
<asp:LinkButton ID="ImgFechaPendientes" Style="background-color: white;" class="btn default " Text="<i style='width:16px; height:16px;' class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
<ajax:MaskedEditExtender ID="MEEFechaPendientes" runat="server" TargetControlID="TxtFechaPendientes" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaPendientes" TargetControlID="TxtFechaPendientes" PopupButtonID="ImgFechaPendientes" PopupPosition="BottomLeft" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaPendientes" runat="server" ControlToValidate="TxtFechaPendientes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPendientes"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaPendientes" runat="server" ControlToValidate="TxtFechaPendientes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpPendientes"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1Pendientes" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaPendientes" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha2Pendientes" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaPendientes" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Button Text="Recarga" Width="75px" ID="BtnConsultarPendientes" OnClick="BtnConsultarPendientes_Click" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpPendientes" />
<asp:Timer runat="server" ID="TimmerRefresh" Interval="300000" OnTick="TimmerRefresh_Tick"></asp:Timer>
<a href="javascript:;" class="collapse"></a>
</asp:Panel>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GVPendientes" runat="server" DataKeyNames="TipoEntrega,CveVenta,CveTraspasoSolicitud" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="200" data-freezerows="1" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Tipo" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-Width="45%" />
<asp:TemplateField HeaderText="Serie-Folio" ItemStyle-Width="20%">
<ItemTemplate>
<asp:Label runat="server" ID="LblFolio" Text='<%# Eval("SerieFolio")%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton Text="Surtir" ID="BtnSurtir" CommandArgument="-1" OnClick="BtnSurtir_Click" CssClass="btn btn-primary btn-xs" runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="20%" />
</asp:TemplateField>
<asp:TemplateField Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HplDownPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-ad-pdf"></i></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<%--ADVERTENCIA--%>
<div class="col-md-12" style="vertical-align: middle;" align="center">
<div style="z-index: 5; position: relative;">
<div id="DivTipoCambioAdvertencia" visible="false" clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
<asp:Literal Text="" runat="server" ID="LtTipoCambioAdvertencia"></asp:Literal>
</div>
</div>
</div>
<%--ADVERTENCIA--%>
<div class="col-md-12" style="vertical-align: middle;" align="center">
<div style="z-index: 5; position: relative;">
<div id="DivVirtualAdvertencia" visible="false" clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
<asp:Literal Text="La mercancía sera trasladada al almacén virtual" runat="server"></asp:Literal>
</div>
</div>
</div>
<div class="col-md-6">
<asp:GridView ID="GvDocs" DataKeyNames="CveDocumentacion,Documentacion,Orden,CveDocumentacionElectronica,Adjunto,Estatus" runat="server" AutoGenerateColumns="False" ShowHeader="true" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-height="100" data-freezerows="1" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Documento" DataField="Documentacion" />
<asp:BoundField HeaderText="Original" DataField="Observacion" />
<asp:BoundField HeaderText="Copia" DataField="Observacion2" />
<asp:TemplateField HeaderText="" ItemStyle-Width="20%">
<ItemTemplate>
<asp:Literal ID="HplDown" runat="server" Visible="false" > </asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Salida de Inventario</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<%--AGREGAR POR CODIGO DE BARRAS--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" runat="server" id="DivCodigoSeriePS" visible="false">
<div class="col-md-4 pull-right">
<table style="float: right;">
<tr>
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
<td>
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
<asp:TextBox ID="TxtCodigoPS" ClientIDMode="Static" Text="" runat="server" />
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
<td runat="server" visible="false" id="TdSeriePS">
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
</tr>
</table>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-12">
<div class="btn-group pull-right">
<asp:Button ID="BtnVerSugerencias" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnVerSugerencias_Click" runat="server" Text="Ver Secciones" />
</div>
</div>
</div>
<%--GV DATOS--%>
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,AplicaSerieLote,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
<HeaderStyle Height="58px" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="cbInv" runat="server" Checked="true" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="5%" />
</asp:TemplateField>
<asp:BoundField HeaderText="Cant. Venta" DataField="CantidadC" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Cant. a Surtir" ItemStyle-Width="10%">
<ItemTemplate>
<asp:TextBox ID="TbCantidadF" runat="server" Width="60px" Mask="9,999.99" Text='<%# Eval("CantidadF") %>'></asp:TextBox>
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:HyperLinkField HeaderText="Producto o Servicio" Target="_blank" DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="35%" />
<asp:BoundField HeaderText="Observación" DataField="ObservacionesDetalle" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtLote" CssClass="form-control" runat="server" Visible="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
<ItemTemplate>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtCaducidad" Text='<%# Eval("Caducidad") %>' CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server" Visible="false"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
</ContentTemplate>
</asp:UpdatePanel>
<%--BOTON GUARDAR--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div align="center">
<asp:Label Text="Venta totalmente Surtida" ID="LbSurtida" Font-Size="Small" Visible="false" CssClass="label label-sm label-success" runat="server" />
<br />
<br />
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" CssClass="btn btn-primary" Text="Guardar" Width="150px" ValidationGroup="GrpGuardar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%--AGREGA POR SERIE--%>
<div id="DivSerie" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpSerie" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label7" runat="server" ClientIDMode="Static" Text="Surtir producto con Serie/Lote y Fecha de Caducidad"></asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:Panel runat="server" DefaultButton="BtnAgregarPS">
<table width="100%">
<tr>
<td width="80px"><b>Producto:</b></td>
<td>
<asp:Label Text="" ID="LbProducto" runat="server" />
</td>
<td width="120px"><b>Cantidad:</b></td>
<td colspan="">
<asp:Label Text="" ID="LbCantidad" runat="server" />
</td>
</tr>
<tr>
<td colspan="4">
<hr />
</td>
</tr>
<tr>
<td width="80px">Serie:</td>
<td>
<asp:TextBox runat="server" ID="TxtSerie" ClientIDMode="Static" Width="200px" />
<asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td width="80px" runat="server" id="TdCaducidad1">Fecha Caducidad:</td>
<td runat="server" id="TdCaducidad2">
<asp:TextBox ID="TxtFechaCaducidad" runat="server" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaCaducidad" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaCaducidad" runat="server" TargetControlID="TxtFechaCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaCaducidad" TargetControlID="TxtFechaCaducidad" PopupButtonID="ImgFechaCaducidad" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaCaducidad" runat="server" ControlToValidate="TxtFechaCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaCaducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaCaducidad" runat="server" ControlToValidate="TxtFechaCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaCaducidad''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpAgregaSerie"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaCaducidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaCaducidad" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaCaducidad2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCaducidad" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td colspan="3">
<code>
<asp:Label ID="LbSerieRecomendado" Text="Serie/Lote Recomendado: <b>PS2505</b>, Caducicdad: <b>25/04/2016</b>" runat="server" />
</code>
</td>
<td align="right">
<asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnAgregarPS" OnClick="BtnAgregarPS_Click" ValidationGroup="GrpAgregaSerie" runat="server" />
</td>
</tr>
<tr>
<td colspan="4">
<asp:GridView ID="GvSerie" DataKey="Serie" DataKeyNames="Serie" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="100" data-freezerows="1" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Serie-Folio" DataField="Serie" ItemStyle-Width="40%" />
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-Width="40%" />
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" CommandName="Delete" OnClientClick="return confirm('¿Desea borrar el registro?')"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="20%"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</asp:Panel>
</div>
<div class="modal-footer">
<button id="CancelarDevolucion" type="button" class="btn btn-default" data-dismiss="modal">cerrar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="DivLote" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpLoteBatch" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Surtir producto con Lote-Batch y Fecha de Caducidad"></asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:Panel ID="Panel2" runat="server" DefaultButton="BtnLote">
<table width="100%">
<tr>
<td width="120px"><b>Producto:</b></td>
<td>
<asp:Label Text="" ID="LbProducto2" runat="server" />
</td>
<td width="120px"><b>Cantidad:</b></td>
<td colspan="">
<asp:Label Text="" ID="LbCantidad2" runat="server" />
</td>
</tr>
<tr>
<td colspan="4">
<hr />
</td>
</tr>
<tr>
<td width="120px">Cantidad:</td>
<td>
<asp:TextBox runat="server" ID="TxtCantidadLote" Width="100px" ClientIDMode="Static" CssClass="form-control input-sm" />
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidadLote" runat="server" TargetControlID="TxtCantidadLote" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RFVCantidadLote" runat="server" ControlToValidate="TxtCantidadLote" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaLote"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidadLote" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidadLote" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVCantidadLote" Display="None" ControlToValidate="TxtCantidadLote" runat="server" MinimumValue="0.01" MaximumValue="999999" Type="Currency" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> debe ser mayor a cero(0) y menor a la cantidad restante por surtir, por favor rectifique." ValidationGroup="GrpAgregaLote"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RVCantidadLote" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td width="120px">Lote:</td>
<td>
<asp:TextBox runat="server" ID="TxtLote" ClientIDMode="Static" Width="200px" CssClass="form-control input-sm" />
<asp:RequiredFieldValidator ID="RFVLote" runat="server" ControlToValidate="TxtLote" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lote''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie2"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVLote" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td width="120px">Batch:</td>
<td>
<asp:TextBox runat="server" ID="TxtBatch" ClientIDMode="Static" Width="200px" CssClass="form-control input-sm" />
<asp:RequiredFieldValidator ID="RFVBatch" runat="server" ControlToValidate="TxtBatch" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Batch''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie2"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="RFVBatch" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td colspan="3">
<code>
<asp:Label ID="LbLoteRecomendado" Text="" runat="server" />
</code>
</td>
<td align="right">
<asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnLote" OnClick="BtnAgregarPS2_Click" ValidationGroup="GrpAgregaSerie2" runat="server" />
</td>
</tr>
<tr>
<td colspan="4">
<asp:GridView ID="GvLote" DataKeyNames="Lote" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="100" data-freezerows="1" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Folio" DataField="Lote" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-Width="20%" />
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" CommandName="Delete" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="20%"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</asp:Panel>
</div>
<div class="modal-footer">
<button id="CancelarDev" type="button" class="btn btn-default" data-dismiss="modal">cerrar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%--CANTIDAD ESPECIAL--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnGuardarCantidadEspecial">
<div id="ModalCantidad" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="LbCantidadEspecial" Text="Cantidad: 1234 - Producto Equis" runat="server" />
</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-5" style="text-align: right;">
Cantidad
</div>
<div class="col-md-7">
<asp:TextBox ClientIDMode="Static" ID="TxtCantidadEspecial" Text="" runat="server"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarCantidadEspecial" OnClick="BtnGuardarCantidadEspecial_Click" runat="server" ClientIDMode="Static" Text="Aceptar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<%--CANTIDAD ESPECIAL 2--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div id="DivCantidadEspecial" style="display: none; z-index: 5000; box-shadow: 0px 0px 15px #999;">
<table border="0" cellpadding="0" cellspacing="1" style="border: solid 1px black; color: Black; background-color: White; width: 140px;">
<tr class="Titulos">
<td>
<asp:Literal ID="LtlProductoCantidad" runat="server"></asp:Literal>
</td>
<td width="15px" valign="bottom" style="height: 8px">
<asp:Image ID="ImgCerrar" runat="server" Width="18px" ImageUrl="/Imagenes/cerrarX.jpg" AlternateText=" " Style="cursor: pointer;" onclick="$('#DivCantidadEspecial').hide(200);" />
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<asp:Panel runat="server" DefaultButton="BtnGuardarCantidadEspecialDiv">
Cant.:
<asp:TextBox ClientIDMode="Static" ID="TxtCantidadEspecialDiv" Text="1" onfocus="this.select();" Width="50px" runat="server"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtCantidadEspecialDiv" FilterType="Custom, Numbers" ValidChars="." />
<br />
<br />
<asp:Button ID="BtnGuardarCantidadEspecialDiv" OnClick="BtnGuardarCantidadEspecial_Click" runat="server" ClientIDMode="Static" Text="Aceptar" CssClass="btn btn-primary" />
</asp:Panel>
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%--NUMERO DE GUIA--%>
<asp:UpdatePanel ID="UpNoGuia" runat="server" Visible="false">
<ContentTemplate>
<asp:TextBox runat="server" ID="TxtNumeroGuia" placeholder="Inserte un numero de guia" ClientIDMode="static"></asp:TextBox>
<asp:Button runat="server" ID="BtnNumeroGuia" ClientIDMode="static" />
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalVerSugerencias" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpVerSugerencias" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Sugerencias</h4>
</div>
<div class="modal-body">
<asp:GridView ID="GvSugerencias" runat="server" EmptyDataText="No se encontraron registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left"/>
<asp:BoundField HeaderText="Sección Almacen" DataField="Seccion" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Caducidad" DataField="Caducidad" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAplicarSugerencias" OnClick="BtnAplicarSugerencias_Click" runat="server" ClientIDMode="Static" Text="Aplicar" CssClass="btn btn-primary" />
<button id="CancelarVerSugerencias" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
<script type="text/javascript">
function pageLoad() {
$(document).ready(function () {
if ($('#DivTipoCambioAdvertencia')) {
$("#DivTipoCambioAdvertencia").pulsate("destroy");
jQuery('#DivTipoCambioAdvertencia').pulsate({
color: "#faebcc"
});
}
});
}
function ValidarCantidad(t, c) {
if (t.value > c) {
t.value = c;
}
}
function Focus() {
$('#TxtCodigoPS').focus()
}
function playsonidito(NomArchivo) {
var URL = /Sonidos/ + NomArchivo
var snd = new Audio(URL);
snd.play();
snd.currentTime = 0;
}
function CantidadEspecial() {
MuestraCantidadEspecial();
//$('#ModalCantidad').modal('show');
}
function MuestraCantidadEspecial() {
PosicionaObjeto('TxtCodigoPS', 'DivCantidadEspecial', '');
$("#DivCantidadEspecial").show(200);
}
function FocusCantidadEspecial() {
$('#TxtCantidadEspecialDiv').focus()
}
function Dividir(t) {
$get("HdnCantidadMovimiento").value = $get(t).value;
}
function LimitaCantidad(C, textbox, button) {
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
if (ToDouble(textbox.value) >= C) {
textbox.value = "";
}
if (parseFloat(textbox.value) > 0) {
$get(button).style.display = "";
//$(contenedor).show();
}
else {
$get(button).style.display = "none";
//$(contenedor).hide();
}
}
</script>
</asp:Content>

File diff suppressed because it is too large Load Diff

View File

@@ -374,17 +374,29 @@
</ItemTemplate>
<ItemStyle Width="100px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Left" HeaderText="Serie/Lote" Visible="false">
<asp:TemplateField ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Left" HeaderText="Sección" Visible="false">
<ItemTemplate>
<asp:Literal ID="lbSL" runat="server" Text='<%# Eval("SerieLote")%>'></asp:Literal>
<asp:Literal ID="lbSA" runat="server" Text='<%# Eval("SeccionAlmacen")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="100px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Left" HeaderText="Serie" Visible="false">
<ItemTemplate>
<asp:Literal ID="lbS" runat="server" Text='<%# Eval("Serie")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="100px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Left" HeaderText="Lote" Visible="false">
<ItemTemplate>
<asp:Literal ID="lbL" runat="server" Text='<%# Eval("Lote")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="70"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Center" HeaderText="F. Caducidad" Visible="false">
<ItemTemplate>
<asp:Label ID="lbFCad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:d}")%>' data-toggle="tooltip"></asp:Label>
</ItemTemplate>
<ItemStyle Width="100px"></ItemStyle>
<ItemStyle Width="75px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="Entrada">
<ItemTemplate>

View File

@@ -34,11 +34,6 @@ Partial Class Inventarios_Kardex
CargaCombos()
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 13, 66) Then
GvM.Columns(6).Visible = True ' SerieLote
GvM.Columns(7).Visible = True ' FCaducidad
End If
If UsuarioActual.TienePermisoProceso(258) Then GvM.Columns(1).Visible = True
ddlAlmacen.SelectedValue = If(Request("CveAlmacen") IsNot Nothing, Request("CveAlmacen").ToString, "-1")
@@ -69,9 +64,9 @@ Partial Class Inventarios_Kardex
Private Sub CargaPermisos()
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
GvM.Columns(11).Visible = TienePermisoImportes ' costo
GvM.Columns(12).Visible = TienePermisoImportes ' importe
GvM.Columns(14).Visible = TienePermisoImportes ' valor
GvM.Columns(13).Visible = TienePermisoImportes ' costo
GvM.Columns(14).Visible = TienePermisoImportes ' importe
GvM.Columns(16).Visible = TienePermisoImportes ' valor
End Sub
Private Function isWithFamily() As Boolean
@@ -197,6 +192,16 @@ Partial Class Inventarios_Kardex
If CveProducto > 0 Then
Dim DtTemp = CargarKardex(CveProducto)
If DtTemp IsNot Nothing Then
Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie As Boolean
AplicaSerie = DtTemp.MAX("Serie") <> ""
AplicaSeccion = DtTemp.MAX("SeccionAlmacen") <> ""
AplicaLote = DtTemp.MAX("Lote") <> ""
AplicaCaducidad = DtTemp.MAX("FechaCaducidad") <> ""
If AplicaSeccion Then GvM.Columns(7).Visible = True
If AplicaSerie Then GvM.Columns(8).Visible = True
If AplicaLote Then GvM.Columns(9).Visible = True
If AplicaCaducidad Then GvM.Columns(10).Visible = True
'CARGA INDICADORES
If UsuarioActual.TienePermisoProceso(201) Then
DivIndicadores.Visible = True

View File

@@ -124,7 +124,7 @@
<asp:UpdatePanel runat="server" ID="UppEntrega" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS, SerieLote,Lote,Batch,CveMovimientoDetalle" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,CveMovimientoDetalle,CveMovimiento" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<%--<HeaderTemplate>
@@ -144,7 +144,9 @@
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="F. Caducidad" DataField="FechaCaducidad" ItemStyle-Width="15%" />
</Columns>
</asp:GridView>

View File

@@ -3,10 +3,29 @@
Partial Class Inventarios_PrestamosdeProveedor
Inherits ClsPaginas
Private Property CveProveedor As Integer
Get
Return ViewState("CveProveedor").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveProveedor") = value
End Set
End Property
Private Property CveMovimiento As Integer
Get
Return ViewState("CveMovimiento").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMovimiento") = value
End Set
End Property
Private Sub Inventarios_PrestamosdeProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
CveMovimiento = 0
CveProveedor = 0
CargaDatos()
End If
@@ -42,8 +61,9 @@ Partial Class Inventarios_PrestamosdeProveedor
If ObjInv.PrestamosdeProveedorGet(tCveProveedor, tFolio, UsuarioActual.CveEmpresa) Then
GvD.DataSource = ObjInv.DtResultados
Dim Dr As Data.DataRow = ObjInv.DtResultados.FiltroPrimero("")
If Dr IsNot Nothing Then
HdnCveProveedor.Value = Dr("CveProveedor")
If Dr IsNot Nothing AndAlso tFolio > 0 Then
CveProveedor = Dr("CveProveedor").ToString.ToEntero
CveMovimiento = Dr("CveMovimiento").ToString.ToEntero
End If
End If
@@ -93,14 +113,14 @@ Partial Class Inventarios_PrestamosdeProveedor
If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Then
ValidaMovtos += gvr.FCTextBox("TxtCantidad").Text.ToDecimal
If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Then
Dim SerieLote As String = "-1"
Dim Serie As String = "-1"
Dim Lote As String = "-1"
Dim Batch As String = "-1"
If gvr.DataKey("SerieLote") <> "" Then SerieLote = gvr.DataKey("SerieLote")
Dim FechaCaducidad As Date = MinFecha
If gvr.DataKey("Serie") <> "" Then Serie = gvr.DataKey("Serie")
If gvr.DataKey("Lote") <> "" Then Lote = gvr.DataKey("Lote")
If gvr.DataKey("Batch") <> "" Then Batch = gvr.DataKey("Batch")
If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad")
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, SerieLote, Lote, Batch)
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
If Not Valido Then
Alert("No hay existencia del producto a devolver.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -127,14 +147,12 @@ Partial Class Inventarios_PrestamosdeProveedor
'REGISTRA LA SALIDA Y ENTRADA (TRASPASO)
Dim Fecha As Date = TxtFechaEntrega.Text.ToDate
Dim CveMovimientoSalida As Integer
Dim tCveProveedor As Integer = HdnCveProveedor.Value.ToEntero
Dim CvePS As Integer = 0
'AGREGAMOS LA SALIDA
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 29, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesEntrega.Text.Trim, CveProveedor:=tCveProveedor, Modulo:="PresP")
Observaciones:=TxtObservacionesEntrega.Text.Trim, CveProveedor:=CveProveedor, CveMovimientoRelacionado:=CveMovimiento, Modulo:="PresP")
Folio = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
@@ -149,7 +167,7 @@ Partial Class Inventarios_PrestamosdeProveedor
If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal > 0 Then
CveMovimientoDetalleEntrada = gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero
CvePS = gvr.DataKey("CvePS").ToString.ToEntero
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, SerieLote:=gvr.DataKey("SerieLote").ToString, Lote:=gvr.DataKey("Lote").ToString, Batch:=gvr.DataKey("Batch").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToString.ToDate) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
@@ -220,13 +238,13 @@ Partial Class Inventarios_PrestamosdeProveedor
End If
End Sub
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional SerieLote As String = "-1", Optional Lote As String = "-1", Optional Batch As String = "-1") As Boolean
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date) As Boolean
Dim Retorno = True
Dim Inv As New ClsInventarios
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFechaEntrega.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=SerieLote, Lote:=Lote, Batch:=Batch)
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFechaEntrega.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen)
Inv.Dispose()
'- DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(SerieLote <> "-1", $" AND SerieLote = '{SerieLote}'", "")}")
If Existencia - Cantidad < 0 Then
If Existencia < 0 Then

View File

@@ -247,7 +247,7 @@
<asp:LinkButton ID="ImgFechaPendientes" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaPendientes" runat="server" TargetControlID="TxtFechaPendientes" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaPendientes" TargetControlID="TxtFechaPendientes" PopupButtonID="ImgFechaPendientes" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaPendientes" TargetControlID="TxtFechaPendientes" PopupButtonID="ImgFechaPendientes" PopupPosition="BottomLeft" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaPendientes" runat="server" ControlToValidate="TxtFechaPendientes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaPendientes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaPendientes" runat="server" ControlToValidate="TxtFechaPendientes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaPendientes''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaPendientes1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaPendientes" Width="350px"></ajax:ValidatorCalloutExtender>
@@ -434,15 +434,23 @@
<ItemTemplate>
<asp:TextBox ID="TbCantidadF" runat="server" Width="60px" Mask="9,999.99" Text="0"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidadF" runat="server" TargetControlID="TbCantidadF" FilterType="Numbers,custom" ValidChars="." />
<asp:Button Text="SerieLote" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-primary btn-sm" runat="server" Visible="false" />
<asp:Button Text="Lote-Batch" ID="BtnLote" CssClass="btn btn-primary" OnClick="BtnLote_Click" runat="server" Visible="false" />
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-sm" runat="server" Visible="false" />
<asp:Button Text="Lote" ID="BtnLote" CssClass="btn btn-primary" OnClick="BtnLote_Click" runat="server" Visible="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="7.5%" />
<asp:HyperLinkField HeaderText="Producto o Servicio" DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="22.5%" />
<asp:HyperLinkField HeaderText="Producto o Servicio" DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="P.U." DataField="PU" DataFormatString="{0:#,###.####}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="C.I." DataField="CostoIndirecto" DataFormatString="{0:###.####}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%">
<ItemTemplate>
<asp:Label ID="LbTotal" Text="" runat="server"></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="LbTotal" Text="" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
@@ -469,20 +477,7 @@
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%">
<ItemTemplate>
<asp:Label ID="LbTotal" Text="" runat="server"></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="LbTotal" Text="" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="false">
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
@@ -695,64 +690,6 @@
</ContentTemplate>
</asp:UpdatePanel>
<%--SECCION DE ALMACEN--%>
<div id="DModalSeccionAlmacen" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalSeccionAlmacen" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="LtlSeccionAlmacen" Text="Sección Almacen" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidadSeccion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCantidadSeccion" runat="server" ControlToValidate="TxtCantidadSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCantidadSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCantidadSeccion"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
<label for="<%= TxtCantidadSeccion.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacen" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacen" runat="server" ControlToValidate="DdlSeccionAlmacen" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoSeccionAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacen"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacen.ClientID.ToString()%>">Sección Almacen:</label>
</div>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAddSeccionAlmacen" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " OnClick="LnkAddSeccionAlmacen_Click" data-placement="top" ToolTip="Agregar Sección Almacen" runat="server" ValidationGroup="VgmSeccion"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvSeccionAlmacen" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
AutoGenerateColumns="False" EmptyDataText="No se han agregado datos"
DataKeyNames="Consec">
<Columns>
<asp:BoundField DataField="CantidadSeccionAlmacen" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="SeccionAlmacen" HeaderText="Sección Almacen" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarSeccion" runat="server" OnClick="LnkEliminarSeccion_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la sección?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<%--AGREGAR POR SERIE LOTE--%>
<div id="DivSerie" class="modal ADS fade" role="dialog">
@@ -786,9 +723,9 @@
<tr>
<td width="80px">Serie/Lote:</td>
<td>
<asp:TextBox runat="server" ID="TxtSerieLote" Width="300px" ClientIDMode="Static" />
<asp:RequiredFieldValidator ID="RFVSerieLote" runat="server" ControlToValidate="TxtSerieLote" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie/Lote''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESerieLote" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerieLote" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:TextBox runat="server" ID="TxtSerie" Width="300px" ClientIDMode="Static" />
<asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td runat="server" id="TdCaducidad1" width="80px">Fecha Caducidad:</td>
<td runat="server" id="TdCaducidad2">
@@ -920,7 +857,6 @@
<Columns>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Batch" DataField="Batch" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>

View File

@@ -5,7 +5,7 @@ Imports Microsoft.Reporting.WebForms
Imports System.Data
Imports Extensiones
Imports System.IO
Imports System.Linq
Partial Class Inventarios_RecepcionAlmacen
Inherits ClsPaginas
@@ -36,15 +36,6 @@ Partial Class Inventarios_RecepcionAlmacen
ViewState("DtInv") = value
End Set
End Property
Private Property DtSeccionAlmacen As DataTable
Get
Return CType(ViewState("DtSeccionAlmacen"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtSeccionAlmacen") = value
End Set
End Property
Private Property dt As DataTable
Get
Return CType(ViewState("dt"), DataTable)
@@ -109,20 +100,20 @@ Partial Class Inventarios_RecepcionAlmacen
ViewState("DtDatosLoteDetalle") = value
End Set
End Property
Private Property CvePSSerieLote As Integer
Private Property CvePSSerie As Integer
Get
Return CType(ViewState("CvePSSerieLote"), Integer)
Return CType(ViewState("CvePSSerie"), Integer)
End Get
Set(value As Integer)
ViewState("CvePSSerieLote") = value
ViewState("CvePSSerie") = value
End Set
End Property
Private Property CveUMSerieLote As Integer
Private Property CveUMSerie As Integer
Get
Return CType(ViewState("CveUMSerieLote"), Integer)
Return CType(ViewState("CveUMSerie"), Integer)
End Get
Set(value As Integer)
ViewState("CveUMSerieLote") = value
ViewState("CveUMSerie") = value
End Set
End Property
Private Property CantidadTotal As Decimal
@@ -141,20 +132,20 @@ Partial Class Inventarios_RecepcionAlmacen
ViewState("IndexSeccionAlmacen") = value
End Set
End Property
Private Property PUSerieLote As Decimal
Private Property PUSerie As Decimal
Get
Return CType(ViewState("PUSerieLote"), Decimal)
Return CType(ViewState("PUSerie"), Decimal)
End Get
Set(value As Decimal)
ViewState("PUSerieLote") = value
ViewState("PUSerie") = value
End Set
End Property
Private Property CveConsecSerieLote As Integer
Private Property CveConsecSerie As Integer
Get
Return CType(ViewState("CveConsecSerieLote"), Integer)
Return CType(ViewState("CveConsecSerie"), Integer)
End Get
Set(value As Integer)
ViewState("CveConsecSerieLote") = value
ViewState("CveConsecSerie") = value
End Set
End Property
Private Property TotalGV As Decimal
@@ -265,6 +256,15 @@ Partial Class Inventarios_RecepcionAlmacen
ViewState("CveCompraSurtir") = value
End Set
End Property
Private Property CveProveedor As Integer
Get
Return CType(ViewState("CveProveedor"), Integer)
End Get
Set(value As Integer)
ViewState("CveProveedor") = value
End Set
End Property
Private Property CvePrePolizaCompra As Integer
Get
Return CType(ViewState("CvePrePolizaCompra"), Integer)
@@ -366,6 +366,7 @@ Partial Class Inventarios_RecepcionAlmacen
CargaPendientes()
CargaPermisos()
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True
End If
End Sub
@@ -377,13 +378,7 @@ Partial Class Inventarios_RecepcionAlmacen
'IMPORTES
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
GvInv.Columns(8).Visible = TienePermisoImportes
GvInv.Columns(11).Visible = TienePermisoImportes
'SECCION ALMACEN
GvInv.Columns(10).Visible = UsuarioActual.Empresa.Funcionalidad(147) = "1"
'SECCION ALMACEN EXISTENCIAS
GvInv.Columns(11).Visible = UsuarioActual.Empresa.Funcionalidad(563).ToString = "1"
GvInv.Columns(10).Visible = TienePermisoImportes
End Sub
#End Region
@@ -406,8 +401,6 @@ Partial Class Inventarios_RecepcionAlmacen
CantidadTotal = 0
IndexSeccionAlmacen = 0
CreaDtSeccionAlmacen()
CargaDdlAlmacen()
ddlAlmacenAdd.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (9)")
ddlAlmacenAdd.DataBind()
@@ -478,17 +471,18 @@ Partial Class Inventarios_RecepcionAlmacen
UpGenerales.Update()
End Sub
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacen.SelectedIndexChanged
If DdlAlmacen.SelectedValue <> "-1" Then
For Each Gvr As GridViewRow In GvInv.Rows
If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then
Dim Dr As DataRow = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero($"CveAlmacen = {DdlAlmacen.SelectedValue}")
If Dr IsNot Nothing Then
Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValueExist(Dr("CveSeccion"))
End If
End If
Next
UPInv.Update()
CargaCompra(CveCompraSurtir, CveProveedor)
'For Each Gvr As GridViewRow In GvInv.Rows
' If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then
' Dim Dr As DataRow = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("")
' If Dr IsNot Nothing Then
' Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValueExist(Dr("CveSeccion"))
' End If
' End If
'Next
'UPInv.Update()
End If
End Sub
@@ -811,8 +805,8 @@ Partial Class Inventarios_RecepcionAlmacen
CargaGVInv()
DtSeccionAlmacen.Rows.Clear()
DtSeccionAlmacen.AcceptChanges()
'DtSeccionAlmacen.Rows.Clear()
'DtSeccionAlmacen.AcceptChanges()
End Sub
Protected Sub BtnSurtir_Click(sender As Object, e As EventArgs)
@@ -822,7 +816,7 @@ Partial Class Inventarios_RecepcionAlmacen
End If
End Sub
Private Sub CargaCompra(pCveCompra As Integer, pCveProveedor As Integer)
CargaAlmacenes(-1)
'CargaAlmacenes(-1)
Dim ObjCompras As New ClsCompras
Dim ObjInventario As New ClsInventarios
@@ -831,6 +825,7 @@ Partial Class Inventarios_RecepcionAlmacen
If ObjCompras.DtResultados.Rows.Count > 0 Then
CveCompraSurtir = pCveCompra
CveProveedor = pCveProveedor
CvePrePolizaCompra = ObjCompras.DtResultados.Rows(0)("CvePrePoliza").ToString.ToEntero
LbProveedor.Text = ObjCompras.DtResultados.Rows(0)("RazonSocial").ToString
@@ -856,6 +851,7 @@ Partial Class Inventarios_RecepcionAlmacen
End If
RecibidaCompleta = False
Dim CargaSoloUsados As Boolean = False
If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim DtRecepcion As DataTable = Nothing
@@ -1174,6 +1170,22 @@ Partial Class Inventarios_RecepcionAlmacen
DtInv = DtInv.FiltraParametros("", "PS")
End If
Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie As Boolean
If DtInv IsNot Nothing AndAlso DtInv.Rows.Count > 0 Then
AplicaSerie = CBool(DtInv.MAX("AplicaSerie"))
AplicaSeccion = CBool(DtInv.MAX("AplicaSeccion"))
AplicaLote = CBool(DtInv.MAX("AplicaLote"))
AplicaCaducidad = CBool(DtInv.MAX("AplicaCaducidad"))
End If
If AplicaSeccion Then GvInv.Columns(11).Visible = True
If AplicaLote Then GvInv.Columns(12).Visible = True
If AplicaCaducidad Then GvInv.Columns(13).Visible = True
If AplicaSerie OrElse AplicaSeccion OrElse AplicaLote OrElse AplicaCaducidad Then
GvInv.Columns(14).Visible = True
End If
'For Each item As DataRow In DtInv.Rows
' Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, item("CvePS").ToString.ToEntero).FiltroPrimero("")
' If Dr IsNot Nothing Then
@@ -1194,7 +1206,7 @@ Partial Class Inventarios_RecepcionAlmacen
GvInv.DataBind()
UPInv.Update()
End Sub
Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
Protected Sub GvInv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -1203,8 +1215,8 @@ Partial Class Inventarios_RecepcionAlmacen
If CBool(e.Row.DBCampo("AplicaSerie")) Then
'If e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then
e.Row.FCButton("BtnSerieLote").Visible = True
e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"))
e.Row.FCButton("BtnSerie").Visible = True
e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"))
e.Row.FCTextBox("TbCantidadF").Enabled = False
e.Row.FCCheckBox("cbInv").Enabled = False
@@ -1221,7 +1233,7 @@ Partial Class Inventarios_RecepcionAlmacen
'End If
Else
e.Row.FCButton("BtnSerieLote").Visible = False
e.Row.FCButton("BtnSerie").Visible = False
e.Row.FCButton("BtnLote").Visible = False
e.Row.FCTextBox("TbCantidadF").Enabled = True
@@ -1238,6 +1250,12 @@ Partial Class Inventarios_RecepcionAlmacen
If CBool(e.Row.DBCampo("AplicaSeccion")) Then
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
If DdlAlmacen.SelectedValue.ToEntero > 0 Then
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
Else
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
End If
@@ -1273,13 +1291,6 @@ Partial Class Inventarios_RecepcionAlmacen
e.Row.FCCheckBox("cbInv").Visible = False
End If
'TotalGV += e.Row.DBCampo("PU").ToString.ToDecimal * e.Row.DBCampo("CantidadF").ToString.ToDecimal
'If UsuarioActual.Empresa.Funcionalidad(147) = "1" Then
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If
e.Row.FCLabel("LbTotal").Text = ((e.Row.DBCampo("PU").ToDecimal + e.Row.DBCampo("CostoIndirecto").ToDecimal) * e.Row.DBCampo("CantidadF").ToDecimal).FormatoNumero
@@ -1325,9 +1336,9 @@ Partial Class Inventarios_RecepcionAlmacen
TdSeriePS.Visible = True
TxtSeriePS.Focus()
CveConsecSerieLote = Gvr.DataKey("Consec").ToEntero
CvePSSerieLote = Gvr.DataKey("CvePS").ToEntero
CveUMSerieLote = Gvr.DataKey("CveUM").ToEntero
CveConsecSerie = Gvr.DataKey("Consec").ToEntero
CvePSSerie = Gvr.DataKey("CvePS").ToEntero
CveUMSerie = Gvr.DataKey("CveUM").ToEntero
Exit Sub
End If
@@ -1388,7 +1399,7 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub
Protected Sub BtnSeriePS_Click(sender As Object, e As EventArgs)
AgregaSerieLote(TxtSeriePS.Text.Trim, 2)
AgregaSerie(TxtSeriePS.Text.Trim, 2)
TdSeriePS.Visible = False
TxtSeriePS.Text = ""
TxtCodigoPS.Text = ""
@@ -1416,7 +1427,7 @@ Partial Class Inventarios_RecepcionAlmacen
#End Region
#Region " AGREGA POR SERIE/LOTE "
Protected Sub BtnSerieLote_Click(sender As Object, e As EventArgs)
Protected Sub BtnSerie_Click(sender As Object, e As EventArgs)
Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c)
@@ -1424,10 +1435,10 @@ Partial Class Inventarios_RecepcionAlmacen
LbCantidad.Text = Argumentos(4).FormatoNumero
TxtFechaCaducidad.Text = Now.ToShortDateString()
CvePSSerieLote = Argumentos(0).ToEntero
CveUMSerieLote = Argumentos(1).ToEntero
PUSerieLote = Argumentos(2).ToDecimal
CveConsecSerieLote = Argumentos(5).ToEntero
CvePSSerie = Argumentos(0).ToEntero
CveUMSerie = Argumentos(1).ToEntero
PUSerie = Argumentos(2).ToDecimal
CveConsecSerie = Argumentos(5).ToEntero
CargaSerie(1)
@@ -1446,12 +1457,12 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub
Private Sub CargaSerie(Tipo As Integer, Optional CerrarCompletado As Boolean = False)
'RegistraScript("document.getElementById(""TxtSerieLote"").focus();")
'RegistraScript("document.getElementById(""TxtSerie"").focus();")
RegistraScript("$('#DivSerie').modal();", "ModalLote")
'Dim AplicaCaducidad = False
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0) IsNot Nothing Then
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
'End If
'If AplicaCaducidad Then
@@ -1464,11 +1475,11 @@ Partial Class Inventarios_RecepcionAlmacen
' TdCaducidad2.Visible = False
'End If
GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote), "Consec DESC")
GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
GvSerie.DataBind()
'VALIDA QUE SIGA AGREGANDO
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote)).Rows.Count < LbCantidad.Text.ToEntero Then
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < LbCantidad.Text.ToEntero Then
BtnAgregarPS.Enabled = False
If CerrarCompletado Then
RegistraScript("$('#DivSerie').modal('hide');")
@@ -1480,7 +1491,7 @@ Partial Class Inventarios_RecepcionAlmacen
'SI TIENE ENTRADA POR SERIE LOTE, BLOQUEAMOS CHECK Y TXTCANTIDAD
Dim Contador = 0
For Each Gvr As GridViewRow In GvInv.Rows
If Gvr.DataKey("CvePS").ToEntero = CvePSSerieLote Then
If Gvr.DataKey("CvePS").ToEntero = CvePSSerie Then
Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec"))).Rows.Count
Gvr.FCCheckBox("cbInv").Enabled = False
Gvr.FCTextBox("TbCantidadF").Enabled = False
@@ -1501,26 +1512,26 @@ Partial Class Inventarios_RecepcionAlmacen
UPInv.Update()
UpSerie.Update()
TxtSerieLote.Text = ""
TxtSerieLote.Focus()
TxtSerie.Text = ""
TxtSerie.Focus()
If Tipo = 1 Then
RegistraScript(String.Format("$('#{0}').on('shown.bs.modal', function () {{$('#{0}').focus(); $('#{0}').trigger(jQuery.Event('keypress', {{which: 13}})); }});$('#DivSerie').modal('show'); ", TxtSerieLote.ClientID))
RegistraScript(String.Format("$('#{0}').on('shown.bs.modal', function () {{$('#{0}').focus(); $('#{0}').trigger(jQuery.Event('keypress', {{which: 13}})); }});$('#DivSerie').modal('show'); ", TxtSerie.ClientID))
End If
End Sub
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
AgregaSerieLote(TxtSerieLote.Text.Replace(" ", String.Empty), 1)
AgregaSerie(TxtSerie.Text.Replace(" ", String.Empty), 1)
End Sub
Private Sub AgregaSerieLote(SerieLote As String, Tipo As Integer)
Private Sub AgregaSerie(Serie As String, Tipo As Integer)
'SerieLote = SerieLote.Trim.Replace(" ", " ")
If SerieLote.Trim = "" Then
If Serie.Trim = "" Then
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim SeriesArreglo = SerieLote.Trim.Split(";"c)
Dim SeriesArreglo = Serie.Trim.Split(";"c)
'VALIDACION DE SERIES DUPLICADAS
Dim MensajeAlert As New StringBuilder
@@ -1529,10 +1540,10 @@ Partial Class Inventarios_RecepcionAlmacen
DtSeriesNuevas.Columns.Add("Serie", GetType(String))
'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltroPrimero("", "PS")
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltroPrimero("", "PS")
For Each Serie In SeriesArreglo
DtDuplicado = DtDatosDetalle.FiltraParametros($"ConsecId = {CveConsecSerieLote} AND Serie = '{Serie}'")
DtDuplicado = DtDatosDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Serie = '{Serie}'")
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
MensajeAlert.Append($"<br/> El numero de Serie <b>""{Serie}""</b> proporcionado ya se encuentra ingresado.")
Continue For
@@ -1575,13 +1586,13 @@ Partial Class Inventarios_RecepcionAlmacen
End If
'VALIDA QUE SIGA AGREGANDO
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote)).Rows.Count < LbCantidad.Text.ToEntero Then
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < LbCantidad.Text.ToEntero Then
Exit For
End If
'VERIFICA EXISTENCIAS
If TipoMovimiento > 1 Then
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Serie)
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie)
If Existencia < 1 Then
MensajeSinExistencias.Append($"Serie: <b>{Serie}</b>. <br/>")
Continue For
@@ -1596,15 +1607,15 @@ Partial Class Inventarios_RecepcionAlmacen
End If
'Dim AplicaCaducidad = False
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0) IsNot Nothing Then
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
'End If
Row("ConsecId") = CveConsecSerieLote
Row("ConsecId") = CveConsecSerie
Row("Consec") = DtDatosDetalle.Rows.Count + 1
Row("CvePS") = CvePSSerieLote
Row("CveUM") = CveUMSerieLote
Row("PU") = PUSerieLote
Row("CvePS") = CvePSSerie
Row("CveUM") = CveUMSerie
Row("PU") = PUSerie
Row("Serie") = Serie
Row("FechaCaducidad") = MinFecha.ToShortDateString
@@ -1613,7 +1624,7 @@ Partial Class Inventarios_RecepcionAlmacen
ObjInventarios.Dispose()
If Tipo = 1 Then
TxtSerieLote.Text = ""
TxtSerie.Text = ""
TxtFechaCaducidad.Text = Now.ToShortDateString
End If
@@ -1659,7 +1670,6 @@ Partial Class Inventarios_RecepcionAlmacen
DtDatosLoteDetalle.Columns.Add("CveUM", GetType(Integer))
DtDatosLoteDetalle.Columns.Add("PU", GetType(Decimal))
DtDatosLoteDetalle.Columns.Add("Lote", GetType(String))
DtDatosLoteDetalle.Columns.Add("Batch", GetType(String))
DtDatosLoteDetalle.Columns.Add("FechaCaducidad", GetType(String))
End If
End Sub
@@ -1669,20 +1679,20 @@ Partial Class Inventarios_RecepcionAlmacen
LbLoteProducto2.Text = Argumentos(3)
LbLoteCantidad2.Text = Argumentos(4).FormatoNumero
CvePSSerieLote = Argumentos(0).ToEntero
CveUMSerieLote = Argumentos(1).ToEntero
PUSerieLote = Argumentos(2).ToDecimal
CveConsecSerieLote = Argumentos(5).ToEntero
CvePSSerie = Argumentos(0).ToEntero
CveUMSerie = Argumentos(1).ToEntero
PUSerie = Argumentos(2).ToDecimal
CveConsecSerie = Argumentos(5).ToEntero
CargaLote(1)
End Sub
Private Sub CargaLote(Tipo As Integer, Optional CerrarCompletado As Boolean = False)
RegistraScript("$('#DivLote').modal();", "ModalLote")
GvLote.DataSource = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote), "Consec DESC")
GvLote.DataSource = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
GvLote.DataBind()
'VALIDA QUE SIGA AGREGANDO
If Not DtDatosLoteDetalle.SUM("Cantidad", String.Format("ConsecId = {0}", CveConsecSerieLote)) < LbLoteCantidad2.Text.ToDouble Then
If Not DtDatosLoteDetalle.SUM("Cantidad", String.Format("ConsecId = {0}", CveConsecSerie)) < LbLoteCantidad2.Text.ToDouble Then
BtnAddPSLote.Enabled = False
If CerrarCompletado Then
RegistraScript("$('#DivLote').modal('hide');")
@@ -1694,7 +1704,7 @@ Partial Class Inventarios_RecepcionAlmacen
'SI TIENE ENTRADA POR LOTE, BLOQUEAMOS CHECK Y TXTCANTIDAD
Dim Contador = 0.0
For Each Gvr As GridViewRow In GvInv.Rows
If Gvr.DataKey("CvePS").ToEntero = CvePSSerieLote Then
If Gvr.DataKey("CvePS").ToEntero = CvePSSerie Then
Contador = DtDatosLoteDetalle.SUM("Cantidad", String.Format("ConsecId = {0}", Gvr.DataKey("Consec")))
Gvr.FCCheckBox("cbInv").Enabled = False
Gvr.FCTextBox("TbCantidadF").Enabled = False
@@ -1729,10 +1739,10 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub
Protected Sub BtnAddPSLote_Click(sender As Object, e As EventArgs)
AgregaLote(TxtLote.Text.Trim, TxtBatch.Text.Trim, 1)
AgregaLote(TxtLote.Text.Trim, TxtFechaCaducidad.Text.ToDate, 1)
End Sub
Private Sub AgregaLote(Lote As String, Batch As String, Tipo As Integer)
Private Sub AgregaLote(Lote As String, FechaCaducidad As Date, Tipo As Integer)
If Lote.Trim = "" Then
Alert("El campo Lote es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
@@ -1745,9 +1755,9 @@ Partial Class Inventarios_RecepcionAlmacen
Dim DtSeriesNuevas As New DataTable
DtSeriesNuevas.Columns.Add("Serie", GetType(String))
DtDuplicado = DtDatosLoteDetalle.FiltraParametros($"ConsecId = {CveConsecSerieLote} AND Lote = '{Lote}' AND Batch = '{Batch}'")
DtDuplicado = DtDatosLoteDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Lote = '{Lote}' ")
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
Alert($"<br/> El numero de Lote <b>""{Lote}""</b> y Batch = '{Batch}' proporcionado ya se encuentra ingresado.", TipoMensaje.MsgAdvertencia)
Alert($"<br/> El numero de Lote <b>""{Lote}""</b> proporcionado ya se encuentra ingresado.", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
Exit Sub
End If
@@ -1760,28 +1770,28 @@ Partial Class Inventarios_RecepcionAlmacen
'VERIFICA EXISTENCIAS
If TipoMovimiento > 1 Then
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Lote, Batch:=Batch)
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Lote, FechaCaducidad:=FechaCaducidad)
If Existencia < CantidadLote Then
Alert($"<br/> El numero de Lote <b>""{Lote}""</b> y Batch = '{Batch}' proporcionado ya se encuentra ingresado.", TipoMensaje.MsgAdvertencia)
Alert($"<br/> El numero de Lote <b>""{Lote}""</b> y FechaCaducidad = '{FechaCaducidad}' proporcionado ya se encuentra ingresado.", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End If
If TipoMovimiento = 2 Then
If Not DtExistencias.SUM("Existencia", $"Lote = '{Lote}' Batch = '{Batch}'") = 0 Then
Alert($"<br/> El numero de Lote <b>""{Lote}""</b> y Batch '{Batch}' proporcionado ya se encuentra ingresado.", TipoMensaje.MsgAdvertencia)
If Not DtExistencias.SUM("Existencia", $"Lote = '{Lote}' FechaCaducidad = '{FechaCaducidad}'") = 0 Then
Alert($"<br/> El numero de Lote <b>""{Lote}""</b> y FechaCaducidad '{FechaCaducidad}' proporcionado ya se encuentra ingresado.", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End If
End If
End If
Row("ConsecId") = CveConsecSerieLote
Row("ConsecId") = CveConsecSerie
Row("Consec") = DtDatosDetalle.Rows.Count + 1
Row("Cantidad") = CantidadLote
Row("CvePS") = CvePSSerieLote
Row("CveUM") = CveUMSerieLote
Row("PU") = PUSerieLote
Row("CvePS") = CvePSSerie
Row("CveUM") = CveUMSerie
Row("PU") = PUSerie
Row("Lote") = Lote
Row("Batch") = Batch
Row("FechaCaducidad") = FechaCaducidad
Row("FechaCaducidad") = If(IsDate(TxtFechaCaducidadLote.Text), TxtFechaCaducidadLote.Text, MinFecha.ToShortDateString)
'Row("FechaCaducidad") = If(AplicaCaducidad, TxtFechaCaducidadLote.Text, MinFecha.ToShortDateString)
@@ -1799,10 +1809,10 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub
Protected Sub GvLote_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvLote.RowDeleting
Dim keyLote As String = e.Keys("Lote").ToString
Dim keyBatch As String = e.Keys("Batch").ToString
Try
For Each dr As DataRow In DtDatosLoteDetalle.Rows
If dr("Lote").ToString = keyLote And dr("Batch").ToString = keyBatch Then
If dr("Lote").ToString = keyLote Then
dr.Delete()
End If
Next
@@ -1946,14 +1956,39 @@ Partial Class Inventarios_RecepcionAlmacen
ObjComprasDif.Dispose()
End If
Dim ValidaSeccion As Boolean = False : Dim ValidaCaducidad As Boolean = False : Dim ValidaLote As Boolean = False
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
Dim Index = 0
For Each gvr As GridViewRow In GvInv.Rows
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
DtInv.Rows(Index)("CantidadSurtidaPantalla") = gvr.FCTextBox("TbCantidadF").Text.ToDouble
If CBool(gvr.DataKey("AplicaSeccion")) AndAlso gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero <= 0 Then
ValidaSeccion = True
End If
If CBool(gvr.DataKey("AplicaCaducidad")) AndAlso gvr.FCTextBox("TxtCaducidad").Text.Trim = "" Then
ValidaCaducidad = True
End If
If CBool(gvr.DataKey("AplicaLote")) AndAlso gvr.FCTextBox("TxtLote").Text.Trim = "" Then
ValidaLote = True
End If
End If
Index += 1
Next
If ValidaSeccion Then
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
Return False
End If
If ValidaCaducidad Then
Alert("La caducidad no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
Return False
End If
If ValidaLote Then
Alert("El lote de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
Return False
End If
'VERIFICA EXISTENCIAS
If TipoMovimiento > 1 Then
@@ -1989,13 +2024,6 @@ Partial Class Inventarios_RecepcionAlmacen
End If
If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then
If TotalCantidad <> DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") Then
Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia)
Return False
End If
End If
Return True
End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
@@ -2180,7 +2208,7 @@ Partial Class Inventarios_RecepcionAlmacen
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (PU))
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), SerieLote:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Serie:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
ErrorMovInv = True
Exit For
End If
@@ -2195,7 +2223,7 @@ Partial Class Inventarios_RecepcionAlmacen
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
ErrorMovInv = True
Exit For
End If
@@ -2216,14 +2244,14 @@ Partial Class Inventarios_RecepcionAlmacen
End If
End If
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {gvr.RowIndex}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
Exit For
End If
Next
End If
'If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
' For Each Dr As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {gvr.RowIndex}").Rows
' If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("CantidadSeccionAlmacen").ToString.ToDecimal) Then
' ErrorMovInv = True
' Exit For
' End If
' Next
'End If
Cont += 1
End If
Next
@@ -2280,7 +2308,7 @@ Partial Class Inventarios_RecepcionAlmacen
If Not ErrorMovInv AndAlso Dt IsNot Nothing Then
For Each Dr As DataRow In Dt.FiltraParametros($"CveVenta={CveVenta}").Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
@@ -2341,12 +2369,12 @@ Partial Class Inventarios_RecepcionAlmacen
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovtoEntradaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovtoEntradaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
@@ -2944,14 +2972,14 @@ Partial Class Inventarios_RecepcionAlmacen
DtDetalleLote = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec").ToEntero))
If DtDetalle.Rows.Count > 0 Then
For Each Dr As DataRow In DtDetalle.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), SerieLote:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Serie:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
ErrorMovInv = True
Exit For
End If
Next
ElseIf DtDetalleLote.Rows.Count > 0 Then
For Each Dr As DataRow In DtDetalleLote.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
ErrorMovInv = True
Exit For
End If
@@ -3744,85 +3772,6 @@ Partial Class Inventarios_RecepcionAlmacen
#End Region
#Region "SECCION ALMACEN"
Private Sub CreaDtSeccionAlmacen()
DtSeccionAlmacen = New DataTable
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("SeccionAlmacen", GetType(String))
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
End Sub
Private Sub CargaDdlAlmacen()
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacen.DataBind()
End Sub
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CantidadTotal = gvRow.FCTextBox("TbCantidadF").Text.ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
End Sub
Private Sub CargaSeccionAlmacen()
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
GvSeccionAlmacen.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}")
GvSeccionAlmacen.DataBind()
TxtCantidadSeccion.Text = ""
DdlSeccionAlmacen.SelectedIndex = 0
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
If CantidadRestante = 0 Then
RVTxtCantidad.MaximumValue = "1"
TxtCantidadSeccion.Enabled = False
Else
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
TxtCantidadSeccion.Enabled = True
End If
If CantidadTotalSeccion > 0 Then
GvInv.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = False
GvInv.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = "Cuenta con sección almacen"
Else
GvInv.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = True
GvInv.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = ""
End If
UpModalSeccionAlmacen.Update()
UPInv.Update()
End Sub
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
Dim Row As DataRow = Nothing
DtSeccionAlmacen.AcceptChanges()
Row = DtSeccionAlmacen.NewRow
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
Row("CveSeccionAlmacen") = DdlSeccionAlmacen.SelectedValue.ToEntero
Row("SeccionAlmacen") = DdlSeccionAlmacen.SelectedItem.Text
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
DtSeccionAlmacen.Rows.Add(Row)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim Index As Integer = 0
For Each Dr As DataRow In DtSeccionAlmacen.Rows
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
Exit For
End If
Index += 1
Next
DtSeccionAlmacen.Rows.RemoveAt(Index)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
#End Region
#Region "DIVIDIR"
Protected Sub Dividir(sender As Object, e As EventArgs)

View File

@@ -386,7 +386,6 @@ Partial Class Inventarios_RecepcionUsados
BtnContabilizar.Enabled = PermiteContabilizar()
BtnNuevo.Enabled = PermiteCrearNuevo()
ActivaPermisoSeccionAlmacen()
If CveMovimiento > 0 Then
PermisoVerImportes()
End If
@@ -417,11 +416,7 @@ Partial Class Inventarios_RecepcionUsados
Private Function PermiteCrearNuevo() As Boolean
Return If(UsuarioActual.TienePermisoProceso(184) Or EsConsumoInterno, True, False)
End Function
Private Sub ActivaPermisoSeccionAlmacen()
' GvM.Columns(12).Visible = UsuarioActual.Empresa.Funcionalidad(147) = "1"
End Sub
Private Sub PermisoVerImportes()
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
End Sub
@@ -465,7 +460,6 @@ Partial Class Inventarios_RecepcionUsados
dt.Columns.Add("CveAF")
dt.Columns.Add("SerieLote", Type.GetType("System.String"))
dt.Columns.Add("Lote", Type.GetType("System.String"))
dt.Columns.Add("Batch", Type.GetType("System.String"))
dt.Columns.Add("Observaciones")
dt.Columns.Add("CountMovimientoEntradaDetalle")
@@ -481,10 +475,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Private Sub CargaCombos()
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccion.DataBind()
'Llenar el dropdownlist de monedas
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
@@ -870,9 +860,9 @@ Partial Class Inventarios_RecepcionUsados
#End Region
#Region " AGREGAR - GUARDAR "
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional SerieLote As String = "-1", Optional Lote As String = "-1", Optional Batch As String = "-1") As Double
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional SerieLote As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Double
Dim Inv As New ClsInventarios
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, -1, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), SerieLote:=SerieLote, Lote:=Lote, Batch:=Batch)
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, -1, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), SerieLote:=SerieLote, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
Inv.Dispose()
Return Existencia
End Function
@@ -976,7 +966,6 @@ Partial Class Inventarios_RecepcionUsados
registro.Item("CveAF") = CveAF
registro.Item("SerieLote") = If(SerieLote <> "", SerieLote, "")
registro.Item("Lote") = If(Lote <> "", Lote, "")
registro.Item("Batch") = If(Batch <> "", Batch, "")
registro.Item("Observaciones") = Observaciones
registro.Item("CveTamaño") = CveTamaño
@@ -1013,7 +1002,6 @@ Partial Class Inventarios_RecepcionUsados
DtMovimientos.Rows(IndexDTUsado)("CveAF") = CveAF
DtMovimientos.Rows(IndexDTUsado)("SerieLote") = If(SerieLote <> "", SerieLote, "")
DtMovimientos.Rows(IndexDTUsado)("Lote") = If(Lote <> "", Lote, "")
DtMovimientos.Rows(IndexDTUsado)("Batch") = If(Batch <> "", Batch, "")
DtMovimientos.Rows(IndexDTUsado)("Observaciones") = Observaciones
DtMovimientos.Rows(IndexDTUsado)("CveTamaño") = CveTamaño
@@ -1133,7 +1121,7 @@ Partial Class Inventarios_RecepcionUsados
ImporteConcepto = Dr("PU").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
@@ -1273,7 +1261,7 @@ Partial Class Inventarios_RecepcionUsados
-1, -1, -1, -1, Modulo:="RU/G")
End If
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, SerieLote:=SerieLote)
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=SerieLote)
ObjInv.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa)
DtMovimientos = ObjInv.DtResultados.FiltraParametros("", "CveMovimientoDetalle DESC").AsEnumerable.Take(25).CopyToDataTable
ObjInv.Dispose()

View File

@@ -273,7 +273,7 @@
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="10%" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
ss
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10%">
@@ -475,7 +475,7 @@
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="10%" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacenDestino_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
xx
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -496,76 +496,6 @@
</ajax:TabContainer>
<%--SECCION DE ALMACEN--%>
<div id="DModalSeccionAlmacen" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalSeccionAlmacen" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="LtlSeccionAlmacen" Text="Sección Almacen" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidadSeccion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCantidadSeccion" runat="server" ControlToValidate="TxtCantidadSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCantidadSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCantidadSeccion"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
<label for="<%= TxtCantidadSeccion.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
<div class="col-md-4" runat="server" id="DivSeccionAlmacenOrigen">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacenOrigen" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacenOrigen" runat="server" ControlToValidate="DdlSeccionAlmacenOrigen" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen Origen''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoSeccionAlmacenOrigen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacenOrigen"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacenOrigen.ClientID.ToString()%>">Sección Almacen O.:</label>
</div>
</div>
<div class="col-md-4" runat="server" id="DivSeccionAlmacenDestino" visible="false">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacenDestino" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacenDestino" runat="server" ControlToValidate="DdlSeccionAlmacenDestino" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen Destino''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacenDestino" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacenDestino"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacenDestino.ClientID.ToString()%>">Sección Almacen D.:</label>
</div>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAddSeccionAlmacen" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " OnClick="LnkAddSeccionAlmacen_Click" data-placement="top" ToolTip="Agregar Sección Almacen" runat="server" ValidationGroup="VgmSeccion"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvSeccion" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
AutoGenerateColumns="False" EmptyDataText="No se han agregado datos"
DataKeyNames="Consec">
<Columns>
<asp:BoundField DataField="CantidadSeccionAlmacen" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="SeccionAlmacenOrigen" HeaderText="Sección Almacen Origen" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="SeccionAlmacenDestino" HeaderText="Sección Almacen Destino" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarSeccion" runat="server" OnClick="LnkEliminarSeccion_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la sección?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -176,8 +176,6 @@ Partial Class Inventarios_ResguardoMaterial
CantidadTotal = 0
IndexSeccionAlmacen = 0
CvePS = 0
CreaDtSeccionAlmacen()
CargaDdlAlmacen()
TipoSeccionAlmacen = 0
End Sub
@@ -783,16 +781,6 @@ Partial Class Inventarios_ResguardoMaterial
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 1").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
TieneError = True
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -812,16 +800,7 @@ Partial Class Inventarios_ResguardoMaterial
TieneError = True
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 1").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
TieneError = True
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -849,16 +828,7 @@ Partial Class Inventarios_ResguardoMaterial
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 2").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
TieneError = True
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
End If
Cont += 1
@@ -880,16 +850,7 @@ Partial Class Inventarios_ResguardoMaterial
TieneError = True
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 2").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
TieneError = True
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -1010,206 +971,6 @@ Partial Class Inventarios_ResguardoMaterial
UpFiltraLiberacion.Update()
End Sub
#End Region
#Region "SECCION ALMACEN"
Private Sub CreaDtSeccionAlmacen()
DtSeccionAlmacen = New DataTable
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenOrigen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenDestino", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer))
DtSeccionAlmacen.Columns.Add("SeccionAlmacenOrigen", GetType(String))
DtSeccionAlmacen.Columns.Add("SeccionAlmacenDestino", GetType(String))
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
DtSeccionAlmacen.Columns.Add("TipoSeccionAlmacen", GetType(Integer))
End Sub
Private Sub CargaDdlAlmacen()
DdlSeccionAlmacenOrigen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacenOrigen.DataBind()
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacenDestino.DataBind()
End Sub
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen origen.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If Not DdlAlmacenDestino.SelectedValue.ToEntero > 0 AndAlso Not ChkTransitorio.Checked Then
' Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen destino.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
GvSeccion.Columns(2).Visible = True
DivSeccionAlmacenDestino.Visible = True
DivSeccionAlmacenOrigen.Visible = True
GvSeccion.Columns(1).Visible = True
CantidadTotal = gvRow.DataKey("Cantidad").ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CvePS = gvRow.DataKey("CvePS").ToEntero
TipoSeccionAlmacen = 1
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
End Sub
Protected Sub LnkSeccionAlmacenDestino_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
If Not DdlAlmacenLiberacion.SelectedValue.ToEntero > 0 Then
Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen destino.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DivSeccionAlmacenOrigen.Visible = True
DivSeccionAlmacenDestino.Visible = True
GvSeccion.Columns(1).Visible = True
GvSeccion.Columns(2).Visible = True
CantidadTotal = gvRow.FCTextBox("TxtCantidad").Text.ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CvePS = gvRow.DataKey("CvePS").ToEntero
TipoSeccionAlmacen = 2
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
End Sub
Private Sub CargaSeccionAlmacen()
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
GvSeccion.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}")
GvSeccion.DataBind()
TxtCantidadSeccion.Text = ""
DdlSeccionAlmacenOrigen.SelectedIndex = 0
DdlSeccionAlmacenDestino.SelectedIndex = 0
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
If CantidadRestante = 0 Then
RVTxtCantidad.MaximumValue = "1"
TxtCantidadSeccion.Enabled = False
Else
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
TxtCantidadSeccion.Enabled = True
End If
If TipoSeccionAlmacen = 1 Then
If CantidadTotalSeccion > 0 Then
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = False
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
Else
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = True
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = ""
End If
If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
DdlAlmacen.Enabled = False
DdlAlmacen.ToolTip = "Cuenta con sección almacen"
Else
DdlAlmacen.Enabled = True
DdlAlmacen.ToolTip = ""
End If
UpGenerales.Update()
ElseIf TipoSeccionAlmacen = 2 Then
If CantidadTotalSeccion > 0 Then
GvMLiberacion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").Enabled = False
GvMLiberacion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").ToolTip = "Cuenta con sección almacen"
Else
GvMLiberacion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").Enabled = True
GvMLiberacion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").ToolTip = ""
End If
If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
DdlAlmacenLiberacion.Enabled = False
DdlAlmacenLiberacion.ToolTip = "Cuenta con sección almacen"
Else
DdlAlmacenLiberacion.Enabled = True
DdlAlmacenLiberacion.ToolTip = ""
End If
UpGridLiberacion.Update()
UpFiltraLiberacion.Update()
End If
UpModalSeccionAlmacen.Update()
End Sub
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
Dim ObjInv As New ClsInventarios
Dim CantidadDisponible As Decimal = 0
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacenOrigen.SelectedValue.ToEntero, If(TipoSeccionAlmacen = 1, DdlAlmacen.SelectedValue.ToEntero, DdlAlmacenLiberacion.SelectedValue.ToEntero),
CvePS, UsuarioActual.CveEmpresa) Then
If ObjInv.DtResultados.Rows.Count > 0 Then
CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
End If
End If
ObjInv.Dispose()
CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacenOrigen = {DdlSeccionAlmacenOrigen.SelectedValue} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Row As DataRow = Nothing
DtSeccionAlmacen.AcceptChanges()
Row = DtSeccionAlmacen.NewRow
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
Row("CveSeccionAlmacenOrigen") = DdlSeccionAlmacenOrigen.SelectedValue.ToEntero
Row("SeccionAlmacenOrigen") = DdlSeccionAlmacenOrigen.SelectedItem.Text
Row("CveSeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedValue.ToEntero
Row("SeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedItem.Text
Row("CvePS") = CvePS
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
Row("TipoSeccionAlmacen") = TipoSeccionAlmacen
DtSeccionAlmacen.Rows.Add(Row)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim Index As Integer = 0
For Each Dr As DataRow In DtSeccionAlmacen.Rows
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
Exit For
End If
Index += 1
Next
DtSeccionAlmacen.Rows.RemoveAt(Index)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
' If Not CveVentaSurtir > 0 Then
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' Dim ObjInv As New ClsInventarios
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
' End If
' ObjInv.Dispose()
' GvVerSeccionesAlmacen.DataBind()
' UpVerSeccionesAlmacen.Update()
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
'End Sub
#End Region
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click

View File

@@ -450,10 +450,10 @@
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="90px" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="90px" />
<asp:BoundField HeaderText="Batch" DataField="Batch" ItemStyle-Width="90px" />
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-Width="90px" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
s
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
@@ -654,7 +654,7 @@
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="15%" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacenDestino" OnClick="LnkSeccionAlmacenDestino_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
sss
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -727,73 +727,6 @@
</div>
</div>
<%--SECCION DE ALMACEN--%>
<div id="DModalSeccionAlmacen" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalSeccionAlmacen" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="LtlSeccionAlmacen" Text="Sección Almacen" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidadSeccion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCantidadSeccion" runat="server" ControlToValidate="TxtCantidadSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCantidadSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCantidadSeccion"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
<label for="<%= TxtCantidadSeccion.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
<div class="col-md-4" runat="server" id="DivSeccionAlmacenOrigen">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacenOrigen" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacenOrigen" runat="server" ControlToValidate="DdlSeccionAlmacenOrigen" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen Origen''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoSeccionAlmacenOrigen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacenOrigen"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacenOrigen.ClientID.ToString()%>">Sección Almacen O.:</label>
</div>
</div>
<div class="col-md-4" runat="server" id="DivSeccionAlmacenDestino" visible="false">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacenDestino" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacenDestino" runat="server" ControlToValidate="DdlSeccionAlmacenDestino" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen Destino''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacenDestino" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacenDestino"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacenDestino.ClientID.ToString()%>">Sección Almacen D.:</label>
</div>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAddSeccionAlmacen" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " OnClick="LnkAddSeccionAlmacen_Click" data-placement="top" ToolTip="Agregar Sección Almacen" runat="server" ValidationGroup="VgmSeccion"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvSeccion" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
AutoGenerateColumns="False" EmptyDataText="No se han agregado datos"
DataKeyNames="Consec">
<Columns>
<asp:BoundField DataField="CantidadSeccionAlmacen" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="SeccionAlmacenOrigen" HeaderText="Sección Almacen Origen" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="SeccionAlmacenDestino" HeaderText="Sección Almacen Destino" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarSeccion" runat="server" OnClick="LnkEliminarSeccion_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la sección?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<%--CARGA EXCEL--%>
<div id="DivCargaExcelConceptos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">

View File

@@ -128,22 +128,6 @@ Partial Class Inventarios_TraspasoAlmacen
End Set
End Property
Private Property DtSeccionAlmacen As DataTable
Get
Return CType(ViewState("DtSeccionAlmacen"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtSeccionAlmacen") = value
End Set
End Property
Private Property IndexSeccionAlmacen As Integer
Get
Return CType(ViewState("IndexSeccionAlmacen"), Integer)
End Get
Set(value As Integer)
ViewState("IndexSeccionAlmacen") = value
End Set
End Property
Private Property CantidadTotal As Decimal
Get
Return CType(ViewState("CantidadTotal"), Decimal)
@@ -227,10 +211,9 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then DivEmitirTimbrado.Visible = True
CantidadTotal = 0
IndexSeccionAlmacen = 0
CvePS = 0
CreaDtSeccionAlmacen()
CargaDdlAlmacen()
TipoSeccionAlmacen = 0
Else
@@ -265,7 +248,7 @@ Partial Class Inventarios_TraspasoAlmacen
dt.Columns.Add("Observaciones")
dt.Columns.Add("SerieLote")
dt.Columns.Add("Lote")
dt.Columns.Add("Batch")
dt.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
'dt.Columns.Add("PU", Type.GetType("System.Double"))
'dt.Columns.Add("Total", Type.GetType("System.Double"))
@@ -532,7 +515,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
End If
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, If(TxtnSerieLote.Visible, TxtnSerieLote.Text, "-1"), If(TxtnLote.Visible, TxtnLote.Text, "-1"), If(TxtnBatch.Visible, TxtnBatch.Text, "-1"))
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, -1, If(TxtnSerieLote.Visible, TxtnSerieLote.Text, "-1"), If(TxtnLote.Visible, TxtnLote.Text, "-1"), MinFecha)
If Valido Then
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, If(TxtnSerieLote.Visible, TxtnSerieLote.Text, ""), If(TxtnLote.Visible, TxtnLote.Text, ""), If(TxtnBatch.Visible, TxtnBatch.Text, ""), FuncionalidadSinSerie)
@@ -540,11 +523,11 @@ Partial Class Inventarios_TraspasoAlmacen
End If
End Sub
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional SerieLote As String = "-1", Optional Lote As String = "-1", Optional Batch As String = "-1") As Boolean
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, SerieLote As String, Lote As String, Fechacaducidad As Date) As Boolean
Dim Retorno = True
Dim Inv As New ClsInventarios
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=SerieLote, Lote:=Lote, Batch:=Batch, PendientePorSurtir:=1)
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=SerieLote, Lote:=Lote, FechaCaducidad:=Fechacaducidad, PendientePorSurtir:=1)
Inv.Dispose()
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(SerieLote <> "-1", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then
@@ -560,7 +543,7 @@ Partial Class Inventarios_TraspasoAlmacen
Return Retorno
End Function
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional SerieLote As String = "", Optional Lote As String = "", Optional Batch As String = "", Optional Limpia As Boolean = True)
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional SerieLote As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True)
If Cantidad <= 0 Then
Alert("La cantidad debe ser mayor a cero (0). Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
@@ -583,7 +566,7 @@ Partial Class Inventarios_TraspasoAlmacen
registro.Item("Observaciones") = Observaciones
registro.Item("SerieLote") = SerieLote
registro.Item("Lote") = Lote
registro.Item("Batch") = Batch
registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("CveClasificacion") = CveClasificacion
registro.Item("CveAF") = -1
registro.Item("EstatusExistencia") = "1"
@@ -745,13 +728,6 @@ Partial Class Inventarios_TraspasoAlmacen
End If
Dim TotalCantidad As Decimal = DtMovimientos.SUMD("Cantidad")
If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then
If TotalCantidad <> DtSeccionAlmacen.FiltraParametros("TipoSeccionAlmacen = 1").SUMD("CantidadSeccionAlmacen") Then
Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim TipoAlmacenOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero}").ToEntero
Dim TipoAlmacenDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero
@@ -796,20 +772,10 @@ Partial Class Inventarios_TraspasoAlmacen
Else
Dim Cont As Integer = 0
For Each Dr As DataRow In DtMovimientos.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, Observaciones:=Dr("Observaciones").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 1").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -861,20 +827,10 @@ Partial Class Inventarios_TraspasoAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim Cont As Integer = 0
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, Observaciones:=Dr("Observaciones").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 1").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
Cont += 1
Next
@@ -1048,7 +1004,7 @@ Partial Class Inventarios_TraspasoAlmacen
Else
For Each Dr As DataRow In DtMovimientos.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
@@ -1129,7 +1085,6 @@ Partial Class Inventarios_TraspasoAlmacen
TxtGastoIndirecto.Text = ""
TxtPlaca.Text = ""
TxtEspecifUnidad.Text = ""
DtSeccionAlmacen.Rows.Clear()
TxtResponsableCarga.Text = ""
TxtResponsableRecibio.Text = ""
TxtIdentificacion.Text = ""
@@ -1282,10 +1237,6 @@ Partial Class Inventarios_TraspasoAlmacen
e.Row.FCTextBox("TxtCantidad2").Attributes.Add("onblur", String.Format("ValidaCantidad(this,{0})", e.Row.DBCampo("Cantidad")))
End If
If DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {e.Row.RowIndex}").SUMD("CantidadSeccionAlmacen") > 0 Then
e.Row.FCLinkButton("lnkRemove").Visible = False
e.Row.FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
End If
'If If(e.Row.DBCampo("SerieLote").ToString = "", "-1", e.Row.DBCampo("SerieLote").ToString) <> "-1" Then
' TxtnSerieLote.Visible = True
' ThSerieLote.Visible = True
@@ -1307,7 +1258,7 @@ Partial Class Inventarios_TraspasoAlmacen
' ThBatch.Visible = True
' TdBatch.Visible = True
' GvDatos.Columns(6).Visible = True
' e.Row.Cells(6).Text = e.Row.DBCampo("Batch").ToString
'Else
' e.Row.Cells(5).Text = ""
' e.Row.Cells(6).Text = ""
@@ -1415,7 +1366,6 @@ Partial Class Inventarios_TraspasoAlmacen
RegistraScript("$('#DivTransitorio').hide(500);$('#DivGastoIndirecto').hide(500);$('#DivDocChofer').hide(500);")
End If
UpModalSeccionAlmacen.Update()
SiguienteFolio(If(ChkTransitorio.Checked, 9, 8))
End Sub
Protected Sub BtnCargaTransitorios_Click(sender As Object, e As EventArgs)
@@ -1449,8 +1399,6 @@ Partial Class Inventarios_TraspasoAlmacen
'Dt.Dispose()
End If
DtSeccionAlmacen.Rows.Clear()
If TxtFolioRecepcion.Text = "" Then
BtnRecibir.Visible = False
BtnCancelarTraspaso.Visible = False
@@ -1567,7 +1515,7 @@ Partial Class Inventarios_TraspasoAlmacen
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, GvRow.DataKey("SerieLote").ToString, Lote:=GvRow.DataKey("Lote"), Batch:=GvRow.DataKey("Batch"), CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, SerieLote:=GvRow.DataKey("SerieLote").ToString, Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
@@ -1577,28 +1525,6 @@ Partial Class Inventarios_TraspasoAlmacen
End If
Next
'If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
' For Each Dr As DataRow In ObjInventario.DtResultados.Rows
' CveMovimientoDetalleSalida = Dr("CveMovimientoDetalle").ToString.ToEntero
' Dim Cantidad As Double = Dr("Cantidad").ToString.ToDouble
' Dim PrecioUnitario As Double = Dr("PU").ToString.ToDouble
' If CveMovimientoDetalleSalida <= 0 Then
' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos de salida"
' Exit For
' End If
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PrecioUnitario, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos de entrada"
' Exit For
' End If
' importe += Cantidad * PrecioUnitario
' Next
'Else
' ErrorMovInv = True
' TextoError = "Ocurrió un error al obtener los movimientos de salida"
'End If
'VIRTUAL ENTRADA
@@ -1708,12 +1634,6 @@ Partial Class Inventarios_TraspasoAlmacen
Exit Sub
End If
If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then
If ValidaMovtos <> DtSeccionAlmacen.FiltraParametros("TipoSeccionAlmacen = 2").SUMD("CantidadSeccionAlmacen") Then
Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim ObjInventario As New ClsInventarios
Dim Dtt As DataTable = Nothing
@@ -1772,20 +1692,10 @@ Partial Class Inventarios_TraspasoAlmacen
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDecimal, gvr.DataKey("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, SerieLote:=gvr.DataKey("SerieLote").ToString, Lote:=gvr.DataKey("Lote").ToString, Batch:=gvr.DataKey("Batch").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDecimal, gvr.DataKey("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, SerieLote:=gvr.DataKey("SerieLote").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont} AND TipoSeccionAlmacen = 2").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
End If
ElseIf cantidadDisponibleValidacion < 0 Then
TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString)
@@ -2017,7 +1927,7 @@ Partial Class Inventarios_TraspasoAlmacen
txtCantidad.Text = "1"
Dim Valido = ValidaExistencia(1, CvePSSerieLote, CveUMSerieLote, TxtSeriePS.Text.Trim)
Dim Valido = ValidaExistencia(1, CvePSSerieLote, CveUMSerieLote, -1, TxtSeriePS.Text.Trim, "-1", MinFecha)
If Valido Then
AgregarPS(1, CvePSSerieLote, CveUMSerieLote, TxtSeriePS.Text.Trim)
@@ -2546,211 +2456,6 @@ Partial Class Inventarios_TraspasoAlmacen
End Try
End Sub
#End Region
#Region "SECCION ALMACEN"
Private Sub CreaDtSeccionAlmacen()
DtSeccionAlmacen = New DataTable
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenOrigen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenDestino", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer))
DtSeccionAlmacen.Columns.Add("SeccionAlmacenOrigen", GetType(String))
DtSeccionAlmacen.Columns.Add("SeccionAlmacenDestino", GetType(String))
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
DtSeccionAlmacen.Columns.Add("TipoSeccionAlmacen", GetType(Integer))
End Sub
Private Sub CargaDdlAlmacen()
DdlSeccionAlmacenOrigen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacenOrigen.DataBind()
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacenDestino.DataBind()
End Sub
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
If Not DdlAlmacenOrigen.SelectedValue.ToEntero > 0 Then
Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen origen.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If Not DdlAlmacenDestino.SelectedValue.ToEntero > 0 AndAlso Not ChkTransitorio.Checked Then
' Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen destino.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
If ChkTransitorio.Checked Then
GvSeccion.Columns(2).Visible = False
DivSeccionAlmacenDestino.Visible = False
Else
GvSeccion.Columns(2).Visible = True
DivSeccionAlmacenDestino.Visible = True
End If
DivSeccionAlmacenOrigen.Visible = True
GvSeccion.Columns(1).Visible = True
CantidadTotal = gvRow.DataKey("Cantidad").ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CvePS = gvRow.DataKey("CvePS").ToEntero
TipoSeccionAlmacen = 1
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
End Sub
Protected Sub LnkSeccionAlmacenDestino_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
If Not DdlAlmacenRecepcion.SelectedValue.ToEntero > 0 Then
Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen destino.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DivSeccionAlmacenOrigen.Visible = False
DivSeccionAlmacenDestino.Visible = True
GvSeccion.Columns(1).Visible = False
GvSeccion.Columns(2).Visible = True
CantidadTotal = gvRow.FCTextBox("TxtCantidad").Text.ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CvePS = gvRow.DataKey("CvePS").ToEntero
TipoSeccionAlmacen = 2
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
End Sub
Private Sub CargaSeccionAlmacen()
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
GvSeccion.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen} AND TipoSeccionAlmacen = {TipoSeccionAlmacen}")
GvSeccion.DataBind()
TxtCantidadSeccion.Text = ""
DdlSeccionAlmacenOrigen.SelectedIndex = 0
DdlSeccionAlmacenDestino.SelectedIndex = 0
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
If CantidadRestante = 0 Then
RVTxtCantidad.MaximumValue = "1"
TxtCantidadSeccion.Enabled = False
Else
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
TxtCantidadSeccion.Enabled = True
End If
If TipoSeccionAlmacen = 1 Then
If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
DdlAlmacenOrigen.Enabled = False
DdlAlmacenOrigen.ToolTip = "Cuenta con sección almacen"
ChkTransitorio.Enabled = False
ChkTransitorio.ToolTip = "Cuenta con sección almacen"
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Enabled = False
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
Else
DdlAlmacenOrigen.Enabled = True
DdlAlmacenOrigen.ToolTip = ""
ChkTransitorio.Enabled = True
ChkTransitorio.ToolTip = ""
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Enabled = True
GvDatos.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = ""
End If
UpDatos.Update()
ElseIf TipoSeccionAlmacen = 2 Then
If CantidadTotalSeccion > 0 Then
GvDatosRecepcion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").Enabled = False
GvDatosRecepcion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").ToolTip = "Cuenta con sección almacen"
Else
GvDatosRecepcion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").Enabled = True
GvDatosRecepcion.Rows(IndexSeccionAlmacen).FCTextBox("TxtCantidad").ToolTip = ""
End If
UpDatosRecepcion.Update()
End If
UpModalSeccionAlmacen.Update()
End Sub
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
If TipoSeccionAlmacen = 1 Then
Dim ObjInv As New ClsInventarios
Dim CantidadDisponible As Decimal = 0
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenOrigen.SelectedValue.ToEntero,
CvePS, UsuarioActual.CveEmpresa) Then
If ObjInv.DtResultados.Rows.Count > 0 Then
CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
End If
End If
ObjInv.Dispose()
CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacenOrigen = {DdlSeccionAlmacenOrigen.SelectedValue}").SUMD("CantidadSeccionAlmacen")
If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim Row As DataRow = Nothing
DtSeccionAlmacen.AcceptChanges()
Row = DtSeccionAlmacen.NewRow
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
Row("CveSeccionAlmacenOrigen") = DdlSeccionAlmacenOrigen.SelectedValue.ToEntero
Row("SeccionAlmacenOrigen") = DdlSeccionAlmacenOrigen.SelectedItem.Text
Row("CveSeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedValue.ToEntero
Row("SeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedItem.Text
Row("CvePS") = CvePS
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
Row("TipoSeccionAlmacen") = TipoSeccionAlmacen
DtSeccionAlmacen.Rows.Add(Row)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim Index As Integer = 0
For Each Dr As DataRow In DtSeccionAlmacen.Rows
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
Exit For
End If
Index += 1
Next
DtSeccionAlmacen.Rows.RemoveAt(Index)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
' If Not CveVentaSurtir > 0 Then
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' Dim ObjInv As New ClsInventarios
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
' End If
' ObjInv.Dispose()
' GvVerSeccionesAlmacen.DataBind()
' UpVerSeccionesAlmacen.Update()
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
'End Sub
#End Region
Protected Sub DldChofer_SelectedIndexChanged(sender As Object, e As EventArgs)
@@ -2867,6 +2572,8 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
Dim SerieLote As String = RowExcel("SerieLote").ToString()
Dim Observaciones As String = RowExcel("Observaciones").ToString()
Dim FechaCaducidad As Date = MinFecha
Dim Lote As String = "-1"
If CveProducto > 0 Then
@@ -2892,7 +2599,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
If Valido Then
Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, "-1"), "-1", "-1")
Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, -1, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, "-1"), Lote, FechaCaducidad)
End If
If Valido Then

View File

@@ -2545,7 +2545,7 @@ Partial Class ProductosyServicios
DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
DdlAlmacen.DataBind()
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
DdlSeccionAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
DdlSeccionAlmacen.DataBind()