Pendientes BDH, mejoras servicion E141, mwjoras carga PS entradas/salidas,cambios en modalidad contable, favicon signals gps
This commit is contained in:
@@ -100,6 +100,10 @@
|
||||
<asp:LinkButton runat="server" ID="LnkAgregarNuevoMov" Visible="false" CssClass="" data-toggle="tooltip" data-placement="left" OnClick="LnkAgregarNuevoMov_Click"
|
||||
title="Crear Nuevo Movimiento A Partir De" Text="<i class='fa fa-server'></i> Crear A Partir De"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkGenerarVirtual" Visible="false" CssClass="" data-toggle="tooltip" data-placement="left" OnClick="LnkGenerarVirtual_Click"
|
||||
title="Generar Movimiento Virtual" Text="<i class='fa fa-server'></i> Generar Movimiento Virtual"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
@@ -335,6 +335,10 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
|
||||
If Request("CveMovimiento") IsNot Nothing AndAlso Request("CveMovimiento").ToString.ToEntero > 0 Then
|
||||
If UsuarioActual.CveUsuario = 100 AndAlso UsuarioActual.CveEmpresa = 140 Then
|
||||
LnkGenerarVirtual.Visible = True
|
||||
End If
|
||||
|
||||
CargaDatos(Request("CveMovimiento").ToString.ToEntero)
|
||||
'CargaGvPaqueteria()
|
||||
Else
|
||||
@@ -1297,7 +1301,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String)
|
||||
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Optional CargarGV As Boolean = True)
|
||||
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
|
||||
|
||||
Dim Valido As Boolean = True
|
||||
@@ -1378,8 +1382,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
registro.Item("Observaciones") = Observaciones
|
||||
registro.Item("AplicaCaducidad") = RowPS("AplicaCaducidad").ToString
|
||||
DtMovimientos.Rows.Add(registro)
|
||||
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
|
||||
If CargarGV Then
|
||||
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -2375,7 +2383,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
#Region " GVM "
|
||||
Private Sub CargaGVM(DtTemp As DataTable)
|
||||
GvM.DataSource = DtTemp
|
||||
GvM.DataSource = DtTemp '.FiltraPorIndices(0, If(DtTemp.Rows.Count > 20, 19, DtTemp.Rows.Count - 1))
|
||||
GvM.DataBind()
|
||||
|
||||
EscondeColumnasGVM(DtTemp)
|
||||
@@ -4567,102 +4575,105 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
|
||||
dt.TableName = "Datos"
|
||||
Dim DTSeccionesAlmacen As DataTable = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
||||
If Not ErrorArchivo Then
|
||||
NumRow = 0
|
||||
Dim RowNoEncontrados As String = ""
|
||||
Dim NumAgregados As Integer = 0
|
||||
For Each Row As DataRow In dt.Rows
|
||||
Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal
|
||||
Dim UM As String = Row("UM").ToString
|
||||
Dim Codigo As String = Row("Código").ToString.Trim.ToUpper
|
||||
'Dim CodigoBarras As String = Row("Codigo Barras").ToString.Trim.ToUpper
|
||||
Dim ProductoServicio As String = Row("Producto/Servicio").ToString.Trim.ToUpper
|
||||
Dim PrecioUnitario As Decimal = Row("Precio Unitario").ToString.ToDecimal
|
||||
Dim Serie As String = Row("Serie").ToString
|
||||
Dim Lote As String = Row("Lote").ToString
|
||||
Dim Caducidad As String = Row("Caducidad").ToString
|
||||
Dim SeccionAlmacen As String = Row("SeccionAlmacen").ToString
|
||||
Try
|
||||
Dim DTSeccionesAlmacen As DataTable = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
||||
If Not ErrorArchivo Then
|
||||
NumRow = 0
|
||||
Dim RowNoEncontrados As String = ""
|
||||
Dim NumAgregados As Integer = 0
|
||||
|
||||
Dim CvePS As Integer = 0
|
||||
Dim CveUM As Integer = 0
|
||||
For Each Row As DataRow In dt.Rows
|
||||
Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal
|
||||
Dim UM As String = Row("UM").ToString
|
||||
Dim Codigo As String = Row("Código").ToString.Trim.ToUpper
|
||||
'Dim CodigoBarras As String = Row("Codigo Barras").ToString.Trim.ToUpper
|
||||
Dim ProductoServicio As String = Row("Producto/Servicio").ToString.Trim.ToUpper
|
||||
Dim PrecioUnitario As Decimal = Row("Precio Unitario").ToString.ToDecimal
|
||||
Dim Serie As String = Row("Serie").ToString
|
||||
Dim Lote As String = Row("Lote").ToString
|
||||
Dim Caducidad As String = Row("Caducidad").ToString
|
||||
Dim SeccionAlmacen As String = Row("SeccionAlmacen").ToString
|
||||
|
||||
NumRow = NumRow + 1
|
||||
Dim CvePS As Integer = 0
|
||||
Dim CveUM As Integer = 0
|
||||
|
||||
Dim CveSeccionAlmacen As Integer = -1
|
||||
If SeccionAlmacen <> "" Then
|
||||
CveSeccionAlmacen = DTSeccionesAlmacen.FiltroPrimeroValor("CveSeccion", String.Format("SeccionAlmacen = '{0}'", SeccionAlmacen)).ToEntero
|
||||
End If
|
||||
NumRow = NumRow + 1
|
||||
|
||||
If Codigo <> "" Then
|
||||
Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
End If
|
||||
Dim CveSeccionAlmacen As Integer = -1
|
||||
If SeccionAlmacen <> "" Then
|
||||
CveSeccionAlmacen = DTSeccionesAlmacen.FiltroPrimeroValor("CveSeccion", String.Format("SeccionAlmacen = '{0}'", SeccionAlmacen)).ToEntero
|
||||
End If
|
||||
'ElseIf CodigoBarras <> "" Then
|
||||
' Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c)
|
||||
' If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
' End If
|
||||
ElseIf ProductoServicio <> "" Then
|
||||
Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c)
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
|
||||
|
||||
|
||||
If Codigo <> "" Then
|
||||
Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
End If
|
||||
End If
|
||||
'ElseIf CodigoBarras <> "" Then
|
||||
' Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c)
|
||||
' If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
' End If
|
||||
ElseIf ProductoServicio <> "" Then
|
||||
Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c)
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
RowNoEncontrados &= "<\BR> - En la fila " & NumRow & " no se especificó código, código de barras ó descripción."
|
||||
End If
|
||||
|
||||
If CvePS > 0 Then
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
||||
|
||||
If DrPS IsNot Nothing AndAlso String.IsNullOrEmpty(UM) Then
|
||||
CveUM = DrPS("CveUnidadMedida").ToString().ToEntero()
|
||||
UM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $"CveUnidadMedida={CveUM}")
|
||||
End If
|
||||
|
||||
AddNew(CvePS, ProductoServicio, CveUM, UM, Cantidad, PrecioUnitario, Serie.Replace(" ", String.Empty), "", "-1", "-1", "",
|
||||
Lote, Caducidad.ToDate, CveSeccionAlmacen, SeccionAlmacen, CargarGV:=False)
|
||||
|
||||
NumAgregados = NumAgregados + 1
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If RowNoEncontrados.Length > 0 Then
|
||||
Alert("Se Cargaron " & NumAgregados & " Productos o Servicios.<\BR>Los siguientes Productos o Servicios no se encontraron en la Base de Datos.<\BR>" & RowNoEncontrados, TipoMensaje.MsgAdvertencia)
|
||||
If NumAgregados > 0 Then
|
||||
RegistraScript("$('#DivCargaExcel').modal('hide')", "hidemodal")
|
||||
TxtExcel.Text = "[]"
|
||||
End If
|
||||
Else
|
||||
RowNoEncontrados &= "<\BR> - En la fila " & NumRow & " no se especificó código, código de barras ó descripción."
|
||||
End If
|
||||
|
||||
If CvePS > 0 Then
|
||||
'CveUM = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"CvePS = '{CvePS}'").ToString.ToEntero
|
||||
|
||||
txtCantidad.Text = Cantidad.ToString
|
||||
DdlProducto2.SelectedValue = CvePS.ToString
|
||||
DdlProducto2.SelectedText = Codigo + " - " + ProductoServicio
|
||||
txtPrecio.Text = PrecioUnitario.ToString
|
||||
|
||||
ElProductoChange()
|
||||
TxtnSerie.Text = Serie
|
||||
TxtnLote.Text = Lote
|
||||
DdlSeccionAlmacen.SelectedValueExist(CveSeccionAlmacen.ToString)
|
||||
TxtnFechaCaducidad.Text = If(Caducidad = "", MinFecha.ToString, Caducidad)
|
||||
AgregarPS()
|
||||
txtPrecio.Text = ""
|
||||
DdlUnidad.SelectedItem.Text = ""
|
||||
TxtnSerie.Text = ""
|
||||
TxtnLote.Text = ""
|
||||
TxtnFechaCaducidad.Text = ""
|
||||
'DdlSeccionAlmacen.SelectedValue = "-1"
|
||||
NumAgregados = NumAgregados + 1
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If RowNoEncontrados.Length > 0 Then
|
||||
Alert("Se Cargaron " & NumAgregados & " Productos o Servicios.<\BR>Los siguientes Productos o Servicios no se encontraron en la Base de Datos.<\BR>" & RowNoEncontrados, TipoMensaje.MsgAdvertencia)
|
||||
If NumAgregados > 0 Then
|
||||
Alert("Se Cargaron " & NumAgregados & " Productos o Servicios correctamente.")
|
||||
RegistraScript("$('#DivCargaExcel').modal('hide')", "hidemodal")
|
||||
TxtExcel.Text = "[]"
|
||||
End If
|
||||
Else
|
||||
Alert("Se Cargaron " & NumAgregados & " Productos o Servicios correctamente.")
|
||||
RegistraScript("$('#DivCargaExcel').modal('hide')", "hidemodal")
|
||||
TxtExcel.Text = "[]"
|
||||
|
||||
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar los datos", ex)
|
||||
End Try
|
||||
|
||||
End If
|
||||
dt.Dispose()
|
||||
End Sub
|
||||
@@ -4969,4 +4980,73 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkGenerarVirtual_Click(sender As Object, e As EventArgs)
|
||||
If CveMovimiento > 0 Then
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
|
||||
Dim CveMovimientoVirtual As Integer = -1
|
||||
Dim FolioVirtual As Integer = -1
|
||||
|
||||
Dim tCveAlmacen As Integer = -1
|
||||
Dim tOrigen As Integer = -1
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
ObjInventario.IniciaTransacSQL()
|
||||
|
||||
Try
|
||||
If ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
tCveAlmacen = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
|
||||
tOrigen = ObjInventario.DtResultados.FiltroPrimeroValor("Origen").ToEntero()
|
||||
End If
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
'VERIFICA SI TIENE ALMACEN VIRTUAL
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
End If
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 2, 3), 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV")
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
Alert("No hay usados para generar el virtual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
Alert("El almacen no tiene vinculado un almacen virtual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ErrorMovInv = True
|
||||
End Try
|
||||
|
||||
If ErrorMovInv Then
|
||||
ObjInventario.RollBack()
|
||||
Else
|
||||
ObjInventario.Commit()
|
||||
End If
|
||||
|
||||
ObjInventario.Dispose()
|
||||
|
||||
If CveMovimientoVirtual > 0 AndAlso Not ErrorMovInv Then
|
||||
Alert($"Se generó el movimiento virtual con el folio:<b>{FolioVirtual}<b/>")
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -3065,7 +3065,13 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim DrAlmO As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If DrAlmO("CveTipoAlmacen").ToString.ToEntero = 26 Then 'costeados
|
||||
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (26) AND Estatus = 'Activo'")
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (26) AND Estatus = 'Activo'")
|
||||
DdlAlmacenDestino.DataBind()
|
||||
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
ElseIf DrAlmO("CveTipoAlmacen").ToString.ToEntero = 22 Then 'Recepcion de Usados
|
||||
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (22) AND Estatus = 'Activo'")
|
||||
DdlAlmacenDestino.DataBind()
|
||||
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user