This commit is contained in:
2021-09-17 16:29:32 -07:00
34 changed files with 1467 additions and 285 deletions

View File

@@ -505,7 +505,7 @@ Public Class ClsCompras
Public Function UpdateCompraDetalle(CvePS As Integer, Cantidad As Double, PU As Double, IVA As Double, Total As Double, Descuento As Double, Observaciones As String, CveSubProyecto As Integer, CvePresupuestoEgreso As Integer, CveActivoFijo As Integer, CveCompraDetalle As Integer, Optional AplicaCostoIndirecto As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveTipoGasto As Integer = -1, Public Function UpdateCompraDetalle(CvePS As Integer, Cantidad As Double, PU As Double, IVA As Double, Total As Double, Descuento As Double, Observaciones As String, CveSubProyecto As Integer, CvePresupuestoEgreso As Integer, CveActivoFijo As Integer, CveCompraDetalle As Integer, Optional AplicaCostoIndirecto As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveTipoGasto As Integer = -1,
Optional AF_Medida As Integer = -1, Optional AF_TipoMantenimiento As Integer = -1, Optional Referencia As String = "", Optional AF_Medida As Integer = -1, Optional AF_TipoMantenimiento As Integer = -1, Optional Referencia As String = "",
Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0,
Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, Optional IEPSPSIVAPorcentaje As Double = 0, Optional NoDeducible As Boolean = False) As Boolean Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, Optional IEPSPSIVAPorcentaje As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -540,6 +540,8 @@ Public Class ClsCompras
.Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje
.Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
End With End With

View File

@@ -3268,6 +3268,65 @@ Public Class ClsGenerales
#End Region #End Region
#Region "C A R T A P O R T E"
Public Function GetMaterialPeligroso() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CP_MaterialPeligrosoGet")
'With SqlAdapter.SelectCommand.Parameters
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' .Add("@CveClasificacionPorcentaje", SqlDbType.Int).Value = CveClasificacionPorcentaje
' .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
' .Add("@PorcentajeIVA", SqlDbType.Float).Value = PorcentajeIVA
' .Add("@Opcion", SqlDbType.Int).Value = Opcion
'End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener materiales peligrosos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetEmbalajes() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CP_EmbalajesGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener embalajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetCartaPorteTipoPermiso() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CP_TipoPermisoGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los permisos de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetCartaPorteConfigAutoTransportes() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_CP_ConfigAutoTransportesGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los configuración de autotransporte de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
Protected Overridable Sub Dispose(ByVal disposing As Boolean) Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not disposedValue Then If Not disposedValue Then
If disposing Then If disposing Then

View File

@@ -2251,7 +2251,30 @@ Public Class ClsNominas
End Try End Try
Return retorno Return retorno
End Function End Function
Public Function GetchecadorAdistencia(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean Public Function AsistenciaDetallePorTurnoGet(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As Boolean
Dim retorno As Boolean = False
Try
DTSet = New DataSet()
DataAdapter("PA_RH_AsistenciaDetallePorTurnoGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio
.Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
End With
SqlAdapter.Fill(DTSet)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al obtener la asistenciadetalle.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al obtener la asistenciadetalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function GetchecadorAsistencia(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
Try Try
@@ -2266,10 +2289,10 @@ Public Class ClsNominas
retorno = True retorno = True
Catch sqEx As SqlException Catch sqEx As SqlException
retorno = False retorno = False
OnError("Ocurrió un error al Realizar el calculo de asistencia.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) OnError("Ocurrió un error al realizar el calculo de asistencia.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception Catch ex As Exception
retorno = False retorno = False
OnError("Ocurrió un error al Realizar el calculo de asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) OnError("Ocurrió un error al realizar el calculo de asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try End Try
Return retorno Return retorno
End Function End Function

View File

@@ -645,6 +645,63 @@ Public Class ClsPaginas
End Set End Set
End Property End Property
#Region "C A R T A P O R T E "
Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable
Get
Dim AppNombre As String = "GlobalDTMaterialPeligroso"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim Obj As New ClsGenerales
If Obj.GetMaterialPeligroso() Then Application(AppNombre) = Obj.DtResultados
Obj.Dispose()
End If
If CveMaterialPeligroso > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveMaterialPeligroso = {0}", CveMaterialPeligroso)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTMaterialPeligroso = Dv.ToTable
Dv.Dispose()
Else
GlobalDTMaterialPeligroso = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTMaterialPeligroso"
Application(AppNombre) = value
End Set
End Property
Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable
Get
Dim AppNombre As String = "GlobalDTEmbalajes"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim Obj As New ClsGenerales
If Obj.GetEmbalajes() Then Application(AppNombre) = Obj.DtResultados
Obj.Dispose()
End If
If CveEmbalaje > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmbalaje = {0}", CveEmbalaje)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTEmbalajes = Dv.ToTable
Dv.Dispose()
Else
GlobalDTEmbalajes = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTEmbalajes"
Application(AppNombre) = value
End Set
End Property
#End Region
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable
Get Get
@@ -3125,18 +3182,26 @@ Public Class ClsPaginas
Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables")
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Using ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetConta_ConceptosContables() Then Application(AppNombre) = ObjContabilidad.DtResultados Else Application(AppNombre) = Nothing
End Using
End If
If CveConceptoContable <> -1 Then If CveConceptoContable <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTContaConceptosContables"), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows)
GlobalDTContaConceptosContables = Dv.ToTable GlobalDTContaConceptosContables = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTContaConceptosContables = DirectCast(Application("GlobalDTContaConceptosContables"), DataTable) GlobalDTContaConceptosContables = DirectCast(Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTContaConceptosContables") = value Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables")
Application(AppNombre) = value
End Set End Set
End Property End Property
#End Region #End Region
@@ -3896,7 +3961,7 @@ Public Class ClsPaginas
If Application("GlobalSIGAppPaginas") Is Nothing Then If Application("GlobalSIGAppPaginas") Is Nothing Then
PaginaDict = New System.Collections.Hashtable PaginaDict = New System.Collections.Hashtable
PaginaDict.Add("/Nomina/ChecadorAsistencia.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/ChecadorAsistencia.aspx".ToUpper(), 921)
PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918)
PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919) PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919)
'PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) 'PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916)

View File

@@ -89,6 +89,9 @@ Public Class ClsProductosServicios
Public Property ClaveSATUnidadAduanaDescripcion As String Public Property ClaveSATUnidadAduanaDescripcion As String
Public Property ClaveSATFraccionArancelaria As String Public Property ClaveSATFraccionArancelaria As String
Public Property ClaveSATUnidadAduana As String Public Property ClaveSATUnidadAduana As String
Public Property CveMaterialPeligroso As Integer
Public Property CveEmbalaje As Integer
Public Property PesoKg As Decimal
'Nuevo Raul: 10/08/2018 'Nuevo Raul: 10/08/2018
Public Property CveUsuarioModifico As Integer Public Property CveUsuarioModifico As Integer
@@ -295,6 +298,10 @@ Public Class ClsProductosServicios
ClaveSATFraccionArancelariaDescripcion = Data.Rows(0)("ClaveSATFraccionArancelariaDescripcion").ToString ClaveSATFraccionArancelariaDescripcion = Data.Rows(0)("ClaveSATFraccionArancelariaDescripcion").ToString
ClaveSATUnidadAduanaDescripcion = Data.Rows(0)("ClaveSATUnidadAduanaDescripcion").ToString ClaveSATUnidadAduanaDescripcion = Data.Rows(0)("ClaveSATUnidadAduanaDescripcion").ToString
CveMaterialPeligroso = Data.Rows(0)("CveMaterialPeligroso").ToString.ToEntero
CveEmbalaje = Data.Rows(0)("CveEmbalaje").ToString.ToEntero
PesoKg = Data.Rows(0)("PesoKg").ToString.ToDecimal
'Nuevo Raul: 10/08/2018 'Nuevo Raul: 10/08/2018
CveUsuarioModifico = Data.Rows(0)("CveUsuarioModifico").ToString.ToEntero CveUsuarioModifico = Data.Rows(0)("CveUsuarioModifico").ToString.ToEntero
UsuarioModifico = Data.Rows(0)("UsuarioModifico").ToString UsuarioModifico = Data.Rows(0)("UsuarioModifico").ToString
@@ -408,7 +415,8 @@ Public Class ClsProductosServicios
Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1,
Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False,
Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False) As Integer Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False,
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_ProductosServiciosAdd") DataAdapter("PA_ProductosServiciosAdd")
@@ -492,6 +500,10 @@ Public Class ClsProductosServicios
.Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia
.Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre .Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre
.Add("@CveMaterialPeligroso", SqlDbType.Int).Value = CveMaterialPeligroso
.Add("@CveEmbalaje", SqlDbType.Int).Value = CveEmbalaje
.Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg
End With End With
Try Try
@@ -638,7 +650,8 @@ Public Class ClsProductosServicios
Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1,
Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False,
Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False) As Boolean Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False,
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -724,6 +737,10 @@ Public Class ClsProductosServicios
.Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia
.Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre .Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre
.Add("@CveMaterialPeligroso", SqlDbType.Int).Value = CveMaterialPeligroso
.Add("@CveEmbalaje", SqlDbType.Int).Value = CveEmbalaje
.Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg
End With End With
Try Try

View File

@@ -2438,8 +2438,53 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Try End Try
Return Retorno Return Retorno
End Function
Public Function UpAsistenciaDetalle(CveEmpresa As Integer, registros As List(Of RequestUpAsistenciaDetalle)) As Boolean
Dim Retorno As Boolean = False
Dim xmlProductos As System.Xml.Linq.XDocument = Nothing
If registros IsNot Nothing AndAlso registros.Count > 0 Then
xmlProductos = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("registros", From x In registros Select New System.Xml.Linq.XElement("registro", New System.Xml.Linq.XElement("CveAsistenciaDetalle", x.CveAsistenciaDetalle), New System.Xml.Linq.XElement("CvePersonal", x.CvePersonal), New System.Xml.Linq.XElement("CveAsistenciasInasistencias", x.CveAsistenciasInasistencias), New System.Xml.Linq.XElement("CveSubProyecto", x.CveSubProyecto), New System.Xml.Linq.XElement("Fecha", x.Fecha))))
End If
Data = New DataTable
SqlDataAdapter("PA_RH_AsistenciaDetalleUP")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al guardar la Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddChecadorRegistro(CveEmpresa As Integer, registros As List(Of RequestAddChecadorRegistro)) As Boolean
Dim Retorno As Boolean = False
Dim xmlProductos As System.Xml.Linq.XDocument = Nothing
If registros IsNot Nothing AndAlso registros.Count > 0 Then
xmlProductos = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("registros", From x In registros Select New System.Xml.Linq.XElement("registro", New System.Xml.Linq.XElement("CveChecador", x.CveChecador), New System.Xml.Linq.XElement("CvePersonal", x.CvePersonal), New System.Xml.Linq.XElement("ChecadorID", x.ChecadorID), New System.Xml.Linq.XElement("Fecha", x.Fecha))))
End If
Data = New DataTable
SqlDataAdapter("PA_RH_ChecadorAsistenciaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al guardar la Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function End Function
Public Function AddAsistenciaMasiva(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function AddAsistenciaMasiva(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -7088,3 +7133,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Sub End Sub
#End Region #End Region
End Class End Class
Public Class RequestAddChecadorRegistro
Public Property CveChecador As Integer
Public Property CvePersonal As Integer
Public Property ChecadorID As Integer
Public Property Fecha As DateTime
End Class
Public Class RequestUpAsistenciaDetalle
Public Property CveAsistenciaDetalle As Integer
Public Property Fecha As DateTime
Public Property CvePersonal As Integer
Public Property CveAsistenciasInasistencias As Integer
Public Property CveSubProyecto As Integer
End Class

View File

@@ -345,6 +345,103 @@ Public Class ClsSAT
#End Region #End Region
#Region " C A R T A P O R T E"
Public Function GetCartaPorteMaterialPeligroso() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_SAT_CP_MaterialPeligroso")
'With SqlAdapter.SelectCommand.Parameters
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
' .Add("@RFC", SqlDbType.VarChar).Value = RFC
' .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 registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetCartaPorteTipoPermiso() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_SAT_CP_TipoPermiso")
'With SqlAdapter.SelectCommand.Parameters
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
' .Add("@RFC", SqlDbType.VarChar).Value = RFC
' .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 registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetCartaPorteConfigAutoTransporte() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_SAT_CP_ConfiAutoTransporte")
'With SqlAdapter.SelectCommand.Parameters
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
' .Add("@RFC", SqlDbType.VarChar).Value = RFC
' .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 registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetCartaPorteSubTipoRemolque() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_SAT_CP_SubTipoRemolque")
'With SqlAdapter.SelectCommand.Parameters
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
' .Add("@RFC", SqlDbType.VarChar).Value = RFC
' .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 registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
#Region "IDisposable Support" #Region "IDisposable Support"
' IDisposable ' IDisposable

View File

@@ -1320,7 +1320,7 @@ Public Class Timbrado
sw.Start() sw.Start()
' cfdi.saltarValidacion("bNtMuvZockPVhEjaPj0E") ' cfdi.saltarValidacion("bNtMuvZockPVhEjaPj0E")
' cfdi.Decimales = 4 cfdi.Decimales = 4
#Region "Certificado" #Region "Certificado"
cfdi.agregarCertificado(ArchivoCertificado) cfdi.agregarCertificado(ArchivoCertificado)
#End Region #End Region
@@ -1906,7 +1906,7 @@ Public Class Timbrado
sw.Start() sw.Start()
' cfdi.saltarValidacion("bNtMuvZockPVhEjaPj0E") ' cfdi.saltarValidacion("bNtMuvZockPVhEjaPj0E")
' cfdi.Decimales = 4 'cfdi.Decimales = 4
#Region "Certificado" #Region "Certificado"
cfdi.CertificadoArchivo(ArchivoCertificado) cfdi.CertificadoArchivo(ArchivoCertificado)
#End Region #End Region

View File

@@ -87,6 +87,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
GETPSUSADOS(context) GETPSUSADOS(context)
Case "getumsat" Case "getumsat"
GETUMSAT(context) GETUMSAT(context)
Case "getsatmatpeligroso"
GETSATMaterialPeligroso(context)
Case "getsatembalajes"
GETSATEmbalajes(context)
Case "getcliente" Case "getcliente"
GetClientes(context) GetClientes(context)
Case "getproveedores" Case "getproveedores"
@@ -1054,6 +1058,84 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End Function End Function
#End Region #End Region
#Region " GET SAT CARTA PORTE "
Private Function GETSATMaterialPeligroso(ByVal context As HttpContext) As String
Dim retorno As String = ""
If context.Application("GlobalDTMaterialPeligroso") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetMaterialPeligroso Then context.Application("GlobalDTMaterialPeligroso") = ObjGrales.DtResultados Else context.Application("GlobalDTMaterialPeligroso") = Nothing
ObjGrales.Dispose()
End If
Dim DTUM = DirectCast(context.Application("GlobalDTMaterialPeligroso"), DataTable).AsEnumerable
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
If Name <> "-1" Then
DTUM = DTUM.Where((Function(a) a!ClaveMaterialPeligrosoDescripcion.ToString.ToLower Like ("*" + Name.ToLower + "*")))
End If
If DTUM.Count > 0 Then
DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!ClaveMaterialPeligrosoDescripcion).CopyToDataTable).ToTable(True, {"CveMaterialPeligroso", "ClaveMaterialPeligrosoDescripcion"})
Else
DtPSRetorno = Nothing
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
DtPSRetorno.Columns("CveMaterialPeligroso").ColumnName = "id"
DtPSRetorno.Columns("ClaveMaterialPeligrosoDescripcion").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
context.Response.Write(retorno)
DtPSRetorno.Dispose()
Else
context.Response.Write("[]")
End If
Return retorno
End Function
Private Function GETSATEmbalajes(ByVal context As HttpContext) As String
Dim retorno As String = ""
If context.Application("GlobalDTEmbalajes") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetEmbalajes Then context.Application("GlobalDTEmbalajes") = ObjGrales.DtResultados Else context.Application("GlobalDTEmbalajes") = Nothing
ObjGrales.Dispose()
End If
Dim DTUM = DirectCast(context.Application("GlobalDTEmbalajes"), DataTable).AsEnumerable
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
If Name <> "-1" Then
DTUM = DTUM.Where((Function(a) a!ClaveEmbalajeDescripcion.ToString.ToLower Like ("*" + Name.ToLower + "*")))
End If
If DTUM.Count > 0 Then
DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!ClaveEmbalajeDescripcion).CopyToDataTable).ToTable(True, {"CveEmbalaje", "ClaveEmbalajeDescripcion"})
Else
DtPSRetorno = Nothing
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
DtPSRetorno.Columns("CveEmbalaje").ColumnName = "id"
DtPSRetorno.Columns("ClaveEmbalajeDescripcion").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
context.Response.Write(retorno)
DtPSRetorno.Dispose()
Else
context.Response.Write("[]")
End If
Return retorno
End Function
#End Region
#Region " GET FRACCION ARANCELARIA " #Region " GET FRACCION ARANCELARIA "
Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String
Dim retorno As String = "" Dim retorno As String = ""

View File

@@ -44,7 +44,7 @@
<asp:LinkButton ID="LnkChqDevuelto" runat="server" Visible="false" OnClick="LnkChqDevuelto_Click" Style="color: #686868;"><i class="fa fa-ban" style="color:#686868;"></i> Cheque Devuelto</asp:LinkButton> <asp:LinkButton ID="LnkChqDevuelto" runat="server" Visible="false" OnClick="LnkChqDevuelto_Click" Style="color: #686868;"><i class="fa fa-ban" style="color:#686868;"></i> Cheque Devuelto</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkCancelar" runat="server" Visible="false" OnClick="LnkCancelar_Click" Style="color: #686868;"><i class="fa fa-ban" style="color:#686868;"></i> Cancelar Movimiento</asp:LinkButton> <asp:LinkButton ID="LnkCancelar" runat="server" Visible="false" OnClick="LnkCancelar_Click" Style="color: #686868;" data-toggle="tooltip" data-placement="left" title="Cancelar Movimiento" ><i class="fa fa-ban" style="color:#686868;"></i> Cancelar Movimiento</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkEliminar" runat="server" Visible="false" OnClientClick="return confirm('¿Está seguro de eliminar el documento?');" Style="color: #686868;"><i class="fa fa-minus" style="color: #686868;"></i> Eliminar Movimiento</asp:LinkButton> <asp:LinkButton ID="LnkEliminar" runat="server" Visible="false" OnClientClick="return confirm('¿Está seguro de eliminar el documento?');" Style="color: #686868;"><i class="fa fa-minus" style="color: #686868;"></i> Eliminar Movimiento</asp:LinkButton>
@@ -53,7 +53,7 @@
<asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton> <asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el movimiento y complemento?" data-btn-ok-label="si" Style="color: #686868;"> <i class="fa fa-pencil"></i> Cancelar</asp:LinkButton> <asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-btn-ok-label="si" Style="color: #686868;" data-toggle="tooltip" data-placement="left" title="Cancelar Movimiento y Complemento" > <i class="fa fa-pencil"></i> Cancelar Movimiento y Complemento</asp:LinkButton>
<%-- data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"><i class="fa fa-pencil"--%> <%-- data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"><i class="fa fa-pencil"--%>

Binary file not shown.

Binary file not shown.

View File

@@ -4835,7 +4835,7 @@
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GVNCInvAlmacen" runat="server" EmptyDataText="Aun no hay registros." Width="100%" AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" DataKeyNames="CveCompraDetalle" CssClass="table table-striped table-hover Widthall ScrollAD" data-heighterror="450" data-freezerows="1" GridLines="None"> <asp:GridView ID="GVNCInvAlmacen" runat="server" EmptyDataText="Aun no hay registros." Width="100%" AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" DataKeyNames="CveCompraDetalle,CveCompra,TipoCambio,PU" CssClass="table table-striped table-hover Widthall ScrollAD" data-heighterror="450" data-freezerows="1" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Cantidad"> <asp:TemplateField HeaderText="Cantidad">
<ItemTemplate> <ItemTemplate>

View File

@@ -6741,13 +6741,6 @@ Partial Class Compras_Compras
End If End If
Next Next
'Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable()
' Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS")
' Select New With
' {
' .Total = dr2.Field(Of Double)("Total")
' }).Sum(Function(item) item.Total)
importeMovimiento += Valor importeMovimiento += Valor
importeMN = importeMovimiento * tipoCambioActual * Multiplicador importeMN = importeMovimiento * tipoCambioActual * Multiplicador
End If End If
@@ -6771,6 +6764,7 @@ Partial Class Compras_Compras
If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then
RegistroCuentaPuente = True RegistroCuentaPuente = True
Dim ImporteTransito As Decimal = 0
'Conta ContPAQ 'Conta ContPAQ
If IdCtaContable = 0 Then If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
@@ -6783,10 +6777,58 @@ Partial Class Compras_Compras
IdCtaContable = 0 IdCtaContable = 0
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then 'se lleva saldo de Mercancía en tránsito
ErrorPrepoliza = True
If ChkNCInvNC.Checked Then
For Each Gvr As GridViewRow In GVNCInv.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
ErrorMovInv = True
Exit For
End If
End If
Next
For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
Dim importeMNTemp As Decimal = 0
If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
ErrorMovInv = True
Exit For
End If
importeMNTemp = (Gvr.DataKey("PU").ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * Gvr.DataKey("TipoCambio").ToDecimal).RoundSQL
ImporteTransito += importeMNTemp
'se registra por cada compra relacionada
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMNTemp, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMNTemp, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=Gvr.DataKey("TipoCambio").ToDecimal, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
End If
Next
'si hay diferencia
Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL
If diferenciaTransito <> 0 Then
Dim tCveCon As Integer = 65
If diferenciaTransito < 0 Then
tCveCon = 64
End If
diferenciaTransito = diferenciaTransito.Abs
IdCtaContable = 0
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
End If
End If End If
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
' ErrorPrepoliza = True
'End If
End If End If
@@ -6931,7 +6973,7 @@ Partial Class Compras_Compras
tidctacon = ViewState("CtaProveedorAnticiposExtranjera").ToString.ToEntero tidctacon = ViewState("CtaProveedorAnticiposExtranjera").ToString.ToEntero
End If End If
ElseIf DdlTipoComprobante.SelectedValue = "NC" Then ElseIf DdlTipoComprobante.SelectedValue = "NC" AndAlso UsuarioActual.Empresa.Funcionalidad(405).ToEntero > 0 Then
tcvecon = 259 tcvecon = 259
tidctacon = UsuarioActual.Empresa.Funcionalidad(405).ToEntero tidctacon = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
@@ -7151,7 +7193,7 @@ Partial Class Compras_Compras
End If End If
' FLUCTUACION CAMBIARIA ' FLUCTUACION CAMBIARIA
If tipoCambioActual <> TipoCambioFactura Then If tipoCambioActual <> TipoCambioFactura AndAlso Not ChkNCInvNC.Checked Then ' que no se esté afectando mercancía en tránsto
importeMovimiento = (importeMovimientoNC * TipoCambioFactura) - (importeMovimientoNC * tipoCambioActual) importeMovimiento = (importeMovimientoNC * TipoCambioFactura) - (importeMovimientoNC * tipoCambioActual)
If importeMovimiento > 0 Then If importeMovimiento > 0 Then
@@ -7308,7 +7350,7 @@ Partial Class Compras_Compras
importeMNNC = importeMovimientoNC * tipoCambioActual * Multiplicador importeMNNC = importeMovimientoNC * tipoCambioActual * Multiplicador
IdCtaContable = CtaProveedorExtranjera IdCtaContable = CtaProveedorExtranjera
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimientoNC, Referencia, 272, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimientoNC, ImporteME:=importeMovimientoNC, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimientoNC, Referencia, 272, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Ant.CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimientoNC, ImporteME:=importeMovimientoNC, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
Dim CveConceptoContableComplementaria As Integer = 206 Dim CveConceptoContableComplementaria As Integer = 206
If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor
@@ -10167,7 +10209,7 @@ Partial Class Compras_Compras
If Not ObjCompra.UpdateCompraDetalle(Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, Row("IVA").ToString.ToDouble, Row("Total").ToString.ToDouble, If Not ObjCompra.UpdateCompraDetalle(Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, Row("IVA").ToString.ToDouble, Row("Total").ToString.ToDouble,
Row("Descuento").ToString.ToDouble, Row("Obs").ToString, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoEgreso").ToString.ToEntero, CveAF, Row("CveCompraDetalle").ToString.ToEntero, CvePersonal:=CvePersonal, CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia, Row("Descuento").ToString.ToDouble, Row("Obs").ToString, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoEgreso").ToString.ToEntero, CveAF, Row("CveCompraDetalle").ToString.ToEntero, CvePersonal:=CvePersonal, CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia,
RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble, RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble,
IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False)) Then IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False), CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero) Then
Retorno = False Retorno = False
Exit For Exit For
@@ -10216,9 +10258,10 @@ Partial Class Compras_Compras
Next Next
For Each item As String In ClavesBorradas For Each item As String In ClavesBorradas
Dim ObjCompras As New ClsCompras If item.ToEntero > 0 Then
If Not ObjCompras.DeleteCompraDetalle(item.ToEntero) Then If Not ObjCompra.DeleteCompraDetalle(item.ToEntero) Then
Retorno = False Retorno = False
End If
End If End If
Next Next
@@ -20107,14 +20150,6 @@ Partial Class Compras_Compras
Dim IDPoliza As Integer = 0 Dim IDPoliza As Integer = 0
'EMPIEZA OBJETOS Y TRANSACCIONES
'Dim OC As New ClsOC
'Dim OCBitacora As New ClsOIEventos(OC.IniciaTransacSQL())
'Dim ObjInventarios As New ClsInventarios(OC.IniciaTransacSQL())
'Dim ObjConta As New ClsContabilidad(OC.IniciaTransacSQL())
Dim DtInvOC As New DataTable Dim DtInvOC As New DataTable
Dim DtInvOCDiferencias As New DataTable 'Actualizado con diferencia Dim DtInvOCDiferencias As New DataTable 'Actualizado con diferencia
DtInvOCDiferencias.Columns.Add("CveOrdenCompra", GetType(Integer)) DtInvOCDiferencias.Columns.Add("CveOrdenCompra", GetType(Integer))
@@ -20142,7 +20177,7 @@ Partial Class Compras_Compras
Dim diferencia As Decimal = (dr2("PU").ToString.ToDecimal - gvr.FCTextBox("TxtPU").Text.ToDecimal) * gvr.FCTextBox("TxtCantidad").Text.ToDecimal Dim diferencia As Decimal = (dr2("PU").ToString.ToDecimal - gvr.FCTextBox("TxtPU").Text.ToDecimal) * gvr.FCTextBox("TxtCantidad").Text.ToDecimal
Dim DrInvOCDiferencias As DataRow Dim DrInvOCDiferencias As DataRow
If diferencia <> 0 Then 'And DtInvOC.Rows.Count > 0 If diferencia <> 0 Then
DrInvOCDiferencias = DtInvOCDiferencias.NewRow DrInvOCDiferencias = DtInvOCDiferencias.NewRow
DrInvOCDiferencias("CveOrdenCompra") = dr2("CveOrdenCompra").ToString.ToEntero DrInvOCDiferencias("CveOrdenCompra") = dr2("CveOrdenCompra").ToString.ToEntero
DrInvOCDiferencias("CveOrdenCompraDetalle") = dr2("CveOrdenCompraDetalle").ToString.ToEntero DrInvOCDiferencias("CveOrdenCompraDetalle") = dr2("CveOrdenCompraDetalle").ToString.ToEntero
@@ -20201,7 +20236,7 @@ Partial Class Compras_Compras
If DtInvOCDiferencias.Rows.Count > 0 Then If DtInvOCDiferencias.Rows.Count > 0 Then
'VARIABLES 'VARIABLES
Dim CveOrdenCompra = -1 Dim CveOrdenCompra As Integer = -1
Dim DiferenciaInvOC = 0.0D Dim DiferenciaInvOC = 0.0D
Dim CveMovimientoAlmacen = -1 Dim CveMovimientoAlmacen = -1
Dim CveOCDetalle = -1 Dim CveOCDetalle = -1
@@ -20284,15 +20319,14 @@ Partial Class Compras_Compras
If DiferenciaInvOC.RoundSQL() <> 0 Then If DiferenciaInvOC.RoundSQL() <> 0 Then
If CveSubProyecto <= 0 Then If CveSubProyecto <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de constos.", TipoMensaje.MsgAdvertencia) Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
Retorno = False Retorno = False
End If End If
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then If CveMoneda = 2 Then
ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD() ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD()
ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD() ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD()

View File

@@ -223,7 +223,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Beneficiario = "-1" Beneficiario = "-1"
Actualizar = False Actualizar = False
IdPoliza = -1 IdPoliza = -1
CargaCtaContableE()
If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then
DivTipoGasto.Visible = True DivTipoGasto.Visible = True
@@ -452,6 +452,11 @@ Partial Class ContabilidadC_RegPrePolizaS
LnkComplementoPago.Visible = True LnkComplementoPago.Visible = True
End If End If
If UsuarioActual.CveEmpresa = 119 Then
BtnContabilizar.Visible = True
End If
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
If dr("FolioPoliza").ToString.ToEntero > 0 Then If dr("FolioPoliza").ToString.ToEntero > 0 Then
divContabilizada.Visible = True divContabilizada.Visible = True
@@ -636,8 +641,20 @@ Partial Class ContabilidadC_RegPrePolizaS
DdlCuentaContable.Items.Insert(0, New ListItem("Seleccione", "0")) DdlCuentaContable.Items.Insert(0, New ListItem("Seleccione", "0"))
DdlCuentaContableE.DataBind() DdlCuentaContableE.DataBind()
DdlCuentaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) DdlCuentaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0"))
End Sub End Sub
Private Function CargaCuentasContpaq(CveCuenta As Integer) As Integer
Dim Retorno As Integer = -1
If CveCuenta > 0 Then
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(CveCuenta, "-1", 1, UsuarioActual.CveEmpresa) Then
Retorno = ObjConta.DtResultados.Rows(0)("IdCompaq").ToString.ToEntero
End If
ObjConta.Dispose()
End If
Return Retorno
End Function
Private Sub CargaTiposGasto() Private Sub CargaTiposGasto()
DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
DdlTipoGasto.DataBind() DdlTipoGasto.DataBind()
@@ -651,7 +668,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End Sub End Sub
Private Sub CargaCompras(CveProveedor As Integer) Private Sub CargaCompras(CveProveedor As Integer)
If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 305, 308, 310, 311, 312) Then
Dim ObjCompras As New ClsCompras Dim ObjCompras As New ClsCompras
DdlCompras.ClearSelection() DdlCompras.ClearSelection()
@@ -1039,17 +1056,22 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
End Sub End Sub
Private Sub ActualizarPrePoliza() Private Sub ActualizarPrePoliza()
Dim contador As Integer = 0
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Dim ObjContabilidad As New ClsContabilidad Dim ObjContabilidad As New ClsContabilidad
ObjContabilidad.IniciaTransacSQL() ObjContabilidad.IniciaTransacSQL()
ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario)
If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
OcurrioError = True
End If
For Each row As GridViewRow In GvPrePoliza.Rows For Each row As GridViewRow In GvPrePoliza.Rows
If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then
If row.FCCheckBox("chkModificado").Checked Then If row.FCCheckBox("chkModificado").Checked Then
contador = contador + 1
If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero,
row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0,
row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero),
@@ -1061,6 +1083,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
End If End If
Else Else
contador = contador + 1
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0,
row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString,
row.DataKey("CveConceptoContable").ToEntero, row.FCLiteral("TxtConcepto").Text, Now, row.DataKey("CveConceptoContable").ToEntero, row.FCLiteral("TxtConcepto").Text, Now,
@@ -1087,6 +1110,13 @@ Partial Class ContabilidadC_RegPrePolizaS
ObjContabilidad.Dispose() ObjContabilidad.Dispose()
CargaPrePoliza() CargaPrePoliza()
If Not OcurrioError Then
If IdPoliza > 0 AndAlso contador Then
BtnContabilizar_Click(Nothing, Nothing)
End If
End If
End Sub End Sub
Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs) Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs)
RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto"))
@@ -1096,10 +1126,8 @@ Partial Class ContabilidadC_RegPrePolizaS
CargaConceptosContablesE() CargaConceptosContablesE()
CargaSubProyectoE() CargaSubProyectoE()
CargaTipoGastoE() CargaTipoGastoE()
CargaCtaContableE()
UpdatePanel1.Update() UpdatePanel1.Update()
End Sub End Sub
Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating
@@ -1135,9 +1163,12 @@ Partial Class ContabilidadC_RegPrePolizaS
DdlPersonalE.SelectedValueExist(CvePersonal) DdlPersonalE.SelectedValueExist(CvePersonal)
DdlClientesE.SelectedValue = CveCliente If CveCliente > 0 Then
DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") DdlClientesE.SelectedValue = CveCliente
DdlClientesE_SelectedIndexChanged(DdlClientesE, e) DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}")
DdlClientesE_SelectedIndexChanged(DdlClientesE, e)
End If
DdlVentasE.SelectedValueExist(CveVenta) DdlVentasE.SelectedValueExist(CveVenta)
TxtConceptoE.Text = Concepto TxtConceptoE.Text = Concepto
@@ -1146,8 +1177,8 @@ Partial Class ContabilidadC_RegPrePolizaS
CargaSubProyectoE() CargaSubProyectoE()
DdlSubProyectoE.SelectedValueExist(CveSubProyecto) DdlSubProyectoE.SelectedValueExist(CveSubProyecto)
CargaTipoGastoE() CargaTipoGastoE()
DdlTipoGastoE.SelectedValueExist(CveTipoGasto) DdlTipoGastoE.SelectedValueExist(CveTipoGasto)
CargaCtaContableE()
DdlCuentaContableE.SelectedValueExist(CveCuenta) DdlCuentaContableE.SelectedValueExist(CveCuenta)
If Cargo <> 0 Then If Cargo <> 0 Then
@@ -1234,7 +1265,7 @@ Partial Class ContabilidadC_RegPrePolizaS
DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1")) DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1"))
End Sub End Sub
Private Sub CargaComprasE(CveProveedor As Integer) Private Sub CargaComprasE(CveProveedor As Integer)
If Not DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(21) Then If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 305, 308, 310, 311, 312) Then
Dim ObjCompras As New ClsCompras Dim ObjCompras As New ClsCompras
DdlComprasE.ClearSelection() DdlComprasE.ClearSelection()
@@ -1293,9 +1324,10 @@ Partial Class ContabilidadC_RegPrePolizaS
If IndiceGrid = -1 Then If IndiceGrid = -1 Then
If DtMovimientos Is Nothing Then CreaDT() If DtMovimientos Is Nothing Then CreaDT()
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero)
Dim dr As DataRow = DtMovimientos.NewRow Dim dr As DataRow = DtMovimientos.NewRow
dr("IdCtaContable") = DdlCuentaContableE.SelectedValue dr("IdCtaContable") = IdCtaContable
dr("CveCuenta") = DdlCuentaContableE.SelectedValue dr("CveCuenta") = DdlCuentaContableE.SelectedValue
dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text
dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue
@@ -1385,8 +1417,9 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle) Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle)
If Rows.Count > 0 Then If Rows.Count > 0 Then
Dim dr As DataRow = Rows(0) Dim dr As DataRow = Rows(0)
dr("IdCtaContable") = DdlCuentaContableE.SelectedValue Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero)
dr("IdCtaContable") = IdCtaContable
dr("CveCuenta") = DdlCuentaContableE.SelectedValue dr("CveCuenta") = DdlCuentaContableE.SelectedValue
dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text
dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text
@@ -1442,12 +1475,13 @@ Partial Class ContabilidadC_RegPrePolizaS
UpTotalCargo.Update() UpTotalCargo.Update()
UpTotalAbono.Update() UpTotalAbono.Update()
End If End If
RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal")
End If End If
UpPrePoliza.Update() UpPrePoliza.Update()
RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal")
End Sub End Sub
Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting
@@ -1831,25 +1865,10 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtObservaciones.Text = "" TxtObservaciones.Text = ""
Actualizar = False Actualizar = False
LbAgregar.Text = "Agregar" LbAgregar.Text = "Agregar"
End Sub
Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
Dim ObjConta As New ClsContabilidad
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio:<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
Else
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
End If
ObjConta.Dispose()
End Sub End Sub
#Region "COMPLEMENTO DE PAGO" #Region "COMPLEMENTO DE PAGO"
Private Sub GeneraTimbre(CvePrePoliza As Integer) Private Sub GeneraTimbre(CvePrePoliza As Integer)
@@ -2247,7 +2266,29 @@ Partial Class ContabilidadC_RegPrePolizaS
End Function End Function
#End Region #End Region
Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
Contabilizar()
End Sub
Private Sub Contabilizar()
Dim ObjConta As New ClsContabilidad
If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
End If
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio:<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
Else
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
End If
ObjConta.Dispose()
End Sub
#Region "Paquete Egresos" #Region "Paquete Egresos"

View File

@@ -69,7 +69,7 @@
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView runat="server" ID="GvDatos" EmptyDataText="" ToolTip="" CssClass="table table-striped table-advance table-hover ScrollAD" <asp:GridView runat="server" ID="GvDatos" EmptyDataText="" ToolTip="" CssClass="table table-striped table-advance table-hover ScrollAD"
DataKeyNames="CveCuentaAsignacion,CveConceptoContable,CveCuenta,IdCuenta,CveProveedor,CveCliente,CvePersonal,CveClasificacion,CveAlmacen,PorcentajeIVA,CveConceptoNomina,CveBancoCuenta" AutoGenerateColumns="False" DataKeyNames="CveCuentaAsignacion,CveConceptoContable,CveCuenta,IdCuenta,CveProveedor,CveCliente,CvePersonal,CveClasificacion,CveAlmacen,PorcentajeIVA,CveConceptoNomina,CveBancoCuenta,CveActivoFijo" AutoGenerateColumns="False"
Style=" width:100%" GridLines="None"> Style=" width:100%" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Width="150px" HeaderText="Concepto Contable" ItemStyle-HorizontalAlign="Left"/> <asp:BoundField DataField="ConceptoContable" ItemStyle-Width="150px" HeaderText="Concepto Contable" ItemStyle-HorizontalAlign="Left"/>
@@ -130,7 +130,7 @@
<div class="col-md-1" style="width:50%;text-align:left"> <div class="col-md-1" style="width:50%;text-align:left">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:HiddenField ID="HdnCveCuentaAsignacion" runat="server" /> <asp:HiddenField ID="HdnCveCuentaAsignacion" runat="server" />
<asp:DropDownList ID="DdlCconceptosContables" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList> <asp:DropDownList ID="DdlCconceptosContables" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" Width="240px" ValidationGroup="GrpModulo" AutoPostBack="true"></asp:DropDownList>
<label for="<%= DdlCconceptosContables.ClientID.ToString()%>">Concepto Contable: </label> <label for="<%= DdlCconceptosContables.ClientID.ToString()%>">Concepto Contable: </label>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -148,7 +148,7 @@
</div> </div>
<div class="form-group form-md-line-input input-iconright" id="divCliente" runat="server" visible="false"> <div class="form-group form-md-line-input input-iconright" id="divCliente" runat="server" visible="false">
<label for="<%= DdlClientes.ClientID.ToString()%>">Cliente: </label><br /> <label for="<%= DdlClientes.ClientID.ToString()%>">Cliente: </label><br />
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="90%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost> <ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="90%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div> </div>
<div class="form-group form-md-line-input input-iconright" id="divBancos" runat="server" visible="false"> <div class="form-group form-md-line-input input-iconright" id="divBancos" runat="server" visible="false">
<asp:DropDownList ID="DdlCuentaBancaria" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaBancaria" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
@@ -181,6 +181,10 @@
<asp:DropDownList ID="DdlActivoFijo" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="Descripcion" DataValueField="CveActivoFijo" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList> <asp:DropDownList ID="DdlActivoFijo" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="Descripcion" DataValueField="CveActivoFijo" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<label for="<%= DdlActivoFijo.ClientID.ToString()%>">Activo Fijo: </label> <label for="<%= DdlActivoFijo.ClientID.ToString()%>">Activo Fijo: </label>
</div> </div>
<div class="form-group form-md-line-input input-iconright" id="divSubProyectos" runat="server" visible="false">
<asp:DropDownList ID="DdlSubProyectos" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<label for="<%= DdlSubProyectos.ClientID.ToString()%>">Sub Proyectos: </label>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -79,6 +79,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) Then If ObjBancos.GetBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) Then
DdlCuentaBancaria.DataSource = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) DdlCuentaBancaria.DataSource = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -94,6 +96,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
'DdlPersonal.DataBind() 'DdlPersonal.DataBind()
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
DdlAlmacen.DataBind() DdlAlmacen.DataBind()
DdlSubProyectos.DataBind()
DdlCuentaBancaria.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCuentaBancaria.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlConceptoNomina.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlConceptoNomina.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -112,6 +115,10 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacion").ToString HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacion").ToString
If Dr IsNot Nothing Then If Dr IsNot Nothing Then
DdlCconceptosContables.Enabled = False
DdlSubProyectos.Enabled = False
DdlClasificacion.Enabled = False
DdlPersonal.Enabled = False
CveConceptoAsignacion = GvRow.DataKey("CveCuentaAsignacion").ToEntero CveConceptoAsignacion = GvRow.DataKey("CveCuentaAsignacion").ToEntero
DdlCconceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable")) DdlCconceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable"))
DdlCuenta.SelectedValueExist(GvRow.DataKey("CveCuenta")) DdlCuenta.SelectedValueExist(GvRow.DataKey("CveCuenta"))
@@ -126,33 +133,37 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero
Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero
RecargaConcepto(CveConceptoContable)
DdlClientes.ddl.SelectedValueExist(CveCliente)
DdlPersonal.ddl.SelectedValueExist(CvePersonal)
LbAgregar.Text = "Actualizar"
UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();")
End If
End Sub
Private Sub RecargaConcepto(CveConceptoContable As Integer)
Dim Dr As DataRow = GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimero("")
If Dr IsNot Nothing Then
If Dr("AplicaCliente").ToString = "True" Then If Dr("AplicaCliente").ToString = "True" Then
divCliente.Visible = True divCliente.Visible = True
If CveCliente > 0 Then DdlClientes.setEsWebService(True)
DdlClientes.setEsWebService(False)
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
DdlClientes.ddl.DataSource = ObjCliente.DtResultados
End If
DdlClientes.ddl.DataBind()
DdlClientes.ddl.SelectedValue = CveCliente
End If
End If End If
If Dr("AplicaProveedor").ToString = "True" Then If Dr("AplicaProveedor").ToString = "True" Then
divProveedor.Visible = True divProveedor.Visible = True
End If End If
If Dr("AplicaPersonal").ToString = "True" Then If Dr("AplicaPersonal").ToString = "True" Then
divPersonal.Visible = True divPersonal.Visible = True
If CvePersonal > 0 Then DdlPersonal.setEsWebService(True)
DdlPersonal.setEsWebService(False)
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
DdlPersonal.ddl.DataSource = ObjPersonal.DtResultados
End If
DdlPersonal.ddl.DataBind()
DdlPersonal.ddl.SelectedValueExist(CvePersonal)
End If
End If End If
If Dr("AplicaImpuesto").ToString = "True" Then If Dr("AplicaImpuesto").ToString = "True" Then
@@ -172,20 +183,22 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
divAlmacen.Visible = True divAlmacen.Visible = True
End If End If
If Dr("AplicaSubProyecto").ToString = "True" Then
divSubProyectos.Visible = True
End If
If Dr("AplicaActivoFijo").ToString = "True" Then If Dr("AplicaActivoFijo").ToString = "True" Then
divActivoFijo.Visible = True divActivoFijo.Visible = True
DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlActivoFijo.DataBind()
' DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo"))
End If End If
If Dr("AplicaNomina").ToString = "True" Then If Dr("AplicaNomina").ToString = "True" Then
divConceptoNomina.Visible = True divConceptoNomina.Visible = True
End If End If
LbAgregar.Text = "Actualizar"
UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();")
End If End If
End Sub End Sub
Protected Sub EliminarRow(sender As Object, e As EventArgs) Protected Sub EliminarRow(sender As Object, e As EventArgs)
@@ -218,7 +231,10 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
Protected Sub BtnAgregarAsignacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarAsignacion.Click Protected Sub BtnAgregarAsignacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarAsignacion.Click
LimpiarDatos() LimpiarDatos()
DdlCconceptosContables.Enabled = True
DdlSubProyectos.Enabled = True
DdlClasificacion.Enabled = True
DdlPersonal.Enabled = True
LbAgregar.Text = "Agregar" LbAgregar.Text = "Agregar"
UpModalModulos.Update() UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();") RegistraScript("$('#ModalCat').modal();")
@@ -249,13 +265,15 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then
If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then
ErrorString = "Error al agregar" ErrorString = "Error al agregar"
End If End If
ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then
If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then
ErrorString = "Error al actualizar" ErrorString = "Error al actualizar"
End If End If
End If End If
@@ -288,4 +306,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
CargaDatosSistema() CargaDatosSistema()
UpDatos.Update() UpDatos.Update()
End Sub End Sub
Private Sub DdlCconceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCconceptosContables.SelectedIndexChanged
RecargaConcepto(DdlCconceptosContables.SelectedValue.ToEntero)
End Sub
End Class End Class

102
General/ExcelToBD.aspx Normal file
View File

@@ -0,0 +1,102 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ExcelToBD.aspx.cs" Inherits="General_ExcelToBD" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpDetallesDia" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-upload font-green"></i>
<span class="caption-subject bold uppercase">Paso 1: cargar plantilla </span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding ">
<asp:Label runat="server" Text="Label">ingrese el archivo a cargar</asp:Label>
<asp:TextBox ID="TxtArchivoXls" CssClass="ADSdropzone hidden" data-maxFilesize="100" runat="server"></asp:TextBox>
<div class="text-right">
<asp:LinkButton ID="LnkCargarArchivo" CssClass="btn btn-success" OnClick="LnkCargarArchivo_Click" runat="server">Cargar excel</asp:LinkButton>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-upload font-green"></i>
<span class="caption-subject bold uppercase">Paso 2: Configuración </span>
</div>
<div class="tools">
<asp:LinkButton ID="Lnkdoit" CssClass="btn btn-success" OnClick="Lnkdoit_Click" runat="server">Mostrar</asp:LinkButton>
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding ">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlWorkBooks" runat="server" CssClass="select2me form-control" DataTextField="Name" DataValueField="position" OnSelectedIndexChanged="DdlWorkBooks_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
<asp:Label runat="server" AssociatedControlID="DdlWorkBooks" Text="Hoja Excel"></asp:Label>
</div>
</div>
<div class="col-md-6">
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtFilas" runat="server" Text="1" Enabled="false"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtFilas" type="number" Text="Filas"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtInicia" runat="server" Text="1" Enabled="false"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtInicia" type="number" Text="Fila inicial"></asp:Label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtColumnas" runat="server" Text="1" Enabled="false"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtColumnas" type="number" Text="Columnas"></asp:Label>
</div>
</div>
<div class="col-md-3">
<asp:CheckBox ID="chkcontieneTitulos" Checked="true" TextAlign="Left" Text="Contiene titulos:" runat="server" />
</div>
</div>
<div class="text-right">
<asp:LinkButton ID="LnkContinuar" OnClick="LnkContinuar_Click" runat="server">Continuar</asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

116
General/ExcelToBD.aspx.cs Normal file
View File

@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ClosedXML.Excel;
using Extensiones;
public partial class General_ExcelToBD : System.Web.UI.Page
{
#region propiedades
private string URLFile
{
get
{
if (ViewState["URLFile"] == null) { return ""; }
else { return ViewState["URLFile"].ToString(); }
}
set { ViewState["URLFile"] = value; }
}
private string extension
{
get
{
if (ViewState["extension"] == null) { return ""; }
else { return ViewState["extension"].ToString(); }
}
set { ViewState["extension"] = value; }
}
private List<ADSWorksBooks> workBooks
{
get
{
if (ViewState["workBooks"] == null) { return null; }
else { return (List<ADSWorksBooks>)ViewState["workBooks"]; }
}
set { ViewState["workBooks"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LnkCargarArchivo_Click(object sender, EventArgs e)
{
List<Archivo> filesgral = TxtArchivoXls.getfiles().Archivos;
workBooks = new List<ADSWorksBooks>();
foreach (Archivo fileItem in filesgral)
{
extension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
URLFile = fileItem.FileUrl;
}
using (var workbook = new XLWorkbook(URLFile))
{
int position = 1;
foreach (IXLWorksheet wokitem in workbook.Worksheets)
{
workBooks.Add(new ADSWorksBooks() { Name = wokitem.Name, position = position++ });
}
}
DdlWorkBooks.DataSource = workBooks;
DdlWorkBooks.DataBind();
if (workBooks.Count > 0)
{
DdlWorkBooks.SelectedIndex = 0;
DdlWorkBooks_SelectedIndexChanged(null,null);
}
}
protected void DdlWorkBooks_SelectedIndexChanged(object sender, EventArgs e)
{
using (var workbook = new XLWorkbook(URLFile))
{
int Filas = 0;
int columnas = 0;
IXLWorksheet workSheet = workbook.Worksheet(DdlWorkBooks.SelectedValue.ToEntero());
Filas = workSheet.LastColumnUsed().CellCount();
columnas = workSheet.LastRowUsed().CellCount();
TxtFilas.Text = Filas.ToString();
TxtInicia.Text = "1";
TxtColumnas.Text = Filas.ToString();
}
}
protected void Lnkdoit_Click(object sender, EventArgs e)
{
}
protected void LnkContinuar_Click(object sender, EventArgs e)
{
int Filas = 0;
int columnas = 0;
using (var workbook = new XLWorkbook(URLFile))
{
IXLWorksheet workSheet = workbook.Worksheet(DdlWorkBooks.SelectedValue.ToEntero());
}
}
}
[Serializable]
public class ADSWorksBooks
{
public int position { get; set; }
public string Name { get; set; }
}

View File

@@ -221,7 +221,7 @@
Using ObjContabilidad As New ClsContabilidad Using ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetConta_PlantillasPolizas(-1, -1) Then Application("GlobalDTContaPlantillasPolizas") = ObjContabilidad.DtResultados Else Application("GlobalDTContaPlantillasPolizas") = Nothing If ObjContabilidad.GetConta_PlantillasPolizas(-1, -1) Then Application("GlobalDTContaPlantillasPolizas") = ObjContabilidad.DtResultados Else Application("GlobalDTContaPlantillasPolizas") = Nothing
If ObjContabilidad.GetConta_ConceptosContables() Then Application("GlobalDTContaConceptosContables") = ObjContabilidad.DtResultados Else Application("GlobalDTContaConceptosContables") = Nothing 'If ObjContabilidad.GetConta_ConceptosContables() Then Application("GlobalDTContaConceptosContables") = ObjContabilidad.DtResultados Else Application("GlobalDTContaConceptosContables") = Nothing
If ObjContabilidad.GetConta_PlantillasPolizasDetalle(-1, -1) Then Application("GlobalDTContaPlantillasPolizasDetalle") = ObjContabilidad.DtResultados Else Application("GlobalDTContaPlantillasPolizasDetalle") = Nothing If ObjContabilidad.GetConta_PlantillasPolizasDetalle(-1, -1) Then Application("GlobalDTContaPlantillasPolizasDetalle") = ObjContabilidad.DtResultados Else Application("GlobalDTContaPlantillasPolizasDetalle") = Nothing
End Using End Using

View File

@@ -4695,7 +4695,7 @@ Partial Class Inventarios_EntradasSalidas
If CvePS > 0 Then If CvePS > 0 Then
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0) Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If DrPS IsNot Nothing AndAlso String.IsNullOrEmpty(UM) Then If DrPS IsNot Nothing Then
CveUM = DrPS("CveUnidadMedida").ToString().ToEntero() CveUM = DrPS("CveUnidadMedida").ToString().ToEntero()
UM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $"CveUnidadMedida={CveUM}") UM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $"CveUnidadMedida={CveUM}")
End If End If

View File

@@ -1819,7 +1819,7 @@ Partial Class Inventarios_EntregaAlmacen
For Each Dr As DataRow In DtDatos.Rows For Each Dr As DataRow In DtDatos.Rows
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha) FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha)
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1") Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString().Trim, "-1")
If Not ValidaLoteCaducidad Then If Not ValidaLoteCaducidad Then
FechaCaducidad = MinFecha FechaCaducidad = MinFecha

View File

@@ -296,6 +296,10 @@ Partial Class Inventarios_TraspasoAlmacen
dt.Columns.Add("Obs") dt.Columns.Add("Obs")
dt.Columns.Add("ImporteIVA", Type.GetType("System.Double")) dt.Columns.Add("ImporteIVA", Type.GetType("System.Double"))
dt.Columns.Add("PorcentajeIVA", Type.GetType("System.Double")) dt.Columns.Add("PorcentajeIVA", Type.GetType("System.Double"))
dt.Columns.Add("ClaveMaterialPeligroso")
dt.Columns.Add("ClaveEmbalaje")
dt.Columns.Add("Embalaje")
dt.Columns.Add("PesoKg", Type.GetType("System.Decimal"))
DtMovimientos = dt DtMovimientos = dt
@@ -663,42 +667,48 @@ Partial Class Inventarios_TraspasoAlmacen
Dim CveClasificacion As Integer Dim CveClasificacion As Integer
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS IsNot Nothing Then CveClasificacion = DrPS("CveClasificacion").ToString.ToEntero If DrPS IsNot Nothing Then
CveClasificacion = DrPS("CveClasificacion").ToString.ToEntero
Dim DrUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimero($"CveUnidadMedida = {CveUnidadMedida}")
Dim DrUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimero($"CveUnidadMedida = {CveUnidadMedida}") Dim registro As DataRow = DtMovimientos.NewRow
registro.Item("Cantidad") = Cantidad
registro.Item("CveUM") = CveUnidadMedida
registro.Item("UM") = DrUM("UnidadMedida")
registro.Item("UnidadMedida") = DrUM("UnidadMedida")
registro.Item("CvePS") = CvePS
registro.Item("PS") = DrPS("PSCodigo")
registro.Item("Observaciones") = Observaciones
registro.Item("Serie") = Serie
registro.Item("Lote") = Lote
If FechaCaducidad > MinFecha Then registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("CveClasificacion") = CveClasificacion
registro.Item("CveAF") = -1
registro.Item("EstatusExistencia") = "1"
registro.Item("CveSeccionAlmacen") = CveSeccionAlmacen
registro.Item("SeccionAlmacen") = SeccionAlmacen
registro.Item("CveSeccionAlmacenDestino") = CveSeccionAlmacenDestino
Dim registro As DataRow = DtMovimientos.NewRow registro.Item("TotalImporte") = 0
registro.Item("Cantidad") = Cantidad registro.Item("PU") = 0
registro.Item("CveUM") = CveUnidadMedida registro.Item("Descuento") = 0
registro.Item("UM") = DrUM("UnidadMedida") registro.Item("SATClaveUM") = DrPS("SATClaveUnidadMedida")
registro.Item("UnidadMedida") = DrUM("UnidadMedida") registro.Item("SATClaveProdServ") = DrPS("SATClavePS")
registro.Item("CvePS") = CvePS registro.Item("Noidentificacion") = DrPS("Codigo")
registro.Item("PS") = DrPS("PSCodigo") registro.Item("CuentaPredial") = ""
registro.Item("Observaciones") = Observaciones registro.Item("Obs") = ""
registro.Item("Serie") = Serie registro.Item("ImporteIVA") = 0
registro.Item("Lote") = Lote registro.Item("PorcentajeIVA") = 0
If FechaCaducidad > MinFecha Then registro.Item("FechaCaducidad") = FechaCaducidad registro("ClaveMaterialPeligroso") = DrPS("ClaveMaterialPeligroso")
registro.Item("CveClasificacion") = CveClasificacion registro("ClaveEmbalaje") = DrPS("ClaveEmbalaje")
registro.Item("CveAF") = -1 registro("PesoKg") = DrPS("PesoKg")
registro.Item("EstatusExistencia") = "1"
registro.Item("CveSeccionAlmacen") = CveSeccionAlmacen
registro.Item("SeccionAlmacen") = SeccionAlmacen
registro.Item("CveSeccionAlmacenDestino") = CveSeccionAlmacenDestino
registro.Item("TotalImporte") = 0 DtMovimientos.Rows.Add(registro)
registro.Item("PU") = 0 RegistraScript("playsonidito('beep-07.wav')")
registro.Item("Descuento") = 0
registro.Item("SATClaveUM") = DrPS("SATClaveUnidadMedida") End If
registro.Item("SATClaveProdServ") = DrPS("SATClavePS")
registro.Item("Noidentificacion") = DrPS("Codigo")
registro.Item("CuentaPredial") = ""
registro.Item("Obs") = ""
registro.Item("ImporteIVA") = 0
registro.Item("PorcentajeIVA") = 0
DtMovimientos.Rows.Add(registro)
RegistraScript("playsonidito('beep-07.wav')")
CargaGvDatos() CargaGvDatos()
If Limpia Then If Limpia Then
@@ -2587,7 +2597,7 @@ Partial Class Inventarios_TraspasoAlmacen
ObjFactura.ConvertirPesos = False ObjFactura.ConvertirPesos = False
ObjFactura.CveMoneda = 1 ObjFactura.CveMoneda = 1
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ") ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = "XXX" 'GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1") ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1") '"XXX"
ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ") ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.TipoDocto = "Tra" ObjFactura.TipoDocto = "Tra"
ObjFactura.RefDocto = "" ObjFactura.RefDocto = ""
@@ -2655,7 +2665,11 @@ Partial Class Inventarios_TraspasoAlmacen
ObjFactura.Inv_CveMovimiento = CveMovimientoTimbrado ObjFactura.Inv_CveMovimiento = CveMovimientoTimbrado
ObjFactura.Timbre = PreParaTimbreCartaPorte(ObjFactura) If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
ObjFactura.Timbre = PreParaTimbreCartaPorte(ObjFactura)
Else
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
End If
End Sub End Sub
Private Function PreParaTimbreCartaPorte(Obj As Modelos.Factura) As CFDITimbre Private Function PreParaTimbreCartaPorte(Obj As Modelos.Factura) As CFDITimbre
@@ -2698,47 +2712,86 @@ Partial Class Inventarios_TraspasoAlmacen
CartaPorte.Mercancias.UnidadPeso = "" CartaPorte.Mercancias.UnidadPeso = ""
CartaPorte.Mercancias.CargoporTasacion = 0 CartaPorte.Mercancias.CargoporTasacion = 0
CartaPorte.FiguraTransporte.AutoTransporteFederal.PermSCT = "TPAF01" Dim Dr As DataRow = DtCamiones.FiltroPrimero(String.Format("CveCamion= {0}", DdlUnidadCamion.SelectedValue))
CartaPorte.FiguraTransporte.AutoTransporteFederal.NumPermisoSCT = "1234567890"
CartaPorte.FiguraTransporte.AutoTransporteFederal.NombreAseg = "GNP" If Dr IsNot Nothing Then
CartaPorte.FiguraTransporte.AutoTransporteFederal.NumPolizaSeguro = "P123" CartaPorte.FiguraTransporte.AutoTransporteFederal.PermSCT = Dr("TipoPermisoSCT").ToString '"TPAF01"
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.ConfigVehicular = "C2" CartaPorte.FiguraTransporte.AutoTransporteFederal.NumPermisoSCT = Dr("NumPermisoSCT").ToString
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.PlacaVM = "WTF757A" CartaPorte.FiguraTransporte.AutoTransporteFederal.NombreAseg = Dr("NombreAseguradora").ToString
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.AnioModeloVM = 2007 CartaPorte.FiguraTransporte.AutoTransporteFederal.NumPolizaSeguro = Dr("NumPolizaSeguro").ToString
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.ConfigVehicular = Dr("ConfigCartaPorte").ToString '"C2"
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.PlacaVM = Dr("Placa").ToString
CartaPorte.FiguraTransporte.AutoTransporteFederal.Vehiculo.AnioModeloVM = Dr("Anio").ToString.ToEntero
End If
Dim CveSubProyectoOrigen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
If CveSubProyectoOrigen > 0 Then
Dim drr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyectoOrigen).FiltroPrimero("")
DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drr("Calle").ToString,
.Colonia = drr("Colonia").ToString,
.CP = drr("CP").ToString,
.Estado = drr("Estado").ToString,
.Pais = drr("Pais").ToString,
.Municipio = drr("Municipio").ToString,
.Localidad = drr("Localidad").ToString}
End If
Dim CveSubProyectoDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestino.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
Dim DomDestino As CFDICartaPorteDomicilio = Nothing
If CveSubProyectoOrigen > 0 Then
Dim drr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyectoOrigen).FiltroPrimero("")
DomDestino = New CFDICartaPorteDomicilio With {.Calle = drr("Calle").ToString,
.Colonia = drr("Colonia").ToString,
.CP = drr("CP").ToString,
.Estado = drr("Estado").ToString,
.Pais = drr("Pais").ToString,
.Municipio = drr("Municipio").ToString,
.Localidad = drr("Localidad").ToString}
End If
Dim DomOrigen As New CFDICartaPorteDomicilio With {.Calle = "calle",
.Colonia = "",
.CP = "45200",
.Estado = "JAL",
.Pais = "MEX",
.Localidad = ""}
Dim DomDestino As New CFDICartaPorteDomicilio With {.Calle = "calle destino",
.Colonia = "",
.CP = "45200",
.Estado = "JAL",
.Pais = "MEX",
.Localidad = ""}
Dim Ubica As New CFDICartaPorteUbicaciones Dim Ubica As New CFDICartaPorteUbicaciones
Ubica.TipoEstacion = "01" Ubica.TipoEstacion = "01"
Ubica.DistanciaRecorrida = 6 Ubica.DistanciaRecorrida = 6
Ubica.Origen = New CFDICartaPorteUbicacionOrigen With {.RFCRemitente = "CAMJ841219I33", Ubica.Origen = New CFDICartaPorteUbicacionOrigen With {.RFCRemitente = UsuarioActual.Empresa.RFC,
.FechaHoraSalida = "2021-08-23T11:13:01", .FechaHoraSalida = Now.ToString("yyyy-MM-ddTH:mm:ss"),' "2021-08-23T11:13:01",
.NombreRemitente = "Empresa", .NombreRemitente = UsuarioActual.Empresa.Empresa,
.Domicilio = DomOrigen} .Domicilio = DomOrigen}
Ubica.Destino = New CFDICartaPorteUbicacionDestino With {.RFCDestinatario = "CAMJ841219I33", Ubica.Destino = New CFDICartaPorteUbicacionDestino With {.RFCDestinatario = UsuarioActual.Empresa.RFC,'"CAMJ841219I33",
.FechaHoraProgLlegada = "2021-08-23T11:13:01", .FechaHoraProgLlegada = TxtFechaEntrega.Text.ToDate.ToString("yyyy-MM-ddT23:59:59"),
.NombreDestinatario = "Empresa dest", .NombreDestinatario = UsuarioActual.Empresa.Empresa,
.Domicilio = DomDestino} .Domicilio = DomDestino}
CartaPorte.Ubicaciones.Add(Ubica) CartaPorte.Ubicaciones.Add(Ubica)
CartaPorte.FiguraTransporte.ClaveTransporte = "01" CartaPorte.FiguraTransporte.ClaveTransporte = "01"
CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With {.RFCOperador = "CAMJ841219I33",
.Domicilio = Nothing, Dim ObjAcar As New ClsAcarreos()
.NombreOperador = "juan Perez",
.NumLicencia = "Num Lic", If ObjAcar.GetChofer(DdlChofer.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1, -1) Then
.NumRegidTribOperador = "", Dim dro As DataRow = ObjAcar.DtResultados.Rows(0)
.ResidenciaFiscalOperador = ""}) If dro IsNot Nothing Then
Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = dro("Domicilio").ToString,
.NumeroExterior = dro("NumeroExterior").ToString,
.NumeroInterior = dro("NumeroInterior").ToString,
.Colonia = dro("Colonia").ToString,
.Municipio = dro("Ciudad").ToString,
.Estado = dro("Estado").ToString,
.CP = dro("CP").ToString}
CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With {.RFCOperador = dro("RFC").ToString,
.NombreOperador = dro("Chofer").ToString,
.NumLicencia = dro("Licencia").ToString,
.NumRegidTribOperador = dro("NumRegidTribOperador").ToString,
.ResidenciaFiscalOperador = dro("ResidenciaFiscalOperador").ToString,
.Domicilio = DomicilioOperador})
End If
End If
ObjAcar.Dispose()
'concepto único 'concepto único
@@ -2768,18 +2821,19 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
Dim conceptoCarta As New CFDICartaPorteMercancia With { Dim conceptoCarta As New CFDICartaPorteMercancia With {
.BienesTransp = drr("SATClaveProdServ").ToString, .BienesTransp = drr("SATClaveProdServ").ToString,
.ClaveSTCC = "01334", .ClaveSTCC = "", 'para metodo ferroviario
.Cantidad = drr("Cantidad").ToString.ToDecimal, .Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripción = tPS, .Descripción = tPS,
.ClaveUnidad = drr("SATClaveUM").ToString, .ClaveUnidad = drr("SATClaveUM").ToString,
.Unidad = drr("UM").ToString, .Unidad = drr("UM").ToString,
.Dimensiones = "", .Dimensiones = "",
.MaterialPeligroso = "", .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", "No"),
.Embalaje = "", .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString,
.DescripEmbalaje = "", .Embalaje = drr("ClaveEmbalaje").ToString,
.PesoenKg = 203, .DescripEmbalaje = drr("Embalaje").ToString,
.PesoenKg = drr("PesoKg").ToString.ToDecimal,
.ValorMercancia = drr("PU").ToString.ToDecimal, .ValorMercancia = drr("PU").ToString.ToDecimal,
.Moneda = "MXN", 'tempral .Moneda = "MXN", 'temporal
.FraccionArrancelaria = "", .FraccionArrancelaria = "",
.UUIDComercioExt = "" .UUIDComercioExt = ""
} }
@@ -2795,6 +2849,75 @@ Partial Class Inventarios_TraspasoAlmacen
Return Timbre Return Timbre
End Function End Function
Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
Dim Timbre As New CFDITimbre
Timbre.Comprobante.TipoComprobante = "T"
Timbre.Comprobante.Folio = Obj.Folio.ToString
Timbre.Comprobante.Serie = Obj.Serie
Timbre.Comprobante.Fecha = Obj.Fecha
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
Timbre.Comprobante.CondicionesdePago = ""
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
Timbre.Comprobante.Subtotal = Obj.SubTotal
Timbre.Comprobante.Descuentos = Obj.Descuento
Timbre.Comprobante.Moneda = Obj.MonedaSAT
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
Timbre.Comprobante.Total = Obj.Total
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
Timbre.Comprobante.Confirmacion = ""
Timbre.Receptor.RFC = "XAXX010101000"
Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa
Timbre.Receptor.UsoCFDI = "P01"
Dim totSubTotal As Decimal = Obj.SubTotal
Dim totIVA As Decimal = Obj.IVA
Dim totRetIVA As Decimal = Obj.RetIVA
Dim totRetISR As Decimal = Obj.RetISR
Dim i As Integer = 1
'DETALLES
Dim tPS As String = ""
For Each drr As DataRow In Obj.DtDetalle.Rows
If drr("PS").ToString.Length = 1 Then
tPS = drr("Obs").ToString
Else
If drr("PS").ToString.Length = 0 Then
tPS = ""
Else
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
End If
End If
'CONDICIONANTE, ESPECIAL
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripcion = tPS,
.ValorUnitario = drr("PU").ToString.ToDecimal,
.Importe = drr("TotalImporte").ToString.ToDecimal,
.Descuento = drr("Descuento").ToString.ToDecimal,
.Unidad = drr("UM").ToString,
.ClaveUnidad = drr("SATClaveUM").ToString,
.ClaveProdServ = drr("SATClaveProdServ").ToString,
.Noidentificacion = drr("Noidentificacion").ToString,
.CuentaPredial = drr("CuentaPredial").ToString}
'VERIFICA SUMA SUBTOTALES
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
concepto.Importe = totSubTotal
End If
totSubTotal = totSubTotal - concepto.Importe
'SIEMPRE ESTAMOS AGREGANDO EL IVA
'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
Timbre.Conceptos.Add(concepto)
i += 1
Next
Return Timbre
End Function
Private Sub PrepararTimbrado(ByRef FM As Modelos.FemsaFactura, ByRef TmpDT7Eleven As DataTable, ByRef TmpDTComplementosTimbrado As DataTable) Private Sub PrepararTimbrado(ByRef FM As Modelos.FemsaFactura, ByRef TmpDT7Eleven As DataTable, ByRef TmpDTComplementosTimbrado As DataTable)
FM.AplicaFEMSA = False FM.AplicaFEMSA = False
FM.FEMSA_NumSociedad = "" FM.FEMSA_NumSociedad = ""

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -38,6 +38,9 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:HyperLink ID="HypAgregarRegistro" data-toggle="modal" data-target="#DivAgregarRegistro" runat="server"><i class="fa fa-check"></i> Agregar registro</asp:HyperLink>
</li>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
@@ -122,12 +125,15 @@
<ContentTemplate> <ContentTemplate>
<div class="modal-header "> <div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button> <button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"> <h4 class="modal-title">Asistencia detalle</h4>
<asp:Literal ID="LtlAsistenciaHorariosModal" runat="server">Detalles</asp:Literal></h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtEmpleadolabel" runat="server" Text="" Enabled="false"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtEmpleadolabel" Text="Empleado"></asp:Label>
</div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -142,74 +148,109 @@
</div> </div>
</div> </div>
</div> </div>
<asp:GridView ID="GvAsistenciaUp" runat="server" DataKeyNames="CveAsistenciaDetalle,CveAsistenciasInasistencias,CvePersonal,CveSubProyecto,CveProyecto,CveTurno,Fecha" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false" OnRowDataBound="GvAsistenciaUp_RowDataBound"
CssClass=" table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Turno" ItemStyle-HorizontalAlign="Left" Visible="true">
<ItemTemplate>
<asp:Label runat="server" Width="150" Text='<%# Eval("Turno") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asistencia" Visible="true">
<ItemTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoAsistencias" runat="server" CssClass="select2me form-control" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias"></asp:DropDownList>
</div>
</ItemTemplate>
</asp:TemplateField>
<div class="form-group form-md-line-input input-iconright"> <asp:TemplateField HeaderText="Centro de costos" Visible="true">
<asp:TextBox CssClass="form-control" ID="TxtEmpleadolabel" runat="server" Text="" Enabled="false" Style="font-size: 11px;"></asp:TextBox> <ItemTemplate>
<asp:Label runat="server" AssociatedControlID="TxtEmpleadolabel" Text="Empleado"></asp:Label>
</div> <asp:Panel ID="PnlProyecto" CssClass="col-md-6" runat="server">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtPorPago" runat="server" Text="" type="number" min="0" max="100" step="0.01"></asp:TextBox> <asp:DropDownList ID="DdlAsisProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
<asp:Label runat="server" AssociatedControlID="TxtPorPago" Text="Porcentaje Pago"></asp:Label> <asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
</div> </asp:DropDownList>
<div class="form-group form-md-line-input input-iconright"> <asp:Label ID="LblAsisProyecto" AssociatedControlID="DdlAsisProyecto" runat="server" Text="Proyecto:"></asp:Label>
<asp:DropDownList ID="DdlTipoAsistencias" Enabled="false" Width="150" runat="server" CssClass="select2me form-control" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias"></asp:DropDownList> </div>
<asp:Label runat="server" AssociatedControlID="DdlTipoAsistencias" Text="Asistencia"></asp:Label> </asp:Panel>
</div> <asp:Panel ID="PnlSubProyecto" CssClass="col-md-12" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlAsisSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label ID="LblAsisSubProyecto" Visible="false" AssociatedControlID="DdlAsisSubProyecto" runat="server" Text="SubProyecto:"></asp:Label>
</div>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Panel ID="Panel1" Visible="false" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtPorPago" runat="server" Text="" type="number" min="0" max="100" step="0.01"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtPorPago" Text="Porcentaje Pago"></asp:Label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoAsistencias" Enabled="false" Width="150" runat="server" CssClass="select2me form-control" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias"></asp:DropDownList>
<asp:Label runat="server" AssociatedControlID="DdlTipoAsistencias" Text="Asistencia"></asp:Label>
</div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control " ID="TxtHorasDobles" runat="server" MaxLength="3" Text="0"></asp:TextBox> <asp:TextBox CssClass="form-control " ID="TxtHorasDobles" runat="server" MaxLength="3" Text="0"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtHorasDobles" Text="Horas Dobles"></asp:Label> <asp:Label runat="server" AssociatedControlID="TxtHorasDobles" Text="Horas Dobles"></asp:Label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control " ID="TxtHorasTriples" runat="server" MaxLength="3" Text="0"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtHorasTriples" Text="Horas Triples"></asp:Label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMotivoHoraExtra" runat="server" AppendDataBoundItems="true" DataTextField="MotivoHoraExtra" DataValueField="CveMotivoHoraExtra"
CssClass="form-control select2me" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" AssociatedControlID="DdlMotivoHoraExtra" Text="Motivo"></asp:Label><%-- Hora Extra--%>
</div>
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control " ID="TxtHorasTriples" runat="server" MaxLength="3" Text="0"></asp:TextBox> <div class="row">
<asp:Label runat="server" AssociatedControlID="TxtHorasTriples" Text="Horas Triples"></asp:Label> <asp:Panel ID="PnlProyecto" CssClass="col-md-6" runat="server">
</div> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlAsisProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label ID="LblAsisProyecto" AssociatedControlID="DdlAsisProyecto" runat="server" Text="Proyecto:"></asp:Label>
</div>
</asp:Panel>
<asp:Panel ID="PnlSubProyecto" CssClass="col-md-12" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlAsisSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label ID="LblAsisSubProyecto" AssociatedControlID="DdlAsisSubProyecto" runat="server" Text="SubProyecto:"></asp:Label>
</div>
</asp:Panel>
</div> </div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMotivoHoraExtra" runat="server" AppendDataBoundItems="true" DataTextField="MotivoHoraExtra" DataValueField="CveMotivoHoraExtra" <div class="form-group form-md-line-input input-iconright">
CssClass="form-control select2me" Width="100%"> <asp:TextBox CssClass="form-control" ID="TxtObservaciones" runat="server" MaxLength="150"></asp:TextBox>
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:Label runat="server" AssociatedControlID="TxtObservaciones" Text="Observaciones"></asp:Label>
</asp:DropDownList>
<asp:Label runat="server" AssociatedControlID="DdlMotivoHoraExtra" Text="Motivo"></asp:Label><%-- Hora Extra--%>
</div>
</div> </div>
</div> </asp:Panel>
<div class="row">
<asp:Panel ID="PnlProyecto" CssClass="col-md-6" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlAsisProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label ID="LblAsisProyecto" AssociatedControlID="DdlAsisProyecto" runat="server" Text="Proyecto:"></asp:Label>
</div>
</asp:Panel>
<asp:Panel ID="PnlSubProyecto" CssClass="col-md-12" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlAsisSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="form-control select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label ID="LblAsisSubProyecto" AssociatedControlID="DdlAsisSubProyecto" runat="server" Text="SubProyecto:"></asp:Label>
</div>
</asp:Panel>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtObservaciones" runat="server" MaxLength="150"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtObservaciones" Text="Observaciones"></asp:Label>
</div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<asp:GridView ID="GvDetalleDias" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" with="150" <asp:GridView ID="GvDetalleDias" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros"
CssClass=" table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None"> CssClass=" table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Registros Checador" ItemStyle-HorizontalAlign="Left" Visible="true"> <asp:TemplateField HeaderText="Registros Checador" ItemStyle-HorizontalAlign="Left" Visible="true">
@@ -266,6 +307,51 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<div id="DivAgregarRegistro" class="modal ADS fade" role="dialog">
<div class="modal-dialog " style="width: 600px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpdatePanel1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Agregar registro</h4>
</div>
<div class="modal-body">
<div runat="server" id="PnlConceptoPersonal" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlmcPersonal" DataTextField="CodigoNombreCompleto" DataValueField="CvePersonal" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" AssociatedControlID="DdlmcPersonal" Enabled="false" Text="Empleado"></asp:Label>
</div>
<div class="row">
<div class="col-md-6">
<label style="top: 0; margin-bottom: 0; font-size: 13px; color: #888888; display: block;">Fecha</label>
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block; padding-left: 0px;">
<asp:TextBox ID="TxtFechaIngreso" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFechaIngreso" runat="server" ControlToValidate="txtFechaIngreso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaIngreso" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaIngreso" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlChecador" runat="server" CssClass="select2me form-control" Width="100%" DataTextField="Checador" DataValueField="CveChecador"></asp:DropDownList>
<asp:Label runat="server" AssociatedControlID="DdlTipoAsistencias" Text="Asistencia"></asp:Label>
</div>
</div>
</div>
<div class="text-right">
<asp:CheckBox ID="chkcontinuarAgregando" Checked="true" TextAlign="Left" Text="Continuar agregando:" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LnkAgregarRegistro" OnClick="LnkAgregarRegistro_Click" CssClass="btn btn-primary" runat="server">Agregar</asp:LinkButton>
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script> <script>
@@ -274,6 +360,53 @@
$('.TxtCvePersonal').val(CvePersonal); $('.TxtCvePersonal').val(CvePersonal);
$('.BtnOpenModal').click(); $('.BtnOpenModal').click();
} }
function CargaPickers() {
$.datetimepicker.setLocale('es');
$('input.ADDateTimePicker').each(function () {
var TThis = $(this);
TThis.datetimepicker({
dayOfWeekStart: 1,
lang: 'es',
format: 'd/m/Y H:i',
formatDate: 'd/m/Y H:i',
step: 30
});
var Div = TThis.parent()
var boton = document.createElement('span');
boton.className = "input-group-btn"
var subboton = document.createElement('a')
subboton.className = "btn default"
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
subboton.addEventListener('click', function () {
TThis.datetimepicker('show')
});
boton.appendChild(subboton)
var agregar = true;
for (var i = 0; i < Div[0].children.length; i++) {
if (Div[0].children[i].isEqualNode(boton)) {
agregar = false;
}
}
if (agregar) {
Div[0].appendChild(boton);
}
//Div[0].appendChild(boton)
});
}
Sys.Application.add_load(function (s, e) {
CargaPickers();
});
$(document).ready(function () {
CargaPickers();
});
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -29,9 +29,17 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
DdlTipoAsistencias.DataBind(); DdlTipoAsistencias.DataBind();
using (ClsRH ObjPersonal = new ClsRH())
{
if (ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa))
{
DdlmcPersonal.DataSource = ObjPersonal.DtResultados;
DdlmcPersonal.DataBind();
}
}
DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)); DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa));
DdlMotivoHoraExtra.DataBind(); DdlMotivoHoraExtra.DataBind();
cargaChecadores();
CargarCentrosDeCosto(DdlAsisProyecto, DdlAsisSubProyecto, LblAsisProyecto, LblAsisSubProyecto); CargarCentrosDeCosto(DdlAsisProyecto, DdlAsisSubProyecto, LblAsisProyecto, LblAsisSubProyecto);
PnlProyecto.Visible = DdlAsisProyecto.Visible; PnlProyecto.Visible = DdlAsisProyecto.Visible;
if (PnlProyecto.Visible) if (PnlProyecto.Visible)
@@ -67,7 +75,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
} }
using (ClsNominas objnom = new ClsNominas()) using (ClsNominas objnom = new ClsNominas())
{ {
if (objnom.GetchecadorAdistencia(FechaI, FechaF, UsuarioActual.CveEmpresa)) if (objnom.GetchecadorAsistencia(FechaI, FechaF, UsuarioActual.CveEmpresa))
{ {
DataTable dtASis = objnom.DTSetResultados.Tables[0]; DataTable dtASis = objnom.DTSetResultados.Tables[0];
dtper = objnom.DTSetResultados.Tables[1]; dtper = objnom.DTSetResultados.Tables[1];
@@ -92,11 +100,11 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
string Horas2 = ""; string Horas2 = "";
if (dtx.Rows.Count > 1) if (dtx.Rows.Count > 1)
{ {
Horas2 = drfec["Horas"].ToString();
DataRow drf = dtx.Rows[1]; DataRow drf = dtx.Rows[1];
asistencia2 = "<i class='fa fa-check-square' style=\"color:green;\"></i>"; asistencia2 = "<i class='fa fa-check-square' style=\"color:green;\"></i>";
TipoAsis = drf["TipoAsistencia"].ToString(); TipoAsis = drf["TipoAsistencia"].ToString();
switch (drfec["Tipo"].ToString().ToEntero()) Horas2 = drf["Horas"].ToString();
switch (drf["Tipo"].ToString().ToEntero())
{ {
case 1: case 1:
asistencia2 = "<i class='fa fa-check-square' style=\"color:green;\"></i>"; asistencia2 = "<i class='fa fa-check-square' style=\"color:green;\"></i>";
@@ -113,6 +121,9 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
case 5: case 5:
asistencia2 = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>"; asistencia2 = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>";
break; break;
case 6:
asistencia2 = "<div style=\"color:red;\">❌</div>";
break;
default: default:
break; break;
@@ -137,6 +148,9 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
case 5: case 5:
asistencia = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>"; asistencia = "<i class='fa fa-clock-o' style=\"color:red;\" aria-hidden='true'></i>";
break; break;
case 6:
asistencia = "<div style=\"color:red;\">❌</div>";
break;
default: default:
break; break;
@@ -190,13 +204,38 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
} }
} }
private void cargaChecadores()
{
ClsRH ObjRH = new ClsRH();
if (ObjRH.GetChecadores(-1, UsuarioActual.CveEmpresa))
{
DdlChecador.DataSource = ObjRH.DtResultados;
}
ObjRH.Dispose();
DdlChecador.DataBind();
}
protected void BtnOpenModal_Click(object sender, EventArgs e) protected void BtnOpenModal_Click(object sender, EventArgs e)
{ {
DateTime fechai = TxtFecha.Text.ToDateTime(); DateTime fechai = TxtFecha.Text.ToDateTime();
DateTime fechaf = fechai.AddDays(1); DateTime fechaf = fechai.AddDays(1);
int CvePersonal = TxtCvePersonal.Text.ToEntero(); int CvePersonal = TxtCvePersonal.Text.ToEntero();
DataRow drow = dtper.FiltroPrimero(string.Format("CvePersonal = {0}", CvePersonal));
if (drow != null)
{
TxtCodigolabel.Text = drow["Codigo"].ToString();
TxtEmpleadolabel.Text = drow["NombreCompleto"].ToString();
}
TxtFechalabel.Text = string.Format("{0:dd/MM/yyyy}", fechai); TxtFechalabel.Text = string.Format("{0:dd/MM/yyyy}", fechai);
DataTable dtTurno = GlobalDTTurno.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa));
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.AsistenciaDetallePorTurnoGet(fechai, fechai, UsuarioActual.CveEmpresa, CvePersonal))
{
GvAsistenciaUp.DataSource = objnom.DTSetResultados.Tables[0];
GvAsistenciaUp.DataBind();
}
}
using (ClsRH objRH = new ClsRH()) using (ClsRH objRH = new ClsRH())
{ {
if (objRH.PreAsistenciaRegistrosGet(fechai, fechaf, -1, UsuarioActual.Empresa.CveEmpresa)) if (objRH.PreAsistenciaRegistrosGet(fechai, fechaf, -1, UsuarioActual.Empresa.CveEmpresa))
@@ -217,39 +256,131 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
TxtHorasTriples.Text = dr["HorasTriples"].ToString(); TxtHorasTriples.Text = dr["HorasTriples"].ToString();
DdlMotivoHoraExtra.SelectedValueExist(dr["CveMotivoHoraExtra"].ToString()); DdlMotivoHoraExtra.SelectedValueExist(dr["CveMotivoHoraExtra"].ToString());
TxtObservaciones.Text = dr["Observacion"].ToString(); TxtObservaciones.Text = dr["Observacion"].ToString();
LnkAgregarRegistro.Visible = true;
}
else
{
LnkAgregarRegistro.Visible = false;
} }
} }
} }
DataRow drow = dtper.FiltroPrimero(string.Format("CvePersonal = {0}", CvePersonal));
if(drow != null)
{
TxtCodigolabel.Text = drow["Codigo"].ToString();
TxtEmpleadolabel.Text = drow["NombreCompleto"].ToString();
}
UpDetallesDia.Update(); UpDetallesDia.Update();
RegistraScript("$('#divDetallesDia').modal();"); RegistraScript("$('#divDetallesDia').modal();");
} }
protected void BtnEstusAsistenciaModal_Click(object sender, EventArgs e)
protected void LnkAgregarRegistro_Click(object sender, EventArgs e)
{ {
DateTime fecha = TxtFecha.Text.ToDateTime(); bool continuar = false;
int CvePersonal = TxtCvePersonal.Text.ToEntero(); List<RequestAddChecadorRegistro> items = new List<RequestAddChecadorRegistro>();
items.Add(new RequestAddChecadorRegistro() { CveChecador = DdlChecador.SelectedValue.ToEntero(), CvePersonal = DdlmcPersonal.SelectedValue.ToEntero(), ChecadorID = -1, Fecha = TxtFechaIngreso.Text.ToDateTimeExcat() });
//int CvePersonal = TxtasiscvePersonal.Text.ToEntero(); using (ClsRH objrh = new ClsRH())
//DateTime fecha = TxtasisFecha.Text.ToDate();
using (ClsRH objpersonal = new ClsRH())
{ {
objrh.IniciaTransacSQL();
if (objpersonal.AddAsistencia(CvePersonal, -1, DdlAsisSubProyecto.SelectedValue.ToEntero(), fecha, DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim().ToDouble(), TxtHorasDobles.Text.Trim().ToDouble(), if (objrh.AddChecadorRegistro(UsuarioActual.CveEmpresa, items))
TxtHorasTriples.Text.Trim().ToDouble(), DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{ {
//Alert(string.Format("se ha guardado la asistencia satisfactoriamente <br/>{0}<br/>{1:dd/MM/yyyy}", TxtPersonal.Text, TxtasisFecha.Text.ToDate()), TipoMensaje.ToastInformacion); continuar = true;
Alert("Se ha guardado la asistencia satisfactoriamente"); }
RegistraScript("$('#DModalModAsistencia').modal('hide');"); if (continuar)
{
objrh.Commit();
}
else
{
objrh.RollBack();
} }
} }
if (continuar)
{
Alert(string.Format("La asistencia se a agregado ({0:dd-MM-yyyy HH:mm}).", TxtFechaIngreso.Text.ToDateTimeExcat()), ModExtensiones.TipoMensaje.ToastInformacion);
}
if (!chkcontinuarAgregando.Checked)
{
LnkConsultar_Click(null, null);
RegistraScript("$('#DivAgregarRegistro').modal('hide');");
}
}
protected void GvAsistenciaUp_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//CveAsistenciaDetalle,CvePersonal,CveSubProyecto,CveProyecto,CveTurno,Fecha
int CveAsistenciasInasistencias = e.Row.DataKey("CveAsistenciasInasistencias").ToEntero();
int CveProyecto = e.Row.DataKey("CveProyecto").ToEntero();
int CveSubProyecto = e.Row.DataKey("CveSubProyecto").ToEntero();
DropDownList DdlTipoAsistenciasB = (DropDownList)e.Row.FindControl("DdlTipoAsistencias");
DropDownList DdlAsisProyectoB = (DropDownList)e.Row.FindControl("DdlAsisProyecto");
DropDownList DdlAsisSubProyectoB = (DropDownList)e.Row.FindControl("DdlAsisSubProyecto");
Label LblAsisProyectoB = (Label)e.Row.FindControl("LblAsisProyecto");
Label LblAsisSubProyectoB = (Label)e.Row.FindControl("LblAsisSubProyecto");
Panel PnlProyectoB = (Panel)e.Row.FindControl("PnlProyecto");
Panel PnlSubProyectoB = (Panel)e.Row.FindControl("PnlSubProyecto");
DdlTipoAsistenciasB.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa));
DdlTipoAsistenciasB.DataBind();
/*
DdlAsisProyectoB.DataSource = DdlAsisProyecto.DataSource;
DdlAsisProyectoB.DataBind();
DdlAsisSubProyectoB.DataSource = DdlAsisSubProyecto.DataSource;
DdlAsisSubProyectoB.DataBind();
LblAsisProyectoB.Text = LblAsisProyecto.Text;
LblAsisSubProyectoB.Text = LblAsisSubProyecto.Text;
*/
CargarCentrosDeCosto(DdlAsisProyectoB, DdlAsisSubProyectoB, LblAsisProyectoB, LblAsisSubProyectoB);
PnlProyectoB.Visible = PnlProyecto.Visible;
PnlSubProyectoB.Visible = PnlSubProyectoB.Visible;
DdlTipoAsistenciasB.SelectedValueExist(CveAsistenciasInasistencias);
DdlAsisProyectoB.SelectedValueExist(CveProyecto);
DdlAsisSubProyectoB.SelectedValueExist(CveSubProyecto);
}
}
protected void BtnEstusAsistenciaModal_Click(object sender, EventArgs e)
{
DateTime fecha = TxtFecha.Text.ToDateTime();
int CvePersonal = TxtCvePersonal.Text.ToEntero();
List<RequestUpAsistenciaDetalle> registros = new List<RequestUpAsistenciaDetalle>();
foreach (GridViewRow row in GvAsistenciaUp.Rows)
{
int CveAsistenciaDetalle = row.DataKey("CveAsistenciaDetalle").ToEntero();
int CveAsistenciasInasistencias = row.DataKey("CveAsistenciasInasistencias").ToEntero();
int CveProyecto = row.DataKey("CveProyecto").ToEntero();
int CveSubProyecto = row.DataKey("CveSubProyecto").ToEntero();
DropDownList DdlTipoAsistenciasB = (DropDownList)row.FindControl("DdlTipoAsistencias");
DropDownList DdlAsisProyectoB = (DropDownList)row.FindControl("DdlAsisProyecto");
DropDownList DdlAsisSubProyectoB = (DropDownList)row.FindControl("DdlAsisSubProyecto");
RequestUpAsistenciaDetalle obj = new RequestUpAsistenciaDetalle();
obj.CveAsistenciaDetalle = CveAsistenciaDetalle;
obj.CveAsistenciasInasistencias = DdlTipoAsistenciasB.SelectedValue.ToEntero();
obj.CveSubProyecto = DdlAsisSubProyectoB.SelectedValue.ToEntero();
obj.CvePersonal = CvePersonal;
obj.Fecha = fecha;
registros.Add(obj);
}
using (ClsRH objRH = new ClsRH())
{
objRH.UpAsistenciaDetalle(UsuarioActual.CveEmpresa, registros);
}
//int CvePersonal = TxtasiscvePersonal.Text.ToEntero();
//DateTime fecha = TxtasisFecha.Text.ToDate();
//using (ClsRH objpersonal = new ClsRH())
//{
// if (objpersonal.AddAsistencia(CvePersonal, -1, DdlAsisSubProyecto.SelectedValue.ToEntero(), fecha, DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim().ToDouble(), TxtHorasDobles.Text.Trim().ToDouble(),
// TxtHorasTriples.Text.Trim().ToDouble(), DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
// {
// //Alert(string.Format("se ha guardado la asistencia satisfactoriamente <br/>{0}<br/>{1:dd/MM/yyyy}", TxtPersonal.Text, TxtasisFecha.Text.ToDate()), TipoMensaje.ToastInformacion);
// Alert("Se ha guardado la asistencia satisfactoriamente");
// RegistraScript("$('#DModalModAsistencia').modal('hide');");
// }
//}
} }
} }

View File

@@ -830,7 +830,7 @@
<div class="btn-group"> <div class="btn-group">
<a onclick="$('#C_BtnImprimirsobrerecibo').click()" class="btn yellow-gold">Imprimir</a> <a onclick="$('#C_BtnImprimirsobrerecibo').click()" class="btn yellow-gold">Imprimir</a>
</div> </div>
<div class="btn-group hidden"> <div class="btn-group ">
<a class="btn yellow-gold btn-sm" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"><i class="fa fa-calculator"></i>Calculos <a class="btn yellow-gold btn-sm" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"><i class="fa fa-calculator"></i>Calculos
<i class="fa fa-angle-down"></i> <i class="fa fa-angle-down"></i>
</a> </a>

View File

@@ -1028,7 +1028,7 @@ function ADDropzone(txtid) {
var urldown = txt.data('urldown'); if ((urldown) && (urldown != "")) { } else { urldown = domain + "/Ashx/SIGWeb.ashx"; } var urldown = txt.data('urldown'); if ((urldown) && (urldown != "")) { } else { urldown = domain + "/Ashx/SIGWeb.ashx"; }
var urlget = txt.data('urlget'); if ((urlget) && (urlget != "")) { } else { urlget = domain + "/temp/"; } var urlget = txt.data('urlget'); if ((urlget) && (urlget != "")) { } else { urlget = domain + "/temp/"; }
var maxFilesize = txt.data('maxFilesize'); if (maxFilesize) { } else { maxFilesize = 10; } var maxFilesize = txt.data('maxfilesize'); if (maxFilesize) { } else { maxFilesize = 10; }
var maxFile = txt.attr('data-maxFile'); if (maxFile) { } else { maxFile = null; } var maxFile = txt.attr('data-maxFile'); if (maxFile) { } else { maxFile = null; }
var mydiv = $("<div id='" + txtid + "-drop' class='addropzone'></div>"); var mydiv = $("<div id='" + txtid + "-drop' class='addropzone'></div>");
var mypaste = $("<div id='" + txtid + "-paste' contenteditable='true' class='mypaste'></div>") var mypaste = $("<div id='" + txtid + "-paste' contenteditable='true' class='mypaste'></div>")

View File

@@ -991,6 +991,39 @@
</div> </div>
</div> </div>
<br /> <br />
<div class="portlet xspadding light bordered" id="divCartaPorte" runat="server" visible="false">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-briefcase font-green"></i>
<span class="caption-subject bold uppercase">Carta Porte</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-4 truncate">Material Peligroso:</label>
<div class="col-md-8">
<ADS:Dropdownlost ID="DdlMaterialPeligroso" runat="server" CssStyle="width: 100%;" DataTextField="ClaveMaterialPeligroDescripcion" DataValueField="CveMaterialPeligroso"></ADS:Dropdownlost>
</div>
</div>
<div class="row">
<label class="col-md-4 truncate">Embalaje:</label>
<div class="col-md-8">
<ADS:Dropdownlost ID="DdlEmbalaje" runat="server" CssStyle="width: 100%;" DataTextField="ClaveEmbalajeDescripcion" DataValueField="CveEmbalaje"></ADS:Dropdownlost>
</div>
</div>
<div class="row">
<label class="col-md-4 truncate">Peso en Kg:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtPesoKg" runat="server" Width="60px"></asp:TextBox>
</div>
</div>
</div>
</div>
<br />
<asp:UpdatePanel ID="UpSeccionAlmacen" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpSeccionAlmacen" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div id="DivSeccionAlmacen" runat="server" visible="false"> <div id="DivSeccionAlmacen" runat="server" visible="false">

View File

@@ -799,6 +799,20 @@ Partial Class ProductosyServicios
If ObjProductosServicios.ClaveSATUnidadAduanaDescripcion.ToString <> Nothing Then If ObjProductosServicios.ClaveSATUnidadAduanaDescripcion.ToString <> Nothing Then
LblUnidadAduana.Text = ObjProductosServicios.ClaveSATUnidadAduanaDescripcion.ToString LblUnidadAduana.Text = ObjProductosServicios.ClaveSATUnidadAduanaDescripcion.ToString
End If End If
If ObjProductosServicios.CveMaterialPeligroso > 0 Then
DdlMaterialPeligroso.SelectedValue = ObjProductosServicios.CveMaterialPeligroso.ToString
DdlMaterialPeligroso.SelectedText = GlobalDTMaterialPeligroso(ObjProductosServicios.CveMaterialPeligroso).FiltroPrimeroValor("ClaveMaterialPeligrosoDescripcion")
End If
If ObjProductosServicios.CveEmbalaje > 0 Then
DdlEmbalaje.SelectedValue = ObjProductosServicios.CveEmbalaje.ToString
DdlEmbalaje.SelectedText = GlobalDTEmbalajes(ObjProductosServicios.CveEmbalaje).FiltroPrimeroValor("ClaveEmbalajeDescripcion")
End If
If ObjProductosServicios.PesoKg > 0 Then
TxtPesoKg.Text = ObjProductosServicios.PesoKg.ToString
End If
DdlTipoPSDes.SelectedValueExist(ObjProductosServicios.CveClasificacionDetalle.ToString) DdlTipoPSDes.SelectedValueExist(ObjProductosServicios.CveClasificacionDetalle.ToString)
DdlUnidadMedida.SelectedValue = ObjProductosServicios.CveUnidadMedida.ToString DdlUnidadMedida.SelectedValue = ObjProductosServicios.CveUnidadMedida.ToString
CveUnidadMedida = ObjProductosServicios.CveUnidadMedida.ToString.ToEntero CveUnidadMedida = ObjProductosServicios.CveUnidadMedida.ToString.ToEntero
@@ -940,6 +954,8 @@ Partial Class ProductosyServicios
LnkUnificar.Visible = True LnkUnificar.Visible = True
ChkEsOutSourcing.Checked = ObjProductosServicios.EsOutSourcing ChkEsOutSourcing.Checked = ObjProductosServicios.EsOutSourcing
ChkPrecioLibre.Checked = ObjProductosServicios.PrecioLibre ChkPrecioLibre.Checked = ObjProductosServicios.PrecioLibre
Else Else
Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
@@ -979,6 +995,18 @@ Partial Class ProductosyServicios
Public Sub CargaDdlFraccionArancelaria() Public Sub CargaDdlFraccionArancelaria()
DdlFraccionArancelaria.setEsWebService(True) DdlFraccionArancelaria.setEsWebService(True)
DdlFraccionArancelaria.Attributes.Add("data-metodo", "getfraccionarancelaria") DdlFraccionArancelaria.Attributes.Add("data-metodo", "getfraccionarancelaria")
If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
divCartaPorte.Visible = True
DdlMaterialPeligroso.setEsWebService(True)
DdlMaterialPeligroso.Attributes.Add("data-metodo", "getsatmatpeligroso")
DdlEmbalaje.setEsWebService(True)
DdlEmbalaje.Attributes.Add("data-metodo", "getsatembalajes")
End If
End Sub End Sub
Private Sub VerificaRequiereSerieLote() Private Sub VerificaRequiereSerieLote()
If UsuarioActual.CveEmpresa.Contiene(80, 72) And DdlClasificacion.SelectedIndex > 0 Then If UsuarioActual.CveEmpresa.Contiene(80, 72) And DdlClasificacion.SelectedIndex > 0 Then
@@ -1301,7 +1329,8 @@ Partial Class ProductosyServicios
CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=CveTamaño, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=CveTamaño,
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(), CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked) > 0 Then ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal) > 0 Then
ViewState("CvePS") = ObjProductosServicios.CvePS ViewState("CvePS") = ObjProductosServicios.CvePS
For Each GVR As GridViewRow In GvImpuestosLocales.Rows For Each GVR As GridViewRow In GvImpuestosLocales.Rows
If GVR.FCCheckBox("ChkDeduccion").Checked Then If GVR.FCCheckBox("ChkDeduccion").Checked Then
@@ -1350,7 +1379,8 @@ Partial Class ProductosyServicios
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(), CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked) Then AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal) Then
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True TieneError = True
@@ -2211,6 +2241,8 @@ Partial Class ProductosyServicios
#End Region #End Region
#Region " ECOMMERCE " #Region " ECOMMERCE "
Private Sub InicializaEcommerce() Private Sub InicializaEcommerce()
AplicaEcommerce = False AplicaEcommerce = False

View File

@@ -601,7 +601,7 @@ Partial Class Ventas_Promociones
If Not TieneError And Dr("CveTipoPromocion").ToString <> Dr2("CveTipoPromocion").ToString Then If Not TieneError And Dr("CveTipoPromocion").ToString <> Dr2("CveTipoPromocion").ToString Then
If Not ObjGral.AddHistorialBitacora(369, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("TipoPromocion").ToString, $"{Dr("CodigoPS").ToString} - {Dr("TipoPromocion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then If Not ObjGral.AddHistorialBitacora(369, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("TipoPromocion").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("TipoPromocion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If
@@ -609,7 +609,7 @@ Partial Class Ventas_Promociones
If Not TieneError And Dr("CantidadMinima").ToString <> Dr2("CantidadMinima").ToString Then If Not TieneError And Dr("CantidadMinima").ToString <> Dr2("CantidadMinima").ToString Then
If Not ObjGral.AddHistorialBitacora(370, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("CantidadMinima").ToString, $"{Dr("CodigoPS").ToString} - {Dr("CantidadMinima").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then If Not ObjGral.AddHistorialBitacora(370, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("CantidadMinima").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("CantidadMinima").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If
@@ -624,14 +624,14 @@ Partial Class Ventas_Promociones
'End If 'End If
If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then
If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - {Dr("HoraInicio").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraInicio").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If
End If End If
If Not TieneError And Dr("HoraFin").ToString <> Dr2("HoraFin").ToString Then If Not TieneError And Dr("HoraFin").ToString <> Dr2("HoraFin").ToString Then
If Not ObjGral.AddHistorialBitacora(373, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("HoraFin").ToString, $"{Dr("CodigoPS").ToString} - {Dr("HoraFin").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then If Not ObjGral.AddHistorialBitacora(373, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraFin").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraFin").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If

View File

@@ -10697,7 +10697,7 @@ Partial Class Ventas
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString().ToDecimal, Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString().ToDecimal,
.Descripcion = tPS, .Descripcion = tPS,
.ValorUnitario = drr("PU").ToString().ToDecimal, .ValorUnitario = drr("PU").ToString().ToDecimal,
.Importe = If(UsuarioActual.Empresa.CvePAC = 3, drr("Total").ToString().ToDecimal, drr("TotalImporte").ToString().ToDecimal), .Importe = If(UsuarioActual.Empresa.CvePAC = 3, drr("Total").ToString().ToDecimal.RoundSQL(2), drr("TotalImporte").ToString().ToDecimal),
.Descuento = drr("Descuento").ToString().ToDecimal.RoundSQL(2), .Descuento = drr("Descuento").ToString().ToDecimal.RoundSQL(2),
.Unidad = drr("UM").ToString(), .Unidad = drr("UM").ToString(),
.ClaveUnidad = drr("SATClaveUM").ToString(), .ClaveUnidad = drr("SATClaveUM").ToString(),
@@ -13318,6 +13318,7 @@ Partial Class Ventas
'El almacen general es el Primer Almacen de Material en la Sucursal 'El almacen general es el Primer Almacen de Material en la Sucursal
If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9) Then If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al verificar inventario de remisiones.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For Exit For
End If End If
Next Next
@@ -13493,11 +13494,13 @@ Partial Class Ventas
'If TotalCosto <> 0 Then 'If TotalCosto <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al guardar movimiento de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
End If End If
'End If 'End If
Else Else
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al consultar los movimientos de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
End If End If
factura.Inv_CveMovimiento = CveMovimientoInventario factura.Inv_CveMovimiento = CveMovimientoInventario
factura.Inv_ValorInventario = ValorInventario factura.Inv_ValorInventario = ValorInventario
@@ -13512,6 +13515,7 @@ Partial Class Ventas
If DebeGenerarMovimiento AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then If DebeGenerarMovimiento AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al verificar inventario.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
End If End If
End If End If
@@ -31146,9 +31150,9 @@ Partial Class Ventas
If resp.Count > 0 Then If resp.Count > 0 Then
Dim Msg As New StringBuilder() Dim Msg As New StringBuilder()
Msg.AppendFormat("Mensaje Póliza Virtual: {0}", resp(0)("Descripcion").ToString()) Msg.AppendFormat("Mensaje Póliza Virtual: {0} - Código: {1}", resp(0)("Descripcion").ToString(), resp(0)("Codigo"))
If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508") Then If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508", "510") Then
Retorno = True Retorno = True
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, True, Now, obj.product_unique_code) Then If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, True, Now, obj.product_unique_code) Then

View File

@@ -312,6 +312,10 @@