diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 2d65de231..7ee0047d9 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1,345 +1,344 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports System.Data.SqlClient -Imports Extensiones - -Public Class ClsInventarios - Implements IDisposable - -#Region " CAMPOS " - 'SQL - Private SqlConexion As SqlConnection - Private SqlAdapter As SqlDataAdapter - Private SqlTransacc As SqlTransaction - Private Data As DataTable - - Private disposedValue As Boolean = False ' Para detectar llamadas redundantes - 'REGISTRAR CONEXIONES ABIERTAS - Private CveConexion As Integer = 0 - - -#End Region - - Public Function IniciaTransacSQL() As SqlTransaction - If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() - Return SqlTransacc - End Function - - Public Sub RollBack() - If SqlTransacc.Connection IsNot Nothing Then SqlTransacc.Rollback() - End Sub - - Public Sub Commit() - If SqlTransacc.Connection IsNot Nothing Then SqlTransacc.Commit() - End Sub - -#Region " PROPIEDADES " - - Public Property Fecha As Date - Public Property FechaHora As DateTime - Public Property FechaRegistro As Date - Public Property CveMovimiento As Integer - Public Property CveMovimientoDetalle As Integer - Public Property CveSucursal As Integer - Public Property CveAlmacenDestino As Integer - Public Property CveAlmacen As Integer - Public Property Almacen As String - Public Property CveConcepto As Integer - Public Property CveMoneda As Integer - Public Property Moneda As String - Public Property CveSeccion As Integer - Public Property FechaI As String - Public Property FechaF As String - Public Property Sucursal As String - Public Property AlmacenDestino As String - Public Property Estatus As String - Public Property InventarioFisico As String - Public Property Observaciones As String - Public Property Recibio As String - Public Property CveMovimientoRelacionado As Integer - Public Property FolioRelacionado As Integer - Public Property TieneRelacionado As Integer - Public Property ConceptoRelacionado As String - Public Property Folio As Integer - Public Property IDPoliza As Integer - Public Property CvePrePoliza As Integer - Public Property CveCompra As Integer - Public Property EstatusAlmacenCompra As Integer - Public Property CveConsignacion As Integer - Public Property CveVenta As Integer - Public Property TipoEstatus As Integer - Public Property EsDevolucionVenta As Integer - Public Property CvePersonal As Integer - Public Property NombreCompleto As String - Public Property NombreCapturo As String - Public Property CveActivoFijo As Integer - Public Property CodigoAF As Integer - Public Property CveSubProyecto As Integer - Public Property CveSubProyectoInventario As Integer - Public Property SubProyecto As String - Public Property SubProyectoInventario As String - Public Property SerieLote As String - Public Property Guia As String - Public Property TipoCambio As Double - Public Property FolioVenta As String - Public Property CveOrdenCompra As Integer - Public Property CveOrdenCompraLiga As Integer - Public Property FolioOC As String - Public Property CvePS As Integer - Public Property CveEntregaForanea As Integer - Public Property CvePaqueteriaGuia As Integer - Public Property CveInventarioFisico As Integer - Public Property FolioInterno As String - Public Property CveTraspasoSolicitud As Integer - Public Property CveGrupoPS As Integer - Public Property CveFlete As Integer - Public Property CveCliente As Integer +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.Data.SqlClient +Imports Extensiones + +Public Class ClsInventarios + Implements IDisposable + +#Region " CAMPOS " + 'SQL + Private SqlConexion As SqlConnection + Private SqlAdapter As SqlDataAdapter + Private SqlTransacc As SqlTransaction + Private Data As DataTable + + Private disposedValue As Boolean = False ' Para detectar llamadas redundantes + 'REGISTRAR CONEXIONES ABIERTAS + Private CveConexion As Integer = 0 + + +#End Region + + Public Function IniciaTransacSQL() As SqlTransaction + If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() + Return SqlTransacc + End Function + + Public Sub RollBack() + If SqlTransacc.Connection IsNot Nothing Then SqlTransacc.Rollback() + End Sub + + Public Sub Commit() + If SqlTransacc.Connection IsNot Nothing Then SqlTransacc.Commit() + End Sub + +#Region " PROPIEDADES " + + Public Property Fecha As Date + Public Property FechaHora As DateTime + Public Property FechaRegistro As Date + Public Property CveMovimiento As Integer + Public Property CveMovimientoDetalle As Integer + Public Property CveSucursal As Integer + Public Property CveAlmacenDestino As Integer + Public Property CveAlmacen As Integer + Public Property Almacen As String + Public Property CveConcepto As Integer + Public Property CveMoneda As Integer + Public Property Moneda As String + Public Property CveSeccion As Integer + Public Property FechaI As String + Public Property FechaF As String + Public Property Sucursal As String + Public Property AlmacenDestino As String + Public Property Estatus As String + Public Property InventarioFisico As String + Public Property Observaciones As String + Public Property Recibio As String + Public Property CveMovimientoRelacionado As Integer + Public Property FolioRelacionado As Integer + Public Property TieneRelacionado As Integer + Public Property ConceptoRelacionado As String + Public Property Folio As Integer + Public Property IDPoliza As Integer + Public Property CvePrePoliza As Integer + Public Property CveCompra As Integer + Public Property EstatusAlmacenCompra As Integer + Public Property CveConsignacion As Integer + Public Property CveVenta As Integer + Public Property TipoEstatus As Integer + Public Property EsDevolucionVenta As Integer + Public Property CvePersonal As Integer + Public Property NombreCompleto As String + Public Property NombreCapturo As String + Public Property CveActivoFijo As Integer + Public Property CodigoAF As Integer + Public Property CveSubProyecto As Integer + Public Property CveSubProyectoInventario As Integer + Public Property SubProyecto As String + Public Property SubProyectoInventario As String + Public Property SerieLote As String + Public Property Guia As String + Public Property TipoCambio As Double + Public Property FolioVenta As String + Public Property CveOrdenCompra As Integer + Public Property CveOrdenCompraLiga As Integer + Public Property FolioOC As String + Public Property CvePS As Integer + Public Property CveEntregaForanea As Integer + Public Property CvePaqueteriaGuia As Integer + Public Property CveInventarioFisico As Integer + Public Property FolioInterno As String + Public Property CveTraspasoSolicitud As Integer + Public Property CveGrupoPS As Integer + Public Property CveFlete As Integer + Public Property CveCliente As Integer Public Property CveClienteSucursal As Integer - Public Property NombreCliente As String - Public Property DepartamentoEntrega As String - Public Property PedidoContrato As String - Public Property GastoIndirecto As Double - Public Property TienePrePoliza As Integer - Public Property RazonSocialOC As String - Public Property Remision As String - Public Property Proveedor As String - Public Property CalleOrigen As String - Public Property NoExtOrigen As String - Public Property ColoniaOrigen As String - Public Property LocalidadOrigen As String - Public Property MunicipioOrigen As String - Public Property EstadoOrigen As String - Public Property PaisOrigen As String - Public Property CPOrigen As String - Public Property CalleDestino As String - Public Property NoExtDestino As String - Public Property ColoniaDestino As String - Public Property LocalidadDestino As String - Public Property MunicipioDestino As String - Public Property EstadoDestino As String - Public Property PaisDestino As String - Public Property CPDestino As String - Public Property PuestoRecibio As String - Public Property PuestoEntrego As String - Public Property CveRemanufactura As Integer - Public Property ResponsableCarga As String - Public Property ResponsableRecibio As String - - - - Public ReadOnly Property DtResultados() As DataTable - Get - DtResultados = Data - End Get - End Property - -#End Region - - Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) - - If TransaccionCompartida Is Nothing Then - SqlConexion = New SqlConnection - SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString - Try - SqlConexion.Open() - Catch ex As Exception - OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) - End Try - Else - SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida - End If - - SqlAdapter = New SqlDataAdapter("", SqlConexion) - ConexionAdd() - End Sub - - Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) - With SqlAdapter.SelectCommand - .Parameters.Clear() - .CommandText = pStrSQL - .CommandType = TipoComando - End With - If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc - Data = New DataTable - End Sub -#Region "Conexiones" - - Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then - Try - DataAdapter("PA_Sis_RegistrarConexion") - With SqlAdapter.SelectCommand.Parameters - .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name - .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) - .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output - End With - SqlAdapter.Fill(Data) - CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero - Catch ex As Exception - OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - End If - End Sub - - Private Sub ConexionClose() - If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then - - DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text) - - Try - SqlAdapter.Fill(Data) - - Catch ex As Exception - OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - CveConexion = 0 - End If - - End Sub -#End Region - -#Region " INVENTARIOS - CONCEPTOS " - - Public Function GetConceptos() As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ConceptosGet") - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de conceptos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - -#End Region - -#Region " INVENTARIOS - ALMACENES " - - Public Function AddAlmacen2(Almacen As String, CveSucursal As Integer, CveTipoAlmacen As Integer, CveSeccion As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_INV_AlmacenAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Almacen", SqlDbType.VarChar).Value = Almacen - .Add("@CveSucursal", SqlDbType.Int).Value = CveSucursal - .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@CveSeccion", SqlDbType.Int).Value = CveSeccion - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("Ya existe un Almacén con el mismo nombre: " & Almacen & ".", TipoMensaje.MsgAdvertencia) - Else - Me.OnError("Ocurrió un error al Guardar el Almacén.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End If - Catch ex As Exception - OnError("Ocurrió un error al Guardar el Almacén", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function UpdateAlmacen2(CveAlmacen As Integer, Almacen As String, CveSucursal As Integer, CveTipoAlmacen As Integer, CveSeccion As Integer, Estatus As Boolean) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_INV_AlmacenUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@Almacen", SqlDbType.VarChar).Value = Almacen - .Add("@CveSucursal", SqlDbType.Int).Value = CveSucursal - .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@CveSeccion", SqlDbType.Int).Value = CveSeccion - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("Ya existe un Almacén con el mismo nombre: " & Almacen & ".", TipoMensaje.MsgAdvertencia) - Else - Me.OnError("Ocurrió un error al guardar los cambios en el Almacén", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End If - Catch ex As Exception - OnError("Ocurrió un error al guardar los cambios en el Almacén.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetAlmacenes(CveTipoAlmacen As Integer, Modalidad As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_AlmacenesGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@Modalidad", SqlDbType.Int).Value = Modalidad - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function + Public Property DepartamentoEntrega As String + Public Property PedidoContrato As String + Public Property GastoIndirecto As Double + Public Property TienePrePoliza As Integer + Public Property RazonSocialOC As String + Public Property Remision As String + Public Property Proveedor As String + Public Property CalleOrigen As String + Public Property NoExtOrigen As String + Public Property ColoniaOrigen As String + Public Property LocalidadOrigen As String + Public Property MunicipioOrigen As String + Public Property EstadoOrigen As String + Public Property PaisOrigen As String + Public Property CPOrigen As String + Public Property CalleDestino As String + Public Property NoExtDestino As String + Public Property ColoniaDestino As String + Public Property LocalidadDestino As String + Public Property MunicipioDestino As String + Public Property EstadoDestino As String + Public Property PaisDestino As String + Public Property CPDestino As String + Public Property PuestoRecibio As String + Public Property PuestoEntrego As String + Public Property CveRemanufactura As Integer + Public Property ResponsableCarga As String + Public Property ResponsableRecibio As String + + + + Public ReadOnly Property DtResultados() As DataTable + Get + DtResultados = Data + End Get + End Property + +#End Region + + Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) + + If TransaccionCompartida Is Nothing Then + SqlConexion = New SqlConnection + SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString + Try + SqlConexion.Open() + Catch ex As Exception + OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) + End Try + Else + SqlConexion = TransaccionCompartida.Connection + SqlTransacc = TransaccionCompartida + End If + + SqlAdapter = New SqlDataAdapter("", SqlConexion) + ConexionAdd() + End Sub + + Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) + With SqlAdapter.SelectCommand + .Parameters.Clear() + .CommandText = pStrSQL + .CommandType = TipoComando + End With + If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc + Data = New DataTable + End Sub +#Region "Conexiones" + + Private Sub ConexionAdd() + If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + Try + DataAdapter("PA_Sis_RegistrarConexion") + With SqlAdapter.SelectCommand.Parameters + .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name + .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) + .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output + End With + SqlAdapter.Fill(Data) + CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero + Catch ex As Exception + OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + End If + End Sub + + Private Sub ConexionClose() + If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + + DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text) + + Try + SqlAdapter.Fill(Data) + + Catch ex As Exception + OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + CveConexion = 0 + End If + + End Sub +#End Region + +#Region " INVENTARIOS - CONCEPTOS " + + Public Function GetConceptos() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ConceptosGet") + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de conceptos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + +#Region " INVENTARIOS - ALMACENES " + + Public Function AddAlmacen2(Almacen As String, CveSucursal As Integer, CveTipoAlmacen As Integer, CveSeccion As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_INV_AlmacenAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Almacen", SqlDbType.VarChar).Value = Almacen + .Add("@CveSucursal", SqlDbType.Int).Value = CveSucursal + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@CveSeccion", SqlDbType.Int).Value = CveSeccion + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya existe un Almacén con el mismo nombre: " & Almacen & ".", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al Guardar el Almacén.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al Guardar el Almacén", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateAlmacen2(CveAlmacen As Integer, Almacen As String, CveSucursal As Integer, CveTipoAlmacen As Integer, CveSeccion As Integer, Estatus As Boolean) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_INV_AlmacenUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@Almacen", SqlDbType.VarChar).Value = Almacen + .Add("@CveSucursal", SqlDbType.Int).Value = CveSucursal + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@CveSeccion", SqlDbType.Int).Value = CveSeccion + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya existe un Almacén con el mismo nombre: " & Almacen & ".", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar los cambios en el Almacén", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar los cambios en el Almacén.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetAlmacenes(CveTipoAlmacen As Integer, Modalidad As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@Modalidad", SqlDbType.Int).Value = Modalidad + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function Public Function GetRepAlmacenes(FechaInicio As String, FechaFin As String, CveEmpresa As Integer, CveTipoAlmacen As String, Contabilizable As Integer, Inventariable As Boolean, - Optional SoloMovimientosContables As Boolean = False, Optional Almacenes As String = "-1", Optional CveSubProyecto As Integer = -1, - Optional CveUsuarioConsulta As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_AlmacenesRepGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@FechaI", SqlDbType.VarChar).Value = FechaInicio - .Add("@FechaF", SqlDbType.VarChar).Value = FechaFin - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveTipoAlmacen", SqlDbType.VarChar).Value = CveTipoAlmacen - .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable - .Add("@SoloMovimientosContables", SqlDbType.Bit).Value = SoloMovimientosContables + Optional SoloMovimientosContables As Boolean = False, Optional Almacenes As String = "-1", Optional CveSubProyecto As Integer = -1, + Optional CveUsuarioConsulta As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenesRepGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.VarChar).Value = FechaInicio + .Add("@FechaF", SqlDbType.VarChar).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveTipoAlmacen", SqlDbType.VarChar).Value = CveTipoAlmacen + .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable + .Add("@SoloMovimientosContables", SqlDbType.Bit).Value = SoloMovimientosContables .Add("@Modalidad", SqlDbType.Int).Value = Contabilizable .Add("@Almacenes", SqlDbType.VarChar).Value = Almacenes .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetRepAlmacenesPeriodo(FechaCorte As Date, CveEmpresa As Integer, CveTipoAlmacen As String, Contabilizable As Integer, Inventariable As Boolean, VerEn As Integer, - Optional Almacenes As String = "-1", Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_AlmacenesPeriodoRepGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveTipoAlmacen", SqlDbType.VarChar).Value = CveTipoAlmacen - .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable - .Add("@Modalidad", SqlDbType.Int).Value = Contabilizable - .Add("@VerEn", SqlDbType.Int).Value = VerEn + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetRepAlmacenesPeriodo(FechaCorte As Date, CveEmpresa As Integer, CveTipoAlmacen As String, Contabilizable As Integer, Inventariable As Boolean, VerEn As Integer, + Optional Almacenes As String = "-1", Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenesPeriodoRepGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveTipoAlmacen", SqlDbType.VarChar).Value = CveTipoAlmacen + .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable + .Add("@Modalidad", SqlDbType.Int).Value = Contabilizable + .Add("@VerEn", SqlDbType.Int).Value = VerEn .Add("@Almacenes", SqlDbType.VarChar).Value = Almacenes .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta @@ -443,10 +442,10 @@ Public Class ClsInventarios End Try Return Retorno - End Function - + End Function + #Region " TIPO ALMACEN " - + Public Function UpdateTipoAlmacen(CveTipoAlmacen As Integer, TipoAlmacen As String, Estatus As Boolean) As Boolean Dim Retorno As Boolean = False @@ -562,9 +561,9 @@ Public Class ClsInventarios End Try Return Retorno - End Function + End Function #End Region - + #Region " SECCIONES ALMACENES " Public Function GetSeccionesAlmacenes() As Boolean Dim Retorno As Boolean = False @@ -695,9 +694,9 @@ Public Class ClsInventarios End Try Return Retorno - End Function + End Function #End Region - + Public Function GetSucursalesAlmacenUsuario(CveUsuario As Integer, CveEmpresa As Integer) As Boolean 'ME TRAE LAS SUCURSALES DE LOS ALMACENES QUE TIENE ASIGNADOS EL USUARIO Dim Retorno As Boolean = False @@ -715,12 +714,12 @@ Public Class ClsInventarios End Try Return Retorno - End Function - + End Function + #End Region - + #Region " INVENTARIOS - MOVIMIENTOS (DETALLE) " - + Public Function GetQuery(Consulta As String) As Boolean Dim Retorno As Boolean = False DataAdapter(Consulta, CommandType.Text) @@ -1484,7 +1483,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1") As Boolean + Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional AgruparAlmacen As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_KardexGet") @@ -1501,7 +1500,6 @@ Public Class ClsInventarios .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@AgruparAlmacen", SqlDbType.Bit).Value = AgruparAlmacen - .Add("@Serie", SqlDbType.VarChar).Value = Serie End With Try @@ -1711,3109 +1709,3109 @@ Public Class ClsInventarios Return Retorno End Function - Public Function RepTraspasoAlmacen(FechaI As Date, FechaF As Date, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RepTraspasoAlmacen") - + Public Function RepTraspasoAlmacen(FechaI As Date, FechaF As Date, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RepTraspasoAlmacen") + With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen - .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino - .Add("@Recibido", SqlDbType.Bit).Value = Recibido - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Reporte de Traspaso de Almacén.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen + .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino + .Add("@Recibido", SqlDbType.Bit).Value = Recibido + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Reporte de Traspaso de Almacén.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno End Function -#End Region +#End Region -#Region " INVENTARIOS - EXISTENCIAS " - Public Function GetExistenciasPS(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, - CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, - Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, - Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", - Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Decimal - Dim Retorno As Decimal = -1 - - If FechaMovto = "-1" Then - FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) - End If - - DataAdapter("PA_Inv_ExistenciasPSGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen - .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) - .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@Lote", SqlDbType.VarChar).Value = Lote - .Add("@Batch", SqlDbType.VarChar).Value = Batch - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado - .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir - .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados - .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes - - .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output - .Add("@CvePSRetorno", SqlDbType.Int).Direction = ParameterDirection.Output - End With - - Try - SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@Existencia").Value.ToString.ToDecimal() - Me.CvePS = SqlAdapter.SelectCommand.Parameters("@CvePSRetorno").Value.ToString.ToEntero - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function GetExistenciasProducto(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, - CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, - Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, - Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", - Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ExistenciasGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen - .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) - .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@Lote", SqlDbType.VarChar).Value = Lote - .Add("@Batch", SqlDbType.VarChar).Value = Batch - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado - .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir - .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados - .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes - .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las Existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetExistenciasPSSerie(SerieLote As String, CveAlmacen As Integer, CveEmpresa As Integer, Optional FechaMovto As String = "-1") As Decimal - - If SerieLote = "" Then Return 0 - - Dim Retorno As Decimal = 0 - If FechaMovto = "-1" Then - FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) - End If - - DataAdapter("PA_Inv_ExistenciasPSSerieGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - ' .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) - - .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output - .Add("@CvePS", SqlDbType.Int).Direction = ParameterDirection.Output - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@Existencia").Value.ToString.ToDecimal - CvePS = SqlAdapter.SelectCommand.Parameters("@CvePS").Value.ToString.ToEntero - Catch Ex1 As SqlException - - Me.OnError("Ocurrió un error al obtener las existencias.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - Catch ex As Exception - OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - - End Function - Public Function GetCostoPSSerie(CvePS As Integer, SerieLote As String, CveAlmacen As Integer, CveEmpresa As Integer) As Decimal - Dim Retorno As Decimal = 0 - DataAdapter("PA_Inv_CostoPSSerieGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@Costo", SqlDbType.Money).Direction = ParameterDirection.Output - End With - - Try - SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@Costo").Value.ToString.ToDecimal - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener las existencias.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetExistenciasAlmacenDT(CveOrdenCompra As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ExistenciasDTGET") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las existencias de los almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_ProductosServiciosInventario") - With SqlAdapter.SelectCommand.Parameters - .Add("@PS", SqlDbType.VarChar).Value = PS - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@AplicaParaVenta", SqlDbType.Int).Value = AplicaParaVenta - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - - End Function - - Public Function GetExistenciasPSEmpaque(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, - CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, - Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, - Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", - Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - If FechaMovto = "-1" Then - FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) - End If - - DataAdapter("PA_Inv_ExistenciasPSEmpaqueGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen - .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) - .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@Lote", SqlDbType.VarChar).Value = Lote - .Add("@Batch", SqlDbType.VarChar).Value = Batch - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado - .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir - .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados - .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function GetExistenciasPSXML(XML As String, CveAlmacen As Integer, Fecha As String, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, ExcluyeApartados As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno = False - - If Fecha = "-1" Then - Fecha = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) - End If - - DataAdapter("PA_Inv_ExistenciasPSXMLGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@XML", SqlDbType.Xml).Value = XML - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@Fecha", SqlDbType.DateTime).Value = DateTime.ParseExact(Fecha, "yyyy/MM/dd HH:mm", Nothing) - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de vericar la existencia de los productos por xml.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno +#Region " INVENTARIOS - EXISTENCIAS " + Public Function GetExistenciasPS(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, + CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, + Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Decimal + Dim Retorno As Decimal = -1 + + If FechaMovto = "-1" Then + FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) + End If + + DataAdapter("PA_Inv_ExistenciasPSGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) + .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote + .Add("@Lote", SqlDbType.VarChar).Value = Lote + .Add("@Batch", SqlDbType.VarChar).Value = Batch + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado + .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir + .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados + .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes + + .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output + .Add("@CvePSRetorno", SqlDbType.Int).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + Retorno = SqlAdapter.SelectCommand.Parameters("@Existencia").Value.ToString.ToDecimal() + Me.CvePS = SqlAdapter.SelectCommand.Parameters("@CvePSRetorno").Value.ToString.ToEntero + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno End Function -#End Region + Public Function GetExistenciasProducto(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, + CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, + Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ExistenciasGet") -#Region " INVENTARIOS - INVENTARIO FISICO " + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) + .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote + .Add("@Lote", SqlDbType.VarChar).Value = Lote + .Add("@Batch", SqlDbType.VarChar).Value = Batch + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado + .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir + .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados + .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes + .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try - Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@InventarioFisico", SqlDbType.VarChar).Value = InventarioFisico - .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones - .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@CveInventarioFisico", SqlDbType.Int).Direction = ParameterDirection.Output - End With - - Try - - SqlAdapter.Fill(Data) - CveInventarioFisico = SqlAdapter.SelectCommand.Parameters("@CveInventarioFisico").Value.ToString.ToEntero - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar el Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function UpdateInventarioFisico(CveInventarioFisico As Integer, InventarioFisico As String, Observaciones As String, - CveSubProyecto As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_InventarioFisicoUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@InventarioFisico", SqlDbType.VarChar).Value = InventarioFisico - .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al modificar el Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al modificar el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function UpdateInventarioFisicoEstatus(CveInventarioFisico As Integer, CveEstatus As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_InventarioFisicoUpdateEstatus") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al actualizar estatus del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al actualizar estatus del Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetInventarioFisico(CveInventarioFisico As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Estado As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@Estado", SqlDbType.Int).Value = Estado - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - If Data IsNot Nothing AndAlso Data.Rows.Count >= 1 Then - Dim dr As DataRow = Data.Rows(0) - InventarioFisico = dr("InventarioFisico").ToString - Observaciones = dr("Observaciones").ToString - CveSubProyectoInventario = dr("CveSubProyecto").ToString.ToEntero - SubProyectoInventario = dr("SubProyecto").ToString - FechaI = dr("FechaInicio").ToString - FechaF = dr("FechaFin").ToString - Estatus = dr("Estatus").ToString - Retorno = True - End If - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener el Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveInventarioFisico(CveInventarioFisico As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("El inventario fisico se encuentra actualmente en uso.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al Eliminar el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function AddInventarioFisicoClasificaciones(CveInventarioFisico As Integer, CveClasificacion As Integer, CveUsuario As Integer, Incluye As Boolean) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoClasificacionesAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Incluye", SqlDbType.Bit).Value = Incluye - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveInventarioFisicoAlamacen(CveInventarioFisico As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoAlmacenesRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al eliminar el almacen del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al eliminar el almacen del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - - Public Function RemoveInventarioFisicoClasificacion(CveInventarioFisico As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoClasificacionesRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al eliminar la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al eliminar la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - - Public Function AddInventarioFisico(CveInventarioFisico As Integer, CveClasificacion As Integer, CveUsuario As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoClasificacionesAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function AddInventarioFisicoProductosServicios(CveInventarioFisico As Integer, CvePS As Integer, Incluye As Boolean) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoProductosServiciosAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Incluye", SqlDbType.Bit).Value = If(Incluye, 1, 0) - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar el producto del servicio del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar el producto del servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - - Public Function RemoveInventarioFisicoProductosServicios(CveInventarioFisico As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoProductosServiciosRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al eliminar el producto del servicio del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al eliminar el producto del servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - - Public Function AddInventarioFisicoAlmacenes(CveInventarioFisico As Integer, CveAlmacen As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoAlmacenesAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al agregar elalmacen del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al agregar elalmacen del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetInventarioFisicoDetallesAlmacen(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoDetallesAlmacenGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetInventarioFisicoDetallesClasificacion(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoDetallesClasificacionGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetInventarioFisicoDetallesProductosServicios(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoDetallesProductosServiciosGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - -#Region "I N V E N T A R I O - F I S I C O - D E T A L L E" - - Public Function UpdateInventarioFisicoDetalles(CveInventarioFisicoDetalle As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_InventarioFisicoDetalleUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisicoDetalle", SqlDbType.Int).Value = CveInventarioFisicoDetalle - .Add("@CveUM", SqlDbType.Int).Value = CveUM - .Add("@Cantidad", SqlDbType.Money).Value = Cantidad - .Add("@CvePS", SqlDbType.Int).Value = CvePS - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al Actualizar los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al Actualizar los detalles del Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function AddInventarioFisicoDetalle(CveInventarioFisico As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double, SerieLote As String, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_InventarioFisicoDetalleAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveUM", SqlDbType.Int).Value = CveUM - .Add("@Cantidad", SqlDbType.Money).Value = Cantidad - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Estatus", SqlDbType.Int).Direction = ParameterDirection.Output - End With - - Try - SqlAdapter.Fill(Data) - - If SqlAdapter.SelectCommand.Parameters("@Estatus").Value.ToString.ToEntero = 1 Then - Retorno = True - ElseIf SqlAdapter.SelectCommand.Parameters("@Estatus").Value.ToString.ToEntero = 2 Then - Retorno = False - Alert($"Ya existe la Serie {SerieLote} en el inventario actual.", TipoMensaje.MsgAdvertencia) - End If - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al Guardar los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al Guardar los detalles del Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveInventarioFisicoDetalles(CveInventarioFisicoDetalle As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_InventarioFisicoDetalleRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisicoDetalle", SqlDbType.Int).Value = CveInventarioFisicoDetalle - - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - - Me.OnError("Ocurrió un error al remover los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - Catch ex As Exception - OnError("Ocurrió un error al remover los detalles del Inventario Físico", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetInventarioFisicoDetalle(CveInventarioFisico As Integer, CveUsuario As Integer, Optional Agrupar As Boolean = False) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_InventarioFisicoDetalleGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + Return Retorno + End Function + Public Function GetExistenciasPSSerie(SerieLote As String, CveAlmacen As Integer, CveEmpresa As Integer, Optional FechaMovto As String = "-1") As Decimal + + If SerieLote = "" Then Return 0 + + Dim Retorno As Decimal = 0 + If FechaMovto = "-1" Then + FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) + End If + + DataAdapter("PA_Inv_ExistenciasPSSerieGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + ' .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) + + .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output + .Add("@CvePS", SqlDbType.Int).Direction = ParameterDirection.Output + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = SqlAdapter.SelectCommand.Parameters("@Existencia").Value.ToString.ToDecimal + CvePS = SqlAdapter.SelectCommand.Parameters("@CvePS").Value.ToString.ToEntero + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al obtener las existencias.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + Public Function GetCostoPSSerie(CvePS As Integer, SerieLote As String, CveAlmacen As Integer, CveEmpresa As Integer) As Decimal + Dim Retorno As Decimal = 0 + DataAdapter("PA_Inv_CostoPSSerieGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@Costo", SqlDbType.Money).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + Retorno = SqlAdapter.SelectCommand.Parameters("@Costo").Value.ToString.ToDecimal + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener las existencias.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetExistenciasAlmacenDT(CveOrdenCompra As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ExistenciasDTGET") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las existencias de los almacenes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_ProductosServiciosInventario") + With SqlAdapter.SelectCommand.Parameters + .Add("@PS", SqlDbType.VarChar).Value = PS + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@AplicaParaVenta", SqlDbType.Int).Value = AplicaParaVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + + End Function + + Public Function GetExistenciasPSEmpaque(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, + CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, + Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + If FechaMovto = "-1" Then + FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) + End If + + DataAdapter("PA_Inv_ExistenciasPSEmpaqueGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) + .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote + .Add("@Lote", SqlDbType.VarChar).Value = Lote + .Add("@Batch", SqlDbType.VarChar).Value = Batch + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado + .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir + .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados + .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetExistenciasPSXML(XML As String, CveAlmacen As Integer, Fecha As String, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, ExcluyeApartados As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + If Fecha = "-1" Then + Fecha = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) + End If + + DataAdapter("PA_Inv_ExistenciasPSXMLGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@XML", SqlDbType.Xml).Value = XML + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@Fecha", SqlDbType.DateTime).Value = DateTime.ParseExact(Fecha, "yyyy/MM/dd HH:mm", Nothing) + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Agrupar", SqlDbType.Bit).Value = Agrupar - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - - Me.OnError("Ocurrió un error al Obtener los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - Catch ex As Exception - OnError("Ocurrió un error al Obtener los detalles del Inventario Físico", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de vericar la existencia de los productos por xml.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - INVENTARIO FISICO " + + Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@InventarioFisico", SqlDbType.VarChar).Value = InventarioFisico + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveInventarioFisico", SqlDbType.Int).Direction = ParameterDirection.Output + End With + + Try + + SqlAdapter.Fill(Data) + CveInventarioFisico = SqlAdapter.SelectCommand.Parameters("@CveInventarioFisico").Value.ToString.ToEntero + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar el Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno End Function - Public Function GetInventarioFisicoContador(CveInventarioFisico As Integer, CveUsuario As Integer, CodigoBarras As String) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_InventarioFisicoContadorGET") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras + Public Function UpdateInventarioFisico(CveInventarioFisico As Integer, InventarioFisico As String, Observaciones As String, + CveSubProyecto As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@InventarioFisico", SqlDbType.VarChar).Value = InventarioFisico + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al modificar el Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al modificar el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateInventarioFisicoEstatus(CveInventarioFisico As Integer, CveEstatus As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoUpdateEstatus") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al actualizar estatus del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al actualizar estatus del Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetInventarioFisico(CveInventarioFisico As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Estado As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Estado", SqlDbType.Int).Value = Estado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + If Data IsNot Nothing AndAlso Data.Rows.Count >= 1 Then + Dim dr As DataRow = Data.Rows(0) + InventarioFisico = dr("InventarioFisico").ToString + Observaciones = dr("Observaciones").ToString + CveSubProyectoInventario = dr("CveSubProyecto").ToString.ToEntero + SubProyectoInventario = dr("SubProyecto").ToString + FechaI = dr("FechaInicio").ToString + FechaF = dr("FechaFin").ToString + Estatus = dr("Estatus").ToString + Retorno = True + End If + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener el Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveInventarioFisico(CveInventarioFisico As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("El inventario fisico se encuentra actualmente en uso.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al Eliminar el Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddInventarioFisicoClasificaciones(CveInventarioFisico As Integer, CveClasificacion As Integer, CveUsuario As Integer, Incluye As Boolean) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoClasificacionesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - - Me.OnError("Ocurrió un error al Obtener los detalles del Inventario Físico(Contador).", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - Catch ex As Exception - OnError("Ocurrió un error al Obtener los detalles del Inventario Físico(Contador).", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function -#End Region + .Add("@Incluye", SqlDbType.Bit).Value = Incluye + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveInventarioFisicoAlamacen(CveInventarioFisico As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoAlmacenesRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar el almacen del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar el almacen del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function RemoveInventarioFisicoClasificacion(CveInventarioFisico As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoClasificacionesRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function AddInventarioFisico(CveInventarioFisico As Integer, CveClasificacion As Integer, CveUsuario As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoClasificacionesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddInventarioFisicoProductosServicios(CveInventarioFisico As Integer, CvePS As Integer, Incluye As Boolean) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoProductosServiciosAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Incluye", SqlDbType.Bit).Value = If(Incluye, 1, 0) + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar el producto del servicio del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar el producto del servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function RemoveInventarioFisicoProductosServicios(CveInventarioFisico As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoProductosServiciosRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar el producto del servicio del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar el producto del servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function AddInventarioFisicoAlmacenes(CveInventarioFisico As Integer, CveAlmacen As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoAlmacenesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al agregar elalmacen del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al agregar elalmacen del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetInventarioFisicoDetallesAlmacen(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoDetallesAlmacenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetInventarioFisicoDetallesClasificacion(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoDetallesClasificacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetInventarioFisicoDetallesProductosServicios(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoDetallesProductosServiciosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener la clasificacion del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + +#Region "I N V E N T A R I O - F I S I C O - D E T A L L E" + + Public Function UpdateInventarioFisicoDetalles(CveInventarioFisicoDetalle As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoDetalleUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisicoDetalle", SqlDbType.Int).Value = CveInventarioFisicoDetalle + .Add("@CveUM", SqlDbType.Int).Value = CveUM + .Add("@Cantidad", SqlDbType.Money).Value = Cantidad + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al Actualizar los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al Actualizar los detalles del Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddInventarioFisicoDetalle(CveInventarioFisico As Integer, CvePS As Integer, CveUM As Integer, Cantidad As Double, SerieLote As String, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoDetalleAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveUM", SqlDbType.Int).Value = CveUM + .Add("@Cantidad", SqlDbType.Money).Value = Cantidad + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Estatus", SqlDbType.Int).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + + If SqlAdapter.SelectCommand.Parameters("@Estatus").Value.ToString.ToEntero = 1 Then + Retorno = True + ElseIf SqlAdapter.SelectCommand.Parameters("@Estatus").Value.ToString.ToEntero = 2 Then + Retorno = False + Alert($"Ya existe la Serie {SerieLote} en el inventario actual.", TipoMensaje.MsgAdvertencia) + End If + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al Guardar los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al Guardar los detalles del Inventario Físico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveInventarioFisicoDetalles(CveInventarioFisicoDetalle As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoDetalleRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisicoDetalle", SqlDbType.Int).Value = CveInventarioFisicoDetalle + + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al remover los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al remover los detalles del Inventario Físico", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetInventarioFisicoDetalle(CveInventarioFisico As Integer, CveUsuario As Integer, Optional Agrupar As Boolean = False) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoDetalleGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Agrupar", SqlDbType.Bit).Value = Agrupar + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al Obtener los detalles del Inventario Físico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al Obtener los detalles del Inventario Físico", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetInventarioFisicoContador(CveInventarioFisico As Integer, CveUsuario As Integer, CodigoBarras As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoContadorGET") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al Obtener los detalles del Inventario Físico(Contador).", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al Obtener los detalles del Inventario Físico(Contador).", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + +#Region "I N V E N T A R I O - F I S I C O - R E S U L T A D O" + Public Function AddInventarioFisicoResultados(CveInventarioFisico As Integer, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoResultadoAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el Inventario Fisico Resultado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetInventarioFisicoResultados(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoResultadosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Inventario Fisico Avance", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetInventarioFisicoResultadosAvance(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoResultadoAvance") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Inventario Fisico Avance", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + + Public Function RepAnomalias(CveInventarioFisico As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ReporteAnomalias") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Reporte de Anomalias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function RepAnomalias2(CveInventarioFisico As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_Rep_AnomaliasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de anomalias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + +#End Region + +#Region " INVENTARIOS - MAXIMO MINIMO" + Public Function RepMaximoMinimo(CveSubproyecto As Integer, CveAlmacen As Integer, CveClasificacion2 As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ReporteMaximoMinimo") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2 + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Reporte de Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function RepMaximoMinimoDetalleGet(CveSubProyecto As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ReporteMaximoMinimoDetalle") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los detalles del Reporte de Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddAlmacenMaximoMinimo(CveAlmacen As Integer, CvePS As Integer, Maximo As Double, Minimo As Double, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenesMaximoMinimoAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Maximo", SqlDbType.Money).Value = Maximo + .Add("@Minimo", SqlDbType.Money).Value = Minimo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al guardar Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateAlmacenMaximoMinimo(CveAlmacen As Integer, CvePS As Integer, Maximo As Double, Minimo As Double, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenesMaximoMinimoUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Maximo", SqlDbType.Money).Value = Maximo + .Add("@Minimo", SqlDbType.Money).Value = Minimo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetAlmacenMaximoMinimo(CveAlmacen As Integer, CvePS As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenesMaximoMinimoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - COMPRAS " + + Public Function RecepcionAlmacenGet(CveCompra As Integer, TipoRecepcion As Integer, CveEmpresa As Integer, Optional CveProveedor As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RecepcionAlmacenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@TipoRecepcion", SqlDbType.Int).Value = TipoRecepcion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los artículos de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function ComprasPendientesAlmacenGet(CveProveedor As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ComprasPendientesAlmacenGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las compras pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function ComprasDevolucionExistenciasGet(CveCompras As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ComprasExistenciasDevolucionGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompras + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las existencias de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetInv_ComprasMov(CveCompra As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasMovimientos") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener datos del Almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - VENTAS " + Public Function EntregaAlmacenGet(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_EntregaAlmacenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los artículos de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function VentasPendientesAlmacenGet(CveCliente As Integer, Fecha As Date, CveSubProyecto As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_VentasPendientesAlmacenGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las ventas pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function SerieLoteRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_SerieLoteRecomendadoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la Serie/Lote recomendado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function LoteBatchRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_LoteBatchRecomendadoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Lote-Batch recomendado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function SeccionAlmacenRecomendadoSurtidoGet(CvePS As Integer, Cantidad As Double, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_SeccionAlmacenRecomendadoSurtidoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Cantidad", SqlDbType.Money).Value = Cantidad + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la seccion almacen recomendada para surtir.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function LoteBatchFechaCaducidadGet(CvePS As Integer, Lote As String, Batch As String, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_LoteBatchFechaCaducidadGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Lote", SqlDbType.VarChar).Value = Lote + .Add("@Batch", SqlDbType.VarChar).Value = Batch + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la Fecha Caducidad del Lote-Batch.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function ActualizarEsDevolucionVenta(CveVenta As Integer, Valor As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("Vta_UpdateDevolucionVenta") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@Valor", SqlDbType.Int).Value = Valor + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la devolucion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function LimpiaEntregaDirecta(CveMovimiento As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_LimpiaEntregaDirecta") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al generar la limpieza del movimiento de entrega directa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function EliminaEntregaDirecta(CveMovimiento As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_EliminaEntregaDirecta") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al generar la eliminación del movimiento de entrega directa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function VentaDetallePadreGet(CveVentaDetallePadre As Integer) As Integer + Dim Retorno = -1 + DataAdapter("PA_Inv_VentaDetallePadreGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre + .Add("@CveVentaDetalle", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + Retorno = SqlAdapter.SelectCommand.Parameters("@CveVentaDetalle").Value.ToString.ToEntero + Catch ex As Exception + OnError("Ocurrió un error al obtener la venta detalle padre.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetPendietePorSurtirVenta(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, Optional Tipo As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_VentasPendientesPorSurtirGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@Tipo", SqlDbType.Int).Value = Tipo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener ventas pendientes por surtir.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetEstatusVentaPorSurir(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_EstatusVentaPorSurtirGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + + Try + SqlAdapter.Fill(Data) + + If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then + Dim dr As DataRow = Data.Rows(0) + TipoEstatus = dr("TipoEstatus").ToString.ToEntero + EsDevolucionVenta = dr("EsVentaDevolucion").ToString.ToEntero + Retorno = True + End If + + + Catch ex As Exception + OnError("Ocurrió un error al obtener ventas pendientes por surtir.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + + + Return Retorno + End Function + + Public Function GetInv_Mov(CveVenta As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentaDetalleAlmacen") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener datos del Almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetDevolucionRemisionesFacturadas(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_DevolucionRemisionesFacturadas") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de devolución de remisiones facturadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetDevolucionRemisionesCanceladas(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_DevolucionRemisionCanceladas") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de devolución de remisiones canceladas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - CONSIGNACIONES " + + Public Function GetConsignaciones2(CveConsignacion As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ConsignacionesGet2") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las consignaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetConsignacionesImpresion(CveConsignacion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ConsignacionesImpresionGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las consignaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetConsignacionesDetalleProveedor(CveProveedor As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ConsignacionesDetalleGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las consignaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddConsignaciones(CveProveedor As Integer, CveCompra As Integer, SerieFolio As String, Fecha As Date, CveUsuario As Integer) As Integer + Dim Retorno = -1 + + DataAdapter("PA_Inv_ConsignacionesAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@SerieFolio", SqlDbType.VarChar).Value = SerieFolio + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveConsignacion", SqlDbType.Int).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + Retorno = SqlAdapter.SelectCommand.Parameters("@CveConsignacion").Value.ToString.ToEntero + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateConsignaciones(CveConsignacion As Integer, CveProveedor As Integer, CveCompra As Integer, SerieFolio As String, Fecha As Date, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ConsignacionesUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@SerieFolio", SqlDbType.VarChar).Value = SerieFolio + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al actualizar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al actualizar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveConsignaciones(CveConsignacion As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ConsignacionesRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateConsignacionesCompra(CveCompra As Integer, CveConsignacion As Integer, CveAlmacen As Integer, CvePS As Integer, Cantidad As Double, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ConsignacionesCompraUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Cantidad", SqlDbType.Money).Value = Cantidad + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al actualizar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al actualizar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RepConsignaciones(CveProveedor As Integer, TipoReporte As Integer, CveConsignacion As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ConsignacionesRep") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte + .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al consultar el reporte de consignaciones.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al consultar el reporte de consignaciones", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetConsignacionesPendientes(CveProveedor As Integer, TipoReporte As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ConsignacionesPendientesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al consultar las consignaciones pendientes.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al consultar las consignaciones pendientes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function ConsignacionesDetalle(CveConsignacion As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ConsignacionesDetalleGet2") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al consultar el detalle de la consignacion.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al consultar el detalle de la consignacion", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - COSTO PS " + Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, SerieLote As String, FechaFin As Date, Optional CveSubProyecto As Integer = -1) As Decimal + Dim Retorno As Decimal = -1D + DataAdapter("PA_Inv_PSCostoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Cantidad", SqlDbType.Float).Value = Cantidad + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Costo", SqlDbType.Money).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + Retorno = SqlAdapter.SelectCommand.Parameters("@Costo").Value.ToString.ToDecimal + Catch ex As Exception + OnError("Ocurrió un error al obtener El Costo del Producto/Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - OC " + Public Function RepOcInv(Folio As String, FIni As Date, Ffin As Date, CveProveedor As Integer, Estatus As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_OC_RepOcInv") + With SqlAdapter.SelectCommand.Parameters + .Add("@Folio", SqlDbType.VarChar).Value = Folio + .Add("@Fini", SqlDbType.Date).Value = FIni + .Add("@Ffin", SqlDbType.Date).Value = Ffin + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Retorno = False + OnError("Ocurrió un error al obtener RepOcInv.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + Public Function RepOcInvMoto(Folio As String, FIni As Date, Ffin As Date, CveProveedor As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_OC_RepOcInvMoto") + With SqlAdapter.SelectCommand.Parameters + .Add("@Folio", SqlDbType.VarChar).Value = Folio + .Add("@Fini", SqlDbType.Date).Value = FIni + .Add("@Ffin", SqlDbType.Date).Value = Ffin + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Retorno = False + OnError("Ocurrió un error al obtener RepOcInvMoto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + Public Function GetMovimientosOC(CveOC As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_MovimientosOCGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los movimientos de Almacen de OC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function UpdateMovimientosOCCompra(CveCompra As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_MovimientosOCCompraUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al vincular los movimientos de Almacen de OC con Compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function RecepcionAlmacenOCGet(CveOC As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_OC_RecepcionAlmacenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las OC pendientes de almacén", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function PendientesAlmacenOCGet(CveProveedor As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_OC_PendientesAlmacenGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las OCs pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function TraspasaEntregaDirectaOCInv(CveVentaNueva As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_OC_TraspasaEntregaDirectaOCInv") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al traspasar la entrega directa de OC con inventario de la venta .", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + +#Region " INVENTARIOS - ENTREGAS FORANEAR - SE CAMBIO ESQUEMA A PAQUETERIAGUIAS" + Public Function AddEntregaForanea(Guia As String, GuiaRequerida As Boolean, CveEntregaEstatus As Integer, CveEmpresa As Integer, Optional CveOC As Integer = -1, Optional CveVenta As Integer = -1, Optional CvePaqueteria As Integer = -1) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_EntregasForaneasAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Guia", SqlDbType.VarChar).Value = Guia + .Add("@GuiaRequerida", SqlDbType.Bit).Value = GuiaRequerida + .Add("@CveEntregaEstatus", SqlDbType.Int).Value = CveEntregaEstatus + .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria + .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al guardar la guia de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetEntregasForaneas(CveEntregaForaneaEstatus As Integer, CvePaqueteria As Integer, CveEmpresa As Integer, Tipo As Integer, Optional CveSubProyecto As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1") As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_EntregasForaneasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEntregaForaneaEstatus", SqlDbType.Int).Value = CveEntregaForaneaEstatus + .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio + .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin + + End With + + Try + SqlAdapter.Fill(Data) + If Tipo = 1 Then + If Data.Rows.Count > 0 Then + _CveEntregaForanea = Data.Rows(0)("CveEntregaForanea").ToString.ToEntero + _CvePaqueteriaGuia = 0 + End If + Else + If Data.Rows.Count > 0 Then + _CveEntregaForanea = 0 + _CvePaqueteriaGuia = Data.Rows(0)("CvePaqueteriaGuia").ToString.ToEntero + End If + End If + 'If Data.Rows.Count > 0 Then + ' _CveEntregaForanea = Data.Rows(0)("CveEntregaForanea").ToString.ToEntero + 'End If + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener datos de la entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateEntregaForanea(CveEntregaForanea As Integer, Guia As String, GuiaRequerida As Integer, CveEntregaEstatus As Integer, Optional CvePaqueteria As Integer = -1, Optional Tipo As Integer = 1, Optional CvePaqueteriaGuia As Integer = -1, Optional Extencion As String = "-1") As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_EntregasForaneasUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEntregaForanea", SqlDbType.Int).Value = CveEntregaForanea + .Add("@Guia", SqlDbType.VarChar).Value = Guia + .Add("@GuiaRequerida", SqlDbType.Bit).Value = GuiaRequerida + .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria + .Add("@CveEntregaEstatus", SqlDbType.Int).Value = CveEntregaEstatus + + .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia + .Add("@Extencion", SqlDbType.VarChar).Value = Extencion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar datos de la entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveEntregaForanea(CveEntregaForanea As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_EntregasForaneasRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEntregaForanea", SqlDbType.Int).Value = CveEntregaForanea + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar datos de la entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetEntregaForaneaEstatus(CveEntregaForaneaEstatus As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_EntregasForaneasEstatusGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEntregaForaneaEstatus", SqlDbType.Int).Value = CveEntregaForaneaEstatus + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener datos del estatus", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + +#End Region + +#Region " INVENTARIOS - APARTADOS " + Public Function VentasAlmacenApartadosGet(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_VentasAlmacenApartadosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la relación de ventas con almacén en apartados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function DesapartadosGet(CveAlmacen As Integer, CveCliente As Integer, CveVendedor As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_DesapartadosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de desapartado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function ApartadosRep(CveAlmacen As Integer, CveCliente As Integer, CveVendedor As Integer, CveEmpresa As Integer, CvePS As Integer, FechaI As Date, FechaF As Date) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ApartadosRep") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de desapartado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function ApartadosRep2(CveAlmacen As Integer, CveCliente As Integer, CveVendedor As Integer, CveEmpresa As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveGrupo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ApartadosRep1") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveGrupo", SqlDbType.Int).Value = CveGrupo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de desapartado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + +#Region " INVENTARIOS - PAQUETES " + Public Function AddPaqueteRelacionSeries(CvePaquete As Integer, SeriePaquete As String, CvePS As Integer, SeriePS As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteRelacionSeriesoAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaquete", SqlDbType.Int).Value = CvePaquete + .Add("@SeriePaquete", SqlDbType.VarChar).Value = SeriePaquete + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@SeriePS", SqlDbType.VarChar).Value = SeriePS + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la relación de series del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetPaqueteRelacionSeries(CvePaquete As Integer, SeriePaquete As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteRelacionSeriesoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaquete", SqlDbType.Int).Value = CvePaquete + .Add("@SeriePaquete", SqlDbType.VarChar).Value = SeriePaquete + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la relación de series del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function RemovePaqueteRelacionSeries(CvePaquete As Integer, SeriePaquete As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteRelacionSeriesoRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaquete", SqlDbType.Int).Value = CvePaquete + .Add("@SeriePaquete", SqlDbType.VarChar).Value = SeriePaquete + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la relación de series del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - OS " + Public Function GetMovimientosOS(CveConcepto As Integer, CveOS As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GetMovimientosOS") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOS", SqlDbType.Int).Value = CveOS + .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Movimientos de Ordenes de Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region " INVENTARIOS - SOLICITUD DE TRASPASOS " + Public Function AddTrasladoSolicitud(Observaciones As String, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, CveMovimientoAlmacen As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, + Optional CveContrato As Integer = -1, Optional Guia As String = "", Optional CvePaqueteria As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional CveOS As Integer = -1) As Integer + Dim Retorno = -1 + DataAdapter("PA_Inv_TraspasoSolicitudAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen + .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino + .Add("@CveTrasladoEstatus", SqlDbType.TinyInt).Value = CveTrasladoEstatus + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveMovimientoAlmacen", SqlDbType.Int).Value = CveMovimientoAlmacen + .Add("@Guia", SqlDbType.VarChar).Value = Guia + .Add("@CveTraspasoSolicitud", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@Folio", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria + .Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio + .Add("@CveOS", SqlDbType.Int).Value = CveOS + + End With + + Try + SqlAdapter.Fill(Data) + CveTraspasoSolicitud = SqlAdapter.SelectCommand.Parameters("@CveTraspasoSolicitud").Value.ToString.ToEntero + If CveTraspasoSolicitud > 0 Then + Retorno = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString.ToEntero + End If + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar el movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar el movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Double, Observaciones As String, CveContratoDetalle As Integer) As Boolean + Dim Retorno As Boolean = False + Dim CveTraspasoSolicitud As Integer = 0 + DataAdapter("PA_Inv_TraspasoSolicitudDetalleAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud + .Add("@Cantidad", SqlDbType.Int).Value = Cantidad + .Add("@CveUM", SqlDbType.Int).Value = CveUM + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Precio", SqlDbType.Float).Value = Precio + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddTrasladoSolicitudGet(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + Dim CveTraspasoSolicitud As Integer = 0 + DataAdapter("PA_Inv_TraspasoSolicitudGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveTrasladoSolicitud(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + Dim CveTraspasoSolicitud As Integer = 0 + DataAdapter("PA_Inv_TraspasoSolicitudRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function EntregaAlmacenTraspasosGet(CveTraspasoSolicitud As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_EntregaAlmacenTraspasosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTraspasoSolicitud", SqlDbType.Int).Value = CveTraspasoSolicitud + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los productos pendientes de la solicitud de traspaso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateTraspasoSolicitudMovimiento(CveTraspasoSolicitud As Integer, CveMovimiento As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_TraspasoSolicitudUpdateMovimiento") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTraspasoSolicitud", SqlDbType.Int).Value = CveTraspasoSolicitud + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el movimiento de almacén de la solicitud de traspaso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function UpdateTraspasoSolicitudEstatus(CveTraspasoSolicitud As Integer, CveEstatus As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_TraspasoSolicitudUpdateEstatus") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTraspasoSolicitud", SqlDbType.Int).Value = CveTraspasoSolicitud + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus de la solicitud de traspaso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RepTrasladoSolicitud(CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveUsuario As Integer, OpcionAlmacen As Integer, CveContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_TraspasoSolicitudGetRep") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen + .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino + .Add("@CveTrasladoEstatus", SqlDbType.Int).Value = CveTrasladoEstatus + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@OpcionAlmacen", SqlDbType.Int).Value = OpcionAlmacen + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar el movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar el movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + +#End Region + +#Region " INVENTARIOS - GRUPO PS" + + Public Function GetGrupoPS(CveEmpresa As Integer, Optional CveGrupoPS As Integer = -1, Optional Estatus As Integer = -1, Optional Descripcion As String = "-1") As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los grupos de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function AddGrupoPS(Descripcion As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@CveGrupoPS", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + CveGrupoPS = SqlAdapter.SelectCommand.Parameters("@CveGrupoPS").Value.ToString.ToEntero + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el grupo de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateGrupoPS(CveGrupoPS As Integer, Descripcion As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el grupo de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveGrupoPS(CveGrupoPS As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el grupo de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + +#Region " INVENTARIOS - GRUPO PS DETALLE" + + Public Function GetGrupoPSDetalle(CveGrupoPS As Integer, Optional CveGrupoPSDetalle As Integer = -1, Optional CvePS As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSDetalleGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS + .Add("@CveGrupoPSDetalle", SqlDbType.Int).Value = CveGrupoPSDetalle + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function AddGrupoPSDetalle(CveGrupoPS As Integer, CvePS As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSDetalleAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateGrupoPSDetalle(CveGrupoPSDetalle As Integer, CveGrupoPS As Integer, CvePS As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSDetalleUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveGrupoPSDetalle", SqlDbType.Int).Value = CveGrupoPSDetalle + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveGrupoPSDetalle(CveGrupoPSDetalle As Integer, Optional CveGrupoPS As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_GrupoPSDetalleRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGrupoPSDetalle", SqlDbType.Int).Value = CveGrupoPSDetalle + .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + +#Region " INVENTARIOS - IMPORTACIONES " + + Public Function PendientesAlmacenImportacionComprasGet(CveImportacion As Integer, CveProveedor As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_PendientesAlmacenImportacionesComprasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveImportacion", SqlDbType.Int).Value = CveImportacion + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Importaciones pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function PendientesAlmacenImportacionGet(CveProveedor As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_PendientesAlmacenImportacionesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Importaciones pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function RecepcionAlmacenImportacionGet(CveImportacion As Integer, CveCompra As Integer, CveProveedor As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RecepcionAlmacenImportacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveImportacion", SqlDbType.Int).Value = CveImportacion + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los productos por recibir de la importación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region " GUIAS " + + Public Function GetPaqueteriaGuia(CveMovimiento As Integer, CveEmpresa As Integer, Optional CvePaqueteriaGuia As Integer = -1, Optional CveVenta As Integer = -1) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteriaGuiasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de obtener la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + Public Function AddPaqueteriaGuia(CvePaqueteria As Integer, CveMovimiento As Integer, Guia As String, NumCajas As Integer, Peso As Decimal, CveUsuario As Integer, CveEmpresa As Integer, + Optional Rastreo As String = "", Optional Dimensiones As String = "", Optional FechaEstimada As String = "", Optional CveVenta As Integer = -1) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteriaGuiasAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + + .Add("@Guia", SqlDbType.VarChar).Value = Guia + .Add("@NumCajas", SqlDbType.Int).Value = NumCajas + .Add("@Peso", SqlDbType.Money).Value = Peso + .Add("@Rastreo", SqlDbType.VarChar).Value = Rastreo + .Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones + .Add("@FechaEstimada", SqlDbType.VarChar).Value = FechaEstimada + + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de agregar la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + Public Function UpdatePaqueteriaGuia(CvePaqueteriaGuia As Integer, CveEstatus As Integer, Guia As String) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteriaGuiasUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia + .Add("@Guia", SqlDbType.VarChar).Value = Guia + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de actualizar la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + Public Function RemovePaqueteriaGuia(CvePaqueteriaGuia As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteriaGuiasRemove") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de eliminar la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + 'PA_Inv_PaqueteriaGuiasInfoFormatoGet + + Public Function GetPaqueteriaGuiasInfoFormato(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveVenta As Integer = -1) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PaqueteriaGuiasInfoFormatoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener información de la guia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function +#End Region + +#Region " FLETES " + + Public Function AddFlete(Folio As String, Descripcion As String, Fecha As Date, CveOC As Integer, CveCompra As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Folio", SqlDbType.VarChar).Value = Folio + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveFlete", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + CveFlete = SqlAdapter.SelectCommand.Parameters("@CveFlete").Value.ToString.ToEntero + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateFlete(CveFlete As Integer, Descripcion As String, Fecha As Date, CveOC As Integer, CveCompra As Integer, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveFlete(CveFlete As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetFletes(CveEmpresa As Integer, Optional CveFlete As Integer = -1, Optional Folio As String = "-1", Optional CveProveedor As Integer = -1, Optional CveOC As Integer = -1, Optional CveCompra As Integer = -1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@Folio", SqlDbType.VarChar).Value = Folio + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RecepcionAlmacenFleteGet(CveFlete As Integer, CveOrdenCompra As Integer, CveCompra As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RecepcionAlmacenFleteGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los productos por recibir del flete", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region " FLETES DETALLE " + Public Function AddFleteDetalle(CveFlete As Integer, CveCompra As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesDetalleAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el flete detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveFleteDetalle(CveFleteDetalle As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesDetalleRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFleteDetalle", SqlDbType.Int).Value = CveFleteDetalle + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el flete detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetFleteDetalle(CveFlete As Integer, Optional CveCompra As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesDetalleGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el flete detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + +#End Region + +#Region " CONSUMO INTERNO " + Public Function GetConsumoInterno(CveEmpresa As Integer, CveAlmacen As Integer, CvePersonal As Integer, CveAF As Integer, CvePS As Integer, FechaInicio As String, FechaFin As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ConsumoInternoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveAF", SqlDbType.Int).Value = CveAF + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio + .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de obtener el detalle del Consumo Interno.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region + +#Region "INVENTARIOS - REPORTE DE MOVIMIENTOS DE PROVEEDOR" + + Public Function GetRepMovimientosProveedor(CveEmpresa As Integer, CveConcepto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosProveedor") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de obtener los movimientos del proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + + +#Region "INVENTARIOS - REPORTE UNIFORMES RESGUARDO" + + Public Function GetResguardoUniformesRep(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveDepartamento As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ResguardoUniformesRep") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveDepartamento", SqlDbType.Int).Value = CveDepartamento + + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de obtener el reporte de uniforme.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + +#Region "REMANUFACTURA" + + Public Function AddRemanufactura(CveCliente As Integer, CveAlmacen As Integer, CveSubProyecto As Integer, CvePS As Integer, + Folio As String, Cantidad As Double, Precio As Double, Fecha As Date, CveUsuario As Integer, + CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RemanufacturaAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Folio", SqlDbType.VarChar).Value = Folio + .Add("@Cantidad", SqlDbType.Float).Value = Cantidad + .Add("@Precio", SqlDbType.Float).Value = Precio + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveRemanufactura", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + CveRemanufactura = SqlAdapter.SelectCommand.Parameters("@CveRemanufactura").Value.ToString.ToEntero + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de agregar la remanufactura.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateRemanufactura(CveRemanufactura As Integer, CveMovimiento As Integer, CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RemanufacturaUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRemanufactura", SqlDbType.Int).Value = CveRemanufactura + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de actualizar la remanufactura.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetRemanufactura(CveCliente As Integer, CveAlmacen As Integer, CveSubProyecto As Integer, CveProyecto As Integer, + CvePS As Integer, CveEmpresa As Integer, FechaI As Date, + FechaF As Date, CveUsuarioConsulta As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RemanufacturaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al momento de obtener la remanufactura.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + +#Region "REPORTE DE ENTRADAS SALIDAS X CONTRATO" + + Public Function GetRepEntradasSalidasXContrato(CveEmpresa As Integer, CveMoneda As Integer, FechaI As Date, + FechaF As Date, CveConcepto As Integer, CveProveedor As Integer, + CveAlmacen As Integer, CvePS As Integer, CveClasificacion As Integer, + Tipo As Integer, CveMarca As Integer, CveContrato As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RepEntradasSalidasXContrato") + With SqlAdapter.SelectCommand.Parameters + .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la lista de movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + +#Region "PRESTAMOS DE PROVEEDOR" + Public Function PrestamosdeProveedorGet(CveProveedor As Integer, Folio As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_PrestamosdeProveedorGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@Folio", SqlDbType.Int).Value = Folio + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la información de préstamos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region "MOVIMIENTOS SALIDA" + + Public Function GetRepMovimientosSalida(FechaI As Date, FechaF As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RepMovimientosSalidaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los movimientos salida", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + +#Region "MOVIMIENTOS DETALLE SECCION ALMACEN" + + Public Function AddMovimientosDetalleSeccionesAlmacen(CveMovimientoDetalle As Integer, CveSeccionAlmacen As Integer, Cantidad As Decimal) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@Cantidad", SqlDbType.Float).Value = Cantidad + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetMovimientosDetalleSeccionesAlmacen(CveSeccionAlmacen As Integer, CveAlmacen As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetExistenciaSeccionAlmacen(CveVenta As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ExistenciaSeccionAlmacenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de las secciones de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetKardexSeccionAlmacen(CvePS As Integer, CveAlmacen As Integer, CveSeccionAlmacen As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_KardexSeccionAlmacenGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el kardex de seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function AddProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveProductosServiciosAlmacenSeccion(CvePSAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePSAlmacenSeccion", SqlDbType.Int).Value = CvePSAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + + +#End Region + + +#Region " IDisposable Support " + ' IDisposable + Protected Overridable Sub Dispose(ByVal disposing As Boolean) + If Not disposedValue Then + If disposing Then + ' TODO: Liberar otro estado (objetos administrados). + SqlConexion.Close() + SqlConexion.Dispose() + If Not Data Is Nothing Then Data.Dispose() + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() + + End If + + ' TODO: Liberar su propio estado (objetos no administrados). + ' TODO: Establecer campos grandes como Null. + End If + disposedValue = True + End Sub + + ' Visual Basic agregó este código para implementar correctamente el modelo descartable. + Public Sub Dispose() Implements IDisposable.Dispose + ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). + ConexionClose() + Dispose(True) + GC.SuppressFinalize(Me) + End Sub +#End Region + +End Class -#Region "I N V E N T A R I O - F I S I C O - R E S U L T A D O" - Public Function AddInventarioFisicoResultados(CveInventarioFisico As Integer, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoResultadoAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el Inventario Fisico Resultado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetInventarioFisicoResultados(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoResultadosGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Inventario Fisico Avance", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetInventarioFisicoResultadosAvance(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_InventarioFisicoResultadoAvance") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Inventario Fisico Avance", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - - Public Function RepAnomalias(CveInventarioFisico As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ReporteAnomalias") - With SqlAdapter.SelectCommand.Parameters - - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Reporte de Anomalias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function RepAnomalias2(CveInventarioFisico As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_Rep_AnomaliasGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte de anomalias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - -#End Region - -#Region " INVENTARIOS - MAXIMO MINIMO" - Public Function RepMaximoMinimo(CveSubproyecto As Integer, CveAlmacen As Integer, CveClasificacion2 As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ReporteMaximoMinimo") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2 - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Reporte de Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function RepMaximoMinimoDetalleGet(CveSubProyecto As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ReporteMaximoMinimoDetalle") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los detalles del Reporte de Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function AddAlmacenMaximoMinimo(CveAlmacen As Integer, CvePS As Integer, Maximo As Double, Minimo As Double, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_AlmacenesMaximoMinimoAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Maximo", SqlDbType.Money).Value = Maximo - .Add("@Minimo", SqlDbType.Money).Value = Minimo - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al guardar Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function UpdateAlmacenMaximoMinimo(CveAlmacen As Integer, CvePS As Integer, Maximo As Double, Minimo As Double, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_AlmacenesMaximoMinimoUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Maximo", SqlDbType.Money).Value = Maximo - .Add("@Minimo", SqlDbType.Money).Value = Minimo - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function GetAlmacenMaximoMinimo(CveAlmacen As Integer, CvePS As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_AlmacenesMaximoMinimoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CvePS", SqlDbType.Int).Value = CvePS - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener Maximos y Minimos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region " INVENTARIOS - COMPRAS " - - Public Function RecepcionAlmacenGet(CveCompra As Integer, TipoRecepcion As Integer, CveEmpresa As Integer, Optional CveProveedor As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RecepcionAlmacenGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@TipoRecepcion", SqlDbType.Int).Value = TipoRecepcion - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los artículos de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function ComprasPendientesAlmacenGet(CveProveedor As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ComprasPendientesAlmacenGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las compras pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function ComprasDevolucionExistenciasGet(CveCompras As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ComprasExistenciasDevolucionGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCompra", SqlDbType.Int).Value = CveCompras - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las existencias de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetInv_ComprasMov(CveCompra As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Comp_ComprasMovimientos") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener datos del Almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function -#End Region - -#Region " INVENTARIOS - VENTAS " - Public Function EntregaAlmacenGet(CveVenta As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_EntregaAlmacenGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los artículos de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function VentasPendientesAlmacenGet(CveCliente As Integer, Fecha As Date, CveSubProyecto As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_VentasPendientesAlmacenGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las ventas pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function SerieLoteRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_SerieLoteRecomendadoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la Serie/Lote recomendado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function LoteBatchRecomendadoGet(CvePS As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_LoteBatchRecomendadoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Lote-Batch recomendado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function SeccionAlmacenRecomendadoSurtidoGet(CvePS As Integer, Cantidad As Double, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_SeccionAlmacenRecomendadoSurtidoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Cantidad", SqlDbType.Money).Value = Cantidad - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la seccion almacen recomendada para surtir.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function LoteBatchFechaCaducidadGet(CvePS As Integer, Lote As String, Batch As String, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_LoteBatchFechaCaducidadGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Lote", SqlDbType.VarChar).Value = Lote - .Add("@Batch", SqlDbType.VarChar).Value = Batch - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la Fecha Caducidad del Lote-Batch.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function ActualizarEsDevolucionVenta(CveVenta As Integer, Valor As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("Vta_UpdateDevolucionVenta") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@Valor", SqlDbType.Int).Value = Valor - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar la devolucion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function LimpiaEntregaDirecta(CveMovimiento As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_LimpiaEntregaDirecta") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al generar la limpieza del movimiento de entrega directa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function EliminaEntregaDirecta(CveMovimiento As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_EliminaEntregaDirecta") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al generar la eliminación del movimiento de entrega directa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function VentaDetallePadreGet(CveVentaDetallePadre As Integer) As Integer - Dim Retorno = -1 - DataAdapter("PA_Inv_VentaDetallePadreGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre - .Add("@CveVentaDetalle", SqlDbType.Int).Direction = ParameterDirection.Output - End With - Try - SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@CveVentaDetalle").Value.ToString.ToEntero - Catch ex As Exception - OnError("Ocurrió un error al obtener la venta detalle padre.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetPendietePorSurtirVenta(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, Optional Tipo As Integer = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_VentasPendientesPorSurtirGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@Tipo", SqlDbType.Int).Value = Tipo - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener ventas pendientes por surtir.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetEstatusVentaPorSurir(CveVenta As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_EstatusVentaPorSurtirGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - End With - - Try - SqlAdapter.Fill(Data) - - If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then - Dim dr As DataRow = Data.Rows(0) - TipoEstatus = dr("TipoEstatus").ToString.ToEntero - EsDevolucionVenta = dr("EsVentaDevolucion").ToString.ToEntero - Retorno = True - End If - - - Catch ex As Exception - OnError("Ocurrió un error al obtener ventas pendientes por surtir.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - - - Return Retorno - End Function - - Public Function GetInv_Mov(CveVenta As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_VentaDetalleAlmacen") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener datos del Almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function GetDevolucionRemisionesFacturadas(CveVenta As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_DevolucionRemisionesFacturadas") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de devolución de remisiones facturadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function GetDevolucionRemisionesCanceladas(CveVenta As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_DevolucionRemisionCanceladas") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de devolución de remisiones canceladas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function -#End Region - -#Region " INVENTARIOS - CONSIGNACIONES " - - Public Function GetConsignaciones2(CveConsignacion As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ConsignacionesGet2") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las consignaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetConsignacionesImpresion(CveConsignacion As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ConsignacionesImpresionGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las consignaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetConsignacionesDetalleProveedor(CveProveedor As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ConsignacionesDetalleGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las consignaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function AddConsignaciones(CveProveedor As Integer, CveCompra As Integer, SerieFolio As String, Fecha As Date, CveUsuario As Integer) As Integer - Dim Retorno = -1 - - DataAdapter("PA_Inv_ConsignacionesAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@SerieFolio", SqlDbType.VarChar).Value = SerieFolio - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveConsignacion", SqlDbType.Int).Direction = ParameterDirection.Output - End With - - Try - SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@CveConsignacion").Value.ToString.ToEntero - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function UpdateConsignaciones(CveConsignacion As Integer, CveProveedor As Integer, CveCompra As Integer, SerieFolio As String, Fecha As Date, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ConsignacionesUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@SerieFolio", SqlDbType.VarChar).Value = SerieFolio - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al actualizar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al actualizar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveConsignaciones(CveConsignacion As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ConsignacionesRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al eliminar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al eliminar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function UpdateConsignacionesCompra(CveCompra As Integer, CveConsignacion As Integer, CveAlmacen As Integer, CvePS As Integer, Cantidad As Double, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ConsignacionesCompraUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Cantidad", SqlDbType.Money).Value = Cantidad - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al actualizar la consignación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al actualizar la consignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RepConsignaciones(CveProveedor As Integer, TipoReporte As Integer, CveConsignacion As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ConsignacionesRep") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte - .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al consultar el reporte de consignaciones.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al consultar el reporte de consignaciones", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetConsignacionesPendientes(CveProveedor As Integer, TipoReporte As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ConsignacionesPendientesGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al consultar las consignaciones pendientes.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al consultar las consignaciones pendientes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function ConsignacionesDetalle(CveConsignacion As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ConsignacionesDetalleGet2") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveConsignacion", SqlDbType.Int).Value = CveConsignacion - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al consultar el detalle de la consignacion.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al consultar el detalle de la consignacion", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function -#End Region - -#Region " INVENTARIOS - COSTO PS " - Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, SerieLote As String, FechaFin As Date, Optional CveSubProyecto As Integer = -1) As Decimal - Dim Retorno As Decimal = -1D - DataAdapter("PA_Inv_PSCostoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Cantidad", SqlDbType.Float).Value = Cantidad - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@Costo", SqlDbType.Money).Direction = ParameterDirection.Output - End With - - Try - SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@Costo").Value.ToString.ToDecimal - Catch ex As Exception - OnError("Ocurrió un error al obtener El Costo del Producto/Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function -#End Region - -#Region " INVENTARIOS - OC " - Public Function RepOcInv(Folio As String, FIni As Date, Ffin As Date, CveProveedor As Integer, Estatus As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_OC_RepOcInv") - With SqlAdapter.SelectCommand.Parameters - .Add("@Folio", SqlDbType.VarChar).Value = Folio - .Add("@Fini", SqlDbType.Date).Value = FIni - .Add("@Ffin", SqlDbType.Date).Value = Ffin - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - Retorno = False - OnError("Ocurrió un error al obtener RepOcInv.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - - End Function - - Public Function RepOcInvMoto(Folio As String, FIni As Date, Ffin As Date, CveProveedor As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_OC_RepOcInvMoto") - With SqlAdapter.SelectCommand.Parameters - .Add("@Folio", SqlDbType.VarChar).Value = Folio - .Add("@Fini", SqlDbType.Date).Value = FIni - .Add("@Ffin", SqlDbType.Date).Value = Ffin - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - Retorno = False - OnError("Ocurrió un error al obtener RepOcInvMoto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - - End Function - Public Function GetMovimientosOC(CveOC As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_MovimientosOCGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveOC", SqlDbType.Int).Value = CveOC - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los movimientos de Almacen de OC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function UpdateMovimientosOCCompra(CveCompra As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_MovimientosOCCompraUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al vincular los movimientos de Almacen de OC con Compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function RecepcionAlmacenOCGet(CveOC As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_OC_RecepcionAlmacenGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveOC", SqlDbType.Int).Value = CveOC - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las OC pendientes de almacén", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function PendientesAlmacenOCGet(CveProveedor As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_OC_PendientesAlmacenGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las OCs pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function TraspasaEntregaDirectaOCInv(CveVentaNueva As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_OC_TraspasaEntregaDirectaOCInv") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al traspasar la entrega directa de OC con inventario de la venta .", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - -#End Region - -#Region " INVENTARIOS - ENTREGAS FORANEAR - SE CAMBIO ESQUEMA A PAQUETERIAGUIAS" - Public Function AddEntregaForanea(Guia As String, GuiaRequerida As Boolean, CveEntregaEstatus As Integer, CveEmpresa As Integer, Optional CveOC As Integer = -1, Optional CveVenta As Integer = -1, Optional CvePaqueteria As Integer = -1) As Boolean - - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_EntregasForaneasAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Guia", SqlDbType.VarChar).Value = Guia - .Add("@GuiaRequerida", SqlDbType.Bit).Value = GuiaRequerida - .Add("@CveEntregaEstatus", SqlDbType.Int).Value = CveEntregaEstatus - .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria - .Add("@CveOC", SqlDbType.Int).Value = CveOC - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al guardar la guia de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetEntregasForaneas(CveEntregaForaneaEstatus As Integer, CvePaqueteria As Integer, CveEmpresa As Integer, Tipo As Integer, Optional CveSubProyecto As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1") As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_EntregasForaneasGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEntregaForaneaEstatus", SqlDbType.Int).Value = CveEntregaForaneaEstatus - .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@Tipo", SqlDbType.Int).Value = Tipo - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio - .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin - - End With - - Try - SqlAdapter.Fill(Data) - If Tipo = 1 Then - If Data.Rows.Count > 0 Then - _CveEntregaForanea = Data.Rows(0)("CveEntregaForanea").ToString.ToEntero - _CvePaqueteriaGuia = 0 - End If - Else - If Data.Rows.Count > 0 Then - _CveEntregaForanea = 0 - _CvePaqueteriaGuia = Data.Rows(0)("CvePaqueteriaGuia").ToString.ToEntero - End If - End If - 'If Data.Rows.Count > 0 Then - ' _CveEntregaForanea = Data.Rows(0)("CveEntregaForanea").ToString.ToEntero - 'End If - - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener datos de la entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function UpdateEntregaForanea(CveEntregaForanea As Integer, Guia As String, GuiaRequerida As Integer, CveEntregaEstatus As Integer, Optional CvePaqueteria As Integer = -1, Optional Tipo As Integer = 1, Optional CvePaqueteriaGuia As Integer = -1, Optional Extencion As String = "-1") As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_EntregasForaneasUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEntregaForanea", SqlDbType.Int).Value = CveEntregaForanea - .Add("@Guia", SqlDbType.VarChar).Value = Guia - .Add("@GuiaRequerida", SqlDbType.Bit).Value = GuiaRequerida - .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria - .Add("@CveEntregaEstatus", SqlDbType.Int).Value = CveEntregaEstatus - - .Add("@Tipo", SqlDbType.Int).Value = Tipo - .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia - .Add("@Extencion", SqlDbType.VarChar).Value = Extencion - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar datos de la entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveEntregaForanea(CveEntregaForanea As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_EntregasForaneasRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEntregaForanea", SqlDbType.Int).Value = CveEntregaForanea - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar datos de la entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetEntregaForaneaEstatus(CveEntregaForaneaEstatus As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_EntregasForaneasEstatusGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEntregaForaneaEstatus", SqlDbType.Int).Value = CveEntregaForaneaEstatus - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener datos del estatus", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - -#End Region - -#Region " INVENTARIOS - APARTADOS " - Public Function VentasAlmacenApartadosGet(CveVenta As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_VentasAlmacenApartadosGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la relación de ventas con almacén en apartados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function DesapartadosGet(CveAlmacen As Integer, CveCliente As Integer, CveVendedor As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_DesapartadosGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de desapartado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function ApartadosRep(CveAlmacen As Integer, CveCliente As Integer, CveVendedor As Integer, CveEmpresa As Integer, CvePS As Integer, FechaI As Date, FechaF As Date) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ApartadosRep") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de desapartado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function ApartadosRep2(CveAlmacen As Integer, CveCliente As Integer, CveVendedor As Integer, CveEmpresa As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveGrupo As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_ApartadosRep1") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveGrupo", SqlDbType.Int).Value = CveGrupo - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de desapartado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - -#End Region - -#Region " INVENTARIOS - PAQUETES " - Public Function AddPaqueteRelacionSeries(CvePaquete As Integer, SeriePaquete As String, CvePS As Integer, SeriePS As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteRelacionSeriesoAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePaquete", SqlDbType.Int).Value = CvePaquete - .Add("@SeriePaquete", SqlDbType.VarChar).Value = SeriePaquete - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@SeriePS", SqlDbType.VarChar).Value = SeriePS - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar la relación de series del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetPaqueteRelacionSeries(CvePaquete As Integer, SeriePaquete As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteRelacionSeriesoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePaquete", SqlDbType.Int).Value = CvePaquete - .Add("@SeriePaquete", SqlDbType.VarChar).Value = SeriePaquete - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la relación de series del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function RemovePaqueteRelacionSeries(CvePaquete As Integer, SeriePaquete As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteRelacionSeriesoRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePaquete", SqlDbType.Int).Value = CvePaquete - .Add("@SeriePaquete", SqlDbType.VarChar).Value = SeriePaquete - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar la relación de series del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region " INVENTARIOS - OS " - Public Function GetMovimientosOS(CveConcepto As Integer, CveOS As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GetMovimientosOS") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveOS", SqlDbType.Int).Value = CveOS - .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las Movimientos de Ordenes de Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region " INVENTARIOS - SOLICITUD DE TRASPASOS " - Public Function AddTrasladoSolicitud(Observaciones As String, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, CveMovimientoAlmacen As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, - Optional CveContrato As Integer = -1, Optional Guia As String = "", Optional CvePaqueteria As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional CveOS As Integer = -1) As Integer - Dim Retorno = -1 - DataAdapter("PA_Inv_TraspasoSolicitudAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones - .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen - .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino - .Add("@CveTrasladoEstatus", SqlDbType.TinyInt).Value = CveTrasladoEstatus - .Add("@Fecha", SqlDbType.DateTime).Value = Fecha - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CveMovimientoAlmacen", SqlDbType.Int).Value = CveMovimientoAlmacen - .Add("@Guia", SqlDbType.VarChar).Value = Guia - .Add("@CveTraspasoSolicitud", SqlDbType.Int).Direction = ParameterDirection.Output - .Add("@Folio", SqlDbType.Int).Direction = ParameterDirection.Output - .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria - .Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio - .Add("@CveOS", SqlDbType.Int).Value = CveOS - - End With - - Try - SqlAdapter.Fill(Data) - CveTraspasoSolicitud = SqlAdapter.SelectCommand.Parameters("@CveTraspasoSolicitud").Value.ToString.ToEntero - If CveTraspasoSolicitud > 0 Then - Retorno = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString.ToEntero - End If - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar el movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar el movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Double, Observaciones As String, CveContratoDetalle As Integer) As Boolean - Dim Retorno As Boolean = False - Dim CveTraspasoSolicitud As Integer = 0 - DataAdapter("PA_Inv_TraspasoSolicitudDetalleAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud - .Add("@Cantidad", SqlDbType.Int).Value = Cantidad - .Add("@CveUM", SqlDbType.Int).Value = CveUM - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Precio", SqlDbType.Float).Value = Precio - .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones - .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function AddTrasladoSolicitudGet(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - Dim CveTraspasoSolicitud As Integer = 0 - DataAdapter("PA_Inv_TraspasoSolicitudGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveTrasladoSolicitud(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - Dim CveTraspasoSolicitud As Integer = 0 - DataAdapter("PA_Inv_TraspasoSolicitudRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al eliminar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al eliminar los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function EntregaAlmacenTraspasosGet(CveTraspasoSolicitud As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_EntregaAlmacenTraspasosGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveTraspasoSolicitud", SqlDbType.Int).Value = CveTraspasoSolicitud - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los productos pendientes de la solicitud de traspaso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function UpdateTraspasoSolicitudMovimiento(CveTraspasoSolicitud As Integer, CveMovimiento As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_TraspasoSolicitudUpdateMovimiento") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveTraspasoSolicitud", SqlDbType.Int).Value = CveTraspasoSolicitud - .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el movimiento de almacén de la solicitud de traspaso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function UpdateTraspasoSolicitudEstatus(CveTraspasoSolicitud As Integer, CveEstatus As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_TraspasoSolicitudUpdateEstatus") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveTraspasoSolicitud", SqlDbType.Int).Value = CveTraspasoSolicitud - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el estatus de la solicitud de traspaso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function RepTrasladoSolicitud(CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveUsuario As Integer, OpcionAlmacen As Integer, CveContrato As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_TraspasoSolicitudGetRep") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen - .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino - .Add("@CveTrasladoEstatus", SqlDbType.Int).Value = CveTrasladoEstatus - .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio - .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@OpcionAlmacen", SqlDbType.Int).Value = OpcionAlmacen - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al guardar el movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al guardar el movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - -#End Region - -#Region " INVENTARIOS - GRUPO PS" - - Public Function GetGrupoPS(CveEmpresa As Integer, Optional CveGrupoPS As Integer = -1, Optional Estatus As Integer = -1, Optional Descripcion As String = "-1") As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS - .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los grupos de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function AddGrupoPS(Descripcion As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion - .Add("@CveGrupoPS", SqlDbType.Int).Direction = ParameterDirection.Output - End With - Try - SqlAdapter.Fill(Data) - CveGrupoPS = SqlAdapter.SelectCommand.Parameters("@CveGrupoPS").Value.ToString.ToEntero - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el grupo de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function UpdateGrupoPS(CveGrupoPS As Integer, Descripcion As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el grupo de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function RemoveGrupoPS(CveGrupoPS As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el grupo de ps.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - -#Region " INVENTARIOS - GRUPO PS DETALLE" - - Public Function GetGrupoPSDetalle(CveGrupoPS As Integer, Optional CveGrupoPSDetalle As Integer = -1, Optional CvePS As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSDetalleGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS - .Add("@CveGrupoPSDetalle", SqlDbType.Int).Value = CveGrupoPSDetalle - .Add("@CvePS", SqlDbType.Int).Value = CvePS - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function AddGrupoPSDetalle(CveGrupoPS As Integer, CvePS As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSDetalleAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS - .Add("@CvePS", SqlDbType.Int).Value = CvePS - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function UpdateGrupoPSDetalle(CveGrupoPSDetalle As Integer, CveGrupoPS As Integer, CvePS As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSDetalleUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveGrupoPSDetalle", SqlDbType.Int).Value = CveGrupoPSDetalle - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function RemoveGrupoPSDetalle(CveGrupoPSDetalle As Integer, Optional CveGrupoPS As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_GrupoPSDetalleRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveGrupoPSDetalle", SqlDbType.Int).Value = CveGrupoPSDetalle - .Add("@CveGrupoPS", SqlDbType.Int).Value = CveGrupoPS - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el grupo de ps detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - -#Region " INVENTARIOS - IMPORTACIONES " - - Public Function PendientesAlmacenImportacionComprasGet(CveImportacion As Integer, CveProveedor As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_PendientesAlmacenImportacionesComprasGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveImportacion", SqlDbType.Int).Value = CveImportacion - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las Importaciones pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function PendientesAlmacenImportacionGet(CveProveedor As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Inv_PendientesAlmacenImportacionesGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las Importaciones pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function RecepcionAlmacenImportacionGet(CveImportacion As Integer, CveCompra As Integer, CveProveedor As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RecepcionAlmacenImportacionGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveImportacion", SqlDbType.Int).Value = CveImportacion - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los productos por recibir de la importación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region " GUIAS " - - Public Function GetPaqueteriaGuia(CveMovimiento As Integer, CveEmpresa As Integer, Optional CvePaqueteriaGuia As Integer = -1, Optional CveVenta As Integer = -1) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteriaGuiasGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de obtener la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - - End Function - - Public Function AddPaqueteriaGuia(CvePaqueteria As Integer, CveMovimiento As Integer, Guia As String, NumCajas As Integer, Peso As Decimal, CveUsuario As Integer, CveEmpresa As Integer, - Optional Rastreo As String = "", Optional Dimensiones As String = "", Optional FechaEstimada As String = "", Optional CveVenta As Integer = -1) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteriaGuiasAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePaqueteria", SqlDbType.Int).Value = CvePaqueteria - .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - - .Add("@Guia", SqlDbType.VarChar).Value = Guia - .Add("@NumCajas", SqlDbType.Int).Value = NumCajas - .Add("@Peso", SqlDbType.Money).Value = Peso - .Add("@Rastreo", SqlDbType.VarChar).Value = Rastreo - .Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones - .Add("@FechaEstimada", SqlDbType.VarChar).Value = FechaEstimada - - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de agregar la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - - End Function - - Public Function UpdatePaqueteriaGuia(CvePaqueteriaGuia As Integer, CveEstatus As Integer, Guia As String) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteriaGuiasUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia - .Add("@Guia", SqlDbType.VarChar).Value = Guia - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de actualizar la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - - End Function - - Public Function RemovePaqueteriaGuia(CvePaqueteriaGuia As Integer, CveEmpresa As Integer) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteriaGuiasRemove") - - With SqlAdapter.SelectCommand.Parameters - - .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de eliminar la guía.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - - End Function - 'PA_Inv_PaqueteriaGuiasInfoFormatoGet - - Public Function GetPaqueteriaGuiasInfoFormato(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveVenta As Integer = -1) As Boolean - - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PaqueteriaGuiasInfoFormatoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener información de la guia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - - End Function -#End Region - -#Region " FLETES " - - Public Function AddFlete(Folio As String, Descripcion As String, Fecha As Date, CveOC As Integer, CveCompra As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_FletesAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@Folio", SqlDbType.VarChar).Value = Folio - .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveOC", SqlDbType.Int).Value = CveOC - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveFlete", SqlDbType.Int).Direction = ParameterDirection.Output - End With - Try - SqlAdapter.Fill(Data) - CveFlete = SqlAdapter.SelectCommand.Parameters("@CveFlete").Value.ToString.ToEntero - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function UpdateFlete(CveFlete As Integer, Descripcion As String, Fecha As Date, CveOC As Integer, CveCompra As Integer, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_FletesUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveOC", SqlDbType.Int).Value = CveOC - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function RemoveFlete(CveFlete As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_FletesRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function GetFletes(CveEmpresa As Integer, Optional CveFlete As Integer = -1, Optional Folio As String = "-1", Optional CveProveedor As Integer = -1, Optional CveOC As Integer = -1, Optional CveCompra As Integer = -1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_FletesGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@Folio", SqlDbType.VarChar).Value = Folio - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - .Add("@CveOC", SqlDbType.Int).Value = CveOC - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function RecepcionAlmacenFleteGet(CveFlete As Integer, CveOrdenCompra As Integer, CveCompra As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RecepcionAlmacenFleteGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los productos por recibir del flete", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region " FLETES DETALLE " - Public Function AddFleteDetalle(CveFlete As Integer, CveCompra As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_FletesDetalleAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el flete detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function RemoveFleteDetalle(CveFleteDetalle As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_FletesDetalleRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFleteDetalle", SqlDbType.Int).Value = CveFleteDetalle - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el flete detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function GetFleteDetalle(CveFlete As Integer, Optional CveCompra As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_FletesDetalleGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el flete detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - -#End Region - -#Region " CONSUMO INTERNO " - Public Function GetConsumoInterno(CveEmpresa As Integer, CveAlmacen As Integer, CvePersonal As Integer, CveAF As Integer, CvePS As Integer, FechaInicio As String, FechaFin As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ConsumoInternoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal - .Add("@CveAF", SqlDbType.Int).Value = CveAF - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio - .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de obtener el detalle del Consumo Interno.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function -#End Region - -#Region "INVENTARIOS - REPORTE DE MOVIMIENTOS DE PROVEEDOR" - - Public Function GetRepMovimientosProveedor(CveEmpresa As Integer, CveConcepto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ProductosProveedor") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de obtener los movimientos del proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - - -#Region "INVENTARIOS - REPORTE UNIFORMES RESGUARDO" - - Public Function GetResguardoUniformesRep(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveDepartamento As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ResguardoUniformesRep") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveDepartamento", SqlDbType.Int).Value = CveDepartamento - - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de obtener el reporte de uniforme.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - -#Region "REMANUFACTURA" - - Public Function AddRemanufactura(CveCliente As Integer, CveAlmacen As Integer, CveSubProyecto As Integer, CvePS As Integer, - Folio As String, Cantidad As Double, Precio As Double, Fecha As Date, CveUsuario As Integer, - CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RemanufacturaAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Folio", SqlDbType.VarChar).Value = Folio - .Add("@Cantidad", SqlDbType.Float).Value = Cantidad - .Add("@Precio", SqlDbType.Float).Value = Precio - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveRemanufactura", SqlDbType.Int).Direction = ParameterDirection.Output - End With - Try - SqlAdapter.Fill(Data) - CveRemanufactura = SqlAdapter.SelectCommand.Parameters("@CveRemanufactura").Value.ToString.ToEntero - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de agregar la remanufactura.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function UpdateRemanufactura(CveRemanufactura As Integer, CveMovimiento As Integer, CveVenta As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RemanufacturaUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRemanufactura", SqlDbType.Int).Value = CveRemanufactura - .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de actualizar la remanufactura.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function GetRemanufactura(CveCliente As Integer, CveAlmacen As Integer, CveSubProyecto As Integer, CveProyecto As Integer, - CvePS As Integer, CveEmpresa As Integer, FechaI As Date, - FechaF As Date, CveUsuarioConsulta As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RemanufacturaGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al momento de obtener la remanufactura.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - -#Region "REPORTE DE ENTRADAS SALIDAS X CONTRATO" - - Public Function GetRepEntradasSalidasXContrato(CveEmpresa As Integer, CveMoneda As Integer, FechaI As Date, - FechaF As Date, CveConcepto As Integer, CveProveedor As Integer, - CveAlmacen As Integer, CvePS As Integer, CveClasificacion As Integer, - Tipo As Integer, CveMarca As Integer, CveContrato As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RepEntradasSalidasXContrato") - With SqlAdapter.SelectCommand.Parameters - .Add("@Tipo", SqlDbType.Int).Value = Tipo - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveMarca", SqlDbType.Int).Value = CveMarca - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la lista de movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - -#Region "PRESTAMOS DE PROVEEDOR" - Public Function PrestamosdeProveedorGet(CveProveedor As Integer, Folio As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_PrestamosdeProveedorGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@Folio", SqlDbType.Int).Value = Folio - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la información de préstamos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region "MOVIMIENTOS SALIDA" - - Public Function GetRepMovimientosSalida(FechaI As Date, FechaF As Date, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_RepMovimientosSalidaGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los movimientos salida", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - -#Region "MOVIMIENTOS DETALLE SECCION ALMACEN" - - Public Function AddMovimientosDetalleSeccionesAlmacen(CveMovimientoDetalle As Integer, CveSeccionAlmacen As Integer, Cantidad As Decimal) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle - .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen - .Add("@Cantidad", SqlDbType.Float).Value = Cantidad - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function GetMovimientosDetalleSeccionesAlmacen(CveSeccionAlmacen As Integer, CveAlmacen As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_MovimientosDetalleSeccionesAlmacenGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar movimientos detalle seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function GetExistenciaSeccionAlmacen(CveVenta As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ExistenciaSeccionAlmacenGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte de las secciones de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function GetKardexSeccionAlmacen(CvePS As Integer, CveAlmacen As Integer, CveSeccionAlmacen As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_KardexSeccionAlmacenGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el kardex de seccion almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - Public Function AddProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function GetProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - Public Function RemoveProductosServiciosAlmacenSeccion(CvePSAlmacenSeccion As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePSAlmacenSeccion", SqlDbType.Int).Value = CvePSAlmacenSeccion - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - - - -#End Region - - -#Region " IDisposable Support " - ' IDisposable - Protected Overridable Sub Dispose(ByVal disposing As Boolean) - If Not disposedValue Then - If disposing Then - ' TODO: Liberar otro estado (objetos administrados). - SqlConexion.Close() - SqlConexion.Dispose() - If Not Data Is Nothing Then Data.Dispose() - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - - End If - - ' TODO: Liberar su propio estado (objetos no administrados). - ' TODO: Establecer campos grandes como Null. - End If - disposedValue = True - End Sub - - ' Visual Basic agregó este código para implementar correctamente el modelo descartable. - Public Sub Dispose() Implements IDisposable.Dispose - ' No cambie este código. Coloque el código de limpieza en Dispose (ByVal que se dispone como Boolean). - ConexionClose() - Dispose(True) - GC.SuppressFinalize(Me) - End Sub -#End Region - -End Class - diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index ddc112746..713783f8a 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4303,6 +4303,13 @@ Partial Class Compras_Compras If RBLPago.SelectedValue.ToEntero = 4 And EstatusCredito.Contiene(1, 101) Then CveEstatusFactura = 6 End If + 'hay amortización directa como descuento. RMF Temporal + If UsuarioActual.CveEmpresa = 119 Then + If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then + TxtDescuento.Text = LblAmortizacion.Text + LblAmortizacion.Text = "0.00" + End If + End If 'Compra If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble, @@ -6889,24 +6896,24 @@ Partial Class Compras_Compras Dim ImporteIVA As Decimal = Math.Round(PorcentajePagoAnt * TxtIVA.Text.ToDecimal, 2) 'Agregamos el 14 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then + If ImporteIVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If 'Agregamos el 19 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then + If ImporteIVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If Dim ImporteIEPS As Decimal = Math.Round(PorcentajePagoAnt * TxtIEPS.Text.ToDecimal, 2) 'Agregamos el 25 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIEPS, Referencia, 25, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then + If ImporteIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIEPS, Referencia, 25, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If 'Agregamos el 26 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIEPS, Referencia, 26, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then + If ImporteIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIEPS, Referencia, 26, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If End If @@ -6989,10 +6996,10 @@ Partial Class Compras_Compras CveCuentaPago = CveCuentaProveedorExtranjera End If - ''Agregamos el 17 - 'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 17, Concepto, FechaMovimiento, IdCtaContablePago, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaPago, Contabilizable:=SeContabiliza) Then - ' ErrorPrepoliza = True - 'End If + 'Agregamos el 17 + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 17, Concepto, FechaMovimiento, IdCtaContablePago, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaPago, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If End If ' FLUCTUACION CAMBIARIA @@ -14800,7 +14807,7 @@ Partial Class Compras_Compras AddPS2(False) 'AJUSTE DE REDONDEO O DIFERENCIA PERMITIDA DE IMPORTE - AjustaImporteUltimoConcepto((If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal)) + AjustaImporteUltimoConcepto((If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal)) 'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal)) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 68afa51d0..00ce5db51 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1223,7 +1223,7 @@ Partial Class PopUpVerFactura Remision, Proveedor, CalleOrigen, NoExtOrigen, ColoniaOrigen, LocalidadOrigen, MunicipioOrigen, EstadoOrigen, PaisOrigen, CPOrigen, CalleDestino, NoExtDestino, ColoniaDestino, LocalidadDestino, MunicipioDestino, EstadoDestino, PaisDestino, CPDestino, FechaMovimiento, NombreCapturo, PuestoRecibio, - PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio) + PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio, NombreCliente) End Sub Private Sub PUanacExtr(CveMoneda As Integer) 'preciounitario a moneda nacional o extranjera @@ -1240,7 +1240,7 @@ Partial Class PopUpVerFactura Remision As String, Proveedor As String, CalleOrigen As String, NoExtOrigen As String, ColoniaOrigen As String, LocalidadOrigen As String, MunicipioOrigen As String, EstadoOrigen As String, PaisOrigen As String, CPOrigen As String, CalleDestino As String, NoExtDestino As String, ColoniaDestino As String, LocalidadDestino As String, MunicipioDestino As String, EstadoDestino As String, PaisDestino As String, CPDestino As String, FechaMovimiento As Date, NombreCapturo As String, PuestoRecibio As String, PuestoEntrego As String, - RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String) + RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String) Select Case CveConcepto @@ -1402,8 +1402,8 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("Folio", Folio)) + params.Add(New ReportParameter("FacturadoA", NombreCliente)) params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, ""))) - params.Add(New ReportParameter("FacturadoA", RazonSocial)) params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), ""))) params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), ""))) params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), ""))) @@ -1586,7 +1586,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Almacen", Almacen)) params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("FacturaProveedor", FolioVenta)) - params.Add(New ReportParameter("FacturadoA", DtMovimientos(0)("Nombre").ToString)) + params.Add(New ReportParameter("FacturadoA", If(DtMovimientos(0)("Nombre").ToString <> "", DtMovimientos(0)("Nombre").ToString, NombreCliente))) params.Add(New ReportParameter("Observaciones", Observaciones)) params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("Folio", Folio)) @@ -1672,6 +1672,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Total", "")) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + params.Add(New ReportParameter("FacturadoA", NombreCliente)) If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) End If @@ -1700,6 +1701,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Total", "")) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + params.Add(New ReportParameter("FacturadoA", NombreCliente)) If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) End If @@ -2364,7 +2366,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Total", "")) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) - + params.Add(New ReportParameter("FacturadoA", NombreCliente)) If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) End If @@ -2393,6 +2395,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Total", "")) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + params.Add(New ReportParameter("FacturadoA", NombreCliente)) If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) End If @@ -2421,6 +2424,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Total", "")) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + params.Add(New ReportParameter("FacturadoA", NombreCliente)) If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) End If @@ -2448,6 +2452,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Total", "")) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + params.Add(New ReportParameter("FacturadoA", NombreCliente)) If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) End If diff --git a/Compras/ReembolsosComprobaciones.aspx b/Compras/ReembolsosComprobaciones.aspx index b8d1aeefe..9eb840af9 100644 --- a/Compras/ReembolsosComprobaciones.aspx +++ b/Compras/ReembolsosComprobaciones.aspx @@ -291,7 +291,7 @@ - + diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 59620eeb6..d8e8d0278 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -696,12 +696,21 @@ Partial Class Compras_ReembolsosComprobaciones If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then MsgError = "Detalle" End If - + Dim ImporteNOIVA As Decimal = gvr.DataKey("IVA").ToDecimal * PorcentajePago 'Agrego el IVA If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then MsgError = "Detalle" End If End If + + If gvr.DataKey("NoDeducible") Then + + Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago + + If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteNOIVA, Referencia, 280, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then + MsgError = "Detalle" + End If + End If End If If MsgError = "" AndAlso gvr.DataKey("RetIVA").ToDecimal > 0 Then @@ -1494,7 +1503,7 @@ Partial Class Compras_ReembolsosComprobaciones Protected Sub GvChequesFYE_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then e.Row.FCHyperLink("HLFYE").NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", e.Row.DBCampo("CvePersonal")) - e.Row.FCHyperLink("HLCheque").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) + 'e.Row.FCHyperLink("HLCheque").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) End If End Sub diff --git a/Empresas/119/Formatos/Traslado.rdlc b/Empresas/119/Formatos/Traslado.rdlc index d3c81f0dd..6de53333a 100644 --- a/Empresas/119/Formatos/Traslado.rdlc +++ b/Empresas/119/Formatos/Traslado.rdlc @@ -1,2868 +1,2880 @@ - - - - - - - - - 1.37635cm - - - 2.37101cm - - - 2.03347cm - - - 8.84221cm - - - 2.24818cm - - - 3.35602cm - - - - - 0.43377cm - - - - - true - - - - - Cant. - - - - - - - Textbox1 - - - - Black - - 1pt - - - Black - - 1pt - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Código - - - - - - - Textbox3 - - - - Black - - 1pt - - - Black - - 1pt - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - U.M. - - - - - - - - - - - - - - - - Textbox7 - - - - Black - - 1pt - - - Black - - 1pt - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox5 - - - - - - - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Serie/Lote - - - - - - - Textbox8 - - - - Black - - 1pt - - - Black - - 1pt - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Observaciones - - - - - - - Textbox12 - - - - Black - - 1pt - - - Black - - 1pt - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.4095cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - - - - - =Fields!UnidadMedida.Value - - - - - - - UnidadMedida - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - true - - - - - =Fields!PS.Value - - - - - - - PS - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - - - - - =Fields!SerieLote.Value - - - - - - - SerieLote - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - - - - - =Fields!Observaciones.Value - - - - - - - Observaciones - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsInventarios - 0.14111cm - 0.10068cm - 0.84327cm - 20.22724cm - - - - - - 0.43055in - - - - - - true - true - - - - - AGROQUÍMICOS JAM, S.A. DE C.V. - - - - - - - Textbox2 - 0.07163cm - 4.74215cm - 0.38833cm - 8.54466cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - AJA850608L7A -Carretera a Bahia Kino KM. 12 S/N -C.P. 83220 Col. La Manga -Hermosillo, Sonora, Mexico - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Microsoft.VisualBasic.Interaction.iif(Parameters!CveConcepto.Value = 8, "AVISO", "ENTRADA") & " DE TRASLADO " - - - - - - - Textbox2 - 0.07163cm - 13.61141cm - 0.38833cm - 6.81397cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio - - - - - - - Textbox12 - 0.88084cm - 16.09549cm - 0.44478cm - 4.32987cm - 4 - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Folio.Value - - - - - - - Textbox12 - 1.32562cm - 16.09549cm - 0.44478cm - 4.32987cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha - - - - - - - Textbox12 - 1.7704cm - 16.0955cm - 0.44478cm - 4.32987cm - 6 - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Fecha.Value - - - - - - - Textbox12 - 2.21518cm - 16.09549cm - 0.44478cm - 4.32987cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - - - true - true - - - - - Almacén Origen: - - - - =Parameters!AlmacenOrigen.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Almacén Destino: - - - - =Parameters!AlmacenDestino.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Detalles del Movimiento: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!DireccionOrigen.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!DireccionDestino.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - 2.39157cm - 2.59353cm - 20.32792cm - 8 - - - - - - true - true - - - - - =iif(Parameters!CveConcepto.Value = 8, "Carga Privada", " ") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - 5.83773cm - true - true - - - true - true - - - - - Observaciones: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ResponsableCarga.Value - - - - - - - Textbox21 - 3.28266cm - 3.14986cm - 0.50243cm - 5.79375cm - 2 - - =iif(Parameters!CveConcepto.Value = 9,true,false) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ResponsableRecibio.Value - - - - - - - Textbox21 - 3.28266cm - 11.86467cm - 0.50243cm - 5.78664cm - 3 - - =iif(Parameters!CveConcepto.Value = 9,true,false) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ___________________________ - - - - - - - - - Nombre y Firma - - - - - - - Textbox21 - 3.56875cm - 3.15781cm - 1.2cm - 5.78664cm - 4 - - =iif(Parameters!CveConcepto.Value = 9,true,false) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ___________________________ - - - - - - - - - Nombre y Firma - - - - - - - Textbox21 - 3.5682cm - 11.87177cm - 1.2cm - 5.78664cm - 5 - - =iif(Parameters!CveConcepto.Value = 9,true,false) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Envió - - - - - - - Textbox22 - 1.97831cm - 3.15781cm - 0.6cm - 5.78664cm - 6 - - =iif(Parameters!CveConcepto.Value = 9,true,false) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Accion.Value - - - - - - - Textbox22 - 1.97831cm - 11.87177cm - 0.6cm - 5.78664cm - 7 - - =iif(Parameters!CveConcepto.Value = 9,true,false) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!NombreAccion.Value = "","",Parameters!NombreAccion.Value) - - - - Textbox21 - 2.35606cm - 7.50017cm - 0.63528cm - 5.78664cm - 8 - - =iif(Parameters!CveConcepto.Value = 8, True, False) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ___________________________ - - - - - - - - - Nombre y Firma - - - - - - - Textbox21 - 3.5682cm - 7.50727cm - 1.2cm - 5.78664cm - 9 - - =iif(Parameters!CveConcepto.Value = 8, True, False) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Accion.Value - - - - - - - Textbox22 - 1.97831cm - 7.50727cm - 0.6cm - 5.78664cm - 10 - - =iif(Parameters!CveConcepto.Value = 8, True, False) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 1.80136cm - 0.13678cm - 0cm - 20.28859cm - 13 - - - - - - 0.31558cm - 0.13678cm - 0cm - 20.28859cm - 14 - - - - - - 5.17097cm - 0.10068cm - 0cm - 20.3247cm - 15 - - - - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox10 - 5.31209cm - 17.60787cm - 0.41981cm - 2.55292cm - 16 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 1cm - 0.13cm - + + + + + + Textbox1 + + + + Black + + 1pt + + + Black + + 1pt + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Código + + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + U.M. + + + + + + + + + + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Descripción + + + + + + + Textbox5 + + + + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Serie/Lote + + + + + + + Textbox8 + + + + Black + + 1pt + + + Black + + 1pt + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Observaciones + + + + + + + Textbox12 + + + + Black + + 1pt + + + Black + + 1pt + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.4095cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!UnidadMedida.Value + + + + + + + UnidadMedida + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + true + + + + + =Fields!PS.Value + + + + + + + PS + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!SerieLote.Value + + + + + + + SerieLote + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!Observaciones.Value + + + + + + + Observaciones + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsInventarios + 0.14111cm + 0.10068cm + 0.84327cm + 20.22724cm + + + + + + 0.43055in + + + + + + true + true + + + + + AGROQUÍMICOS JAM, S.A. DE C.V. + + + + + + + Textbox2 + 0.07163cm + 4.74215cm + 0.38833cm + 8.54466cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + AJA850608L7A +Carretera a Bahia Kino KM. 12 S/N +C.P. 83220 Col. La Manga +Hermosillo, Sonora, Mexico + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Microsoft.VisualBasic.Interaction.iif(Parameters!CveConcepto.Value = 8, "AVISO", "ENTRADA") & " DE TRASLADO " + + + + + + + Textbox2 + 0.07163cm + 13.61141cm + 0.38833cm + 6.81397cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio + + + + + + + Textbox12 + 0.88084cm + 16.09549cm + 0.44478cm + 4.32987cm + 4 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Folio.Value + + + + + + + Textbox12 + 1.32562cm + 16.09549cm + 0.44478cm + 4.32987cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + 1.7704cm + 16.0955cm + 0.44478cm + 4.32987cm + 6 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox12 + 2.21518cm + 16.09549cm + 0.44478cm + 4.32987cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + =IIf(Parameters!CveConcepto.Value = 8, "Almacén Origen:", "Almacén que recibe:") + + + + + + + + =Parameters!AlmacenOrigen.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIf(Parameters!CveConcepto.Value = 8, "Almacén Destino:", "Almacén que envía:") + + + + + + + + =Parameters!AlmacenDestino.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Detalles del Movimiento: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DireccionOrigen.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DireccionDestino.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + 2.39157cm + 2.59353cm + 20.32792cm + 8 + + + + + + true + true + + + + + =iif(Parameters!CveConcepto.Value = 8, "Carga Privada", " ") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 5.83773cm + true + true + + + true + true + + + + + Observaciones: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ResponsableCarga.Value + + + + + + + Textbox21 + 3.28266cm + 3.14986cm + 0.50243cm + 5.79375cm + 2 + + =iif(Parameters!CveConcepto.Value = 9,true,false) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ResponsableRecibio.Value + + + + + + + Textbox21 + 3.28266cm + 11.86467cm + 0.50243cm + 5.78664cm + 3 + + =iif(Parameters!CveConcepto.Value = 9,true,false) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ___________________________ + + + + + + + + + Nombre y Firma + + + + + + + Textbox21 + 3.56875cm + 3.15781cm + 1.2cm + 5.78664cm + 4 + + =iif(Parameters!CveConcepto.Value = 9,true,false) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ___________________________ + + + + + + + + + Nombre y Firma + + + + + + + Textbox21 + 3.5682cm + 11.87177cm + 1.2cm + 5.78664cm + 5 + + =iif(Parameters!CveConcepto.Value = 9,true,false) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Envió + + + + + + + Textbox22 + 1.97831cm + 3.15781cm + 0.6cm + 5.78664cm + 6 + + =iif(Parameters!CveConcepto.Value = 9,true,false) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Accion.Value + + + + + + + Textbox22 + 1.97831cm + 11.87177cm + 0.6cm + 5.78664cm + 7 + + =iif(Parameters!CveConcepto.Value = 9,true,false) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!NombreAccion.Value = "","",Parameters!NombreAccion.Value) + + + + Textbox21 + 2.35606cm + 7.50017cm + 0.63528cm + 5.78664cm + 8 + + =iif(Parameters!CveConcepto.Value = 8, True, False) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ___________________________ + + + + + + + + + Nombre y Firma + + + + + + + Textbox21 + 3.5682cm + 7.50727cm + 1.2cm + 5.78664cm + 9 + + =iif(Parameters!CveConcepto.Value = 8, True, False) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Accion.Value + + + + + + + Textbox22 + 1.97831cm + 7.50727cm + 0.6cm + 5.78664cm + 10 + + =iif(Parameters!CveConcepto.Value = 8, True, False) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 1.80136cm + 0.13678cm + 0cm + 20.28859cm + 13 + + + + + + 0.31558cm + 0.13678cm + 0cm + 20.28859cm + 14 + + + + + + 5.17097cm + 0.10068cm + 0cm + 20.3247cm + 15 + + + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox10 + 5.31209cm + 17.60787cm + 0.41981cm + 2.55292cm + 16 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm + - - - - - - Textbox3 - 3.71856cm - 0.2667cm - 0.6cm - 18.82013cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - CITRUS GAME - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - PROVEEDOR: - - - - =Parameters!ProveedorNombre.Value - - - - - - - - - - - =Parameters!ProveedorDireccion.Value - - - - - - - - - - - =Parameters!ProveedorTel.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - FECHA DE REGISTRO: - - - - - - - - =Parameters!FechaSolicitud.Value - - - - - - - - - - - =IIF(Parameters!FechaEntrega.Value = "01/01/0001", "",Parameters!FechaEntrega.Value) - - - - - - - - - 2pt - 2pt - 2pt - - - - true - true - - - - - DESCRIPCION: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Justificacion.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - =Parameters!Folio.Value - - - - - - - Textbox2 - 0.35576cm - 17.32766cm - 0.6cm - 1.75917cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No. - - - - - - - Textbox19 - 0.35576cm - 15.93891cm - 0.6cm - 1.38875cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 1.81941cm - - - 1.53649cm - - - 1.56801cm - - - 3.69311cm - - - 4.60683cm - - - 2.23066cm - - - 2.23935cm - - - 2.15605cm - - - - - 0.473cm - - - - - true - true - - - - - CANTIDAD - - - - - - - Textbox1 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - CODIGO - - - - - - - Textbox7 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - U.M - - - - - - - Textbox11 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - PRODUCTO - - - - - - - Textbox9 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - D E S C R I P C I O N - - - - - - - Textbox9 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Sub Proyecto - - - - - - - Textbox4 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - P. UNITARIO - - - - - - - Textbox13 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - IMPORTE - - - - - - - Textbox5 - - - - Black - - 1pt - - - Black - - 1pt - - #f5811c - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.38833cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!CodPS.Value - - - - - - - CodPS - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Producto.Value - - - - - - - Producto - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Obs.Value - - - - - - - Obs - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!SubProyecto.Value - - - - - - - SubProyecto - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total - - - 2pt - 2pt - 1pt - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 8.60072cm - 0.02288in - 0.86133cm - 19.84991cm - 8 - - - - - - Embedded - FK_Citrus_Game_Logo_Final_Art1 - FitProportional - 0.6985cm - 0.2667cm - 1.34991cm - 5.44588cm - 9 - - - - - - true - true - - - - - Uso CFDI 3.3: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsoCFDI.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 3.83563in - - - - - - true - - - - - =UCase(Parameters!ImporteLetra.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - I.V.A. - - - - - - - Textbox20 - 1.15061cm - 14.82865cm - 0.45183cm - 2.5cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - DESCUENTO: - - - - - - - Textbox20 - 0.69878cm - 14.82865cm - 0.45183cm - 2.5cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!IVA.Value - - - - - - - Textbox20 - 1.15061cm - 17.32865cm - 0.45183cm - 2.5cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Descuento.Value - - - - - - - Textbox20 - 0.69878cm - 17.32865cm - 0.45183cm - 2.5cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - SUB-TOTAL - - - - - - - Textbox20 - 0.24695cm - 14.82865cm - 0.45183cm - 2.5cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SubTotal.Value - - - - - - - Textbox20 - 0.22931cm - 17.32865cm - 0.45183cm - 2.5cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - - - true - true - - - - - TOTAL - - - - - - - Textbox20 - 0.02173cm - 0.45183cm - 2.5cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Total.Value - - - - - - - Textbox20 - 0.02173cm - 2.5cm - 0.45183cm - 2.5cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - 1.58071cm - 14.83218cm - 0.47356cm - 5cm - 8 - - =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value <= 0 And Parameters!RetISR.Value <= 0, False, True) - - - - - - - - - true - true - - - - - Ret IVA - - - - - - - Textbox20 - 0.52239cm - 0.45183cm - 2.5cm - - =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value > 0, False, True) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!RetIVA.Value - - - - - - - Textbox20 - 0.49769cm - 2.5cm - 0.45183cm - 2.5cm - 1 - - =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value > 0, False, True) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!RetISR.Value - - - - - - - Textbox20 - 0.9848cm - 2.50353cm - 0.45183cm - 2.5cm - 2 - - =Microsoft.VisualBasic.Interaction.iif(Parameters!RetISR.Value > 0, False, True) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Ret ISR - - - - - - - Textbox20 - 0.9848cm - 0.00353cm - 0.45183cm - 2.5cm - 3 - - =Microsoft.VisualBasic.Interaction.iif(Parameters!RetISR.Value > 0, False, True) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - TOTAL - - - - - - - Textbox20 - 1.43962cm - 0.00353cm - 0.45183cm - 2.5cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Total.Value - - - - - - - Textbox20 - 1.43962cm - 2.50353cm - 0.45183cm - 2.5cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - 1.49281cm - 14.82865cm - 1.92468cm - 5.02999cm - 9 - - =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value > 0 Or Parameters!RetISR.Value > 0, False, True) - - - - - - - - - - - 27.94cm - 21.59cm - 1cm - 0cm - 1cm - 1cm - 0.13cm - + + + + + + Textbox3 + 3.71856cm + 0.2667cm + 0.6cm + 18.82013cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CITRUS GAME + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + PROVEEDOR: + + + + =Parameters!ProveedorNombre.Value + + + + + + + + + + + =Parameters!ProveedorDireccion.Value + + + + + + + + + + + =Parameters!ProveedorTel.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + FECHA DE REGISTRO: + + + + + + + + =Parameters!FechaSolicitud.Value + + + + + + + + + + + =IIF(Parameters!FechaEntrega.Value = "01/01/0001", "",Parameters!FechaEntrega.Value) + + + + + + + + + 2pt + 2pt + 2pt + + + + true + true + + + + + DESCRIPCION: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Justificacion.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + =Parameters!Folio.Value + + + + + + + Textbox2 + 0.35576cm + 17.32766cm + 0.6cm + 1.75917cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. + + + + + + + Textbox19 + 0.35576cm + 15.93891cm + 0.6cm + 1.38875cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.81941cm + + + 1.53649cm + + + 1.56801cm + + + 3.69311cm + + + 4.60683cm + + + 2.23066cm + + + 2.23935cm + + + 2.15605cm + + + + + 0.473cm + + + + + true + true + + + + + CANTIDAD + + + + + + + Textbox1 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CODIGO + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + U.M + + + + + + + Textbox11 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + PRODUCTO + + + + + + + Textbox9 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + D E S C R I P C I O N + + + + + + + Textbox9 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sub Proyecto + + + + + + + Textbox4 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + P. UNITARIO + + + + + + + Textbox13 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IMPORTE + + + + + + + Textbox5 + + + + Black + + 1pt + + + Black + + 1pt + + #f5811c + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.38833cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!CodPS.Value + + + + + + + CodPS + + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Producto.Value + + + + + + + Producto + + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Obs.Value + + + + + + + Obs + + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!SubProyecto.Value + + + + + + + SubProyecto + + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + 2pt + 2pt + 1pt + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 8.60072cm + 0.02288in + 0.86133cm + 19.84991cm + 8 + + + + + + Embedded + FK_Citrus_Game_Logo_Final_Art1 + FitProportional + 0.6985cm + 0.2667cm + 1.34991cm + 5.44588cm + 9 + + + + + + true + true + + + + + Uso CFDI 3.3: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsoCFDI.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 3.83563in + + + + + + true + + + + + =UCase(Parameters!ImporteLetra.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + I.V.A. + + + + + + + Textbox20 + 1.15061cm + 14.82865cm + 0.45183cm + 2.5cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + DESCUENTO: + + + + + + + Textbox20 + 0.69878cm + 14.82865cm + 0.45183cm + 2.5cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IVA.Value + + + + + + + Textbox20 + 1.15061cm + 17.32865cm + 0.45183cm + 2.5cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Descuento.Value + + + + + + + Textbox20 + 0.69878cm + 17.32865cm + 0.45183cm + 2.5cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SUB-TOTAL + + + + + + + Textbox20 + 0.24695cm + 14.82865cm + 0.45183cm + 2.5cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox20 + 0.22931cm + 17.32865cm + 0.45183cm + 2.5cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + TOTAL + + + + + + + Textbox20 + 0.02173cm + 0.45183cm + 2.5cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Total.Value + + + + + + + Textbox20 + 0.02173cm + 2.5cm + 0.45183cm + 2.5cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 1.58071cm + 14.83218cm + 0.47356cm + 5cm + 8 + + =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value <= 0 And Parameters!RetISR.Value <= 0, False, True) + + + + + + + + + true + true + + + + + Ret IVA + + + + + + + Textbox20 + 0.52239cm + 0.45183cm + 2.5cm + + =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value > 0, False, True) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!RetIVA.Value + + + + + + + Textbox20 + 0.49769cm + 2.5cm + 0.45183cm + 2.5cm + 1 + + =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value > 0, False, True) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!RetISR.Value + + + + + + + Textbox20 + 0.9848cm + 2.50353cm + 0.45183cm + 2.5cm + 2 + + =Microsoft.VisualBasic.Interaction.iif(Parameters!RetISR.Value > 0, False, True) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Ret ISR + + + + + + + Textbox20 + 0.9848cm + 0.00353cm + 0.45183cm + 2.5cm + 3 + + =Microsoft.VisualBasic.Interaction.iif(Parameters!RetISR.Value > 0, False, True) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + TOTAL + + + + + + + Textbox20 + 1.43962cm + 0.00353cm + 0.45183cm + 2.5cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Total.Value + + + + + + + Textbox20 + 1.43962cm + 2.50353cm + 0.45183cm + 2.5cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 1.49281cm + 14.82865cm + 1.92468cm + 5.02999cm + 9 + + =Microsoft.VisualBasic.Interaction.iif(Parameters!RetIVA.Value > 0 Or Parameters!RetISR.Value > 0, False, True) + + + + + + + + + + + 27.94cm + 21.59cm + 1cm + 0cm + 1cm + 1cm + 0.13cm + - - - - - - - - - - - - - - - Textbox4 - 0.62364cm - 1.5139in - 0.24366in - 5.57778in - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 1.93198cm - - - 2.02877cm - - - 1.87559cm - - - 7.85114cm - - - 1.69062cm - - - 2.1371cm - - - 2.51819cm - - - - - 0.52063cm - - - - - true - - - - - Cantidad - - - - - - - Textbox34 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Unidad - - - - - - - Textbox53 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave - - - - - - - Textbox20 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox79 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - % Desc - - - - - - - Textbox7 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - P/U - - - - - - - Textbox84 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Importe - - - - - - - - - - - - - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.4148cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Descuento.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value*Fields!PU.Value - - - - - - - Textbox88 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 0.08406cm - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!CveUnidadMedida.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - Before - - - - DsOC - 5.52595cm - 0.49766cm - 1.01949cm - 20.03339cm - 1 - - - - - - - - - 3.01975cm - - - - - 0.6cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.56368cm - - - true - true - - - - - =Fields!ImpuestoLocal.Value - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - DataSet1 - 6.68655cm - 14.94762cm - 0.6cm - 5.58343cm - 2 - - - - - - true - true - - - - - =UCase(Parameters!ImporteLetra.Value) - - - - - - - ImporteLetra - 3.31099in - 0.19593in - 0.24069in - 7.88716in - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - 6.72183cm - 14.94762cm - 0cm - 5.58342cm - 4 - - - - - - 7.28655cm - 14.94763cm - 0cm - 5.58342cm - 5 - - - - - - true - - - - - Domicilio fiscal - - - - - - - - R.F.C. : - - - - RACV72060972A - - - - COTIZACION No.: - - - - - - - - =Parameters!Folio.Value - - - - - - - - - Calle: CIPRES No. 9924 Int: 3, Col. CUBILLAS, CP: 22045, TIJUANA, BAJA CALIFORNIA, - - - - =CDate(Parameters!Fecha.Value) - - - - - - - - - MEXICO - - - - - - - - - Lugar de expedición - - - - - - - - - =Parameters!DomicilioSucursal.Value - - - - - - - - - Cliente : - - - - =Parameters!ClienteNombre.Value - - - - - - - - - =Parameters!ClienteDireccion.Value - - - - , - - - - =Parameters!ClienteCiudad.Value - - - - , - - - - =Parameters!ClienteEstado.Value - - - - , RFC: - - - - =Parameters!ClienteRFC.Value - - - - , Teléfono: - - - - =Parameters!ClienteTelefono.Value - - - - - - - - - Vendedor : - - - - =Parameters!VendedorNombre.Value - - - - - - - - - Enviar a: - - - - =Parameters!EnvioContacto.Value - - - - - - - Textbox10 - 0.54474in - 0.95655in - 1.56138in - 7.12654in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - 9.32742cm - + + + + + + Textbox1 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UNIDAD + + + + + + + Textbox15 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox9 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + OBSERVACIONES + + + + + + + Textbox17 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + P.U. + + + + + + + Textbox13 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IMPORTE + + + + + + + Textbox5 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.25in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value*Fields!PU.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 3.49009in + 0.13746in + 0.5in + 7.1093in + + + + + + true + true + + + + + Atención a: + + + + =Parameters!ClienteContacto.Value + + + + + + + + + Empresa: + + + + =Parameters!ClienteNombre.Value + + + + + + + + + Teléfono: + + + + =Parameters!ClienteTelefono.Value + + + + + + + Textbox4 + 5.52105cm + 3.76464in + 2.00758cm + 8.84471cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha: + + + + =Parameters!FechaSolicitud.Value + + + + + + + + + No.Cotización: + + + + + + + + =Parameters!Folio.Value + + + + + + + + + + + Textbox4 + 2.11526cm + 12.26628cm + 1.47842cm + 6.14066cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CLIENTE + + + + + + + Textbox2 + 5.00423cm + 9.56206cm + 0.51682cm + 8.84471cm + 3 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COTIZACIÓN + + + + + + + Textbox12 + 1.59844cm + 12.26624cm + 0.51682cm + 6.14066cm + 4 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + I.V.A. + + + + + + + Textbox20 + 14.3789cm + 13.44208cm + 0.45183cm + 2.5cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + TOTAL: + + + + + + + Textbox20 + 14.83074cm + 13.44208cm + 0.45183cm + 2.5cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SUB-TOTAL 2: + + + + + + + Textbox20 + 13.92707cm + 13.44208cm + 0.45183cm + 2.5cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IVA.Value + + + + + + + Textbox20 + 14.3789cm + 15.94208cm + 0.45183cm + 2.5cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Total.Value + + + + + + + Textbox20 + 14.83074cm + 15.94208cm + 0.45183cm + 2.5cm + 9 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SubTotal2.Value + + + + + + + Textbox20 + 13.92707cm + 15.94208cm + 0.45183cm + 2.5cm + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + DESCUENTOS: + + + + + + + Textbox20 + 13.47524cm + 13.44208cm + 0.45183cm + 2.5cm + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Descuento.Value + + + + + + + Textbox20 + 13.47524cm + 15.94208cm + 0.45183cm + 2.5cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Son: + + + + =Parameters!ImporteLetra.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VICTOR MANUEL RAMIREZ CASTILLO + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 5.09864in + 0.15135in + 0in + 7.10935in + 15 + + 2pt + + + + + true + true + + + + + SUB-TOTAL: + + + + + + + Textbox20 + 13.02111cm + 13.44208cm + 0.45183cm + 2.5cm + 16 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox20 + 13.02111cm + 15.94218cm + 0.45183cm + 2.5cm + 17 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + LogoMTT + FitProportional + 0.51958in + 0.15135in + 1.39503in + 3.70488in + 18 + + + + + + 15.55229cm + 5.29216in + 0cm + 5.00022cm + 19 + + 2pt + + + + + Embedded + VISTAPREVIA22 + FitProportional + 0.01389in + 7.40306in + 6.34944in + 0.09753in + 20 + + =IIf(Parameters!CveVenta.Value > 0, True,False) + + + + + + + 6.36333in + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + I + + + + mpresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox23 + 2.41298in + 3.7507in + 0.25in + 1.67093in + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox24 + 2.41298in + 6.35981in + 0.25in + 1in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + NOMBRE Y FIRMA DE AUTORIZACIÓN + + + + + + + Textbox2 + 3.11862cm + 0.31387cm + 0.51682cm + 8.84471cm + 5 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + + Textbox4 + 3.63544cm + 0.12362in + 2.00758cm + 8.84471cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Precios unitarios, no incluyen IVA + + + + + + + + + No devolución, no cancelación una vez hecho el pedido + + + + + + + + + Todo pedido requiere Orden de Compra o mail de confirmación + + + + + + + + + Precios sujetos a cambio sin previo aviso + + + + + + + + + Cotización sujeta a disponibilidad + + + + + + + + + Vigencia de cotización: + + + + =Parameters!Vigencia.Value + + + + + + + + + Condiciones de pago: + + + + =Parameters!CondicionPago.Value + + + + + + + Textbox20 + 0.61902cm + 10.16523cm + 3.01642cm + 8.19687cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!VendedorNombre.Value + + + + + + + +Celular: + + + + ="(" & Parameters!VendedorCelular.Value.ToString().Substring(0,3) & ") " & Parameters!VendedorCelular.Value.ToString().Substring(3) + + + + + + + =Parameters!VendedorMail.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + 0.35444cm + 0cm + 0.12347cm + 19.05149cm + 9 + + = iif(Globals!PageNumber=Globals!TotalPages, false,true) + + + + + + + + + + + 11.69in + 8.27in + 0.25in + 0.25in + 0.25in + 0.5in + - - - - - - - - - - - - - - - Textbox4 - 0.03532cm - 1.39809in - 0.24366in - 5.03179in - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - RFC: RACV72060972A - - - - - - - - - Regimen Fiscal - - - - - - - - (612)Personas Físicas con Actividades Empresariales - - - - - - - Textbox10 - 0.26614in - 1.39809in - 0.3218in - 3.4585in - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Calle: CIPRES No. 9924 Int: 3, Col. CUBILLAS, CP: 22045, TIJUANA, BAJA CALIFORNIA, MEXICO - - - - - - - Textbox10 - 0.26614in - 4.85658in - 0.3218in - 2.55429in - 2 - - - Top - - - - - - true - true - - - - - Por éste pagare prometo (emos) pagar incondicionalmente a la orden de VICTOR MANUEL RAMIREZ CASTILLO el día: - - - - =Parameters!Vencimiento.Value - - - - en Tijuana, Baja California, Mexico, o domicilio que se requiera, la cantidad de: - - - - =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) - - - - $ - - - - =Parameters!Total.Value - - - - la falta de pago de este documento dara derecho a VICTOR MANUEL RAMIREZ CASTILLO a cobrar 5% mensual de intereses moratorios hasta su total liquidación. - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ACEPTO (NOMBRE Y FIRMA) - - - - - - - Textbox69 - 1.09894in - 4.07862in - 0.35417in - 2.41245in - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - 2.7913cm - 10.3597cm - 0cm - 6.12762cm - 3 - - - - - - true - true - - - - - Serie: - - - - =Parameters!Serie.Value - - - - - - - =Parameters!Folio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - 17.59343cm - 0.23734cm - 4.4453cm - 20.06179cm - 3 - - = (Parameters!AplicaPagare.Value="0" ORelse Parameters!AplicaPagare.Value="") - - - - - - - - - - 1.93198cm - - - 2.02877cm - - - 1.87559cm - - - 7.85114cm - - - 1.69062cm - - - 2.1371cm - - - 2.51819cm - - - - - 0.52063cm - - - - - true - - - - - Cantidad - - - - - - - Textbox34 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Unidad - - - - - - - Textbox53 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave - - - - - - - Textbox20 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox79 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - % Desc - - - - - - - Textbox7 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - P/U - - - - - - - Textbox84 - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Importe - - - - - - - - - - - - - - - - Black - 1.5pt - - - Black - 1.5pt - - - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.4148cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - Textbox21 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value &Fields!Obs.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value*Fields!PU.Value - - - - - - - Textbox88 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 0.08406cm - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - Before - - - - DsOC - 5.71406cm - 0.23735cm - 1.01949cm - 20.03339cm - 4 - - - - - - - - - 3.01975cm - - - - - 0.6cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.56368cm - - - true - true - - - - - =Fields!ImpuestoLocal.Value - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - DataSet1 - 6.87466cm - 14.68731cm - 0.6cm - 5.58343cm - 5 - - - - - - true - - - - - Datos del cliente - - - - - - - Textbox10 - 0.58793in - 1.39809in - 0.19681in - 3.03906in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Comprobante fiscal digital - - - - (I)Ingreso - - - - - - - Textbox10 - 0.58793in - 4.5066in - 0.29749in - 2.90428in - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - RFC: - - - - =Parameters!ClienteRFC.Value - - - - - - - - - Dirección: - - - - - - - - - =Parameters!ClienteDireccion.Value - - - - - - - Textbox10 - 0.81251in - 1.39809in - 0.89125in - 3.03906in - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Serie: - - - - =Parameters!Serie.Value - - - - - - - - Folio: - - - - =Parameters!Folio.Value - - - - - - - - - Fecha y hora: - - - - =Parameters!Fecha.Value - - - - - - - - - Lugar de expedición: - - - - =Parameters!DomicilioSucursal.Value - - - - - - - - - Forma de pago: - - - - =Parameters!FormaPago.Value - - - - - - - - - Uso de CFDI - - - - =Parameters!UsoCFDI.Value - - - - - - - - - Version de Comprobante - - - - 3.3 - - - - - - - Textbox10 - 0.8125in - 4.52807in - 0.89126in - 2.88281in - 9 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Enviar a: - - - - =Parameters!EnvioContacto.Value - - - - - - - - - Dirección de envío: - - - - =Parameters!EnvioDireccion.Value - - - - - - - Textbox10 - 1.70376in - 0.09344in - 0.37389in - 4.34371in - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!QR.Value - FitProportional - 2.70656in - 0.15524in - 0.95455in - 1.49755in - 11 - - - - - - true - - - - - BBVA Bancomer (Pesos) CTA. 0169 7737 03 CLABE 0120 2800 1697 7370 30 - - - - - - - - - BBVA Bancomer (Dólares) CTA. 0187 1574 28 CLABE 0120 2800 1871 5742 84 - - - - - - - Textbox10 - 4.05283in - 0.15524in - 0.37389in - 4.70134in - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - "Este documento es una representación impresa de un CFDI" - - - - - - - - - Folio fiscal: - - - - =Parameters!FolioFiscal.Value - - - - - - - - Fecha y hora de certificación: - - - - =Parameters!FechaCertificacion.Value - - - - - - - - - Sello digital del CFDI: - - - - - - - - - =Parameters!SelloCFDI.Value - - - - - - - - - Número de serie del Certificado de Sello Digital : - - - - - - - - Número de serie del Certificado de Sello Digital del SAT: - - - - - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - - - Cadena original del complemento de certificación digital del SAT: - - - - - - - - - =Parameters!CadenaOriginal.Value - - - - - - - - - Sello digital del SAT: - - - - - - - - - =Parameters!SelloSAT.Value - - - - - - - - - - - - - - - - Textbox10 - 4.49616in - 0.09344in - 2.10306in - 7.84119in - 13 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =UCase(Parameters!ImporteLetra.Value) - - - - - - - ImporteLetra - 3.82255in - 1.91243in - 0.18861in - 6.06817in - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - 6.90994cm - 14.68731cm - 0cm - 5.58342cm - 15 - - - - - - 7.47466cm - 14.68732cm - 0cm - 5.58342cm - 16 - - - - - - true - - - - - Pedido: - - - - - - - Textbox10 - 1.70376in - 4.52807in - 0.37389in - 1.44266in - 17 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Vendedor: - - - - - - - Textbox10 - 1.70376in - 6.0124in - 0.37389in - 1.39848in - 18 - - - 2pt - 2pt - 2pt - 2pt - - - - 22.03873cm - + + + + + + Textbox3 + 1.37762in + 5.662in + 0.5cm + 2.24597in + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Fecha y hora de emisión + + + + + + + + + + + + + + + + Textbox3 + 0.93484in + 5.662in + 0.5cm + 2.24597in + 1 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) + + + + + + + Textbox3 + 0.69525in + 5.662in + 0.60856cm + 2.24597in + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!TipoDocumento.Value + + + + + + + Textbox3 + 1.23676cm + 5.662in + 0.5cm + 2.24597in + 3 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + VICTOR MANUEL RAMIREZ CASTILLO + + + + + + + + + R.F.C RACV72060972A + + + + + + + + + + + + + + + + Textbox4 + 1.19556cm + 1.94469in + 0.51102in + 3.69231in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 5.87436in + 0.03915in + 0.95455in + 1.49755in + 5 + + + + + + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox3 + 1.13169in + 5.662in + 0.25114in + 2.24597in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!Tipo.Value & Parameters!Ref.Value + + + + + + + Textbox3 + 1.57434in + 5.662in + 0.25635in + 2.24597in + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Domicilio Fiscal + + + + + + + + + CIPRES, No. Ext. 9924, No. Int. 3, Col.: CUBILLAS, C.P.: 22045, TIJUANA, BAJA CALIFORNIA, México. + + + + + + + Textbox10 + 0.98172in + 1.48781in + 0.65513in + 2.06754in + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Lugar de Expedición + + + + + + + + + =Parameters!DomicilioSucursal.Value + + + + + + + Textbox10 + 0.98172in + 3.64748in + 0.65513in + 1.93674in + 9 + + + Top + + + + true + true + + + + + Nombre + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Dirección + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Ciudad + + + + + + + + 1.25pt + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteLugar.Value + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal: + + + + + + + Textbox54 + 5.85221in + 1.64301in + 0.18056in + 4.02952in + 16 + + + + + + + White + + + + + + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. Serie del Certificado del SAT: + + + + + + + Textbox54 + 6.04666in + 1.64301in + 0.18056in + 4.03672in + 17 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora de certificación: + + + + + + + Textbox54 + 6.24521in + 1.64301in + 0.19444in + 4.03672in + 18 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Certificado del Contribuyente: + + + + + + + Textbox54 + 6.45082in + 1.64301in + 0.19445in + 4.03672in + 19 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaCertificacion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Régimen: Sociedad Anónima de Capital Variable; Condiciones de pago: + + + + =IIF(Parameters!CondicionPago.Value.ToString="","No Identificado",Parameters!CondicionPago.Value) + + + + ; Método de Pago: + + + + =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) + + + + ; Num. Cta Pago: + + + + =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Éste documento es una representación impresa de un CFDi + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + P A G A R E con Folio + + + + =Parameters!Serie.Value + + + + - + + + + =Parameters!Folio.Value + + + + Por éste pagare prometo (emos) pagar incondicionalmente a la orden de Localización Precisa GPS de México SA de CV, a su vencimiento el + + + + =Parameters!Vencimiento.Value + + + + , en Hermosillo, Sonora o en el domicilio señalado a elección del acreedor o tenedor la cantidad de $ + + + + =Parameters!Total.Value + + + + SON: ( + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + ). Valor recibido a mi (nuestra) entera satisfacción. La falta de pago de éste documento a su vencimiento dará derecho a Localización Precisa GPS de México SA de CV o tenedor, desde el día siguiente a cobrar el 10% mensual de interes moratorios hasta su total liquidación y los gastos judiciales que se ocasionen. Lugar y Fecha de Suscripción: Hermosillo, Sonora a + + + + =CDATE(Parameters!Fecha.Value).ToString("dd/MM/yyyy") + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Nombre: + + + + =Parameters!ClienteNombre.Value + + + + + + + =Parameters!ClienteDireccion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Acepto de conformidad + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.29357cm + 0.09963cm + 0cm + 0.57653cm + 3 + + + + + + 0.29357cm + 0.73559cm + 0cm + 0.57653cm + 4 + + + + + + 0.29357cm + 1.35545cm + 0cm + 0.57653cm + 5 + + + + + + 0.29357cm + 1.80439cm + 0cm + 0.57653cm + 6 + + + + + + 0.29357cm + 2.37686cm + 0cm + 0.57653cm + 7 + + + + + + 0.29357cm + 3.01789cm + 0cm + 0.57653cm + 8 + + + + + + 0.29357cm + 3.65558cm + 0cm + 0.57653cm + 9 + + + + + + 0.29357cm + 4.29154cm + 0cm + 0.57653cm + 10 + + + + + + 0.29357cm + 4.92728cm + 0cm + 0.57653cm + 11 + + + + + + 0.29357cm + 5.25981cm + 0cm + 0.57653cm + 12 + + + + + + 0.29357cm + 5.89576cm + 0cm + 0.57653cm + 13 + + + + + + 0.29357cm + 6.50505cm + 0cm + 0.57653cm + 14 + + + + + + 0.29357cm + 7.18531cm + 0cm + 0.57653cm + 15 + + + + + + 0.29357cm + 7.82127cm + 0cm + 0.57653cm + 16 + + + + + + 0.29357cm + 8.48346cm + 0cm + 0.57653cm + 17 + + + + + + 0.29357cm + 8.81599cm + 0cm + 0.57653cm + 18 + + + + + + 0.29357cm + 9.45195cm + 0cm + 0.57653cm + 19 + + + + + + 0.29357cm + 10.11415cm + 0cm + 0.57653cm + 20 + + + + + + 0.29357cm + 14.08927cm + 0cm + 0.57653cm + 21 + + + + + + 0.29357cm + 14.72523cm + 0cm + 0.57653cm + 22 + + + + + + 0.29357cm + 15.33451cm + 0cm + 0.57653cm + 23 + + + + + + 0.29357cm + 15.64058cm + 0cm + 0.57653cm + 24 + + + + + + 0.29357cm + 16.27654cm + 0cm + 0.57653cm + 25 + + + + + + 0.29357cm + 16.91228cm + 0cm + 0.57653cm + 26 + + + + + + 0.29357cm + 10.76463cm + 0cm + 0.57653cm + 27 + + + + + + 0.29357cm + 11.42705cm + 0cm + 0.57653cm + 28 + + + + + + 0.29357cm + 12.06279cm + 0cm + 0.57653cm + 29 + + + + + + 0.29357cm + 12.36886cm + 0cm + 0.57653cm + 30 + + + + + + 0.29357cm + 12.89898cm + 0cm + 0.57653cm + 31 + + + + + + 0.29357cm + 13.53472cm + 0cm + 0.57653cm + 32 + + + + + + 0.29357cm + 18.40663cm + 0cm + 0.57653cm + 33 + + + + + + 0.29357cm + 19.04259cm + 0cm + 0.57653cm + 34 + + + + + + 0.29357cm + 17.74353cm + 0cm + 0.57653cm + 35 + + + + + + 3.29402cm + 15.33451cm + 0cm + 4.58211cm + 36 + + + + + + true + 21.54349cm + 0.04398cm + 4.04843cm + 20.06179cm + 26 + + = (Parameters!AplicaPagare.Value="0" ORelse Parameters!AplicaPagare.Value="") + + + + + + + + + + 2.12527cm + + + 2.02474cm + + + 10.17786cm + + + 2.52862cm + + + 3.15415cm + + + + + 0.52063cm + + + + + true + + + + + Cantidad + + + + + + + Textbox34 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Unidad + + + + + + + Textbox53 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Descripción + + + + + + + Textbox79 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + P. Unitario + + + + + + + Textbox84 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Importe + + + + + + + + + + + + + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.4148cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM1 + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value &Fields!Obs.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value*Fields!PU.Value + + + + + + + Textbox88 + + + + + + + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 0.13698cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + + + + + + Before + + + + DsOC + 5.75246cm + 0.11468cm + 1.07241cm + 20.01064cm + 27 + + + + + + true + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.81245in + + + 0.69098in + + + 0.69475in + + + + + 0.19645in + + + + + true + true + + + + + Impuesto + + + + + + + Textbox22 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tasa + + + + + + + Textbox15 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox29 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.14436in + + + + + true + true + + + + + =Fields!Impuesto.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!tasa.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Codigo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet3 + 3.00662in + 5.73412in + 0.34081in + 2.19818in + 29 + + + + + + + + + 3.01975cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.56368cm + + + true + true + + + + + =Fields!ImpuestoLocal.Value + + + + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + DataSet1 + 6.91306cm + 14.56464cm + 0.6cm + 5.58343cm + 30 + + + + + + + + + 3.33888cm + + + 11.00525cm + + + + + 0.6cm + + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + + Textbox128 + + + + + + + + + + + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + 0.6cm + + + + + true + true + + + + + Importe con letra: + + + + + + + Textbox126 + + + + + + + + + + + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + ="SON: " & Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + + + + Textbox127 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Forma de pago: + + + + + + + Textbox130 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + + Textbox131 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Uso CFDI: + + + + + + + Textbox15 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!UsoCFDI.Value + + + + + + + Textbox17 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 1.56188cm + + + + + true + true + + + + + Sello digital del CFDI: + + + + + + + Textbox132 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + + Textbox133 + + + Top + 2pt + 2pt + 2pt + 2pt + + + + + + + + 1.2cm + + + + + true + true + + + + + Sello del SAT: + + + + + + + Textbox134 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + + Textbox135 + + + Top + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Cadena original del complemento de certificación digital del SAT: + + + + + + + Textbox136 + + + + + + + + + + + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + DsOC + 6.91306cm + 0.11468cm + 5.76188cm + 14.34413cm + 31 + + + + + + true + true + + + + + =Parameters!CadenaOriginal.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.11382cm + 0.05336cm + 0.54004cm + 20.00281cm + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.83025cm + 4.33636cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.39643cm + 2.83462cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + true + + + + + VERSION 3.3 + + + + + + + Textbox5 + 2.28775cm + 17.08931cm + 0.6cm + 3.06609cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 18.27471cm + 0.05568cm + 2.97096cm + 20.1554cm + 33 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + + + Embedded + VISTAPREVIA22 + FitProportional + 0cm + 19.87567cm + 18.27471cm + 0.33541cm + 34 + + =IIf(Parameters!CveVenta.Value > 0, True,False) + + + + + + + Embedded + LogoMTT + FitProportional + 1.19556cm + 0.14361cm + 1.67893cm + 4.7959cm + 35 + + + + + + true + + + + + BBVA Bancomer (Pesos) CTA. 0169 7737 03 CLABE 0120 2800 1697 7370 30 + + + + + + + + + BBVA Bancomer (Dólares) CTA. 0187 1574 28 CLABE 0120 2800 1871 5742 84 + + + + + + + Textbox10 + 5.43665in + 0.04515in + 0.37389in + 4.70134in + 36 + + + 2pt + 2pt + 2pt + 2pt + + + + 25.59192cm + + + + + + + Textbox3 + 0.92083in + 5.662in + 0.5cm + 2.24597in + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Fecha y hora de emisión + + + + + + + + + + + + + + + + Textbox3 + 0.47805in + 5.662in + 0.5cm + 2.24597in + 1 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) + + + + + + + Textbox3 + 0.23846in + 5.662in + 0.60856cm + 2.24597in + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!TipoDocumento.Value + + + + + + + Textbox3 + 0.07652cm + 5.662in + 0.5cm + 2.24597in + 3 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 4.99488in + 0.04026in + 0.95455in + 1.49755in + 4 + + + + + + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox3 + 0.6749in + 5.662in + 0.25114in + 2.24597in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!Tipo.Value & Parameters!Ref.Value + + + + + + + Textbox3 + 1.11755in + 5.662in + 0.25635in + 2.24597in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Lugar de Expedición + + + + + + + + + =Parameters!DomicilioSucursal.Value + + + + + + + Textbox10 + 0.52493in + 3.64748in + 0.65513in + 1.93674in + 7 + + + Top + + + + true + true + + + + + Nombre + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Dirección + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Ciudad + + + + + + + + 1.25pt + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteLugar.Value + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal: + + + + + + + Textbox54 + 4.97273in + 1.64412in + 0.18056in + 4.03672in + 14 + + + + + + + White + + + + + + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. Serie del Certificado del SAT: + + + + + + + Textbox54 + 5.16718in + 1.64412in + 0.18056in + 4.03672in + 15 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora de certificación: + + + + + + + Textbox54 + 5.36573in + 1.64412in + 0.19444in + 4.03672in + 16 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Certificado del Contribuyente: + + + + + + + Textbox54 + 5.57134in + 1.64412in + 0.19445in + 4.03672in + 17 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaCertificacion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Regímen: Sociedad Anonima de Capital Variable; Condiciones de pago: + + + + =IIF(Parameters!CondicionPago.Value.ToString="","No Identificado",Parameters!CondicionPago.Value) + + + + ; Método de Pago: + + + + =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) + + + + ; Num. Cta Pago: + + + + =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Éste documento es una representacion impresa de un CFDi + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + P A G A R E con Folio + + + + =Parameters!Serie.Value + + + + - + + + + =Parameters!Folio.Value + + + + Por éste pagare prometo (emos) pagar incondicionalmente a la orden de Localización precisa GPS de México SA DE CV, a su vencimiento el + + + + =Parameters!Vencimiento.Value + + + + , en Hermosillo, Sonora o en el domicilio señalado a elección del acreedor o tenedor la cantidad de $ + + + + =Parameters!Total.Value + + + + SON: ( + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + ). Valor recibido a mi (nuestra) entera satisfacción. la falta de pago de éste documento a su vencimiento dará derecho a Localización precisa GPS de México SA DE CV o tenedor, desde el día siguiente a cobrar el 10% mensual de interes moratorios hasta su total liquidación y los gastos judiciales que se ocasionen. Lugar y Fecha de Suscripción: Hermosillo, Sonora a + + + + =CDATE(Parameters!Fecha.Value).ToString("dd/MM/yyyy") + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Nombre: + + + + =Parameters!ClienteNombre.Value + + + + + + + =Parameters!ClienteDireccion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Acepto de conformidad + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.29357cm + 0.09963cm + 0cm + 0.57653cm + 3 + + + + + + 0.29357cm + 0.73559cm + 0cm + 0.57653cm + 4 + + + + + + 0.29357cm + 1.35545cm + 0cm + 0.57653cm + 5 + + + + + + 0.29357cm + 1.80439cm + 0cm + 0.57653cm + 6 + + + + + + 0.29357cm + 2.37686cm + 0cm + 0.57653cm + 7 + + + + + + 0.29357cm + 3.01789cm + 0cm + 0.57653cm + 8 + + + + + + 0.29357cm + 3.65558cm + 0cm + 0.57653cm + 9 + + + + + + 0.29357cm + 4.29154cm + 0cm + 0.57653cm + 10 + + + + + + 0.29357cm + 4.92728cm + 0cm + 0.57653cm + 11 + + + + + + 0.29357cm + 5.25981cm + 0cm + 0.57653cm + 12 + + + + + + 0.29357cm + 5.89576cm + 0cm + 0.57653cm + 13 + + + + + + 0.29357cm + 6.50505cm + 0cm + 0.57653cm + 14 + + + + + + 0.29357cm + 7.18531cm + 0cm + 0.57653cm + 15 + + + + + + 0.29357cm + 7.82127cm + 0cm + 0.57653cm + 16 + + + + + + 0.29357cm + 8.48346cm + 0cm + 0.57653cm + 17 + + + + + + 0.29357cm + 8.81599cm + 0cm + 0.57653cm + 18 + + + + + + 0.29357cm + 9.45195cm + 0cm + 0.57653cm + 19 + + + + + + 0.29357cm + 10.11415cm + 0cm + 0.57653cm + 20 + + + + + + 0.29357cm + 14.08927cm + 0cm + 0.57653cm + 21 + + + + + + 0.29357cm + 14.72523cm + 0cm + 0.57653cm + 22 + + + + + + 0.29357cm + 15.33451cm + 0cm + 0.57653cm + 23 + + + + + + 0.29357cm + 15.64058cm + 0cm + 0.57653cm + 24 + + + + + + 0.29357cm + 16.27654cm + 0cm + 0.57653cm + 25 + + + + + + 0.29357cm + 16.91228cm + 0cm + 0.57653cm + 26 + + + + + + 0.29357cm + 10.76463cm + 0cm + 0.57653cm + 27 + + + + + + 0.29357cm + 11.42705cm + 0cm + 0.57653cm + 28 + + + + + + 0.29357cm + 12.06279cm + 0cm + 0.57653cm + 29 + + + + + + 0.29357cm + 12.36886cm + 0cm + 0.57653cm + 30 + + + + + + 0.29357cm + 12.89898cm + 0cm + 0.57653cm + 31 + + + + + + 0.29357cm + 13.53472cm + 0cm + 0.57653cm + 32 + + + + + + 0.29357cm + 18.40663cm + 0cm + 0.57653cm + 33 + + + + + + 0.29357cm + 19.04259cm + 0cm + 0.57653cm + 34 + + + + + + 0.29357cm + 17.74353cm + 0cm + 0.57653cm + 35 + + + + + + 3.29402cm + 15.33451cm + 0cm + 4.58211cm + 36 + + + + + + true + 16.08168cm + 0.13016cm + 4.04843cm + 20.06179cm + 24 + + = (Parameters!AplicaPagare.Value="0" ORelse Parameters!AplicaPagare.Value="") + + + + + + + + + + 2.12527cm + + + 2.02474cm + + + 10.17786cm + + + 2.52862cm + + + 3.15415cm + + + + + 0.52063cm + + + + + true + + + + + Cantidad + + + + + + + Textbox34 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Unidad + + + + + + + Textbox53 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Descripción + + + + + + + Textbox79 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + P. Unitario + + + + + + + Textbox84 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Importe + + + + + + + + + + + + + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.4148cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM1 + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value &Fields!Obs.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value*Fields!PU.Value + + + + + + + Textbox88 + + + + + + + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 0.13698cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + + + + + + Before + + + + DsOC + 4.59222cm + 0.11468cm + 1.07241cm + 20.01064cm + 25 + + + + + + true + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.81245in + + + 0.69098in + + + 0.69475in + + + + + 0.19645in + + + + + true + true + + + + + Impuesto + + + + + + + Textbox22 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tasa + + + + + + + Textbox15 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox29 + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.14436in + + + + + true + true + + + + + =Fields!Impuesto.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!tasa.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Codigo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet3 + 2.54983in + 5.73412in + 0.34081in + 2.19818in + 27 + + + + + + + + + 3.01975cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.56368cm + + + true + true + + + + + =Fields!ImpuestoLocal.Value + + + + + + #ff1037 + 2pt + 2pt + 2pt + 2pt + + + + + + + + DataSet1 + 5.75282cm + 14.56464cm + 0.6cm + 5.58343cm + 28 + + + + + + + + + 3.33888cm + + + 11.00525cm + + + + + 0.6cm + + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + + Textbox128 + + + + + + + + + + + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + 0.6cm + + + + + true + true + + + + + Importe con letra: + + + + + + + Textbox126 + + + + + + + + + + + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + ="SON: " & Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + + + + Textbox127 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Forma de pago: + + + + + + + Textbox130 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + + Textbox131 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Uso CFDI: + + + + + + + Textbox15 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!UsoCFDI.Value + + + + + + + Textbox17 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 1.56188cm + + + + + true + true + + + + + Sello digital del CFDI: + + + + + + + Textbox132 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + + Textbox133 + + + Top + 2pt + 2pt + 2pt + 2pt + + + + + + + + 1.2cm + + + + + true + true + + + + + Sello del SAT: + + + + + + + Textbox134 + + + + + 1pt + + + + 1pt + + + + 1pt + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + + Textbox135 + + + Top + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Cadena original del complemento de certificación digital del SAT: + + + + + + + Textbox136 + + + + + + + + + + + + + + 1pt + + #ff1037 + Middle + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + DsOC + 5.75282cm + 0.11468cm + 5.76188cm + 14.34413cm + 29 + + + + + + true + true + + + + + =Parameters!CadenaOriginal.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + LogoMTT + FitProportional + 0.07652cm + 0.10128cm + 1.67893cm + 4.7959cm + 31 + + + + + + true + + + + + VICTOR MANUEL RAMIREZ CASTILLO + + + + + + + + + R.F.C RACV72060972A + + + + + + + + + + + + + + + + Textbox4 + 0.07652cm + 1.92802in + 0.51102in + 3.69231in + 32 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + Domicilio Fiscal + + + + + + + + + CIPRES, No. Ext. 9924, No. Int. 3, Col.: CUBILLAS, C.P.: 22045, TIJUANA, BAJA CALIFORNIA, México. + + + + + + + Textbox10 + 0.52493in + 1.47114in + 0.65513in + 2.06754in + 33 + + + 2pt + 2pt + 2pt + 2pt + + + + 20.27828cm + @@ -567,10 +567,10 @@ 0.82291in - true true @@ -699,7 +698,7 @@ Textbox18 - 2.83214cm + 3.14964cm 2.30482cm 0.6cm 9.54145cm @@ -731,7 +730,7 @@ Textbox16 - 2.843cm + 3.1605cm 0.14172cm 0.6cm 2.11724cm @@ -766,7 +765,7 @@ Textbox14 - 2.09104cm + 2.40854cm 0.12931cm 0.6cm 2.12965cm @@ -872,7 +871,7 @@ Textbox4 - 2.84301cm + 3.16051cm 12.17799cm 0.59999cm 1.80326cm @@ -888,7 +887,6 @@ - true true @@ -904,10 +902,10 @@ Textbox6 - 2.09105cm + 2.40855cm 13.98125cm 0.6cm - 3.94849cm + 3.65324cm 10