Indicadores Medicos, procedimientos
This commit is contained in:
@@ -2,14 +2,15 @@
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_EntregaAlmacen
|
||||
Inherits ClsPaginas
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property CveVentaAD As Integer
|
||||
Get
|
||||
@@ -317,13 +318,25 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Set(value As Boolean)
|
||||
ViewState("CargaBitacora") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
Private Property PedidoBloqueCantidad As Boolean
|
||||
Get
|
||||
If ViewState("PedidoBloqueCantidad") Is Nothing Then
|
||||
ViewState("PedidoBloqueCantidad") = False
|
||||
End If
|
||||
Return Boolean.Parse(ViewState("PedidoBloqueCantidad").ToString)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PedidoBloqueCantidad") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
@@ -339,9 +352,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub InicializaValores()
|
||||
TipoEstatus = -1
|
||||
@@ -412,11 +425,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
CreaDtDetalleLote()
|
||||
CargaPendientes()
|
||||
LimpiaCampos()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " CARGA PARAMETROS - EXCLUSIVO USO AD "
|
||||
Private Sub CargaParametrosAD()
|
||||
|
||||
@@ -434,9 +447,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
BtnGuardar.Visible = False
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA PENDIENTES POR SURTIR "
|
||||
Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaFolios()
|
||||
@@ -552,11 +565,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End Select
|
||||
UpPendientes.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " CARGA VENTA POR SURTIR "
|
||||
Protected Sub BtnSurtir_Click(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -644,7 +657,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
EsDevolucionVenta = drE("EsDevolucionVenta").ToString().ToEntero()
|
||||
TipoDocto = DtDatos.Rows(0)("TipoDocto").ToString()
|
||||
TipoMovimiento = If(TipoDocto.Contiene({"Rem", "Ing", "Ped", "PeC", "Ant"}) And (EsDevolucionVenta = 0 Or CveVentaAD > 0), 1, 2)
|
||||
TipoMovimiento = If(TipoDocto.Contiene({"Rem", "Ped", "Ing", "Ped", "PeC", "Ant"}) And (EsDevolucionVenta = 0 Or CveVentaAD > 0), 1, 2)
|
||||
|
||||
LbCliente.Text = DtDatos.Rows(0)("Nombre").ToString()
|
||||
HLFolio.Text = drE("SerieFolio").ToString()
|
||||
@@ -663,8 +676,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
LbObservacionesAlmacen.Text = drE("ObservacionesAlmacen").ToString()
|
||||
CveVentaSurtir = CveVenta
|
||||
CveOSSurtir = CveOS
|
||||
CveAlmacenTraspasoDestino = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem", "CveAlmacenTraspasoOrigen", "CveAlmacenTraspasoDestino")).ToString().ToEntero()
|
||||
CveAlmacenTraspasoOrigen = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem", "CveAlmacenTraspasoDestino", "CveAlmacenTraspasoOrigen")).ToString().ToEntero()
|
||||
CveAlmacenTraspasoDestino = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoOrigen", "CveAlmacenTraspasoDestino")).ToString().ToEntero()
|
||||
CveAlmacenTraspasoOrigen = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoDestino", "CveAlmacenTraspasoOrigen")).ToString().ToEntero()
|
||||
CveContrato = drE("CveContrato").ToString().ToEntero()
|
||||
CveVendedor = drE("CveVendedor").ToString().ToEntero()
|
||||
CveCliente = drE("CveCliente").ToString().ToEntero()
|
||||
@@ -693,7 +706,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario"
|
||||
End If
|
||||
|
||||
If CveAlmacenTraspasoDestino > 0 And Not (TipoMovimiento = 2 And TipoDocto = "Rem") Then
|
||||
If CveAlmacenTraspasoDestino > 0 And Not (TipoMovimiento = 2 And TipoDocto.Contiene("Rem", "Ped")) Then
|
||||
DivTipoCambioAdvertencia.Visible = True
|
||||
LtTipoCambioAdvertencia.Text = $"Los productos seran Trasladados al Almacen: <b>{GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacenTraspasoDestino}")}</b>"
|
||||
Else
|
||||
@@ -701,7 +714,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
'DEVOLUCION REMISION
|
||||
If TipoMovimiento = 2 And TipoDocto = "Rem" And Not CveAlmacenTraspasoDestino > 0 Then
|
||||
If TipoMovimiento = 2 And TipoDocto.Contiene("Rem", "Ped") And Not CveAlmacenTraspasoDestino > 0 Then
|
||||
Alert("La remisión que se intenta devolver presenta inconsistencias. Comuniquese con servicio tecnico SIG.", TipoMensaje.MsgError)
|
||||
BtnGuardar.Visible = False
|
||||
End If
|
||||
@@ -833,6 +846,14 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
UpGenerales.Update()
|
||||
If CveAlmacen <= 0 Then CargaGvDatos()
|
||||
|
||||
|
||||
|
||||
If EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 AndAlso TipoDocto = "Ped" Then
|
||||
PedidoBloqueCantidad = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub CargaTraspasoPorSurtir(CveTraspaso As Integer)
|
||||
LbSurtida.Visible = False
|
||||
@@ -995,9 +1016,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
'código temporal
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
|
||||
'código temporal
|
||||
Dim AplicaSerie As Boolean = CBool(e.Row.DBCampo("AplicaSerie"))
|
||||
|
||||
If AplicaSerie Then
|
||||
@@ -1119,8 +1142,14 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
'SI ES TRASPASO OBLIGATORIO SURTIR TODO
|
||||
If TipoEntrega = 2 Then
|
||||
e.Row.FCCheckBox("cbInv").Enabled = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If PedidoBloqueCantidad Then
|
||||
e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1135,14 +1164,14 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
GvDocs.DataBind()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " AGREGAR "
|
||||
|
||||
|
||||
Protected Sub BtnSerie_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim Argumentos As String() = CType(sender, Button).CommandArgument.Split("°"c)
|
||||
@@ -1169,10 +1198,10 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
UpSerie.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#Region " AGREGA POR SERIE/LOTE "
|
||||
|
||||
|
||||
Private Sub CreaDtDetalle()
|
||||
If DtDatosDetalle Is Nothing Then
|
||||
DtDatosDetalle = New DataTable
|
||||
@@ -1365,7 +1394,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
If Tipo < 3 Then
|
||||
CargaSerie(True, cargaMasivo)
|
||||
CargaSerie(True, CargaMasivo)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -1387,7 +1416,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
ActualizaBitacora()
|
||||
CargaSerie()
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Bitacora"
|
||||
Private Sub ActualizaBitacora(Optional Eliminar As Boolean = False)
|
||||
@@ -1431,11 +1460,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Else
|
||||
Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
#Region " AGREGA CON LOTE BATCH "
|
||||
|
||||
|
||||
Private Sub CreaDtDetalleLote()
|
||||
If DtDatosDetalleLote Is Nothing Then
|
||||
DtDatosDetalleLote = New DataTable
|
||||
@@ -1624,9 +1653,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End Try
|
||||
DtDatosDetalleLote.AcceptChanges()
|
||||
CargaLote()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " AGREGA CON TXT | CODIGO - SERIE "
|
||||
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -1758,12 +1787,12 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
TxtCantidadEspecialDiv.Text = "1"
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " GUARDAR "
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -1849,7 +1878,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
If EsDevolucionVenta = 1 Or TipoDocto.Contiene({"Ped"}) Then
|
||||
If Not (EsDevolucionVenta = 1 And TipoDocto.Contiene("Rem")) Then ' condicion si hay una devolucion de remision, no verifique la totalidad surtido
|
||||
If Not (EsDevolucionVenta = 1 And TipoDocto.Contiene("Rem", "Ped")) Then ' condicion si hay una devolucion de remision, no verifique la totalidad surtido
|
||||
For Each Gvr As GridViewRow In GvDatos.Rows
|
||||
If Not Gvr.FCCheckBox("cbInv").Checked Or (Gvr.FCCheckBox("cbInv").Checked AndAlso Gvr.FCTextBox("TbCantidadF").Text.ToDecimal <> Gvr.DataKey("CantidadC").ToString().ToDecimal) Then
|
||||
Alert("Es necesario surtir todos los productos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -1864,9 +1893,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
|
||||
Dim EsInterno As Integer = -1
|
||||
If TipoDocto = "Ped" Then
|
||||
EsInterno = If(Me.EsInterno, 1, 0)
|
||||
End If
|
||||
'If TipoDocto = "Ped" Then
|
||||
' EsInterno = If(Me.EsInterno, 1, 0)
|
||||
'End If
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
@@ -2007,9 +2036,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim CantidadSalidaSinCosto As Decimal = 0
|
||||
|
||||
'' COMIENZA: SIN COSTO
|
||||
If TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(587) = "1" AndAlso TipoMovimiento = 1 Then
|
||||
If TipoDocto.Contiene("Ing", "Rem", "Ped") AndAlso UsuarioActual.Empresa.Funcionalidad(587) = "1" AndAlso TipoMovimiento = 1 Then
|
||||
|
||||
Dim CveConceptoSalidaSinCosto As Integer = If(TipoDocto.Contiene("Rem"), 8, 40)
|
||||
Dim CveConceptoSalidaSinCosto As Integer = If(TipoDocto.Contiene("Rem", "Ped"), 8, 40)
|
||||
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Dr("CantidadGV").ToString().ToDecimal > 0 Then
|
||||
@@ -2128,7 +2157,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Next
|
||||
|
||||
'ENTRADA POR TRASPASO A ENTREGA POR ADELANTADO
|
||||
If TipoDocto = "Rem" AndAlso Not ErrorMovInv Then
|
||||
If TipoDocto.Contiene("Rem", "Ped") AndAlso Not ErrorMovInv Then
|
||||
For Each Dr1 As DataRow In DtTraspasos.Select("CveTipoAlmacen = 26")
|
||||
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
|
||||
|
||||
@@ -2164,7 +2193,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 AndAlso TipoDocto.Contiene("Rem") Then
|
||||
If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 AndAlso TipoDocto.Contiene("Rem", "Ped") Then
|
||||
Dim CvePrePolizaSinCosto As Integer = ObjConta.AddPrePolizas("EA/SinCost", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Entrega", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePolizaSinCosto > 0 Then
|
||||
|
||||
@@ -2415,7 +2444,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim TotalGarantia As Decimal = 0
|
||||
|
||||
' COMIENZA: GARANTIAS
|
||||
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then
|
||||
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Rem", "Ped") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then
|
||||
|
||||
Dim CveAlmacenGarantia As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim DtGarantias As DataTable = Nothing
|
||||
@@ -2527,7 +2556,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
CantidadPendientePorSalir = CantidadPendientePorSalir - CantidadEntradaSinCosto
|
||||
End If
|
||||
'si el alamcen del que salio, es el mismo que entra, no hay traspasos.
|
||||
If CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero() And TipoDocto <> "Rem" Then CveAlmacenTraspasoDestino = 0
|
||||
If CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero() And TipoDocto <> "Rem" And TipoDocto <> "Ped" Then CveAlmacenTraspasoDestino = 0
|
||||
|
||||
If Not ErrorMovInv AndAlso CantidadPendientePorSalir > 0 Then
|
||||
Dim ConceptoMovimiento As Integer = 3
|
||||
@@ -2537,13 +2566,13 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim Almacen1 As Integer = DdlAlmacen.SelectedValue.ToEntero()
|
||||
Dim tCveAlmacenTraspasoDestino As Integer = CveAlmacenTraspasoDestino
|
||||
|
||||
If TipoDocto = "Rem" AndAlso tCveAlmacenTraspasoDestino = 0 Then
|
||||
If TipoDocto.Contiene("Rem", "Ped") AndAlso tCveAlmacenTraspasoDestino = 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error. no se tiene definido el almacen destino")
|
||||
End If
|
||||
|
||||
'DEVOLUCION REMISION
|
||||
If TipoMovimiento = 2 And TipoDocto = "Rem" Then
|
||||
If TipoMovimiento = 2 And TipoDocto.Contiene("Rem", "Ped") Then
|
||||
ConceptoMovimiento = 8
|
||||
Almacen1 = CveAlmacenTraspasoDestino
|
||||
tCveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero()
|
||||
@@ -3012,8 +3041,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
|
||||
|
||||
If EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 Then
|
||||
If Not CierreOS(CveOSSurtir) Then
|
||||
If EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 AndAlso TipoDocto = "Ped" Then
|
||||
If Not CierreOS(CveOSSurtir, CveMovimiento, ObjInventario.IniciaTransacSQL) Then
|
||||
ErrorMovInv = True
|
||||
Alert("Error al finalizar orden de servicio", TipoMensaje.MsgError)
|
||||
End If
|
||||
@@ -3074,7 +3103,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
'SI NO ES GARANTIA MANDA A RECIBIR AL USADO
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDocto = "Rem" AndAlso CveMovimientoGarantia <= 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDocto.Contiene("Rem", "Ped") AndAlso CveMovimientoGarantia <= 0 Then
|
||||
Msg.AppendFormat("<br/><br/>Recibir Usado: <b><a href=""/Inventarios/RecepcionUsados.aspx?CveRemision={0}"" target=""_blank"" class=""Texto"">Ir a Recepción de Usados</a></b>", CveVentaSurtir)
|
||||
End If
|
||||
|
||||
@@ -3667,160 +3696,160 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
CargaGvDatos()
|
||||
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " TRASPASO - TRANSITORIO "
|
||||
Protected Sub ChkTransitorio_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
TxtResponsable.Text = ""
|
||||
DivTransitorio2.Visible = ChkTransitorio.Checked
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "SECCION ALMACEN"
|
||||
'Private Sub CreaDtSeccionAlmacen()
|
||||
' DtSeccionAlmacen = New DataTable
|
||||
' DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
|
||||
' DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
|
||||
' DtSeccionAlmacen.Columns.Add("CveSeccionAlmacen", GetType(Integer))
|
||||
' DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer))
|
||||
' DtSeccionAlmacen.Columns.Add("SeccionAlmacen", GetType(String))
|
||||
' DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
|
||||
'End Sub
|
||||
'Private Sub CargaDdlAlmacen()
|
||||
' DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
' DdlSeccionAlmacen.DataBind()
|
||||
'End Sub
|
||||
'Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
' If Not DdlAlmacen.SelectedValue.ToEntero() > 0 Then
|
||||
' Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' CantidadTotal = gvRow.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
' IndexSeccionAlmacen = gvRow.RowIndex
|
||||
' CvePS = gvRow.DataKey("CvePS").ToEntero()
|
||||
' CargaSeccionAlmacen()
|
||||
' RegistraScript("$('#DModalSeccionAlmacen').modal()")
|
||||
'End Sub
|
||||
|
||||
'Private Sub CargaSeccionAlmacen()
|
||||
' Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
|
||||
' GvSeccion.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}")
|
||||
' GvSeccion.DataBind()
|
||||
|
||||
' TxtCantidadSeccion.Text = ""
|
||||
' DdlSeccionAlmacen.SelectedIndex = 0
|
||||
' Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
|
||||
' If CantidadRestante = 0 Then
|
||||
' RVTxtCantidad.MaximumValue = "1"
|
||||
' TxtCantidadSeccion.Enabled = False
|
||||
' Else
|
||||
' RVTxtCantidad.MaximumValue = CantidadRestante.ToString()
|
||||
' TxtCantidadSeccion.Enabled = True
|
||||
' End If
|
||||
|
||||
' If CantidadTotalSeccion > 0 Then
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = False
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = "Cuenta con sección almacen"
|
||||
|
||||
' Else
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = True
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = ""
|
||||
|
||||
' End If
|
||||
|
||||
' If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
|
||||
' DdlAlmacen.Enabled = False
|
||||
' DdlAlmacen.ToolTip = "Cuenta con sección almacen"
|
||||
' Else
|
||||
' DdlAlmacen.Enabled = True
|
||||
' DdlAlmacen.ToolTip = ""
|
||||
' End If
|
||||
|
||||
' UpModalSeccionAlmacen.Update()
|
||||
' UpDatos.Update()
|
||||
' UpGenerales.Update()
|
||||
'End Sub
|
||||
|
||||
'Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
|
||||
' Dim ObjInv As New ClsInventarios
|
||||
' Dim CantidadDisponible As Decimal = 0
|
||||
' If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacen.SelectedValue.ToEntero(), DdlAlmacen.SelectedValue.ToEntero(),
|
||||
' CvePS, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
' CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString().ToDecimal
|
||||
' End If
|
||||
' End If
|
||||
' ObjInv.Dispose()
|
||||
|
||||
' CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacen = {DdlSeccionAlmacen.SelectedValue}").SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
' If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
|
||||
' Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' Dim Row As DataRow = Nothing
|
||||
' DtSeccionAlmacen.AcceptChanges()
|
||||
' Row = DtSeccionAlmacen.NewRow
|
||||
' Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
|
||||
' Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
|
||||
' Row("CveSeccionAlmacen") = DdlSeccionAlmacen.SelectedValue.ToEntero()
|
||||
' Row("SeccionAlmacen") = DdlSeccionAlmacen.SelectedItem.Text
|
||||
' Row("CvePS") = CvePS
|
||||
' Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
|
||||
' DtSeccionAlmacen.Rows.Add(Row)
|
||||
' DtSeccionAlmacen.AcceptChanges()
|
||||
' CargaSeccionAlmacen()
|
||||
'End Sub
|
||||
|
||||
'Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
|
||||
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
' Dim Index As Integer = 0
|
||||
' For Each Dr As DataRow In DtSeccionAlmacen.Rows
|
||||
' If Dr("Consec").ToString().ToEntero() = gvRow.DataKey("Consec").ToEntero() Then
|
||||
' Exit For
|
||||
' End If
|
||||
' Index += 1
|
||||
' Next
|
||||
' DtSeccionAlmacen.Rows.RemoveAt(Index)
|
||||
' DtSeccionAlmacen.AcceptChanges()
|
||||
' CargaSeccionAlmacen()
|
||||
'End Sub
|
||||
|
||||
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
|
||||
' If Not CveVentaSurtir > 0 Then
|
||||
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' If Not DdlAlmacen.SelectedValue.ToEntero() > 0 Then
|
||||
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' Dim ObjInv As New ClsInventarios
|
||||
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then
|
||||
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
|
||||
' End If
|
||||
' ObjInv.Dispose()
|
||||
' GvVerSeccionesAlmacen.DataBind()
|
||||
' UpVerSeccionesAlmacen.Update()
|
||||
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
|
||||
'End Sub
|
||||
|
||||
'Private Sub CreaDtSeccionAlmacen()
|
||||
' DtSeccionAlmacen = New DataTable
|
||||
' DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
|
||||
' DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
|
||||
' DtSeccionAlmacen.Columns.Add("CveSeccionAlmacen", GetType(Integer))
|
||||
' DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer))
|
||||
' DtSeccionAlmacen.Columns.Add("SeccionAlmacen", GetType(String))
|
||||
' DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
|
||||
'End Sub
|
||||
'Private Sub CargaDdlAlmacen()
|
||||
' DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
' DdlSeccionAlmacen.DataBind()
|
||||
'End Sub
|
||||
'Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
' If Not DdlAlmacen.SelectedValue.ToEntero() > 0 Then
|
||||
' Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' CantidadTotal = gvRow.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
' IndexSeccionAlmacen = gvRow.RowIndex
|
||||
' CvePS = gvRow.DataKey("CvePS").ToEntero()
|
||||
' CargaSeccionAlmacen()
|
||||
' RegistraScript("$('#DModalSeccionAlmacen').modal()")
|
||||
'End Sub
|
||||
|
||||
'Private Sub CargaSeccionAlmacen()
|
||||
' Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
|
||||
' GvSeccion.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}")
|
||||
' GvSeccion.DataBind()
|
||||
|
||||
' TxtCantidadSeccion.Text = ""
|
||||
' DdlSeccionAlmacen.SelectedIndex = 0
|
||||
' Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
|
||||
' If CantidadRestante = 0 Then
|
||||
' RVTxtCantidad.MaximumValue = "1"
|
||||
' TxtCantidadSeccion.Enabled = False
|
||||
' Else
|
||||
' RVTxtCantidad.MaximumValue = CantidadRestante.ToString()
|
||||
' TxtCantidadSeccion.Enabled = True
|
||||
' End If
|
||||
|
||||
' If CantidadTotalSeccion > 0 Then
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = False
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = "Cuenta con sección almacen"
|
||||
|
||||
' Else
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = True
|
||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = ""
|
||||
|
||||
' End If
|
||||
|
||||
' If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
|
||||
' DdlAlmacen.Enabled = False
|
||||
' DdlAlmacen.ToolTip = "Cuenta con sección almacen"
|
||||
' Else
|
||||
' DdlAlmacen.Enabled = True
|
||||
' DdlAlmacen.ToolTip = ""
|
||||
' End If
|
||||
|
||||
' UpModalSeccionAlmacen.Update()
|
||||
' UpDatos.Update()
|
||||
' UpGenerales.Update()
|
||||
'End Sub
|
||||
|
||||
'Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
|
||||
' Dim ObjInv As New ClsInventarios
|
||||
' Dim CantidadDisponible As Decimal = 0
|
||||
' If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacen.SelectedValue.ToEntero(), DdlAlmacen.SelectedValue.ToEntero(),
|
||||
' CvePS, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
' CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString().ToDecimal
|
||||
' End If
|
||||
' End If
|
||||
' ObjInv.Dispose()
|
||||
|
||||
' CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacen = {DdlSeccionAlmacen.SelectedValue}").SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
' If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
|
||||
' Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' Dim Row As DataRow = Nothing
|
||||
' DtSeccionAlmacen.AcceptChanges()
|
||||
' Row = DtSeccionAlmacen.NewRow
|
||||
' Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
|
||||
' Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
|
||||
' Row("CveSeccionAlmacen") = DdlSeccionAlmacen.SelectedValue.ToEntero()
|
||||
' Row("SeccionAlmacen") = DdlSeccionAlmacen.SelectedItem.Text
|
||||
' Row("CvePS") = CvePS
|
||||
' Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
|
||||
' DtSeccionAlmacen.Rows.Add(Row)
|
||||
' DtSeccionAlmacen.AcceptChanges()
|
||||
' CargaSeccionAlmacen()
|
||||
'End Sub
|
||||
|
||||
'Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
|
||||
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
' Dim Index As Integer = 0
|
||||
' For Each Dr As DataRow In DtSeccionAlmacen.Rows
|
||||
' If Dr("Consec").ToString().ToEntero() = gvRow.DataKey("Consec").ToEntero() Then
|
||||
' Exit For
|
||||
' End If
|
||||
' Index += 1
|
||||
' Next
|
||||
' DtSeccionAlmacen.Rows.RemoveAt(Index)
|
||||
' DtSeccionAlmacen.AcceptChanges()
|
||||
' CargaSeccionAlmacen()
|
||||
'End Sub
|
||||
|
||||
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
|
||||
' If Not CveVentaSurtir > 0 Then
|
||||
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' If Not DdlAlmacen.SelectedValue.ToEntero() > 0 Then
|
||||
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' Dim ObjInv As New ClsInventarios
|
||||
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then
|
||||
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
|
||||
' End If
|
||||
' ObjInv.Dispose()
|
||||
' GvVerSeccionesAlmacen.DataBind()
|
||||
' UpVerSeccionesAlmacen.Update()
|
||||
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
|
||||
'End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "DIVIDIR"
|
||||
|
||||
|
||||
Protected Sub Dividir(sender As Object, e As EventArgs)
|
||||
Dim index2 As Integer = 0
|
||||
|
||||
@@ -3901,11 +3930,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
index2 += 1
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GUIAS - SABE QUE ES PORQUE NO VEO QUE SE UTILIZE EN ALGUNA PARTE - EN MIRAS DE ELIMINAR - IPP 24 AGOSTO 2017 "
|
||||
Private Sub BtnNumeroGuia_Click(sender As Object, e As EventArgs) Handles BtnNumeroGuia.Click
|
||||
Dim Objeto As New ClsInventarios
|
||||
@@ -3939,11 +3968,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "SUGERENCIAS"
|
||||
|
||||
|
||||
Protected Sub BtnVerSugerencias_Click(sender As Object, e As EventArgs)
|
||||
If Not CveVentaSurtir > 0 Then
|
||||
Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
||||
@@ -4043,12 +4072,12 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepEntregaAlmacenSugerencia.rdlc", DtDatosSugerencias, params, "Equipo GPS")
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "TipoEntrega"
|
||||
|
||||
|
||||
Protected Sub EntregaRadioGroup_Click(sender As Object, e As EventArgs)
|
||||
If RbEntregaExterna.Checked Then
|
||||
RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveVenta={CveVentaSurtir}',800,547,'N')")
|
||||
@@ -4075,9 +4104,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
ElseIf RbEntregaInterna.Checked Then
|
||||
'RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Cliente entrega personal"
|
||||
Private Sub ClienteEntregaPersonal(CveCliente As Integer)
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
@@ -4092,11 +4121,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
UpClentesPersonalEntrega.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "sugerir caducidad"
|
||||
|
||||
|
||||
Private Sub SugiereLoteCaducidad(CveAlmacen As Integer)
|
||||
Dim TempDT As New DataTable
|
||||
Dim DtLotesCaducidad As New DataTable
|
||||
@@ -4228,16 +4257,42 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function CierreOS(CveOSCerrar As Integer) As Boolean
|
||||
Private Function CierreOS(CveOSCerrar As Integer, CveMovimientoGenerado As Integer, ByRef TransaccionSql As SqlTransaction) As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = True
|
||||
|
||||
Dim CveOSEstatusFinalizada As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 4").ToEntero
|
||||
|
||||
If CveOSEstatusFinalizada > 0 Then
|
||||
Dim ObjOS As New ClsOS()
|
||||
|
||||
Dim ObjOS As New ClsOS(TransaccionSql)
|
||||
|
||||
Respuesta = ObjOS.UpdateOrdenesServiciosEstatus(CveOSEstatusFinalizada, UsuarioActual.CveUsuario, CveOSCerrar)
|
||||
ObjOS.Dispose()
|
||||
|
||||
If Respuesta Then
|
||||
|
||||
Dim ObjInventario As New ClsInventarios(ObjOS.IniciaTransacSQL)
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
|
||||
Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero()
|
||||
Dim Cantidad As Decimal = Dr("Cantidad").ToString().ToDecimal
|
||||
|
||||
If CveVentaDetalle > 0 Then
|
||||
If Not ObjInventario.UpdatePedidoDetalleCantidad(CveVentaDetalle, Cantidad) Then
|
||||
Respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
Respuesta = False
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("No se pudo obtener el estado para finalizar la orden de servicio.")
|
||||
Respuesta = False
|
||||
|
||||
Reference in New Issue
Block a user