This commit is contained in:
rrene
2019-11-29 11:51:33 -07:00
9 changed files with 6208 additions and 6418 deletions

View File

@@ -1,306 +1,306 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Imports Extensiones
Imports System
Imports System.Configuration
Public Class ClsGralFolios
Implements IDisposable
#Region "Campos"
'SQL
Private SqlConexion As SqlConnection
Private SqlAdapter As SqlDataAdapter
Private SqlCommand As SqlCommand
Private SqlTransacc As SqlTransaction
Private Data As DataTable
'Atributos de la clase
Private _CveFolio As Integer
Private _CveEmpresa As Integer
Private _CveUsuario As Integer
Private _Aprobacion As String
Private _CBB As String
Private _FInicial As Integer
Private _FFinal As Integer
Private _FActual As Integer
Private _FechaIng As Date
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'REGISTRAR CONEXIONES ABIERTAS
Private CveConexion As Integer = 0
#End Region
#Region "Propiedades"
Public ReadOnly Property DtResultados() As DataTable
Get
DtResultados = Data
End Get
End Property
#End Region
Public Function IniciaTransacSQL() As SqlTransaction
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
Return SqlTransacc
End Function
Public Sub RollBack()
SqlTransacc.Rollback()
End Sub
Public Sub Commit()
SqlTransacc.Commit()
End Sub
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
Data = New DataTable
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
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
Public Function GetFolios(Optional TipoDocto As String = "-1", Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddFolios(CveSubProyecto As Integer, TipoDocto As String, Serie As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FInicial", SqlDbType.Int).Value = FInicial
.Add("@FActual", SqlDbType.Int).Value = FActual
.Add("@FFinal", SqlDbType.Int).Value = FFinal
.Add("@CBB", SqlDbType.VarChar).Value = CBB
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
Try
SqlAdapter.Fill(Data)
_CveFolio = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Me.OnError("Ocurrió un error al guardar el folio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al guardar la nueva Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar la nueva Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateFolios(CveSubProyecto As Integer, TipoDocto As String, Serie As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, Estado As Boolean, CveUsuario As Integer, CveFolio As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FInicial", SqlDbType.Int).Value = FInicial
.Add("@FActual", SqlDbType.Int).Value = FActual
.Add("@FFinal", SqlDbType.Int).Value = FFinal
.Add("@CBB", SqlDbType.VarChar).Value = CBB
.Add("@Estado", SqlDbType.Bit).Value = Estado
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveFolio", SqlDbType.Int).Value = CveFolio
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Me.OnError("Ocurrió un error al actualizar los folios..", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al actualizar los folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar los cambios en la Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveFolios(CveFolio As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFolio", SqlDbType.Int).Value = CveFolio
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 547;") Then
Alert("La aprobación de Folios no se pudo eliminar porque está siendo utilizado por otro registro.", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al eliminar la Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar la Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateFolioActual(CveSubProyecto As Integer, TipoDocto As String, Estatus As Boolean, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FolioActualUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Estado", SqlDbType.Bit).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 547;") Then
Alert("La aprobación de Folios no se pudo eliminar porque está siendo utilizado por otro registro.", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al actualizar la Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
Me.OnError("Ocurrió un error al actualizar la Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#Region "IDisposable Support"
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
If Not Data Is Nothing Then Data.Dispose()
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose()
If Not SqlCommand Is Nothing Then SqlCommand.Dispose()
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
If Not SqlConexion Is Nothing Then SqlConexion.Dispose()
End If
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Imports Extensiones
Imports System
Imports System.Configuration
Public Class ClsGralFolios
Implements IDisposable
#Region "Campos"
'SQL
Private SqlConexion As SqlConnection
Private SqlAdapter As SqlDataAdapter
Private SqlCommand As SqlCommand
Private SqlTransacc As SqlTransaction
Private Data As DataTable
'Atributos de la clase
Private _CveFolio As Integer
Private _CveEmpresa As Integer
Private _CveUsuario As Integer
Private _Aprobacion As String
Private _CBB As String
Private _FInicial As Integer
Private _FFinal As Integer
Private _FActual As Integer
Private _FechaIng As Date
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'REGISTRAR CONEXIONES ABIERTAS
Private CveConexion As Integer = 0
#End Region
#Region "Propiedades"
Public ReadOnly Property DtResultados() As DataTable
Get
DtResultados = Data
End Get
End Property
#End Region
Public Function IniciaTransacSQL() As SqlTransaction
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
Return SqlTransacc
End Function
Public Sub RollBack()
SqlTransacc.Rollback()
End Sub
Public Sub Commit()
SqlTransacc.Commit()
End Sub
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
Data = New DataTable
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
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
Public Function GetFolios(Optional TipoDocto As String = "-1", Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddFolios(CveSubProyecto As Integer, TipoDocto As String, Serie As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FInicial", SqlDbType.Int).Value = FInicial
.Add("@FActual", SqlDbType.Int).Value = FActual
.Add("@FFinal", SqlDbType.Int).Value = FFinal
.Add("@CBB", SqlDbType.VarChar).Value = CBB
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
Try
SqlAdapter.Fill(Data)
_CveFolio = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Me.OnError("Ocurrió un error al guardar el folio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al guardar la nueva Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar la nueva Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateFolios(CveSubProyecto As Integer, TipoDocto As String, Serie As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, Estado As Boolean, CveUsuario As Integer, CveFolio As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FInicial", SqlDbType.Int).Value = FInicial
.Add("@FActual", SqlDbType.Int).Value = FActual
.Add("@FFinal", SqlDbType.Int).Value = FFinal
.Add("@CBB", SqlDbType.VarChar).Value = CBB
.Add("@Estado", SqlDbType.Bit).Value = Estado
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveFolio", SqlDbType.Int).Value = CveFolio
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Me.OnError("Ocurrió un error al actualizar los folios..", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al actualizar los folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar los cambios en la Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveFolios(CveFolio As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFolio", SqlDbType.Int).Value = CveFolio
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 547;") Then
Alert("La aprobación de Folios no se pudo eliminar porque está siendo utilizado por otro registro.", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al eliminar la Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar la Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateFolioActual(CveSubProyecto As Integer, TipoDocto As String, Estatus As Boolean, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FolioActualUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Estado", SqlDbType.Bit).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 547;") Then
Alert("La aprobación de Folios no se pudo eliminar porque está siendo utilizado por otro registro.", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al actualizar la Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
Me.OnError("Ocurrió un error al actualizar la Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#Region "IDisposable Support"
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
If Not Data Is Nothing Then Data.Dispose()
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose()
If Not SqlCommand Is Nothing Then SqlCommand.Dispose()
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
If Not SqlConexion Is Nothing Then SqlConexion.Dispose()
End If
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class

View File

@@ -674,10 +674,12 @@ Partial Class Compras_ReembolsosComprobaciones
Dim PorcentajeIVA As Decimal = gvr.DataKey("IVAPorcentaje").ToDecimal
Dim IdCtaContIVAXAcreditar As Integer = 0
Dim IdCtaContIVAAcreditable As Integer = 0
Dim IdCtaContIVANoAcreditable As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows.Count > 0 Then
IdCtaContIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaContIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
IdCtaContIVANoAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVANoAcreditable").ToString.ToEntero
End If
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
If ImporteMovto = gvr.FCLiteral("LtlSaldo").Text.ToDouble Then
@@ -701,7 +703,7 @@ Partial Class Compras_ReembolsosComprobaciones
'Agrego el IVA
If gvr.DataKey("IVADeducible").ToDecimal > 0 Then
Dim ImporteIVA As Decimal = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago
If ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteIVA, 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, ImporteIVA), ImporteMX:=(ImporteIVA) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteIVA, 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, ImporteIVA), ImporteMX:=(ImporteIVA) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If
@@ -711,7 +713,7 @@ Partial Class Compras_ReembolsosComprobaciones
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
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteNOIVA, Referencia, 280, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVANoAcreditable > 0, IdCtaContIVANoAcreditable, 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

View File

@@ -327,200 +327,6 @@
<ReportSection>
<Body>
<ReportItems>
<Rectangle Name="Rectangle2">
<ReportItems>
<Image Name="QRCode">
<Source>External</Source>
<Value>=Parameters!QR.Value</Value>
<Sizing>FitProportional</Sizing>
<Top>0.1632in</Top>
<Left>0.02254in</Left>
<Height>1.2939in</Height>
<Width>1.53682in</Width>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Image>
<Textbox Name="Textbox88">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Sello Digital del CFDI:</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!SelloCFDI.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Sello Digital del SAT:</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!SelloSAT.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Cadena Original del complemento de certificación digital del SAT:</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!CadenaOriginal.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>RFC del Proveedor de Certificación: </Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>6pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Este documento es una representación impresa de un CFDI</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox88</rd:DefaultName>
<Top>0.41453cm</Top>
<Left>4.18558cm</Left>
<Height>3.5806cm</Height>
<Width>16.69544cm</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<PageBreak>
<BreakLocation>Start</BreakLocation>
</PageBreak>
<KeepTogether>true</KeepTogether>
<Top>6.39675in</Top>
<Left>0.0645in</Left>
<Height>1.67778in</Height>
<Width>8.23221in</Width>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Rectangle>
<Tablix Name="Tablix2">
<TablixBody>
<TablixColumns>
@@ -1137,6 +943,7 @@
<FontFamily>calibri</FontFamily>
<FontSize>8.75pt</FontSize>
<FontWeight>Normal</FontWeight>
<Format>#,0.00;(#,0.00)</Format>
</Style>
</TextRun>
</TextRuns>
@@ -1299,7 +1106,6 @@
<Left>0.09836in</Left>
<Height>0.34081in</Height>
<Width>8.20966in</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -1325,7 +1131,7 @@
<Left>0.28014cm</Left>
<Height>0.05496cm</Height>
<Width>20.88652cm</Width>
<ZIndex>2</ZIndex>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -1359,7 +1165,7 @@
<Left>1.89472cm</Left>
<Height>1.09816cm</Height>
<Width>19.15264cm</Width>
<ZIndex>3</ZIndex>
<ZIndex>2</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -1378,7 +1184,7 @@
<Left>1.15361cm</Left>
<Height>2.413cm</Height>
<Width>2.75323cm</Width>
<ZIndex>4</ZIndex>
<ZIndex>3</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -1459,7 +1265,7 @@
<Left>4.32565cm</Left>
<Height>2.06903cm</Height>
<Width>7.93893cm</Width>
<ZIndex>5</ZIndex>
<ZIndex>4</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -1490,7 +1296,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>MATRIZ</Value>
<Value>=Parameters!Sucursal.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
@@ -1503,20 +1309,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>VERACRUZ Y CUERNAVACA 148 SAN</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>BENITO HERMOSILLO HERMOSILLO</Value>
<Value>=Parameters!DomicilioSucursal.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
@@ -1555,20 +1348,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>MAT Juan Martin Contreras Castellanos</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Value>=Parameters!VendedorNombre.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
@@ -1597,7 +1377,7 @@
<Left>12.68838cm</Left>
<Height>2.88925cm</Height>
<Width>5.11312cm</Width>
<ZIndex>6</ZIndex>
<ZIndex>5</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -1632,7 +1412,7 @@
<Left>18.23008cm</Left>
<Height>0.6cm</Height>
<Width>2.79101cm</Width>
<ZIndex>7</ZIndex>
<ZIndex>6</ZIndex>
<Style>
<Border>
<Style>Solid</Style>
@@ -1668,7 +1448,7 @@
<Left>18.23008cm</Left>
<Height>0.6cm</Height>
<Width>2.79101cm</Width>
<ZIndex>8</ZIndex>
<ZIndex>7</ZIndex>
<Style>
<Border>
<Style>Solid</Style>
@@ -1719,7 +1499,7 @@
<Left>18.23008cm</Left>
<Height>0.86903cm</Height>
<Width>2.79101cm</Width>
<ZIndex>9</ZIndex>
<ZIndex>8</ZIndex>
<Style>
<Border>
<Style>Solid</Style>
@@ -1828,7 +1608,7 @@
<Left>0.28014cm</Left>
<Height>1.09007cm</Height>
<Width>9.71199cm</Width>
<ZIndex>10</ZIndex>
<ZIndex>9</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -1916,7 +1696,7 @@
<Left>10.06268cm</Left>
<Height>0.7927cm</Height>
<Width>9.71199cm</Width>
<ZIndex>11</ZIndex>
<ZIndex>10</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2056,7 +1836,7 @@
<Left>0.25136cm</Left>
<Height>0.74611cm</Height>
<Width>13.82025cm</Width>
<ZIndex>12</ZIndex>
<ZIndex>11</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2089,7 +1869,7 @@
<Left>14.07729cm</Left>
<Height>0.57354cm</Height>
<Width>2.90753cm</Width>
<ZIndex>13</ZIndex>
<ZIndex>12</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2124,7 +1904,7 @@
<Left>0.26772cm</Left>
<Height>0.52062cm</Height>
<Width>9.72441cm</Width>
<ZIndex>14</ZIndex>
<ZIndex>13</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2186,7 +1966,7 @@
<Left>3.33321cm</Left>
<Height>1.05328cm</Height>
<Width>17.71415cm</Width>
<ZIndex>15</ZIndex>
<ZIndex>14</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2315,7 +2095,7 @@
<Left>0.22108cm</Left>
<Height>2.03224cm</Height>
<Width>20.79751cm</Width>
<ZIndex>16</ZIndex>
<ZIndex>15</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2345,7 +2125,7 @@
<Left>0.19009cm</Left>
<Height>0.05496cm</Height>
<Width>20.88652cm</Width>
<ZIndex>17</ZIndex>
<ZIndex>16</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2365,7 +2145,7 @@
<Left>0.17151cm</Left>
<Height>0.96488cm</Height>
<Width>3.75909cm</Width>
<ZIndex>18</ZIndex>
<ZIndex>17</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2423,7 +2203,7 @@
<Left>0.19008cm</Left>
<Height>0.40655cm</Height>
<Width>12.88812cm</Width>
<ZIndex>19</ZIndex>
<ZIndex>18</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2442,7 +2222,7 @@
<Left>4.34941cm</Left>
<Height>0.91769cm</Height>
<Width>3.03541cm</Width>
<ZIndex>20</ZIndex>
<ZIndex>19</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2457,7 +2237,7 @@
<Left>7.56121cm</Left>
<Height>0.97656cm</Height>
<Width>4.16281cm</Width>
<ZIndex>21</ZIndex>
<ZIndex>20</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2472,7 +2252,7 @@
<Left>11.90634cm</Left>
<Height>1.01184cm</Height>
<Width>3.76809cm</Width>
<ZIndex>22</ZIndex>
<ZIndex>21</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2487,7 +2267,7 @@
<Left>15.67443cm</Left>
<Height>0.93046cm</Height>
<Width>5.37042cm</Width>
<ZIndex>23</ZIndex>
<ZIndex>22</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2519,7 +2299,7 @@
<Left>15.67443cm</Left>
<Height>0.50299cm</Height>
<Width>5.42547cm</Width>
<ZIndex>24</ZIndex>
<ZIndex>23</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2573,7 +2353,7 @@
<Left>17.09066cm</Left>
<Height>0.64028cm</Height>
<Width>3.90165cm</Width>
<ZIndex>25</ZIndex>
<ZIndex>24</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2718,7 +2498,7 @@
<Left>0.16383cm</Left>
<Height>2.44366cm</Height>
<Width>15.5106cm</Width>
<ZIndex>26</ZIndex>
<ZIndex>25</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2753,7 +2533,7 @@
<Left>6.24049in</Left>
<Height>0.21875in</Height>
<Width>0.94607in</Width>
<ZIndex>27</ZIndex>
<ZIndex>26</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2788,7 +2568,7 @@
<Left>6.24048in</Left>
<Height>0.21875in</Height>
<Width>0.94607in</Width>
<ZIndex>28</ZIndex>
<ZIndex>27</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2823,7 +2603,7 @@
<Left>6.24048in</Left>
<Height>0.21875in</Height>
<Width>0.94607in</Width>
<ZIndex>29</ZIndex>
<ZIndex>28</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2858,7 +2638,7 @@
<Left>6.24048in</Left>
<Height>0.21875in</Height>
<Width>0.94607in</Width>
<ZIndex>30</ZIndex>
<ZIndex>29</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2894,7 +2674,7 @@
<Left>6.24048in</Left>
<Height>0.21875in</Height>
<Width>0.94607in</Width>
<ZIndex>31</ZIndex>
<ZIndex>30</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2930,7 +2710,7 @@
<Left>7.18656in</Left>
<Height>0.21875in</Height>
<Width>0.98426in</Width>
<ZIndex>32</ZIndex>
<ZIndex>31</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -2965,7 +2745,7 @@
<Left>7.18656in</Left>
<Height>0.20486in</Height>
<Width>0.98425in</Width>
<ZIndex>33</ZIndex>
<ZIndex>32</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -3000,7 +2780,7 @@
<Left>7.18656in</Left>
<Height>0.19899in</Height>
<Width>0.98425in</Width>
<ZIndex>34</ZIndex>
<ZIndex>33</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -3036,7 +2816,7 @@
<Left>7.18656in</Left>
<Height>0.19284in</Height>
<Width>0.98425in</Width>
<ZIndex>35</ZIndex>
<ZIndex>34</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -3072,7 +2852,7 @@
<Left>7.18656in</Left>
<Height>0.19596in</Height>
<Width>0.98425in</Width>
<ZIndex>36</ZIndex>
<ZIndex>35</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -3107,7 +2887,7 @@
<Left>4.32565cm</Left>
<Height>0.82021cm</Height>
<Width>7.93893cm</Width>
<ZIndex>37</ZIndex>
<ZIndex>36</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -3137,7 +2917,7 @@
<Left>0.19009cm</Left>
<Height>0.05496cm</Height>
<Width>20.88652cm</Width>
<ZIndex>38</ZIndex>
<ZIndex>37</ZIndex>
<Style>
<Border>
<Style>None</Style>
@@ -3150,7 +2930,7 @@
</Style>
</Textbox>
</ReportItems>
<Height>20.50931cm</Height>
<Height>16.64639cm</Height>
<Style />
</Body>
<Width>21.16666cm</Width>

File diff suppressed because it is too large Load Diff

View File

@@ -1,215 +1,215 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports System.IO
Partial Class CatFolios
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveFolio As Integer
Get
Return ViewState("CveFolio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveFolio") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
Session("FileUpload") = ""
CargaSubProyectos()
CargaDdlTipoDocto()
CargaDatos()
End If
End Sub
#Region "C A R G A S"
Private Sub CargaDdlTipoDocto()
DdlTipoDocto.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.Empresa.CvePlataforma = 1 Then
DdlTipoDocto.Items.Insert(1, New ListItem("Facturas", "Ing"))
DdlTipoDocto.Items.Insert(2, New ListItem("Remisión", "Rem"))
DdlTipoDocto.Items.Insert(3, New ListItem("Notas de Crédito", "Egs"))
DdlTipoDocto.Items.Insert(4, New ListItem("Devoluciones", "Dev"))
DdlTipoDocto.Items.Insert(5, New ListItem("Cotización", "Cot"))
DdlTipoDocto.Items.Insert(6, New ListItem("Requisiciones", "Req"))
DdlTipoDocto.Items.Insert(7, New ListItem("Orden de Compra", "OC"))
DdlTipoDocto.Items.Insert(8, New ListItem("Orden de Servicio", "OS"))
DdlTipoDocto.Items.Insert(9, New ListItem("Nomina", "Nom"))
DdlTipoDocto.Items.Insert(10, New ListItem("Organización Interna", "OI"))
DdlTipoDocto.Items.Insert(11, New ListItem("Vale Gasolina", "VaG"))
DdlTipoDocto.Items.Insert(12, New ListItem("Resguardo AF", "AFR"))
DdlTipoDocto.Items.Insert(13, New ListItem("Traslado AF", "AFT"))
DdlTipoDocto.Items.Insert(14, New ListItem("Acarreo", "Aca"))
DdlTipoDocto.Items.Insert(15, New ListItem("Contratos", "Con"))
DdlTipoDocto.Items.Insert(16, New ListItem("Pedido", "Ped"))
DdlTipoDocto.Items.Insert(17, New ListItem("Devolución de Pedido", "DPe"))
DdlTipoDocto.Items.Insert(18, New ListItem("Pedido de Consignación", "PeC"))
DdlTipoDocto.Items.Insert(19, New ListItem("Órden de Producción", "OP"))
DdlTipoDocto.Items.Insert(20, New ListItem("Órden de Corte", "OCO"))
DdlTipoDocto.Items.Insert(21, New ListItem("Entrada de Materia Prima a Empaque", "EME"))
DdlTipoDocto.Items.Insert(22, New ListItem("Empaque", "EMP"))
DdlTipoDocto.Items.Insert(23, New ListItem("Solicitud de Traslado", "STr"))
DdlTipoDocto.Items.Insert(24, New ListItem("Complemento Pago", "CP"))
DdlTipoDocto.Items.Insert(24, New ListItem("Fletes", "FLE"))
DdlTipoDocto.Items.Insert(25, New ListItem("Activos Fijos", "AF"))
DdlTipoDocto.Items.Insert(26, New ListItem("Viaticos", "VIA"))
DdlTipoDocto.Items.Insert(27, New ListItem("Remanufactura", "RMF"))
DdlTipoDocto.Items.Insert(28, New ListItem("PedidoA", "PA"))
DdlTipoDocto.Items.Insert(29, New ListItem("Pedido2", "Pd2"))
DdlTipoDocto.Items.Insert(30, New ListItem("Proveedor/Acreedor", "Amb"))
DdlTipoDocto.Items.Insert(31, New ListItem("Proveedor", "Pro"))
DdlTipoDocto.Items.Insert(32, New ListItem("Acreedor", "Acr"))
DdlTipoDocto.Items.Insert(33, New ListItem("Productos/Servicios", "PS"))
DdlTipoDocto.Items.Insert(34, New ListItem("NC de Remisión", "RNC"))
ElseIf UsuarioActual.Empresa.CvePlataforma = 2 Then
DdlTipoDocto.Items.Insert(1, New ListItem("Facturas", "Ing"))
DdlTipoDocto.Items.Insert(2, New ListItem("Notas de Crédito", "Egs"))
DdlTipoDocto.Items.Insert(3, New ListItem("Cotización", "Cot"))
DdlTipoDocto.Items.Insert(4, New ListItem("Remisión", "Rem"))
DdlTipoDocto.Items.Insert(5, New ListItem("Orden de Compra", "OC"))
End If
DdlTipoDocto.DataBind()
End Sub
Private Sub CargaSubProyectos()
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Public Sub CargaDatos()
Dim ObjFolios As New ClsGralFolios
If ObjFolios.GetFolios() Then
ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTFolios = ObjFolios.DtResultados
GvDatos.DataSource = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GvDatos.DataBind()
Else
Me.GvDatos.DataSource = Nothing
End If
ObjFolios.Dispose()
End Sub
#End Region
Public Sub BtnAgregarFolio_Click(sender As Object, e As EventArgs)
CveFolio = -1
HdnModalidad.Value = "I"
ChkEstatus.Checked = True
TxtFolioInicial.Text = ""
TxtFolioFinal.Text = ""
TxtFolioActual.Text = ""
txtserie.text = ""
DivFactual.Visible = False
CargaSubProyectos()
BtnGuardar.Text = "Agregar"
UpAddFolio.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarFolio"))
End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveFolio = (GvRow.DataKey("CveFolio")).ToEntero
HdnModalidad.Value = "U"
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlTipoDocto.SelectedValueExist(GvRow.DataKey("TipoDocto"))
ChkEstatus.Checked = If(GvRow.DataKey("Estado").ToString = "Activo", True, False)
TxtFolioInicial.Text = (GvRow.DataKey("FInicial"))
TxtFolioFinal.Text = (GvRow.DataKey("FFinal"))
TxtFolioActual.Text = (GvRow.DataKey("FActual"))
DivFactual.Visible = True
BtnGuardar.Text = "Actualizar"
UpAddFolio.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarFolio"))
End Sub
#Region "GV"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjFolios As New ClsGralFolios
If ObjFolios.RemoveFolios(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTFolios = ObjFolios.DtResultados
Alert("La Aprobación de Folios se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjFolios.Dispose()
End Sub
#End Region
#Region "G U A R D A R "
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim ObjFolios As New ClsGralFolios
Dim TieneError = False
If HdnModalidad.Value = "I" Then
If Not ObjFolios.AddFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.Trim.ToEntero, TxtFolioInicial.Text.Trim.ToEntero,
TxtFolioFinal.Text.Trim.Trim.ToEntero, Session("FileUpload").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TieneError = True
End If
Else
If Not ObjFolios.UpdateFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.Trim.ToEntero, TxtFolioActual.Text.Trim.ToEntero, TxtFolioFinal.Text.Trim.ToEntero,
"", If(ChkEstatus.Checked, True, False), UsuarioActual.CveUsuario, CveFolio) Then
TieneError = True
End If
End If
If TieneError Then
Alert("Ocurrio un error al guardar/editar la nueva aprobación de Folios", TipoMensaje.MsgError)
Else
DdlTipoDocto.SelectedIndex = 0
TxtFolioInicial.Text = ""
TxtFolioActual.Text = ""
TxtFolioFinal.Text = ""
Session("FileUpload") = ""
Alert("El nuevo Folio se guardó/editó correctamente.", TipoMensaje.MsgInformacion)
GlobalDTFolios = ObjFolios.DtResultados
ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
CargaDatos()
UpDatos.Update()
UpAddFolio.Update()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio"))
End If
ObjFolios.Dispose()
End Sub
#End Region
End Class
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports System.IO
Partial Class CatFolios
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveFolio As Integer
Get
Return ViewState("CveFolio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveFolio") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
Session("FileUpload") = ""
CargaSubProyectos()
CargaDdlTipoDocto()
CargaDatos()
End If
End Sub
#Region "C A R G A S"
Private Sub CargaDdlTipoDocto()
DdlTipoDocto.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.Empresa.CvePlataforma = 1 Then
DdlTipoDocto.Items.Insert(1, New ListItem("Facturas", "Ing"))
DdlTipoDocto.Items.Insert(2, New ListItem("Remisión", "Rem"))
DdlTipoDocto.Items.Insert(3, New ListItem("Notas de Crédito", "Egs"))
DdlTipoDocto.Items.Insert(4, New ListItem("Devoluciones", "Dev"))
DdlTipoDocto.Items.Insert(5, New ListItem("Cotización", "Cot"))
DdlTipoDocto.Items.Insert(6, New ListItem("Requisiciones", "Req"))
DdlTipoDocto.Items.Insert(7, New ListItem("Orden de Compra", "OC"))
DdlTipoDocto.Items.Insert(8, New ListItem("Orden de Servicio", "OS"))
DdlTipoDocto.Items.Insert(9, New ListItem("Nomina", "Nom"))
DdlTipoDocto.Items.Insert(10, New ListItem("Organización Interna", "OI"))
DdlTipoDocto.Items.Insert(11, New ListItem("Vale Gasolina", "VaG"))
DdlTipoDocto.Items.Insert(12, New ListItem("Resguardo AF", "AFR"))
DdlTipoDocto.Items.Insert(13, New ListItem("Traslado AF", "AFT"))
DdlTipoDocto.Items.Insert(14, New ListItem("Acarreo", "Aca"))
DdlTipoDocto.Items.Insert(15, New ListItem("Contratos", "Con"))
DdlTipoDocto.Items.Insert(16, New ListItem("Pedido", "Ped"))
DdlTipoDocto.Items.Insert(17, New ListItem("Devolución de Pedido", "DPe"))
DdlTipoDocto.Items.Insert(18, New ListItem("Pedido de Consignación", "PeC"))
DdlTipoDocto.Items.Insert(19, New ListItem("Órden de Producción", "OP"))
DdlTipoDocto.Items.Insert(20, New ListItem("Órden de Corte", "OCO"))
DdlTipoDocto.Items.Insert(21, New ListItem("Entrada de Materia Prima a Empaque", "EME"))
DdlTipoDocto.Items.Insert(22, New ListItem("Empaque", "EMP"))
DdlTipoDocto.Items.Insert(23, New ListItem("Solicitud de Traslado", "STr"))
DdlTipoDocto.Items.Insert(24, New ListItem("Complemento Pago", "CP"))
DdlTipoDocto.Items.Insert(24, New ListItem("Fletes", "FLE"))
DdlTipoDocto.Items.Insert(25, New ListItem("Activos Fijos", "AF"))
DdlTipoDocto.Items.Insert(26, New ListItem("Viaticos", "VIA"))
DdlTipoDocto.Items.Insert(27, New ListItem("Remanufactura", "RMF"))
DdlTipoDocto.Items.Insert(28, New ListItem("PedidoA", "PA"))
DdlTipoDocto.Items.Insert(29, New ListItem("Pedido2", "Pd2"))
DdlTipoDocto.Items.Insert(30, New ListItem("Proveedor/Acreedor", "Amb"))
DdlTipoDocto.Items.Insert(31, New ListItem("Proveedor", "Pro"))
DdlTipoDocto.Items.Insert(32, New ListItem("Acreedor", "Acr"))
DdlTipoDocto.Items.Insert(33, New ListItem("Productos/Servicios", "PS"))
DdlTipoDocto.Items.Insert(34, New ListItem("NC de Remisión", "RNC"))
ElseIf UsuarioActual.Empresa.CvePlataforma = 2 Then
DdlTipoDocto.Items.Insert(1, New ListItem("Facturas", "Ing"))
DdlTipoDocto.Items.Insert(2, New ListItem("Notas de Crédito", "Egs"))
DdlTipoDocto.Items.Insert(3, New ListItem("Cotización", "Cot"))
DdlTipoDocto.Items.Insert(4, New ListItem("Remisión", "Rem"))
DdlTipoDocto.Items.Insert(5, New ListItem("Orden de Compra", "OC"))
End If
DdlTipoDocto.DataBind()
End Sub
Private Sub CargaSubProyectos()
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Public Sub CargaDatos()
Dim ObjFolios As New ClsGralFolios
If ObjFolios.GetFolios() Then
ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTFolios = ObjFolios.DtResultados
GvDatos.DataSource = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GvDatos.DataBind()
Else
Me.GvDatos.DataSource = Nothing
End If
ObjFolios.Dispose()
End Sub
#End Region
Public Sub BtnAgregarFolio_Click(sender As Object, e As EventArgs)
CveFolio = -1
HdnModalidad.Value = "I"
ChkEstatus.Checked = True
TxtFolioInicial.Text = ""
TxtFolioFinal.Text = ""
TxtFolioActual.Text = ""
txtserie.text = ""
DivFactual.Visible = False
CargaSubProyectos()
BtnGuardar.Text = "Agregar"
UpAddFolio.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarFolio"))
End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveFolio = (GvRow.DataKey("CveFolio")).ToEntero
HdnModalidad.Value = "U"
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlTipoDocto.SelectedValueExist(GvRow.DataKey("TipoDocto"))
ChkEstatus.Checked = If(GvRow.DataKey("Estado").ToString = "Activo", True, False)
TxtFolioInicial.Text = (GvRow.DataKey("FInicial"))
TxtFolioFinal.Text = (GvRow.DataKey("FFinal"))
TxtFolioActual.Text = (GvRow.DataKey("FActual"))
DivFactual.Visible = True
BtnGuardar.Text = "Actualizar"
UpAddFolio.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarFolio"))
End Sub
#Region "GV"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjFolios As New ClsGralFolios
If ObjFolios.RemoveFolios(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTFolios = ObjFolios.DtResultados
Alert("La Aprobación de Folios se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjFolios.Dispose()
End Sub
#End Region
#Region "G U A R D A R "
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim ObjFolios As New ClsGralFolios
Dim TieneError = False
If HdnModalidad.Value = "I" Then
If Not ObjFolios.AddFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.Trim.ToEntero, TxtFolioInicial.Text.Trim.ToEntero,
TxtFolioFinal.Text.Trim.Trim.ToEntero, Session("FileUpload").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TieneError = True
End If
Else
If Not ObjFolios.UpdateFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.Trim.ToEntero, TxtFolioActual.Text.Trim.ToEntero, TxtFolioFinal.Text.Trim.ToEntero,
"", If(ChkEstatus.Checked, True, False), UsuarioActual.CveUsuario, CveFolio) Then
TieneError = True
End If
End If
If TieneError Then
Alert("Ocurrio un error al guardar/editar la nueva aprobación de Folios", TipoMensaje.MsgError)
Else
DdlTipoDocto.SelectedIndex = 0
TxtFolioInicial.Text = ""
TxtFolioActual.Text = ""
TxtFolioFinal.Text = ""
Session("FileUpload") = ""
Alert("El nuevo Folio se guardó/editó correctamente.", TipoMensaje.MsgInformacion)
GlobalDTFolios = ObjFolios.DtResultados
ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
CargaDatos()
UpDatos.Update()
UpAddFolio.Update()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio"))
End If
ObjFolios.Dispose()
End Sub
#End Region
End Class

View File

@@ -2411,7 +2411,7 @@ Partial Class Clientes
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero, DesglosaIEPS:=ChkDesglosarIEPS.Checked, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, CveTipoOperacion:=DdlTipoOperacion.SelectedValue.ToEntero, CvePedimento:=DdlClavePedimento.SelectedValue.ToEntero, CveIncoterm:=DdlIncoterm.SelectedValue.ToEntero,
CvePais:=DdlPais.SelectedValue.ToEntero, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero, CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero, NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(),
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked,
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero) Then
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked) Then
ViewState("CveCliente") = ObjClientes.CveCliente
@@ -2505,7 +2505,7 @@ Partial Class Clientes
AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, CveTipoOperacion:=DdlTipoOperacion.SelectedValue.ToEntero, CvePedimento:=DdlClavePedimento.SelectedValue.ToEntero, CveIncoterm:=DdlIncoterm.SelectedValue.ToEntero, CvePais:=DdlPais.SelectedValue.ToEntero, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero,
CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero, NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(),
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(),
ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero) Then
ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked) Then
ObjClientes.LimpiaImpuestosLocales(CveCliente)

View File

@@ -2355,6 +2355,7 @@
</div>
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTelefonoCliente" runat="server" ControlToValidate="TxtTelefonoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label>
</div>
</div>

View File

@@ -6284,6 +6284,7 @@
</div>
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTelefonoCliente" runat="server" ControlToValidate="TxtTelefonoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label>
</div>
</div>

View File

@@ -6657,8 +6657,10 @@ Partial Class Ventas
End If
'Esquema viejo, evitamos que aparezca por surtir
If ErrorList.Count = 0 Then
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
If VentaSaldoAlmacen <> 0 Then
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
End If
End If
End If
@@ -10604,7 +10606,7 @@ Partial Class Ventas
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1)
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
If CveMovimientoInventario <= 0 Then
OcurrioError = True
@@ -12613,8 +12615,8 @@ Partial Class Ventas
Dim Fecha As Date = Now
'Creamos el movimiento de entrada y el movimiento de salida
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True)
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True)
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
If CveMovimientoInventarioEntrada > 0 AndAlso CveMovimientoInventarioSalida > 0 Then
@@ -15459,7 +15461,8 @@ Partial Class Ventas
Dim ContadorMovtosDetalles = 0
'Creamos el movimiento
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Ventas/Ventas.aspx")
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E")
If CveMovimientoInventario > 0 Then
@@ -15622,7 +15625,7 @@ Partial Class Ventas
CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={ObjFactura.CveSubProyecto}").ToEntero()
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1)
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/E")
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
@@ -15729,7 +15732,8 @@ Partial Class Ventas
If Not TieneError Then
AlmacenEntrada = CveAlmacenOrigen
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida, CveOS:=CveOS)
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=-1,
CveMovimientoRelacionado:=CveMovimientoSalida, CveOS:=CveOS, Modulo:="Vta/OS")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
@@ -15756,7 +15760,8 @@ Partial Class Ventas
If Not TieneError Then
AlmacenEntrada = CveAlmacenDestino
CveMovimientoEntrada2 = ObjInventario.AddMovimiento(AlmacenEntrada, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida2, CveOS:=CveOS)
CveMovimientoEntrada2 = ObjInventario.AddMovimiento(AlmacenEntrada, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=-1,
CveMovimientoRelacionado:=CveMovimientoSalida2, CveOS:=CveOS, Modulo:="Vta/OS")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada2 <= 0 Then
@@ -15783,7 +15788,8 @@ Partial Class Ventas
If Not TieneError Then
AlmacenEntrada = CveAlmacenDestino
CveMovimientoEntrada3 = ObjInventario.AddMovimiento(AlmacenEntrada, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida3, CveOS:=CveOS)
CveMovimientoEntrada3 = ObjInventario.AddMovimiento(AlmacenEntrada, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=-1,
CveMovimientoRelacionado:=CveMovimientoSalida3, CveOS:=CveOS, Modulo:="Vta/OS")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada3 <= 0 Then
@@ -19439,7 +19445,7 @@ Partial Class Ventas
'MOVIMIENTO DE SALIDA POR TRASPASO DEL ALMACEN DE CONSIGNACION
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1)
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
If CveMovimientoSalidaConsignacion > 0 Then
Dim CveProducto As Integer
Dim CveUnidad As Integer
@@ -19482,7 +19488,7 @@ Partial Class Ventas
'ENTRADA POR TRASPASO A GENERAL
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion)
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E")
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
@@ -19496,7 +19502,7 @@ Partial Class Ventas
End If
'SALIDA GENERAL
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1)
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows