-- envio de folios de garantía en traspasos a devoluciones a proveedor

This commit is contained in:
2022-01-24 07:33:14 -07:00
parent 536894806a
commit ee1ec3a792
4 changed files with 98 additions and 54 deletions

View File

@@ -460,7 +460,7 @@
</table>
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Lote,FechaCaducidad,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign ="Right">

View File

@@ -28,7 +28,6 @@ Partial Class Inventarios_TraspasoAlmacen
End Set
End Property
Private Property CveAlmacenTransitorio As Integer
Get
Return CType(ViewState("CveAlmacenTransitorio"), Integer)
@@ -198,6 +197,10 @@ Partial Class Inventarios_TraspasoAlmacen
CargaMovimiento(Request("CveEntrada").ToString.ToEntero)
End If
If Request("CveFolioGarantia") IsNot Nothing AndAlso Request("CveFolioGarantia").ToString.ToEntero > 0 Then
CargaMovimientoGarantia(Request("CveFolioGarantia").ToString.ToEntero)
End If
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
DivCodigoSeriePS.Visible = True
Else
@@ -221,7 +224,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
CantidadTotal = 0
CvePS = 0
CvePS = 0
TipoSeccionAlmacen = 0
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
@@ -358,6 +361,56 @@ Partial Class Inventarios_TraspasoAlmacen
UpMov.Update()
End Sub
Private Sub CargaMovimientoGarantia(CveFolioGarantia As Integer)
Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia) Then
''carga
Dim dra As DataRow = ObjAcum.DtResultados(0)
DivMov.Visible = True
ltlFolio.Text = dra("FolioGarantia").ToString
Dim CveSub As Integer = dra("CveSubProyecto").ToString.ToEntero
'If Mov.CveCompra > 0 Then
' hplRef.NavigateUrl = $"/Compras/Compras.aspx?CveCompra={Mov.CveCompra}"
' lblCompraRef.Visible = True
' hplRef.Visible = True
'Else
' hplRef.Visible = False
' lblCompraRef.Visible = False
'End If
ChkTransitorio.Enabled = False
DdlAlmacenOrigen.Enabled = True
DdlAlmacenOrigen.Items.Clear()
DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6).FiltraParametros(String.Format("CveSubProyecto={0}", CveSub))
DdlAlmacenOrigen.DataBind()
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 21).FiltraParametros(String.Format("CveSubProyecto={0}", CveSub))
DdlAlmacenDestino.DataBind()
CargadoDeMov = True
Dim dtt As DataTable = ObjAcum.DtResultados.FiltraParametros("", DistinctColumns:={"CvePS", "PS", "CveUM", "UnidadMedida", "Codigo"})
For Each drr As DataRow In dtt.Rows
Dim dr As DataRow = DtMovimientos.NewRow
dr("CvePS") = drr("CvePS")
dr("PS") = String.Format("{0} - {1}", drr("Codigo"), drr("PS"))
dr("CveUM") = drr("CveUM")
dr("UnidadMedida") = drr("UnidadMedida")
dr("Cantidad") = ObjAcum.DtResultados.COUNT("CvePS", "CvePS = " & drr("CvePS").ToString)
DtMovimientos.Rows.Add(dr)
Next
CargaGvDatos()
End If
End Using
UpMov.Update()
End Sub
Private Sub AlmacenTransitorioDefaults()
ChkTransitorio.Checked = UsuarioActual.Empresa.Funcionalidad(154).ToString.ToEntero > 0
ChkTransitorio.Enabled = Not UsuarioActual.Empresa.Funcionalidad(154).ToString.ToEntero > 0
@@ -898,16 +951,6 @@ Partial Class Inventarios_TraspasoAlmacen
Dim tLote As String = If(Lote <> "-1", String.Format("AND Lote = '{0}' ", Lote), "")
Dim tFechaCaducidad As String = If(FechaCaducidad > MinFecha, String.Format("AND FechaCaducidad = '{0}' ", FechaCaducidad), "")
'If UsuarioActual.CveEmpresa = 140 Then
' Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").ToEntero
' If Not CveSubProyecto.Contiene(11791, 11793, 11993, 11994, 11794, 11797, 11795, 12010, 12011) Then
' Serie = "-1"
' End If
'End If
Dim ExistenciaEspecificada As Decimal = 0
CantidadenGrid = DtMovimientos.SUMD("Cantidad", String.Format("CvePS = {0} AND CveUM = {1} {2} {3} {4} ", dr("CvePS"), dr("CveUM"), If(Not dr("Serie").ToString.Contiene("-1", ""), $" AND Serie = '{dr("Serie")}'", ""), tLote, tFechaCaducidad))
If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
@@ -945,7 +988,7 @@ Partial Class Inventarios_TraspasoAlmacen
Lote = If(gvr.DataKey("Lote") = "", "-1", gvr.DataKey("Lote"))
FechaCaducidad = If(gvr.DataKey("FechaCaducidad") = "", MinFecha, gvr.DataKey("FechaCaducidad").ToDate)
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
'si hay existencia en almacen costeado, lo tengo que sacar
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
End If
@@ -1249,12 +1292,12 @@ Partial Class Inventarios_TraspasoAlmacen
RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimientoSalida))
End If
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
Dim Correo As String = "jorgegonzalez@compuproveedores.com"
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero = 16 Then
MandaCorreo(CveMovimientoSalida, Correo)
End If
End If
'If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
' Dim Correo As String = "jorgegonzalez@compuproveedores.com"
' If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero = 16 Then
' MandaCorreo(CveMovimientoSalida, Correo)
' End If
'End If
LimpiaMovimiento()
@@ -1769,7 +1812,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
If UsuarioActual.Empresa.Funcionalidad(132) = "1" OrElse UsuarioActual.CveEmpresa = 140 Then
DivCodigoSeriePSRecepcion.Visible = True
Else
DivCodigoSeriePSRecepcion.Visible = False
@@ -3330,7 +3373,7 @@ Partial Class Inventarios_TraspasoAlmacen
If SATClaveUnidadMedida.Length = 0 Then SBMensaje.AppendLine("-Producto sin unidad de medida SAT asignada. ")
SBMensaje.AppendLine($"<br><br> <strong><a class='texto' target='_blank' href='../Ventas/ProductosServicios.aspx?CvePS={DrPS("CvePS").ToString}' > Corregir Producto </a></strong>")
SBMensaje.AppendLine($"<br><strong><a class='texto' target='_blank' href='/Ventas/ProductosServicios.aspx?CvePS={DrPS("CvePS").ToString}' > Editar Producto </a></strong>")
Alert(SBMensaje.ToString, TipoMensaje.MsgAdvertencia)