diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 23ef846b9..9845e2643 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -1463,7 +1463,7 @@ Public Class ClsClientes #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, 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 DataAdapter("PA_Vta_ClientesDireccionesEnvioAdd") @@ -1488,6 +1488,7 @@ Public Class ClsClientes .Add("@CveMunicipio", SqlDbType.Int).Value = CveMunicipio .Add("@CveLocalidad", SqlDbType.Int).Value = CveLocalidad .Add("@CveColonia", SqlDbType.Int).Value = CveColonia + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveDireccionEnvio", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index ab161ebc8..9f6902b8d 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -6543,6 +6543,47 @@ Public Class ClsContabilidad Return Retorno 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" ' IDisposable diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index 08b2a0361..a7c6401b3 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -246,14 +246,14 @@ Public Class ClsEdocumentacion End Try Return Retorno - End Function + End Function #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" - - - 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 DataAdapter("PA_Edoc_DocumentacionElectronicaGet") @@ -265,6 +265,7 @@ Public Class ClsEdocumentacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@Periodo", SqlDbType.Int).Value = Periodo .Add("@Modulo", SqlDbType.Int).Value = Modulo End With @@ -279,7 +280,7 @@ Public Class ClsEdocumentacion 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, - 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 @@ -298,6 +299,7 @@ Public Class ClsEdocumentacion .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@FechaLimite", SqlDbType.Date).Value = FechaLimite .Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia + .Add("@Periodo", SqlDbType.Int).Value = Periodo .Add("@CveDocumentacionElectronica", SqlDbType.Int).Direction = ParameterDirection.Output 'FechaVigencia End With @@ -534,6 +536,9 @@ Public Class ClsEdocumentacion Dim retorno As Boolean = False Try SqlAdapter.Fill(DSet) + If DSet.Tables.Count > 0 Then + Data = DSet.Tables(0) + End If retorno = True Catch ex As Exception retorno = False @@ -543,8 +548,64 @@ Public Class ClsEdocumentacion 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" - + 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 Dim retorno As Boolean = False DataAdapter("PA_Edoc_TableroMaterialidad", CommandType.StoredProcedure) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 3f019b83f..1f953f6de 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1734,7 +1734,7 @@ Public Class ClsGenerales Return Retorno - End Function + End Function Public Function GetTipoCambio(CveTipoCambio As Integer, Fecha As Date) As Boolean Dim Retorno = False @@ -1754,6 +1754,26 @@ Public Class ClsGenerales Return Retorno 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 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, Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0, - Optional CveEntregaAlmacen As Integer = -1, - Optional AplicaCP As Boolean = False) As Integer + Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Gral_TimbreAdd") @@ -3663,7 +3682,7 @@ Public Class ClsGenerales With SqlAdapter.SelectCommand.Parameters .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre .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("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -3785,13 +3804,17 @@ Public Class ClsGenerales .Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega .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("@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("@Distancia", SqlDbType.Int).Value = Distancia + + .Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite + + + .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index c0ab586d4..50259e4c7 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -241,7 +241,7 @@ Public Class ClsMovimientos Gpo As Integer, CveResponsable As Integer, 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 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 'Data = New DataTable @@ -274,7 +274,8 @@ Public Class ClsMovimientos .Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .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 Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 92cd449be..ed48b6e96 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2356,6 +2356,14 @@ Public Class ClsNominas Return retorno 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 Dim retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 4bb7de6c7..1bc365482 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -127,6 +127,47 @@ Public Class ClsPaginas End Set 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 + + 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 Get If GlobalTipoCambioEuro <= 0 Then @@ -4109,6 +4150,9 @@ Public Class ClsPaginas PaginaDict.Add("/Nomina/NomTimbrados.aspx".ToUpper(), 920) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) 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("/Nomina/FiniquitoB.aspx".ToUpper(), -1) ''CONFIGURACIONES GENERALES @@ -4944,6 +4988,7 @@ Public Class ClsPaginas PaginaDict.Add("/Inventarios/CatUnidades.aspx".ToUpper(), 2056) PaginaDict.Add("/Inventarios/EntregaAlmacenRuta.aspx".ToUpper(), 1320) 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/CatChecadorTipo.aspx".ToUpper(), 427) 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) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index d2496ee83..64d2400a6 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -5080,202 +5080,203 @@ Namespace Modelos If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then 'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES - For Each RowMovimiento As DataRow In DtSalidas.Rows - Dim CveConceptoMovimiento As Integer = -1 - Dim CveAlmacenMovimiento As Integer = -1 + If ObjFactura.TipoDocto <> "Rem" Then + For Each RowMovimiento As DataRow In DtSalidas.Rows + Dim CveConceptoMovimiento As Integer = -1 + Dim CveAlmacenMovimiento As Integer = -1 - Dim CveMovimientoDevolucion As Integer = 0 - Dim Folio As Integer = 0 + Dim CveMovimientoDevolucion As Integer = 0 + Dim Folio As Integer = 0 - Select Case RowMovimiento("CveConcepto").ToString().ToEntero() - Case 3 - CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE - CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() - Case 40 - CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA - CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() - Case 18 - CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA - CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() - ''SI TIENE REMISIONES RELACIONADAS - 'If DtRemisionesFacturadas.Rows.Count > 0 Then - ' Dim RowRemision As DataRow = DtExistencias.FiltroPrimero($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}") + Select Case RowMovimiento("CveConcepto").ToString().ToEntero() + Case 3 + CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE + CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() + Case 40 + CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA + CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() + Case 18 + CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA + CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() + ''SI TIENE REMISIONES RELACIONADAS + 'If DtRemisionesFacturadas.Rows.Count > 0 Then + ' 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 - ' If CancelarRemision Then - ' CveAlmacenDevolucion = RowRemision("CveAlmacenDevolucion").ToString().ToEntero() - ' Else - ' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero() - ' End If + ' 'SI LA REMISION SE VA A CANCELAR DEBE REGRESAR AL ALMACEN GENERAL + ' If CancelarRemision Then + ' CveAlmacenDevolucion = RowRemision("CveAlmacenDevolucion").ToString().ToEntero() + ' Else + ' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero() + ' End If - 'Else - ' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero() - 'End If - End Select + 'Else + ' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero() + 'End If + End Select - 'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION - 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) - 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 + 'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION + 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) + 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 - If CveMovimientoDevolucion > 0 Then - For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows + If CveMovimientoDevolucion > 0 Then + For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows - Dim FechaCaducidad As Date = MinFecha - If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then - If IsDate(Dr("FechaCaducidad")) Then - FechaCaducidad = Dr("FechaCaducidad").ToString().ToDate() + Dim FechaCaducidad As Date = MinFecha + If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then + If IsDate(Dr("FechaCaducidad")) Then + 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 - 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 + 'AGREGA BITACORA A VENTA + If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then + Dim MensajeBitacora = "Devuelta" + If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: {1}", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then + MensajeError = "Ocurrió un error al agregar la bitacora." ErrorCancelar = True - MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar." - Exit For + 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 - 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 + If ErrorCancelar Then + Exit For End If - 'AGREGA BITACORA A VENTA - If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then - Dim MensajeBitacora = "Devuelta" - If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: {1}", 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 - + Next + End If '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) If Not ErrorCancelar Then @@ -5314,6 +5315,40 @@ Namespace Modelos 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 If Not ErrorCancelar Then If Not GeneraMovimientosApartados(ObjInventario) Then diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index 5ef0ae6df..8dfb746a1 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -119,7 +119,8 @@ Public Class Timbres Dim Distancia As Integer = 1 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 Dim DtMovimientos As DataTable = Nothing @@ -144,20 +145,20 @@ Public Class Timbres End If If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then - DtMovimientos = ObjGrales.DtResultados - Else - TieneError = True - _MsgError.AppendLine("Error al obtener Movimientos") - End If + DtMovimientos = ObjGrales.DtResultados + Else + TieneError = True + _MsgError.AppendLine("Error al obtener Movimientos") + 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.SetSubProyectoMatriz() + ObjFactura.SetSubProyecto() + ObjFactura.SetSubProyectoMatriz() If AplicaCP Then @@ -331,15 +332,17 @@ Public Class Timbres _MsgError.AppendLine("timbrado son detalle de productos") End If - End If + End If - Else - TieneError = True + Else + TieneError = True _MsgError.AppendLine("Consultar datos de timbrado") End If ObjGrales.Dispose() - + Else + Timbre = Nothing + _MsgError.AppendLine("Consultar datos de timbrado") End If Return Timbre End Function diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 9250a2f5f..a0b88fb36 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -117,11 +117,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Case "sendMailLPM" context.Response.Write(sendMailLPM(context)) Case "getSATColomias" - getSATColonias(context) - Case "GetFilesDirectory" + getSatColonias(context) + Case "GetFilesDirectory" GetFilesDirectory(context) Case "Getetiquetas" Getetiquetas(context) + Case "cancelarRemision" + cancelarRemision(context) End Select Catch ex As Exception ex.GuardaLog(ex.Message) @@ -1599,4 +1601,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Return retorno End Function #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 \ No newline at end of file diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 93673c3d1..19dc04717 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -1,593 +1,600 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FluctuacionCambiaria.aspx.vb" Inherits="Bancos_FluctuacionCambiaria" %> - - - - - - - - - - Fluctuación Cambiaria - - - - - - -
-
-
- - -
-
- -
-
- - - - -
- - - - - - -
-
-
TC:
-
-
- -
- -
-
-
-
-
-
- -
-
-
-
-
- - - - - - - -
-
-
-

PÉRDIDA

-
- -
- MXN - - - -
-
-
-
-
-
-

GANANCIA

-
- -
-
-
- MXN - - - -
-
-
-
-
-
-
-
-

-
- -
-
-
- MXN - - - -
-
-
-
-
-
-
-
-
-
- - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FluctuacionCambiaria.aspx.vb" Inherits="Bancos_FluctuacionCambiaria" %> + + + + + + + + + + Fluctuación Cambiaria + + + + + + +
+
+
+ + +
+
+ +
+ + +
+ +
+ + +
+
+
TC:
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+
+ + + + + + + +
+
+
+

PÉRDIDA

+
+ +
+ MXN + + + +
+
+
+
+
+
+

GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+

+

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+
+
+ +
- +
- - - - -
- -
- - - - - -
- -
- + + + +
-
- - - - -
- - - - - - - - - - - <%----%> -
-
- - - - -
-
-
-

PÉRDIDA

-
- -
- MXN - - - -
-
-
-
-
-
-

GANANCIA

-
- -
-
-
- MXN - - - -
-
-
-
-
-
-
-
-

-
- -
-
-
- MXN - - - -
-
-
-
-
-
-
-
-
- - -
+
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + + + + + + + + + <%----%> +
+
+ + + + +
+
+
+

PÉRDIDA

+
+ +
+ MXN + + + +
+
+
+
+
+
+

GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+

+

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+
+ + +
-
- - - - -
- -
- - - - - -
- - - -
- +
+ + + +
-
- -
- - - - - - - - - - - - - - - - - - - - - -
+
+ + + + + +
+ + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + +
+
+ + + +
-
- - - - -
- -
- - - - - -
- - - -
- +
+ + + +
-
- - - -
- + + + + + +
+ + + +
+ +
+ + + + + +
+ - - - - - - - - - - - - - - -
-
- - - - - - - -
+ Banco,NumCuenta,CveCuentaComplementaria,Saldo" + EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias" + CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> + + + + + + + + + + + + + + +
+
+ + + + + + + +
-
- - - - -
+
+ + + + +
-
- +
+ - - - -
+ + + +
-
- +
+
- -
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - - -
+
-
- + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + + +
+ +
+ - - - -
- - - -
- -
-
-
- - - - - - - - - - - - - -
-
- - - -
-
- -
- - - - -
- -
- - - - - -
+ + + +
-
- -
-
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - - + +
+ +
+
+
+ + + + + + + + + + + + + +
+
+ + + +
+
+ +
+ + + + +
+ +
+ + + + + +
+ + +
+ +
+
+ +
+ + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index bbc74193e..720450601 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -2,10 +2,18 @@ Option Strict On Imports System.Data +Imports System.Globalization Imports Extensiones Partial Class Bancos_FluctuacionCambiaria 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" Private Property LblTotal() As String Get @@ -19,7 +27,7 @@ Partial Class Bancos_FluctuacionCambiaria Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then - + CargaFechas() CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "") CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "") CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "") @@ -32,6 +40,27 @@ Partial Class Bancos_FluctuacionCambiaria End Sub #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 CargaTipoCambio() @@ -47,36 +76,52 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaTipoCambio() Dim ObjGenerales As New ClsGenerales - ObjGenerales.GetTipoCambio(-1, TxtFecha.Text.ToDate) + ObjGenerales.GetTipoCambio(-1, FechaUltimoDiaMes) If ObjGenerales.DtResultados.Rows.Count > 0 Then LtTipoCambioActual.Text = ObjGenerales.DtResultados.Rows(0)("TipoCambio").ToString - TxtConceptoFluctuacion.Text = "Fluctuación a " & TxtFecha.Text + TxtConceptoFluctuacion.Text = "Fluctuación a " & FechaUltimoDiaMes.ToShortDateString() End If ObjGenerales.Dispose() End Sub Private Sub CargaUltimaFluctuacion() - Dim Obj As New ClsBancos - If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then - Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC") - If dt.Rows.Count > 0 Then - 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 - If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then - TxtFecha.Text = Now.ToShortDateString - Else - TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString() - End If - End If + 'Dim Obj As New ClsBancos + 'If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then + ' Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC") + ' If dt.Rows.Count > 0 Then + ' 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 + ' If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then + ' TxtFecha.Text = Now.ToShortDateString + ' Else + ' TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString() + ' 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 - Obj.Dispose() + CargaTipoCambio() End Sub Private Sub CargaDatosCompra() Dim ObjBancos As New ClsBancos '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 'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ") @@ -110,7 +155,7 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaDatosVentas() Dim ObjBancos As New ClsBancos 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 Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") @@ -142,7 +187,7 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaDatosCuentas() Dim ObjBancos As New ClsBancos 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 TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal Dim TotAcumulado As Decimal = 0 @@ -151,7 +196,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero 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 Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal End If @@ -162,7 +207,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim SaldoActualContabilidad As Decimal = 0 Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero 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 SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal End If @@ -189,7 +234,7 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaDatosDeudores() Dim ObjBancos As New ClsBancos 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 LblTotalDeudores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else @@ -203,7 +248,7 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaDatosAcreedores() Dim ObjBancos As New ClsBancos 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 LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else @@ -217,7 +262,7 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaDatosFiliales() Dim ObjBancos As New ClsBancos 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") LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else @@ -237,15 +282,17 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim Conta As New ClsContabilidad 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 CveCuenta As Integer = 0 + Dim CveCuentaPerdida, CveCuentaGanancia As Integer Dim idCtaPerdida, IdCtaGanancia As Integer + Dim TipoMovto As Boolean = False Dim CveConceptoContable As Integer = 0 - Dim CveCuentaComplementaria As Integer = 55175 - Dim IdCtaComplementaria As Integer = 1248 + Dim IdCtaComplementaria As Integer = 0 + Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 @@ -257,19 +304,17 @@ Partial Class Bancos_FluctuacionCambiaria Total = LblTotal.ToDecimal If Total > 0 Then CveConceptoContable = 64 - CveCuenta = CveCuentaGanancia idCta = IdCtaGanancia TipoMovto = True Else CveConceptoContable = 65 - CveCuenta = CveCuentaPerdida idCta = idCtaPerdida TipoMovto = False 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), CveCuenta:=CveCuenta, 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), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then ErrorRegistrar = True End If @@ -279,12 +324,18 @@ Partial Class Bancos_FluctuacionCambiaria Total = gvr.DataKey("Fluctuacion").ToDecimal 'si es pérdida o ganancia - + IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() '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 Exit For + End If + + If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then + ErrorRegistrar = True + Exit For End If + Next If Not ErrorRegistrar Then @@ -311,16 +362,18 @@ Partial Class Bancos_FluctuacionCambiaria Dim idCtaPerdida, IdCtaGanancia As Integer Dim TipoMovto As Boolean = False Dim CveConceptoContable As Integer = 0 - Dim CveCuentaComplementaria As Integer = 54141 - Dim IdCtaComplementaria As Integer = 70 + Dim IdCtaComplementaria As Integer = 0 Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 CveCuentaGanancia = 0 ' 55382 idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 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 If Total > 0 Then CveConceptoContable = 64 @@ -341,7 +394,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim Conta As New ClsContabilidad 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 ErrorRegistrar = True @@ -353,14 +406,21 @@ Partial Class Bancos_FluctuacionCambiaria For Each gvr As GridViewRow In GvVentas.Rows Total = -gvr.DataKey("Fluctuacion").ToDecimal + IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() + If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then CveConconceptoCliente = 226 Else CveConconceptoCliente = 203 End If + If Not Conta.UpdateVentaTCValuacion(gvr.DataKey("CveVenta").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then + ErrorRegistrar = True + Exit For + End If + '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 Exit For End If @@ -395,9 +455,9 @@ Partial Class Bancos_FluctuacionCambiaria Dim CveConceptoContable As Integer = 0 Dim ErrorRegistrar As Boolean = False 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 @@ -477,7 +537,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim Conta As New ClsContabilidad 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 CveCuenta As Integer = 0 Dim CveCuentaPerdida, CveCuentaGanancia As Integer @@ -494,7 +554,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.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 @@ -553,7 +613,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) 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 CveCuenta As Integer = 0 Dim CveCuentaPerdida, CveCuentaGanancia As Integer @@ -572,7 +632,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.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 For Each gvr As GridViewRow In GvFiliales.Rows @@ -646,7 +706,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim Conta As New ClsContabilidad 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 CveCuenta As Integer = 0 Dim CveCuentaPerdida, CveCuentaGanancia As Integer diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index f24961ea0..0a09a646e 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -5832,7 +5832,14 @@ Partial Class Bancos_IE Else If CveIE > 0 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 diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 051bce60d..654746115 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -637,7 +637,7 @@ Partial Class Bancos_PopIECompras CveMonedaCompra = dr("CveMoneda").ToString.ToEntero CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero 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)) CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero @@ -1474,6 +1474,14 @@ Partial Class Bancos_PopIECompras Dim CveCuentaContabilizacion As Long = 1 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 If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos tipoCambioPago = 1 @@ -1491,6 +1499,13 @@ Partial Class Bancos_PopIECompras tipoCambioPago = TxtTipoCambio.Text.ToDecimal tipoCambioCompra = 1 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 Select Case RBLContado.SelectedValue @@ -1569,17 +1584,17 @@ Partial Class Bancos_PopIECompras ImporteMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMX = ImporteMovimiento ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) End If ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMX = ImporteMX.RoundSQL - TimpocambioGeneral = tipoCambioCompra + TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) CveIE = rw.DataKey("CveIE").ToString.ToEntero If CveMonedaCompra <> 1 Then @@ -1617,17 +1632,17 @@ Partial Class Bancos_PopIECompras ImporteMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMX = ImporteMovimiento ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) End If ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMX = ImporteMX.RoundSQL - TimpocambioGeneral = tipoCambioCompra + TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) CveIE = rw.DataKey("CveIE").ToString.ToEntero If CveMonedaCompra <> 1 Then @@ -1640,14 +1655,14 @@ Partial Class Bancos_PopIECompras IdCtaContable = CtaProveedor 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" End If If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then IdCtaContable = IdCtaContComplementaria 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" End If End If @@ -1664,13 +1679,13 @@ Partial Class Bancos_PopIECompras ImporteMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMX = ImporteMovimiento ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) End If ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMX = ImporteMX.RoundSQL @@ -1686,14 +1701,14 @@ Partial Class Bancos_PopIECompras IdCtaContable = CtaProveedor 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" End If If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then IdCtaContable = IdCtaContComplementaria 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" End If End If @@ -1710,13 +1725,13 @@ Partial Class Bancos_PopIECompras ImporteMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago ImporteMX = ImporteMovimiento ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) End If ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMX = ImporteMX.RoundSQL @@ -1731,14 +1746,14 @@ Partial Class Bancos_PopIECompras IdCtaContable = CtaProveedor 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" End If If CveMonedaCompra = 2 Then IdCtaContable = IdCtaContComplementaria 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" End If End If @@ -1755,17 +1770,17 @@ Partial Class Bancos_PopIECompras ImporteMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = ImportePagado.ToString.ToDecimal / tipoCambioPago - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ImporteMovimiento = ImportePagado.ToString.ToDecimal * tipoCambioPago ImporteMX = ImporteMovimiento ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = ImportePagado.ToString.ToDecimal - ImporteMX = ImporteMovimiento * tipoCambioCompra + ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) End If ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMX = ImporteMX.RoundSQL - TimpocambioGeneral = tipoCambioCompra + TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) End If If CveMonedaCompra = 1 Then @@ -1773,7 +1788,7 @@ Partial Class Bancos_PopIECompras Else IdCtaContable = IdCtaContComplementaria 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" End If ImporteMX = ImporteMovimiento @@ -2557,9 +2572,10 @@ Partial Class Bancos_PopIECompras IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) TimpocambioGeneral = TCImpuestos + Dim tipoCambioCompraValuacion As Decimal = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra 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.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 @@ -2581,9 +2597,10 @@ Partial Class Bancos_PopIECompras If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria 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 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.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 diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 0467778a7..57ab71324 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -1513,20 +1513,30 @@ Partial Class Bancos_PopIEVentas Dim CuentasContablesInvalidasSIG As New StringBuilder Dim TipoCambioFluctuacion As Decimal = 1 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 - FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate - TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal - End If - End If + Dim tFecha As Date = TxtFechaDocumento.Text.ToDate + + Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) + + 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 + '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 tipoCambioPago = 1 diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index b7a2fad40..1ba70513e 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -924,20 +924,31 @@ Partial Class Bancos_ProveedoresAbonar Dim TipoCambioFluctuacion As Decimal = 1 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 - FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate - TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal - End If + Dim tFecha As Date = TxtFechaDocumento.Text.ToDate + Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) + 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 + '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 If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index fdb758268..bbeb59cd2 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -202,11 +202,62 @@ Partial Class PopUpVerFactura If Request("onlyPrint").ToString() = "PalletCaja" Then imprimirpallet(Request("CvePallet").ToString.ToEntero()) End If + If Request("onlyPrint").ToString() = "manifiesto" Then + imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero()) + End If End If End If 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) Dim Envase As String = "" Dim Tamano As String = "" diff --git a/Compras/RepCxP.aspx b/Compras/RepCxP.aspx index 07bd70a8c..666f8cd15 100644 --- a/Compras/RepCxP.aspx +++ b/Compras/RepCxP.aspx @@ -269,7 +269,17 @@
- +
+ Moneda: +
+ +
+ + + + + +
diff --git a/Compras/RepCxP.aspx.vb b/Compras/RepCxP.aspx.vb index f22fe1d7f..8ebbfe1d9 100644 --- a/Compras/RepCxP.aspx.vb +++ b/Compras/RepCxP.aspx.vb @@ -180,7 +180,7 @@ Partial Class Compras_RepCxP If txtFechaVF.Text = "" Then FechaVF = "-1" Dim TipoAgrupacion As Integer = IIf(chkAgruparMes.Checked, 1, -1) 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, TipoDocto:=TipoDocto, TipoAgrupacion:=TipoAgrupacion) Then GvCxP.DataSource = Mov.DtResultados diff --git a/Contratos/Contrato.aspx b/Contratos/Contrato.aspx index 7fb92b014..52992ef0a 100644 --- a/Contratos/Contrato.aspx +++ b/Contratos/Contrato.aspx @@ -130,7 +130,9 @@
  • Presupuesto PDF
  • - +
  • + Presupuesto Excel +
  • Activos Fijos PDF
  • @@ -170,6 +172,7 @@ + diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 5c84bf091..50bb6f76a 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -2754,7 +2754,7 @@ Partial Class Contratos_Default Private Sub CargaGVGastos() Dim objContrato As New ClsContratos - If objContrato.GetContratoGastos(CveContrato, UsuarioActual.cveempresa) Then + If objContrato.GetContratoGastos(CveContrato, UsuarioActual.CveEmpresa) Then DtGastos = objContrato.DtResultados GvContratosGastos.DataSource = DtGastos 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 " Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click GenerarPDFPPresupuesto() + End Sub + Private Sub lLbImprimirPresupuestoEXCEL_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuestoExcel.Click + GenerarPDFPPresupuesto(Formato:="EXCEL") End Sub Private Sub GenerarPDFPPresupuesto(Optional Formato As String = "PDF") Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) diff --git a/CxC/RepCxC.aspx b/CxC/RepCxC.aspx index 374b50382..5baadfd42 100644 --- a/CxC/RepCxC.aspx +++ b/CxC/RepCxC.aspx @@ -335,9 +335,20 @@ +
    + Moneda: +
    + +
    + + + + + +
    -
    + diff --git a/CxC/RepCxC.aspx.vb b/CxC/RepCxC.aspx.vb index e625f98bc..d7bda4f73 100644 --- a/CxC/RepCxC.aspx.vb +++ b/CxC/RepCxC.aspx.vb @@ -203,7 +203,7 @@ Partial Class RepCxC "-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, 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 DtDatos = ObjMovtos.DtResultados diff --git a/Documentacion/TableroMaterialidad.aspx b/Documentacion/TableroMaterialidad.aspx index c7a5d2ecc..744690695 100644 --- a/Documentacion/TableroMaterialidad.aspx +++ b/Documentacion/TableroMaterialidad.aspx @@ -11,6 +11,9 @@ #C_Tab_Tlablero tr td:nth-child(n+2) { text-align: center } + .spanfoliofiscal{ + white-space:nowrap; + }
    @@ -36,7 +39,7 @@ - +
    @@ -111,7 +114,14 @@ XML Timbrados PDF Timbrados - + + Enviar + + + + + + @@ -149,7 +159,8 @@ <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalPDF"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> - <%# string.Format("Enviar",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> + + <%-- <%# string.Format("Enviar",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %>--%> @@ -159,163 +170,524 @@ - -