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:
+
+ + + + + +
+
- + diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index b933ebc07..1f6a9efdf 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -461,8 +461,8 @@ Partial Class Inventarios_EntradasSalidas End If DdlClasificacion.DataBind() - DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - DdlSeccionAlmacen.DataBind() + 'DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) + 'DdlSeccionAlmacen.DataBind() DdlSeccionAlmacenEntrada.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) DdlSeccionAlmacenEntrada.DataBind() @@ -827,7 +827,7 @@ Partial Class Inventarios_EntradasSalidas 'cargar también los movimentos detalle If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DtMovimientos = Mov.DtResultados.FiltraParametros("", "CveMovimientoDetalle") + DtMovimientos = Mov.DtResultados DtMovimientos.Columns("No").AutoIncrement = True DtMovimientos.Columns("No").AutoIncrementSeed = DtMovimientos.Rows.Count + 1 @@ -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 @@ -2187,12 +2187,18 @@ Partial Class Inventarios_EntradasSalidas End If If CBool(dr("AplicaSeccion")) Then divSeccionAlmacen.Visible = True + 'DdlSeccionAlmacen.Items.Clear() + 'DdlSeccionAlmacen.ClearSelection() + 'DdlSeccionAlmacen.DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero) + 'DdlSeccionAlmacen.DataBind() + CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAlmacen.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) End If If CBool(dr("AplicaCaducidad")) Then divCaducidad.Visible = True End If + End If End If @@ -2397,7 +2403,11 @@ Partial Class Inventarios_EntradasSalidas TxtnLote.Text = GvRow.DataKey("Lote") TxtnFechaCaducidad.Text = GvRow.DataKey("FechaCaducidad").ToDate.ToShortDateString TxtObservacionesdetalle.Text = GvRow.DataKey("Observaciones") + + DdlSeccionAlmacen.DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, GvRow.DataKey("CvePS").ToEntero) + DdlSeccionAlmacen.DataBind() DdlSeccionAlmacen.SelectedValueExist(GvRow.DataKey("CveSeccionAlmacen")) + LkAgregarDetalle.Text = "Actualizar" Dim Origen As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue)).ToEntero divPrecio.Visible = Origen = 1 @@ -2426,6 +2436,7 @@ Partial Class Inventarios_EntradasSalidas TxtnFechaCaducidad.Text = GvRow.DataKey("FechaCaducidad") TxtObservacionesdetalle.Text = GvRow.DataKey("Observaciones") DdlSeccionAlmacen.SelectedValueExist(GvRow.DataKey("CveSeccionAlmacen")) + Dim Origen As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue)).ToEntero divPrecio.Visible = Origen = 1 txtPrecio.Visible = Origen = 1 @@ -2938,6 +2949,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 +2959,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 +2968,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 +3004,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, "") @@ -4333,6 +4374,7 @@ Partial Class Inventarios_EntradasSalidas CveUsuarioModifico:=UsuarioActual.CveUsuario) Then Alert("Error al Actualizar los movimientos") Else + Alert("Movimiento actualizado correctamente") RegistraScript("$('#ModalAgregar').modal('hide')") End If ObjInventario.Dispose() @@ -4355,7 +4397,7 @@ Partial Class Inventarios_EntradasSalidas TxtnLote.Text = "" TxtnFechaCaducidad.Text = "" TxtObservacionesdetalle.Text = "" - DdlSeccionAlmacen.SelectedValue = "-1" + DdlSeccionAlmacen.ClearSelection() LkAgregarDetalle.Text = "Agregar" If DdlMonedaTC.SelectedValue.ToEntero = 2 Then VisualizaPUExtranjero(UsuarioActual.TienePermisoProceso(201)) 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 85cdf7b62..2adc2532c 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -7,7 +7,8 @@ Imports System.IO Imports Extensiones Imports Microsoft.Reporting.WebForms - +Imports Stimulsoft.Base.Indicator + Partial Class Inventarios_EntregaAlmacen Inherits ClsPaginas @@ -886,13 +887,14 @@ Partial Class Inventarios_EntregaAlmacen If CBool(e.Row.DBCampo("AplicaSeccion")) Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True If DdlAlmacen.SelectedValue.ToEntero > 0 Then - Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt - e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - If dtt.Rows.Count > 1 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - dtt.Dispose() + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa, True) + 'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() + 'If dtt.Rows.Count > 1 Then + ' e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + 'End If + 'dtt.Dispose() End If Else @@ -927,7 +929,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 @@ -1720,10 +1722,10 @@ Partial Class Inventarios_EntregaAlmacen If CBool(Dr("AplicaSerie")) Then DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) For Each Dr1 As DataRow In DtDetalle.Rows - StrXML.AppendFormat("", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd")) + StrXML.AppendFormat("", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd")) Next Else - StrXML.AppendFormat("", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd")) + StrXML.AppendFormat("", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd")) End If End If Next @@ -1959,9 +1961,16 @@ Partial Class Inventarios_EntregaAlmacen Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado Dr1("FolioEntrada") = FolioEntrada - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + Dim CveSeccionAlmacen As Integer = -1 + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If CBool(Dr("AplicaSeccion")) Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExA, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + Else + CveSeccionAlmacen = -1 + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") Exit For @@ -2002,6 +2011,7 @@ Partial Class Inventarios_EntregaAlmacen DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) For Each Dr1 As DataRow In DtDetalle.Rows If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr1("Serie").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then + Dim CveSeccionAlmacen As Integer = 0 For Each Dr2 As DataRow In ObjInventario.DtResultados.FiltraParametros("CveAlmacen > 0 AND ExistenciaFinal > 0").Rows 'BUSCA SI EXISTE YA UN TRASPASO DEL ALMACEN DE APARTADO @@ -2031,8 +2041,14 @@ Partial Class Inventarios_EntregaAlmacen CantidadPendiente = 1 + If CBool(Dr("AplicaSeccion")) Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr2("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr2("CveAlmacen"), Dr("CvePS"), CveSeccionAlmacen) + Else + CveSeccionAlmacen = -1 + End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un Error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") Exit For @@ -2462,7 +2478,7 @@ Partial Class Inventarios_EntregaAlmacen Dim CveMovimientoSalidaApartado = -1 Dim CveAlmacenApartado = -1 Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero) - + Dim CveSeccionAlmacen As Integer = 0 For Each Dr As DataRow In DtTempApartados.Rows If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString.ToEntero Then @@ -2484,9 +2500,14 @@ Partial Class Inventarios_EntregaAlmacen ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") Exit For + End If + If CBool(Dr("AplicaSeccion")) Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen) + Else + CveSeccionAlmacen = -1 End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") Exit For @@ -2513,8 +2534,15 @@ Partial Class Inventarios_EntregaAlmacen Dr1("FolioEntrada") = FolioEntrada If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If CBool(Dr("AplicaSeccion")) Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS"), CveSeccionAlmacen) + Else + CveSeccionAlmacen = -1 + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") Exit For @@ -3205,71 +3233,75 @@ Partial Class Inventarios_EntregaAlmacen tCvecliente = dr("CveCliente").ToString.ToEntero Dim drC As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=tCvecliente).FiltroPrimero("") - Destinatario += String.Format(";{0};{1}", drC("CorreoEntregaCompras"), drC("CorreoEntregaAlmacen")) + If drC IsNot Nothing Then - Dim ClienteNombre As String = dr("ClienteNombre").ToString() - Dim FolioVenta As String = dr("SerieFolio").ToString() - Dim Pedido As String = dr("PedidoContrato").ToString() - Dim OrdenCompra As String = dr("OrdenCompra").ToString() - Dim CveVenta As Integer = dr("CveVenta").ToString().ToEntero() - Dim TipoDocto As String = dr("TipoDocto").ToString() + Destinatario += String.Format(";{0};{1}", drC("CorreoEntregaCompras"), drC("CorreoEntregaAlmacen")) - Dim dtDetalle As New DataTable - If ObjVentas.GetVentaDetalle(CveVenta) Then - dtDetalle = ObjVentas.DtResultados + Dim ClienteNombre As String = dr("ClienteNombre").ToString() + Dim FolioVenta As String = dr("SerieFolio").ToString() + Dim Pedido As String = dr("PedidoContrato").ToString() + Dim OrdenCompra As String = dr("OrdenCompra").ToString() + Dim CveVenta As Integer = dr("CveVenta").ToString().ToEntero() + Dim TipoDocto As String = dr("TipoDocto").ToString() + + Dim dtDetalle As New DataTable + If ObjVentas.GetVentaDetalle(CveVenta) Then + dtDetalle = ObjVentas.DtResultados + End If + Dim DetalleTable As String = "" + For Each dRow As DataRow In dtDetalle.Rows + Dim detalle As String = String.Format("", dRow("Codigo"), dRow("Cantidad"), dRow("PS")) + DetalleTable += detalle + Next + + strBody.Append("") + strBody.Append("") + strBody.Append("") + strBody.Append("") + strBody.Append(" ") + strBody.Append("
") + strBody.Append($"") + strBody.Append("
") + strBody.Append("

") + strBody.Append($" Apreciable {ClienteNombre}, le confirmamos los") + strBody.Append(" productos surtidos y entregados en mostrador conforme a la") + strBody.Append($" {TipoDocto}:") + strBody.Append("

") + strBody.Append($"

{FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}

") + strBody.Append("
") + strBody.Append("
{0}{1}{2}
") + strBody.Append(DetalleTable) + strBody.Append(" ") + strBody.Append("
") + strBody.Append("
") + strBody.Append("

") + strBody.Append(" Se entregaron los productos conforme a las especificaciones de su pedido y verificamos que no se presentara alguno de los siguientes inconvenientes:") + strBody.Append("

") + strBody.Append("

") + strBody.Append(" • Empaque violado.
") + strBody.Append("• Daño físico en la caja.
") + strBody.Append("• Producto incompleto o distinto al solicitado.
") + strBody.Append("• Alguna otra situación que se considere que compromete la integridad de la mercancía.
") + strBody.Append("") + strBody.Append("

") + strBody.Append("
") + strBody.Append("

") + strBody.Append($" Aceptando a entera satisfacción a las {Today.Hour}:{Today.Minute} hrs del {Today.ToString}") + strBody.Append("

") + strBody.Append("
") + strBody.Append("

") + strBody.Append(" Gracias por su compra
") + 'strBody.Append(" Compuproveedores") + strBody.Append("

") + strBody.Append("

") + strBody.Append(" Sigue disfrutando de nuestros productos y servicios
") + 'strBody.Append(" www.compuproveedores.com") + strBody.Append("") + strBody.Append("

") + strBody.Append(" ") + strBody.Append("") End If - Dim DetalleTable As String = "" - For Each dRow As DataRow In dtDetalle.Rows - Dim detalle As String = String.Format("{0}{1}{2}", dRow("Codigo"), dRow("Cantidad"), dRow("PS")) - DetalleTable += detalle - Next - strBody.Append("") - strBody.Append("") - strBody.Append("") - strBody.Append("") - strBody.Append(" ") - strBody.Append("
") - strBody.Append($"") - strBody.Append("
") - strBody.Append("

") - strBody.Append($" Apreciable {ClienteNombre}, le confirmamos los") - strBody.Append(" productos surtidos y entregados en mostrador conforme a la") - strBody.Append($" {TipoDocto}:") - strBody.Append("

") - strBody.Append($"

{FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}

") - strBody.Append("
") - strBody.Append(" ") - strBody.Append(DetalleTable) - strBody.Append(" ") - strBody.Append("
") - strBody.Append("
") - strBody.Append("

") - strBody.Append(" Se entregaron los productos conforme a las especificaciones de su pedido y verificamos que no se presentara alguno de los siguientes inconvenientes:") - strBody.Append("

") - strBody.Append("

") - strBody.Append(" • Empaque violado.
") - strBody.Append("• Daño físico en la caja.
") - strBody.Append("• Producto incompleto o distinto al solicitado.
") - strBody.Append("• Alguna otra situación que se considere que compromete la integridad de la mercancía.
") - strBody.Append("") - strBody.Append("

") - strBody.Append("
") - strBody.Append("

") - strBody.Append($" Aceptando a entera satisfacción a las {Today.Hour}:{Today.Minute} hrs del {Today.ToString}") - strBody.Append("

") - strBody.Append("
") - strBody.Append("

") - strBody.Append(" Gracias por su compra
") - 'strBody.Append(" Compuproveedores") - strBody.Append("

") - strBody.Append("

") - strBody.Append(" Sigue disfrutando de nuestros productos y servicios
") - 'strBody.Append(" www.compuproveedores.com") - strBody.Append("") - strBody.Append("

") - strBody.Append(" ") - strBody.Append("") End If ObjVentas.Dispose() diff --git a/Inventarios/EntregasPorRealizar.aspx.cs b/Inventarios/EntregasPorRealizar.aspx.cs index d3a5ba81e..38a82c6c9 100644 --- a/Inventarios/EntregasPorRealizar.aspx.cs +++ b/Inventarios/EntregasPorRealizar.aspx.cs @@ -104,7 +104,7 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas private void CargarPersonal() { - DataTable UsuariosConRolLogistico = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveRol IN (1339,1386,1430)"); + DataTable UsuariosConRolLogistico = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveRol IN (1339,1386,1430,1155)"); DdlUsuario.DataSource = UsuariosConRolLogistico; DdlUsuario.DataBind(); DdlUsuario.Items.Insert(0, new ListItem("Seleccione", "-1")); diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index 67eba9064..448dcc4e4 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -63,6 +63,7 @@ Partial Class Inventarios_Kardex #Region " INICIALIZA VALORES " Private Sub CargaPermisos() + If UsuarioActual.CveRol = 1 Then ChkAgruparAlmacen.Visible = True Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) GvM.Columns(13).Visible = TienePermisoImportes ' costo GvM.Columns(14).Visible = TienePermisoImportes ' importe @@ -168,9 +169,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/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index b6642b36d..4f33f8d95 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -1267,19 +1267,23 @@ Partial Class Inventarios_RecepcionAlmacen If CBool(e.Row.DBCampo("AplicaSeccion")) Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True If DdlAlmacen.SelectedValue.ToEntero > 0 Then - Dim dtsec As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtsec - e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - If dtsec.Rows.Count = 1 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").SelectedIndex = 0 - e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False - End If - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa, True) + 'Dim dtsec As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtsec + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() + 'If dtsec.Rows.Count = 1 Then + ' e.Row.FCDropDownList("DdlSeccionAlmacen").SelectedIndex = 0 + ' e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False + 'Else 'si es mayor a uno que por default seleccione el primero, que seria el predeterminado + ' e.Row.FCDropDownList("DdlSeccionAlmacen").SelectedValueExist(dtsec.FiltroPrimeroValor("CveSeccionAlmacen", "Predeterminado = 1")) + 'End If - dtsec.Dispose() - End If - e.Row.FCTextBox("TxtDividir").Visible = True + 'e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + + 'dtsec.Dispose() + End If + e.Row.FCTextBox("TxtDividir").Visible = True Else e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False @@ -2382,6 +2386,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 +2397,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 +2414,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 @@ -3110,7 +3122,7 @@ Partial Class Inventarios_RecepcionAlmacen End If Dim CvePrePoliza As Integer = 0 Dim UsaComplementariaCostoIndirecto As Boolean = False - Dim ConceptoPrePoliza As String = LbProveedor.Text + Dim ConceptoPrePoliza As String = String.Format("{0}-{1}", LbProveedor.Text, HLFolio.Text) If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaCostoIndirecto = False Dim PorcentajeCompraImportacion As Decimal = 0 ' si hay mas de una factura de importación saber lo que se está recibiendo @@ -3156,13 +3168,12 @@ Partial Class Inventarios_RecepcionAlmacen drc("SubTotal") = drt("SubTotal") drc("TipoCambio") = drt("TipoCambio") drc("CveProveedor") = drt("CveProveedor") + drc("SubTotalTC") = drt("SubTotalTC") DtTempCompras.Rows.Add(drc) Next End If - - Else ErrorMovInv = True End If @@ -3174,6 +3185,9 @@ Partial Class Inventarios_RecepcionAlmacen ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Dim TotalCosto As Decimal = ObjInventario.DtResultados.SUMD("Total").RoundSQL() Dim IdCtaContableCostoInd As Integer = 0 + 'si reciben parcialidades de producto. en base al total de la importacion y lo recibido. + Dim PorcentajeRecepcionCompras As Decimal = TotalCosto / DtTempCompras.SUMD("SubTotalTC") + Dim ConceptoPartida As String = String.Format("{0}- Inv#{1}", HLFolio.Text, InvFolio) If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen) Then 'se recorren las facturas a descontar el recepción @@ -3182,7 +3196,7 @@ Partial Class Inventarios_RecepcionAlmacen For Each dr As DataRow In DtTempCompras.Rows Dim CveComp As Integer = dr("CveCompra").ToString.ToEntero 'el porcentaje solo aplica a las facturas de costo indirecto - Dim SubTotalPartida As Decimal = dr("SubTotal").ToString.ToDecimal * If(dr("TipoCompra").ToString = "CI", PorcentajeCompraImportacion, 1) + Dim SubTotalPartida As Decimal = dr("SubTotal").ToString.ToDecimal * If(dr("TipoCompra").ToString = "CI", PorcentajeCompraImportacion, 1) * PorcentajeRecepcionCompras Dim ImporteAbono As Decimal = (SubTotalPartida * dr("TipoCambio").ToString.ToDecimal).RoundSQL Dim ImporteAbonoME As Decimal = 0 Dim CveConceptoCostoIndirecto As Integer = If(CveImportacionSurtir > 0, 240, 237) @@ -3199,10 +3213,10 @@ Partial Class Inventarios_RecepcionAlmacen - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, InvFolio, CveConceptoCostoIndirecto, InvFolio, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, CveConceptoCostoIndirecto, ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then ' si tiene valor es que hay complementaria If ImporteAbonoME > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, InvFolio, If(CveImportacionSurtir > 0, 242, 239), InvFolio, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, If(CveImportacionSurtir > 0, 242, 239), ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then ErrorMovInv = True End If End If @@ -3220,7 +3234,7 @@ Partial Class Inventarios_RecepcionAlmacen End If End If - If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then If ObjConta.ValorPolizaDescuadre > 0 Then GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") ErrorMovInv = True diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index 688c514df..d05dad8a8 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -242,7 +242,7 @@ - + @@ -284,11 +284,11 @@ - - + + <%-- @@ -439,7 +439,7 @@
- +
@@ -473,7 +473,7 @@ - + <%-- --%> @@ -490,13 +490,15 @@ - - - + + + + - xx + + diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index c706e4f5c..fb4e1fd2c 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 @@ -275,8 +274,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 +334,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 +350,17 @@ Partial Class Inventarios_ResguardoMaterial If CBool(drp("AplicaSeccion")) Then ThSeccion.Visible = True TrSeccion.Visible = True + If DdlAlmacen.SelectedValue.ToEntero > 0 Then + DdlSeccionAlmacen.Items.Clear() + CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAlmacen.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) + '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 @@ -571,6 +583,18 @@ Partial Class Inventarios_ResguardoMaterial Protected Sub GvMLiberacion_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then e.Row.FCLabel("LblCantidad").Text = e.Row.FCLabel("LblCantidad").Text.FormatoNumero(2) + + If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero > 0 Then + Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt + e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() + If dtt.Rows.Count = 0 Then + e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + dtt.Dispose() + End If + End If End Sub @@ -650,13 +674,12 @@ Partial Class Inventarios_ResguardoMaterial End Sub Private Sub CargaGvMLiberacion() - GvM.Columns(5).Visible = False - For Each Dr As DataRow In DtMovimientosLiberacion.Rows - If Dr("Serie").ToString <> "" Then - GvM.Columns(5).Visible = True - Exit For - End If - Next + + GvMLiberacion.Columns(5).Visible = DtMovimientosLiberacion.MAX("Serie").ToString <> "" + GvMLiberacion.Columns(6).Visible = DtMovimientosLiberacion.MAX("Lote").ToString <> "" + GvMLiberacion.Columns(7).Visible = DtMovimientosLiberacion.MAX("FechaCaducidad").ToString.ToDate > MinFecha + GvMLiberacion.Columns(8).Visible = DtMovimientosLiberacion.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 Or DtMovimientosLiberacion.MAX("AplicaSeccion") = "True" + GvMLiberacion.DataSource = DtMovimientosLiberacion GvMLiberacion.DataBind() @@ -823,10 +846,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" @@ -845,6 +875,7 @@ Partial Class Inventarios_ResguardoMaterial 'SALIDA ORIGEN - RESGUARDO CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenLiberación, 3, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservacionesLiberacion.Text, CvePersonal:=CvePersonalLiberacion, CveAlmacenDestino:=DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero, CveProveedor:=CveProveedorLiberacion, CveCliente:=CveClienteLiberacion, MovimientoFijo:=True) FolioSalida = ObjInventario.Folio + Dim DiccionarioSecciones As New HybridDictionary If CveMovimientoSalida <= 0 Then TieneError = True @@ -855,11 +886,12 @@ Partial Class Inventarios_ResguardoMaterial Dim Cont As Integer = 0 For Each Gvr As GridViewRow In GvMLiberacion.Rows If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Gvr.DataKey("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, CveSeccionAlmacen:=Gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Gvr.DataKey("Serie").ToString, Observaciones:=Gvr.DataKey("Observaciones").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For - + Else + DiccionarioSecciones.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue) End If End If Cont += 1 @@ -877,7 +909,8 @@ Partial Class Inventarios_ResguardoMaterial If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Cont = 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("Serie").ToString, Dr("Observaciones").ToString) Then + Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero + 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:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" Exit For @@ -1020,4 +1053,7 @@ Partial Class Inventarios_ResguardoMaterial End If End Sub + Private Sub DdlAlmacenDestinoLiberacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestinoLiberacion.SelectedIndexChanged + CargaResguardos() + End Sub End Class diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 9ce5b10d3..05c5c6f2e 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1534,13 +1534,14 @@ Partial Class Inventarios_TraspasoAlmacen e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", String.Format("ValidaCantidad(this,{0});", e.Row.DBCampo("Cantidad"))) If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenRecepcion.SelectedValue.ToEntero > 0 Then - Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt - e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - If dtt.Rows.Count > 1 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - dtt.Dispose() + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) + 'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() + 'If dtt.Rows.Count > 1 Then + ' e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + 'End If + 'dtt.Dispose() End If End If diff --git a/LogIn.aspx b/LogIn.aspx index b391e24ef..80d75be74 100644 --- a/LogIn.aspx +++ b/LogIn.aspx @@ -18,7 +18,7 @@ <%: Styles.Render("~/Metronic/assets/global/css/css") %> - + <%: Scripts.Render("~/bundles/modernizr") %> @@ -69,13 +69,13 @@
- +
- - + +
+ +
<%----%> diff --git a/RH/Organigrama.aspx.vb b/RH/Organigrama.aspx.vb index 84175ea43..190813a3a 100644 --- a/RH/Organigrama.aspx.vb +++ b/RH/Organigrama.aspx.vb @@ -86,14 +86,8 @@ Partial Class RH_Organigrama CveEmpresaFiltro = UsuarioActual.CveEmpresa NivelOrg = If(rgx.IsMatch(txtNivel.Text), txtNivel.Text.ToEntero, NivelOrg) txtNivel.Text = "" - DdlSupervisorOrganigrama.SelectedIndex = 0 - ScriptManager.RegisterClientScriptBlock(Me, [GetType], "mykey", "drawChart()", True) 'ejecutamos la funcion de js para que haga la consulta de los registros - End Sub + 'DdlSupervisorOrganigrama.SelectedIndex = 0 -#End Region - - - Public Shared Function FetchData() As List(Of Object) Dim ObjRH As New ClsRH Dim DtTemporal As New DataTable Dim chartData As New List(Of Object)() @@ -110,8 +104,33 @@ Partial Class RH_Organigrama chartData.Add(New Object() {headerEmpleado, If(nombreEmpleado = nombreSuperior, "", nombreSuperior), puesto}) Next End If + Dim str As String = (New Script.Serialization.JavaScriptSerializer()).Serialize(chartData) + LblJson.Text = str + 'ScriptManager.RegisterClientScriptBlock(Me, [GetType], "mykey", "drawChart()", True) 'ejecutamos la funcion de js para que haga la consulta de los registros + End Sub - Return chartData +#End Region + + + Public Shared Function FetchData() As String + Dim ObjRH As New ClsRH + Dim DtTemporal As New DataTable + Dim chartData As New List(Of Object)() + + If ObjRH.GetOrganigrama(CveEmpresaFiltro, CveCabecera, NivelOrg) Then + DtTemporal = ObjRH.DtResultados.Copy + + For Each renglon As DataRow In DtTemporal.Rows + Dim nombreEmpleado As String = renglon("nombreEmpleado").ToString + Dim nombreSuperior As String = renglon("nombreSuperior").ToString + Dim puesto As String = renglon("puesto").ToString + Dim headerEmpleado As String = String.Format("{{{2}v{2}:{2}{0}{2},{2}f{2}:{2}{0}
{1}
{2}}}", nombreEmpleado, puesto, ControlChars.Quote) 'este es el JSON que da formato a los subtitulos se hace en String y la funcion lo hace JSON + + chartData.Add(New Object() {headerEmpleado, If(nombreEmpleado = nombreSuperior, "", nombreSuperior), puesto}) + Next + End If + Dim str As String = (New Script.Serialization.JavaScriptSerializer()).Serialize(chartData) + Return str End Function End Class diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 58b20c4a1..ce2b06451 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -715,7 +715,7 @@ - +
@@ -723,7 +723,7 @@ - +
@@ -829,7 +829,7 @@ - @@ -3861,13 +3861,18 @@
@@ -721,6 +723,7 @@
Seleccionar Todos +
@@ -785,234 +788,239 @@ -
-
-
-
-
- - Inventarios -
-
-
+ + + +
+
+
+
+
+ + Inventarios +
+
+
+
+
-
-
-
- <%--
+
+ <%--
--%> -
- -
- - - - - - - +
+ +
+ + + + + + + +
+
+
+ +
+ +
+
+ + + <%--Nuevo R: 27/09/2017--%> + +
+ +
+ + + +
+
+
+ +
+ + + +
+
+
+ +
+ + + +
+
+
+ +
+ + + +
+
+
+ +
+ + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + + + + + +
+
-
- -
- +
+
+
+
+
+ + Concepto Relacionado +
+
+
+
+
-
- - - <%--Nuevo R: 27/09/2017--%> - -
- -
- - - -
-
-
- -
- - - -
-
-
- -
- - - -
-
-
- -
- - - -
-
-
- -
- - - -
-
-
- -
- -
-
-
- -
- +
+
+ +
+ + + +
+

-
-
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- - - - - - - - - - -
-
-
-
-
-
-
-
-
- - Concepto Relacionado -
-
-
-
-
-
-
-
- -
- - - -
-
-
-
-
-
-
-
- - Comercio Exterior -
-
-
-
-
-
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- - -
-
-
-
- - Secciones de Almacen -
-
-
- -
+
+
+
+ + Comercio Exterior +
+
+
-
- - - - -<%-- +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+ + Secciones de Almacen +
+
+
+ +
+
+
+
+ + + + + <%-- --%> - - - - - - - + + + + + + + +
+
-
-
- - -
-
+ + +
+
+ + @@ -1085,6 +1093,8 @@ Característica + + @@ -1092,6 +1102,8 @@ Opción + + @@ -1099,6 +1111,8 @@ Fecha Ing. + + @@ -1106,6 +1120,8 @@ Usuario + + @@ -1748,6 +1764,8 @@

El producto seleccionado en el recuadro de arriba sera unificado en el producto actual + +

@@ -1980,6 +1998,7 @@

Tipo de Clasificación: +

@@ -1990,6 +2009,7 @@   +
@@ -2072,7 +2092,7 @@