This commit is contained in:
2021-12-24 07:17:20 -07:00
42 changed files with 13624 additions and 1936 deletions

View File

@@ -1463,7 +1463,7 @@ Public Class ClsClientes
#Region "D I R E C C I O N D E E N V I O " #Region "D I R E C C I O N D E E N V I O "
Public Function DireccionEnvioAdd(CveCliente As Integer, EnvioDireccion As String, EnvioNoExt As String, EnvioNoInt As String, EnvioColonia As String, EnvioCiudad As String, EnvioEstado As String, Public Function DireccionEnvioAdd(CveCliente As Integer, EnvioDireccion As String, EnvioNoExt As String, EnvioNoInt As String, EnvioColonia As String, EnvioCiudad As String, EnvioEstado As String,
EnvioCP As Integer, EnvioContacto As String, CveUsuario As Integer, Estatus As Integer, Optional CveClienteSucursal As Integer = -1, Optional EnvioDepartamento As String = "-1", Optional EnvioTel As String = "-1", EnvioCP As Integer, EnvioContacto As String, CveUsuario As Integer, Estatus As Integer, Optional CveClienteSucursal As Integer = -1, Optional EnvioDepartamento As String = "-1", Optional EnvioTel As String = "-1",
Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1) As Integer Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1, Optional CveEmpresa As Integer = -1) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Vta_ClientesDireccionesEnvioAdd") DataAdapter("PA_Vta_ClientesDireccionesEnvioAdd")
@@ -1488,6 +1488,7 @@ Public Class ClsClientes
.Add("@CveMunicipio", SqlDbType.Int).Value = CveMunicipio .Add("@CveMunicipio", SqlDbType.Int).Value = CveMunicipio
.Add("@CveLocalidad", SqlDbType.Int).Value = CveLocalidad .Add("@CveLocalidad", SqlDbType.Int).Value = CveLocalidad
.Add("@CveColonia", SqlDbType.Int).Value = CveColonia .Add("@CveColonia", SqlDbType.Int).Value = CveColonia
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveDireccionEnvio", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveDireccionEnvio", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With

View File

@@ -6543,6 +6543,47 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
#Region "F L U C T U A C I O N - C A M B I A R I A"
Public Function UpdateVentaTCValuacion(CveVenta As Integer, TCValuacion As Decimal) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_VentasTCValuacionUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@TCValuacion", SqlDbType.Decimal).Value = TCValuacion
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateCompraTCValuacion(CveCompra As Integer, TCValuacion As Decimal) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_ComprasTCValuacionUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@TCValuacion", SqlDbType.Decimal).Value = TCValuacion
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
#Region "IDisposable Support" #Region "IDisposable Support"
' IDisposable ' IDisposable

View File

@@ -246,14 +246,14 @@ Public Class ClsEdocumentacion
End Try End Try
Return Retorno Return Retorno
End Function End Function
#End Region #End Region
#Region "D O C U M E N T A C I O N - E L E C T R O N I C A" #Region "D O C U M E N T A C I O N - E L E C T R O N I C A"
Public Function DocumentacionElectronicaGet(CvePersonal As Integer, CveCliente As Integer, CveProveedor As Integer, CveEmpresa As Integer, CveDocumentacionTipo As Integer, Optional CveVenta As Integer = -1, Optional Modulo As Integer = 1) As Boolean Public Function DocumentacionElectronicaGet(CvePersonal As Integer, CveCliente As Integer, CveProveedor As Integer, CveEmpresa As Integer, CveDocumentacionTipo As Integer, Optional CveVenta As Integer = -1, Optional Modulo As Integer = 1, Optional Periodo As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Edoc_DocumentacionElectronicaGet") DataAdapter("PA_Edoc_DocumentacionElectronicaGet")
@@ -265,6 +265,7 @@ Public Class ClsEdocumentacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@Periodo", SqlDbType.Int).Value = Periodo
.Add("@Modulo", SqlDbType.Int).Value = Modulo .Add("@Modulo", SqlDbType.Int).Value = Modulo
End With End With
@@ -279,7 +280,7 @@ Public Class ClsEdocumentacion
End Function End Function
Public Function DocumentacionElectronicaAdd(CveDocumentacion As Integer, CvePersonal As Integer, CveCliente As Integer, CveProveedor As Integer, Estatus As Integer, Observacion As String, Adjunto As String, Public Function DocumentacionElectronicaAdd(CveDocumentacion As Integer, CvePersonal As Integer, CveCliente As Integer, CveProveedor As Integer, Estatus As Integer, Observacion As String, Adjunto As String,
CveUsuario As Integer, FechaLimite As Date, Optional FechaVigencia As Date = Nothing, Optional CveVenta As Integer = -1, Optional Observacion2 As String = "-1") As Integer CveUsuario As Integer, FechaLimite As Date, Optional FechaVigencia As Date = Nothing, Optional CveVenta As Integer = -1, Optional Observacion2 As String = "-1", Optional Periodo As Integer = 190001) As Integer
Dim Retorno As Integer = 0 Dim Retorno As Integer = 0
@@ -298,6 +299,7 @@ Public Class ClsEdocumentacion
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@FechaLimite", SqlDbType.Date).Value = FechaLimite .Add("@FechaLimite", SqlDbType.Date).Value = FechaLimite
.Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia .Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia
.Add("@Periodo", SqlDbType.Int).Value = Periodo
.Add("@CveDocumentacionElectronica", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveDocumentacionElectronica", SqlDbType.Int).Direction = ParameterDirection.Output
'FechaVigencia 'FechaVigencia
End With End With
@@ -534,6 +536,9 @@ Public Class ClsEdocumentacion
Dim retorno As Boolean = False Dim retorno As Boolean = False
Try Try
SqlAdapter.Fill(DSet) SqlAdapter.Fill(DSet)
If DSet.Tables.Count > 0 Then
Data = DSet.Tables(0)
End If
retorno = True retorno = True
Catch ex As Exception Catch ex As Exception
retorno = False retorno = False
@@ -543,8 +548,64 @@ Public Class ClsEdocumentacion
End Function End Function
#Region "CRUD_Edoc_MaterialidadEnvios"
Public Function Edoc_MaterialidadEnviosGet(cveMaterialidadEnvios As Int32, cveCliente As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Edoc_MaterialidadEnviosGet", CommandType.StoredProcedure)
addParameters("@CveMaterialidadEnvios", SqlDbType.Int, cveMaterialidadEnvios)
addParameters("@CveCliente", SqlDbType.Int, cveCliente)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al obtener el Edoc_MaterialidadEnvios.")
Return retorno
End Function
Public Function Edoc_MaterialidadEnviosAdd(cveCliente As Int32, periodo As Int32, noarchivos As Int32, observacion As String, Correos As String, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Edoc_MaterialidadEnviosAdd", CommandType.StoredProcedure)
addParameters("@CveCliente", SqlDbType.Int, cveCliente)
addParameters("@Periodo", SqlDbType.Int, periodo)
addParameters("@Noarchivos", SqlDbType.Int, noarchivos)
addParameters("@Observacion", SqlDbType.VarChar, observacion)
addParameters("@Correos", SqlDbType.VarChar, Correos)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al agregar el Edoc_MaterialidadEnvios.")
Return retorno
End Function
Public Function Edoc_MaterialidadEnviosUp(cveMaterialidadEnvios As Int32, cveCliente As Int32, periodo As Int32, noarchivos As Int32, observacion As String, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Edoc_MaterialidadEnviosUp", CommandType.StoredProcedure)
addParameters("@CveMaterialidadEnvios", SqlDbType.Int, cveMaterialidadEnvios)
addParameters("@CveCliente", SqlDbType.Int, cveCliente)
addParameters("@Periodo", SqlDbType.Int, periodo)
addParameters("@Noarchivos", SqlDbType.Int, noarchivos)
addParameters("@Observacion", SqlDbType.VarChar, observacion)
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al actualizar el Edoc_MaterialidadEnvios.")
Return retorno
End Function
Public Function Edoc_MaterialidadEnviosRemove(cveMaterialidadEnvios As Int32, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Edoc_MaterialidadEnviosRemove", CommandType.StoredProcedure)
addParameters("@CveMaterialidadEnvios", SqlDbType.Int, cveMaterialidadEnvios)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al eliminar el Edoc_MaterialidadEnvios.")
Return retorno
End Function
#End Region
#Region "CRUD_Edoc_Materialidad" #Region "CRUD_Edoc_Materialidad"
Public Function materialidadDoctos(strxml As String, cveUsuario As Integer, cveEmpresa As Integer, periodo As Integer, Optional guardar As Boolean = False) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_MaterialidadAddXmlDoctos", CommandType.StoredProcedure)
addParameters("@strxml", SqlDbType.Xml, If(String.IsNullOrEmpty(strxml.Trim()), DBNull.Value, DirectCast(strxml, Object)))
addParameters("@CveUsuario", SqlDbType.Int, cveUsuario)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@Periodo", SqlDbType.Int, periodo)
addParameters("@Guardar", SqlDbType.Bit, guardar)
retorno = RunQueryds("Ocurrió un error al analizar archivos.")
Return retorno
End Function
Public Function TableroMaterialidadGET(cveEmpresa As Integer, anio As Integer, mes As Integer) As Boolean Public Function TableroMaterialidadGET(cveEmpresa As Integer, anio As Integer, mes As Integer) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
DataAdapter("PA_Edoc_TableroMaterialidad", CommandType.StoredProcedure) DataAdapter("PA_Edoc_TableroMaterialidad", CommandType.StoredProcedure)

View File

@@ -1734,7 +1734,7 @@ Public Class ClsGenerales
Return Retorno Return Retorno
End Function End Function
Public Function GetTipoCambio(CveTipoCambio As Integer, Fecha As Date) As Boolean Public Function GetTipoCambio(CveTipoCambio As Integer, Fecha As Date) As Boolean
Dim Retorno = False Dim Retorno = False
@@ -1754,6 +1754,26 @@ Public Class ClsGenerales
Return Retorno Return Retorno
End Function End Function
Public Function GetTipoCambioUltimaFluctuacion(CveTipoCambio As Integer, Fecha As Date, Optional Top As Integer = 1000) As Boolean
Dim Retorno = False
DataAdapter("PA_Gral_TipoCambioUltimaFluctuacionGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoCambio", SqlDbType.Int).Value = CveTipoCambio
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@Top", SqlDbType.Int).Value = Top
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el Tipo de Cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetTiposCambio(FechaInicio As Date, FechaFin As Date) As Boolean Public Function GetTiposCambio(FechaInicio As Date, FechaFin As Date) As Boolean
Dim Retorno = False Dim Retorno = False
@@ -3617,8 +3637,7 @@ Public Class ClsGenerales
Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0, Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0,
Optional CveEntregaAlmacen As Integer = -1, Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False) As Integer
Optional AplicaCP As Boolean = False) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Gral_TimbreAdd") DataAdapter("PA_Gral_TimbreAdd")
@@ -3663,7 +3682,7 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -3785,13 +3804,17 @@ Public Class ClsGenerales
.Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@CveCamion", SqlDbType.Int).Value = CveCamion
.Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
.Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
.Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia .Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
.Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite
.Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
.Add("@Estatus", SqlDbType.VarChar).Value = Estatus .Add("@Estatus", SqlDbType.VarChar).Value = Estatus
.Add("@Distancia", SqlDbType.Int).Value = Distancia .Add("@Distancia", SqlDbType.Int).Value = Distancia
.Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite
.Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With

View File

@@ -241,7 +241,7 @@ Public Class ClsMovimientos
Gpo As Integer, CveResponsable As Integer, Gpo As Integer, CveResponsable As Integer,
TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1", TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1) As Boolean Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional CveMoneda As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
'Data = New DataTable 'Data = New DataTable
@@ -274,7 +274,8 @@ Public Class ClsMovimientos
.Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus .Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
.Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados .Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With End With
Try Try

View File

@@ -2356,6 +2356,14 @@ Public Class ClsNominas
Return retorno Return retorno
End Function End Function
Public Function CalculoISRAnual(ejercicio As Integer, cveEmpresa As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_CalculoISRAnual", CommandType.StoredProcedure)
addParameters("@Ejercicio", SqlDbType.Int, ejercicio)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
retorno = RunQuery("Ocurrió un error al obtener el PA_Nom_CalculoISRAnual.")
Return retorno
End Function
Public Function GetNominaAcumulado(Ejercicio As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodoI As Integer, CvePeriodoF As Integer, CveEmpresa As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean Public Function GetNominaAcumulado(Ejercicio As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodoI As Integer, CvePeriodoF As Integer, CveEmpresa As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False

View File

@@ -127,6 +127,47 @@ Public Class ClsPaginas
End Set End Set
End Property End Property
Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As MTipoCambioFluctuacion
Get
If Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
End If
ObjGral.Dispose()
End If
Dim fluctuacion = New MTipoCambioFluctuacion() With {
.TCFluctuacion = 0,
.FechaFluctuacion = MinFecha
}
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
If Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr = DirectCast(Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha = '{0}'", Fecha))
If dr IsNot Nothing Then
fluctuacion.TCFluctuacion = dr("TCFluctuacion").ToString().ToDecimal()
fluctuacion.FechaFluctuacion = dr("FechaFluctuacion").ToString().ToDateTime()
End If
Return fluctuacion
Else
Return fluctuacion
End If
End Get
End Property
<Serializable()>
Public Class MTipoCambioFluctuacion
Public Property TCFluctuacion As Decimal
Public Property FechaFluctuacion As DateTime
End Class
Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double
Get Get
If GlobalTipoCambioEuro <= 0 Then If GlobalTipoCambioEuro <= 0 Then
@@ -4109,6 +4150,9 @@ Public Class ClsPaginas
PaginaDict.Add("/Nomina/NomTimbrados.aspx".ToUpper(), 920) PaginaDict.Add("/Nomina/NomTimbrados.aspx".ToUpper(), 920)
PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1)
PaginaDict.Add("/Nomina/RepInversiondeNomina.aspx".ToUpper(), 906) PaginaDict.Add("/Nomina/RepInversiondeNomina.aspx".ToUpper(), 906)
PaginaDict.Add("/Nomina/CalculoISRAnual.aspx".ToUpper(), 983)
PaginaDict.Add("/Documentacion/TableroMaterialidad.aspx".ToUpper(), 965)
PaginaDict.Add("/Documentacion/TableroMaterialidadDetalle.aspx".ToUpper(), 965)
PaginaDict.Add("/RH/DiasFestivos.aspx".ToUpper(), -1) PaginaDict.Add("/RH/DiasFestivos.aspx".ToUpper(), -1)
PaginaDict.Add("/Nomina/FiniquitoB.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/FiniquitoB.aspx".ToUpper(), -1)
''CONFIGURACIONES GENERALES ''CONFIGURACIONES GENERALES
@@ -4944,6 +4988,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Inventarios/CatUnidades.aspx".ToUpper(), 2056) PaginaDict.Add("/Inventarios/CatUnidades.aspx".ToUpper(), 2056)
PaginaDict.Add("/Inventarios/EntregaAlmacenRuta.aspx".ToUpper(), 1320) PaginaDict.Add("/Inventarios/EntregaAlmacenRuta.aspx".ToUpper(), 1320)
PaginaDict.Add("/Inventarios/RepEntregaAlmacenRuta.aspx".ToUpper(), 1319) PaginaDict.Add("/Inventarios/RepEntregaAlmacenRuta.aspx".ToUpper(), 1319)
PaginaDict.Add("/Inventarios/CartaPorteManual.aspx".ToUpper(), 1321)
@@ -5181,8 +5226,6 @@ Public Class ClsPaginas
PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422) PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422)
PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427) PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427)
PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428) PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428)
PaginaDict.Add("/Documentacion/TableroMaterialidad.aspx".ToUpper(), -1)
PaginaDict.Add("/Documentacion/TableroMaterialidadDetalle.aspx".ToUpper(), -1)
PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628) PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628)

View File

@@ -5080,202 +5080,203 @@ Namespace Modelos
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then
'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES 'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES
For Each RowMovimiento As DataRow In DtSalidas.Rows If ObjFactura.TipoDocto <> "Rem" Then
Dim CveConceptoMovimiento As Integer = -1 For Each RowMovimiento As DataRow In DtSalidas.Rows
Dim CveAlmacenMovimiento As Integer = -1 Dim CveConceptoMovimiento As Integer = -1
Dim CveAlmacenMovimiento As Integer = -1
Dim CveMovimientoDevolucion As Integer = 0 Dim CveMovimientoDevolucion As Integer = 0
Dim Folio As Integer = 0 Dim Folio As Integer = 0
Select Case RowMovimiento("CveConcepto").ToString().ToEntero() Select Case RowMovimiento("CveConcepto").ToString().ToEntero()
Case 3 Case 3
CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 40 Case 40
CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 18 Case 18
CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
''SI TIENE REMISIONES RELACIONADAS ''SI TIENE REMISIONES RELACIONADAS
'If DtRemisionesFacturadas.Rows.Count > 0 Then 'If DtRemisionesFacturadas.Rows.Count > 0 Then
' Dim RowRemision As DataRow = DtExistencias.FiltroPrimero($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}") ' Dim RowRemision As DataRow = DtExistencias.FiltroPrimero($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}")
' Dim CveRemision As Integer = RowRemision("CveRemision").ToString().ToEntero() ' Dim CveRemision As Integer = RowRemision("CveRemision").ToString().ToEntero()
' Dim CancelarRemision As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = CveRemision)) ' Dim CancelarRemision As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = CveRemision))
' 'SI LA REMISION SE VA A CANCELAR DEBE REGRESAR AL ALMACEN GENERAL ' 'SI LA REMISION SE VA A CANCELAR DEBE REGRESAR AL ALMACEN GENERAL
' If CancelarRemision Then ' If CancelarRemision Then
' CveAlmacenDevolucion = RowRemision("CveAlmacenDevolucion").ToString().ToEntero() ' CveAlmacenDevolucion = RowRemision("CveAlmacenDevolucion").ToString().ToEntero()
' Else ' Else
' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero() ' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
' End If ' End If
'Else 'Else
' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero() ' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
'End If 'End If
End Select End Select
'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION 'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION
If ObjFactura.SaldoAlmacen <> 0 Then If ObjFactura.SaldoAlmacen <> 0 Then
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN) 'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1") CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1")
Folio = ObjInventario.Folio Folio = ObjInventario.Folio
If CveMovimientoDevolucion > 0 Then If CveMovimientoDevolucion > 0 Then
For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows
Dim FechaCaducidad As Date = MinFecha Dim FechaCaducidad As Date = MinFecha
If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then
If IsDate(Dr("FechaCaducidad")) Then If IsDate(Dr("FechaCaducidad")) Then
FechaCaducidad = Dr("FechaCaducidad").ToString().ToDate() FechaCaducidad = Dr("FechaCaducidad").ToString().ToDate()
End If
End If
Dim CveVentaDetalleRemision As Integer = -1
If CveConceptoMovimiento = 41 Then
CveVentaDetalleRemision = Dr("CveVentaDetalleRemision").ToString.ToEntero()
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad, CveVentaDetalleRemision:=CveVentaDetalleRemision) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
End If
Next
Else
MensajeError = "Ocurrió un error al agregar el movimiento"
ErrorCancelar = True
End If
'GENERA PREPOLIZA DEL MOVIMIENTO DE DEVOLUCION
If Not ErrorCancelar Then
Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0
If ObjInventario.GetMovimientosDetalle(CveMovimientoDevolucion, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero
Dim IdCtaContable As Integer = 0
If tmpCostos.Rows.Count > 0 Then
Dim Multiplicador As Decimal = -1D
If ObjFactura.TipoDocto = "Dev" Then
Multiplicador = 1D
End If
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = Now
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER)
For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD()
TotalCostoAcumulado += ValorInventario
'CUANDO ES EL ÚLTIMO MOVIMIENTO Y HAY DIFERENCIAS EN LOS IMPORTES
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
End If
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If Not ErrorCancelar Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, Multiplicador * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * ValorInventario, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
ErrorCancelar = True
End If
End If
cont += 1
Next
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, Multiplicador * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * TotalCosto) Then
ErrorCancelar = True
End If
'AUTOCONTA - EL MOVIMIENTO 1 ES EL DE VENTA
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then
AutoConta = False
End If
If AutoConta And Not ErrorCancelar Then
If IdCtaContable > 0 Then
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
End If
Else
Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia)
End If
End If
Else
ErrorCancelar = True
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
End If
End If End If
End If End If
End If
Dim CveVentaDetalleRemision As Integer = -1 'AGREGA BITACORA A VENTA
If CveConceptoMovimiento = 41 Then If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then
CveVentaDetalleRemision = Dr("CveVentaDetalleRemision").ToString.ToEntero() Dim MensajeBitacora = "Devuelta"
End If If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
MensajeError = "Ocurrió un error al agregar la bitacora."
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad, CveVentaDetalleRemision:=CveVentaDetalleRemision) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar." End If
Exit For End If
Else
'SI EXISTE UNA DEVOLUCION PREVIAMENTE HECHA UTILIZAR COMO REFERENCIA
If DtDevPrevias IsNot Nothing AndAlso DtDevPrevias.Rows.Count > 0 Then
CveMovimientoDevolucion = DtDevPrevias.FiltroPrimeroValor("CveMovimiento", $"CveConcepto = {CveConceptoMovimiento}").ToEntero()
End If
End If
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
'SI ES DEVOLUCION DEL CLIENTE DEBE REGRESAR A ENTREGA POR ADELANTADO
If Not ErrorCancelar AndAlso CveConceptoMovimiento = 18 AndAlso RevivirRemisiones Then
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimientoDevolucion, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión"
End If
End If
If DtVirtuales IsNot Nothing Then
For Each RowVirtual As DataRow In DtVirtuales.Rows
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
If Not ErrorCancelar AndAlso Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If End If
Next Next
Else
MensajeError = "Ocurrió un error al agregar el movimiento"
ErrorCancelar = True
End If End If
'GENERA PREPOLIZA DEL MOVIMIENTO DE DEVOLUCION If ErrorCancelar Then
If Not ErrorCancelar Then Exit For
Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0
If ObjInventario.GetMovimientosDetalle(CveMovimientoDevolucion, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero
Dim IdCtaContable As Integer = 0
If tmpCostos.Rows.Count > 0 Then
Dim Multiplicador As Decimal = -1D
If ObjFactura.TipoDocto = "Dev" Then
Multiplicador = 1D
End If
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = Now
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER)
For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD()
TotalCostoAcumulado += ValorInventario
'CUANDO ES EL ÚLTIMO MOVIMIENTO Y HAY DIFERENCIAS EN LOS IMPORTES
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
End If
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If Not ErrorCancelar Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, Multiplicador * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * ValorInventario, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
ErrorCancelar = True
End If
End If
cont += 1
Next
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, Multiplicador * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * TotalCosto) Then
ErrorCancelar = True
End If
'AUTOCONTA - EL MOVIMIENTO 1 ES EL DE VENTA
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then
AutoConta = False
End If
If AutoConta And Not ErrorCancelar Then
If IdCtaContable > 0 Then
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
End If
Else
Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia)
End If
End If
Else
ErrorCancelar = True
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
End If
End If
End If
End If End If
'AGREGA BITACORA A VENTA Next
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then End If
Dim MensajeBitacora = "Devuelta"
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
MensajeError = "Ocurrió un error al agregar la bitacora."
ErrorCancelar = True
End If
End If
Else
'SI EXISTE UNA DEVOLUCION PREVIAMENTE HECHA UTILIZAR COMO REFERENCIA
If DtDevPrevias IsNot Nothing AndAlso DtDevPrevias.Rows.Count > 0 Then
CveMovimientoDevolucion = DtDevPrevias.FiltroPrimeroValor("CveMovimiento", $"CveConcepto = {CveConceptoMovimiento}").ToEntero()
End If
End If
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
'SI ES DEVOLUCION DEL CLIENTE DEBE REGRESAR A ENTREGA POR ADELANTADO
If Not ErrorCancelar AndAlso CveConceptoMovimiento = 18 AndAlso RevivirRemisiones Then
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimientoDevolucion, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión"
End If
End If
If DtVirtuales IsNot Nothing Then
For Each RowVirtual As DataRow In DtVirtuales.Rows
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
If Not ErrorCancelar AndAlso Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If
Next
End If
If ErrorCancelar Then
Exit For
End If
Next
'SI EXISTEN HAY EXISTENCIA EN (ENTREGA POR ADELANTADO) SE TIENE QUE REGRESAR AL ALMACEN ORGINAL (GENERAL,SIN COSTO) 'SI EXISTEN HAY EXISTENCIA EN (ENTREGA POR ADELANTADO) SE TIENE QUE REGRESAR AL ALMACEN ORGINAL (GENERAL,SIN COSTO)
If Not ErrorCancelar AndAlso ListaRemisionesCancelar IsNot Nothing AndAlso ListaRemisionesCancelar.Count > 0 Then If Not ErrorCancelar AndAlso ObjFactura.TipoDocto <> "Rem" AndAlso ListaRemisionesCancelar IsNot Nothing AndAlso ListaRemisionesCancelar.Count > 0 Then
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO) 'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then If Not ErrorCancelar Then
@@ -5314,6 +5315,40 @@ Namespace Modelos
End If End If
'CANCELACION DE MOVIMIENTOS DE REMISION
If Not ErrorCancelar AndAlso ObjFactura.TipoDocto = "Rem" AndAlso RealizarDevolucionAlmacen Then
Dim CveAlmacenGeneral As Integer = 0
Dim DtMovRemision As DataTable = Nothing
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero()
Else
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If
End If
'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO)
If Not ErrorCancelar AndAlso DtMovRemision IsNot Nothing AndAlso DtMovRemision.Rows.Count > 0 Then
Dim DtDevMovs = DtMovRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveAlmacen"})
For Each RowDevolucion As DataRow In DtDevMovs.Rows
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
If Not CancelarMovimientosRemision(CveVenta, CveAlmacen, CveAlmacenGeneral, DtMovRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")} AND CvePS > 0"), ObjVentas, ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
Exit For
End If
Next
End If
End If
'VERIFICAR MOVIMIENTOS DE APARTADOS 'VERIFICAR MOVIMIENTOS DE APARTADOS
If Not ErrorCancelar Then If Not ErrorCancelar Then
If Not GeneraMovimientosApartados(ObjInventario) Then If Not GeneraMovimientosApartados(ObjInventario) Then

View File

@@ -119,7 +119,8 @@ Public Class Timbres
Dim Distancia As Integer = 1 Dim Distancia As Integer = 1
Dim ObjGrales As New ClsGenerales Dim ObjGrales As New ClsGenerales
If ObjGrales.GetGralTimbre(CveTimbre, "-1", FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then
If ObjGrales.GetGralTimbre(CveTimbre, Obj.TipoDocto, FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then
If ObjGrales.DtResultados.Rows.Count = 1 Then If ObjGrales.DtResultados.Rows.Count = 1 Then
Dim DtMovimientos As DataTable = Nothing Dim DtMovimientos As DataTable = Nothing
@@ -144,20 +145,20 @@ Public Class Timbres
End If End If
If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then
DtMovimientos = ObjGrales.DtResultados DtMovimientos = ObjGrales.DtResultados
Else Else
TieneError = True TieneError = True
_MsgError.AppendLine("Error al obtener Movimientos") _MsgError.AppendLine("Error al obtener Movimientos")
End If End If
ObjFactura.DtDetalle = DtMovimientos ObjFactura.DtDetalle = DtMovimientos
AplicaCP = Boolean.Parse(drT("AplicaCP").ToString) AplicaCP = Boolean.Parse(drT("AplicaCP").ToString)
ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero
ObjFactura.SetSubProyecto() ObjFactura.SetSubProyecto()
ObjFactura.SetSubProyectoMatriz() ObjFactura.SetSubProyectoMatriz()
If AplicaCP Then If AplicaCP Then
@@ -331,15 +332,17 @@ Public Class Timbres
_MsgError.AppendLine("timbrado son detalle de productos") _MsgError.AppendLine("timbrado son detalle de productos")
End If End If
End If End If
Else Else
TieneError = True TieneError = True
_MsgError.AppendLine("Consultar datos de timbrado") _MsgError.AppendLine("Consultar datos de timbrado")
End If End If
ObjGrales.Dispose() ObjGrales.Dispose()
Else
Timbre = Nothing
_MsgError.AppendLine("Consultar datos de timbrado")
End If End If
Return Timbre Return Timbre
End Function End Function

View File

@@ -117,11 +117,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Case "sendMailLPM" Case "sendMailLPM"
context.Response.Write(sendMailLPM(context)) context.Response.Write(sendMailLPM(context))
Case "getSATColomias" Case "getSATColomias"
getSATColonias(context) getSatColonias(context)
Case "GetFilesDirectory" Case "GetFilesDirectory"
GetFilesDirectory(context) GetFilesDirectory(context)
Case "Getetiquetas" Case "Getetiquetas"
Getetiquetas(context) Getetiquetas(context)
Case "cancelarRemision"
cancelarRemision(context)
End Select End Select
Catch ex As Exception Catch ex As Exception
ex.GuardaLog(ex.Message) ex.GuardaLog(ex.Message)
@@ -1599,4 +1601,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Return retorno Return retorno
End Function End Function
#End Region #End Region
#Region "C A N C E L A R - R E M I S I O N"
Private Function cancelarRemision(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim CveVenta As Integer = IfNull(context.Request("CveVenta"), "-1").ToString().ToEntero()
If CveVenta > 0 Then
Dim usuario As Usuario = UsuarioActual(context)
If usuario IsNot Nothing AndAlso usuario.CveEmpresa > 0 Then
Dim CveAlmacenDevolucion As Integer = 0
Using ObjInv As New ClsInventarios
If ObjInv.GetInv_Mov(CveVenta, usuario.CveEmpresa) Then
If ObjInv.DtResultados.Rows.Count > 0 Then
CveAlmacenDevolucion = ObjInv.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveConcepto IN (3,40)").ToEntero()
End If
End If
End Using
Dim ObjFacturaCancelacion As New Modelos.Factura(usuario, CveVenta, usuario.CveEmpresa, EsCancelacion:=True)
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
If ObjFacturaCancelacion.TipoDocto = "Rem" Then
Dim respuesta = ObjFacturaCancelacion.CancelarFactura(True, New List(Of Integer))
If respuesta IsNot Nothing Then
retorno = JsonConvert.SerializeObject(respuesta)
End If
End If
End If
End If
If Not String.IsNullOrEmpty(retorno) Then
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
Return retorno
End Function
#End Region
End Class End Class

File diff suppressed because it is too large Load Diff

View File

@@ -2,10 +2,18 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.Globalization
Imports Extensiones Imports Extensiones
Partial Class Bancos_FluctuacionCambiaria Partial Class Bancos_FluctuacionCambiaria
Inherits ClsPaginas Inherits ClsPaginas
Public ReadOnly Property FechaUltimoDiaMes() As DateTime
Get
Return New DateTime(DdlAnio.SelectedValue.ToEntero(), DdlMes.SelectedValue.ToEntero(), 1).AddMonths(1).AddDays(-1)
End Get
End Property
#Region "PROPIEDADES" #Region "PROPIEDADES"
Private Property LblTotal() As String Private Property LblTotal() As String
Get Get
@@ -19,7 +27,7 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CargaFechas()
CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "") CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "")
CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "") CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "") CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "")
@@ -32,6 +40,27 @@ Partial Class Bancos_FluctuacionCambiaria
End Sub End Sub
#Region "CARGAS" #Region "CARGAS"
Private Sub CargaFechas()
'Año actual
DdlAnio.Items.Add(New ListItem(Now.Year.ToString(), Now.Year.ToString()))
'Año Anterior
DdlAnio.Items.Add(New ListItem(Now.AddYears(-1).Year.ToString(), Now.AddYears(1).Year.ToString()))
For i = 1 To 12
Dim fecha = New DateTime(DdlAnio.SelectedValue.ToEntero(), i, 1)
Dim mes = fecha.ToString("MMMM", CultureInfo.GetCultureInfo("es-MX"))
Dim mesStr = Char.ToUpper(mes(0)) + mes.Substring(1)
DdlMes.Items.Add(New ListItem(mesStr, i.ToString()))
Next
Dim UltimaFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
If UltimaFluctuacion IsNot Nothing Then
DdlMes.SelectedValueExist(UltimaFluctuacion.FechaFluctuacion.Month)
DdlMes.SelectedValueExist(UltimaFluctuacion.FechaFluctuacion.Year)
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaTipoCambio() CargaTipoCambio()
@@ -47,36 +76,52 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaTipoCambio() Private Sub CargaTipoCambio()
Dim ObjGenerales As New ClsGenerales Dim ObjGenerales As New ClsGenerales
ObjGenerales.GetTipoCambio(-1, TxtFecha.Text.ToDate) ObjGenerales.GetTipoCambio(-1, FechaUltimoDiaMes)
If ObjGenerales.DtResultados.Rows.Count > 0 Then If ObjGenerales.DtResultados.Rows.Count > 0 Then
LtTipoCambioActual.Text = ObjGenerales.DtResultados.Rows(0)("TipoCambio").ToString LtTipoCambioActual.Text = ObjGenerales.DtResultados.Rows(0)("TipoCambio").ToString
TxtConceptoFluctuacion.Text = "Fluctuación a " & TxtFecha.Text TxtConceptoFluctuacion.Text = "Fluctuación a " & FechaUltimoDiaMes.ToShortDateString()
End If End If
ObjGenerales.Dispose() ObjGenerales.Dispose()
End Sub End Sub
Private Sub CargaUltimaFluctuacion() Private Sub CargaUltimaFluctuacion()
Dim Obj As New ClsBancos 'Dim Obj As New ClsBancos
If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then 'If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC") ' Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC")
If dt.Rows.Count > 0 Then ' If dt.Rows.Count > 0 Then
LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", dt.Rows(0)("Fecha").ToString.ToDate.ToShortDateString) ' LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", dt.Rows(0)("Fecha").ToString.ToDate.ToShortDateString)
'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual ' 'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual
If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then ' If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then
TxtFecha.Text = Now.ToShortDateString ' TxtFecha.Text = Now.ToShortDateString
Else ' Else
TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString() ' TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString()
End If ' End If
End If ' End If
'End If
'Obj.Dispose()
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
If UltimaFluctuacion IsNot Nothing Then
LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", UltimaFluctuacion.FechaFluctuacion.ToShortDateString)
'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual
If UltimaFluctuacion.FechaFluctuacion >= Now.AddMonths(-1).LastDayOfMonth Then
DdlMes.SelectedValueExist(Now.Month)
DdlAnio.SelectedValueExist(Now.Year)
Else
DdlMes.SelectedValueExist(Now.AddMonths(-1).Month)
DdlAnio.SelectedValueExist(Now.AddMonths(-1).Year)
'TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString()
End If
End If End If
Obj.Dispose()
CargaTipoCambio() CargaTipoCambio()
End Sub End Sub
Private Sub CargaDatosCompra() Private Sub CargaDatosCompra()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
'LblTotalCompras.Text = "0.00" 'LblTotalCompras.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 1, UsuarioActual.CveEmpresa) Then
GvCompras.DataSource = ObjBancos.DtResultados GvCompras.DataSource = ObjBancos.DtResultados
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero 'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ") Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
@@ -110,7 +155,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosVentas() Private Sub CargaDatosVentas()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
LblTotalVentas.Text = "0.00" LblTotalVentas.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 2, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 2, UsuarioActual.CveEmpresa) Then
GvVentas.DataSource = ObjBancos.DtResultados GvVentas.DataSource = ObjBancos.DtResultados
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
@@ -142,7 +187,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosCuentas() Private Sub CargaDatosCuentas()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
LblTotalBancos.Text = "0.00" LblTotalBancos.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 4, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 4, UsuarioActual.CveEmpresa) Then
Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Dim TotAcumulado As Decimal = 0 Dim TotAcumulado As Decimal = 0
@@ -151,7 +196,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0 Dim Total As Decimal = 0
Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero
If CveCuentaExtranjera > 0 Then If CveCuentaExtranjera > 0 Then
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, TxtFecha.Text.ToDate, 2, "-1", UsuarioActual.CveEmpresa, "1") Then If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, "-1", UsuarioActual.CveEmpresa, "1") Then
If Conta.DtResultados.Rows.Count > 1 Then If Conta.DtResultados.Rows.Count > 1 Then
Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
End If End If
@@ -162,7 +207,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim SaldoActualContabilidad As Decimal = 0 Dim SaldoActualContabilidad As Decimal = 0
Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero
If CveCuentaComplementaria > 0 Then If CveCuentaComplementaria > 0 Then
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, TxtFecha.Text.ToDate, 2, "-1", UsuarioActual.CveEmpresa, "1") Then If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, "-1", UsuarioActual.CveEmpresa, "1") Then
If Conta.DtResultados.Rows.Count > 1 Then If Conta.DtResultados.Rows.Count > 1 Then
SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
End If End If
@@ -189,7 +234,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosDeudores() Private Sub CargaDatosDeudores()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
LblTotalDeudores.Text = "0.00" LblTotalDeudores.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 5, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 5, UsuarioActual.CveEmpresa) Then
GvDeudores.DataSource = ObjBancos.DtResultados GvDeudores.DataSource = ObjBancos.DtResultados
LblTotalDeudores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero LblTotalDeudores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else Else
@@ -203,7 +248,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosAcreedores() Private Sub CargaDatosAcreedores()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
LblTotalAcreedores.Text = "0.00" LblTotalAcreedores.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 6, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 6, UsuarioActual.CveEmpresa) Then
GvAcreedores.DataSource = ObjBancos.DtResultados GvAcreedores.DataSource = ObjBancos.DtResultados
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else Else
@@ -217,7 +262,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosFiliales() Private Sub CargaDatosFiliales()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
LblTotalAcreedores.Text = "0.00" LblTotalAcreedores.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 7, UsuarioActual.CveEmpresa) Then If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then
GvFiliales.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0") GvFiliales.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0")
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else Else
@@ -237,15 +282,17 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0 Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL() Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoCompras.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoCompras.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0 Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer Dim CveCuentaPerdida, CveCuentaGanancia As Integer
Dim idCtaPerdida, IdCtaGanancia As Integer Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0 Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 55175 Dim IdCtaComplementaria As Integer = 0
Dim IdCtaComplementaria As Integer = 1248
Dim ErrorRegistrar As Boolean = False Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379 CveCuentaPerdida = 0 '55379
@@ -257,19 +304,17 @@ Partial Class Bancos_FluctuacionCambiaria
Total = LblTotal.ToDecimal Total = LblTotal.ToDecimal
If Total > 0 Then If Total > 0 Then
CveConceptoContable = 64 CveConceptoContable = 64
CveCuenta = CveCuentaGanancia
idCta = IdCtaGanancia idCta = IdCtaGanancia
TipoMovto = True TipoMovto = True
Else Else
CveConceptoContable = 65 CveConceptoContable = 65
CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida idCta = idCtaPerdida
TipoMovto = False TipoMovto = False
End If End If
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
ErrorRegistrar = True ErrorRegistrar = True
End If End If
@@ -279,12 +324,18 @@ Partial Class Bancos_FluctuacionCambiaria
Total = gvr.DataKey("Fluctuacion").ToDecimal Total = gvr.DataKey("Fluctuacion").ToDecimal
'si es pérdida o ganancia 'si es pérdida o ganancia
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
'movimiento de complementaria 'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total) Then
ErrorRegistrar = True ErrorRegistrar = True
Exit For Exit For
End If
If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
ErrorRegistrar = True
Exit For
End If End If
Next Next
If Not ErrorRegistrar Then If Not ErrorRegistrar Then
@@ -311,16 +362,18 @@ Partial Class Bancos_FluctuacionCambiaria
Dim idCtaPerdida, IdCtaGanancia As Integer Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0 Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 54141 Dim IdCtaComplementaria As Integer = 0
Dim IdCtaComplementaria As Integer = 70
Dim ErrorRegistrar As Boolean = False Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379 CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382 CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
''
Total = LblTotalVentas.Text.ToDecimal Total = LblTotalVentas.Text.ToDecimal
If Total > 0 Then If Total > 0 Then
CveConceptoContable = 64 CveConceptoContable = 64
@@ -341,7 +394,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Conta As New ClsContabilidad Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL() Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then
ErrorRegistrar = True ErrorRegistrar = True
@@ -353,14 +406,21 @@ Partial Class Bancos_FluctuacionCambiaria
For Each gvr As GridViewRow In GvVentas.Rows For Each gvr As GridViewRow In GvVentas.Rows
Total = -gvr.DataKey("Fluctuacion").ToDecimal Total = -gvr.DataKey("Fluctuacion").ToDecimal
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
CveConconceptoCliente = 226 CveConconceptoCliente = 226
Else Else
CveConconceptoCliente = 203 CveConconceptoCliente = 203
End If End If
If Not Conta.UpdateVentaTCValuacion(gvr.DataKey("CveVenta").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
ErrorRegistrar = True
Exit For
End If
'movimiento de complementaria 'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True ErrorRegistrar = True
Exit For Exit For
End If End If
@@ -395,9 +455,9 @@ Partial Class Bancos_FluctuacionCambiaria
Dim CveConceptoContable As Integer = 0 Dim CveConceptoContable As Integer = 0
Dim ErrorRegistrar As Boolean = False Dim ErrorRegistrar As Boolean = False
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Dim MesTCtexto As String = String.Format("{0} TC:{1}", TxtFecha.Text.ToDate.ToString("MMMM-yyyy"), TCCierreFluctuacion) Dim MesTCtexto As String = String.Format("{0} TC:{1}", FechaUltimoDiaMes.ToString("MMMM-yyyy"), TCCierreFluctuacion)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveCuentaPerdida = 0 ' 55379 CveCuentaPerdida = 0 ' 55379
@@ -477,7 +537,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0 Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaDD", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoDeudores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaDD", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoDeudores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0 Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0 Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -494,7 +554,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Total = LblTotalAcreedores.Text.ToDecimal Total = LblTotalAcreedores.Text.ToDecimal
Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", TxtFecha.Text) Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", FechaUltimoDiaMes)
Dim CveConconceptoDeudores As Integer = 256 Dim CveConconceptoDeudores As Integer = 256
@@ -553,7 +613,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
ObjContPaq.IniciaTransacSQL() ObjContPaq.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaFilial", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoFiliales.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaFilial", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoFiliales.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0 Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0 Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -572,7 +632,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Total = LblTotalAcreedores.Text.ToDecimal Total = LblTotalAcreedores.Text.ToDecimal
Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", TxtFecha.Text) Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", FechaUltimoDiaMes)
'saco las cuentas de pérdida y ganancia 'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvFiliales.Rows For Each gvr As GridViewRow In GvFiliales.Rows
@@ -646,7 +706,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0 Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL() Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0 Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0 Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer Dim CveCuentaPerdida, CveCuentaGanancia As Integer

View File

@@ -5832,7 +5832,14 @@ Partial Class Bancos_IE
Else Else
If CveIE > 0 Then If CveIE > 0 Then
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"})
' GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"})
GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "Folio", "SerieFolio", "FechaComplemento", "Importe", "RFCReceptor", "StrEstatus", "FechaCancelacion", "Tipo", "Estatus", "CveIE", "CvePAC"})
'"CveComplementoPago","FolioFiscal","Folio","SerieFolio","FechaComplemento","Importe","RFCReceptor","StrEstatus","FechaCancelacion","Tipo,Estatus","CveIE","CvePAC"
End If End If
End If End If

View File

@@ -637,7 +637,7 @@ Partial Class Bancos_PopIECompras
CveMonedaCompra = dr("CveMoneda").ToString.ToEntero CveMonedaCompra = dr("CveMoneda").ToString.ToEntero
CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero
SerieFolio = dr("SerieFolio").ToString SerieFolio = dr("SerieFolio").ToString
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal TipoCambioOriginal = dr("TipoCambioOriginal").ToString.ToDecimal
NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor)) NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
@@ -1474,6 +1474,14 @@ Partial Class Bancos_PopIECompras
Dim CveCuentaContabilizacion As Long = 1 Dim CveCuentaContabilizacion As Long = 1
Dim CuentasContablesInvalidasSIG As New StringBuilder Dim CuentasContablesInvalidasSIG As New StringBuilder
Dim FechaPago As Date = TxtFechaDocumento.Text.ToDate()
'VERIFICA SI SE ESTA PAGANDO EN EL MISMO MES DE LA FACTURA
Dim PagoMismoMes As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso (FechaDocumento < FechaPago) AndAlso ((FechaDocumento.Month < FechaPago.Month AndAlso FechaDocumento.Year = FechaPago.Year) OrElse (FechaDocumento.Year < FechaPago.Year)) Then
PagoMismoMes = False
End If
Dim TCUltimaFluctuacion As Decimal = 1
'Tipos de cambio segun metodo de pago 'Tipos de cambio segun metodo de pago
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
tipoCambioPago = 1 tipoCambioPago = 1
@@ -1491,6 +1499,13 @@ Partial Class Bancos_PopIECompras
tipoCambioPago = TxtTipoCambio.Text.ToDecimal tipoCambioPago = TxtTipoCambio.Text.ToDecimal
tipoCambioCompra = 1 tipoCambioCompra = 1
PorcentajePago = ImportePagado.ToString.ToDecimal / MovimientoPagar.Total PorcentajePago = ImportePagado.ToString.ToDecimal / MovimientoPagar.Total
End If
Dim UltimaFluctuacion = GlobalTipoCambioUltimaFluctuacion(TxtFechaDocumento.Text.ToDate)
If UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < TxtFechaDocumento.Text.ToDate Then
TCUltimaFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If End If
Select Case RBLContado.SelectedValue Select Case RBLContado.SelectedValue
@@ -1569,17 +1584,17 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If End If
ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
CveIE = rw.DataKey("CveIE").ToString.ToEntero CveIE = rw.DataKey("CveIE").ToString.ToEntero
If CveMonedaCompra <> 1 Then If CveMonedaCompra <> 1 Then
@@ -1617,17 +1632,17 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If End If
ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
CveIE = rw.DataKey("CveIE").ToString.ToEntero CveIE = rw.DataKey("CveIE").ToString.ToEntero
If CveMonedaCompra <> 1 Then If CveMonedaCompra <> 1 Then
@@ -1640,14 +1655,14 @@ Partial Class Bancos_PopIECompras
IdCtaContable = CtaProveedor IdCtaContable = CtaProveedor
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=tipoCambioCompra) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then
IdCtaContable = IdCtaContComplementaria IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
End If End If
@@ -1664,13 +1679,13 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If End If
ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL ImporteMX = ImporteMX.RoundSQL
@@ -1686,14 +1701,14 @@ Partial Class Bancos_PopIECompras
IdCtaContable = CtaProveedor IdCtaContable = CtaProveedor
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=tipoCambioCompra) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then
IdCtaContable = IdCtaContComplementaria IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
End If End If
@@ -1710,13 +1725,13 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If End If
ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL ImporteMX = ImporteMX.RoundSQL
@@ -1731,14 +1746,14 @@ Partial Class Bancos_PopIECompras
IdCtaContable = CtaProveedor IdCtaContable = CtaProveedor
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, 275, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, rw.DataKey("CveVenta").ToEntero, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=tipoCambioCompra) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, 275, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, rw.DataKey("CveVenta").ToEntero, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
If CveMonedaCompra = 2 Then If CveMonedaCompra = 2 Then
IdCtaContable = IdCtaContComplementaria IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, rw.DataKey("CveVenta").ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, rw.DataKey("CveVenta").ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
End If End If
@@ -1755,17 +1770,17 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ImportePagado.ToString.ToDecimal / tipoCambioPago ImporteMovimiento = ImportePagado.ToString.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = ImportePagado.ToString.ToDecimal * tipoCambioPago ImporteMovimiento = ImportePagado.ToString.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ImportePagado.ToString.ToDecimal ImporteMovimiento = ImportePagado.ToString.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If End If
ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If End If
If CveMonedaCompra = 1 Then If CveMonedaCompra = 1 Then
@@ -1773,7 +1788,7 @@ Partial Class Bancos_PopIECompras
Else Else
IdCtaContable = IdCtaContComplementaria IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
ImporteMX = ImporteMovimiento ImporteMX = ImporteMovimiento
@@ -2557,9 +2572,10 @@ Partial Class Bancos_PopIECompras
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
TimpocambioGeneral = TCImpuestos TimpocambioGeneral = TCImpuestos
Dim tipoCambioCompraValuacion As Decimal = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
If tipoCambioPago < tipoCambioCompra AndAlso CveMonedaCompra = 2 Then If tipoCambioPago < tipoCambioCompra AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en la venta ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompraValuacion) 'Añadimos la diferencia de ganancia en la venta
ImporteMovimiento -= ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA ImporteMovimiento -= ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA
ImporteMovimiento += ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA ImporteMovimiento += ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA
ImporteMovimiento += ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR ImporteMovimiento += ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR
@@ -2581,9 +2597,10 @@ Partial Class Bancos_PopIECompras
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
Dim tipoCambioCompraValuacion As Decimal = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
If tipoCambioPago > tipoCambioCompra AndAlso CveMonedaCompra = 2 Then If tipoCambioPago > tipoCambioCompra AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompraValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
ImporteMovimiento -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA ImporteMovimiento -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
ImporteMovimiento += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA ImporteMovimiento += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
ImporteMovimiento += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR ImporteMovimiento += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR

View File

@@ -1513,20 +1513,30 @@ Partial Class Bancos_PopIEVentas
Dim CuentasContablesInvalidasSIG As New StringBuilder Dim CuentasContablesInvalidasSIG As New StringBuilder
Dim TipoCambioFluctuacion As Decimal = 1 Dim TipoCambioFluctuacion As Decimal = 1
Dim FechaUltimaFluctuacion As Date = MinFecha Dim FechaUltimaFluctuacion As Date = MinFecha
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim strFecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & strFecha & "#", "Fecha DESC")
If drr IsNot Nothing Then Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
End If
End If If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim strFecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & strFecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
tipoCambioPago = 1 tipoCambioPago = 1

View File

@@ -924,20 +924,31 @@ Partial Class Bancos_ProveedoresAbonar
Dim TipoCambioFluctuacion As Decimal = 1 Dim TipoCambioFluctuacion As Decimal = 1
Dim FechaUltimaFluctuacion As Date = MinFecha Dim FechaUltimaFluctuacion As Date = MinFecha
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC")
If drr IsNot Nothing Then Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
End If
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
' Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
Dim DttPlantilla As DataTable = Nothing Dim DttPlantilla As DataTable = Nothing
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then

View File

@@ -202,11 +202,62 @@ Partial Class PopUpVerFactura
If Request("onlyPrint").ToString() = "PalletCaja" Then If Request("onlyPrint").ToString() = "PalletCaja" Then
imprimirpallet(Request("CvePallet").ToString.ToEntero()) imprimirpallet(Request("CvePallet").ToString.ToEntero())
End If End If
If Request("onlyPrint").ToString() = "manifiesto" Then
imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero())
End If
End If End If
End If End If
End Sub End Sub
Private Sub imprimirManifiesto(cveEmbarqueManifiesto As Integer)
Dim NoEmbarque As String = ""
Dim Fecha As String = ""
Dim SubProyecto As String = ""
Dim AgenciaAduanalUSA As String = ""
Dim AgenciaAduanalMEX As String = ""
Dim tablaReporte As New DataTable
'Envase = "1 1/9"
'Tamano = "Small"
'Cultivo = "Tomate"
'noPallet = "000001"
'Variedad = "Golden"
Using objnom As New ClsNominas
If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then
Dim row As DataRow = objnom.DtResultados.Rows(0)
NoEmbarque = row("NoEmbarque").ToString()
Fecha = row("Fecha").ToString()
SubProyecto = row("SubProyecto").ToString()
AgenciaAduanalUSA = row("AgenciaAduanalUSA").ToString()
AgenciaAduanalMEX = row("AgenciaAduanalMEX").ToString()
End If
End Using
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NoEmbarque", NoEmbarque))
params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("SubProyecto", SubProyecto))
params.Add(New ReportParameter("AgenciaAduanalUSA", AgenciaAduanalUSA))
params.Add(New ReportParameter("AgenciaAduanalMEX", AgenciaAduanalMEX))
params.Add(New ReportParameter("Temperatura", "45"))
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte}
lrds.Add(rds)
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
'"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
ImprimirPDF("GPS/EmbarqueManifiesto.rdlc", lrds, params, "Equipo GPS")
End Sub
Private Sub imprimirpallet2(cvePallet As Integer) Private Sub imprimirpallet2(cvePallet As Integer)
Dim Envase As String = "" Dim Envase As String = ""
Dim Tamano As String = "" Dim Tamano As String = ""

View File

@@ -269,7 +269,17 @@
<asp:ListBox ID="DdlEmpresas" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Empresa" DataValueField="CveEmpresa"></asp:ListBox> <asp:ListBox ID="DdlEmpresas" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Empresa" DataValueField="CveEmpresa"></asp:ListBox>
</div> </div>
</div> </div>
<div class="col-md-1 truncate" title="Tipo Cliente:" data-toggle="tooltip" data-placement="top">
Moneda:
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlMoneda" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Pesos" Value="1"></asp:ListItem>
<asp:ListItem Text="Dolares" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -180,7 +180,7 @@ Partial Class Compras_RepCxP
If txtFechaVF.Text = "" Then FechaVF = "-1" If txtFechaVF.Text = "" Then FechaVF = "-1"
Dim TipoAgrupacion As Integer = IIf(chkAgruparMes.Checked, 1, -1) Dim TipoAgrupacion As Integer = IIf(chkAgruparMes.Checked, 1, -1)
Dim TipoDocto As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM) Dim TipoDocto As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM)
If Mov.GetCxP(FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, -1, DdlUsuarioResponsable.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlEstatusCompra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, If Mov.GetCxP(FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero(), DdlUsuarioResponsable.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlEstatusCompra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=IIf(DdlTipoProveedor.SelectedValue.ToEntero = 3, -1, DdlTipoProveedor.SelectedValue.ToEntero), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=IIf(DdlTipoProveedor.SelectedValue.ToEntero = 3, -1, DdlTipoProveedor.SelectedValue.ToEntero), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero,
TipoDocto:=TipoDocto, TipoAgrupacion:=TipoAgrupacion) Then TipoDocto:=TipoDocto, TipoAgrupacion:=TipoAgrupacion) Then
GvCxP.DataSource = Mov.DtResultados GvCxP.DataSource = Mov.DtResultados

View File

@@ -130,7 +130,9 @@
<li> <li>
<asp:LinkButton ID="LbImprimirPresupuesto" Visible="true" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Presupuesto PDF</asp:LinkButton> <asp:LinkButton ID="LbImprimirPresupuesto" Visible="true" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Presupuesto PDF</asp:LinkButton>
</li> </li>
<li>
<asp:LinkButton ID="LbImprimirPresupuestoExcel" Visible="true" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Presupuesto Excel</asp:LinkButton>
</li>
<li> <li>
<asp:LinkButton ID="LbImprmirAF" Visible="true" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Activos Fijos PDF</asp:LinkButton> <asp:LinkButton ID="LbImprmirAF" Visible="true" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Activos Fijos PDF</asp:LinkButton>
</li> </li>
@@ -170,6 +172,7 @@
<asp:PostBackTrigger ControlID="LBImprimirInformacionG" /> <asp:PostBackTrigger ControlID="LBImprimirInformacionG" />
<asp:PostBackTrigger ControlID="lbImprimirAvance" /> <asp:PostBackTrigger ControlID="lbImprimirAvance" />
<asp:PostBackTrigger ControlID="LbImprimirPresupuesto" /> <asp:PostBackTrigger ControlID="LbImprimirPresupuesto" />
<asp:PostBackTrigger ControlID="LbImprimirPresupuestoExcel" />
<asp:PostBackTrigger ControlID="LbImprmirAF" /> <asp:PostBackTrigger ControlID="LbImprmirAF" />
<asp:PostBackTrigger ControlID="LbImprmirAFExcel" /> <asp:PostBackTrigger ControlID="LbImprmirAFExcel" />
<asp:PostBackTrigger ControlID="LbImprimirPedDev" /> <asp:PostBackTrigger ControlID="LbImprimirPedDev" />

View File

@@ -2754,7 +2754,7 @@ Partial Class Contratos_Default
Private Sub CargaGVGastos() Private Sub CargaGVGastos()
Dim objContrato As New ClsContratos Dim objContrato As New ClsContratos
If objContrato.GetContratoGastos(CveContrato, UsuarioActual.cveempresa) Then If objContrato.GetContratoGastos(CveContrato, UsuarioActual.CveEmpresa) Then
DtGastos = objContrato.DtResultados DtGastos = objContrato.DtResultados
GvContratosGastos.DataSource = DtGastos GvContratosGastos.DataSource = DtGastos
SumaGasto = objContrato.DtResultados.SUM("Importe", "CveContratoGasto IS NULL") SumaGasto = objContrato.DtResultados.SUM("Importe", "CveContratoGasto IS NULL")
@@ -3835,6 +3835,9 @@ Partial Class Contratos_Default
#Region "I M P R E S I O N D E P R E S U P U E S T O " #Region "I M P R E S I O N D E P R E S U P U E S T O "
Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click
GenerarPDFPPresupuesto() GenerarPDFPPresupuesto()
End Sub
Private Sub lLbImprimirPresupuestoEXCEL_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuestoExcel.Click
GenerarPDFPPresupuesto(Formato:="EXCEL")
End Sub End Sub
Private Sub GenerarPDFPPresupuesto(Optional Formato As String = "PDF") Private Sub GenerarPDFPPresupuesto(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))

View File

@@ -335,9 +335,20 @@
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem> <asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate" title="Tipo Cliente:" data-toggle="tooltip" data-placement="top">
Moneda:
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlMoneda" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Pesos" Value="1"></asp:ListItem>
<asp:ListItem Text="Dolares" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2"> <div class="col-md-2">
<asp:CheckBox ID="ChkAnticipos" runat="server" Text="Incluye Anticipos" TextAlign="Left" Visible="false" /> <asp:CheckBox ID="ChkAnticipos" runat="server" Text="Incluye Anticipos" TextAlign="Left" Visible="false" />
</div> </div>
</div> </div>

View File

@@ -203,7 +203,7 @@ Partial Class RepCxC
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico,
If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero,
CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=AplicaAnticipos) Then TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=AplicaAnticipos, CveMoneda:=DdlMoneda.SelectedValue.ToEntero()) Then
GvDatos.DataSource = ObjMovtos.DtResultados GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados DtDatos = ObjMovtos.DtResultados

View File

@@ -11,6 +11,9 @@
#C_Tab_Tlablero tr td:nth-child(n+2) { #C_Tab_Tlablero tr td:nth-child(n+2) {
text-align: center text-align: center
} }
.spanfoliofiscal{
white-space:nowrap;
}
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
@@ -36,7 +39,7 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server" ID="upPaneldata" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter"> <div class="portlet solid grey-cascade portlet-filter">
@@ -111,7 +114,14 @@
</asp:Repeater> </asp:Repeater>
<th>XML Timbrados</th> <th>XML Timbrados</th>
<th>PDF Timbrados</th> <th>PDF Timbrados</th>
<th style="width: 85px;"></th> <th style="width: 85px;">
<asp:HyperLink ID="hypEnviarDocto" onclick="EnviarCorreo();" CssClass="btn btn-sm btn-primary" runat="server">Enviar</asp:HyperLink>
<asp:TextBox ID="TxtClientescorreo" CssClass="hidden TxtClientescorreo" runat="server"></asp:TextBox>
<asp:Button ID="Btnenviardocto" UseSubmitBehavior="false" CssClass="hidden Btnenviardocto" OnClick="Btnenviardocto_Click" runat="server" Text="Button" />
</th>
</tr> </tr>
@@ -149,7 +159,8 @@
<%# string.Format("<a href=\"/Documentacion/TableroMaterialidadDetalle.ASPX?CveCliente={2}&anio={3}&mes={4}\" >{1}/{0}</a>",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalPDF"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> <%# string.Format("<a href=\"/Documentacion/TableroMaterialidadDetalle.ASPX?CveCliente={2}&anio={3}&mes={4}\" >{1}/{0}</a>",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalPDF"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %>
</td> </td>
<td> <td>
<%# string.Format("<a class=\"btn btn-primary\" onclick=\"enviarDocto({0})\">Enviar</a>",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> <asp:CheckBox Checked="true" CssClass="Chkenviardocto" runat="server" data-cvecliente='<%# DataBinder.Eval(Container.DataItem, "CveCliente") %>' />
<%-- <%# string.Format("<a class=\"btn btn-primary\" onclick=\"enviarDocto({0})\">Enviar</a>",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %>--%>
</td> </td>
</tr> </tr>
</ItemTemplate> </ItemTemplate>
@@ -159,163 +170,524 @@
</tbody> </tbody>
</table> </table>
<div class="portlet light smmallpadding bordered procesardiv">
<div id="ModalDoctosxmlpdf" class="modal ADS fade" role="dialog"> <div class="portlet-title">
<div class="modal-dialog"> <div class="caption font-green">
<i class="fa fa-download font-green"></i>
<!-- Modal content--> <span class="caption-subject bold uppercase">Historial de envio</span>
<div class="modal-content" style="width: 700px;"> </div>
<div class="modal-header "> <div class="tools">
<button type="button" class="close" data-dismiss="modal">&times;</button> <a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<h4 class="modal-title">Agregar documentos XML PDF Timbrados.</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="Upxmlpdf" UpdateMode="Conditional">
<ContentTemplate>
<div class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
Los documentos cargados serán relacionados en el periodo:
<asp:Literal runat="server" ID="LtlPeriodoXMLPDF"></asp:Literal>
</div>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Paso 1: Procesar 'ZIP'</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="LnkCargarZip" CssClass="btn btn-success" OnClick="LnkCargarZip_Click" runat="server">Procesar</asp:LinkButton>
</div>
</div>
</div>
<div class="portlet-body rowpadding ">
<div>
<asp:TextBox ID="Anexoxmlpdf" CssClass="ADSdropzone hidden" data-maxfilesize ="500" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
</div>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Paso 2: Guardar</span>
</div>
<div class="tools">
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding " style="display: none">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div class="dashboard-stat red-intense">
<div class="visual"><i class="fa fa-bar-chart-o"></i></div>
<div class="details">
<div class="number">Documentos</div>
<div class="desc">
<label class="indicadortipo4 col-md-6 tooltips" data-original-title="">
<asp:Literal ID="LtlNoDoctos" runat="server"></asp:Literal></label>
<label class="indicadortipo4 col-md-6 tooltips" data-original-title=""></label>
<label class="indicadortipo4 col-md-6 tooltips" data-original-title="XML">
<asp:Literal ID="LtlNoXml" runat="server"></asp:Literal></label>
<label class="indicadortipo4 col-md-6 tooltips" data-original-title="PDF">
<asp:Literal ID="LtlNoPDF" runat="server"></asp:Literal></label>
</div>
</div>
<a class="more" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" tabindex="0">Ver Más <i class="m-icon-swapright m-icon-white"></i>
</a>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<%--<asp:Button ID="BtnAddClienteDocumentoxmlpd" UseSubmitBehavior="false" OnClick="BtnAddClienteDocumentoxmlpd_Click" runat="server" Text="Guardar" CssClass="btn btn-primary" />--%>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div> </div>
</div> </div>
</div> <div class="portlet-body rowpadding ">
<div id="ModalDoctos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content--> <asp:GridView ID="GvHistorialGral" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
<div class="modal-content" style="width: 700px;"> ShowHeaderWhenEmpty="true" EmptyDataText="No se ha enviado documentos"
<div class="modal-header "> DataKeyNames="Noarchivos,FechaIng,Usuario">
<button type="button" class="close" data-dismiss="modal">&times;</button> <Columns>
<h4 class="modal-title">Agregar documento</h4> <asp:TemplateField HeaderText="Fecha ">
</div> <ItemTemplate>
<asp:Label ID="lblfechaIng" runat="server" Text='<%# Eval("FechaIng","{0:dd/MM/yyyy hh}:{0:mm}")%>'> </asp:Label>
<div class="modal-body"> </ItemTemplate>
<asp:UpdatePanel runat="server" ID="UpModalDoctos" UpdateMode="Conditional"> </asp:TemplateField>
<ContentTemplate> <asp:TemplateField HeaderText="Noarchivos">
<ItemTemplate>
<div class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;"> <asp:Label ID="lblnoarchivos" runat="server" Text='<%# Eval("Noarchivos")%>'> </asp:Label>
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button> </ItemTemplate>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong> </asp:TemplateField>
Los documentos cargados serán relacionados en el periodo: <asp:TemplateField HeaderText="Usuario">
<asp:Literal runat="server" ID="LtlPeriodo"></asp:Literal> <ItemTemplate>
</div> <asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<span class="doctitulo"></span>
<asp:TextBox ID="TxtcveCliente" CssClass="hidden TxtcveCliente" runat="server"></asp:TextBox>
<asp:TextBox ID="TxtcveDocumentacion" CssClass="hidden TxtcveDocumentacion" runat="server"></asp:TextBox>
Tipo documento
<asp:DropDownList ID="DdlDocumentacion" DataValueField="CveDocumentacion" DataTextField="Documentacion" Width="100%" runat="server" CssClass="form-control select2me"></asp:DropDownList>
<div>
<br />
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnAddClienteDocumento" UseSubmitBehavior="false" OnClick="BtnAddClienteDocumento_Click" runat="server" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div> </div>
</div> </div>
<asp:TextBox ID="TxtcveClienteCorreo" CssClass="hidden TxtcveClienteCorreo" runat="server"></asp:TextBox> <asp:TextBox ID="TxtcveClienteCorreo" CssClass="hidden TxtcveClienteCorreo" runat="server"></asp:TextBox>
<asp:Button ID="BtnEnviarDoctos" UseSubmitBehavior="false" OnClick="BtnEnviarDoctos_Click" runat="server" Text="Enviar" CssClass="btn btn-primary hidden BtnEnviarDoctos" /> <asp:Button ID="BtnEnviarDoctos" UseSubmitBehavior="false" OnClick="BtnEnviarDoctos_Click" runat="server" Text="Enviar" CssClass="btn btn-primary hidden BtnEnviarDoctos" />
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="ModalDoctosxmlpdf" class="modal ADS fade" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Agregar documentos XML PDF Timbrados.</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="Upxmlpdf" UpdateMode="Conditional">
<ContentTemplate>
<div class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
Los documentos cargados serán relacionados en el periodo:
<asp:Literal runat="server" ID="LtlPeriodoXMLPDF"></asp:Literal>
</div>
<div class="portlet light smmallpadding bordered procesardiv">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Paso 1: Procesar 'ZIP'</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body rowpadding ">
<div>
<asp:TextBox ID="Anexoxmlpdf" CssClass="ADSdropzone hidden" data-maxfilesize="500" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
<div class="text-center">
<asp:LinkButton ID="LnkCargarZip" CssClass="btn btn-success" OnClick="LnkCargarZip_Click" runat="server">Procesar</asp:LinkButton>
</div>
</div>
</div>
<div class="portlet light smmallpadding bordered guardardiv">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Paso 2: Guardar</span>
</div>
<div class="tools">
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body rowpadding" style="display: none">
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<div class="dashboard-stat red-intense">
<div class="visual"><i class="fa fa-bar-chart-o"></i></div>
<div class="details">
<div class="number">Documentos</div>
<div class="desc">
<label class="indicadortipo4 col-md-6 tooltips" data-original-title="XML">
<asp:Literal ID="LtlNoXml" runat="server"></asp:Literal></label>
<label class="indicadortipo4 col-md-6 tooltips" data-original-title="PDF">
<asp:Literal ID="LtlNoPDF" runat="server"></asp:Literal></label>
<label class="indicadortipo4 col-md-6 tooltips" data-original-title="Todos">
<asp:Literal ID="LtlNoDoctos" runat="server"></asp:Literal></label>
<label class="indicadortipo4 col-md-6 tooltips" data-original-title="Otros">
<asp:Literal ID="LtlOtrosDoctos" runat="server"></asp:Literal></label>
</div>
</div>
<a class="more" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" tabindex="0">Ver Más <i class="m-icon-swapright m-icon-white"></i>
</a>
</div>
</div>
</div>
<asp:Panel runat="server" ID="pnlinconsistencias" Visible="false" CssClass="alert alert-warning" Style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>Se encontraron inconsistencias en los documentos cargados, solo se guardaran los archivos sin inconsistencias.
</asp:Panel>
<ajax:TabContainer ID="Tabsmodal" runat="server" Width="100%" AutoPostBack="True">
<ajax:TabPanel ID="TabDoctos" runat="server" HeaderText="Documentos">
<ContentTemplate>
<asp:GridView ID="GVmaterialidadDoctos" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD" AutoGenerateColumns="False" OnRowDataBound="GVmaterialidadDoctos_RowDataBound"
DataKeyNames="FolioFiscal,nofiles,archivoXML,archivoPDF,Receptor,RfcReceptor,Emisor,RfcEmisor,SubTotal,Descuento,Total,Serie,Folio,Fecha,FechaPago,FechaInicio,FechaFin,TotalPercepciones,TotalDeducciones,NumDiasPagados,CURP,NSS,TN,NDP,TP,Periodo,PeriodoOk,CvePersonal,CvePeriodo,CveNomina"
data-height="250">
<Columns>
<asp:TemplateField HeaderText="Folio Fiscal">
<ItemTemplate>
<asp:Label CssClass="spanfoliofiscal" runat="server" Text='<%# Eval("FolioFiscal")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Doctos">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("nofiles")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="XML">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("archivoXML").ToString().Length>0?"Si":"No" %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PDF">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("archivoPDF").ToString().Length>0?"Si":"No" %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empleado">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Receptor")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RfcReceptor")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CURP">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CURP")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NSS">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("NSS")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Emisor">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Emisor")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Neto">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Total","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Periodo">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("PeriodoText")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<HeaderTemplate>
Fecha<br />inicio
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("FechaInicio","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<HeaderTemplate>
Fecha<br />fin
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("FechaFin","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<HeaderTemplate>
Fecha<br />pago
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("FechaPago","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<HeaderTemplate>
Días<br />pago
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("NumDiasPagados")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="Tabperiodos" runat="server" HeaderText="Periodos sin registrar">
<ContentTemplate>
<asp:GridView ID="GvPeriodo" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD" AutoGenerateColumns="False"
DataKeyNames="FechaInicio,FechaFin,TN,TP" data-height="250">
<Columns>
<asp:TemplateField HeaderText="Fecha Inicio">
<ItemTemplate>
<asp:Label ID="lblfechaInicio" runat="server" Text='<%# Eval("FechaInicio","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Fin">
<ItemTemplate>
<asp:Label ID="lblfechaFin" runat="server" Text='<%# Eval("FechaFin","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPersonal" runat="server" HeaderText="Personal sin registrar">
<ContentTemplate>
<asp:GridView ID="GvPersonal" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD" AutoGenerateColumns="False"
DataKeyNames="CvePersonal,Receptor,CURP,NombreCompleto,Codigo" data-height="250">
<Columns>
<asp:TemplateField HeaderText="Empleado">
<ItemTemplate>
<asp:Label ID="lblreceptor" runat="server" Text='<%# Eval("Receptor")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CURP">
<ItemTemplate>
<asp:Label ID="lblcURP" runat="server" Text='<%# Eval("CURP")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabConceptos" runat="server" HeaderText="Conceptos sin registrar" Visible="false">
</ajax:TabPanel>
</ajax:TabContainer>
<div class="text-center">
<asp:LinkButton ID="LnkProcesarDoctos" CssClass="btn btn-success" OnClick="LnkProcesarDoctos_Click" runat="server">Guardar</asp:LinkButton>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<%--<asp:Button ID="BtnAddClienteDocumentoxmlpd" UseSubmitBehavior="false" OnClick="BtnAddClienteDocumentoxmlpd_Click" runat="server" Text="Guardar" CssClass="btn btn-primary" />--%>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div id="ModalDoctos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" style="width: 700px;">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Agregar documento</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalDoctos" UpdateMode="Conditional">
<ContentTemplate>
<div class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
Los documentos cargados serán relacionados en el periodo:
<asp:Literal runat="server" ID="LtlPeriodo"></asp:Literal>
</div>
Tipo documento
<asp:DropDownList ID="DdlDocumentacion" DataValueField="CveDocumentacion" DataTextField="Documentacion" Width="100%" runat="server" CssClass="form-control select2me"></asp:DropDownList>
<div>
<br />
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" Text="" runat="server"></asp:TextBox>
Observaciones
<asp:TextBox ID="TxtObservaciones" TextMode="MultiLine" Rows="4" CssClass="form-control" runat="server"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnAddClienteDocumento" UseSubmitBehavior="false" OnClick="BtnAddClienteDocumento_Click" runat="server" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div id="ModalShowDoctos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" style="width: 700px;">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Documentos</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalshowdoctos" UpdateMode="Conditional">
<ContentTemplate>
<span class="doctitulo"></span>
<asp:TextBox ID="TxtcveCliente" CssClass="hidden TxtcveCliente" runat="server"></asp:TextBox>
<asp:TextBox ID="TxtcveDocumentacion" CssClass="hidden TxtcveDocumentacion" runat="server"></asp:TextBox>
<asp:Button ID="btnshowdoc" UseSubmitBehavior="false" CssClass="hidden btnshowdoc" OnClick="btnshowdoc_Click" runat="server" Text="Button" />
<div class="portlet light smmallpadding bordered procesardiv">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Documentos</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding ">
<asp:GridView ID="GVdocelect" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall mysmallbtn" AutoGenerateColumns="False"
ShowHeaderWhenEmpty="true"
EmptyDataText="No se encontraron documentos"
DataKeyNames="CveDocumentacionElectronica,CveDocumentacion,Documentacion,DocumentacionFormato,Orden,Adjunto,CveDocumentacionTipo,Requerido,DocumentacionTipo,SCompleto,Estatus,Observacion,Fecha,FechaIng,FechaLimite,FechaVigencia,Usuario,DiasLimite,CveVenta,Observacion2,AplicaDiasLimite,AplicaFechaVencimiento,Modulo">
<Columns>
<asp:TemplateField HeaderText="Documento">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Observacion2")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observacion">
<ItemTemplate>
<asp:Label ID="lblobservacion" runat="server" Text='<%# Eval("Observacion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Archivo" ItemStyle-Width="50">
<ItemTemplate>
<asp:HyperLink ID="HypFile" onclick='<%# string.Format("downfile(\"{0}\",\"{1}\");",Eval("Adjunto"),Eval("Observacion2"))%>' CssClass="btn btn-circle btn-sm blue mysmallbtn" runat="server"><i class="fa fa-download"></i></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminardocto" OnClick="LnkEliminardocto_Click" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='icon-trash'></i>" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el documento?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="portlet light smmallpadding bordered procesardiv">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Historial</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding ">
<asp:GridView ID="GVMaterialidadEnvios" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
DataKeyNames="CveMaterialidadEnvios,CveCliente,Periodo,Noarchivos,Observacion,FechaIng,CveUsuario,CveEmpresa">
<Columns>
<asp:TemplateField HeaderText="Fecha ">
<ItemTemplate>
<asp:Label ID="lblfechaIng" runat="server" Text='<%# Eval("FechaIng","{0:dd/MM/yyyy hh}:{0:mm}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Noarchivos">
<ItemTemplate>
<asp:Label ID="lblnoarchivos" runat="server" Text='<%# Eval("Noarchivos")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observacion">
<ItemTemplate>
<asp:Label ID="lblobservacion" runat="server" Text='<%# Eval("Observacion")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<asp:TextBox ID="TxtDoctoName" CssClass="hidden TxtDoctoName" runat="server"></asp:TextBox>
<asp:TextBox ID="TxtCveDocumentacionElectronica" CssClass="hidden TxtCveDocumentacionElectronica" runat="server"></asp:TextBox>
<asp:Button ID="BtnDocumentacionElectronica" UseSubmitBehavior="false" CssClass="hidden BtnDocumentacionElectronica" OnClick="BtnDocumentacionElectronica_Click" runat="server" Text="Button" />
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script> <script>
var showhideprocesarguardar = 0;
function openguardar() {
if (showhideprocesarguardar == 1) {
materialidadshowhide('.guardardiv', 1)
materialidadshowhide('.procesardiv', 0)
} else {
materialidadshowhide('.guardardiv', 0)
materialidadshowhide('.procesardiv', 1)
}
}
function EnviarCorreo() {
let clientes = '';
let coma = ''
$('.Chkenviardocto').each(
function () {
if ($(this).find('input').is(':checked')) {
clientes += coma + $(this).data("cvecliente");
coma = ',';
}
}
)
$('.TxtClientescorreo').val(clientes);
$('.Btnenviardocto').click();
}
function downfile(file, DoctoName) {
$('.TxtDoctoName').val(DoctoName);
$('.TxtCveDocumentacionElectronica').val(file);
$('.BtnDocumentacionElectronica').click();
}
function materialidadshowhide(porlet, showhide) {
var collapseexpand = $(porlet + ' >.portlet-title .collapse,' + porlet + ' >.portlet-title .expand')
collapseexpand.removeClass('collapse')
collapseexpand.removeClass('expand')
if (showhide == 1) {
collapseexpand.addClass('collapse')
$(porlet + ' >.portlet-body').show();
} else {
collapseexpand.addClass('expand')
$(porlet + ' >.portlet-body').hide();
}
}
function cargarDocto(cveCliente, cveDocumentacion, cliente, documentacion) { function cargarDocto(cveCliente, cveDocumentacion, cliente, documentacion) {
$('.TxtcveCliente').val(cveCliente) $('.TxtcveCliente').val(cveCliente);
$('.TxtcveDocumentacion').val(cveDocumentacion) $('.TxtcveDocumentacion').val(cveDocumentacion);
$('.doctitulo').html(cliente + ' - ' + documentacion); $('.doctitulo').html(cliente + ' - ' + documentacion);
$('#ModalDoctos').modal() $('.btnshowdoc').click();
//
} }
function enviarDocto(cveCliente) { function enviarDocto(cveCliente) {
$('.TxtcveClienteCorreo').val(cveCliente); $('.TxtcveClienteCorreo').val(cveCliente);
$('.BtnEnviarDoctos').click(); $('.BtnEnviarDoctos').click();
} }
function ADSBegin() {
openguardar();
}
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -4,12 +4,16 @@ using System.Data;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Linq; using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web; using System.Web;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
using Extensiones; using Extensiones;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.parser;
public partial class Documentacion_TableroMaterialidad : ClsPaginas public partial class Documentacion_TableroMaterialidad : ClsPaginas
{ {
@@ -25,6 +29,27 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
get { return ViewState["mes"] != null ? ViewState["mes"].ToString().ToEntero() : 0; } get { return ViewState["mes"] != null ? ViewState["mes"].ToString().ToEntero() : 0; }
set { ViewState["mes"] = value; } set { ViewState["mes"] = value; }
} }
public string directorio
{
get { return ViewState["directorio"] != null ? ViewState["directorio"].ToString() : string.Empty; }
set
{
if (ViewState["directorio"] != null && !string.IsNullOrEmpty(ViewState["directorio"].ToString()))
{
System.IO.Directory.Delete(ViewState["directorio"].ToString(), true);
}
ViewState["directorio"] = value;
}
}
public string xmlobject
{
get { return ViewState["xmlobject"] != null ? ViewState["xmlobject"].ToString() : string.Empty; }
set
{
ViewState["xmlobject"] = value;
}
}
#endregion #endregion
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
@@ -51,6 +76,7 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
} }
} }
upPaneldata.Update();
} }
protected void RptDatos_ItemDataBound(object sender, RepeaterItemEventArgs e) protected void RptDatos_ItemDataBound(object sender, RepeaterItemEventArgs e)
@@ -65,6 +91,35 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
protected void BtnAddClienteDocumento_Click(object sender, EventArgs e) protected void BtnAddClienteDocumento_Click(object sender, EventArgs e)
{ {
List<Archivo> litsarchivoxml = Anexo.getfiles().Archivos;
int CveDocumentacion = DdlDocumentacion.SelectedValue.ToEntero();
int CveDocumentacionElectronica = 0;
string obs = TxtObservaciones.Text;
string rutaempresa = string.Format("{0}\\materialidad\\", UsuarioActual.Empresa.Ruta);
if (!System.IO.Directory.Exists(rutaempresa))
{
System.IO.Directory.CreateDirectory(rutaempresa);
}
foreach (Archivo arch in litsarchivoxml)
{
DateTime fecha = string.Format("{0}-{1}-01", anio, mes).ToDateTime();
using (ClsEdocumentacion edoc = new ClsEdocumentacion())
{
CveDocumentacionElectronica = edoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, -1, 1, obs, "", UsuarioActual.CveUsuario, fecha, fecha, Periodo: string.Format("{0}{1}", anio, mes).ToEntero());
if (CveDocumentacionElectronica > 0)
{
edoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, -1, 2, obs, string.Format("{0}.{1}", CveDocumentacionElectronica, arch.Extension.ToLower()), UsuarioActual.CveUsuario, fecha, fecha, arch.filenameO);
System.IO.File.Move(arch.FileUrl, string.Format("{2}{0}.{1}", CveDocumentacionElectronica, arch.Extension.ToLower(), rutaempresa));
Alert("los registros se guardaron correctamente");
cargadatos();
RegistraScript("$('#ModalDoctos').modal('hide');");
Anexo.Text = "[]";
}
}
}
} }
@@ -78,10 +133,6 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
cargadatos(); cargadatos();
} }
protected void BtnAddClienteDocumentoxmlpd_Click(object sender, EventArgs e)
{
}
protected void LckOpModalDoctos_Click(object sender, EventArgs e) protected void LckOpModalDoctos_Click(object sender, EventArgs e)
{ {
@@ -95,21 +146,32 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
{ {
DateTime fecha = string.Format("{0}-{1}-01", anio, mes).ToDateTime(); DateTime fecha = string.Format("{0}-{1}-01", anio, mes).ToDateTime();
LtlPeriodoXMLPDF.Text = fecha.ToString("MMMM yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX")); LtlPeriodoXMLPDF.Text = fecha.ToString("MMMM yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX"));
RegistraScript("$('#ModalDoctosxmlpdf').modal();"); RegistraScript("$('#ModalDoctosxmlpdf').modal();showhideprocesarguardar =0; openguardar();");
Upxmlpdf.Update(); Upxmlpdf.Update();
} }
protected void LnkCargarZip_Click(object sender, EventArgs e) protected void LnkCargarZip_Click(object sender, EventArgs e)
{ {
string xmlobject = null;
List<Archivo> litsarchivoxml = Anexoxmlpdf.getfiles().Archivos; List<Archivo> litsarchivoxml = Anexoxmlpdf.getfiles().Archivos;
if (litsarchivoxml.Count > 0) if (litsarchivoxml.Count > 0)
{ {
Archivo archivoxml = litsarchivoxml[0]; Archivo archivoxml = litsarchivoxml[0];
if (archivoxml.Extension.ToLower() == "zip") if (archivoxml.Extension.ToLower() == "zip")
{ {
xmlobject = null;
string text;
string[] lines;
string[] splitword;
List<string> fechas = new List<string>();
string foliofiscal = string.Empty;
string CURP = string.Empty;
directorio = string.Empty;
char[] delimiterChars = { ' ', ',', '.', ':', '\t' };
Regex rgxfecha = new Regex(@"^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[13-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$");
Regex rgxcurp = new Regex("^(([A-ZÑ&]{4})([0-9]{2})([0][13578]|[1][02])(([0][1-9]|[12][\\d])|[3][01])([A-Z0-9]{3}))|(([A-ZÑ&]{4})([0-9]{2})([0][13456789]|[1][012])(([0][1-9]|[12][\\d])|[3][0])([A-Z0-9]{3}))|(([A-ZÑ&]{4})([02468][048]|[13579][26])[0][2]([0][1-9]|[12][\\d])([A-Z0-9]{3}))|(([A-ZÑ&]{4})([0-9]{2})[0][2]([0][1-9]|[1][0-9]|[2][0-8])([A-Z0-9]{3}))$");
string directorio = archivoxml.FileUrl.Substring(0, archivoxml.FileUrl.Length - 4);
directorio = archivoxml.FileUrl.Substring(0, archivoxml.FileUrl.Length - 4);
System.IO.Directory.CreateDirectory(directorio); System.IO.Directory.CreateDirectory(directorio);
ZipFile.ExtractToDirectory(archivoxml.FileUrl, directorio); ZipFile.ExtractToDirectory(archivoxml.FileUrl, directorio);
@@ -117,13 +179,14 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
XElement xfolder = new XElement("folder"); XElement xfolder = new XElement("folder");
foreach (var urfile in System.IO.Directory.GetFiles(directorio, "*", SearchOption.AllDirectories)) foreach (var urfile in System.IO.Directory.GetFiles(directorio, "*", SearchOption.AllDirectories))
{ {
XElement xfile = new XElement("archivo", urfile); XElement xfile = new XElement("archivo");
xfile.SetAttributeValue("URL", urfile);
xfile.SetAttributeValue("EXT", Path.GetExtension(urfile).ToLower()); xfile.SetAttributeValue("EXT", Path.GetExtension(urfile).ToLower());
if (Path.GetExtension(urfile).ToLower() == ".xml") if (Path.GetExtension(urfile).ToLower() == ".xml")
{ {
var xmlobj = ADSistemaLibrary3.SatXml.XmlSatCFDI.readXML(urfile); var xmlobj = ADSistemaLibrary3.SatXml.XmlSatCFDI.readXML(urfile);
xfile.SetAttributeValue("UUID", xmlobj.complemento.UUID);
xfile.SetAttributeValue("Receptor", xmlobj.receptor.Nombre); xfile.SetAttributeValue("Receptor", xmlobj.receptor.Nombre);
xfile.SetAttributeValue("RfcReceptor", xmlobj.receptor.Rfc); xfile.SetAttributeValue("RfcReceptor", xmlobj.receptor.Rfc);
xfile.SetAttributeValue("RfcEmisor", xmlobj.emisor.Rfc); xfile.SetAttributeValue("RfcEmisor", xmlobj.emisor.Rfc);
@@ -131,6 +194,9 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
xfile.SetAttributeValue("SubTotal", xmlobj.comprobante.SubTotal); xfile.SetAttributeValue("SubTotal", xmlobj.comprobante.SubTotal);
xfile.SetAttributeValue("Descuento", xmlobj.comprobante.Descuento); xfile.SetAttributeValue("Descuento", xmlobj.comprobante.Descuento);
xfile.SetAttributeValue("Total", xmlobj.comprobante.Total); xfile.SetAttributeValue("Total", xmlobj.comprobante.Total);
xfile.SetAttributeValue("Serie", xmlobj.comprobante.Serie);
xfile.SetAttributeValue("Folio", xmlobj.comprobante.Folio);
xfile.SetAttributeValue("Fecha", xmlobj.comprobante.Fecha);
xfile.SetAttributeValue("FechaPago", xmlobj.complemento.nomina12.FechaPago); xfile.SetAttributeValue("FechaPago", xmlobj.complemento.nomina12.FechaPago);
@@ -140,9 +206,113 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
xfile.SetAttributeValue("TotalPercepciones", xmlobj.complemento.nomina12.TotalPercepciones); xfile.SetAttributeValue("TotalPercepciones", xmlobj.complemento.nomina12.TotalPercepciones);
xfile.SetAttributeValue("TotalDeducciones", xmlobj.complemento.nomina12.TotalDeducciones); xfile.SetAttributeValue("TotalDeducciones", xmlobj.complemento.nomina12.TotalDeducciones);
xfile.SetAttributeValue("CURP", xmlobj.complemento.nomina12.Receptor.CURP); xfile.SetAttributeValue("CURP", xmlobj.complemento.nomina12.Receptor.CURP);
xfile.SetAttributeValue("NSS", xmlobj.complemento.nomina12.Receptor.NSS);
xfile.SetAttributeValue("TN", xmlobj.complemento.nomina12.TipoNomina);
xfile.SetAttributeValue("NDP", xmlobj.complemento.nomina12.NumDiasPagados);
xfile.SetAttributeValue("TP", xmlobj.complemento.nomina12.Receptor.TipoPeriodo);
foreach (var con in xmlobj.complemento.nomina12.Percepciones)
{
XElement concepto = new XElement("con");
concepto.SetAttributeValue("TCon", "P");
concepto.SetAttributeValue("SV", "0");
concepto.SetAttributeValue("Tipo", con.TipoPercepcion);
concepto.SetAttributeValue("Clave", con.Clave);
concepto.SetAttributeValue("Concepto", con.Concepto);
concepto.SetAttributeValue("Importe", con.ImporteGravado + con.ImporteExento);
concepto.SetAttributeValue("ImporteG", con.ImporteGravado);
concepto.SetAttributeValue("ImporteE", con.ImporteExento);
xfile.Add(concepto);
}
foreach (var con in xmlobj.complemento.nomina12.OtrosPagos)
{
XElement concepto = new XElement("con");
concepto.SetAttributeValue("TCon", "D");
concepto.SetAttributeValue("SV", "0");
concepto.SetAttributeValue("Tipo", con.TipoOtroPago);
concepto.SetAttributeValue("Clave", con.Clave);
concepto.SetAttributeValue("Concepto", con.Concepto);
concepto.SetAttributeValue("Importe", -con.Importe);
concepto.SetAttributeValue("ImporteG", -con.Importe);
concepto.SetAttributeValue("ImporteE", 0);
xfile.Add(concepto);
}
foreach (var con in xmlobj.complemento.nomina12.Deducciones)
{
if (con.TipoDeduccion == "-001-") { }
else
{
XElement concepto = new XElement("con");
concepto.SetAttributeValue("TCon", "D");
if (con.TipoDeduccion == "-000-")
{
concepto.SetAttributeValue("SV", "1");
concepto.SetAttributeValue("Tipo", "000");
}
else
{
concepto.SetAttributeValue("SV", "0");
concepto.SetAttributeValue("Tipo", con.TipoDeduccion);
}
concepto.SetAttributeValue("Clave", con.Clave);
concepto.SetAttributeValue("Concepto", con.Concepto);
concepto.SetAttributeValue("Importe", con.Importe);
concepto.SetAttributeValue("ImporteG", con.Importe);
concepto.SetAttributeValue("ImporteE", 0);
xfile.Add(concepto);
}
}
}
else if (Path.GetExtension(urfile).ToLower() == ".pdf")
{
try
{
PdfReader reader = new PdfReader(urfile);
text = PdfTextExtractor.GetTextFromPage(reader, 1, new LocationTextExtractionStrategy());
foliofiscal = string.Empty;
CURP = string.Empty;
fechas.RemoveAll(z => true);
lines = text.Split('\n');
foreach (string linea in lines)
{
foreach (string word in Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(linea)).Split(delimiterChars))
{
if (word.Length == 36 && (splitword = word.Split('-')).Length == 5 &&
splitword[0].Length == 8 && splitword[1].Length == 4 && splitword[2].Length == 4 &&
splitword[3].Length == 4 && splitword[4].Length == 12)
{
foliofiscal = word;
}
if (rgxcurp.IsMatch(word))
{
CURP = word;
}
if (rgxfecha.IsMatch(word))
{
fechas.Add(word);
}
}
}
reader.Close();
}
catch (Exception) { }
if (fechas.Count > 2)
{
xfile.SetAttributeValue("FechaInicio", fechas[2].ToDateTime().ToString("yyyy-MM-dd"));
}
if (fechas.Count > 3)
{
xfile.SetAttributeValue("FechaFin", fechas[3].ToDateTime().ToString("yyyy-MM-dd"));
}
xfile.SetAttributeValue("CURP", CURP);
xfile.SetAttributeValue("UUID", foliofiscal);
} }
@@ -150,24 +320,228 @@ public partial class Documentacion_TableroMaterialidad : ClsPaginas
} }
xmlarchivos.Add(xfolder); xmlarchivos.Add(xfolder);
xmlobject = xmlarchivos.ToString(); xmlobject = xmlarchivos.ToString();
//System.IO.StreamWriter archivoW = null;
//try { archivoW = new System.IO.StreamWriter(string.Format("{0}xml.txt", directorio), true, System.Text.Encoding.UTF8); } catch (Exception) { }
//if (archivoW != null)
//{
// try { archivoW.WriteLine(xmlobject); } catch (Exception) { }
// try
// {
// archivoW.Close();
// archivoW.Dispose();
// }
// catch (Exception) { }
//}
}
foreach (Archivo obj in litsarchivoxml)
{
System.IO.File.Delete(obj.FileUrl);
}
if (!string.IsNullOrEmpty(xmlobject))
{
procesararchivo(xmlobject, string.Format("{0}{1}", anio, mes).ToEntero());
}
Anexoxmlpdf.Text = "[]";
RegistraScript("showhideprocesarguardar =1; openguardar();");
Upxmlpdf.Update();
//RegistraScript("$('#ModalDoctosxmlpdf').modal();");
}
}
public void procesararchivo(string xmlobject,int periodo, bool guardarInformacion =false)
{
using (ClsEdocumentacion edoc = new ClsEdocumentacion())
{
if (edoc.materialidadDoctos(xmlobject,UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, periodo, guardarInformacion))
{
if (edoc.DtResultados.Rows.Count > 0)
{
DataRow row = edoc.DtResultados.Rows[0];
LtlNoDoctos.Text = row["AllFiles"].ToString().ToEntero().ToString("N0");
LtlOtrosDoctos.Text = row["OTROSFiles"].ToString().ToEntero().ToString("N0");
LtlNoXml.Text = row["XMLFiles"].ToString().ToEntero().ToString("N0");
LtlNoPDF.Text = row["PDFFiles"].ToString().ToEntero().ToString("N0");
}
pnlinconsistencias.Visible = (edoc.DSResultados.Tables[2].FiltraParametros("CvePersonal IS NULL OR CvePeriodo IS NULL OR PeriodoOk =0").Rows.Count > 0);
if (edoc.DSResultados.Tables.Count > 2)
{
GVmaterialidadDoctos.DataSource = edoc.DSResultados.Tables[2];
GVmaterialidadDoctos.DataBind();
}
if (edoc.DSResultados.Tables.Count > 3)
{
GvPersonal.DataSource = edoc.DSResultados.Tables[3].FiltraParametros("CvePersonal IS NULL");
GvPersonal.DataBind();
}
if (edoc.DSResultados.Tables.Count > 4)
{
GvPeriodo.DataSource = edoc.DSResultados.Tables[4].FiltraParametros("CvePeriodo IS NULL");
GvPeriodo.DataBind();
}
}
Upxmlpdf.Update();
}
}
protected void LnkProcesarDoctos_Click(object sender, EventArgs e)
{
procesararchivo(xmlobject, string.Format("{0}{1}", anio, mes).ToEntero(), true);
procesararchivo(xmlobject, string.Format("{0}{1}", anio, mes).ToEntero(), false);
}
protected void GVmaterialidadDoctos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string toolTip = "";
int PeriodoOk = e.Row.DataKey("PeriodoOk").ToEntero();
int cvePersonal = e.Row.DataKey("CvePersonal").ToEntero();
int CvePeriodo = e.Row.DataKey("CvePeriodo").ToEntero();
int CveNomina = e.Row.DataKey("CveNomina").ToEntero();
if (CveNomina > 0)
{
e.Row.CssClass = "info";
toolTip = string.Format("{0}{1}Nomina registrada.", toolTip, (toolTip.Length > 0 ? " " : ""));
}
if (PeriodoOk <= 0)
{
e.Row.CssClass = "warning";
toolTip = string.Format("{0}{1}Esta nomina no pertenece a este periodo", toolTip, (toolTip.Length > 0 ? " " : ""));
}
if (cvePersonal <= 0)
{
e.Row.CssClass = "danger";
toolTip = string.Format("{0}{1}No se encontro el personal", toolTip, (toolTip.Length > 0 ? " " : ""));
}
/*
if (CvePeriodo <= 0)
{
e.Row.CssClass = "danger";
toolTip = string.Format("{0}{1}No se encontro el periodo", toolTip, (toolTip.Length > 0 ? " " : ""));
}*/
e.Row.ToolTip = toolTip;
}
}
protected void btnshowdoc_Click(object sender, EventArgs e)
{
GVdocelect.DataSource = new DataTable();
GVMaterialidadEnvios.DataSource = new DataTable();
using (ClsEdocumentacion edoc = new ClsEdocumentacion())
{
if (edoc.DocumentacionElectronicaGet(-1, -1, -1, UsuarioActual.CveEmpresa, -1, -1, -2, string.Format("{0}{1}", anio, mes).ToEntero()))
{
GVdocelect.DataSource = edoc.DtResultados.FiltraParametros(string.Format("CveDocumentacion ={0}", TxtcveDocumentacion.Text.ToEntero()));
}
if (edoc.Edoc_MaterialidadEnviosGet(-1, TxtcveCliente.Text.ToEntero(), -1, UsuarioActual.CveEmpresa))
{
GVMaterialidadEnvios.DataSource = edoc.DtResultados;
} }
} }
foreach (Archivo obj in litsarchivoxml) GVMaterialidadEnvios.DataBind();
{ GVdocelect.DataBind();
System.IO.File.Delete(obj.FileUrl); RegistraScript("$('#ModalShowDoctos').modal()");
}
RegistraScript("$('#ModalDoctosxmlpdf').modal();");
} }
protected void LnkEliminardocto_Click(object sender, EventArgs e)
{
int CveDocumentacionElectronica = ((GridViewRow)((LinkButton)sender).NamingContainer).DataKey("CveDocumentacionElectronica").ToEntero();
string Adjunto = ((GridViewRow)((LinkButton)sender).NamingContainer).DataKey("Adjunto");
using (ClsEdocumentacion edoc = new ClsEdocumentacion())
{
if (edoc.DocumentacionElectronicaRemove(CveDocumentacionElectronica, -1))
{
string ruta = string.Format("{0}\\materialidad\\{1}", UsuarioActual.Empresa.Ruta, Adjunto);
if (System.IO.File.Exists(ruta))
{
try
{
System.IO.File.Delete(ruta);
}
catch (Exception) { }
}
if (edoc.DocumentacionElectronicaGet(-1, -1, -1, UsuarioActual.CveEmpresa, -1, -1, -2, string.Format("{0}{1}", anio, mes).ToEntero()))
{
GVdocelect.DataSource = edoc.DtResultados.FiltraParametros(string.Format("CveDocumentacion ={0}", TxtcveDocumentacion.Text.ToEntero()));
GVdocelect.DataBind();
}
Alert("El documento se a eliminado");
}
}
}
protected void BtnDocumentacionElectronica_Click(object sender, EventArgs e)
{
String Adjunto = TxtCveDocumentacionElectronica.Text;
string ruta = string.Format("{0}\\materialidad\\{1}", UsuarioActual.Empresa.Ruta, Adjunto);
using (ClsEdocumentacion edoc = new ClsEdocumentacion())
{
if (System.IO.File.Exists(ruta))
{
System.IO.FileInfo file = new System.IO.FileInfo(ruta);
string mimeType = "text/plain";
try
{
mimeType = MimeMapping.GetMimeMapping(ruta);
}
catch (Exception ex)
{
}
// Response.Write(path)
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("Content-Disposition", $"attachment; filename= {Uri.EscapeDataString(TxtDoctoName.Text)}");
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = mimeType;
Response.Flush();
Response.TransmitFile(file.FullName);
Response.End();
}
else
{
Alert("no se encontro el documento.");
}
}
}
protected void Btnenviardocto_Click(object sender, EventArgs e)
{
int periodo = string.Format("{0}{1}", anio, mes).ToEntero();
DataTable dtdoctos = null;
DataTable dtdocs = null;
string CorreoCumplimiento = string.Empty;
using (ClsEdocumentacion edoc = new ClsEdocumentacion())
{
if (edoc.TableroMaterialidadGET(UsuarioActual.CveEmpresa, anio, mes) && edoc.DSResultados.Tables.Count > 1)
{
dtdoctos = edoc.DSResultados.Tables[0];
}
if (edoc.DocumentacionElectronicaGet(-1, -1, -1, UsuarioActual.CveEmpresa, -1, -1, -2, periodo))
{
dtdocs = edoc.DtResultados.FiltraParametros(string.Format("CveDocumentacionElectronica>0"));
}
DataRow row = null;
foreach (string item in TxtClientescorreo.Text.Split(','))
{
if (item.ToEntero() > 0 && dtdoctos != null && (row = dtdoctos.FiltroPrimero(string.Format("CveCliente ={0}", item))) != null && dtdocs != null && dtdocs.Rows.Count > 0 && !string.IsNullOrEmpty(CorreoCumplimiento = row["CorreoCumplimiento"].ToString()))
{
edoc.Edoc_MaterialidadEnviosAdd(item.ToEntero(), periodo, dtdocs.Rows.Count, "Envio", CorreoCumplimiento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
}
}
}
Alert("El correo se ha enviado.");
}
} }
public class archivoxmlpdf public class archivoxmlpdf
{ {
@@ -196,8 +570,6 @@ public class archivoxmlpdf
} }
namespace ADSistemaLibrary3.SatXml namespace ADSistemaLibrary3.SatXml
{ {
public class XmlSatCFDI public class XmlSatCFDI
@@ -515,17 +887,18 @@ namespace ADSistemaLibrary3.SatXml
if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyComplemento) if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyComplemento)
{ {
int cDepth = xtr.Depth; int cDepth = xtr.Depth;
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
{
bool enterdept = true;
bool noavance = true;
xmlCFDI.complemento.nomina12 = new CFDINomina();
} while (canread && (xtr.Depth > cDepth || enterdept))
while (canread && xtr.Depth > cDepth)
{ {
enterdept = false;
if (noavance)
{
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
}
noavance = true;
if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName == "TimbreFiscalDigital" && xmlCFDI.comprobante.Version != null) if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName == "TimbreFiscalDigital" && xmlCFDI.comprobante.Version != null)
{ {
xmlCFDI.complemento.xmlns_tfd = xtr.GetAttribute("xmlns:tfd"); xmlCFDI.complemento.xmlns_tfd = xtr.GetAttribute("xmlns:tfd");
@@ -539,13 +912,10 @@ namespace ADSistemaLibrary3.SatXml
xmlCFDI.complemento.SelloSAT = xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("SelloSAT") : xtr.GetAttribute("selloSAT"); xmlCFDI.complemento.SelloSAT = xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("SelloSAT") : xtr.GetAttribute("selloSAT");
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
} }
else if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName.ToUpper() == "NOMINA" && xmlCFDI.comprobante.Version != null) if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName.ToUpper() == "NOMINA" && xmlCFDI.comprobante.Version != null)
{ {
xmlCFDI.complemento.nomina12 = new CFDINomina();
//Version="1.2" TipoNomina="E" FechaPago="2021-12-08"
//="2021-12-08" ="2021-12-08"
//="1" ="5026.31" ="254.34"
cont = xtr.MoveToFirstAttribute(); cont = xtr.MoveToFirstAttribute();
while (cont) while (cont)
{ {
@@ -556,14 +926,150 @@ namespace ADSistemaLibrary3.SatXml
case "FECHAFINALPAGO": xmlCFDI.complemento.nomina12.FechaFin = xtr.Value; break; case "FECHAFINALPAGO": xmlCFDI.complemento.nomina12.FechaFin = xtr.Value; break;
case "NUMDIASPAGADOS": xmlCFDI.complemento.nomina12.NumDiasPagados = xtr.Value.ToEntero(); break; case "NUMDIASPAGADOS": xmlCFDI.complemento.nomina12.NumDiasPagados = xtr.Value.ToEntero(); break;
case "TIPONOMINA": xmlCFDI.complemento.nomina12.TipoNomina = xtr.Value; break; case "TIPONOMINA": xmlCFDI.complemento.nomina12.TipoNomina = xtr.Value; break;
case "Version": xmlCFDI.complemento.nomina12.Version = xtr.Value; break; case "VERSION": xmlCFDI.complemento.nomina12.Version = xtr.Value; break;
} }
cont = xtr.MoveToNextAttribute(); cont = xtr.MoveToNextAttribute();
} }
xtr.MoveToFirstAttribute(); xtr.MoveToFirstAttribute();
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
} }
else if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName == "Pagos" && xmlCFDI.comprobante.Version != null) if (xtr.NodeType == XmlNodeType.Element && xtr.Name.ToUpper() == "NOMINA12:RECEPTOR")
{
cont = xtr.MoveToFirstAttribute();
while (cont)
{
switch (xtr.Name.ToUpper())
{
case "CURP": xmlCFDI.complemento.nomina12.Receptor.CURP = xtr.Value; break;
case "NUMSEGURIDADSOCIAL": xmlCFDI.complemento.nomina12.Receptor.NSS = xtr.Value; break;
case "FECHAINICIORELLABORAL": xmlCFDI.complemento.nomina12.Receptor.FechaInicioContrato = xtr.Value; break;
case "ANTIGÜEDAD": xmlCFDI.complemento.nomina12.Receptor.Antiguedad = xtr.Value; break;
case "TIPOCONTRATO": xmlCFDI.complemento.nomina12.Receptor.TipoContrato = xtr.Value; break;
case "NUMEMPLEADO": xmlCFDI.complemento.nomina12.Receptor.CodigoEmpleado = xtr.Value; break;
case "DEPARTAMENTO": xmlCFDI.complemento.nomina12.Receptor.Departamento = xtr.Value; break;
case "TIPOREGIMEN": xmlCFDI.complemento.nomina12.Receptor.CodigoRegimenContratacion = xtr.Value; break;
case "SINDICALIZADO": xmlCFDI.complemento.nomina12.Receptor.Sindicalizado = xtr.Value; break;
case "TIPOJORNADA": xmlCFDI.complemento.nomina12.Receptor.CodigoTipoJornada = xtr.Value; break;
case "PUESTO": xmlCFDI.complemento.nomina12.Receptor.Puesto = xtr.Value; break;
case "RIESGOPUESTO": xmlCFDI.complemento.nomina12.Receptor.CodigoRiesgoPuesto = xtr.Value; break;
case "SALARIOBASECOTAPOR": xmlCFDI.complemento.nomina12.Receptor.SBC = xtr.Value.ToDouble(); break;
case "SALARIODIARIOINTEGRADO": xmlCFDI.complemento.nomina12.Receptor.SDI = xtr.Value.ToDouble(); break;
case "CLAVEENTFED": xmlCFDI.complemento.nomina12.Receptor.CodigoEntidadFederativa = xtr.Value; break;
case "PERIODICIDADPAGO": xmlCFDI.complemento.nomina12.Receptor.TipoPeriodo = xtr.Value; break;
case "CUENTABANCARIA": xmlCFDI.complemento.nomina12.Receptor.NumeroCuenta = xtr.Value; break;
case "BANCO": xmlCFDI.complemento.nomina12.Receptor.CodigoBanco = xtr.Value; break;
}
cont = xtr.MoveToNextAttribute();
}
xtr.MoveToFirstAttribute();
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
}
if (xtr.NodeType == XmlNodeType.Element && xtr.Name.ToUpper() == "NOMINA12:PERCEPCION")
{
if (xmlCFDI.complemento.nomina12.Percepciones == null)
{
xmlCFDI.complemento.nomina12.Percepciones = new List<CFDINominaPercepciones>();
}
CFDINominaPercepciones concepto = new CFDINominaPercepciones();
cont = xtr.MoveToFirstAttribute();
while (cont)
{
switch (xtr.Name.ToUpper())
{
case "CLAVE": concepto.Clave = xtr.Value; break;
case "TIPOPERCEPCION": concepto.TipoPercepcion = xtr.Value; break;
case "IMPORTEGRAVADO": concepto.ImporteGravado = xtr.Value.ToDecimal(); break;
case "IMPORTEEXENTO": concepto.ImporteExento = xtr.Value.ToDecimal(); break;
case "CONCEPTO": concepto.Concepto = xtr.Value; break;
}
cont = xtr.MoveToNextAttribute();
}
xmlCFDI.complemento.nomina12.Percepciones.Add(concepto);
xtr.MoveToFirstAttribute();
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
}
if (xtr.NodeType == XmlNodeType.Element && xtr.Name.ToUpper() == "NOMINA12:DEDUCCION")
{
if (xmlCFDI.complemento.nomina12.Deducciones == null)
{
xmlCFDI.complemento.nomina12.Deducciones = new List<CFDINominaDeducciones>();
}
CFDINominaDeducciones concepto = new CFDINominaDeducciones();
cont = xtr.MoveToFirstAttribute();
while (cont)
{
switch (xtr.Name.ToUpper())
{
case "CLAVE": concepto.Clave = xtr.Value; break;
case "TIPODEDUCCION": concepto.TipoDeduccion = xtr.Value; break;
case "IMPORTE": concepto.Importe = xtr.Value.ToDecimal(); break;
case "CONCEPTO": concepto.Concepto = xtr.Value; break;
}
cont = xtr.MoveToNextAttribute();
}
xmlCFDI.complemento.nomina12.Deducciones.Add(concepto);
xtr.MoveToFirstAttribute();
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
}
if (xtr.NodeType == XmlNodeType.Element && xtr.Name.ToUpper() == "NOMINA12:OTROPAGO")
{
if (xmlCFDI.complemento.nomina12.OtrosPagos == null)
{
xmlCFDI.complemento.nomina12.OtrosPagos = new List<CFDINominaOtrosPagos>();
}
CFDINominaOtrosPagos concepto = new CFDINominaOtrosPagos();
cont = xtr.MoveToFirstAttribute();
while (cont)
{
switch (xtr.Name.ToUpper())
{
case "CLAVE": concepto.Clave = xtr.Value; break;
case "TIPOOTROPAGO": concepto.TipoOtroPago = xtr.Value; break;
case "IMPORTE": concepto.Importe = xtr.Value.ToDecimal(); break;
case "CONCEPTO": concepto.Concepto = xtr.Value; break;
}
cont = xtr.MoveToNextAttribute();
}
xmlCFDI.complemento.nomina12.OtrosPagos.Add(concepto);
xtr.MoveToFirstAttribute();
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
}
if (xtr.NodeType == XmlNodeType.Element && xtr.Name.ToUpper() == "NOMINA12:SUBSIDIOALEMPLEO")
{
if (xmlCFDI.complemento.nomina12.Deducciones == null)
{
xmlCFDI.complemento.nomina12.Deducciones = new List<CFDINominaDeducciones>();
}
CFDINominaDeducciones concepto = new CFDINominaDeducciones();
cont = xtr.MoveToFirstAttribute();
while (cont)
{
concepto.TipoDeduccion = "-000-";
concepto.Clave = "D025";
concepto.Concepto = "Subsidio acreditable";
switch (xtr.Name.ToUpper())
{
case "SubsidioCausado": concepto.Importe = -xtr.Value.ToDecimal(); break;
}
cont = xtr.MoveToNextAttribute();
}
CFDINominaDeducciones concepto2 = new CFDINominaDeducciones();
concepto2.TipoDeduccion = "-001-";
concepto2.Clave = concepto.Clave;
concepto2.Concepto = concepto.Concepto;
concepto2.Importe = -concepto.Importe;
xmlCFDI.complemento.nomina12.Deducciones.Add(concepto2);
xmlCFDI.complemento.nomina12.Deducciones.Add(concepto);
xtr.MoveToFirstAttribute();
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
}
if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName.ToUpper() == "PAGOS" && xmlCFDI.comprobante.Version != null)
{ {
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
xmlCFDI.complemento.Pagos = new CFDIPago(); xmlCFDI.complemento.Pagos = new CFDIPago();
@@ -618,13 +1124,9 @@ namespace ADSistemaLibrary3.SatXml
conts = xtr.MoveToFirstAttribute(); conts = xtr.MoveToFirstAttribute();
xmlCFDI.complemento.Pagos.doctosRelacionados.Add(objpago); xmlCFDI.complemento.Pagos.doctosRelacionados.Add(objpago);
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
noavance = false;
} }
} }
else
{
while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { }
}
} }
} }
} }
@@ -1179,8 +1681,4 @@ namespace ADSistemaLibrary3.SatXml
public string UUID { get; set; } public string UUID { get; set; }
} }
} }

View File

@@ -49,7 +49,7 @@
</div> </div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">MES:</div> <div class="col-md-1 " style="font-size: medium; max-width: 100px!important">MES:</div>
<div class=" col-md-2 " style="max-width: 283px!important"> <div class=" col-md-2 " style="max-width: 283px!important">
<asp:DropDownList ID="ddlMes" Width="100%" runat="server" CssClass="form-control select2me"> <asp:DropDownList ID="ddlMes" Width="100%" runat="server" CssClass="form-control select2me">
<asp:ListItem Value="01" Text="01 - Enero"></asp:ListItem> <asp:ListItem Value="01" Text="01 - Enero"></asp:ListItem>
<asp:ListItem Value="02" Text="02 - Febrero"></asp:ListItem> <asp:ListItem Value="02" Text="02 - Febrero"></asp:ListItem>
@@ -92,16 +92,49 @@
<asp:Label ID="lblnombreCompleto" runat="server" Text='<%# Eval("NombreCompleto")%>'> </asp:Label> <asp:Label ID="lblnombreCompleto" runat="server" Text='<%# Eval("NombreCompleto")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="XML"> <asp:TemplateField HeaderText="XML" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lbldocsXML" runat="server" Text='<%# Eval("docsXML")%>'> </asp:Label> <asp:Label ID="lbldocsXML" runat="server" Text='<%# Eval("docsXML")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="PDF"> <asp:TemplateField HeaderText="PDF" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lbldocsPDF" runat="server" Text='<%# Eval("docsPDF")%>'> </asp:Label> <asp:Label ID="lbldocsPDF" runat="server" Text='<%# Eval("docsPDF")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
<asp:BoundField Visible="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="80px" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using System.Web.UI; using System.Web.UI;
@@ -56,6 +57,25 @@ public partial class Documentacion_TableroMaterialidadDetalle : ClsPaginas
if (edoc.TableroMaterialidadDetalleGET(UsuarioActual.CveEmpresa, (anio = Txtanio.Text.ToEntero()), (mes = ddlMes.SelectedValue.ToEntero()), CveCliente) && edoc.DSResultados.Tables.Count > 0) if (edoc.TableroMaterialidadDetalleGET(UsuarioActual.CveEmpresa, (anio = Txtanio.Text.ToEntero()), (mes = ddlMes.SelectedValue.ToEntero()), CveCliente) && edoc.DSResultados.Tables.Count > 0)
{ {
GVData.DataSource = edoc.DSResultados.Tables[0]; GVData.DataSource = edoc.DSResultados.Tables[0];
int CurrentColumn = 4;
BoundField bf;
foreach (DataRow item in edoc.DSResultados.Tables[1].Rows)
{
GVData.Columns[CurrentColumn].Visible = true;
bf = (BoundField)GVData.Columns[CurrentColumn];
bf.DataField = string.Format("V_{0}", item["CvePeriodo"]);
bf.HeaderText = string.Format("({0:dd/MM/yyyy}-{1:dd/MM/yyyy})", item["FechaInicio"], item["FechaFin"]);
bf.Visible = true;
//Alert(string.Format("{0}-{1}", item["FechaInicio"], item["FechaFin"]));
CurrentColumn = CurrentColumn + 1;
}
for (int i = CurrentColumn; i < GVData.Columns.Count; i++)
{
GVData.Columns[i].Visible = false;
bf = (BoundField)GVData.Columns[i];
bf.DataField = "";
bf.HeaderText = "";
}
GVData.DataBind(); GVData.DataBind();
} }

View File

@@ -52,7 +52,13 @@
<Width>3.00921cm</Width> <Width>3.00921cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>10.82134cm</Width> <Width>6.3532cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.90464cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.35479cm</Width> <Width>2.35479cm</Width>
@@ -150,6 +156,86 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="CodigoMaterialPeligroso">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!CodigoMaterialPeligroso.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>CodigoMaterialPeligroso</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Embalaje">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Embalaje.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Embalaje</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="PesoEnKg"> <Textbox Name="PesoEnKg">
@@ -280,6 +366,86 @@
</CellContents> </CellContents>
</TablixHeader> </TablixHeader>
</TablixMember> </TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.52062cm</Size>
<CellContents>
<Textbox Name="Textbox37">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Cod. Material Peligroso</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox37</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#4f81bd</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.52062cm</Size>
<CellContents>
<Textbox Name="Textbox40">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Embalaje</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox40</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#4f81bd</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
</TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.52062cm</Size> <Size>0.52062cm</Size>
@@ -385,7 +551,7 @@
<Top>6.39415cm</Top> <Top>6.39415cm</Top>
<Left>0.38395cm</Left> <Left>0.38395cm</Left>
<Height>1.12062cm</Height> <Height>1.12062cm</Height>
<Width>19.11271cm</Width> <Width>19.04921cm</Width>
<Style> <Style>
<Border> <Border>
<Color>#4f81bd</Color> <Color>#4f81bd</Color>
@@ -1723,6 +1889,60 @@
<TextAlign>Left</TextAlign> <TextAlign>Left</TextAlign>
</Style> </Style>
</Paragraph> </Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Placa:</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!PlacaVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Año:</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!AnioVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName> <rd:DefaultName>Textbox2</rd:DefaultName>
<Top>1.13111in</Top> <Top>1.13111in</Top>
@@ -1925,52 +2145,13 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Placa:</Value> <Value />
<Style> <Style>
<FontFamily>Myriad Pro</FontFamily> <FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize> <FontSize>7pt</FontSize>
<FontWeight>SemiBold</FontWeight> <FontWeight>SemiBold</FontWeight>
</Style> </Style>
</TextRun> </TextRun>
<TextRun>
<Value>=Parameters!PlacaVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Año:</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!AnioVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
<TextAlign>Left</TextAlign> <TextAlign>Left</TextAlign>
@@ -3520,6 +3701,14 @@
<DataField>PesoEnKg</DataField> <DataField>PesoEnKg</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="CodigoMaterialPeligroso">
<DataField>CodigoMaterialPeligroso</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Embalaje">
<DataField>Embalaje</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields> </Fields>
<rd:DataSetInfo> <rd:DataSetInfo>
<rd:DataSetName>DataSet</rd:DataSetName> <rd:DataSetName>DataSet</rd:DataSetName>

7579
GPS/EmbarqueManifiesto.rdlc Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,886 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CartaPorteManual.aspx.vb" Inherits="Inventarios_CartaPorteManual" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.psagregar {
width: 550px;
}
.psagregar > div.comboxes {
display: inline-block;
width: 450px;
}
.psagregar > div.codigo input {
width: 79px;
}
.psagregar > div.codigo {
display: inline-block;
width: 80px;
}
.psagregar > div.codigo > input[type="submit"] {
display: none;
}
.select2anothertable {
position: absolute;
left: 100%;
background-color: white;
/*top: 50px;*/ top: 21px;
/*max-height: 200px;*/ max-height: 229px;
/*background-color: #dcdcdc;*/
overflow: hidden;
}
.select2anothertable > table > tbody > tr > td:nth-of-type(odd) {
background-color: rgba(220, 220, 220, 0.45);
}
.select2anothertable > table > tbody > tr > td {
line-height: 21px;
white-space: nowrap;
}
.select2anothertable > table > tbody > tr.active {
background-color: #5897fb;
}
a#C_Tab_TabR_GvDatosRecepcion_LnkSeccionAlmacenDestino_0 {
display: none;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Carta Porte Manual
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" >
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="LnkAgregarDireccion" data-toggle="tooltip" data-placement="left" title="Agregar Dirección" Text="<i class='fa fa-plus'></i> Agregar Dirección"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabTraspaso" runat="server" HeaderText="Traspaso">
<ContentTemplate>
<div class="row">
<%-- <div class="col-md-8">
<asp:UpdatePanel ID="UpTraspaso" runat="server">
<ContentTemplate>
<div class="portlet light xspadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">TRASPASO ENTRE ALMACENES</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body ">
<div class="row" style="padding-top: 8px;">
<label class="col-md-2">Observaciones:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtObservaciones" CssClass="form-control " TextMode="MultiLine" Rows="3" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="padding-top: 8px;">
</div>
<div id="DivResponsable" runat="server" visible="true">
<div class="row">
<label class="col-md-2">Responsable:</label>
<div class="col-md-2" id="div1" >
<asp:TextBox runat="server" Text="" CssClass="form-control input-sm" ID="TxtResponsable" />
</div>
</div>
</div>
<div id="DivTransitorio2" class="rowpadding" runat="server" visible="false">
<div class="row">
<asp:Label AssociatedControlID="TxtGastoIndirecto" Visible="false" ID="LblGastoIndirecto" runat="server" Text="Gasto Indirecto:" CssClass="col-md-2"></asp:Label>
<div class="col-md-2" id="divGastoIndirecto" visible="false" runat="server">
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtGastoIndirecto" />
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>--%>
<asp:UpdatePanel ID="UpEmitirTransitorio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivEmitirTransitorio" class="col-md-4 " runat="server" visible="true">
<div class="portlet light xspadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">EMISIÓN DE TRASLADO</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body ">
<div class="rowpadding">
<div class="row">
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-3"></asp:Label>
<div class="col-md-9" style="padding-left: 5px;">
<asp:DropDownList runat="server" ID="DdlSubProyecto" CssClass="select2me" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyecto" runat="server" InitialValue="-1" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
</div>
<div class="row">
<label class="col-md-3">Fecha:</label>
<div class="col-md-3" style="padding-left: 5px;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" ValidationGroup="GrpGuardar" Width="100px" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFecha" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" Type="Date" MinimumValue="01/01/2000" MaximumValue="01/01/2000" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no puede ser mayor al dia actual. Por favor verifcar." ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha3" runat="server" HighlightCssClass="vco" TargetControlID="RVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row rowpadding" id="divEmitir" runat="server">
<label class="col-md-3">Emitir:</label>
<div class="col-md-9">
<table>
<tr>
<td>
<asp:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirTimbrado_CheckedChanged" AutoPostBack="true" Enabled="false" />
</td>
<td>
<asp:CheckBox ID="ChkEmitirCartaPorte" Checked="true" runat="server" Text="Carta Porte" Visible="true" Enabled="false" /></td>
</tr>
</table>
</div>
</div>
<div class="row rowpadding">
<label class="col-md-3">Chofer:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row rowpadding">
<label class="col-md-3">Unidad:</label>
<div class="col-md-9">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row rowpadding">
<%--<label class="col-md-3">F. Salida:</label>
<div class="col-md-9" style="padding-top: 0px;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
<asp:TextBox ID="TxtFechaEntrega" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFechaEntrega" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaEntrega" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaEntrega" PopupButtonID="ImgFechaEntrega" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
</div>
<div class="row rowpadding" runat="server" id="divFechaLlegada">
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="col-md-8" runat="server" visible="true">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpDirecciones">
<ContentTemplate>
<div class="portlet light xspadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Direcciones</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UpGvDireccionesEnvio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDireccionesEnvio" runat="server" Width="100%" GridLines="None"
DataKeyNames="CveDireccionEnvio,EnvioDireccion,EnvioCP,CveUsuario,Estatus,EnvioNoExt,EnvioNoInt,CvePais,CveEstado,CveMunicipio,CveLocalidad,CveColonia,Tipo"
CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de direcciones de envio">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Tipo
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioTipo" runat="server" CssClass="truncate" Text='<%# Eval("EnvioTipo")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Dirección
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioDireccion" runat="server" CssClass="truncate" Text='<%# Eval("EnvioDireccion")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Estado
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioEstado" runat="server" CssClass="truncate" Text='<%# Eval("EnvioEstado")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Municipio
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioMunicipio" runat="server" CssClass="truncate" Text='<%# Eval("EnvioMunicipio")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Localidad
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioLocalidad" runat="server" CssClass="truncate" Text='<%# Eval("EnvioLocalidad")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Colonia
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioColonia" runat="server" CssClass="truncate" Text='<%# Eval("EnvioColonia")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
C.P.
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioCP" runat="server" CssClass="truncate" Text='<%# Eval("EnvioCP")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" class="Widthall grides" cellspacing="0">
<thead>
<tr class="Titulos">
<th width="25px">#</th>
<th width="100px">Cantidad</th>
<th width="90px">Unidad</th>
<th width="500px">Producto
</th>
<th width="100px"></th>
<th style="width: 88px" runat="server" id="ThSeccionAlmacen" visible="false">Sección Almacen</th>
<th style="width: 88px" runat="server" id="ThSerie" visible="false">Serie</th>
<th style="width: 88px" runat="server" id="ThLote" visible="false">Lote</th>
<th style="width: 88px" runat="server" id="ThFechaCaducidad" visible="false">Fecha Caducidad</th>
<th width="160px">Comandos</th>
</tr>
</thea>
<tr>
<td></td>
<td align="center">
<asp:TextBox ID="txtCantidad" Width="50px" MaxLength="7" runat="server" TabIndex="1"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbeCant" runat="server" TargetControlID="txtCantidad" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator runat="server" ID="RFVCantidad" ControlToValidate="txtCantidad" ValidationGroup="GrpAgregar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario por favor introdúzcalo." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVCantidad" runat="server" ControlToValidate="txtCantidad" Display="None" Type="Double" MinimumValue="0.001" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor introdúzcalo." ValidationGroup="GrpAgregar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="RVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DdlUnidad" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me" Style="width: 85px !important;"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidad" runat="server" ControlToValidate="DdlUnidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: left;">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="psagregar">
<div class="comboxes">
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2" DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td >
<%-- <asp:TextBox ID="TxtnObservaciones" CssClass="form-control input-sm" runat="server" Width="100px"></asp:TextBox>--%>
</td>
<td runat="server" id="TdSeccionAlmacen" visible="false">
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
Destino:<asp:DropDownList ID="DdlSeccionAlmacenDestino" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td runat="server" id="TdSerie" visible="false">
<asp:Panel runat="server" DefaultButton="BtnSerieAddNew">
<asp:TextBox ID="TxtnSerie" Visible="false" runat="server" Width="80px"></asp:TextBox>
<asp:Button Text="" ID="BtnSerieAddNew" OnClick="BtnSerieAddNew_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
<td runat="server" id="TdLote" visible="false">
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td runat="server" id="TdFechaCaducidad" visible="false">
<asp:CheckBox ID="ChkSugiereFechaCaducidad" runat="server" Text="Auto Sugiere" ToolTip="Auto Sugiere Fecha de caducidad" AutoPostBack="true" OnCheckedChanged="ChkSugiereFechaCaducidad_CheckedChanged" />
<asp:TextBox ID="TxtnFechaCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td align="center">
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="Texto" ValidationGroup="GrpAgregar" TabIndex="3" Text="Agregar" />
</td>
</tr>
</table>
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Cantidad") %>' ID="ltlCantidad"></asp:Literal>
<asp:TextBox runat="server" ID="TxtCantidad2" Text='<%# Eval("Cantidad", "{0:###,###,###,##0.##}") %>' Width="50px" Visible="false"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidadF" runat="server" TargetControlID="TxtCantidad2" FilterType="Numbers,custom" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="86px" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="500px" />
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="90px" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="90px" />
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="90px" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("SeccionAlmacen") %>' ID="ltlSec"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" CommandName="Delete" CommandArgument='<%# Eval("No")%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el concepto?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UpNuevoRealizar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="text-align: center;">
<div class="col-md-12">
<asp:Button Text="Realizar Carta Porte" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" ID="BtnGuardar" runat="server" />
<%--<asp:Button Text="Nuevo" CssClass="btn btn-success" ID="BtnNuevo" OnClick="BtnNuevo_Click" runat="server" />--%>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<div style="display: none;">
<asp:Button ID="BtnImprimirTraspaso" runat="server" ClientIDMode="Static" />
<asp:Button ID="BtnImprimirRecepcion" runat="server" ClientIDMode="Static" />
</div>
<%-- <div id="ModalDivMail" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Correo</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpSendMail" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-xs-4">Para:</div>
<div class="col-xs-8">
<asp:TextBox ID="TxtParaMail" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVParaMail" runat="server" ControlToValidate="TxtParaMail" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Para''</b> es necesario, por favor introdúzcalo." ValidationGroup="GrpEnviarEmail"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEParaMail" runat="server" HighlightCssClass="vco" TargetControlID="RFVParaMail" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<div class="col-xs-4">
Con copia para:<br />
(Separar con: ;)
</div>
<div class="col-xs-8">
<asp:TextBox ID="TxtCC" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnSendMail" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" ValidationGroup="GrpEnviarEmail" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>--%>
<div id="divAddDireccionEnvio" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalDVDireccionEnvio" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">Dirección de envío</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyDireccion" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoDireccion" runat="server" Width="100%" CssClass="form-control select2me" CausesValidation="true" AutoPostBack="true"
OnSelectedIndexChanged="DdlTipoDireccion_SelectedIndexChanged" ></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlTipoDireccion" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlTipoDireccion"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio">
</asp:RequiredFieldValidator>
<label for="<%= DdlTipoDireccion.ClientID.ToString()%>">Tipo:</label>
</div>
</div>
<div class="col-md-6">
<label for="<%= TxtFechaLlegada.ClientID.ToString()%>">Fecha:</label>
<div class="col-md-12" style="padding-top: 0px;margin-top:-7px;text-align:left">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
<asp:TextBox ID="TxtFechaLlegada" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFechaEnvio" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtFechaLlegada" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaLlegada" PopupButtonID="ImgFechaEnvio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaLlegada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Envío''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date " ValidationGroup="GrpObligatorio"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RfvTxtFechaLlegada" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtFechaLlegada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvTxtFechaLlegada" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaLlegada" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEnvioDireccion" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="100"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEnvioDireccion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtEnvioDireccion.ClientID.ToString()%>">Calle:</label>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtEnvioNoExt" runat="server" CssClass="form-control" MaxLength="15"></asp:TextBox>
<label for="<%= TxtEnvioNoExt.ClientID.ToString()%>">No. Ext. </label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtEnvioNoInt" runat="server" CssClass="form-control" MaxLength="50"></asp:TextBox>
<label for="<%= TxtEnvioNoInt.ClientID.ToString()%>">No. Int.</label>
</div>
</div>
</div>
<div class="row ">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEnvioCP" runat="server" Width="100%" CssClass="form-control" CausesValidation="true" TextMode="Number" onblur="DirclienteValidaCodigoPostal()" onkeypress="if(event.key === 'Enter'){return false;}"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEnvioCP" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código Postal''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtEnvioCP.ClientID.ToString()%>">Código Postal:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClientePais" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlDirClientePais_SelectedIndexChanged" runat="server" DataTextField="Descripcion" DataValueField="CvePais" CssClass="form-control select2me" Width="100%" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClientePais" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClientePais" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pais''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClientePais.ClientID.ToString()%>">Pais:</label>
<i></i>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClienteEstado" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlDirClienteEstado_SelectedIndexChanged" runat="server" DataTextField="NombreEstado" DataValueField="CveEstado" CssClass="form-control select2me" Width="100%" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClienteEstado" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteEstado" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estado''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteEstado.ClientID.ToString()%>">Estado:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClienteMunicipio" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlDirClienteMunicipio_SelectedIndexChanged" runat="server" DataTextField="Descripcion" DataValueField="CveMunicipio" CssClass="form-control select2me" Width="100%" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClienteMunicipio" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteMunicipio" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Municipio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteMunicipio.ClientID.ToString()%>">Municipio:</label>
<i></i>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList runat="server" ID="DdlDirClienteLocalidad" CssClass="form-control select2me" DataValueField="CveLocalidad" DataTextField="NombreLocalidad" Width="100%" CausesValidation="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlDirClienteLocalidad" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteLocalidad" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Localidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteLocalidad.ClientID.ToString()%>">Localidad:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClienteColonia" runat="server" AppendDataBoundItems="true" DataTextField="NombreAsentamiento" DataValueField="CveColonia" CssClass="form-control select2me" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlDirClienteColonia_SelectedIndexChanged" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClienteColonia" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteColonia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Colonia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteColonia.ClientID.ToString()%>">Colonia:</label>
<i></i>
</div>
</div>
<div class="col-md-6" runat="server" id="DvDistancia" visible="false">
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control" MaxLength="50" Width="100%" CausesValidation="true" TextMode="Number" onblur="DirclienteValidaCodigoPostal()" onkeypress="if(event.key === 'Enter'){return false;}"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtDistancia" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDistancia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Distancia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtDistancia.ClientID.ToString()%>">Distancia:</label>
</div>
</div>
</div>
<div style="display: none">
<asp:Button ID="BtnDirClienteValidar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="BtnDirClienteValidar_Click" Text="validar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="BtnAgregarDireccion" runat="server" CssClass="btn btn-success" Text="Agregar" ValidationGroup="GrpObligatorio"></asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript" language="javascript">
function ValidaCantidad(input, valorInicial) {
var ValorActual = input.value;
if (ValorActual > valorInicial) {
//alert("El valor no puede ser mayor a la cantidad inicial: " + valorInicial);
input.value = valorInicial;
}
}
function ImprimirTraslado(clave) {
$get('BtnImprimirTraspaso').click();
}
function Focus() {
$('#TxtCodigoPS').focus()
}
function Focus1() {
$('#TxtCodigoPSRecepcion').focus()
}
function Focus2() {
$('#TxtSeriePSRecepcion').focus()
}
function playsonidito(NomArchivo) {
var URL = /Sonidos/ + NomArchivo
var snd = new Audio(URL);
snd.play();
snd.currentTime = 0;
}
//EXISTENCIAS ALMACEN
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
var $this = $(this);
var ind = $this.index();
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
//log($this);
});
var scrollfuncion = function () {
var stop = this.scrollTop;
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
}
function CargaExistenciaAlmacenes(data, params) {
var div = $('<div class="select2anothertable"></div>');
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
var table = $('<table></table>'); div.append(table);
var tbody = $('<tbody></tbody>'); table.append(tbody);
$(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
$(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
var indexd = 0;
data.forEach(function (item) {
if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); }
}
}
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td ' + ((item[key] > 0) ? 'style = "font-weight:bold;"' : '') + '>' + item[key] + '</td>'); tr.append(td); }
}
indexd += 1;
});
}
</script>
</asp:Content>

File diff suppressed because it is too large Load Diff

View File

@@ -156,7 +156,8 @@
Salario<br />diario Salario<br />diario
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label ID="TxtsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:Label> <asp:Label ID="lblsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:Label>
<asp:TextBox ID="TxtsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:TextBox>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dSala" /> <ItemStyle HorizontalAlign="Right" CssClass="dSala" />
</asp:TemplateField> </asp:TemplateField>

View File

@@ -295,8 +295,8 @@ public partial class Nomina_Aguinaldo : ClsPaginas
objNomina.RollBack(); objNomina.RollBack();
} }
objNomina.Dispose(); objNomina.Dispose();
} }
} }
@@ -324,10 +324,20 @@ public partial class Nomina_Aguinaldo : ClsPaginas
if (e.Row.RowType == DataControlRowType.DataRow) if (e.Row.RowType == DataControlRowType.DataRow)
{ {
int CveNomina = e.Row.DBCampo("CveNomina").ToString().ToEntero(); int CveNomina = e.Row.DBCampo("CveNomina").ToString().ToEntero();
int CvePersonal = e.Row.DBCampo("CvePersonal").ToString().ToEntero();
if (CveNomina > 0) if (CveNomina > 0)
{ {
e.Row.CssClass = "success"; e.Row.CssClass = "success";
} }
if (UsuarioActual.CveEmpresa == 154 || UsuarioActual.CveEmpresa == 153)
{
e.Row.FCTextBox("TxtsueldoDiario").Visible = (CvePersonal > 0);
e.Row.FCLabel("lblsueldoDiario").Visible = false;
}else
{
e.Row.FCTextBox("TxtsueldoDiario").Visible = false;
e.Row.FCLabel("lblsueldoDiario").Visible = true;
}
} }
} }
@@ -382,7 +392,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{ {
CveSubProyecto = gvrow.DataKey("CveSubProyecto").ToEntero(); CveSubProyecto = gvrow.DataKey("CveSubProyecto").ToEntero();
CvePersonal = gvrow.DataKey("CvePersonal").ToEntero(); CvePersonal = gvrow.DataKey("CvePersonal").ToEntero();
salariodiario = gvrow.FCLabel("TxtsueldoDiario").Text.ToDecimal(); salariodiario = gvrow.FCTextBox("TxtsueldoDiario").Text.ToDecimal();
diaslaborados = gvrow.FCLabel("TxtdiasLaborados").Text.ToDecimal(); diaslaborados = gvrow.FCLabel("TxtdiasLaborados").Text.ToDecimal();
diasaguinaldo = gvrow.FCLabel("TxtdiasAguinaldo").Text.ToDecimal(); diasaguinaldo = gvrow.FCLabel("TxtdiasAguinaldo").Text.ToDecimal();
descuento = gvrow.FCTextBox("TxtDescuento").Text.ToDecimal(); descuento = gvrow.FCTextBox("TxtDescuento").Text.ToDecimal();
@@ -573,7 +583,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
libro.Cell(fila, 1).Value = gvrow.FCLabel("lblnombreCompleto").Text; libro.Cell(fila, 1).Value = gvrow.FCLabel("lblnombreCompleto").Text;
libro.Cell(fila, 2).Value = gvrow.FCLabel("lblfechaingreso").Text; libro.Cell(fila, 2).Value = gvrow.FCLabel("lblfechaingreso").Text;
libro.Cell(fila, 3).Value = gvrow.FCLabel("TxtsueldoDiario").Text.ToDecimal(); libro.Cell(fila, 3).Value = gvrow.FCTextBox("TxtsueldoDiario").Text.ToDecimal();
libro.Cell(fila, 4).Value = gvrow.FCLabel("TxtdiasLaborados").Text.ToDecimal(); libro.Cell(fila, 4).Value = gvrow.FCLabel("TxtdiasLaborados").Text.ToDecimal();
libro.Cell(fila, 5).Value = gvrow.FCLabel("TxtdiasAguinaldo").Text.ToDecimal(); libro.Cell(fila, 5).Value = gvrow.FCLabel("TxtdiasAguinaldo").Text.ToDecimal();
libro.Cell(fila, 6).Value = gvrow.FCLabel("lbldiasAguinaldoprop").Text.ToDecimal(); libro.Cell(fila, 6).Value = gvrow.FCLabel("lbldiasAguinaldoprop").Text.ToDecimal();
@@ -645,7 +655,7 @@ class ClsClaseBaseD : IDisposable
// REGISTRAR CONEXIÓN // REGISTRAR CONEXIÓN
private int CveConexion = 0; private int CveConexion = 0;
public ClsClaseBaseD(ClsClaseBaseD adsObj = null, SqlTransaction sqlTransacc = null, SqlDataAdapter sqlAdapter =null) public ClsClaseBaseD(ClsClaseBaseD adsObj = null, SqlTransaction sqlTransacc = null, SqlDataAdapter sqlAdapter = null)
{ {

View File

@@ -0,0 +1,95 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CalculoISRAnual.aspx.cs" Inherits="Nomina_CalculoISRAnual" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
<style >
.GVCalculoISRAnual tr td:nth-child(n+4){
text-align :right;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Calculo ISR anual
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<li>
<asp:LinkButton ID="LnkdownExcel" OnClick="LnkdownExcel_Click" runat="server"><i class="fa fa-download" aria-hidden="true"></i>Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="upDatos" runat ="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:GridView ID="GVCalculoISRAnual" runat="server" GridLines="None" CssClass ="table table-hover table-striped ScrollAD GVCalculoISRAnual Widthall" AutoGenerateColumns="False"
datakeynames="CvePersonal,Codigo,NombreCompleto,TipoIngreso,FechaInicio,IngresosTotales,BaseGravada,Deducciones,ISRRetenido,Art152,SubsCorrespondiente,LimiteInferior,LimiteSuperior,CuotaFija,Porcentaje,ImpuestoAnual,Acargo,Acompensar">
<Columns>
<asp:TemplateField HeaderText="Código">
<ItemTemplate>
<asp:Label ID="lblcodigo" runat="server" Text='<%# Eval("Codigo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre ">
<ItemTemplate>
<asp:Label ID="lblnombreCompleto" runat="server" Text='<%# Eval("NombreCompleto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Ingreso">
<ItemTemplate>
<asp:Label ID="lblfechaInicio" runat="server" Text='<%# string.Format("{0} - {1:dd/MM/yyyy}",Eval("TipoIngreso"), Eval("FechaInicio"))%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ingresos Totales">
<ItemTemplate>
<asp:Label ID="lblingresosTotales" runat="server" Text='<%# Eval("IngresosTotales","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Base Gravada">
<ItemTemplate>
<asp:Label ID="lblbaseGravada" runat="server" Text='<%# Eval("BaseGravada","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ISRRetenido">
<ItemTemplate>
<asp:Label ID="lbliSRRetenido" runat="server" Text='<%# Eval("ISRRetenido","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Art152">
<ItemTemplate>
<asp:Label ID="lblart152" runat="server" Text='<%# Eval("Art152","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Subs Correspondiente">
<ItemTemplate>
<asp:Label ID="lblsubsCorrespondiente" runat="server" Text='<%# Eval("SubsCorrespondiente","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto Anual">
<ItemTemplate>
<asp:Label ID="lblimpuestoAnual" runat="server" Text='<%# Eval("ImpuestoAnual","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acargo">
<ItemTemplate>
<asp:Label ID="lblacargo" runat="server" Text='<%# Eval("Acargo","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acompensar">
<ItemTemplate>
<asp:Label ID="lblacompensar" runat="server" Text='<%# Eval("Acompensar","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Nomina_CalculoISRAnual : ClsPaginas
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaCalculoISRAnual();
}
}
protected void CargaCalculoISRAnual()
{
using (ClsNominas onom = new ClsNominas())
{
onom.CalculoISRAnual(2021, UsuarioActual.Empresa.CveEmpresa);
GVCalculoISRAnual.DataSource = onom.DtResultados;
}
GVCalculoISRAnual.DataBind();
upDatos.Update();
}
protected void LnkdownExcel_Click(object sender, EventArgs e)
{
}
}

View File

@@ -382,6 +382,18 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
} }
if (continuar) if (continuar)
{ {
using (ClsClaseBase objbase = new ClsClaseBase())
{
/*
INSERT INTO Gral_HistorialBitacora(CvePersonal,CveConceptoHistorialBitacora,Descripcion,Motivo,CveUsuario,CveEmpresa,Fecha,Actual)
SELECT CvePersonal, 384,'se ingreso asistencia manual','se ingreso asistencia manual',100,@CveEmpresa,MIN(CAST(Fecha AS DATE))
*/
objbase.runQuerystr(string.Format("INSERT INTO Gral_HistorialBitacora(CvePersonal,CveConceptoHistorialBitacora,Descripcion,Motivo,CveUsuario,CveEmpresa,Fecha,Actual)SELECT {0}, 384,'SE INGRESO ASISTENCIA MANUAL','SE INGRESO ASISTENCIA MANUAL',{3},{2},'{1:yyyy/MM/dd}','Asistió'",
DdlmcPersonal.SelectedValue.ToEntero(), fechaing, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario));
}
Alert(string.Format("La asistencia se a agregado ({0:dd-MM-yyyy HH:mm:ss}).", fechaing), ModExtensiones.TipoMensaje.ToastInformacion); Alert(string.Format("La asistencia se a agregado ({0:dd-MM-yyyy HH:mm:ss}).", fechaing), ModExtensiones.TipoMensaje.ToastInformacion);
} }
if (!chkcontinuarAgregando.Checked) if (!chkcontinuarAgregando.Checked)

View File

@@ -23,19 +23,22 @@
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<li> <li>
<asp:LinkButton ID="LnkDescargar" OnClick="LnkDescargar_Click" runat="server"><i class="fa fa-ad-excel"></i> Descargar</asp:LinkButton> <asp:LinkButton ID="LnkDescargar" OnClick="LnkDescargar_Click" runat="server"><i class="fa fa-ad-excel"></i> Descargar</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkGuardarCambios" OnClick="LnkGuardarCambios_Click" runat="server"><i class="fa fa-save"></i> Guardar</asp:LinkButton> <asp:LinkButton ID="LnkGuardarCambios" OnClick="LnkGuardarCambios_Click" runat="server"><i class="fa fa-save"></i> Guardar</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="Lnkmostrararchivos" OnClick="Lnkmostrararchivos_Click" runat="server"><i class="fa fa-save"></i> Mostrar archivos</asp:LinkButton>
</li>
<li style="display: none">
<asp:LinkButton ID="LnkDownArchivosSua" OnClick="LnkDownArchivosSua_Click" runat="server"><i class="fa fa-download"></i> Descargar Archivos IDSE</asp:LinkButton> <asp:LinkButton ID="LnkDownArchivosSua" OnClick="LnkDownArchivosSua_Click" runat="server"><i class="fa fa-download"></i> Descargar Archivos IDSE</asp:LinkButton>
</li> </li>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkDescargar" /> <asp:PostBackTrigger ControlID="LnkDescargar" />
<%-- <asp:PostBackTrigger ControlID="LnkListaRaya" /> --%> <%-- <asp:PostBackTrigger ControlID="LnkListaRaya" /> --%>
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Content> </asp:Content>
@@ -53,7 +56,7 @@
<div class="row"> <div class="row">
<asp:Label ID="Label1" runat="server" CssClass="col-md-1 ">Tipo :</asp:Label> <asp:Label ID="Label1" runat="server" CssClass="col-md-1 ">Tipo :</asp:Label>
<div class="col-md-3" id="Div1" runat="server"> <div class="col-md-3" id="Div1" runat="server">
<asp:DropDownList ID="DdlTipo" runat="server"> <asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control select2me">
<asp:ListItem Value="1" Text="Cambio en salario variable" Selected="True"></asp:ListItem> <asp:ListItem Value="1" Text="Cambio en salario variable" Selected="True"></asp:ListItem>
<asp:ListItem Value="2" Text="modificación de salario"></asp:ListItem> <asp:ListItem Value="2" Text="modificación de salario"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
@@ -386,7 +389,7 @@
</ajax:TabPanel> </ajax:TabPanel>
<ajax:TabPanel ID="TabDetalleParteVariable" runat="server" HeaderText="Detalle parte variable"> <ajax:TabPanel ID="TabDetalleParteVariable" runat="server" HeaderText="Detalle parte variable">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GVDetalleParteVariable" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" ></asp:GridView> <asp:GridView ID="GVDetalleParteVariable" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall"></asp:GridView>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
</ajax:TabContainer> </ajax:TabContainer>
@@ -498,6 +501,59 @@
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="ModalDoctos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" style="width: 700px;">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Documentos Generados</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalDoctos" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVDoctos" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
DataKeyNames="nombrearchivo,ruta" ShowHeaderWhenEmpty="true" EmptyDataText="No se encontr">
<Columns>
<asp:TemplateField HeaderText="Documento">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("nombrearchivo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Generado" ItemStyle-Width="110">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("fecha","{0:dd/MM/yyyy HH}:{0:mm}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script> <script>

View File

@@ -41,9 +41,9 @@ public partial class RH_CalculoSBC : ClsPaginas
GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0]; GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0];
GVCFija.DataSource = objnom.DTSetResultados.Tables[0]; GVCFija.DataSource = objnom.DTSetResultados.Tables[0];
GVPV.DataSource = objnom.DTSetResultados.Tables[0]; GVPV.DataSource = objnom.DTSetResultados.Tables[0];
if (objnom.DTSetResultados.Tables.Count >1) if (objnom.DTSetResultados.Tables.Count > 1)
{ {
dtDetalleParteVariable=objnom.DTSetResultados.Tables[1]; dtDetalleParteVariable = objnom.DTSetResultados.Tables[1];
GVDetalleParteVariable.DataSource = dtDetalleParteVariable; GVDetalleParteVariable.DataSource = dtDetalleParteVariable;
GVDetalleParteVariable.DataBind(); GVDetalleParteVariable.DataBind();
} }
@@ -63,7 +63,7 @@ public partial class RH_CalculoSBC : ClsPaginas
//string movtosBajas = ""; //string movtosBajas = "";
using (ClsRH ObjPersonal = new ClsRH()) using (ClsRH ObjPersonal = new ClsRH())
{ {
if (ObjPersonal.GetMovimientosToSUA(UsuarioActual.CveEmpresa, "2021-03-01", "2021-03-03")) if (ObjPersonal.GetMovimientosToSUA(UsuarioActual.CveEmpresa, TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy-MM-dd"), TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy-MM-dd")))
{ {
////01: MovtosAfil ////01: MovtosAfil
//concater = ""; //concater = "";
@@ -105,6 +105,34 @@ public partial class RH_CalculoSBC : ClsPaginas
//} //}
} }
string rutarchivos = string.Format("{0}\\modificacionsalarios\\", UsuarioActual.Empresa.RutaArchivos);
if (!System.IO.Directory.Exists(rutarchivos))
{
System.IO.Directory.CreateDirectory(rutarchivos);
}
string namearchivoO = TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy-MM-dd");
string namearchivo = namearchivoO;
int contadorz = 1;
while (System.IO.File.Exists(string.Format("{0}{1}", rutarchivos, namearchivo)))
{
namearchivo = string.Format("{0}({1})", namearchivoO, contadorz++);
}
System.IO.StreamWriter archivoW = null;
try { archivoW = new System.IO.StreamWriter(string.Format("{0}{1}", rutarchivos, namearchivo), true, System.Text.Encoding.UTF8); } catch (Exception) { }
if (archivoW != null)
{
try { archivoW.WriteLine(MovtosmodSalario); } catch (Exception) { }
try
{
archivoW.Close();
archivoW.Dispose();
}
catch (Exception) { }
}
RegistraScript(string.Format("SaveCsv(\"MovtosmodSalario{1:ddMMMyyyy}.txt\", '{0}');", MovtosmodSalario, TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy"))); RegistraScript(string.Format("SaveCsv(\"MovtosmodSalario{1:ddMMMyyyy}.txt\", '{0}');", MovtosmodSalario, TxtFechaPago.Text.ToDateTimeExcat("dd/MM/yyyy")));
//RegistraScript(string.Format("SaveCsv(\"MovtosAfil.txt\", '{0}');SaveCsv(\"MovtosmodSalario.txt\", '{1}');SaveCsv(\"movtosBajas.txt\", '{2}');", MovtosAfil.Replace("'", "\\'"), MovtosmodSalario.Replace("'", "\\'"), movtosBajas.Replace("'", "\\'"))); //RegistraScript(string.Format("SaveCsv(\"MovtosAfil.txt\", '{0}');SaveCsv(\"MovtosmodSalario.txt\", '{1}');SaveCsv(\"movtosBajas.txt\", '{2}');", MovtosAfil.Replace("'", "\\'"), MovtosmodSalario.Replace("'", "\\'"), movtosBajas.Replace("'", "\\'")));
//RegistraScript("$('#DmodalGetSua').modal('hide');"); //RegistraScript("$('#DmodalGetSua').modal('hide');");
@@ -138,7 +166,7 @@ public partial class RH_CalculoSBC : ClsPaginas
} }
else else
{ {
objrh.RollBack (); objrh.RollBack();
} }
} }
if (continuar) if (continuar)
@@ -160,7 +188,7 @@ public partial class RH_CalculoSBC : ClsPaginas
protected void LnkDescargar_Click(object sender, EventArgs e) protected void LnkDescargar_Click(object sender, EventArgs e)
{ {
DataTable dt = GVToDT(GVCalculosSBC,"Salario"); DataTable dt = GVToDT(GVCalculosSBC, "Salario");
DataTable dtPF = GVToDT(GVCFija, "Parte fija"); DataTable dtPF = GVToDT(GVCFija, "Parte fija");
DataTable dtPV = GVToDT(GVPV, "Parte variable"); DataTable dtPV = GVToDT(GVPV, "Parte variable");
dtDetalleParteVariable.TableName = "Detalle parte variable"; dtDetalleParteVariable.TableName = "Detalle parte variable";
@@ -203,7 +231,7 @@ public partial class RH_CalculoSBC : ClsPaginas
libro.Range(7, 6, 7 + dt.Rows.Count, 12).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; libro.Range(7, 6, 7 + dt.Rows.Count, 12).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right;
libro.Range(7, 6, 7+ dt.Rows.Count, 12).Style.NumberFormat.Format = "$##,###,###,0.00"; libro.Range(7, 6, 7 + dt.Rows.Count, 12).Style.NumberFormat.Format = "$##,###,###,0.00";
@@ -228,10 +256,11 @@ public partial class RH_CalculoSBC : ClsPaginas
} }
public string limpiarcelda( string celdatext) public string limpiarcelda(string celdatext)
{ {
celdatext = celdatext.Replace("<br />", "\r\n").Replace(" ", " "); celdatext = celdatext.Replace("<br />", "\r\n").Replace(" ", " ");
while (celdatext.Contains(" ")){ while (celdatext.Contains(" "))
{
celdatext = celdatext.Replace(" ", " "); celdatext = celdatext.Replace(" ", " ");
} }
celdatext = celdatext.Replace("\n ", " "); celdatext = celdatext.Replace("\n ", " ");
@@ -250,7 +279,7 @@ public partial class RH_CalculoSBC : ClsPaginas
foreach (TableCell cell in GridView.HeaderRow.Cells) foreach (TableCell cell in GridView.HeaderRow.Cells)
{ {
string titulo = HttpUtility.HtmlDecode(Extensiones.ModExtensiones.TextoCelda(cell)).Trim(); string titulo = HttpUtility.HtmlDecode(Extensiones.ModExtensiones.TextoCelda(cell)).Trim();
titulo = limpiarcelda( titulo); titulo = limpiarcelda(titulo);
if (GridView.Columns.Count > i && GridView.Columns[i].Visible && titulo.Length > 0) if (GridView.Columns.Count > i && GridView.Columns[i].Visible && titulo.Length > 0)
{ {
if (dt.Columns.Contains(titulo)) if (dt.Columns.Contains(titulo))
@@ -275,4 +304,33 @@ public partial class RH_CalculoSBC : ClsPaginas
} }
return dt; return dt;
} }
protected void Lnkmostrararchivos_Click(object sender, EventArgs e)
{
string rutarchivos = string.Format("{0}\\modificacionsalarios\\", UsuarioActual.Empresa.RutaArchivos);
List<archivosD> lisaarchivos = new List<archivosD>();
foreach (var urfile in System.IO.Directory.GetFiles(rutarchivos, "*"))
{
if (urfile.Replace(rutarchivos, "").Length > 9)
{
string cfecha = urfile.Replace(rutarchivos, "").Substring(0, 10).ToDateTime().ToString("dd/MM/yyyy");
archivosD arch = new archivosD() { nombrearchivo = cfecha, ruta = urfile, fecha= System.IO.File.GetCreationTime(urfile) };
lisaarchivos.Add(arch);
}
}
GVDoctos.DataSource = lisaarchivos;
GVDoctos.DataBind();
UpModalDoctos.Update();
RegistraScript("$('#ModalDoctos').modal();");
}
}
public class archivosD
{
public string nombrearchivo { get; set; }
public string ruta { get; set; }
public DateTime fecha { get; set; }
} }

View File

@@ -835,7 +835,7 @@ Partial Class RH_Personal
CargaRiesgoPuesto() CargaRiesgoPuesto()
CargaBancos() CargaBancos()
CargaSubProyectosZona() CargaSubProyectosZona()
CargaEstados(1) CargaEstados(151)
CargaMonedas() CargaMonedas()
CargaSuperioresOrganigrama() CargaSuperioresOrganigrama()
CargaUsuariosNomina() CargaUsuariosNomina()

File diff suppressed because it is too large Load Diff

View File

@@ -800,20 +800,31 @@ Partial Class Ventas_ClientesAbonar
Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False)
Dim TipoCambioFluctuacion As Decimal = 1 Dim TipoCambioFluctuacion As Decimal = 1
Dim FechaUltimaFluctuacion As Date = MinFecha Dim FechaUltimaFluctuacion As Date = MinFecha
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
End If
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
dtConceptos = ObjMov.DtResultados dtConceptos = ObjMov.DtResultados
End If End If
@@ -2554,24 +2565,35 @@ Partial Class Ventas_ClientesAbonar
Dim CvePrePoliza As Integer = 0 Dim CvePrePoliza As Integer = 0
Dim MsgError As String = "" Dim MsgError As String = ""
Dim ObjIE As New ClsBancos 'Dim ObjIE As New ClsBancos
Dim FechaUltimaFluctuacion As Date = MinFecha Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1 Dim TipoCambioFluctuacion As Decimal = 1
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaIncobrable.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then Dim tFecha As Date = TxtFechaIncobrable.Text.ToDate
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
End If
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
End If End If
ObjIE.Dispose() 'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaIncobrable.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
'ObjIE.Dispose()
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)

View File

@@ -4388,7 +4388,7 @@ Partial Class Ventas
DdlTipoComprobante.Items.Insert(0, New ListItem("Devolucion", "Dev")) DdlTipoComprobante.Items.Insert(0, New ListItem("Devolucion", "Dev"))
HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto"))))
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
ViewState("CveDevolucion") = DbRowVenta("CveVentaPadre").ToString().ToEntero() 'ViewState("CveDevolucion") = DbRowVenta("CveVentaPadre").ToString().ToEntero()
Trsaldo.Visible = True Trsaldo.Visible = True
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
@@ -6286,7 +6286,7 @@ Partial Class Ventas
Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595) Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595)
'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO 'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then
RBLPago.SelectedValue = "2" RBLPago.SelectedValue = "2"
RBLPago.Items(0).Enabled = False RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing) RBLPago_SelectedIndexChanged(Nothing, Nothing)
@@ -14620,20 +14620,31 @@ Partial Class Ventas
Dim FechaUltimaFluctuacion As Date = MinFecha Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1 Dim TipoCambioFluctuacion As Decimal = 1
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then Dim tFecha As Date = Now
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = Now 'gvr.DataKey("Fecha").ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
End If
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = Now 'gvr.DataKey("Fecha").ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
tipoCambioPago = 1 tipoCambioPago = 1
tipoCambioVenta = 1 tipoCambioVenta = 1
@@ -23949,6 +23960,7 @@ Partial Class Ventas
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < 1 Then If Existencia < 1 Then
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato},Serie:{Dr2("Serie").ToString()}")
Return False Return False
End If End If
@@ -23961,6 +23973,7 @@ Partial Class Ventas
Else Else
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then If Existencia < Cantidad Then
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato}")
Return False Return False
End If End If
@@ -24733,24 +24746,34 @@ Partial Class Ventas
Dim CvePrePoliza As Integer = 0 Dim CvePrePoliza As Integer = 0
Dim MsgError As String = "" Dim MsgError As String = ""
Dim ObjIE As New ClsBancos 'Dim ObjIE As New ClsBancos
Dim FechaUltimaFluctuacion As Date = MinFecha Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1 Dim TipoCambioFluctuacion As Decimal = 1
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaSaldarVenta.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then Dim tFecha As Date = TxtFechaSaldarVenta.Text.ToDate
FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
End If
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaSaldarVenta.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
ObjIE.Dispose() ' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
' ObjIE.Dispose()
Dim IdCtaContable As Integer = IdCtaContClientes Dim IdCtaContable As Integer = IdCtaContClientes
@@ -27733,20 +27756,29 @@ Partial Class Ventas
TipoCambioFactura = TxtTipoCambio.Text.ToDecimal TipoCambioFactura = TxtTipoCambio.Text.ToDecimal
If DdlMoneda.SelectedValue.ToEntero() > 1 Then If DdlMoneda.SelectedValue.ToEntero() > 1 Then
Dim ObjIE As New ClsBancos Dim tFecha As Date = TxtFecha.Text.ToDate
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFecha.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha > #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then
TipoCambioFactura = drr("TipoCambio").ToString().ToDecimal
End If
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion > tFecha Then
TipoCambioFactura = UltimaFluctuacion.TCFluctuacion
End If End If
End If End If
ObjIE.Dispose()
'Dim ObjIE As New ClsBancos
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFecha.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha > #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' TipoCambioFactura = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
'ObjIE.Dispose()
Else Else
TipoCambioFactura = 1 TipoCambioFactura = 1
End If End If