From 8b80d6c1270d34dea6d1a8a6df8c8a7198b688f3 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Jul 2020 18:50:28 -0700 Subject: [PATCH 01/11] -ajustes de secciones --- Inventarios/Apartados.aspx.vb | 2 +- Inventarios/EntregaAlmacen.aspx | 44 +++++++++++++-------------- Inventarios/EntregaAlmacen.aspx.vb | 2 +- Inventarios/Kardex.aspx.vb | 4 +-- Inventarios/ResguardoMaterial.aspx | 2 +- Inventarios/ResguardoMaterial.aspx.vb | 29 +++++++++++++++--- Ventas/ProductosServicios.aspx | 2 +- Ventas/ProductosServicios.aspx.vb | 13 +++++--- 8 files changed, 61 insertions(+), 37 deletions(-) diff --git a/Inventarios/Apartados.aspx.vb b/Inventarios/Apartados.aspx.vb index 21708ab8a..6853eb7ec 100644 --- a/Inventarios/Apartados.aspx.vb +++ b/Inventarios/Apartados.aspx.vb @@ -836,7 +836,7 @@ Partial Class Inventarios_Apartados GvDatosDesapartado.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> "" GvDatosDesapartado.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> "" GvDatosDesapartado.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha - GvDatosDesapartado.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 + GvDatosDesapartado.Columns(8).Visible = DtTemp.MAX("AplicaSeccion") = "True" GvDatosDesapartado.DataSource = DtTemp GvDatosDesapartado.DataBind() diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index 2c2378d3e..8d4ff3ea1 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -21,20 +21,22 @@ } .gvInventario tr td:nth-child(4) { - width: 18% !important; + width: 12% !important; text-align: center !important; } .gvInventario tr th:nth-child(4) { - width: 18% !important; + width: 12% !important; } .gvEscondeColumna tr td:nth-child(3) { display: none; + width:0px; } .gvEscondeColumna tr th:nth-child(3) { display: none; + width:0px; } .btn.default:hover { @@ -406,6 +408,12 @@
+ +
+
+ +
+
@@ -429,40 +437,32 @@ -
-
-
- -
-
-
- + <%--GV DATOS--%> - + DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,AplicaSerieLote,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None"> + - + - + - - + + - + - - + - - + + - + diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 1fda0e0ee..c4b208c08 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -927,7 +927,7 @@ Partial Class Inventarios_EntregaAlmacen If e.Row.DBCampo("Inv_CveMetodoInventario").Contiene("5", "6") Then e.Row.FCTextBox("TbCantidadF").Enabled = False Else - e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero() + e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").ToDecimal.ToString("#,##0.######") End If End If diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index 67eba9064..6cafe91de 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -168,9 +168,9 @@ Partial Class Inventarios_Kardex TxtSerie.Text = "" If ddlProducto2.SelectedValue.ToEntero > 0 Then - Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, ddlProducto2.SelectedValue.ToEntero).FiltroPrimero("") + Dim Dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=ddlProducto2.SelectedValue.ToEntero).FiltroPrimero("") If Dr IsNot Nothing Then - If Dr("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If Dr("AplicaSerie").ToString = "True" Then DivSerie.Visible = True Else DivSerie.Visible = False diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index 688c514df..939bb9015 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -242,7 +242,7 @@ diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index c706e4f5c..0df638679 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -275,8 +275,8 @@ Partial Class Inventarios_ResguardoMaterial DdlAlmacenDestinoLiberacion.DataBind() DdlAlmacenDestinoLiberacion.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - DdlSeccionAlmacen.DataBind() + 'DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) + 'DdlSeccionAlmacen.DataBind() CargaPS() End Sub @@ -335,9 +335,11 @@ Partial Class Inventarios_ResguardoMaterial End Sub Private Sub VerificaProducto() If DdlProducto2.SelectedValue.ToEntero > 0 Then - Dim drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("") + Dim drp As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("") If drp IsNot Nothing Then + + 'activa Serie If CBool(drp("AplicaSerie")) Then ThSerie.Visible = True @@ -349,6 +351,16 @@ Partial Class Inventarios_ResguardoMaterial If CBool(drp("AplicaSeccion")) Then ThSeccion.Visible = True TrSeccion.Visible = True + If DdlAlmacen.SelectedValue.ToEntero > 0 Then + DdlSeccionAlmacen.Items.Clear() + Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero) + DdlSeccionAlmacen.DataSource = dtt + DdlSeccionAlmacen.DataBind() + If dtt.Rows.Count > 1 Then + DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + dtt.Dispose() + End If End If 'activa lote If CBool(drp("AplicaLote")) Then @@ -445,7 +457,7 @@ Partial Class Inventarios_ResguardoMaterial registro.Item("Estatus") = "" registro.Item("SeccionAlmacen") = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedItem.Text, "") registro.Item("Serie") = TxtnSerie.Text - registro.Item("Lote") = If(TxtLote.Text = "", "-1", TxtLote.Text) + registro.Item("Lote") = If(TxtLote.Text = "", "", TxtLote.Text) registro.Item("FechaCaducidad") = If(TxtCaducidad.Text = "", MinFecha.ToString, TxtCaducidad.Text) registro.Item("CveSeccionAlmacen") = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedValue.ToEntero, -1) registro.Item("Observaciones") = TxtObservacionesdetalle.Text @@ -823,10 +835,17 @@ Partial Class Inventarios_ResguardoMaterial MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar." TieneError = True Else + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + Dim CveSeccionAlmacen As Integer = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If CBool(Dr("AplicaSeccion")) Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + Else + CveSeccionAlmacen = -1 + End If 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, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, + Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index 36274682c..075222523 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -2072,7 +2072,7 @@ + + +
+
+
+ + + +
+
+ +
+ +
@@ -153,6 +153,7 @@
- +
Almacén Destino: - +
+ + + + + +
Estado :
Usuario :
Fecha :
+ +
+ +
+ +
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + @@ -238,7 +300,7 @@
- + diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb index 515063e12..6c3b28afe 100644 --- a/Inventarios/TrasladoSolicitud.aspx.vb +++ b/Inventarios/TrasladoSolicitud.aspx.vb @@ -35,9 +35,24 @@ Partial Class Inventarios_TrasladoSolicitud Set(value As Integer) ViewState("CveDireccionEnvio") = value End Set - End Property + End Property + + 'Private Property CveUsuarioAutoriza As Integer + ' Get + ' If ViewState("CveUsuarioAutoriza") Is Nothing Then + ' Return -1 + ' Else + ' Return CType(ViewState("CveUsuarioAutoriza"), Integer) + ' End If + + ' End Get + ' Set(value As Integer) + ' ViewState("CveUsuarioAutoriza") = value + ' End Set + 'End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then @@ -132,7 +147,8 @@ Partial Class Inventarios_TrasladoSolicitud #Region " CARGA DATOS " Private Sub CargaDatos() Dim ObjInventarios As New ClsInventarios - Dim ObjClientes As New ClsClientes + Dim ObjClientes As New ClsClientes + If ObjInventarios.AddTrasladoSolicitudGet(CveTraspasoSolicitud, UsuarioActual.CveEmpresa) Then If ObjInventarios.DtResultados.Rows.Count > 0 Then @@ -213,6 +229,55 @@ Partial Class Inventarios_TrasladoSolicitud LbAgregarPS.Visible = False HLDesdeContrato.Visible = False + + Dim EstatusAlmacen As Integer = ObjInventarios.DtResultados.Rows(0)("EstatusAlmacen").ToString().ToEntero + Dim CveUsuarioAutoriza As Integer = ObjInventarios.DtResultados.Rows(0)("CveUsuarioAutorizaDestino").ToString().ToEntero + + If EstatusAlmacen > 0 Then + + + If UsuarioActual.CveUsuario = CveUsuarioAutoriza Then + + If EstatusAlmacen = 1 Then + + + DivAutoriza.Visible = True + DVAutorizarBotones.Visible = True + DVAutorizaInformacion.Visible = False + + ElseIf EstatusAlmacen.Contiene(2, 3) Then + DivAutoriza.Visible = True + + DVAutorizarBotones.Visible = False + DVAutorizaInformacion.Visible = True + + LblEstatusAutorizo.Text = If(EstatusAlmacen = 2, "Aceptado", "Rechazado") + LblUsaurioAutorizo.Text = ObjInventarios.DtResultados.Rows(0)("NombreAutoriza").ToString() + LblFechaAutoriza.Text = ObjInventarios.DtResultados.Rows(0)("FechaAutorizacion").ToString().ToDate().ToString("dd/MM/yyyy") + Else + + End If + + ElseIf EstatusAlmacen.Contiene(2, 3) Then + + DivAutoriza.Visible = True + + DVAutorizarBotones.Visible = False + DVAutorizaInformacion.Visible = True + + LblEstatusAutorizo.Text = If(EstatusAlmacen = 2, "Aceptado", "Rechazado") + LblUsaurioAutorizo.Text = ObjInventarios.DtResultados.Rows(0)("NombreAutoriza").ToString() + LblFechaAutoriza.Text = ObjInventarios.DtResultados.Rows(0)("FechaAutorizacion").ToString().ToDate().ToString("dd/MM/yyyy") + + End If + + + Else + DivAutoriza.Visible = False + End If + + + Else Alert("Ocurrió un error al obtener los datos del traspaso.", TipoMensaje.MsgError) End If @@ -469,15 +534,37 @@ Partial Class Inventarios_TrasladoSolicitud If Not GvDatos.Rows.Count > 0 Then Alert("No se ha seleccionado ningún Producto para trasladar.", TipoMensaje.MsgAdvertencia) Exit Sub - End If - - 'VERIFICA EXISTENCIAS + End If + + + Dim CveUsuarioAutoriza As Integer = -1 + Dim EstatusAlmacen As Integer = 2 + 'VERIFICA EXISTENCIAS Dim ObjInventarios As New ClsInventarios Dim Existencia = 0.0 Dim TieneErrorExistencia = False Dim MensajeExistencia As New StringBuilder MensajeExistencia.Append("No hay la existencia suficiente de los siguientes productos:
") - Dim CodigoPS As String = "" + Dim CodigoPS As String = "" + + + If ObjInventarios.GetAlmacenes(-1, -1, UsuarioActual.CveEmpresa, -1) Then + + If ObjInventarios.DtResultados.Rows.Count > 0 Then + + CveUsuarioAutoriza = If(ObjInventarios.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenDestino.SelectedValue}")(0)("CveUsuarioAutoriza").ToString.ToEntero > 0, ObjInventarios.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenDestino.SelectedValue}")(0)("CveUsuarioAutoriza").ToString.ToEntero, -1) + If CveUsuarioAutoriza > 0 Then + EstatusAlmacen = 1 + End If + + Else + CveUsuarioAutoriza = -1 + End If + End If + + + + For Each row As GridViewRow In GvDatos.Rows CodigoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row.DataKey("CvePS").ToEntero).FiltroPrimeroValor("PSCodigo", "") Existencia = ObjInventarios.GetExistenciasPS(row.DataKey("CvePS").ToEntero, row.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59")) @@ -509,7 +596,7 @@ Partial Class Inventarios_TrasladoSolicitud Estatus = 3 End If - Dim Folio = ObjInventarios.AddTrasladoSolicitud(TxtObservaciones.Text.Trim, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, Estatus, -1, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato, Guia:=Guia, CvePaqueteria:=DdlPaqueteria.SelectedValue.ToEntero, CveDireccionEnvio:=CveDireccionEnvio) + Dim Folio = ObjInventarios.AddTrasladoSolicitud(TxtObservaciones.Text.Trim, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, Estatus, -1, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato, Guia:=Guia, CvePaqueteria:=DdlPaqueteria.SelectedValue.ToEntero, CveDireccionEnvio:=CveDireccionEnvio, EstatusAlmacen:=EstatusAlmacen) If Folio > 0 Then CveTraspasoSolicitud = ObjInventarios.CveTraspasoSolicitud @@ -536,7 +623,12 @@ Partial Class Inventarios_TrasladoSolicitud If TieneError = False Then ObjInventarios.Commit() - Alert($"El Traspaso se guardó correctamente con el folio #: {Folio}.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""") + Alert($"El Traspaso se guardó correctamente con el folio #: {Folio}.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""") + + If CveUsuarioAutoriza > 0 Then + MandaCorreoAutorizacion(Folio, CveTraspasoSolicitud, CveUsuarioAutoriza) + End If + Else ObjInventarios.RollBack() Alert("Ocurrió un Error al guardar el traspaso.", TipoMensaje.MsgError) @@ -852,12 +944,12 @@ Partial Class Inventarios_TrasladoSolicitud Response.TransmitFile(Archivo.FullName) Response.End() End If - End Sub - - + End Sub + + #End Region - - + + Protected Sub DdlProductoServicio_selectedindexchange(sender As Object, e As EventArgs) If DdlProductoServicio.SelectedValue.ToEntero > 0 Then Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProductoServicio.SelectedValue.ToEntero).FiltroPrimero("") @@ -874,6 +966,78 @@ Partial Class Inventarios_TrasladoSolicitud End If UpPS.Update() UpDatos.Update() - End Sub + End Sub + + + Protected Sub LnkAceptarTraslado_Click(sender As Object, e As EventArgs) + + Dim ObjInven As New ClsInventarios + If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 2, UsuarioActual.CveUsuario, Now) Then + Alert("Autorizado correctamente.") + End If + ObjInven.Dispose() + + CargaDatos() + + End Sub + Protected Sub LnkRechazarTraslado_Click(sender As Object, e As EventArgs) + + Dim ObjInven As New ClsInventarios + If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 3, UsuarioActual.CveUsuario, Now) Then + Alert("Rechazado correctamente.") + End If + ObjInven.Dispose() + + CargaDatos() + + End Sub + + + Private Sub MandaCorreoAutorizacion(Folio As Integer, CveTraspasoSolicitud As Integer, CveUsuarioAutoriza As Integer) + + Dim SB As New StringBuilder + + Dim CorreoDestino As String = GlobalDTUsuarios(CveUsuarioAutoriza)(0)("Correo").ToString.Trim + + + If CorreoDestino.Length > 0 Then + + + + SB.AppendLine($"

Se ha registrado una solicitud de traspaso de {DdlAlmacenOrigen.SelectedItem.Text} a {DdlAlmacenDestino.SelectedItem.Text}, con los siguientes productos.

") + + + + SB.AppendLine("
") + SB.AppendLine("") + SB.AppendLine("") + + For Each GvRow As GridViewRow In GvDatos.Rows + + If GvRow.RowType = DataControlRowType.DataRow Then + SB.AppendLine($"") + End If + + Next + SB.AppendLine("
Cantidad U.M. Producto Observaciones
{GvRow.DataKey("Cantidad")} {GvRow.DataKey("UnidadMedida")} {GvRow.DataKey("CodigoPS")} {GvRow.DataKey("Observaciones")}
") + SB.AppendLine("
") + SB.AppendLine($" Ir a solicitud de traspaso para autorización") + + + + Dim MandaCorre As New ClsSisMail + MandaCorre.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, $"Solicitud de Autorización de traspaso #{Folio}", SB.ToString, Displayname:="SIG Notificaciones: Solicitud de Traspaso") + + + End If + + + + + + + + End Sub + End Class From c507a42c8164f6cd3e64539ba33bb01f63af147a Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jul 2020 15:17:30 -0700 Subject: [PATCH 06/11] se incluyen los almacenes de consumo interno --- Inventarios/AjustesSeccionAlmacen.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 726db4464..c1706b6eb 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -13,7 +13,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen End Sub Private Sub CargaCombos() - Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,14)") DdlAlmacen.DataSource = DtAlmacenes DdlAlmacen.DataBind() From 5e6bd72c4696589e8afa59a61fb7ee8dcefa2f61 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jul 2020 15:17:56 -0700 Subject: [PATCH 07/11] espacios --- Inventarios/ResguardoMaterial.aspx.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 0df638679..ae6976ed6 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -121,7 +121,6 @@ Partial Class Inventarios_ResguardoMaterial EsSurtidoUniforme = If(Request.QueryString("EsSurtidoUniforme").ToString = "1", True, False) End If - InicializaValores() If Not Request.QueryString("CvePersonal") Is Nothing Then From 716a35b16af66b351d6854ae4080c66fa4667122 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jul 2020 15:18:25 -0700 Subject: [PATCH 08/11] seccion el codigo barras al ser consumo interno --- Inventarios/EntradasSalidas.aspx | 8 +++++ Inventarios/EntradasSalidas.aspx.vb | 52 +++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 7d192b3dd..976d4a772 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -546,6 +546,14 @@
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index b933ebc07..832652772 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1190,7 +1190,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, SerieLote 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) 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 @@ -1201,7 +1201,7 @@ Partial Class Inventarios_EntradasSalidas Dim FechaCaducidadVal As Date = If(RowPS("AplicaCaducidad").ToString = "True", FechaCaducidad, MinFecha) - If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then + If CveMetodoInventario = 5 And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then Valido = False Alert("El producto requiere Serie", TipoMensaje.MsgAdvertencia) End If @@ -1209,9 +1209,9 @@ Partial Class Inventarios_EntradasSalidas 'salida If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen - Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), FechaCaducidadVal) + Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal) ' LbAgregar.ToolTip = Existencia.ToString - If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND Serie = '{SerieLote}'", "")}") < 0 Then + If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") < 0 Then If Existencia <= 0 Then Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") @@ -1230,12 +1230,12 @@ Partial Class Inventarios_EntradasSalidas If Valido Then Dim CveClasificacion As Integer - Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS") - If dr IsNot Nothing Then CveClasificacion = dr("CveClasificacion").ToString.ToEntero + 'Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS") + If RowPS IsNot Nothing Then CveClasificacion = RowPS("CveClasificacion").ToString.ToEntero 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS - If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then - Alert($"La serie indicada {SerieLote} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + If Serie <> "" And (Serie.ToUpper = RowPS("Codigo").ToString.ToUpper Or Serie.ToUpper = RowPS("CodigoBarras").ToString.ToUpper) Then + Alert($"La serie indicada {Serie} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -1258,7 +1258,7 @@ Partial Class Inventarios_EntradasSalidas registro.Item("CodigoAF") = CodigoAF registro.Item("Codigo") = Codigo registro.Item("CveAF") = CveAF - registro.Item("Serie") = If(SerieLote <> "", SerieLote, "") + registro.Item("Serie") = If(Serie <> "", Serie, "") registro.Item("Lote") = If(Lote <> "", Lote, "") registro.Item("FechaCaducidad") = FechaCaducidad registro.Item("Observaciones") = Observaciones @@ -2938,6 +2938,7 @@ Partial Class Inventarios_EntradasSalidas End If TdSeriePS.Visible = False + TdSeccionPSAdd.Visible = False Dim Dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras= '{TxtCodigoPS.Text}'") If Dr Is Nothing Then @@ -2947,7 +2948,7 @@ Partial Class Inventarios_EntradasSalidas Exit Sub End If - If Dr("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If Dr("AplicaSerie").ToString = "True" Then TdSeriePSAdd.Visible = True TxtSeriePS.Focus() CvePSSerieLote = Dr("CvePS").ToString.ToEntero @@ -2956,8 +2957,32 @@ Partial Class Inventarios_EntradasSalidas UMSerieLote = Dr("UnidadMedida").ToString Exit Sub End If + Dim CveSeccionAlmacen As Integer = -1 + Dim SeccionAlmacen As String = "" - AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", MinFecha, -1, "") + If Dr("AplicaSeccion").ToString = "True" Then + If DdlAlmacen.SelectedValue.ToEntero <= 1 Then + Alert("No se ha especificado el almacen para especificar la sección", TipoMensaje.MsgError) + Exit Sub + End If + DdlSeccionPSAdd.Items.Clear() + Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero) + DdlSeccionPSAdd.DataSource = dtt + DdlSeccionPSAdd.DataBind() + If dtt.Rows.Count > 1 Then + DdlSeccionPSAdd.Items.Insert(0, New ListItem("Seleccione", "-1")) + ' si solo hay un movimiento, debe de agregar, sino debe de esperar a que seleccionen + Exit Sub + DdlSeccionPSAdd.Focus() + TdSeccionPSAdd.Visible = True + Else + CveSeccionAlmacen = DdlSeccionPSAdd.SelectedValue.ToEntero + SeccionAlmacen = DdlSeccionPSAdd.SelectedItem.Text + End If + + End If + + AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", MinFecha, CveSeccionAlmacen, SeccionAlmacen) TxtCodigoPS.Text = "" TxtCodigoPS.Focus() @@ -2968,6 +2993,11 @@ Partial Class Inventarios_EntradasSalidas If TxtSeriePS.Text.Trim = "" Then Exit Sub End If + If TdSeccionPSAdd.Visible Then + If DdlSeccionAlmacen.SelectedValue.ToEntero <= 0 Then + Exit Sub + End If + End If AddNew(CvePSSerieLote, PSSerieLote, CveUMSerieLote, UMSerieLote, 1, 0, TxtSeriePS.Text.Trim, "", "", "", "", "", MinFecha, -1, "") From 528f5d03c0d09e1a790e4d54c48cf9e2137f5558 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jul 2020 15:19:09 -0700 Subject: [PATCH 09/11] - modulo en movimeinto --- Inventarios/RecepcionAlmacen.aspx.vb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index b6642b36d..ea1db1741 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2382,6 +2382,8 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveClienteActual = -1 Dim CveAlmacenDestino = CveAlmacenApartado + Dim CveSeccionDestino As Integer = -1 + For Each Dr As DataRow In ObjInventario.DtResultados.Rows If CveVendedorActual = -1 Or (Dr("CveVendedor").ToString.ToEntero <> CveVendedorActual Or Dr("CveCliente").ToString.ToEntero <> CveClienteActual) Then @@ -2391,7 +2393,7 @@ Partial Class Inventarios_RecepcionAlmacen MovtosSalida.Add(CveMovtoSalidaActual) FoliosSalida.Add(ObjInventario.Folio) - CveMovtoEntradaActual = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), CveAlmacenDestino:=CveAlmacenDestino, CveMovimientoRelacionado:=CveMovtoSalidaActual, CveVendedor:=Dr("CveVendedor").ToString.ToEntero, CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text) + CveMovtoEntradaActual = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), CveAlmacenDestino:=CveAlmacenDestino, CveMovimientoRelacionado:=CveMovtoSalidaActual, CveVendedor:=Dr("CveVendedor").ToString.ToEntero, CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text, Modulo:="RA/G7") MovtosEntrada.Add(CveMovtoEntradaActual) FoliosEntrada.Add(ObjInventario.Folio) @@ -2408,8 +2410,14 @@ Partial Class Inventarios_RecepcionAlmacen ErrorMovInv = True Exit For End If + If CBool(Dr("AplicaSeccion")) Then + CveSeccionDestino = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDestino, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + Else + CveSeccionDestino = -1 + End If - If Not ObjInventario.AddMovimientoDetalle(CveMovtoEntradaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, 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, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionDestino, Serie:=Dr("Serie").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 From f14aa26df189dcba51845ee413426c07b365e364 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jul 2020 15:19:36 -0700 Subject: [PATCH 10/11] -global almacen usuarios --- Sistemas/UsuarioDetalle.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 855f31886..44533c341 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -1326,8 +1326,8 @@ Partial Class Sistemas_UsuarioDetalle 'RECARGA GLOBAL ALMACEN - If ObjUsuarios.GetAlmacen(-1, UsuarioActual.CveEmpresa) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing - + 'If ObjUsuarios.GetAlmacen(-1, UsuarioActual.CveEmpresa) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing + GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing 'RECARGA GLOBAL EMPRESAS USUARIOS If ObjUsuarios.GetUsuariosEmpresas(-1) Then From 98e5d27aeada76553e45808b7d0108ad14befa8b Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jul 2020 15:56:45 -0700 Subject: [PATCH 11/11] -- seccion en importacion de AF --- AF/AF.aspx | 10 + AF/AF.aspx.vb | 566 ++++++++++++++++++++++++++------------------------ 2 files changed, 302 insertions(+), 274 deletions(-) diff --git a/AF/AF.aspx b/AF/AF.aspx index c4357400e..82e22650c 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -2903,6 +2903,16 @@ +
+
Sección:
+
+ + + + + +
+