diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 5b34123a5..747f593bd 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -2985,7 +2985,7 @@ Public Class ClsContratos End Function - Public Function AddPresupuestosDetalle(CvePresupuesto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, Importe As Decimal, Observacion As String) As Boolean + Public Function AddPresupuestosDetalle(CvePresupuesto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, Importe As Decimal, Observacion As String, Optional CveConceptoContableNom As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosDetalleAdd") @@ -2996,6 +2996,7 @@ Public Class ClsContratos .Add("@Importe", SqlDbType.Money).Value = Importe .Add("@Observacion", SqlDbType.VarChar).Value = Observacion .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto + .Add("@CveConceptoContableNom", SqlDbType.Int).Value = CveConceptoContableNom End With Try @@ -3029,7 +3030,7 @@ Public Class ClsContratos Return Retorno End Function - Public Function UpdatePresupuestosDetalle(CvePresupuestoDetalle As Integer, CveClasificacion As Integer, ImporteVigente As Decimal, Observacion As String) As Boolean + Public Function UpdatePresupuestosDetalle(CvePresupuestoDetalle As Integer, CveClasificacion As Integer, ImporteVigente As Decimal, Observacion As String, Optional CveConceptoContableNom As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosDetalleUpdate") @@ -3039,6 +3040,7 @@ Public Class ClsContratos .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@ImporteVigente", SqlDbType.Money).Value = ImporteVigente .Add("@Observacion", SqlDbType.VarChar).Value = Observacion + .Add("@CveConceptoContableNom", SqlDbType.Int).Value = CveConceptoContableNom End With Try @@ -3068,7 +3070,7 @@ Public Class ClsContratos End Try Return Retorno End Function - Public Function GetPresupuestosRep(CvePresupuesto As Integer, CveTipoGasto As Integer, Agrupador As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveUsuarioConsulta As Integer, CveClasificacion As Integer) As Boolean + Public Function GetPresupuestosRep(CvePresupuesto As Integer, CveTipoGasto As Integer, Agrupador As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveUsuarioConsulta As Integer, CveAgrupador As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosRep") @@ -3082,7 +3084,7 @@ Public Class ClsContratos .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveAgrupador", SqlDbType.Int).Value = CveAgrupador End With Try @@ -3094,7 +3096,7 @@ Public Class ClsContratos Return Retorno End Function - Public Function GetPresupuestosMensualRep(CvePresupuesto As Integer, CveTipoGasto As Integer, Agrupador As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveUsuarioConsulta As Integer, CveClasificacion As Integer) As Boolean + Public Function GetPresupuestosMensualRep(CvePresupuesto As Integer, CveTipoGasto As Integer, Agrupador As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveUsuarioConsulta As Integer, CveAgrupador As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosMensualRep") @@ -3108,7 +3110,7 @@ Public Class ClsContratos .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveAgrupador", SqlDbType.Int).Value = CveAgrupador End With Try @@ -3120,68 +3122,14 @@ Public Class ClsContratos Return Retorno End Function - - Public Function GetPresupuestosRepDetalle(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, Agrupador As Integer, Gpo As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Con_PresupuestosRepDetalle") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto - .Add("@Agrupador", SqlDbType.Int).Value = Agrupador - .Add("@Gpo", SqlDbType.Int).Value = Gpo - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte detallado de presupuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - Public Function GetPresupuestosMensualRepDetalle(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, Agrupador As Integer, Gpo As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Con_PresupuestosMensualRepDetalle") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto - .Add("@Agrupador", SqlDbType.Int).Value = Agrupador - .Add("@Gpo", SqlDbType.Int).Value = Gpo - .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte detallado de presupuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean + Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveAgrupador As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosRepDetalleCompra") With SqlAdapter.SelectCommand.Parameters .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveAgrupador", SqlDbType.Int).Value = CveAgrupador .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF diff --git a/App_Code/ClsFinanzas.vb b/App_Code/ClsFinanzas.vb index 20a6fdb07..238079690 100644 --- a/App_Code/ClsFinanzas.vb +++ b/App_Code/ClsFinanzas.vb @@ -258,6 +258,58 @@ Public Class ClsFinanzas Return Retorno End Function + + Public Function GetRazonesFinancierasEstadoResultadosRep(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveUsuario As Integer, Tipo As Integer, Periodo As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Finan_RF_EstadoResultadosRepGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@Periodo", SqlDbType.Int).Value = Periodo + + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar el Reporte de Razones Financieras (2).", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + + Public Function GetRazonesFinancierasRatiosRep(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveUsuario As Integer, Tipo As Integer, Periodo As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Finan_RF_RatiosRepGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@Periodo", SqlDbType.Int).Value = Periodo + + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar el Reporte de Ratios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + #Region "RazonesFinancierasCuentas" Public Function AddRazonesFinancierasCuentas(CveRazonFinancieraConcepto As Integer, CveCuenta As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 7bcdce6ab..e285a7287 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4002,28 +4002,28 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Public Shared Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1, Optional PorcentajeIVA As Double = -1) As DataTable - Get - Dim AppNombre As String = $"GlobalDTClasificacionPorcentaje-{CveEmpresa}" - If HttpContext.Current.Application(AppNombre) Is Nothing Then - Using ObjVenta As New ClsGenerales - If ObjVenta.GetClasificacionPorcentaje(CveEmpresa, CveClasificacion:=-1) Then HttpContext.Current.Application(AppNombre) = ObjVenta.DtResultados - End Using - End If + 'Public Shared Property GlobalDTClasificacionPorcentaje2(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1, Optional PorcentajeIVA As Double = -1) As DataTable + ' Get + ' Dim AppNombre As String = $"GlobalDTClasificacionPorcentaje-{CveEmpresa}" + ' If HttpContext.Current.Application(AppNombre) Is Nothing Then + ' Using ObjVenta As New ClsGenerales + ' If ObjVenta.GetClasificacionPorcentaje(CveEmpresa, CveClasificacion:=-1) Then HttpContext.Current.Application(AppNombre) = ObjVenta.DtResultados + ' End Using + ' End If - Dim Str As StringBuilder = New StringBuilder() - If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje) - If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion) - If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTClasificacionPorcentaje = Dv.ToTable - Dv.Dispose() - End Get - Set(value As DataTable) - Dim AppNombre As String = $"GlobalDTClasificacionPorcentaje-{CveEmpresa}" - HttpContext.Current.Application(AppNombre) = value - End Set - End Property + ' Dim Str As StringBuilder = New StringBuilder() + ' If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje) + ' If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion) + ' If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA) + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTClasificacionPorcentaje2 = Dv.ToTable + ' Dv.Dispose() + ' End Get + ' Set(value As DataTable) + ' Dim AppNombre As String = $"GlobalDTClasificacionPorcentaje-{CveEmpresa}" + ' HttpContext.Current.Application(AppNombre) = value + ' End Set + 'End Property Property GlobalDTPaqueterias(CveEmpresa As Integer, Optional TipoPaqueteria As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTPaqueterias-{CveEmpresa}" @@ -7681,6 +7681,8 @@ Public Class ClsPaginas Dim ConPreP As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(1, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor) 'cuando el Pago viene por NC, se utiliza un concepto If Pago.TipoPago.Contiene("NC", "DEV") Then If CompraActual.CveMoneda = 2 Then ConPreP.CveConcepto = 304 Else ConPreP.CveConcepto = 272 'pago nota de crédito ME + 'cuando el Pago viene por Venta, se utiliza un concepto + 'If Pago.TipoPago.Contiene("Venta") Then If CompraActual.CveMoneda = 2 Then ConPreP.CveConcepto = 275 Else ConPreP.CveConcepto = 275 'Pago Compra con Venta Dim Concepto As String = String.Format("{0} F:{1}", CompraActual.ProveedorNombre, CompraActual.SerieFolio) Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) @@ -7846,10 +7848,10 @@ Public Class ClsPaginas Dim Diferencia As Decimal = 0 If tImporteCompra <> tImportePago Then If tImporteCompra > tImportePago Then - ConceptoContable = 64 : IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria + ConceptoContable = 64 TipoMovimiento = True Else - ConceptoContable = 65 : IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria + ConceptoContable = 65 TipoMovimiento = False End If Diferencia = (tImporteCompra - tImportePago).Abs.RoundSQL @@ -7925,18 +7927,18 @@ Public Class ClsPaginas Ret.CveConceptoAcreditable = 19 Ret.CveConceptoxAcreditar = 14 End If - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - Dim IdCtaIVAXAcreditar, IdCtaIVAAcreditable, IdCtaIVANOAcreditable As Integer - Dim dt As DataTable = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA) - If dt.Rows.Count > 0 Then - IdCtaIVAXAcreditar = dt.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - IdCtaIVAAcreditable = dt.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero - IdCtaIVANOAcreditable = dt.Rows(0)("IdCtaIVANoAcreditable").ToString.ToEntero - End If - Ret.IdCtaContableAcreditable = IdCtaIVAAcreditable - Ret.IdCtaContablexAcreditar = IdCtaIVAXAcreditar - Ret.IdCtaContIVANoAcreditable = IdCtaIVANOAcreditable - End If + 'If UsuarioActual.Empresa.TipoContabilidad = 2 Then + ' Dim IdCtaIVAXAcreditar, IdCtaIVAAcreditable, IdCtaIVANOAcreditable As Integer + ' Dim dt As DataTable = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA) + ' If dt.Rows.Count > 0 Then + ' IdCtaIVAXAcreditar = dt.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + ' IdCtaIVAAcreditable = dt.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + ' IdCtaIVANOAcreditable = dt.Rows(0)("IdCtaIVANoAcreditable").ToString.ToEntero + ' End If + ' Ret.IdCtaContableAcreditable = IdCtaIVAAcreditable + ' Ret.IdCtaContablexAcreditar = IdCtaIVAXAcreditar + ' Ret.IdCtaContIVANoAcreditable = IdCtaIVANOAcreditable + 'End If Return Ret End Get End Property @@ -8192,10 +8194,10 @@ Public Class ClsPaginas End If 'movimiento de pago cliente - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, Contabilizable:=Contabilizable) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada, Contabilizable:=Contabilizable) Then ErrorMovtos = True 'movimiento de pago cliente Complementaria If Not ErrorMovtos AndAlso VentaActual.CveMoneda > 1 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, Contabilizable:=Contabilizable) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada, Contabilizable:=Contabilizable) Then ErrorMovtos = True End If If Pago.AplicaTraslado Then 'si tiene iva y su proporcion @@ -8203,10 +8205,10 @@ Public Class ClsPaginas ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 61, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 61, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True End If End If 'si tiene RET IVA y su proporcion @@ -8214,20 +8216,20 @@ Public Class ClsPaginas ImporteMovimiento = (PorcentajePago * VentaActual.RetIVA).RoundSQL ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True End If 'si tiene Ret ISR y su proporcion If Not ErrorMovtos AndAlso VentaActual.RetISR > 0 Then ImporteMovimiento = (PorcentajePago * VentaActual.RetISR).RoundSQL ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True End If 'si tiene IEPS y su proporcion If Not ErrorMovtos AndAlso VentaActual.IEPS > 0 Then @@ -8239,10 +8241,10 @@ Public Class ClsPaginas If ObjConta.GetRetCuenta(38, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero If ObjConta.GetRetCuenta(39, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True End If 'concepto pago Concepto = String.Format("{0} NC:{1}", VentaActual.ClienteNombre, Pago.Referencia) @@ -8313,10 +8315,10 @@ Public Class ClsPaginas tImportePago += Pago.ImporteFluctuacionAdicional 'para los casos de aplicación de If tImporteVenta <> tImportePago Then If tImporteVenta < tImportePago Then - ConceptoContable = 64 : IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria + ConceptoContable = 64 TipoMovimiento = True Else - ConceptoContable = 65 : IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria + ConceptoContable = 65 TipoMovimiento = False End If Diferencia = (tImporteVenta - tImportePago).Abs.RoundSQL @@ -8992,6 +8994,7 @@ Public Class ClsPaginas PaginaDict.Add("/Finanzas/RepRotacionCartera.aspx".ToUpper(), 649) PaginaDict.Add("/Finanzas/RepRotacionCarteraDetalle.aspx".ToUpper(), 649) PaginaDict.Add("/Finanzas/RepBalanceGeneralHorizontal2.aspx".ToUpper(), -1) + PaginaDict.Add("/Finanzas/RepRazonesFinancieras2.aspx".ToUpper(), 1337) #End Region #Region "Flotillas" PaginaDict.Add("/Flotillas/CatCombustibles.aspx".ToUpper(), 284) diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index 2ca94fb56..97542eac4 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -404,18 +404,18 @@ Public Class ClsSisEmpresas 'Nuevos Datos _Empresa.AreaGeografica = Data.Rows(0)("AreaGeografica").ToString - _Empresa.IdCuentaIVAxAcreditar = Data.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero - _Empresa.IdCuentaIVAAcreditable = Data.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero - _Empresa.IdCuentaIVAxTrasladar = Data.Rows(0)("IdCuentaIVAxTrasladar").ToString.ToEntero - _Empresa.IdCuentaIVATrasladado = Data.Rows(0)("IdCuentaIVATrasladado").ToString.ToEntero - _Empresa.IdCuentaRetIVACirculacion = Data.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - _Empresa.IdCuentaRetISRCirculacion = Data.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - _Empresa.IdCuentaDSV = Data.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString.ToEntero - _Empresa.IdCuentaImpuestosLocales = Data.Rows(0)("Conta_IdCuentaImpuestosLocales").ToString.ToEntero - _Empresa.IdCuentaIEPSxAcreditar = Data.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero - _Empresa.IdCuentaIEPSAcreditable = Data.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero - _Empresa.IdCuentaIEPSxTrasladar = Data.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero - _Empresa.IdCuentaIEPSTrasladado = Data.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero + '_Empresa.IdCuentaIVAxAcreditar = Data.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero + '_Empresa.IdCuentaIVAAcreditable = Data.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero + '_Empresa.IdCuentaIVAxTrasladar = Data.Rows(0)("IdCuentaIVAxTrasladar").ToString.ToEntero + '_Empresa.IdCuentaIVATrasladado = Data.Rows(0)("IdCuentaIVATrasladado").ToString.ToEntero + '_Empresa.IdCuentaRetIVACirculacion = Data.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + '_Empresa.IdCuentaRetISRCirculacion = Data.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + '_Empresa.IdCuentaDSV = Data.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString.ToEntero + '_Empresa.IdCuentaImpuestosLocales = Data.Rows(0)("Conta_IdCuentaImpuestosLocales").ToString.ToEntero + '_Empresa.IdCuentaIEPSxAcreditar = Data.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + '_Empresa.IdCuentaIEPSAcreditable = Data.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + '_Empresa.IdCuentaIEPSxTrasladar = Data.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero + '_Empresa.IdCuentaIEPSTrasladado = Data.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero _Empresa.IdCuentaOtrosIngresos = Data.Rows(0)("Conta_IdCuentaOtrosIngresos").ToString.ToEntero '_Empresa.IdCtaProveedor = Data.Rows(0)("IdCtaProveedor").ToString.ToEntero @@ -428,7 +428,7 @@ Public Class ClsSisEmpresas '_Empresa.IdCtaAnticipoProveedores = Data.Rows(0)("IdCtaAnticipoProveedores").ToString.ToEntero _Empresa.Buzon_Tipo = Data.Rows(0)("Buzon_Tipo").ToString - _Empresa.ContaContabilizacionNC = Data.Rows(0)("Conta_ContabilizacionNC").ToString.ToEntero + '_Empresa.ContaContabilizacionNC = Data.Rows(0)("Conta_ContabilizacionNC").ToString.ToEntero '_Empresa.Ruta = String.Format("{0}Empresas\{1}\", ModExtensiones.DirectorioBaseEmpresas, _Empresa.CveEmpresa) _Empresa.PV_TerminalTipo = Data.Rows(0)("PV_TerminalTipo").ToString.ToEntero _Empresa.EjercicioActual = Data.Rows(0)("EjercicioActual").ToString.ToEntero @@ -437,8 +437,8 @@ Public Class ClsSisEmpresas _Empresa.MetodoOC = Data.Rows(0)("MetodoOC").ToString.ToEntero _Empresa.CveMetodoInventario = Data.Rows(0)("Inv_CveMetodoInventario").ToString.ToEntero _Empresa.RequiereCentroCostos = Data.Rows(0)("RequiereCentroCostos").ToString <> "No" - _Empresa.IdCuentaPerdidaCambiaria = Data.Rows(0)("IdCuentaPerdidaCambiaria").ToString.ToEntero - _Empresa.IdCuentaGananciaCambiaria = Data.Rows(0)("IdCuentaGananciaCambiaria").ToString.ToEntero + '_Empresa.IdCuentaPerdidaCambiaria = Data.Rows(0)("IdCuentaPerdidaCambiaria").ToString.ToEntero + '_Empresa.IdCuentaGananciaCambiaria = Data.Rows(0)("IdCuentaGananciaCambiaria").ToString.ToEntero _Empresa.Tipo_CentroCosto = Data.Rows(0)("Tipo_CentroCosto").ToString.ToEntero _Empresa.GrupoEmpresa = Data.Rows(0)("GrupoEmpresa").ToString.ToEntero _Empresa.PlantillaMailVenta = Data.Rows(0)("PlantillaMailVenta").ToString @@ -467,7 +467,6 @@ Public Class ClsSisEmpresas _Empresa.RutaArchivos = Data.Rows(0)("RutaArchivos").ToString - Else 'Alert("No se encontró la Empresa solicitada.", TipoMensaje.MsgAdvertencia) End If diff --git a/App_Code/Empresa.vb b/App_Code/Empresa.vb index 666880f07..de0648139 100644 --- a/App_Code/Empresa.vb +++ b/App_Code/Empresa.vb @@ -53,7 +53,6 @@ Public Class Empresa Public CvePAC As Integer Public CveRegimenFiscal As Integer - Public Property Tipo_CentroCosto As Integer Public Property MostrarRetISR As Boolean Public Property Regimen As String @@ -63,7 +62,6 @@ Public Class Empresa Public Property RegistroCompleto As Integer Public Property Importe As Decimal Public Property CveMetodoPago As Integer - Public Property CodigoRegimenFiscal As String Public Property RegimenFiscal As String Public Property EstatusFacturacion As Boolean @@ -108,23 +106,23 @@ Public Class Empresa Return String.Format("{0}\{1}\", Extensiones.ModExtensiones.DirectorioEmpresas, Me.CveEmpresa) End If End Get - End Property - Public Property IdCuentaIVAxTrasladar As Integer - Public Property IdCuentaIVATrasladado As Integer - Public Property IdCuentaPerdidaCambiaria As Integer - Public Property IdCuentaGananciaCambiaria As Integer - Public Property ContaContabilizacionNC As Integer + End Property + 'Public Property IdCuentaIVAxTrasladar As Integer + 'Public Property IdCuentaIVATrasladado As Integer + 'Public Property IdCuentaPerdidaCambiaria As Integer + 'Public Property IdCuentaGananciaCambiaria As Integer + ' Public Property ContaContabilizacionNC As Integer Public Property PV_TerminalTipo As Integer Public Property PlantillaMailVenta As String Public Property AsuntoPlantillaMailVenta As String 'Nuevas - Public Property IdCuentaIVAxAcreditar As Integer - Public Property IdCuentaIVAAcreditable As Integer - Public Property IdCuentaRetIVACirculacion As Integer - Public Property IdCuentaRetISRCirculacion As Integer - Public Property IdCuentaDSV As Integer - Public Property IdCuentaImpuestosLocales As Integer + 'Public Property IdCuentaIVAxAcreditar As Integer + 'Public Property IdCuentaIVAAcreditable As Integer + 'Public Property IdCuentaRetIVACirculacion As Integer + 'Public Property IdCuentaRetISRCirculacion As Integer + 'Public Property IdCuentaDSV As Integer + 'Public Property IdCuentaImpuestosLocales As Integer Public Property IdCtaProveedor As Integer Public Property IdCtaCliente As Integer Public Property IdCtaDeudores As Integer @@ -134,10 +132,6 @@ Public Class Empresa Public Property IdCtaAnticipoProveedores As Integer 'Nuevos Datos - Public Property IdCuentaIEPSxAcreditar As Integer - Public Property IdCuentaIEPSAcreditable As Integer - Public Property IdCuentaIEPSxTrasladar As Integer - Public Property IdCuentaIEPSTrasladado As Integer Public Property PorDepreciacion As Decimal Public Property CvePlataforma As Integer Public Property CveDistribuidor As Integer diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 888460422..26c66ef60 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2421,10 +2421,10 @@ Namespace Modelos SeContabiliza = False End If - If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then - IdCtaIVAXTrasladar = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero - IdCtaIVATrasladado = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero - End If + 'If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then + ' IdCtaIVAXTrasladar = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero + ' IdCtaIVATrasladado = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero + 'End If Dim UsaComplementariaClientes As Boolean = True 'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True @@ -2491,11 +2491,9 @@ Namespace Modelos If difFluctuacion < 0 Then CveConceptoFluctua = 65 TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria Else CveConceptoFluctua = 64 TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If Dim ImporteFluctuacion As Decimal = Math.Abs((importeMovimiento * difFluctuacion).RoundSQL) @@ -2798,11 +2796,9 @@ Namespace Modelos If difFluctuacion < 0 Then CveConceptoFluctua = 65 TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria Else CveConceptoFluctua = 64 TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If Dim ImporteFluctuacion As Decimal = Math.Abs((Importe251 * difFluctuacion).RoundSQL) * ValorMultiplicador @@ -2889,11 +2885,9 @@ Namespace Modelos If difFluctuacion < 0 Then CveConceptoFluctua = 65 TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria Else CveConceptoFluctua = 64 TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If Dim ImporteFluctuacion As Decimal = Math.Abs((importeMovimientoDev * difFluctuacion).RoundSQL) * ValorMultiplicador @@ -3183,11 +3177,9 @@ Namespace Modelos If difFluctuacion < 0 Then CveConceptoFluctua = 65 TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria Else CveConceptoFluctua = 64 TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If Dim ImporteFluctuacion As Decimal = Math.Abs((Importe251 * difFluctuacion).RoundSQL) * ValorMultiplicador @@ -3332,20 +3324,20 @@ Namespace Modelos CveVentaAmortizacionAplicar = ObjFactura.CveVenta End If - 'código fijo en base el porcentaje iva, que se afecten las clasificaciones - For i = 0 To TmpDTDetalle.Rows.Count - 1 + ''código fijo en base el porcentaje iva, que se afecten las clasificaciones + 'For i = 0 To TmpDTDetalle.Rows.Count - 1 - 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso - If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933") Then + ' 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso + ' If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933") Then - 'reclasifica la clasificación del producto, por la del ingreso correspondiente a su iva - If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows.Count > 0 Then - TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows(0)("CveClasificacion").ToString - End If + ' 'reclasifica la clasificación del producto, por la del ingreso correspondiente a su iva + ' If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows.Count > 0 Then + ' TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows(0)("CveClasificacion").ToString + ' End If - End If + ' End If - Next + 'Next DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"}) @@ -3396,23 +3388,23 @@ Namespace Modelos CveVentaAmortizacionAplicar = ObjFactura.CveVenta End If - If UsuarioActual.CveEmpresa = 119 Then + 'If UsuarioActual.CveEmpresa = 119 Then - 'código fijo en base el porcentaje iva, que se afecten las clasificaciones - For i = 0 To TmpDTDetalle.Rows.Count - 1 + ' 'código fijo en base el porcentaje iva, que se afecten las clasificaciones + ' For i = 0 To TmpDTDetalle.Rows.Count - 1 - 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso - If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "20242") Then + ' 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso + ' If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "20242") Then - If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then - TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString - End If + ' If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then + ' TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString + ' End If - End If + ' End If - Next + ' Next - End If + 'End If DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"}) @@ -3583,9 +3575,6 @@ Namespace Modelos importeMovimiento = importeMovimiento * -1 importeMX = importeMX * -1 - IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) - Else - IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) End If CveSubProyectoContabilizar = CveSubProyectoVenta @@ -3693,7 +3682,6 @@ Namespace Modelos End If 'IVA X TRASLADAR - IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True @@ -3701,7 +3689,6 @@ Namespace Modelos End If 'IVA PAGADO - IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True @@ -3710,14 +3697,14 @@ Namespace Modelos 'IEPS X TRASLADAR Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then + If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, 0, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then ErrorPrepoliza = True Exit For End If 'IEPS PAGADO Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString) - If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then + If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, 0, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then ErrorPrepoliza = True Exit For End If diff --git a/Bancos/DepositoTerminal.aspx.vb b/Bancos/DepositoTerminal.aspx.vb index 1a4095086..aea73499c 100644 --- a/Bancos/DepositoTerminal.aspx.vb +++ b/Bancos/DepositoTerminal.aspx.vb @@ -345,7 +345,6 @@ Partial Class Bancos_DepositoTerminal ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago importeMX = Math.Round(ImporteMovimiento * tipoCambioVenta, 2) - IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" Case 62 'Ret IVA Trasladado @@ -387,7 +386,6 @@ Partial Class Bancos_DepositoTerminal ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago importeMX = Math.Round(ImporteMovimiento * tipoCambioManual, 2) - IdCtaContable = UsuarioActual.Empresa.IdCuentaIVATrasladado If tipoCambioManual > 1 Then ConceptoMovimiento += $" TC:{tipoCambioManual} ${ImporteMovimiento.FormatoNumero(2)}" Case 38 'IEPS por trasladar @@ -395,14 +393,10 @@ Partial Class Bancos_DepositoTerminal ImporteMovimiento = gvr.DataKey("IEPS").ToDecimal * PorcentajePago importeMX = Math.Round(ImporteMovimiento * tipoCambioVenta, 2) - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar - Case 39 'IEPS Trasladado ImporteMovimiento = gvr.DataKey("IEPS").ToDecimal * PorcentajePago importeMX = Math.Round(ImporteMovimiento * tipoCambioManual, 2) - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado - Case 78 'Otros Ingresos If ChkAjusteOI.Checked Then ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index 9bcabe81d..a3bf3ec35 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -540,12 +540,12 @@ public partial class Bancos_Devoluciones : ClsPaginas } //IVA - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 13, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 13, Conc, DateTime.Now, 0, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal())) { MsgError = "No se pudo insertar concepto de IVA"; } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 61, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 61, Conc, DateTime.Now,0, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal())) { MsgError = "No se pudo insertar concepto de IVA"; } diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index c7634465c..db024ed8d 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -758,8 +758,60 @@ + + + + +
+
+ +
+ + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+
+ +
+ +
+
+ + + + + + + + + +
+
- +
@@ -806,17 +858,7 @@ - - - - - - - - +
diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index 75f553751..ec1245098 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -36,6 +36,8 @@ Partial Class Bancos_FluctuacionCambiaria CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreeedoresAnt, Nothing, LblSubProyectoAcreedoresAnt, "") CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "") CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales, "") + CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreedoresDiversos, Nothing, LblSubProyectoAcreedoresDiversos, "") + CargarCentrosDeCosto(Nothing, DdlSubProyectoDeudores, Nothing, LblSubProyectoDeudores, "") CargaUltimaFluctuacion() @@ -66,6 +68,10 @@ Partial Class Bancos_FluctuacionCambiaria End Sub Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + + Private Sub CargaDatos() CargaTipoCambio() If T.ActiveTabIndex = 0 Then CargaDatosProveedores() If T.ActiveTabIndex = 1 Then CargaDatosProveedoresAnticipos() @@ -77,7 +83,7 @@ Partial Class Bancos_FluctuacionCambiaria If T.ActiveTabIndex = 7 Then CargaDatosAcreedoresDiversos() 'CargaDatosFiliales() If T.ActiveTabIndex = 8 Then CargaDatosDeudores() - UpTabs.Update() + UpTabs.Update() End Sub @@ -288,8 +294,9 @@ Partial Class Bancos_FluctuacionCambiaria HdnAcreedorAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString BtnAcreedoresAntRemove.Visible = HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0 BtnGeneraAcreedoresAnt.Visible = Not HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0 + HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString - HplAcreedorAntLiga.Visible = HdnAcreedorCvePrePoliza.Value.ToEntero > 0 + HplAcreedorAntLiga.Visible = HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0 HplAcreedorAntLiga.NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", ObjBancos.DtResultados.MAX("CvePrePoliza").ToString) GvAcreedoresAnt.DataSource = ObjBancos.DtResultados LblTotalAcreedoresAnt.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero @@ -379,9 +386,17 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaDatosAcreedoresDiversos() Dim ObjBancos As New ClsBancos LblTotalAcreedores.Text = "0.00" - If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 88, UsuarioActual.CveEmpresa) Then - GvAcreedorDiversos.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0") - LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 88, UsuarioActual.CveEmpresa) Then + HdnAcreedoresDiversosCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString + HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString + BtnAcreedoresDiversosRemove.Visible = HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero > 0 + BtnGeneraAcreeedoresDiversos.Visible = Not HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero > 0 + + HplAcreedoresDiversosPoliza.Visible = HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero > 0 + HplAcreedoresDiversosPoliza.NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", ObjBancos.DtResultados.MAX("CvePrePoliza").ToString) + + GvAcreedorDiversos.DataSource = ObjBancos.DtResultados + LblTotalAcreedoresDiversos.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else GvAcreedorDiversos.DataSource = Nothing Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia) @@ -413,9 +428,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Total = LblTotal.ToDecimal @@ -493,9 +506,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Total = LblTotal.ToDecimal @@ -577,9 +588,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() @@ -674,9 +683,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() @@ -780,9 +787,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Total = LblTotalAcreedores.Text.ToDecimal @@ -869,9 +874,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Total = LblTotalAcreedoresAnt.Text.ToDecimal @@ -952,9 +955,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveCuentaPerdida = 0 ' 55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Total = LblTotalBancos.Text.ToDecimal @@ -1038,9 +1039,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal @@ -1102,8 +1101,8 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim Conta As New ClsContabilidad Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) - Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) - ObjContPaq.IniciaTransacSQL() + 'Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) + 'ObjContPaq.IniciaTransacSQL() 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 @@ -1116,9 +1115,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + CveCuentaGanancia = 0 ' 55382 Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal @@ -1157,9 +1154,6 @@ Partial Class Bancos_FluctuacionCambiaria Banco.UpdateBancosTipoCambioValuacion(TCCierreFluctuacion, gvr.DataKey("CveIE").ToEntero, UsuarioActual.CveEmpresa) End If - - - Next If Not ErrorRegistrar Then @@ -1168,28 +1162,96 @@ Partial Class Bancos_FluctuacionCambiaria Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" If AutoConta Then - If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then + If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then Else Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) End If - End If - - If ObjContPaq IsNot Nothing Then ObjContPaq.Commit() - 'Fin autoconta + End If + + ' If ObjContPaq IsNot Nothing Then ObjContPaq.Commit() + 'Fin autoconta Conta.Commit() - Alert(String.Format("La Fluctuación se ha generado
Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() - ObjContPaq.RollBack() + 'ObjContPaq.RollBack() End If Conta.Dispose() Banco.Dispose() - ObjContPaq.Dispose() + 'ObjContPaq.Dispose() End Sub + + #End Region + +#Region "FLUCTUACION ACREEDORES DIVEROS" + Protected Sub BtnGeneraAcreeedoresDiversos_Click(sender As Object, e As EventArgs) + + Dim Conta As New ClsContabilidad + Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) + Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaAD", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedoresDiversos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim CveConceptoContable As Integer + Dim TipoMovto As Boolean + Dim ErrorRegistrar As Boolean = False + + Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias + Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal + Dim TotalAcumulado As Decimal = 0 + Dim ConceptoFluctuacion As String = String.Format("Fluctuación Acreedores Diversos {0:d} ", FechaUltimoDiaMes) + + + For Each gvr As GridViewRow In GvAcreedorDiversos.Rows + TotalAcumulado += gvr.DataKey("Fluctuacion").ToDecimal + Next + 'TotalAcumulado = GvAcreedorDiversos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) Convert.ToDecimal(GvAcreedorDiversos.DataKeys(gvr.RowIndex)("Fluctuacion"))) + + + If TotalAcumulado < 0 Then + CveConceptoContable = 64 : TipoMovto = True + Else + CveConceptoContable = 65 : TipoMovto = False + End If + + 'saco las cuentas de pérdida y ganancia + For Each gvr As GridViewRow In GvAcreedorDiversos.Rows + + If gvr.DataKey("Fluctuacion").ToDecimal <> 0 Then + 'movimiento de complementaria + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, gvr.DataKey("Fluctuacion").ToDecimal, ConceptoFluctuacion, 351, ConceptoFluctuacion & gvr.DataKey("RazonSocial"), Now, 0, 0, TipoCambio:=TC, ImporteMX:=gvr.DataKey("Fluctuacion").ToDecimal, ImporteME:=gvr.DataKey("Fluctuacion").ToDecimal, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveSubProyecto:=DdlSubProyectoAcreedoresDiversos.SelectedValue.ToEntero) Then + ErrorRegistrar = True + Exit For + End If + End If + + Next + If Not ErrorRegistrar Then + + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(TotalAcumulado), ConceptoFluctuacion, CveConceptoContable, ConceptoFluctuacion, Now, 0, 0, ImporteMX:=Math.Abs(TotalAcumulado), CveSubProyecto:=DdlSubProyectoAcreedoresDiversos.SelectedValue.ToEntero) Then + ErrorRegistrar = True + End If + End If + + If Not ErrorRegistrar Then + + If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 9, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + End If + + Conta.Commit() + + Alert(String.Format("La Fluctuación se ha generado
Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Else + Conta.RollBack() + 'ObjContPaq.RollBack() + End If + Conta.Dispose() + Banco.Dispose() + 'ObjContPaq.Dispose() + End Sub +#End Region #Region "GRIDVIEWS" @@ -1236,7 +1298,7 @@ Partial Class Bancos_FluctuacionCambiaria If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorCvePrePoliza.Value.ToEntero, 1, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() BtnProveedoresRemove.visible = False - Alert("Flucturación eliminada.") + Alert("Fluctuación eliminada.") Else Banco.RollBack() End If @@ -1251,7 +1313,7 @@ Partial Class Bancos_FluctuacionCambiaria If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorAntCvePrePoliza.Value.ToEntero, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() BtnProveedoresAntRemove.Visible = False - Alert("Flucturación eliminada.") + Alert("Fluctuación eliminada.") Else Banco.RollBack() End If @@ -1265,7 +1327,7 @@ Partial Class Bancos_FluctuacionCambiaria If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteCvePrePoliza.Value.ToEntero, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() BtnClientesRemove.Visible = False - Alert("Flucturación eliminada.") + Alert("Fluctuación eliminada.") Else Banco.RollBack() End If @@ -1279,7 +1341,7 @@ Partial Class Bancos_FluctuacionCambiaria If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteAntCvePrePoliza.Value.ToEntero, 4, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() BtnClientesAntRemove.Visible = False - Alert("Flucturación eliminada.") + Alert("Fluctuación eliminada.") Else Banco.RollBack() End If @@ -1293,7 +1355,7 @@ Partial Class Bancos_FluctuacionCambiaria If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorCvePrePoliza.Value.ToEntero, 5, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() BtnAcreedoresRemove.Visible = False - Alert("Flucturación eliminada.") + Alert("Fluctuación eliminada.") Else Banco.RollBack() End If @@ -1307,7 +1369,7 @@ Partial Class Bancos_FluctuacionCambiaria If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorAntCvePrePoliza.Value.ToEntero, 6, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() BtnAcreedoresAntRemove.Visible = False - Alert("Flucturación eliminada.") + Alert("Fluctuación eliminada.") Else Banco.RollBack() End If @@ -1352,4 +1414,19 @@ Partial Class Bancos_FluctuacionCambiaria End Sub #End Region + + Protected Sub BtnAcreedoresDiversosRemove_Click(sender As Object, e As EventArgs) + Dim Banco As New ClsBancos + Banco.IniciaTransacSQL() + + If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero, 9, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + Banco.Commit() + BtnAcreedoresDiversosRemove.Visible = False + CargaDatos() + Alert("Fluctuación eliminada.") + Else + Banco.RollBack() + End If + Banco.Dispose() + End Sub End Class diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index a707d96a5..f7095185e 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -265,6 +265,7 @@ Clientes Proveedor Viáticos + Acreedor diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index d887529d1..a1c19340e 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2818,7 +2818,7 @@ Partial Class Bancos_IE If TxtIvaIxC.Text.ToDouble > 0 Then Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2) 'Iva - ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=If(PorcentajeIVA.ToString().Contiene("0.08", "0.16"), PorcentajeIVA, 0)) + ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, 0, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=If(PorcentajeIVA.ToString().Contiene("0.08", "0.16"), PorcentajeIVA, 0)) End If 'Bancos @@ -2935,7 +2935,7 @@ Partial Class Bancos_IE Dim CveConIVA As Integer = 61 If UsuarioActual.CveEmpresa = 70 Then CveConIVA = 299 Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2) - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, CveConIVA, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=PorcentajeIVA) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, CveConIVA, Concepto, FechaMovimiento, 0, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=PorcentajeIVA) Then MsgError = "Ocurrió un error al registrar el asiento del ingreso." End If End If @@ -3244,14 +3244,14 @@ Partial Class Bancos_IE If DiferenciaTC < 0 Then '64 - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then MsgError = "Ocurrió un error al registrar el asiento de ganancia cambiaria" Exit Select End If Else '65 - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then MsgError = "Ocurrió un error al registrar el asiento de perdidada cfambiaria" Exit Select End If @@ -3282,9 +3282,9 @@ Partial Class Bancos_IE Dim IEPSDev As Decimal = dr("IEPS").ToString.ToDecimal PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal - Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) - Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + 'Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) + 'Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + 'Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero Dim IVADevMN As Decimal = 0 Dim IEPSDevMN As Decimal = 0 Dim PorcentajeDevolucion As Decimal = ((ImporteAplicar * 100D / TotalCompraDev) / 100).RoundSQL(2) @@ -3305,11 +3305,11 @@ Partial Class Bancos_IE If IVADev > 0 Then - IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC + ' IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then - IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC + ' IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" @@ -3453,14 +3453,14 @@ Partial Class Bancos_IE If DiferenciaTC < 0 Then '64 - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then MsgError = "Ocurrió un error al registrar el asiento de ganancia cambiaria" Exit Select End If Else '65 - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then MsgError = "Ocurrió un error al registrar el asiento de perdidada cfambiaria" Exit Select End If @@ -3489,17 +3489,17 @@ Partial Class Bancos_IE Dim IEPSDev As Decimal = dr("IEPS").ToString.ToDecimal PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal - Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) + 'Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) Dim IdCtaIVAXAcreditarDevDinC As Integer Dim IdCtaIVAAcreditableDevDinC As Integer - If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then - IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero - Else - MsgError = "Sin Registros de porcentaje impuesto" - End If + 'If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then + ' IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + ' IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + 'Else + ' MsgError = "Sin Registros de porcentaje impuesto" + 'End If Dim IVADevMN As Decimal = 0 Dim IEPSDevMN As Decimal = 0 diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 5dbf0ec6c..d7fb87350 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -409,13 +409,11 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (TCPago > TC) { CveConceptoDiferenciaCambiaria = 65; - IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria; TipoMovto = false; } else if (TCPago < TC) { CveConceptoDiferenciaCambiaria = 64; - IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria; TipoMovto = true; } Importe = ((Importe * TCPago) - (Importe * TC)).Abs(); diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 3a210032b..df9520fbd 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -780,16 +780,13 @@ public partial class Bancos_PagoDeudor : ClsPaginas if (TC < TCDoc) { CveConceptoDiferenciaCambiaria = 65; - IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria; TipoMovto = false; Importe = (Importe * gvr.DataKey("TipoCambio").ToDecimal()) - (Importe * TC); } else if (TC > TCDoc) { CveConceptoDiferenciaCambiaria = 64; - IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria; TipoMovto = true; - Importe = (Importe * TC) - (Importe * gvr.DataKey("TipoCambio").ToDecimal()); } ImporteMN = Importe; diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index 33211d3ff..0b28dc305 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -108,7 +108,7 @@ Partial Class Bancos_PolizaCheque DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True Dim dt As DataTable = Nothing - If UsuarioActual.Empresa.UsaContabilidad Then + If UsuarioActual.Empresa.TipoContabilidad = 2 Then Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) If Conta.GetCuentas(-1, "-1", 1) Then @@ -118,6 +118,17 @@ Partial Class Bancos_PolizaCheque End If Conta.Dispose() + End If + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + Dim Conta As New ClsContabilidad + + If Conta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then + dt = Conta.DtResultados + DtCuentasContables = Conta.DtResultados + Session("DtCuentas") = Conta.DtResultados + End If + Conta.Dispose() + End If TipoPlantilla = 0 @@ -405,9 +416,8 @@ Partial Class Bancos_PolizaCheque NombreCuenta = "" If UsuarioActual.Empresa.UsaContabilidad Then - If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) - + If UsuarioActual.Empresa.TipoContabilidad = 1 AndAlso drt("CveCuenta").ToString.ToEntero > 0 Then + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", drt("CveCuenta").ToString)) If drr IsNot Nothing Then IdCuenta = drt("IdCtaContable").ToString.ToEntero @@ -416,41 +426,43 @@ Partial Class Bancos_PolizaCheque 'Cuenta = drr("Nombre").ToString() End If EsComodin = 0 + End If + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) - - ElseIf drt("CveConcepto").ToString = "30" Then - 'saco la clave de la cuenta bancaria seleccionada - If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero))) If drr IsNot Nothing Then - IdCuenta = drr("Id").ToString.ToEntero + IdCuenta = drt("IdCtaContable").ToString.ToEntero CodigoCuenta = drr("CuentaFormato").ToString() NombreCuenta = drr("Nombre").ToString() - ' Cuenta = drr("Nombre").ToString() - EsComodin = 1 - Else - - ' Rad.Checked = False - If UsuarioActual.CveEmpresa <> 126 Then - Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia) - GvMov.DataBind() - UPMovs.Update() - Exit Sub - End If - + 'Cuenta = drr("Nombre").ToString() End If + EsComodin = 0 + + + ElseIf drt("CveConcepto").ToString = "30" Then + 'saco la clave de la cuenta bancaria seleccionada + If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero))) + If drr IsNot Nothing Then + IdCuenta = drr("Id").ToString.ToEntero + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + ' Cuenta = drr("Nombre").ToString() + EsComodin = 1 + End If + End If + ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then + + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia)) + + IdCuenta = IdCtaFondoGarantia + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + 'Cuenta = drr("Nombre").ToString() + + EsComodin = 0 End If - ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then - - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia)) - - IdCuenta = IdCtaFondoGarantia - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - 'Cuenta = drr("Nombre").ToString() - - EsComodin = 0 - End If End If diff --git a/Bancos/PopIECompras.aspx b/Bancos/PopIECompras.aspx index 68b5d172c..8f4cf2a6a 100644 --- a/Bancos/PopIECompras.aspx +++ b/Bancos/PopIECompras.aspx @@ -443,7 +443,7 @@
- diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 565f5c4bf..9e161e4eb 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -33,7 +33,7 @@ Partial Class Bancos_PopIECompras 'Configuración Private Property CveIE As Integer Get - Return ViewState("CveIE").ToString.ToEntero + Return IfNull(ViewState("CveIE"), "0").ToString.ToEntero End Get Set(value As Integer) ViewState("CveIE") = value @@ -315,6 +315,12 @@ Partial Class Bancos_PopIECompras End Get End Property + Private ReadOnly Property NombreCliente As String + Get + Return ViewState("NombreCliente").ToString + End Get + End Property + Private Property NotificarA As String Get If ViewState("NotificarA") Is Nothing Then @@ -814,6 +820,7 @@ Partial Class Bancos_PopIECompras ViewState("IdCtaContRetISRCliente") = dtc.Rows(0)("IdCtaContRetISR") ViewState("IdCtaContComplementariaCliente") = dtc.Rows(0)("IdCtaContComplementaria") ViewState("IdCtaContMonedaExtranjeraCliente") = dtc.Rows(0)("IdCtaContMonedaExtranjera") + ViewState("NombreCliente") = dtc.Rows(0)("Nombre") If ObjMovtos.GetCxCClienteDetalle(CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1) Then @@ -1413,21 +1420,49 @@ Partial Class Bancos_PopIECompras Pago.ImportePago = ImportePagado Pago.CveIE = CveIE - 'If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then - ' Dim ObjCreditos As New ClsBancos - ' ObjCreditos.GetTarjetasCreditos(DdlCuenta.SelectedValue.ToEntero, DdlTarjeta.SelectedValue.ToEntero) - ' If ObjCreditos.DtResultados.Rows.Count > 0 AndAlso (ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero > 0 Or ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjetaSIG").ToString.ToEntero > 0) Then - ' IdCtaContable = ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero - ' Else - ' IdCtaContable = CtaProveedor - ' End If - ' ObjCreditos.Dispose() - ' Else - ' IdCtaContable = IdCuentaBancaria - ' End If - If MsgError = "" AndAlso AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" + End If + 'AGREGO PREPOLIZA BANCOS + Dim IdCuenta As Integer = 0 + Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83) + Dim ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}" + Dim Referencia As String = TxtFolio.Text.Trim + Dim tImporteMN As Decimal = TxtImporte.Text.ToDecimal + Pago.ImportePago = tImporteMN + + If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then + Dim ObjCreditos As New ClsBancos + ObjCreditos.GetTarjetasCreditos(DdlCuenta.SelectedValue.ToEntero, DdlTarjeta.SelectedValue.ToEntero) + + If ObjCreditos.DtResultados.Rows.Count > 0 AndAlso (ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero > 0) Then + IdCuenta = ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero + End If + + Dim Importe42 As Decimal = Pago.ImportePago + Pago.OtroGastoIngreso + tImporteMN = If(Pago.CveMonedaPago = 2, If(DivTipoCambio.Visible, Importe42 / TxtTipoCambio.Text.ToDecimal * Pago.TCPago, Importe42 * Pago.TCPago), Importe42) + + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Importe42, tImporteMN, 42, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then + MsgError = "No se pudo insertar la póliza" + End If + + Else + Dim ImporteME As Decimal = 0 + If Pago.CveMonedaPago = 2 Then ImporteME = Pago.ImportePago + If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then + ImporteME = tImporteMN + tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL + End If + + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, tImporteMN, 30, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto, ImporteME:=ImporteME) Then + MsgError = "No se pudo insertar la póliza" + End If + + If Pago.CveMonedaPago = 2 AndAlso UsaComplementariaBancos Then + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, (Pago.ImportePago * Pago.TCPago - Pago.ImportePago).RoundSQL, 204, Referencia, ConceptoMovimiento, IdCuentaBancariaComplementaria, CveIE:=CveIE, CveProveedor:=CveProveedor, ImporteME:=Pago.ImportePago, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then + MsgError = "No se pudo insertar la póliza" + End If + End If End If Case "2" 'FyE @@ -1471,6 +1506,8 @@ Partial Class Bancos_PopIECompras If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" + Else + Exit For End If End If Next @@ -1492,6 +1529,8 @@ Partial Class Bancos_PopIECompras Pago.TipoPago = "DD" If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" + Else + Exit For End If End If Next @@ -1513,7 +1552,10 @@ Partial Class Bancos_PopIECompras Pago.TipoPago = "DD" If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" + Else + Exit For End If + End If Next @@ -1533,17 +1575,20 @@ Partial Class Bancos_PopIECompras End If If MsgError = "" Then - Dim VentaActual As New Venta With {.CveVenta = rw.DataKey("CveVenta").ToEntero, .CveCliente = rw.DataKey("CveCliente").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal} + Dim VentaActual As New Venta With {.CveVenta = rw.DataKey("CveVenta").ToEntero, .ClienteNombre = NombreCliente, .SerieFolio = rw.DataKey("SerieFolio"), .CveCliente = rw.DataKey("CveCliente").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal, .CveSubProyecto = rw.DataKey("CveSubProyecto").ToEntero, .CveMoneda = rw.DataKey("CveMoneda").ToEntero} Dim PagoVenta As New VentaPago PagoVenta.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero PagoVenta.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal + PagoVenta.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal PagoVenta.TCPago = rw.DataKey("TipoCambio").ToDecimal PagoVenta.CveCompraRelacionada = CompraActual.CveCompra - PagoVenta.TipoPago = "XX" + PagoVenta.TipoPago = "Venta" If AplicaPrePolizaPagoVenta(VentaActual, PagoVenta, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" End If + Else + Exit For End If End If Next @@ -1551,28 +1596,44 @@ Partial Class Bancos_PopIECompras Case Else ImportePagado = 0 End Select + Dim ObjConta As ClsContPAQi = Nothing If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If ObjMov.ValorPolizaDescuadre > 0 Then MsgError = ObjMov.MensajePolizaDescuadre GuardaLogAD($"Bancos/PopIECompras | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + Else + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then + ObjConta = New ClsContPAQi(UsuarioActual.Empresa) + ObjConta.IniciaTransacSQL() + End If + If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjConta) Then + IdPoliza = ObjMov.ContaIdPoliza + Else + Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico" + End If + End If End If End If If MsgError = "" Then - ObjIE.Commit() + + ObjIE.Commit() + If ObjConta IsNot Nothing Then ObjConta.Commit() Dim StrMsg As New StringBuilder StrMsg.Append("El Documento se guardó correctamente.
") If TipoTransaccion = "Egs" AndAlso CveIE > 0 Then GeneraChequePDF(CveIE, UsuarioActual.Empresa) - If IdPoliza > 0 Then - StrMsg.AppendFormat("
Ver Póliza", IdPoliza) - End If + If IdPoliza > 0 Then StrMsg.AppendFormat("
Ver Póliza", IdPoliza) + If RBLContado.SelectedValue.ToEntero = 6 And ChkEmitirComplementoPago.Checked Then GeneraTimbre(CvePrePoliza) Else Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") EnviarCorreoNotificacion(CveIE, NotificarA, "", UsuarioActual, False) Else - ObjIE.RollBack() + ObjIE.RollBack() + If ObjConta IsNot Nothing Then ObjConta.RollBack() Alert(MsgError, TipoMensaje.MsgError) End If diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 0ee519115..28ee2316a 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -1122,7 +1122,7 @@ Partial Class Bancos_PopIEVentas trCuentaDeposito.Visible = False Dim Dep As New ClsGenerales - If Dep.GetCuentasDepositos(CveCliente:=CveCliente) Then + If Dep.GetCuentasDepositos(CveCliente:=CveCliente, CveEmpresa:=UsuarioActual.CveEmpresa) Then If DdlTipoTransaccion.SelectedValue = "9" Then DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") @@ -1905,13 +1905,6 @@ Partial Class Bancos_PopIEVentas PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA - Dim IdCtaIVAXTrasladar As Integer = 0 - - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero - End If - - IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) Case 61 'Iva Trasladado If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then @@ -1937,13 +1930,7 @@ Partial Class Bancos_PopIEVentas If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA - Dim IdCtaIVATrasladado As Integer = 0 - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero - End If - - IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) Case 38 'IEPS por trasladar If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then @@ -2078,7 +2065,6 @@ Partial Class Bancos_PopIEVentas Case 64 'Ganancia If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria Dim tImporteVenta, tImportePago, Diferencia As Decimal ImporteMovimiento = 0 @@ -2100,11 +2086,9 @@ Partial Class Bancos_PopIEVentas If tImporteVenta <> tImportePago Then If tImporteVenta < tImportePago Then ConceptoContable = 64 - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria TipoMovimiento = True Else ConceptoContable = 65 - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria TipoMovimiento = False End If Diferencia = Math.Abs(tImporteVenta - tImportePago) diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 2cdd0c17f..186558956 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1877,10 +1877,10 @@ Partial Class Bancos_ProveedoresAbonar Dim IdCtaIVAXAcreditar As Integer = 0 Dim IdCtaIVAAcreditable As Integer = 0 - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero - End If + 'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + ' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + ' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + 'End If Dim IVA As Decimal = PorcentajePago * gr.DataKey("IVA").ToDecimal @@ -1930,11 +1930,11 @@ Partial Class Bancos_ProveedoresAbonar End If If TCCompra > TCPago Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then MsgError = "Ocurrio un error al saldar el movimiento" End If Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then MsgError = "Ocurrio un error al saldar el movimiento" End If End If diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx index 54bfe794e..701a2ed2c 100644 --- a/Bancos/Transferencias.aspx +++ b/Bancos/Transferencias.aspx @@ -30,7 +30,7 @@ Tipo Movimiento: - + Cheque Emitido Transferencia Bancaria @@ -127,7 +127,12 @@ Paguese - + + + + Observaciones: @@ -138,7 +143,7 @@
- + diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index e649693cd..1d343190b 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -42,7 +42,9 @@ Partial Class Bancos_Transferencias #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + tCveMonedaOrigen = 0 tCveMonedaDestino = 0 If Request("OPC") IsNot Nothing AndAlso IsNumeric(Request("OPC")) Then @@ -70,6 +72,8 @@ Partial Class Bancos_Transferencias TxtFechaDocumento.Text = Now.ToShortDateString + DdlTipoMovto_SelectedIndexChanged(Nothing, Nothing) + End If End Sub @@ -281,20 +285,26 @@ Partial Class Bancos_Transferencias Observaciones = TxtObservaciones.Text.Trim End If - If Opcion = 1 Then + + If Opcion = 1 Then 'ESTO ES TRANSFERENCIA ENTRE CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = CveIE Else + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then FolioDestino = TxtFolio.Text.Trim If TxtPaguese.Text.Trim <> "" Then CuentaDestino = TxtPaguese.Text.Trim End If - + Else + If DdlTipoMovto.SelectedValue.ToEntero = 1 Then + CuentaDestino = TxtPaguese.Text.Trim + End If End If CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TxtFechaDocumento.Text.Trim.ToDate, FolioDestino, String.Format("Transferencia Cta: {0}", DdlCuentaOrigen.SelectedItem.Text), ImporteDestino, CveMonedaDestino, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + End If Dim CveIEDevolucion As Integer = -1 @@ -636,12 +646,21 @@ Partial Class Bancos_Transferencias Private Sub DdlTipoMovto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoMovto.SelectedIndexChanged + RFVTxtPaguese.Visible = False + If Opcion = 1 Then CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) Else CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) + + If DdlTipoMovto.SelectedValue.ToEntero = 1 And Opcion <> 1 Then 'CHEQUE ACTIVA EL REQUIRED DE TxtPaguese + RFVTxtPaguese.Visible = True + End If + End If + UPPDatos.Update() + End Sub Protected Sub RBLOpcion_SelectedIndexChanged(sender As Object, e As EventArgs) diff --git a/CRM/RegPrePolizaS.aspx.vb b/CRM/RegPrePolizaS.aspx.vb deleted file mode 100644 index bcb621de3..000000000 --- a/CRM/RegPrePolizaS.aspx.vb +++ /dev/null @@ -1,2083 +0,0 @@ - - -Imports System.Data -Imports Extensiones -Imports System.Linq -Imports System.Web.Services -Imports GemBox.Spreadsheet -Imports Microsoft.Reporting.WebForms -Imports System.IO -Imports iTextSharp.text.pdf - -Partial Class ContabilidadC_RegPrePolizaS - Inherits ClsPaginas - - -#Region "Propiedades" - Public Property ArregloMovs As ArrayList - Get - Return CType(ViewState("ArregloMovs"), ArrayList) - End Get - Set(value As ArrayList) - ViewState("ArregloMovs") = value - End Set - End Property - Public Property DtMovimientos As DataTable - Get - Return CType(ViewState("DtMovimientos"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtMovimientos") = value - End Set - End Property - Public Property DtCuentasContables As DataTable - Get - Return CType(ViewState("DtCuentasContables"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtCuentasContables") = value - End Set - End Property - Public Property TipoPlantilla As Integer - Get - Return CType(ViewState("TipoPlantilla"), Integer) - End Get - Set(value As Integer) - ViewState("TipoPlantilla") = value - End Set - End Property - Public Property CveMoneda As Integer - Get - Return CType(ViewState("CveMoneda"), Integer) - End Get - Set(value As Integer) - ViewState("CveMoneda") = value - End Set - End Property - Private ReadOnly Property CvePrePoliza As Integer - Get - Return ViewState("CvePrePoliza").ToString.ToEntero - End Get - End Property - - 'PARA CREAR IE - Private Property CveConcepto As Integer - Get - Return ViewState("CveConcepto").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveConcepto") = value - End Set - End Property - Private Property CveTipoTransaccion As Integer - Get - Return ViewState("CveTipoTransaccion").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveTipoTransaccion") = value - End Set - End Property - Private Property CveCuenta As Integer - Get - Return ViewState("CveCuenta").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveCuenta") = value - End Set - End Property - Private Property Folio As String - Get - Return ViewState("Folio").ToString - End Get - Set(value As String) - ViewState("Folio") = value - End Set - End Property - Private Property ImporteDocumento As Decimal - Get - Return ViewState("ImporteDocumento").ToString.ToDecimal - End Get - Set(value As Decimal) - ViewState("ImporteDocumento") = value - End Set - End Property - Private Property Observaciones As String - Get - Return ViewState("Observaciones").ToString - End Get - Set(value As String) - ViewState("Observaciones") = value - End Set - End Property - Private Property Beneficiario As String - Get - Return ViewState("Beneficiario").ToString - End Get - Set(value As String) - ViewState("Beneficiario") = value - End Set - End Property - Private Property RowIndex As Integer - Get - Return ViewState("RowIndex").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("RowIndex") = value - End Set - End Property - Private Property Actualizar As Boolean - Get - Return CBool(ViewState("Actualizar").ToString) - End Get - Set(value As Boolean) - ViewState("Actualizar") = value - End Set - End Property - - Private ReadOnly Property CvePeriodo As Integer - Get - Return CType(ViewState("CvePeriodo"), Integer) - End Get - End Property - Private ReadOnly Property CveProyecto As Integer - Get - Return CType(ViewState("CveProyecto"), Integer) - End Get - End Property - Private ReadOnly Property CveSubProyecto As Integer - Get - Return CType(ViewState("CveSubProyecto"), Integer) - End Get - End Property - Private ReadOnly Property CveTurno As Integer - Get - Return CType(ViewState("CveTurno"), Integer) - End Get - End Property - Public Property IndiceGrid As Integer - Get - Return CType(ViewState("IndiceGrid"), Integer) - End Get - Set(value As Integer) - ViewState("IndiceGrid") = value - End Set - End Property - Public Property IdPoliza As Integer - Get - Return CType(ViewState("IdPoliza"), Integer) - End Get - Set(value As Integer) - ViewState("IdPoliza") = value - End Set - End Property - Public Property Tick As String - Get - Return CType(ViewState("Tick"), String) - End Get - Set(value As String) - ViewState("Tick") = value - End Set - End Property - - Public Property CveIE As Integer - Get - Return CType(ViewState("CveIE"), Integer) - End Get - Set(value As Integer) - ViewState("CveIE") = value - End Set - End Property - - Public Property TipoPoliza As String - Get - Return CType(ViewState("TipoPoliza"), String) - End Get - Set(value As String) - ViewState("TipoPoliza") = value - End Set - End Property -#End Region - - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - - If Not Page.IsPostBack Then - Tick = DateTime.Now.Ticks.ToString - - CveMoneda = 1 - ViewState("CvePrePoliza") = 0 - ViewState("CvePeriodo") = "0" - CveConcepto = -1 - CveTipoTransaccion = -1 - CveCuenta = -1 - Folio = "-1" - ImporteDocumento = -1 - Observaciones = "-1" - Beneficiario = "-1" - Actualizar = False - IdPoliza = -1 - - - If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then - DivTipoGasto.Visible = True - ThTipoGasto.Visible = True - CargaTiposGasto() - End If - - If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then - ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero - CreaDT() - CargaPrePoliza() - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then - GvPrePoliza.Columns(5).Visible = False - DivTG.Visible = False - GvMov.Columns(5).Visible = False - End If - - Exit Sub - Else - CreaDT() - BtnEliminar.Visible = False - LnkExcel.Visible = True - LnkImprimirPDF.Visible = False - End If - - - TipoPlantilla = -1 - If IfNull(Request("Tipo"), "").ToString = "Ing" Then - TipoPlantilla = 1 - LblEncabezado.Text = "Otros Ingresos" - End If - - CargaPlantillas(TipoPlantilla) - - If UsuarioActual.CveRol = 1 Then trNotificar.Visible = True - - CargaConceptos() - CargaSubProyectos() - CargaCuentasContables() - - 'crea tabla temporal - ArregloMovs = New ArrayList - - CargaCuentas() - - 'If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then - ' ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero - ' ViewState("CveProyecto") = Request("CveProyecto").ToEntero - ' ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero - ' ViewState("CveTurno") = Request("CveTurno").ToEntero - - ' DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) - ' DdlPlantilla.SelectedValue = "61" - ' DdlPlantilla.Enabled = False - ' DivAgregarConceptos.Visible = False - - ' CargaNomina() - - ' RegistraScript("$(document).ready(function () { calculateCargo(); Sys.Application.add_load(function (s, e) { calculateCargo(); }); } );", 1) - ' RegistraScript("$(document).ready(function () { calculateAbono(); Sys.Application.add_load(function (s, e) { calculateAbono(); }); } );", 2) - ' RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3) - 'End If - - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then - GvPrePoliza.Columns(4).Visible = False - GvMov.Columns(4).Visible = False - End If - - - - End If - - End Sub - - Private Sub CreaDT() - DtMovimientos = New DataTable("Movimientos") - Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True - With DtMovimientos.Columns - .Add("CodigoCuenta", Type.GetType("System.String")) - .Add("Cuenta", Type.GetType("System.String")) - .Add("Referencia", Type.GetType("System.String")) - .Add("Concepto", Type.GetType("System.String")) - .Add("Cargo", Type.GetType("System.Double")) - .Add("Abono", Type.GetType("System.Double")) - .Add("TipoMovto", Type.GetType("System.Int32")) - .Add("EsComodin", Type.GetType("System.Int32")) - .Add("CveConcepto", Type.GetType("System.Int32")) - .Add("CveSubProyecto", Type.GetType("System.Int32")) - .Add("Descripcion", Type.GetType("System.String")) - .Add("CveProveedor", Type.GetType("System.Int32")) - .Add("CvePersonal", Type.GetType("System.Int32")) - .Add("CveCompra", Type.GetType("System.Int32")) - .Add("CveCliente", Type.GetType("System.Int32")) - .Add("CveVenta", Type.GetType("System.Int32")) - .Add("CveClasificacion", Type.GetType("System.Int32")) - .Add("MultipleSubProyecto", Type.GetType("System.Boolean")) - .Add("CveTipoGasto", Type.GetType("System.Int32")) - .Add("CvePrePolizaDetalle", Type.GetType("System.Int32")) - .Add("CveConceptoContable", Type.GetType("System.Int32")) - .Add("IdCtaContable", Type.GetType("System.Int32")) - .Add("ConceptoContable", Type.GetType("System.String")) - .Add("CveCuenta", Type.GetType("System.Int32")) - End With - End Sub - - 'Private Sub CargaNomina() - ' Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero - ' Dim ObjNomina As New ClsNominas - ' Dim ObjConta As New ClsContabilidad - - ' Dim Dt As DataTable = Nothing - ' Dim Cuenta As String = "" - ' Dim Concepto As String = "" - ' Dim IdCuenta As Integer = 0 - ' Dim TipoMovto As Integer - ' Dim CveConcepto As Integer - ' Dim CodigoCuenta As String = "" - ' Dim NombreCuenta As String = "" - ' Dim Referencia As String = "" - ' Dim EsComodin As Integer = 0 - ' DtMovimientos.Clear() - - ' If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then - ' Dt = ObjNomina.DtResultados - - ' For Each drt As DataRow In Dt.Rows - ' Dim dr As DataRow = DtMovimientos.NewRow - - ' If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then - ' CveConcepto = 98 - ' Cuenta = "Nominas por Pagar" - ' IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero - ' Concepto = "Pago Nomina" - ' Referencia = "Pago Nomina" - ' Else - ' Concepto = drt("NombreCompleto") - ' Referencia = "" - ' CveConcepto = drt("CveConceptoContable").ToString.ToEntero - ' Cuenta = drt("ConceptoContable").ToString - ' IdCuenta = drt("IdCtaContable").ToString.ToEntero - ' End If - - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}") - ' CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "") - ' NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "") - - ' TipoMovto = drt("TipoMovto") - - ' If TipoMovto = 0 Then - ' dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal) - ' dr("Abono") = 0 - ' Else - ' dr("Cargo") = 0 - ' dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal) - ' End If - - ' dr("IdCuenta") = IdCuenta - ' dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - ' dr("Cuenta") = Cuenta - ' dr("Concepto") = Concepto - ' dr("Descripcion") = Concepto - ' dr("Referencia") = Referencia - ' dr("TipoMovto") = TipoMovto - ' dr("EsComodin") = EsComodin - ' dr("CveConcepto") = CveConcepto - ' dr("CveProveedor") = "-1" - ' dr("CveSubProyecto") = drt("CveSubProyecto") - ' dr("CvePersonal") = drt("CvePersonal") - ' dr("CveClasificacion") = drt("CveClasificacion") - ' dr("CveTipoGasto") = drt("CveTipoGasto") - - ' DtMovimientos.Rows.Add(dr) - ' Next - - ' GvMov.DataSource = DtMovimientos - ' GvMov.DataBind() - ' UPMovs.Update() - ' End If - - 'End Sub - - Private Sub CargaPrePoliza() - BtnEliminar.Visible = True - LblEncabezado.Text = "Edición de Póliza" - - Dim ObjContabilidad As New ClsContabilidad - If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then - Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("") - If dr IsNot Nothing Then - DivAgregarConceptos.Visible = False - DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza") - TxtFechaDocumento.Text = dr("Fecha") - TxtConcepto.Text = dr("Concepto") - DivDatosPoliza.Visible = True - TipoPoliza = DdlTipoPoliza.SelectedItem.Text - Folio = dr("FolioPoliza").ToString - - If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then - 'DivAgregarConceptos.Visible = True - LnkAddConcepto.Visible = True - CargaConceptos() - CargaSubProyectos() - CargaCuentasContables() - End If - - ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza) - - DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - - If UsuarioActual.CveRol = 1 AndAlso DtMovimientos.COUNT("TC", "TC > 1") > 0 Then - GvPrePoliza.Columns(7).Visible = True - End If - - If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then - LnkComplementoPago.Visible = True - End If - - If UsuarioActual.Empresa.TipoContabilizacion = 1 Then - If dr("FolioPoliza").ToString.ToEntero > 0 Then - divContabilizada.Visible = True - LblFolio.Text = dr("FolioPoliza").ToString - Folio = dr("FolioPoliza").ToString - - End If - Else - If dr("IdPoliza").ToString.ToEntero > 0 Then - HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) - divContabilizada.Visible = True - IdPoliza = dr("IdPoliza").ToString.ToEntero - ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then - 'sino está contabilizada, se activa el botón - BtnContabilizar.Visible = True - End If - End If - - divDatosPrincipales.Visible = False - divObservaciones.Visible = False - UPMovs.Visible = False - UPMovs.Update() - UPPDocumento.Update() - UpPrePoliza.Update() - - RegistraScript("comparar();") - - If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then - 'For Each row As GridViewRow In GvPrePoliza.Rows - ' row.FCTextBox("TxtCargo").Enabled = False - ' row.FCTextBox("TxtAbono").Enabled = False - 'Next - End If - LnkExcel.Visible = False - LnkImprimirPDF.Visible = True - Else - Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) - BtnEliminar.Visible = False - End If - - End If - - ObjContabilidad.Dispose() - UpPoliza.Update() - End Sub - - Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound - - If e.Row.RowType = DataControlRowType.DataRow Then - - ''Asignamos los Subproyectos - 'e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - 'e.Row.FCDropDownList("DdlSubProyecto").DataBind() - 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) - 'e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto")) - - 'Asignamos los Tipos de Gasto - 'e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - 'e.Row.FCDropDownList("DdlTipoGasto").DataBind() - 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) - 'e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto")) - - 'ASignamos las CuentasContables - 'e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas") - 'e.Row.FCDropDownList("DdlCtaContable").DataBind() - 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) - 'e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable")) - - If e.Row.DataKey("IdCtaContable") > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", e.Row.DataKey("IdCtaContable"))) - If drr IsNot Nothing Then - e.Row.FCLiteral("DdlCtaContable").Text = drr("CuentaFormato").ToString() + " - " + drr("Nombre").ToString() - End If - End If - - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCLiteral("TxtCargo").Text.ToDouble).ToString.FormatoNumero - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCLiteral("TxtAbono").Text.ToDouble).ToString.FormatoNumero - - Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero - - If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) - If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) - If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) - If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) - - 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable - - End If - - If e.Row.RowType = DataControlRowType.Header Then - 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind() - 'e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1")) - End If - - End Sub - - Private Sub CargaPlantillas(TipoPlantilla As Integer) - - 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - 'GvPlantillas.DataBind() - - If UsuarioActual.CveEmpresa.Contiene(120) Then - DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) - DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) - - Else - DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - - End If - - - DdlPlantilla.DataBind() - DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) - - DdlPlantilla2.DataBind() - DdlPlantilla2.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) - End Sub - - Private Sub CargaConceptos() - DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1) - DdlConceptosContables.DataBind() - End Sub - - Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then - CargaProveedores() - DdlProveedores.Visible = True - DdlCompras.Visible = True - Else - DdlProveedores.Visible = False - DdlCompras.Visible = False - End If - - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then - CargaPersonal() - DdlPersonal.Visible = True - Else - DdlPersonal.Visible = False - End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then - CargaClientes() - DdlClientes.Visible = True - DdlVentas.Visible = True - Else - DdlClientes.Visible = False - DdlVentas.Visible = False - End If - End Sub - - Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged - CargaCompras(DdlProveedores.SelectedValue.ToEntero) - End Sub - - Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange - CargaVentas(DdlClientes.SelectedValue.ToEntero) - End Sub - - Private Sub CargaSubProyectos() - DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem(" - ", "-1")) - DdlSubProyectoFiltroMov.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubProyectoFiltroMov.DataBind() - DdlSubProyectoFiltroMov.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - - Private Sub CargaCuentasContables() - Dim ObjConta As New ClsContabilidad - If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then - DdlCtaContable.DataSource = ObjConta.DtResultados - DtCuentasContables = ObjConta.DtResultados - End If - ObjConta.Dispose() - DdlCtaContable.DataBind() - DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - - Private Sub CargaTiposGasto() - DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - DdlTipoGasto.DataBind() - DdlTipoGasto.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - - Private Sub CargaProveedores() - DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedores.DataBind() - DdlProveedores.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - Private Sub CargaCompras(CveProveedor As Integer) - If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then - Dim ObjCompras As New ClsCompras - - DdlCompras.ClearSelection() - If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then - DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") - DdlCompras.DataBind() - DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlCompras.DataSource = Nothing - DdlCompras.DataBind() - DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjCompras.Dispose() - End If - End Sub - - Private Sub CargaClientes() - DdlClientes.setEsWebService(True) - DdlClientes.Attributes.Add("data-metodo", "getcliente") - DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientes.DataBind() - ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - Private Sub CargaVentas(CveCliente As Integer) - Dim ObjVentas As New ClsVentas - - DdlVentas.ClearSelection() - If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") - DdlVentas.DataBind() - DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlVentas.DataSource = Nothing - DdlVentas.DataBind() - DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjVentas.Dispose() - End Sub - - Private Sub CargaPersonal() - DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlPersonal.DataBind() - DdlPersonal.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - - Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged - - TxtTotalAbonos.Text = "" - TxtTotalCargos.Text = "" - - If DdlPlantilla.SelectedValue.ToEntero <= 0 Then - Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia) - DdlPlantilla.SelectedValue = "-1" - Exit Sub - End If - - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada - DivAgregarConceptos.Visible = True - Else - DivAgregarConceptos.Visible = False - End If - - - - Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero - - Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") - Dim Cuenta As String = "" - Dim IdCuenta As Integer = 0 - Dim CodigoCuenta As String = "" - Dim NombreCuenta As String = "" - Dim EsComodin As Integer = 0 - DtMovimientos.Clear() - - For Each drt As DataRow In Dt.Rows - - Cuenta = drt("ConceptoContable").ToString - IdCuenta = 0 - CodigoCuenta = "" - NombreCuenta = "" - If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) - If drr IsNot Nothing Then - IdCuenta = drt("IdCtaContable").ToString.ToEntero - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - 'Cuenta = drr("Nombre").ToString() - End If - EsComodin = 0 - End If - - Dim dr As DataRow = DtMovimientos.NewRow - - dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - dr("Cuenta") = Cuenta 'TxtCuentaContable.Text - dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) - dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) - dr("EsComodin") = EsComodin - dr("CveConcepto") = drt("CveConcepto") - dr("CveSubProyecto") = drt("CveSubProyectoNegativo") - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("CveProveedor") = drt("CveProveedor") - dr("CvePersonal") = drt("CvePersonal") - dr("CveClasificacion") = -1 - dr("MultipleSubProyecto") = drt("MultipleSubProyecto") - dr("CveCuenta") = drt("CveCuenta") - 'dr("FolioPoliza") = 0 'drt("FolioPoliza") - - DtMovimientos.Rows.Add(dr) - Next - - - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - - End Sub - - Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - - e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left - e.Row.Height = Unit.Pixel(1) - e.Row.Cells(0).ToolTip = e.Row.DBCampo("CveCuenta") - - If e.Row.DBCampo("TipoMovto") = "1" Then - e.Row.FCTextBox("TxtAbono").Visible = True - Else - e.Row.FCTextBox("TxtCargo").Visible = True - End If - - e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono")) - e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo")) - e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion") - - If CvePeriodo > 0 Then - e.Row.FCTextBox("TxtCargo").Enabled = False - e.Row.FCTextBox("TxtAbono").Enabled = False - End If - - e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - e.Row.FCDropDownList("DdlSubProyecto").DataBind() - e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) - e.Row.FCDropDownList("DdlSubProyecto").SelectedValue = e.Row.DBCampo("CveSubProyecto") - - 'Asignamos los Tipos de Gasto - e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - e.Row.FCDropDownList("DdlTipoGasto").DataBind() - e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) - e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto") - - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada - e.Row.FCDropDownList("DdlSubProyecto").Enabled = True - e.Row.FCLinkButton("imgD").Visible = True - Else - e.Row.FCDropDownList("DdlSubProyecto").Enabled = False - End If - - If e.Row.DBCampo("MultipleSubProyecto") = "True" Then - e.Row.FCDropDownList("DdlSubProyecto").Enabled = True - End If - - 'Agregamos la opcion para vincular los movimientos bancarios - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then - Dim ObjMovimientos As New ClsMovimientos - Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos") - - Select Case e.Row.DataKey("CveConcepto").ToEntero - - 'Acreedores - Case 41 - If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then - DdlSaldos.Visible = True - DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}") - DdlSaldos.DataBind() - DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - - End Select - - ObjMovimientos.Dispose() - End If - - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then - e.Row.FCLinkButton("ImgBancos").Visible = True - - - If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then - e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" - End If - End If - End If - End Sub - - Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click - Dim TotalCargos, TotalAbonos As Decimal - - If CvePrePoliza > 0 Then - TotalCargos = TxtTotalCargos.Text.ToDecimal - TotalAbonos = TxtTotalAbonos.Text.ToDecimal - Else - For Each Gvr As GridViewRow In GvMov.Rows - TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal - TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal - Next - End If - - If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then - Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - If CvePrePoliza > 0 Then - 'Nuevo Modulo Charlie - ActualizarPrePoliza() - Else - Dim MensajeAlert = New StringBuilder - Dim ObjIE As New ClsBancos() - Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) - ' Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL) - Dim Conta As ClsContPAQi = Nothing - Dim IDPoliza As Integer = 0 - Dim MsgError As String = "" - Dim CveIE As Integer - Dim FolioIE As String = "" - - Try - Dim CvePrePoliza As Integer - Dim ConceptoPoliza As String = TxtObservaciones.Text - CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) - - If CvePrePoliza > 0 Then - Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" - Dim idCuentaContabilizacion As Long = 1 - Dim Importe As Double = 0 - Dim TipoMovto As Boolean = False - Dim IdCtaContable As Integer = 0 - - 'Registra movimieno bancario - If CveConcepto = 30 Then - CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" - If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then - FolioIE = ObjIE.Folio - End If - End If - - - - 'inserto las compras que voy a pagarDdlSaldos - For Each gvr As GridViewRow In GvMov.Rows - 'If gvr.DataKey("IDCuenta").ToEntero > 0 Then - ' IdCtaContable = gvr.DataKey("IDCuenta") - 'End If - - If gvr.DataKey("TipoMovto").ToDouble > 0 Then - Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble - TipoMovto = True - Else - Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble - TipoMovto = False - End If - - If CveConcepto <> 30 Then - - If CveConcepto = 41 Then - CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero - Else - CveIE = -1 - End If - - End If - - - If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then - idCuentaContabilizacion = 0 - End If - If Importe <> 0 Then - Dim tCveCuenta As Integer = gvr.DataKey("CveCuenta").ToEntero - - 'If gvr.datakey("CveConcepto") = "299" Then - ' tCveCuenta = gvr.DataKey("CveCuenta").ToEntero - 'End If - - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text, - TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE, - CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveCompra:=gvr.DataKey("CveCompra").ToEntero, - CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero, - ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, - CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCuenta:=tCveCuenta) Then - Else - MsgError = "No se pudo insertar el detalle de la póliza2" - Exit For - End If - End If - Next - - If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then - If ObjMov.ValorPolizaDescuadre > 0 Then - GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - MsgError = ObjMov.MensajePolizaDescuadre - End If - End If - - - 'El movimiento 2 es el de Pago - If ChkAutoConta.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If idCuentaContabilizacion > 0 Then - If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - - 'MENSAJE PRINCIPAL - MensajeAlert.AppendFormat("

Folio de Salida: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) - 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) - Else - Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") - End If - Else - Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas") - End If - Else - MensajeAlert.AppendFormat("

Folio: {1}", CvePrePoliza, ObjMov.ContaFolio) - End If - - Else - MsgError = "No se pudo insertar la póliza" - End If - Catch ex As Exception - MsgError = "Error" - End Try - - If MsgError = "" Then - 'MENSAJE IE - If CveIE Then - MensajeAlert.AppendFormat("

Folio Bancario: {1}", CveIE, FolioIE) - Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") - Else - Alert(If(MensajeAlert.ToString = "", "Se registro con exito.", MensajeAlert.ToString), TipoMensaje.MsgInformacion, "window.location.reload()") - End If - - ObjIE.Commit() - If Conta IsNot Nothing Then Conta.Commit() - - UPPDocumento.Update() - - TxtObservaciones.Text = "" - GvMov.DataBind() - TxtFecha.Text = "" - TxtObservaciones.Text = "" - Else - Alert(MsgError.ToString, ModExtensiones.TipoMensaje.MsgError) - ObjIE.RollBack() - If Conta IsNot Nothing Then Conta.RollBack() - End If - - ObjIE.Dispose() - ObjMov.Dispose() - If Conta IsNot Nothing Then Conta.Dispose() - End If - End Sub - - Private Sub ActualizarPrePoliza() - - Dim OcurrioError As Boolean = False - Dim ObjContabilidad As New ClsContabilidad - ObjContabilidad.IniciaTransacSQL() - - ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) - - For Each row As GridViewRow In GvPrePoliza.Rows - If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then - If row.FCCheckBox("chkModificado").Checked Then - If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, - row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, - row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), - CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, - CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, CveCuenta:=row.DataKey("CveCuenta").ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - OcurrioError = True - Exit For - End If - End If - Else - If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, - row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString, - row.DataKey("CveConceptoContable").ToEntero, row.FCLiteral("TxtConcepto").Text, Now, - row.DataKey("IdCtaContable").ToEntero, 0, CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero, - CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), - ImporteMX:=If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, - row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveProveedor:=row.DataKey("CveProveedor").ToEntero, - CveCompra:=row.DataKey("CveCompra").ToEntero, CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, - CvePersonal:=row.DataKey("CvePersonal").ToEntero) Then - OcurrioError = True - Exit For - End If - End If - - Next - - If Not OcurrioError Then - ObjContabilidad.Commit() - Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion) - Else - ObjContabilidad.RollBack() - Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError) - End If - - ObjContabilidad.Dispose() - CargaPrePoliza() - End Sub - Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs) - RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) - LtlTitulo.Text = "Agregar Concepto" - BtnAceptar.Text = "Agregar" - LimpiaCampos() - - CargaConceptosContablesE() - CargaSubProyectoE() - CargaTipoGastoE() - CargaCtaContableE() - - - UpdatePanel1.Update() - End Sub - Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating - RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) - LtlTitulo.Text = "Editar Concepto" - BtnAceptar.Text = "Aceptar" - LimpiaCampos() - IndiceGrid = e.RowIndex - - Dim CveConceptoContable As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveConceptoContable").ToEntero - Dim CveProveedor As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveProveedor").ToEntero - Dim CveCompra As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCompra").ToEntero - Dim CvePersonal As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CvePersonal").ToEntero - Dim CveCliente As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCliente").ToEntero - Dim CveVenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveVenta").ToEntero - 'Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text - Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtConcepto").Text - Dim Referencia As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtRef").Text - Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveSubProyecto").ToString.ToEntero - Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveTipoGasto").ToString.ToEntero - Dim CveCuenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCuenta").ToString.ToEntero - Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDouble - Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDouble - - CargaConceptosContablesE() - DdlConceptosContablesE.SelectedValueExist(CveConceptoContable) - DdlConceptosContablesE_SelectedIndexChanged(DdlConceptosContablesE, e) - - DdlProveedoresE.SelectedValueExist(CveProveedor) - DdlProveedoresE_SelectedIndexChanged(DdlProveedoresE, e) - DdlComprasE.SelectedValueExist(CveCompra) - - DdlPersonalE.SelectedValueExist(CvePersonal) - - DdlClientesE.SelectedValue = CveCliente - DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") - DdlClientesE_SelectedIndexChanged(DdlClientesE, e) - DdlVentasE.SelectedValueExist(CveVenta) - - TxtConceptoE.Text = Concepto - TxtReferenciaE.Text = Referencia - - CargaSubProyectoE() - DdlSubProyectoE.SelectedValueExist(CveSubProyecto) - CargaTipoGastoE() - DdlTipoGastoE.SelectedValueExist(CveTipoGasto) - CargaCtaContableE() - DdlCtaContableE.SelectedValueExist(CveCuenta) - - If Cargo <> 0 Then - TxtCargoE.Text = Cargo - End If - - If Abono <> 0 Then - TxtAbonoE.Text = Abono - End If - - UpdatePanel1.Update() - - End Sub - Private Sub LimpiaCampos() - IndiceGrid = -1 - TxtConceptoE.Text = "" - TxtCargoE.Text = "" - TxtAbonoE.Text = "" - TxtReferenciaE.Text = "" - End Sub - Private Sub CargaConceptosContablesE() - DdlConceptosContablesE.DataSource = GlobalDTContaConceptosContables(-1) - DdlConceptosContablesE.DataBind() - End Sub - Private Sub CargaSubProyectoE() - DdlSubProyectoE.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubProyectoE.DataBind() - DdlSubProyectoE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub CargaTipoGastoE() - DdlTipoGastoE.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - DdlTipoGastoE.DataBind() - DdlTipoGastoE.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - Private Sub CargaCtaContableE() - Dim ObjConta As New ClsContabilidad - If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then - DdlCtaContableE.DataSource = ObjConta.DtResultados - End If - ObjConta.Dispose() - - DdlCtaContableE.DataBind() - DdlCtaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then - CargaProveedoresE() - DdlProveedoresE.Visible = True - DdlComprasE.Visible = True - Else - DdlProveedoresE.Visible = False - DdlComprasE.Visible = False - End If - - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(28, 29) Then - CargaPersonalE() - DdlPersonalE.Visible = True - Else - DdlPersonalE.Visible = False - End If - - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(51) Then - CargaClasificacionesE() - DdlClasificacionesE.Visible = True - Else - DdlClasificacionesE.Visible = False - End If - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then - CargaClientesE() - DdlClientesE.Visible = True - DdlVentasE.Visible = True - Else - DdlClientesE.Visible = False - DdlVentasE.Visible = False - End If - End Sub - Private Sub CargaProveedoresE() - DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedoresE.DataBind() - DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub CargaComprasE(CveProveedor As Integer) - If Not DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(21) Then - Dim ObjCompras As New ClsCompras - - DdlComprasE.ClearSelection() - If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then - DdlComprasE.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") - DdlComprasE.DataBind() - DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlComprasE.DataSource = Nothing - DdlComprasE.DataBind() - DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjCompras.Dispose() - End If - End Sub - Private Sub CargaClientesE() - DdlClientesE.setEsWebService(True) - DdlClientesE.Attributes.Add("data-metodo", "getcliente") - DdlClientesE.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientesE.DataBind() - ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub CargaVentasE(CveCliente As Integer) - Dim ObjVentas As New ClsVentas - - DdlVentasE.ClearSelection() - If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") - DdlVentasE.DataBind() - DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlVentasE.DataSource = Nothing - DdlVentasE.DataBind() - DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjVentas.Dispose() - End Sub - Private Sub CargaPersonalE() - DdlPersonalE.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlPersonalE.DataBind() - DdlPersonalE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - Private Sub CargaClasificacionesE() - DdlClasificacionesE.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) - DdlClasificacionesE.DataBind() - DdlClasificacionesE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub DdlProveedoresE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedoresE.SelectedIndexChanged - CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero) - End Sub - Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange - CargaVentasE(DdlClientesE.SelectedValue.ToEntero) - End Sub - Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click - - If IndiceGrid = -1 Then - If DtMovimientos Is Nothing Then CreaDT() - If CvePrePoliza > 0 Then - Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = DdlCtaContableE.SelectedValue - dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - dr("Concepto") = TxtConceptoE.Text - dr("Referencia") = TxtReferenciaE.Text - dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - dr("Cargo") = TxtCargoE.Text.ToDouble - dr("Abono") = TxtAbonoE.Text.ToDouble - dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text - dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) - - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - - If CvePrePoliza > 0 Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - Else - 'Dim dr As DataRow = DtMovimientos.NewRow - 'Dim CodigoCuenta As String = "" - 'Dim NombreCuenta As String = "" - - 'dr("IdCuenta") = DdlCtaContableE.SelectedValue - - 'If DdlCtaContableE.SelectedValue.ToEntero > 0 Then - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContableE.SelectedValue)) - ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() - ' End If - 'End If - - 'dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - 'dr("Cuenta") = DdlConceptosContablesE.SelectedItem.Text - 'dr("Referencia") = TxtReferenciaE.Text - 'dr("Concepto") = TxtConceptoE.Text - 'dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - 'dr("EsComodin") = 0 - 'dr("CveConcepto") = DdlConceptosContablesE.SelectedValue - 'dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - 'dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - 'dr("Cargo") = TxtCargoE.Text.ToDouble - 'dr("Abono") = TxtAbonoE.Text.ToDouble - ''dr("Descripcion") = TxtDescripcionE.Text - 'dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - 'dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - 'dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero - 'DtMovimientos.Rows.Add(dr) - 'DtMovimientos.AcceptChanges() - - 'GvMov.DataSource = DtMovimientos - 'GvMov.DataBind() - 'UPMovs.Update() - 'Actualizar = False - - End If - Else - Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero - Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle) - - If Rows.Count > 0 Then - Dim dr As DataRow = Rows(0) - dr("IdCtaContable") = DdlCtaContableE.SelectedValue - dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - dr("Concepto") = TxtConceptoE.Text - dr("Referencia") = TxtReferenciaE.Text - dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text - dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) - dr("CveCuenta") = DdlCtaContableE.SelectedValue.ToEntero - dr("CodigoNombreCuenta") = DdlCtaContableE.SelectedItem.Text - - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnConceptoContable").Value = DdlConceptosContablesE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnProveedor").Value = DdlProveedoresE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCompra").Value = DdlComprasE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnPersonal").Value = DdlPersonalE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCliente").Value = DdlClientesE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnVenta").Value = DdlVentasE.SelectedValue.ToEntero - - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnSubProyecto").Value = DdlSubProyectoE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnTipoGasto").Value = DdlTipoGastoE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCtaContable").Value = DdlCtaContableE.SelectedValue.ToEntero - - If TxtCargoE.Text <> "" Then - dr("Cargo") = TxtCargoE.Text.ToDouble - dr("Abono") = "".ToDouble - Else - dr("Abono") = TxtAbonoE.Text.ToDouble - dr("Cargo") = "".ToDouble - End If - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.AcceptChanges() - GvPrePoliza.EditIndex = -1 - - If CvePrePoliza > 0 Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - GvPrePoliza.Columns(11).Visible = True - - GvPrePoliza.Rows(IndiceGrid).FCCheckBox("chkModificado").Checked = True - End If - End If - - UpPrePoliza.Update() - RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") - End Sub - Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting - - Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero - - Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov) - If Rows.Count > 0 Then - DtMovimientos.Rows.Remove(Rows(0)) - DtMovimientos.AcceptChanges() - End If - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - - TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero - TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero - - 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria - - End Sub - - Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click - - If DtMovimientos Is Nothing Then CreaDT() - - If Actualizar Then - - Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & HdnCve.Value) - - If Rows.Count > 0 Then - Dim dr As DataRow = Rows(0) - Dim CodigoCuenta As String = "" - Dim NombreCuenta As String = "" - dr("CveCuenta") = DdlCtaContable.SelectedValue - - If DdlCtaContable.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) - If drr IsNot Nothing Then - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - End If - End If - - dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - dr("Cuenta") = DdlConceptosContables.SelectedItem - dr("Referencia") = TxtReferencia.Text - dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - dr("EsComodin") = 0 - dr("CveConcepto") = DdlConceptosContables.SelectedValue - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("Descripcion") = TxtDescripcion.Text - dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = -1 - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - dr("CveCuenta") = DdlCtaContable.SelectedValue.ToEntero - End If - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - LbCancelarEdicion.Visible = False - LbAgregar.Text = "Agregar" - - Else - - If CvePrePoliza > 0 Then - Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = -1 'DdlCtaContable.SelectedValue - dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContables.SelectedValue - dr("Concepto") = TxtDescripcion.Text - dr("Referencia") = TxtReferencia.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("SubProyecto") = DdlSubProyecto.SelectedItem.Text - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - - If CvePrePoliza > 0 Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - Else - Dim dr As DataRow = DtMovimientos.NewRow - Dim CodigoCuenta As String = "" - Dim NombreCuenta As String = "" - - dr("CveCuenta") = DdlCtaContable.SelectedValue - - If DdlCtaContable.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) - If drr IsNot Nothing Then - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - End If - End If - - dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - dr("Cuenta") = DdlConceptosContables.SelectedItem.Text - dr("Referencia") = TxtReferencia.Text - dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - dr("EsComodin") = 0 - dr("CveConcepto") = DdlConceptosContables.SelectedValue - dr("CveConceptoContable") = DdlConceptosContables.SelectedValue - dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("Descripcion") = TxtDescripcion.Text - dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = -1 - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - - 'If CvePrePoliza > 0 Then - ' GvPrePoliza.DataSource = DtMovimientos - ' GvPrePoliza.DataBind() - ' UpPrePoliza.Update() - 'End If - - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - Actualizar = False - - End If - - End If - - TxtCargo.Text = "" - TxtAbono.Text = "" - TxtReferencia.Text = "" - TxtDescripcion.Text = "" - End Sub - -#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" - Public Sub Bancos_Click(sender As Object, e As EventArgs) - Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - RowIndex = GvRow.RowIndex - - If GvRow.FCTextBox("TxtAbono").Text = "" Then - CargaTipoTransaccion("Ing") - Else - CargaTipoTransaccion("Egs") - End If - - - TxtDocumentoImporte.Text = If(GvRow.FCTextBox("TxtAbono").Text = "", GvRow.FCTextBox("TxtCargo").Text.FormatoNumero, GvRow.FCTextBox("TxtAbono").Text.FormatoNumero) - UpBancos.Update() - RegistraScript(String.Format("$('#{0}').modal();", "DivContadoModal")) - End Sub - Private Sub CargaTipoTransaccion(Tipo As String) - DdlTipoTransaccion.Items.Clear() - DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}' AND Estatus = 1 ") - DdlTipoTransaccion.DataBind() - DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1")) - End Sub - Private Sub CargaCuentas() - DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) - DdlCuenta.DataBind() - DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub - Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click - CveConcepto = 30 - CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero - CveCuenta = DdlCuenta.SelectedValue.ToEntero - Folio = TxtDocumentoFolio.Text - ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal - Observaciones = TxtDocumentoObservaciones.Text - Beneficiario = TxtDocumentoBeneficiario.Text - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) - GvMov.Rows(RowIndex).FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" - UPMovs.Update() - End Sub - - Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click - Dim ObjContabilidad As New ClsContabilidad - - If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then - Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion) - Else - Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError) - End If - - ObjContabilidad.Dispose() - End Sub -#End Region - - Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs) - If UpPrePoliza.Visible Then - For Each Gvr As GridViewRow In GvPrePoliza.Rows - Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) - Next - UpPrePoliza.Update() - End If - If UPMovs.Visible Then - For Each Gvr As GridViewRow In GvMov.Rows - Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) - Next - UPMovs.Update() - End If - End Sub - Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs) - Dim Ddl As DropDownList = CType(sender, DropDownList) - For Each Gvr As GridViewRow In GvPrePoliza.Rows - If Ddl.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then - Gvr.Visible = True - Else - Gvr.Visible = False - End If - Else - Gvr.Visible = True - End If - Next - UpPrePoliza.Update() - RegistraScript("calculateAbono()", "cargo") - RegistraScript("calculateCargo()", "abono") - RegistraScript("comparar()", "compara") - End Sub - Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs) - For Each Gvr As GridViewRow In GvMov.Rows - If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then - Gvr.Visible = True - Else - Gvr.Visible = False - End If - Else - Gvr.Visible = True - End If - Next - UpPrePoliza.Update() - RegistraScript("calculateAbono()", "cargo") - RegistraScript("calculateCargo()", "abono") - RegistraScript("comparar()", "compara") - End Sub - - Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing - Actualizar = True - GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero - Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero - - Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex) - - If DrM IsNot Nothing Then - HdnCve.Value = idMov.ToString - - DdlCtaContable.SelectedValue = DrM("CveCuenta") - TxtReferencia.Text = DrM("Referencia") - TxtObservaciones.Text = DrM("Concepto") - ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto") - DrM("EsComodin") = 0 - DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString - TxtCargo.Text = DrM("Cargo").ToString - TxtAbono.Text = DrM("Abono").ToString - TxtDescripcion.Text = DrM("Descripcion") - DdlSubProyecto.SelectedValue = DrM("CveSubProyecto") - DdlProveedores.SelectedValue = DrM("CveProveedor") - DdlCompras.SelectedValue = DrM("CveCompra") - DdlPersonal.SelectedValue = DrM("CvePersonal") - ' DrM("CveClasificacion") = -1 - DdlClientes.SelectedValue = DrM("CveCliente") - DdlVentas.SelectedValue = DrM("CveVenta") - LbCancelarEdicion.Visible = True - LbAgregar.Text = "Actualizar" - - End If - - UPPDocumento.Update() - DivAgregarConceptos.Visible = True - - 'If DtMovimientos Is Nothing Then CreaDT() - - 'Dim dr As DataRow = DtMovimientos.NewRow - 'Dim CodigoCuenta As String = "" - 'Dim NombreCuenta As String = "" - - 'dr("IdCuenta") = DdlCtaContable.SelectedValue - - 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) - ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() - ' End If - 'End If - - 'dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - 'dr("Cuenta") = DdlConceptosContables.SelectedItem - 'dr("Referencia") = TxtReferencia.Text - 'dr("Concepto") = TxtObservaciones.Text - 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - 'dr("EsComodin") = 0 - 'dr("CveConcepto") = DdlConceptosContables.SelectedValue - 'dr("Cargo") = TxtCargo.Text.ToDouble - 'dr("Abono") = TxtAbono.Text.ToDouble - 'dr("Descripcion") = TxtDescripcion.Text - 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero - 'DtMovimientos.Rows.Add(dr) - - 'If CvePrePoliza > 0 Then - ' GvPrePoliza.DataSource = DtMovimientos - ' GvPrePoliza.DataBind() - 'End If - - - 'GvMov.DataSource = DtMovimientos - 'GvMov.DataBind() - 'UPMovs.Update() - - - End Sub - - Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click - LbCancelarEdicion.Visible = False - TxtObservaciones.Text = "" - Actualizar = False - LbAgregar.Text = "Agregar" - End Sub - - Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click - - Dim ObjConta As New ClsContabilidad - - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) - Else - - Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) - End If - - ObjConta.Dispose() - - - End Sub - - -#Region "COMPLEMENTO DE PAGO" - - Private Sub GeneraTimbre(CvePrePoliza As Integer) - Dim Str As New StringBuilder - Dim Banco As New ClsBancos - Banco.IniciaTransacSQL() - If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then - If Banco.Mensaje = "" Then - Banco.Commit() - PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False) - Str.AppendFormat("Folio: {0}  ", Banco.ComplementoSerieFolio) - Str.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) - Str.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) - MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo) - End If - Else - Banco.RollBack() - Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje) - End If - Banco.Dispose() - Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") - End Sub - - Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) - Try - Dim Msg As String = "" - If NombreArchivo <> "-1" Then ' - Dim ObjMail As New ClsSisMail() - Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo) - Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo) - Dim Cuerpo As String = "Se hace entrega del comprobante de pago" - Dim Asunto As String = "Entrega de comprobante de pago" - If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then - Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF}) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML}) - If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then - If ConAlerta Then - 'RegistraScript("$('#ModalDivMail').modal('hide');") - Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) - End If - Else - Msg = "No se pudo enviar el correo electrónico." - End If - Else - Msg = "No se pudo adjuntar el correo electrónico." - End If - End If - If ConAlerta AndAlso Msg <> "" Then - Alert(Msg, TipoMensaje.MsgError) - End If - Catch ex As Exception - OnError("Ocurrió error al mandar MAIL", ex) - End Try - End Sub - - Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) - GeneraTimbre(CvePrePoliza) - End Sub -#End Region - - - -#Region "E X C E L" - - - Private Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click - RegistraScript(String.Format("$('#{0}').modal();", "DivCargaExcel")) - - End Sub - - Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click - Dim NombreArchivo As String - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - Dim workbook As New ExcelFile() - Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString) - - Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero - Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") - - Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows - Select New With - { - .ConceptoAdministrativo = row.Item("ConceptoContable"), - .Cuenta = row.Item("Codigo"), - .NombreCuenta = row.Item("NombreCuenta"), - .Cargo = "", - .Abono = "", - .Referencia = "", - .Concepto = "", - .SubProyecto = row.Item("SubProyecto"), - .CveConceptoContable = row.Item("CveConcepto"), - .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), - .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1), - .CveCuenta = row.Item("CveCuenta") - }).QueryToDataTable(True) - - worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With - { - .ColumnHeaders = True, - .StartRow = 0, - .StartColumn = 0 - }) - - Dim columnCount = worksheet.CalculateMaxUsedColumns() - For i = 0 To columnCount - worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) - Next - worksheet.Columns("I").Hidden = True - worksheet.Columns("J").Hidden = True - worksheet.Columns("K").Hidden = True - worksheet.Columns("L").Hidden = True - - - NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString - workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault) - - - End Sub - - Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click - If TxtExcel.getfiles().Archivos.Count > 0 Then - Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - - Dim Directorio As String = Server.MapPath("~") & file.patch - - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") - CargarArchivo(Directorio, file.filename, Tipo) - Else - Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) - End If - End Sub - Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) - Dim dt As New DataTable - ' Conexion As Odbc.OdbcConnection = Nothing - Dim ErrorArchivo = False - Dim ErrorExcel = False - DdlPlantilla.SelectedValue = DdlPlantilla2.SelectedValue - dt = ReadExcelFile(Ruta + FileName, True) - - - If Not ErrorArchivo Then - - If Not dt.Columns(0).ColumnName = "ConceptoAdministrativo" Then - Alert("El nombre de la primera columna debe ser 'ConceptoAdmin'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(1).ColumnName = "Cuenta" Then - Alert("El nombre de la segunda columna debe ser 'Cuenta'.Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(2).ColumnName = "NombreCuenta" Then - Alert("El nombre de la tercera columna debe ser 'NombreCuenta'.Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(3).ColumnName = "Cargo" Then - Alert("El nombre de la cuarta columna debe ser 'Cargo'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(4).ColumnName = "Abono" Then - Alert("El nombre de la quinta columna debe ser 'Abono' .Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(5).ColumnName = "Referencia" Then - Alert("El nombre de la sexta columna debe ser 'Referencia'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(6).ColumnName = "Concepto" Then - Alert("El nombre de la séptima columna debe ser 'Concepto'.Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(7).ColumnName = "SubProyecto" Then - Alert("El nombre de la octava columna debe ser 'SubProyecto'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - End If - - If Not ErrorArchivo Then - - DtMovimientos.Clear() - - Dim ObjConta As New ClsContabilidad() - ObjConta.IniciaTransacSQL() - Try - - - For Each Row As DataRow In dt.FiltraParametros("ConceptoAdministrativo <> ''").Rows - - Dim NombreCuenta As String = Row("NombreCuenta").ToString - Dim Cuenta As String = Row("Cuenta").ToString - Dim ConceptoAdministrativo As String = Row("ConceptoAdministrativo").ToString - - Dim CveSubProyecto As Integer = -1 - Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) - Dim CveConceptoContable As Integer = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable ='{0}'", Row("ConceptoAdministrativo"))).ToEntero ' Row("CveConceptoContable").ToString.ToEntero - 'Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero - Dim CveClasificacion As Integer = -1 - Dim CveCuenta As Integer = -1 - Dim ObjConta2 As New ClsContabilidad - If ObjConta2.GetCuentas(-1, Row("Cuenta").ToString.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then - CveCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CveCuenta", "").ToEntero - NombreCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CtaCodigo", "") - End If - ObjConta2.Dispose() - - If CveCuenta <= 0 AndAlso CveConceptoContable <> 30 Then - Alert(String.Format("La cuenta {0} no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString)) - DtMovimientos.Clear() - Exit For - End If - - 'sino viene el cveconcepto, busca por le nombre del concepto - If CveConceptoContable = 0 Then - Alert(String.Format("El concepto {0} no se reconoció, favor de verificar el archivo.", Row("ConceptoAdministrativo"))) - DtMovimientos.Clear() - Exit For - End If - - If Row("SubProyecto").ToString.Trim <> "" Then - CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=-1).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto = '{0}'", Row("SubProyecto").ToString.Trim)).ToEntero 'Row("CveSubProyecto").ToString.ToEntero - - If CveSubProyecto = 0 Then - Alert(String.Format("El subproyecto {0} no se reconoció, favor de verificar el archivo.", Row("SubProyecto"))) - DtMovimientos.Clear() - Exit For - End If - - End If - - If CveConceptoContable = 69 Then - CveClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", "").ToEntero - End If - - Dim dr As DataRow = DtMovimientos.NewRow - Dim CodigoCuenta As String = "" - - dr("CodigoCuenta") = NombreCuenta 'Cuenta & "
" & NombreCuenta - dr("Cuenta") = ConceptoAdministrativo - dr("Referencia") = Row("Referencia").ToString - dr("Concepto") = Row("Concepto").ToString - dr("TipoMovto") = TipoMovto - dr("EsComodin") = 0 - dr("CveConcepto") = CveConceptoContable - dr("CveConceptoContable") = CveConceptoContable - dr("ConceptoContable") = Row("ConceptoAdministrativo").ToString - dr("Cargo") = Row("Cargo").ToString.ToDecimal.RoundSQL - dr("Abono") = Row("Abono").ToString.ToDecimal.RoundSQL - dr("Descripcion") = Row("Concepto").ToString - dr("CveSubProyecto") = CveSubProyecto - dr("CveProveedor") = -1 - dr("CveCompra") = -1 - dr("CvePersonal") = -1 - dr("CveClasificacion") = CveClasificacion - dr("CveCliente") = -1 - dr("CveVenta") = -1 - dr("CveCuenta") = CveCuenta - - - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - Next - - TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero - TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero - - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - - Catch ex As Exception - Alert("No se pudo cargar el excel") - End Try - End If - End Sub -#End Region - -#Region "Paquete Egresos" - Protected Sub LnkImprimirPDF_Click(sender As Object, e As EventArgs) - ImprimirPolizaPDF(IdPoliza) - End Sub - Private Function ImprimirPolizaPDF(IdPoliza As Integer) As String - Dim ObjConta As New ClsContabilidad - 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) - - Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) - Dim params As New List(Of ReportParameter) - Dim Bytes As Byte() = Nothing - - - 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then - If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then - Dim dtVC As DataTable - Dim dr As DataRow - dtVC = ObjConta.DtResultados.FiltraParametros("Contabilizable = 1", "Orden") - dr = dtVC.Rows(0) - Dim ruta As String = "" - params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString)) - params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) - 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) - 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) - params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) - params.Add(New ReportParameter("Moneda", "")) - params.Add(New ReportParameter("CodigoPostal", "")) - If UsuarioActual.CveEmpresa = 119 Then - params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre"))) - End If - If UsuarioActual.CveEmpresa = 140 Then - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - End If - If Archivo.Exists Then - ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc" - Else - ruta = "Empresas/Grales/Formatos/Polizas.rdlc" - End If - ImprimirbytesPDF(StreamPDF(ruta, dtVC, params, "ppoliza"), String.Format("{0}-{1}", TipoPoliza, dr("FolioPoliza").ToString), "PDF", True) - - End If - Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) - ObjConta.Dispose() - - End Function - - -#End Region - -End Class - diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 99e104462..841911cad 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7,7 +7,7 @@ Imports System.Diagnostics Imports System.Globalization Imports System.IO Imports System.Threading.Tasks -Imports Newtonsoft.Json +Imports Newtonsoft.Jsonf Imports Extensiones Imports System.Activities.Expressions Imports iText.Barcodes.Dmcode @@ -1853,6 +1853,7 @@ Partial Class Compras_Compras 'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -5907,10 +5908,10 @@ Partial Class Compras_Compras ' Dim IdCtaIVAAcreditable As Integer = 0 Dim GuardoConcepto18 As Boolean = False - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows.Count > 0 Then - IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - ' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero - End If + 'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows.Count > 0 Then + ' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + ' ' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + 'End If '********************** Variables '********************** @@ -6362,11 +6363,9 @@ Partial Class Compras_Compras If TipoCambioCompra > TCPago Then ConceptoContable = 64 - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria TipoMovimiento = True Else ConceptoContable = 65 - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria TipoMovimiento = False End If If TCPago <> TipoCambioCompra Then @@ -6827,10 +6826,8 @@ Partial Class Compras_Compras If diferenciaTransito <> 0 Then Dim tCveCon As Integer = 65 - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria If diferenciaTransito < 0 Then tCveCon = 64 - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If diferenciaTransito = Math.Abs(diferenciaTransito) @@ -7367,11 +7364,9 @@ Partial Class Compras_Compras If importeMovimiento > 0 Then ConceptoContable = 64 TipoMovimiento = True - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria ElseIf importeMovimiento < 0 Then ConceptoContable = 65 TipoMovimiento = False - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria End If importeMovimiento = importeMovimiento.Abs.RoundSQL() @@ -8112,7 +8107,7 @@ Partial Class Compras_Compras End If 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA - If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then Dim CvePreComprobacion As Integer If ObjCompras.DtResultados.Rows.Count = 0 Then @@ -9340,7 +9335,7 @@ Partial Class Compras_Compras If (TxtRembolsoNumero.Text.Trim.Length > 0 AndAlso IdPoliza <= 0) AndAlso (NumeroReembolsoOriginal.Trim <> TxtRembolsoNumero.Text.Trim) Then 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA - If UsuarioActual.CveEmpresa.Contiene(1, 119, 141) AndAlso TxtRembolsoNumero.Text.Trim <> "" AndAlso (DdlRembolsoPersonal.SelectedValue.ToEntero > 0 Or DdlRembolsoCajaChica.SelectedValue.ToEntero > 0) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtRembolsoNumero.Text.Trim <> "" AndAlso (DdlRembolsoPersonal.SelectedValue.ToEntero > 0 Or DdlRembolsoCajaChica.SelectedValue.ToEntero > 0) Then If ObjCompra.GetComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then Dim CvePreComprobacion As Integer If ObjCompra.DtResultados.Rows.Count = 0 Then @@ -20680,11 +20675,8 @@ Partial Class Compras_Compras TxtModalEliminarCompraDescripcion.Text = "" RegistraScript("$('#DvModalEliminarCompra').modal('show');") - UpModalEliminarcompraCuerpo.Update() - - End Sub Protected Sub BtnModalEliminarCompra_Click(sender As Object, e As EventArgs) @@ -20787,9 +20779,9 @@ Partial Class Compras_Compras SBEliminacionCompra.Append($"Capturó: {LblUsuarioCaptura.Text}, ") SBEliminacionCompra.Append($"F Captura: {LitFechCaptura.Text}, ") - SBEliminacionCompra.Append($"Dealles: ") + SBEliminacionCompra.Append($"Dealles:
") For Each dRow As DataRow In TmpDT.Rows - SBEliminacionCompra.Append($"Cantidad: {dRow("Cantidad")}, PS: {dRow("PS")}, Obs: {dRow("Obs")}, Sub Proyecto: {dRow("SubProyecto")}, Tipo Gasto: {dRow("TipoGasto")}, IVA: {dRow("IVA").ToString.ToDecimal.ToString("###,###,###.00")}, IEPSPS: {dRow("IEPSPS").ToString.ToDecimal.ToString("###,###,###.00") } ") + SBEliminacionCompra.Append($"-Cantidad: {dRow("Cantidad").ToString.ToDecimal().ToString("###,###,###.00") }, PS: {dRow("PS")}, Obs: {dRow("Obs")}, Sub Proyecto: {dRow("SubProyecto")}, Tipo Gasto: {dRow("TipoGasto")}, IVA: {dRow("IVA").ToString.ToDecimal.ToString("###,###,###.00")}, IEPSPS: {dRow("IEPSPS").ToString.ToDecimal.ToString("###,###,###.00") }
") Next If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveCompra, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index 4165a41c9..75c12338f 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -868,7 +868,7 @@
- + diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 15dc5bff8..ccfb2ae94 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -1823,11 +1823,8 @@ Partial Class Compras_Proveedores If ObjContaAC IsNot Nothing Then ObjContaAC.Commit() 'ACTUALIZAR GLOBAL - 'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing - 'Else - ' ErrorBancos = True - 'End If + GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing Alert("El Proveedor se guardó correctamente. " & "
" & MsgCuentaContable, TipoMensaje.MsgInformacion, If(Request("CveFactura") Is Nothing, "document.location.href=""/Compras/CatProveedores.aspx""", "window.opener.location.href = window.opener.location.href; window.close();")) RecargaGlobalCuentasBancarias() @@ -2677,7 +2674,7 @@ Partial Class Compras_Proveedores End If If e.Row.RowIndex > 0 Then e.Row.FCLiteral("LtlAux").Text = String.Format("Ir", CveProveedor, e.Row.DBCampo("CveCompra")) 'DirectCast(e.Row.FindControl("ImgAbonar"), Image).Attributes.Add("onclick", String.Format("$get('HdnCveVenta').value='{0}';$get('HdnCveVentaAbono').value='{0}';$('#DivAddPago').show(1000);PosicionaObjeto('{1}', 'DivAddPago');", e.Row.DBCampo("CveCompra"), DirectCast(e.Row.FindControl("ImgAbonar"), Image).ClientID)) - If e.Row.FCHyperLink("ImgAbonar") IsNot Nothing Then e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/PopIECompras.aspx?CveCompra={0}&TB_iframe=true&height=450&width=790", e.Row.DBCampo("CveCompra")) + If e.Row.FCHyperLink("ImgAbonar") IsNot Nothing Then e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/PopIECompras.aspx?CveCompra={0}&TB_iframe=true&height=510&width=800", e.Row.DBCampo("CveCompra")) If CType(sender, GridView).ID = "GvCxPHistorial" Then @@ -3416,7 +3413,9 @@ Partial Class Compras_Proveedores If CveProveedor > 0 Then If ObjCuentasBancos.RemoveCuentasDepositos(GvRow.DataKey("CveCuentaDeposito").ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then DTCuentasBancos.Clear() - DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor))) + 'recargar las cuentas + GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing + DTCuentasBancos = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor) Alert("Cuenta Bancaria borrada con éxito.", TipoMensaje.MsgInformacion) Else @@ -3430,12 +3429,11 @@ Partial Class Compras_Proveedores CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString) ObjCuentasBancos.Dispose() - RecargaGlobalCuentasBancarias() + End Sub Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1) If CveProveedor > 0 Then GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing - End If End Sub diff --git a/Compras/RepComprasAF.aspx b/Compras/RepComprasAF.aspx index 20b3912ae..41d634712 100644 --- a/Compras/RepComprasAF.aspx +++ b/Compras/RepComprasAF.aspx @@ -1,330 +1,326 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComprasAF.aspx.vb" Inherits="Compras_RepComprasAF" %> - - - - - - - - Reporte de Compras Activo Fijo - - - - -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • -
  • - Ver Dlls en pesos -
  • -
  • -   -
  • - - -
  • - Ver Grafica -
  • -
    -
    -
    - - - - - -
    -
    -
    - - -
    -
    -
    -
    Fecha Inicio:
    -
    -
    - - - - - - - - - - -
    -
    -
    Fecha Fin:
    -
    -
    - - - - - - - - - - -
    -
    -
    Grupo:
    -
    - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - + + + +
    + + + + + + + - - + + + diff --git a/Compras/RepComprasAF.aspx.vb b/Compras/RepComprasAF.aspx.vb index fbd61c616..781f65a9a 100644 --- a/Compras/RepComprasAF.aspx.vb +++ b/Compras/RepComprasAF.aspx.vb @@ -59,16 +59,20 @@ Partial Class Compras_RepComprasAF txtFechaI.Text = $"01/{Now.Month}/{Now.Year}" DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedores.DataBind() + DdlProveedores.DataBind() + DdlProveedores.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlMonedas.DataSource = GlobalDTMonedas() - DdlMonedas.DataBind() + DdlMonedas.DataBind() + DdlMonedas.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlTipoActivoFijo.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo") DdlTipoActivoFijo.DataBind() + DdlTipoActivoFijo.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") DdlClasificacion.DataBind() + DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1")) Dim ObjClasificacion As New ClsClasificaciones @@ -81,9 +85,11 @@ Partial Class Compras_RepComprasAF ObjClasificacion.Dispose() DdlClasificacion2.DataBind() + DdlClasificacion2.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) DdlActivoFijo.DataBind() + DdlActivoFijo.Items.Insert(0, New ListItem("Seleccione", "-1")) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto) diff --git a/Compras/RepNotasCredito.aspx b/Compras/RepNotasCredito.aspx index 95cfef677..5c8f0bec3 100644 --- a/Compras/RepNotasCredito.aspx +++ b/Compras/RepNotasCredito.aspx @@ -108,7 +108,7 @@ + DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,CveTipoConcepto,IdCtaContProveedores,IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio,CveSubProyecto,SerieFolio"> diff --git a/Compras/RepNotasCredito.aspx.vb b/Compras/RepNotasCredito.aspx.vb index b06371f16..c3ab63854 100644 --- a/Compras/RepNotasCredito.aspx.vb +++ b/Compras/RepNotasCredito.aspx.vb @@ -156,20 +156,19 @@ Partial Class Compras_RepNotasCredito 'Dim CveCon As Integer = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.SelectedValue, DdlMoneda.SelectedValue.ToEntero, False) - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, "", 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, gr.DataKey("SerieFolio"), 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If If UsaComplementaria AndAlso CveMoneda > 1 Then ImporteComplementaria = (Importe * TCCompra - Importe).RoundSQL IdCtaContableComplementaria = gr.DataKey("IdCtaContComplementaria").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-Importe, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-Importe, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If End If - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToString.ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, gr.DataKey("SerieFolio"), 211, Concepto, TxtFechaSaldar.Text.ToDate, 0, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If @@ -181,11 +180,9 @@ Partial Class Compras_RepNotasCredito If difFluctuacion < 0 Then CveConceptoFluctua = 65 TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria Else CveConceptoFluctua = 64 TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If Dim ImporteFluctuacion As Decimal = Math.Abs((Importe * difFluctuacion).RoundSQL) @@ -193,44 +190,45 @@ Partial Class Compras_RepNotasCredito MsgError = "Ocurrio un Error al saldar el movimiento" End If End If - - If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then - If ObjConta.ValorPolizaDescuadre > 0 Then - MsgError = ObjConta.MensajePolizaDescuadre - GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - End If - End If - - If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - If MensajeAlert.ToString = "" Then - MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente:
    ") - End If - MensajeAlert.AppendFormat("", ObjConta.ContaIdPoliza, ObjConta.ContaFolio) - End If - End If - + If MsgError <> "" Then Exit For End If Next - If MsgError = "" Then - ObjConta.Commit() - If MensajeAlert.ToString <> "" Then + If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + MsgError = ObjConta.MensajePolizaDescuadre + GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + If MensajeAlert.ToString = "" Then + MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente:
    ") + End If + MensajeAlert.AppendFormat("", ObjConta.ContaIdPoliza, ObjConta.ContaFolio) + End If + End If + + If MsgError = "" Then + ObjConta.Commit() + If MensajeAlert.ToString <> "" Then + Alert(MensajeAlert.ToString) + Else + Alert("Los movimientos fueron saldados correctamente.") + End If Alert(MensajeAlert.ToString) + CargaDatos() + HLSaldar.Visible = False + RegistraScript("$('#DivSaldar').modal('hide')") + LnkHabilitarSaldar.Visible = True Else - Alert("Los movimientos fueron saldados correctamente.") + ObjConta.RollBack() + Alert(MsgError, TipoMensaje.MsgError) End If - Alert(MensajeAlert.ToString) - CargaDatos() - HLSaldar.Visible = False - RegistraScript("$('#DivSaldar').modal('hide')") - LnkHabilitarSaldar.Visible = True - Else - ObjConta.RollBack() - Alert(MsgError, TipoMensaje.MsgError) End If ObjConta.Dispose() End Sub diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx index 44d945232..8af65aaa1 100644 --- a/Compras/eFacturas.aspx +++ b/Compras/eFacturas.aspx @@ -578,14 +578,17 @@
    + + + +
    - - +

    @@ -596,7 +599,13 @@ - + + + + + + + diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 6f4633835..6ba918478 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1907,6 +1907,7 @@ Partial Class Compras_eFacturas cfdVer = "http://www.sat.gob.mx/cfd/2" End If namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -1963,6 +1964,7 @@ Partial Class Compras_eFacturas cfdVer = "http://www.sat.gob.mx/cfd/2" End If namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -2180,6 +2182,7 @@ Partial Class Compras_eFacturas cfdVer = "http://www.sat.gob.mx/cfd/2" End If namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -3302,6 +3305,7 @@ Partial Class Compras_eFacturas End If + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") @@ -4498,6 +4502,7 @@ Partial Class Compras_eFacturas Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3") + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos") nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces) diff --git a/Contabilidad/CatClasificacionPorcentaje.aspx.vb b/Contabilidad/CatClasificacionPorcentaje.aspx.vb index 4c7f79bc3..fa155e307 100644 --- a/Contabilidad/CatClasificacionPorcentaje.aspx.vb +++ b/Contabilidad/CatClasificacionPorcentaje.aspx.vb @@ -93,9 +93,9 @@ Partial Class Contabilidad_CatClasificacionPorcentaje DdlIdCtaIVAXTrasladar.SelectedValue, DdlIdCtaIVATrasladado.SelectedValue, UsuarioActual.CveEmpresa) Then RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) Alert("Clasificación porcentaje agregado correctamente") - If ObjGenerales.GetClasificacionPorcentaje(-1) Then - GlobalDTClasificacionPorcentaje(-1) = ObjGenerales.DtResultados - End If + 'If ObjGenerales.GetClasificacionPorcentaje(-1) Then + ' GlobalDTClasificacionPorcentaje(-1) = ObjGenerales.DtResultados + 'End If CargaDatos() CargaContPaq() UpDatos.Update() @@ -105,9 +105,9 @@ Partial Class Contabilidad_CatClasificacionPorcentaje DdlIdCtaIVAAcreditable.SelectedValue, DdlIdCtaIVAXTrasladar.SelectedValue, DdlIdCtaIVATrasladado.SelectedValue) Then RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) Alert("Clasificación porcentaje actualizado correctamente") - If ObjGenerales.GetClasificacionPorcentaje(-1) Then - GlobalDTClasificacionPorcentaje(-1) = ObjGenerales.DtResultados - End If + 'If ObjGenerales.GetClasificacionPorcentaje(-1) Then + ' GlobalDTClasificacionPorcentaje(-1) = ObjGenerales.DtResultados + 'End If CargaDatos() CargaContPaq() UpDatos.Update() @@ -120,9 +120,9 @@ Partial Class Contabilidad_CatClasificacionPorcentaje Dim objgenerales As New ClsGenerales If objgenerales.RemoveClasificacionPorcentaje(GvDatos.DataKeys(e.RowIndex).Value.ToString) Then Alert("la clasificación porcentaje se eliminó correctamente") - If objgenerales.GetClasificacionPorcentaje(-1) Then - GlobalDTClasificacionPorcentaje(-1) = objgenerales.DtResultados - End If + 'If objgenerales.GetClasificacionPorcentaje(-1) Then + ' GlobalDTClasificacionPorcentaje(-1) = objgenerales.DtResultados + 'End If CargaDatos() CargaContPaq() UpDatos.Update() diff --git a/Contabilidad/DIOTChilo.aspx b/Contabilidad/DIOTChilo.aspx deleted file mode 100644 index abe8b969a..000000000 --- a/Contabilidad/DIOTChilo.aspx +++ /dev/null @@ -1,29 +0,0 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DIOTChilo.aspx.vb" Inherits="Contabilidad_DIOTChilo" %> - - - - - - - - - - - - - - - - -
    -
    - - -
    -
    - - -
    - - - diff --git a/Contabilidad/DIOTChilo.aspx.vb b/Contabilidad/DIOTChilo.aspx.vb deleted file mode 100644 index bd0ee463a..000000000 --- a/Contabilidad/DIOTChilo.aspx.vb +++ /dev/null @@ -1,121 +0,0 @@ -Imports System.Data -Imports Extensiones - -Partial Class Contabilidad_DIOTChilo - Inherits Page - - Private Sub Contabilidad_DIOTChilo_Load(sender As Object, e As EventArgs) Handles Me.Load - - End Sub - - - - Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click - Dim ObjContabilidad As New ClsContabilidad - Dim ObjConta As ClsContPAQi = Nothing - Dim ObjEmpres As New Empresa() - - ObjEmpres.Empresa = "EXPLORACIONES MINERAS DEL DESIERTO S.A DE C.V" - ObjEmpres.ServerContPAQi = "192.168.0.2\COMPAC,1430" - ObjEmpres.BDContPAQi = "ctEMD" - ObjEmpres.UsrContPAQi = "sa" - ObjEmpres.PwdContPAQi = "AsS151026r37" - - Dim OcurrioError = False - Dim Mensaje = "" - - If ObjConta Is Nothing Then - ObjConta = New ClsContPAQi(ObjEmpres) - ObjConta.IniciaTransacSQL() - End If - - Dim tIdPoliza As Integer - Dim Fecha As Date - Dim ContaFolio As Integer - - If ObjContabilidad.GetPrePoliza(TxtPoliza.Text.ToEntero, 13) Then - tIdPoliza = ObjContabilidad.DtResultados(0)("IdPoliza").ToString.ToEntero - Fecha = ObjContabilidad.DtResultados(0)("Fecha").ToString.ToDate - ContaFolio = ObjContabilidad.DtResultados(0)("FolioPoliza").ToString.ToEntero - End If - - - If ObjContabilidad.GetDIOTValores(TxtPoliza.Text.ToEntero) Then - - If ObjContabilidad.DtResultados.Rows.Count.ToEntero > 0 Then - Dim IdProveedor As Integer - - Dim RFC As String = "" - Dim RazonSocial As String = "" - Dim IdCtaContProveedores As Integer - - - For Each dr As DataRow In ObjContabilidad.DtResultados.Rows - RFC = dr("RFC").ToString - RazonSocial = dr("RazonSocial").ToString - IdCtaContProveedores = dr("IdCtaContProveedores").ToString.ToEntero - - If IdCtaContProveedores > 0 Then - - 'busco la clave del proveedor en la contabilidad por su cuenta contable - If ObjConta.GetProveedores(IdCuentaContable:=IdCtaContProveedores) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - Dim drt As DataRow = ObjConta.DtResultados.Rows(0) : IdProveedor = drt("Id").ToString.ToEntero - End If - End If - Else - 'busco la clave del proveedor en la contabilidad por su cuenta contable - If ObjConta.GetProveedores(RFC:=RFC) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - Dim drtt As DataRow = ObjConta.DtResultados.Rows(0) : IdProveedor = drtt("Id").ToString.ToEntero - End If - Else - 'registro el proveedor generico - Select Case 13 - Case Else : IdProveedor = 0 - End Select - End If - - End If - - - If IdProveedor <= 0 Then - IdProveedor = ObjConta.AddProveedor(IdCtaContProveedores, RFC, RazonSocial, "") - If IdProveedor <= 0 Then - OcurrioError = True - End If - End If - - If Not OcurrioError Then - If dr("Total").ToString.ToDecimal <> 0.00 Then - If Not ObjConta.AddDevolucionesIVA(tIdPoliza, dr("CuentaBancos").ToString.ToEntero, - IdProveedor, - 16, - dr("SubTotal").ToString.ToDecimal, - dr("IvaAcreditable").ToString.ToDecimal, - dr("IVARetenido").ToString.ToDecimal, - dr("ISRRetenido").ToString.ToDecimal, - Fecha, - ContaFolio, - dr("Serie").ToString.ToString, - dr("Folio").ToString.StrToNum, dr("FolioFiscal").ToString, 13) Then - OcurrioError = True - Mensaje = "La Poliza o la Cuenta no son válidas" - Exit For - End If - End If - End If - Next - - - If OcurrioError Then - ObjConta.RollBack() - Else - 'Alert(String.Format("{1}
    ", tIdPoliza, ObjConta.Folio)) - ObjConta.Commit() - End If - - End If - End If - End Sub -End Class diff --git a/Contabilidad/DiarioAmortizaciones.aspx.vb b/Contabilidad/DiarioAmortizaciones.aspx.vb index c3d194a80..433b55244 100644 --- a/Contabilidad/DiarioAmortizaciones.aspx.vb +++ b/Contabilidad/DiarioAmortizaciones.aspx.vb @@ -810,9 +810,9 @@ Partial Class Contabilidad_DiarioAmortizaciones FluctuacionCambiariaIVA = Math.Round((IVAAcreditable * TipoCambioFechaCompra) - (IVAAcreditable * TipoCambioPago), 2) 'FLUCTUACION CAMBIARIA DE IVA If FluctuacionCambiariaIVA < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If If Math.Abs(FluctuacionCambiariaIVA) <> 0 Then If Not Conta.AddMovimiento(IDPoliza, CtaFluctuacion, tempMovto, Math.Abs(FluctuacionCambiariaIVA), gvrc.FCHiddenField("HdnSerieFolio").Value, "Fluctuacion IVA " & ConceptoDetalle, 0, Fecha, gvr.DataKey("CveProveedor").ContaReferencia(TipoContaReferencia.Proveedor), 0) Then MsgError = "No se pudo insertar movimiento contable" : Exit For ' no lleva moneda extranjera @@ -823,9 +823,9 @@ Partial Class Contabilidad_DiarioAmortizaciones If Dif < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If ConceptoDetalle = String.Format("{0} TC:{1} ${2}", gvr.FCTextBox("TxtDescripcion").Text, TipoCambioPago, Math.Abs(Dif).FormatoNumero) @@ -858,9 +858,9 @@ Partial Class Contabilidad_DiarioAmortizaciones FluctuacionCambiariaIVA = Math.Round((IVAAcreditable * TipoCambioFechaCompra) - (IVAAcreditable * TipoCambioPago), 2) 'FLUCTUACION CAMBIARIA DE IVA If FluctuacionCambiariaIVA < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If If Math.Abs(FluctuacionCambiariaIVA) <> 0 Then If Not Conta.AddMovimiento(IDPoliza, CtaFluctuacion, tempMovto, Math.Abs(FluctuacionCambiariaIVA), gvrc.FCHiddenField("HdnSerieFolio").Value, "Fluctuacion IVA " & ConceptoDetalle, 0, Fecha, gvr.DataKey("CveProveedor").ContaReferencia(TipoContaReferencia.Proveedor), 0) Then MsgError = "No se pudo insertar movimiento contable" : Exit For ' no lleva moneda extranjera @@ -871,9 +871,9 @@ Partial Class Contabilidad_DiarioAmortizaciones If Dif < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If ConceptoDetalle = String.Format("{0} TC:{1} ${2}", gvr.FCTextBox("TxtDescripcion").Text, TipoCambioPago, Math.Abs(Dif).FormatoNumero) @@ -1123,7 +1123,7 @@ Partial Class Contabilidad_DiarioAmortizaciones IVAxAcreditar = IVAAcreditable IVAAcreditable = 0 - If UsuarioActual.Empresa.ContaContabilizacionNC = 1 Then + If 1 = 1 Then TipoCambioCompra = TipoCambioCompra * -1 'cuando el movimiento de las nc, sea <> cero, quiero decir que solo convertimos a negativos los valores TipoCambioPago = TipoCambioPago * -1 TipoCambioFechaCompra = TipoCambioFechaCompra * -1 @@ -1301,9 +1301,9 @@ Partial Class Contabilidad_DiarioAmortizaciones If UsuarioActual.CveEmpresa = 66 Then FluctuacionCambiariaIVA = Math.Round((IVAAcreditable * TipoCambioFechaCompra) - (IVAAcreditable * TipoCambioPago), 2) 'FLUCTUACION CAMBIARIA DE IVA If FluctuacionCambiariaIVA < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If If Math.Abs(FluctuacionCambiariaIVA) <> 0 Then If Not Conta.AddMovimiento(IDPoliza, CtaFluctuacion, tempMovto, Math.Abs(FluctuacionCambiariaIVA), gvrc.FCHiddenField("HdnSerieFolio").Value, "Fluctuación IVA " & ConceptoDetalle, 0, Fecha, gvr.DataKey("CveProveedor").ContaReferencia(TipoContaReferencia.Proveedor), 0) Then MsgError = "No se pudo insertar movimiento contable" : Exit For ' no lleva moneda extranjera @@ -1320,9 +1320,9 @@ Partial Class Contabilidad_DiarioAmortizaciones If Dif < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If ConceptoDetalle = String.Format("{0} TC:{1} ${2}", gvr.FCTextBox("TxtDescripcion").Text, TipoCambioPago, Math.Abs(Dif).FormatoNumero) diff --git a/Contabilidad/DiarioCompras.aspx.vb b/Contabilidad/DiarioCompras.aspx.vb index 8f3e2ebeb..b199e4ac2 100644 --- a/Contabilidad/DiarioCompras.aspx.vb +++ b/Contabilidad/DiarioCompras.aspx.vb @@ -344,7 +344,7 @@ Partial Class Contabilidad_DiarioCompras If gvr.DataKey("TipoDocto") = "NC" Then - If UsuarioActual.Empresa.ContaContabilizacionNC <> 0 Then + If 1 <> 0 Then 'cuando el movimiento de las nc, sea <> cero, quiero decir que solo convertimos a negativos los valores MultNC = -1 Else diff --git a/Contabilidad/DiarioPagos.aspx.vb b/Contabilidad/DiarioPagos.aspx.vb index ec96f64eb..f6e19b1f6 100644 --- a/Contabilidad/DiarioPagos.aspx.vb +++ b/Contabilidad/DiarioPagos.aspx.vb @@ -697,7 +697,7 @@ Partial Class Contabilidad_DiarioPagos If gvrc.FCHiddenField("HdnTipoDocto").Value = "NC" Then - If UsuarioActual.Empresa.ContaContabilizacionNC = 1 Then + If 1 = 1 Then TipoCambioCompra = TipoCambioCompra * -1 'cuando el movimiento de las nc, sea <> cero, quiero decir que solo convertimos a negativos los valores TipoCambioPago = TipoCambioPago * -1 TipoCambioFechaCompra = TipoCambioFechaCompra * -1 @@ -1054,9 +1054,9 @@ Partial Class Contabilidad_DiarioPagos If UsuarioActual.CveEmpresa = 66 Then FluctuacionCambiariaIVA = Math.Round((IVAAcreditable * TipoCambioFechaCompra) - (IVAAcreditable * TipoCambioPago), 2) 'FLUCTUACION CAMBIARIA DE IVA If FluctuacionCambiariaIVA < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If If Math.Abs(FluctuacionCambiariaIVA) <> 0 Then If Not Conta.AddMovimiento(IDPoliza, CtaFluctuacion, tempMovto, Math.Abs(FluctuacionCambiariaIVA), gvrc.FCHiddenField("HdnSerieFolio").Value, "Fluctuación IVA " & ConceptoDetalle, IdSegNeg, Fecha, gvr.DataKey("CveProveedor").ContaReferencia(TipoContaReferencia.Proveedor), 0) Then MsgError = "No se pudo insertar movimiento contable" : Exit For ' no lleva moneda extranjera @@ -1073,9 +1073,9 @@ Partial Class Contabilidad_DiarioPagos If Dif < 0 Then - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaGananciaCambiaria : tempMovto = True ' ganancia cambiaria + tempMovto = True ' ganancia cambiaria Else - CtaFluctuacion = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria : tempMovto = False ' perdida cambiaria + tempMovto = False ' perdida cambiaria End If ConceptoDetalle = String.Format("{0} TC:{1} ${2}", gvr.FCTextBox("TxtDescripcion").Text, TipoCambioPago, Math.Abs(Dif).FormatoNumero) diff --git a/Contabilidad/PopUpAuxiliar.aspx b/Contabilidad/PopUpAuxiliar.aspx index 0a5826bef..a2f4ca566 100644 --- a/Contabilidad/PopUpAuxiliar.aspx +++ b/Contabilidad/PopUpAuxiliar.aspx @@ -81,7 +81,7 @@ - + Fecha @@ -120,7 +120,7 @@ - Num. Póliza + Póliza diff --git a/Contabilidad/PopUpAuxiliar.aspx.vb b/Contabilidad/PopUpAuxiliar.aspx.vb index 21da35698..72c7cfed2 100644 --- a/Contabilidad/PopUpAuxiliar.aspx.vb +++ b/Contabilidad/PopUpAuxiliar.aspx.vb @@ -177,16 +177,16 @@ Partial Class PopUpAuxiliar e.Row.Cells(7).Visible = False e.Row.Cells(8).Visible = False e.Row.Cells(12).Visible = False - ElseIf e.Row.RowIndex = 1 Then - e.Row.Cells(0).Width = Unit.Pixel(95) - e.Row.Cells(1).Width = Unit.Pixel(180) - e.Row.Cells(2).Width = Unit.Pixel(80) - e.Row.Cells(3).Width = Unit.Pixel(80) - e.Row.Cells(4).Width = Unit.Pixel(83) - e.Row.Cells(5).Width = Unit.Pixel(93) - e.Row.Cells(6).Width = Unit.Pixel(85) - e.Row.Cells(7).Width = Unit.Pixel(95) - e.Row.Cells(8).Width = Unit.Pixel(70) + 'ElseIf e.Row.RowIndex = 1 Then + ' e.Row.Cells(0).Width = Unit.Pixel(95) + ' e.Row.Cells(1).Width = Unit.Pixel(180) + ' e.Row.Cells(2).Width = Unit.Pixel(80) + ' e.Row.Cells(3).Width = Unit.Pixel(80) + ' e.Row.Cells(4).Width = Unit.Pixel(83) + ' e.Row.Cells(5).Width = Unit.Pixel(93) + ' e.Row.Cells(6).Width = Unit.Pixel(85) + ' e.Row.Cells(7).Width = Unit.Pixel(95) + ' e.Row.Cells(8).Width = Unit.Pixel(70) End If e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index c39b56c1a..a60d0febb 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -215,7 +215,7 @@ Partial Class ContabilidadC_RegPrePoliza If Not Page.IsPostBack Then Tick = DateTime.Now.Ticks.ToString() - If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then + If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 OrElse UsuarioActual.CveEmpresa = 119 Then Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS")) End If diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index a55b9af04..75e9ceaf2 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -310,9 +310,6 @@ Partial Class ContabilidadC_RegPrePolizaS End If - - - Exit Sub ElseIf Request("CvePrePolizaOrigen") IsNot Nothing AndAlso IsNumeric(Request("CvePrePolizaOrigen")) AndAlso Request("CvePrePolizaOrigen").ToEntero > 0 Then @@ -450,7 +447,6 @@ Partial Class ContabilidadC_RegPrePolizaS If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("") If dr IsNot Nothing Then - 'DivAgregarConceptos.Visible = False DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza") TxtFechaDocumento.Text = dr("Fecha") TxtConcepto.Text = dr("Concepto") @@ -461,7 +457,6 @@ Partial Class ContabilidadC_RegPrePolizaS TxtFolio.Text = dr("FolioPoliza").ToString TxtUsuarioElaboro.Text = dr("Usuario").ToString TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy") - ' TxtEstatus.Text = If(Boolean.Parse(dr("Estatus").ToString), "Activa", "Inactiva") CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString If UsuarioActual.CveRol = 1 Then @@ -469,7 +464,6 @@ Partial Class ContabilidadC_RegPrePolizaS End If If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then - 'DivAgregarConceptos.Visible = True LnkAddConcepto.Visible = True CargaConceptos() CargaSubProyectos() @@ -479,7 +473,7 @@ Partial Class ContabilidadC_RegPrePolizaS ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza) DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") - If dr("Modulo").ToString.Contiene("Banc/FluctuaA", "Banc/FluctuaC", "Banc/FluctuaV", "Banc/FluctuaFilial") Then + If dr("Modulo").ToString.Contiene("Banc/FluctuaA", "Banc/FluctuaC", "Banc/FluctuaV", "Banc/FluctuaFilial", "Banc/FluctuaAD") Then BtnEliminar.Enabled = False BtnEliminar.ToolTip = "No se puede eliminar al prepóliza, eliminarlos desde el módulo" End If @@ -518,52 +512,36 @@ Partial Class ContabilidadC_RegPrePolizaS GvPrePoliza.Columns(7).Visible = True End If - If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then + If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17,292,308)").Rows.Count > 0 Then LnkComplementoPago.Visible = True End If - If dr("FolioPoliza").ToString = "" OrElse dr("FolioPoliza").ToString = "0" Then BtnContabilizar.Visible = True End If If UsuarioActual.Empresa.TipoContabilizacion = 1 Then - If dr("FolioPoliza").ToString.ToEntero > 0 Then + If dr("FolioPoliza").ToString.ToEntero > 0 AndAlso UsuarioActual.CveRol = 1 Then divContabilizada.Visible = True Folio = dr("FolioPoliza").ToString - End If Else - If dr("IdPoliza").ToString.ToEntero > 0 Then + If dr("IdPoliza").ToString.ToEntero > 0 AndAlso UsuarioActual.CveRol = 1 Then HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) divContabilizada.Visible = True IdPoliza = dr("IdPoliza").ToString.ToEntero - ElseIf TxtTotalCargos.Text.ToDecimal = TxtTotalAbonos.Text.ToDecimal Then - 'sino está contabilizada, se activa el botón - ' BtnContabilizar.Visible = True End If End If - 'divDatosPrincipales.Visible = False - 'divObservaciones.Visible = False - UpPrePoliza.Update() - RegistraScript("comparar();") - If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then - 'For Each row As GridViewRow In GvPrePoliza.Rows - ' row.FCTextBox("TxtCargo").Enabled = False - ' row.FCTextBox("TxtAbono").Enabled = False - 'Next - End If LnkExcel.Visible = False LnkImprimirPDF.Visible = True Else Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) BtnEliminar.Visible = False End If - End If ObjContabilidad.Dispose() @@ -1382,7 +1360,7 @@ Partial Class ContabilidadC_RegPrePolizaS If CveCliente > 0 Then DvModalconceptoCliente.Visible = True - DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "") + 'DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "") DdlClientesE.ddl.Items.Insert(0, New ListItem(GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", ""), CveCliente)) DdlClientesE.SelectedValue = CveCliente diff --git a/Contabilidad/Reportes/RepCuadreContaAdmon.aspx.vb b/Contabilidad/Reportes/RepCuadreContaAdmon.aspx.vb index afaa68d82..d4c2d6f79 100644 --- a/Contabilidad/Reportes/RepCuadreContaAdmon.aspx.vb +++ b/Contabilidad/Reportes/RepCuadreContaAdmon.aspx.vb @@ -74,19 +74,6 @@ Partial Class RepCuadreContaAdmon Case 8 'Ant Proveedores Return 204 - - Case 9 'IVA x Acreditar - Return UsuarioActual.Empresa.IdCuentaIVAxAcreditar - - Case 10 'IVA Acreditado - Return UsuarioActual.Empresa.IdCuentaIVAAcreditable - - Case 11 'IVA x Trasladar - Return UsuarioActual.Empresa.IdCuentaIVAxTrasladar - - Case 12 'IVA Trasladado - Return UsuarioActual.Empresa.IdCuentaIVATrasladado - Case 13 'Ingresos Return 222 diff --git a/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb b/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb index 4b711bc3a..42d35bd3f 100644 --- a/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb +++ b/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx.vb @@ -83,18 +83,6 @@ Partial Class RepCuadreContaAdmonDetalle Case 8 'Ant Proveedores Return 204 - Case 9 'IVA x Acreditar - Return UsuarioActual.Empresa.IdCuentaIVAxAcreditar - - Case 10 'IVA Acreditado - Return UsuarioActual.Empresa.IdCuentaIVAAcreditable - - Case 11 'IVA x Trasladar - Return UsuarioActual.Empresa.IdCuentaIVAxTrasladar - - Case 12 'IVA Trasladado - Return UsuarioActual.Empresa.IdCuentaIVATrasladado - Case 13 'Ingresos Return 222 diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx index 59e0d8c68..685958e85 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx +++ b/Contabilidad2/CatCuentasAsignaciones.aspx @@ -105,7 +105,8 @@ - + + diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 3ec01dd77..009282029 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -163,20 +163,23 @@ Partial Class Contabilidad2_CatCuentasAsignaciones DdlTipoGasto.SelectedValueExist(GvRow.DataKey("CveTipoGasto").ToEntero) DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo").ToEntero) DdlActivoFijo.Enabled = False - - Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero - DdlClientes.ddl.SelectedValueExist(CveCliente) + If CveCliente > 0 Then + Dim drp As String = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre") + DdlClientes.ddl.Items.Insert(0, New ListItem(drp, CveCliente)) + DdlClientes.SelectedValue = CveCliente + DdlClientes.SelectedText = drp + End If If CvePersonal > 0 Then Dim drp As String = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal).FiltroPrimeroValor("NombreCompleto") - - DdlPersonal.ddl.Items.Add(New ListItem(drp, CvePersonal)) - + DdlPersonal.ddl.Items.Insert(0, New ListItem(drp, CvePersonal)) + DdlPersonal.SelectedValue = CvePersonal + DdlPersonal.SelectedText = drp End If - DdlPersonal.ddl.SelectedValueExist(CvePersonal) + LbAgregar.Text = "Actualizar" UpModalModulos.Update() RegistraScript("$('#ModalCat').modal();") diff --git a/Contratos/Presupuestos.aspx b/Contratos/Presupuestos.aspx index bfb6aca06..073d6cec2 100644 --- a/Contratos/Presupuestos.aspx +++ b/Contratos/Presupuestos.aspx @@ -1,318 +1,342 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Presupuestos.aspx.vb" Inherits="Contratos_Presupuestos" %> - - - - - - - - Presupuestos - - - - - - -
  • - Autorizar -
  • -
  • - Cargar Presupuesto -
  • -
  • - Modificar Presupuesto -
  • -
    -
    -
    - - - -
    -
    -
    -
    -
    +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Presupuestos.aspx.vb" Inherits="Contratos_Presupuestos" %> + + + + + + + + Presupuestos + + + + + + +
  • + Autorizar +
  • +
  • + Cargar Presupuesto +
  • +
  • + Modificar Presupuesto +
  • +
    +
    +
    + + + +
    +
    +
    +
    +
    Datos Generales -
    -
    - - -
    -
    -
    - - -
    -
    - -
    - - - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    - - - -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -

    Estatus: -

    -
    -
    -
    -
    -
    -
    -
    -

    - $ - - -

    - IMPORTE -
    + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + Configuración + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +

    Estatus: +

    +
    +
    +
    +
    +
    +
    +
    +

    + $ + + +

    + IMPORTE +
    <%--
    -
    --%> -
    -
    -
    - -
    -
    -
    -
    -

    - $ - - -

    - EJERCIDO -
    +
    --%> +
    +
    +
    + +
    +
    +
    +
    +

    + $ + + +

    + EJERCIDO +
    <%--
    -
    --%> -
    -
    -
    - - - - -
    -
    -
    Porcentaje Ejercido
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    - $ - - -

    - POR EJERCER -
    +
    --%> +
    +
    +
    + + + + +
    +
    +
    Porcentaje Ejercido
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    + $ + + +

    + POR EJERCER +
    <%--
    -
    --%> -
    -
    -
    - - - - -
    -
    -
    Porcentaje Por Ejercer
    -
    - -
    -
    -
    -
    -
    - -
    - - -
    -
    -
    -
    -
    -
    -
    -
    +
    --%> +
    +
    +
    + + + + +
    +
    +
    Porcentaje Por Ejercer
    +
    + +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    +
    +
    Presupuestos -
    -
    - - -
    -
    -
    -
    - - - - - - - - - - - - - Total : - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    -
    -
    - + + +
    +
    +
    + +
    +
    +
    +
    +
    + - - + --> + +
    +
    +
    + + + +
    + + + + + + + - - + + + diff --git a/Contratos/Presupuestos.aspx.vb b/Contratos/Presupuestos.aspx.vb index dc344f772..15b704ed9 100644 --- a/Contratos/Presupuestos.aspx.vb +++ b/Contratos/Presupuestos.aspx.vb @@ -5,10 +5,10 @@ Imports System.Data Imports Extensiones Partial Class Contratos_Presupuestos - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "P R O P I E D A D E S" - + Public Property CvePresupuesto() As Integer Get Return ViewState("CvePresupuesto").ToString.ToEntero @@ -37,10 +37,10 @@ Partial Class Contratos_Presupuestos Set(ByVal value As DataTable) ViewState("DtClasificaciones") = value End Set - End Property - + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then CvePresupuesto = IfNull(Request("CvePresupuesto"), -1).ToString.ToEntero @@ -56,8 +56,8 @@ Partial Class Contratos_Presupuestos UpGvClasificaciones.Update() UpIndicadores.Update() End If - End Sub - + End Sub + #Region "I N I C I A L I Z A - V A L O R E S" Private Sub InicializaValores() TxtFechaI.Text = $"01/01/{Now.Year}" @@ -125,13 +125,13 @@ Partial Class Contratos_Presupuestos End Select End If If e.Row.RowType = DataControlRowType.Footer Then - Dim Importe = DtClasificaciones.SUM("Importe", "CveClasificacion IS NOT NULL") + Dim Importe = DtClasificaciones.SUM("Importe", "CveAgrupador IS NOT NULL") e.Row.FCLabel("LblTotal").Text = String.Format("{0:C}", Importe) End If - End Sub - + End Sub + #End Region - + #Region "C A R G A - D A T O S" Private Sub CargaDatos() CargaMoneda() @@ -245,9 +245,9 @@ Partial Class Contratos_Presupuestos HlModificar.Visible = True HlModificar.NavigateUrl = $"/Contratos/ModificarPresupuesto.aspx?CvePresupuesto={CvePresupuesto}" End If - End Sub + End Sub #End Region - + #Region "G U A R D A R " Private Function ValidaDatos() As Boolean If String.IsNullOrEmpty(TxtPresupuesto.Text.Trim) Then @@ -327,23 +327,39 @@ Partial Class Contratos_Presupuestos For Each GvRow As GridViewRow In GvPresupuestos.Rows If GvRow.RowType = DataControlRowType.DataRow Then - Dim CveClasificacion = GvRow.DataKey("CveClasificacion").ToEntero - Dim CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero + Dim CveAgrupador = GvRow.DataKey("CveAgrupador").ToEntero + Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero + + Dim CveTipoGasto = -1 + Dim CveClasificacion As Integer = -1 + Dim CveConceptoContableNom As Integer = -1 + + If Tipo = 1 Then + CveClasificacion = CveAgrupador + CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero + End If + + If Tipo = 2 Then + CveConceptoContableNom = CveAgrupador + End If + + Dim CvePresupuestoDetalle = GvRow.DataKey("CvePresupuestoDetalle").ToEntero Dim Importe = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal Dim Obs = GvRow.FCTextBox("TxtObservacion").Text.Trim + 'ACTUALIZA EL REGISTRO EXISTENTE If CvePresupuestoDetalle > 0 Then - TieneError = Not ObjCont.UpdatePresupuestosDetalle(CvePresupuestoDetalle, CveClasificacion, Importe, Obs) + TieneError = Not ObjCont.UpdatePresupuestosDetalle(CvePresupuestoDetalle, CveClasificacion, Importe, Obs, CveConceptoContableNom:=CveConceptoContableNom) If TieneError Then Exit For End If 'AGREGA LA CLASIFICACION SI NO EXISTE EN EN EL DT DETALLE Else - If Importe > 0 And CveClasificacion > 0 Then - TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuesto, CveClasificacion, CveTipoGasto, Importe, Obs) + If Importe > 0 And CveAgrupador > 0 Then + TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuesto, CveClasificacion, CveTipoGasto, Importe, Obs, CveConceptoContableNom:=CveConceptoContableNom) If TieneError Then Exit For End If @@ -385,18 +401,33 @@ Partial Class Contratos_Presupuestos If CvePresupuestoNuevo > 0 Then Dim ImporteClasi = 0.0D - Dim CveClasificacion = -1 Dim ObsDetalle = "" For Each GvRow As GridViewRow In GvPresupuestos.Rows If GvRow.RowType = DataControlRowType.DataRow Then - ImporteClasi = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal - CveClasificacion = GvRow.DataKey("CveClasificacion").ToEntero - Dim CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero + ImporteClasi = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal + ObsDetalle = GvRow.FCTextBox("TxtObservacion").Text.Trim + + Dim CveAgrupador = GvRow.DataKey("CveAgrupador").ToEntero + Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero + + Dim CveClasificacion As Integer = -1 + Dim CveConceptoContableNom As Integer = -1 + Dim CveTipoGasto As Integer = -1 + + If Tipo = 1 Then + CveClasificacion = CveAgrupador + CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero + End If + + If Tipo = 2 Then + CveConceptoContableNom = CveAgrupador + End If + If CveClasificacion > 0 Then If ImporteClasi > 0 Then - TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuestoNuevo, CveClasificacion, CveTipoGasto, ImporteClasi, ObsDetalle) + TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuestoNuevo, CveClasificacion, CveTipoGasto, ImporteClasi, ObsDetalle, CveConceptoContableNom:=CveConceptoContableNom) If TieneError Then Exit For End If @@ -427,11 +458,11 @@ Partial Class Contratos_Presupuestos Alert("Se agregó el presupuesto correctamente.", TipoMensaje.MsgInformacion, Liga) End If - End Sub + End Sub #End Region - - - + + + Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs) Handles LnkAutorizar.Click If ValidaDatos() Then If ActualizarPresupuesto() Then diff --git a/Contratos/RepPresupuestos.aspx b/Contratos/RepPresupuestos.aspx index ba7cfd71f..500e6ef34 100644 --- a/Contratos/RepPresupuestos.aspx +++ b/Contratos/RepPresupuestos.aspx @@ -233,7 +233,7 @@
    Clasificacion:
    - +
    Tipo Gasto:
    diff --git a/Contratos/RepPresupuestos.aspx.vb b/Contratos/RepPresupuestos.aspx.vb index 07cfc6d1f..4800f3850 100644 --- a/Contratos/RepPresupuestos.aspx.vb +++ b/Contratos/RepPresupuestos.aspx.vb @@ -8,9 +8,9 @@ Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Contratos_RepPresupuestos - Inherits ClsPaginas + Inherits ClsPaginas #Region "P R O P I E D A D E S" - + Public Property DtPresupuestos() As DataTable Get Return DirectCast(ViewState("DtPresupuestos"), DataTable) @@ -18,15 +18,15 @@ Partial Class Contratos_RepPresupuestos Set(ByVal value As DataTable) ViewState("DtPresupuestos") = value End Set - End Property - + End Property + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then InicializaValores() End If - End Sub - + End Sub + #Region " INICIALIZA VALORES " Private Sub InicializaValores() @@ -36,9 +36,14 @@ Partial Class Contratos_RepPresupuestos DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() - DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + Dim dtAgrupador = (From dr In GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + Select New With {.CveAgrupador = dr("CveClasificacion").ToString().ToEntero(), .Agrupador = dr("Clasificacion").ToString()} + ).Union(From dr In GlobalDTContaConceptosContables(-1) + Select New With {.CveAgrupador = dr("CveConceptoContable").ToString().ToEntero(), .Agrupador = dr("ConceptoContable").ToString()}).QueryToDataTable(True) + + DdlClasificacion.DataSource = dtAgrupador + DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) - DdlClasificacion.DataBind() DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"})) DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1")) @@ -46,12 +51,12 @@ Partial Class Contratos_RepPresupuestos CargaSubProyecto() UpFiltros.Update() - End Sub + End Sub #End Region - - + + #Region " CARGA DATOS " - + Private Sub CargaSubProyecto() DdlSubProyecto.Items.Clear() If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then @@ -362,15 +367,15 @@ Partial Class Contratos_RepPresupuestos EsProyecto = True End If Dim Css = "Texto" - Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" + Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If End If - End Sub + End Sub #End Region - - - + + + Protected Sub ChkMensual_CheckedChanged(sender As Object, e As EventArgs) Handles ChkMensual.CheckedChanged DivRepDatos.Visible = Not ChkMensual.Checked @@ -492,7 +497,7 @@ Partial Class Contratos_RepPresupuestos Dim FechaFin = e.Row.DBCampo("FechaFFiltro").ToDate.ToShortDateString Dim FechaInicio = e.Row.DBCampo("FechaIFiltro").ToDate.ToShortDateString Dim Css = "Texto" - Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={True}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" + Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={True}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If Else @@ -506,7 +511,7 @@ Partial Class Contratos_RepPresupuestos Dim FechaFin = e.Row.DBCampo("FechaFFiltro").ToDate.ToShortDateString Dim FechaInicio = e.Row.DBCampo("FechaIFiltro").ToDate.ToShortDateString Dim Css = "Texto" - Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={True}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" + Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={True}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If End If @@ -515,8 +520,8 @@ Partial Class Contratos_RepPresupuestos End Sub Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) CargaSubProyecto() - End Sub - + End Sub + #Region " IMPRESION - NUEVO " Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click GenerarPDF("EXCEL") @@ -555,7 +560,7 @@ Partial Class Contratos_RepPresupuestos Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) End If - End Sub + End Sub #End Region - + End Class diff --git a/Contratos/RepPresupuestosDetalle.aspx b/Contratos/RepPresupuestosDetalle.aspx index 05b3668d8..35ed80fe3 100644 --- a/Contratos/RepPresupuestosDetalle.aspx +++ b/Contratos/RepPresupuestosDetalle.aspx @@ -226,7 +226,7 @@
    Clasificacion:
    - +
    Tipo Gasto:
    diff --git a/Contratos/RepPresupuestosDetalle.aspx.vb b/Contratos/RepPresupuestosDetalle.aspx.vb index 75fdbd48b..af74319ad 100644 --- a/Contratos/RepPresupuestosDetalle.aspx.vb +++ b/Contratos/RepPresupuestosDetalle.aspx.vb @@ -45,9 +45,14 @@ Partial Class Contratos_RepPresupuestosDetalle TxtFiltrosFechaInicio.Text = $"01/09/{Now.Year - 1}" TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}" - DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + Dim dtAgrupador = (From dr In GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + Select New With {.CveAgrupador = dr("CveClasificacion").ToString().ToEntero(), .Agrupador = dr("Clasificacion").ToString()} + ).Union(From dr In GlobalDTContaConceptosContables(-1) + Select New With {.CveAgrupador = dr("CveConceptoContable").ToString().ToEntero(), .Agrupador = dr("ConceptoContable").ToString()}).QueryToDataTable(True) + + DdlClasificacion.DataSource = dtAgrupador + DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1")) - DdlClasificacion.DataBind() DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() @@ -181,7 +186,7 @@ Partial Class Contratos_RepPresupuestosDetalle EsProyecto = True End If Dim Css = "Texto" - Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" + Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If End If @@ -302,7 +307,7 @@ Partial Class Contratos_RepPresupuestosDetalle EsProyecto = True End If Dim Css = "Texto" - Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" + Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If End If diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx b/Contratos/RepPresupuestosDetalleCompras.aspx index 1b611900f..a6f50fb94 100644 --- a/Contratos/RepPresupuestosDetalleCompras.aspx +++ b/Contratos/RepPresupuestosDetalleCompras.aspx @@ -221,7 +221,7 @@
    Clasificacion:
    - +
    Tipo Gasto:
    @@ -242,7 +242,7 @@
    - + diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx.vb b/Contratos/RepPresupuestosDetalleCompras.aspx.vb index 56c455d1d..89ac7a195 100644 --- a/Contratos/RepPresupuestosDetalleCompras.aspx.vb +++ b/Contratos/RepPresupuestosDetalleCompras.aspx.vb @@ -31,11 +31,16 @@ Partial Class Contratos_RepPresupuestosDetalleCompras Private Sub InicializaValores() TxtFiltrosFechaInicio.Text = $"01/09/{Now.Year - 1}" - TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}" - - DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}" + + Dim dtAgrupador = (From dr In GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + Select New With {.CveAgrupador = dr("CveClasificacion").ToString().ToEntero(), .Agrupador = dr("Clasificacion").ToString()} + ).Union(From dr In GlobalDTContaConceptosContables(-1) + Select New With {.CveAgrupador = dr("CveConceptoContable").ToString().ToEntero(), .Agrupador = dr("ConceptoContable").ToString()}).QueryToDataTable(True) + + DdlClasificacion.DataSource = dtAgrupador + DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1")) - DdlClasificacion.DataBind() DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() @@ -121,6 +126,21 @@ Partial Class Contratos_RepPresupuestosDetalleCompras If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowIndex = 0 Then e.Row.CssClass = "Totales" + End If + If e.Row.RowIndex > 0 Then + Dim Liga = "" + Dim Css = "Texto" + + Dim TipoAgrupador As Integer = e.Row.DBCampo("TipoAgrupador").ToEntero() + Select Case TipoAgrupador + Case 1 + Liga = $"/Compras/Compras.aspx?&CveCompra={e.Row.DBCampo("CveCompra")}" + Case 2 + Liga = $"/Contabilidad/RegPrePoliza.aspx?&CvePrePoliza={e.Row.DBCampo("CveCompra")}" + Case Else + + End Select + e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If End If End Sub diff --git a/Empresas/119/Formatos/CHQ-7260.rdlc b/Empresas/119/Formatos/CHQ-7260.rdlc index 24ae6ff90..0b58cd17b 100644 --- a/Empresas/119/Formatos/CHQ-7260.rdlc +++ b/Empresas/119/Formatos/CHQ-7260.rdlc @@ -1,498 +1,5 @@ - - - - - true - true - - - - - - - - - =Parameters!Folio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =UCASE(day(Parameters!Fecha.Value) & " DE " & CHOOSE(MONTH(Parameters!Fecha.Value),"Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre") & " DE " & year(Parameters!Fecha.Value)) - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ImporteLetra.Value - - - - - - - Textbox1 - 3.73754cm - 1.11125cm - 0.6cm - 14.79409cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Beneficiario.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Importe.Value - - - - - - - Textbox1 - 2.78553cm - 16.60737cm - 0.75875cm - 3.23497cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 3.35611cm - - - 11.2824cm - - - 2.29715cm - - - 2.63229cm - - - - - 0.54708cm - - - - - true - true - - - - - =Fields!CODIGO.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cuenta.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cargo.Value - - - - - - - Cargo - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Abono.Value - - - - - - - Abono - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - DataSet1 - 11.32099cm - 0.73766cm - 0.54708cm - 19.56795cm - 6 - - - - - - - - - - - - - - - - - - 7.26042in - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 29.7cm - 21cm - 0cm - 0cm - 0cm - 0.13cm - + + + =Parameters!Folio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =UCASE(day(Parameters!Fecha.Value) & " DE " & CHOOSE(MONTH(Parameters!Fecha.Value),"Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre") & " DE " & year(Parameters!Fecha.Value)) + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ImporteLetra.Value + + + + + + + Textbox1 + 3.89629cm + 1.11125cm + 0.6cm + 14.79409cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Beneficiario.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Importe.Value + + + + + + + Textbox1 + 2.94428cm + 16.60737cm + 0.75875cm + 3.23497cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 3.35611cm + + + 11.2824cm + + + 2.29715cm + + + 2.63229cm + + + + + 0.54708cm + + + + + true + true + + + + + =Fields!CODIGO.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cuenta.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cargo.Value + + + + + + + Cargo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Abono.Value + + + + + + + Abono + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + DataSet1 + 11.32099cm + 0.73766cm + 0.54708cm + 19.56795cm + 6 + + + + + + + + + + + + + + + + + + 7.26042in + - - - - - - - - Tipo de Comprobante: I - Ingreso - - - - - - - - - Del Cobre No. 95 Col. Parque Industrial Hermosillo, Sonora. México, C.P. 83299 - - - - - - - - - Tel. 6622510249 - - - - - - - - - Régimen Fiscal: 601 - General de Ley Personas Morales - - - - - - - Textbox4 - 1.67497in - 0.75237in - 6.31315in - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Logo1 - FitProportional - 1.06146cm - 1.91102cm - 2.76081cm - 1 - - - - - - true - true - - - - - Nombre: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 1.19026cm - - - 1.4759cm - - - 1.29788cm - - - 1.48643cm - - - 7.60751cm - - - 1.37298cm - - - 1.42482cm - - - 1.73271cm - - - 2.4815cm - - - - - 0.48536cm - - - - - true - - - - - Cantidad - - - - - - - Textbox34 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Codigo - - - - - - - Textbox15 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - C.U. SAT - - - - - - - Textbox75 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave Prod. - - - - - - - Textbox82 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox79 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Obj. Imp. - - - - - - - Textbox7 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - P.U. - - - - - - - Textbox84 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Impuestos - - - - - - - Textbox91 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Importe - - - - - - - - - - - - - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.48536cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - - #4f81bd - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo1 - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveUM.Value - - - - - - - SATClaveUM - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveProdServ.Value - - - - - - - SATClaveProdServ - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value & " " & Fields!Obs.Value - - - - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!CodigoObjetoImpuesto.Value - - - - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteIVA.Value - - - - - - - ImporteIVA - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value*Fields!PU.Value - - - - - - - Textbox88 - - - - #4f81bd - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 4.63617cm - 0.21985cm - 0.97072cm - 20.06999cm - 4 - - - 8pt - - - - true - true - true - - - - - =Parameters!ClienteDatoExtra1.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 3.15414cm - - - - - 0.5841cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 0.66667cm - - - - - true - true - - - - - =Replace(Parameters!Moneda.Value,"Pesos","Peso mexicano") - - - - - - - Textbox47 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.52863cm - - - true - true - - - - - =Fields!ImpuestoLocal.Value - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 2.52863cm - - - true - true - - - - - Moneda - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - Before - - - - DataSet1 - 7.01572cm - 14.60707cm - 1.25076cm - 5.68277cm - 6 - - - - - - true - true - - - - - Folio Factura - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) - - - - - - - Textbox3 - 1.84362cm - 17.17098cm - 0.41303cm - 3.066cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Fecha.Value - - - - - - - Textbox12 - 2.27076cm - 17.17098cm - 0.42714cm - 3.066cm - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Lugar de Expedición - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - 83299 - - - - - - - Textbox55 - 2.77551cm - 17.17098cm - 0.46681cm - 3.05452cm - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Forma de Pago - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FormaPago.Value - - - - - - - Textbox3 - 1.8799cm - 4.25442cm - 0.42944cm - 6.76133cm - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Método de Pago - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) - - - - - - - Textbox3 - 2.29523cm - 4.25442cm - 0.40122cm - 6.76133cm - 16 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Moneda - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Moneda.Value - - - - - - - - Tipo de Cambio - - - - - - - - =Parameters!TipoCambio.Value - - - - - - - - - - - Textbox3 - 2.74584cm - 4.25442cm - 0.43297cm - 6.76133cm - 18 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Datos del Cliente - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - R.F.C.: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteRFC.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Uso CFDI: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!UsoCFDI.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Domicilio: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteDireccion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - OBSERVACIONES GENERALES: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - - Textbox3 - 6.90978cm - 4.83044cm - 0.44003cm - 9.60024cm - 27 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ImporteLetra.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Importe Con Letra: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Este documento es una representación impresa de un CFDI Version - - - - =IIf(Parameters!CFDIVersion.Value = "4.0","4.0","3.3") - - - - - - - Textbox19 - 3.39026in - 14.1724cm - 0.13921in - 2.40844in - 30 - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SelloCFDI.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Sello Digital del CFDI - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SelloSAT.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Sello SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CadenaSAT.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Cadena Original del Complemento del Certificación Digital del SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - true - true - - - - - CFDI Relacionados - - - - - - - Textbox5 - 0.02226cm - 1.30058cm - 0.46066cm - 18.98926cm - - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Tipo Relación: - - - - - - - Textbox29 - 0.57625cm - 5.06432cm - 0.41981cm - 5.31841cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!TipoRelacionTexto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.42456cm - - - 2.05585cm - - - 3.03631cm - - - 7.7847cm - - - - - 0.44125cm - - - - - true - true - - - - - Folio - - - - - - - Textbox10 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox12 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox21 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Folio Fiscal - - - - - - - Textbox11 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.41479cm - - - - - true - true - - - - - =Fields!SerieFolio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Fecha.Value - - - - - - - Fecha - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FolioFiscal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - - - - - - - DataSet4 - 1.07893cm - 3.56258cm - 0.85604cm - 15.30142cm - 3 - - - - - - true - 11.9011cm - 1.93497cm - 20.28984cm - 37 - - =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) - - - - - - - - - CartaPorteTimbrado - - - =Parameters!SRP_LogoPath.Value - - - =Parameters!SRP_RFC.Value - - - =Parameters!SRP_SerieFolio.Value - - - =Parameters!SRP_DomicilioFiscal.Value - - - =Parameters!SRP_RegimenFiscal.Value - - - =Parameters!SRP_DomicilioExpedicion.Value - - - =Parameters!SRP_ClienteDireccion.Value - - - =Parameters!SRP_ClienteNombre.Value - - - =Parameters!SRP_ClienteRFC.Value - - - =Parameters!SRP_MedioTransporte.Value - - - =Parameters!SRP_TransporteInternacional.Value - - - =Parameters!SRP_FolioFiscal.Value - - - =Parameters!SRP_FechaCertificacion.Value - - - =Parameters!SRP_CertificadoContribuyente.Value - - - =Parameters!SRP_SerieCertificadoSAT.Value - - - =Parameters!SRP_SelloCFDI.Value - - - =Parameters!SRP_CadenaOriginal.Value - - - =Parameters!SRP_SelloSAT.Value - - - =Parameters!SRP_QR.Value - - - =Parameters!SRP_PermisoSTCC.Value - - - =Parameters!SRP_NumPermiso.Value - - - =Parameters!SRP_Aseguradora.Value - - - =Parameters!SRP_NumPoliza.Value - - - =Parameters!SRP_PlacaVM.Value - - - =Parameters!SRP_AnioVM.Value - - - =Parameters!SRP_TipoTI.Value - - - =Parameters!SRP_ViaTI.Value - - - =Parameters!SRP_UsoCFDi.Value - - - =Parameters!SRP_SubTotal.Value - - - =Parameters!SRP_Total.Value - - - =Parameters!SRP_Descuentos.Value - - - =Parameters!SRP_NombreAseguradoraMedioAmbiente.Value - - - =Parameters!SRP_NumPolizaSeguroMedioAmbiente.Value - - - =Parameters!SRP_NombreAseguradoraCarga.Value - - - =Parameters!SRP_NumPolizaSeguroCarga.Value - - - =Parameters!SRP_RemolquePlaca1.Value - - - =Parameters!SRP_RemolqueSubtimo1.Value - - - =Parameters!SRP_RemolquePlaca2.Value - - - =Parameters!SRP_RemolqueSubtimo2.Value - - - =True - - - =Parameters!SRP_PesoNetoTotal.Value - - - =Parameters!SRP_DistanciaTotal.Value - - - =Parameters!SRP_UnidadPeso.Value - - - =Parameters!SRP_NumTotalMercancias.Value - - - =Parameters!SRP_PermisoSCTRemolque1.Value - - - =Parameters!SRP_PermisoSCTRemolque2.Value - - - =Parameters!SRP_ConfATR1.Value - - - =Parameters!SRP_ConfATR2.Value - - - 0.06863cm - 1.11461cm - 20.12945cm - - - - - - true - 5.65275cm - 1.2341cm - 20.2229cm - 38 - - = Not iif(IsNothing(Parameters!TieneCartaPorte), True, iif(Parameters!TieneCartaPorte.Value , True, False)) - - - - - - - true - true - - - - - Regimen Fiscal: - - - - - - - Textbox19 - 1.62527in - 10.5005cm - 0.17222in - 0.82757in - 39 - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!RegimenFiscalCodigo.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - External - =Parameters!QR.Value - FitProportional - 0.06848in - 0.0372in - 0.51336in - 0.79074in - - - - - - true - true - - - - - Serie del Certificado del Emisor - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio Fiscal - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No. de Serie del Certificado de l SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha y Hora de Certificación - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CertificadoContribuyente.Value - - - - - - - Textbox2 - 0cm - 8.1126cm - 0.35889cm - 5.62289cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FolioFiscal.Value - - - - - - - Textbox2 - 0.39417cm - 8.1126cm - 0.33067cm - 5.62289cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - Textbox2 - 0.76717cm - 8.1126cm - 0.3536cm - 5.62289cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaCertificacion.Value - - - - - - - Textbox2 - 1.1631cm - 8.1126cm - 0.31479cm - 5.62289cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - 7.84409cm - 0.19628cm - 1.6525cm - 13.9708cm - 41 - - - - - - 13.83608cm - - - - - - - Textbox3 - 0.04232cm - 16.6252cm - 0.30896cm - 3.66464cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 0.5cm - 1.27cm - + + + + + + + + Tipo de Comprobante: I - Ingreso + + + + + + + + + Del Cobre No. 95 Col. Parque Industrial Hermosillo, Sonora. México, C.P. 83299 + + + + + + + + + Tel. 6622510249 + + + + + + + + + Régimen Fiscal: 601 - General de Ley Personas Morales + + + + + + + Textbox4 + 1.67497in + 0.75237in + 6.31315in + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 1.06146cm + 1.91102cm + 2.76081cm + 1 + + + + + + true + true + + + + + Nombre: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.19026cm + + + 1.10859cm + + + 1.29788cm + + + 1.48643cm + + + 7.60751cm + + + 1.25656cm + + + 1.91588cm + + + 1.72538cm + + + 2.4815cm + + + + + 0.48536cm + + + + + true + + + + + Cantidad + + + + + + + Textbox34 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Codigo + + + + + + + Textbox15 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + C.U. SAT + + + + + + + Textbox75 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Clave Prod. + + + + + + + Textbox82 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Descripción + + + + + + + Textbox79 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Obj. Imp. + + + + + + + Textbox7 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + P.U. + + + + + + + Textbox84 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Impuestos + + + + + + + Textbox91 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Importe + + + + + + + + + + + + + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.48536cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + + #4f81bd + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo1 + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveUM.Value + + + + + + + SATClaveUM + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!CodigoObjetoImpuesto.Value + + + + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteIVA.Value + + + + + + + ImporteIVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value*Fields!PU.Value + + + + + + + Textbox88 + + + + #4f81bd + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 4.63617cm + 0.21985cm + 0.97072cm + 20.06999cm + 4 + + + 8pt + + + + true + true + true + + + + + =Parameters!ClienteDatoExtra1.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 3.15414cm + + + + + 0.5841cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 0.66667cm + + + + + true + true + + + + + =Replace(Parameters!Moneda.Value,"Pesos","Peso mexicano") + + + + + + + Textbox47 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.52863cm + + + true + true + + + + + =Fields!ImpuestoLocal.Value + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 2.52863cm + + + true + true + + + + + Moneda + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + Before + + + + DataSet1 + 7.01572cm + 14.60707cm + 1.25077cm + 5.68277cm + 6 + + + + + + true + true + + + + + Folio Factura + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) + + + + + + + Textbox3 + 1.84362cm + 17.17098cm + 0.41303cm + 3.066cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox12 + 2.27076cm + 17.17098cm + 0.42714cm + 3.066cm + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Lugar de Expedición + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 83299 + + + + + + + Textbox55 + 2.77551cm + 17.17098cm + 0.46681cm + 3.05452cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Forma de Pago + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + + Textbox3 + 1.8799cm + 4.25442cm + 0.42944cm + 6.76133cm + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Método de Pago + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) + + + + + + + Textbox3 + 2.29523cm + 4.25442cm + 0.40122cm + 6.76133cm + 16 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Moneda + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Moneda.Value + + + + + + + + Tipo de Cambio + + + + + + + + =Parameters!TipoCambio.Value + + + + + + + + + + + Textbox3 + 2.74584cm + 4.25442cm + 0.43297cm + 6.76133cm + 18 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Datos del Cliente + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + R.F.C.: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteRFC.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Uso CFDI: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!UsoCFDI.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Domicilio: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + , + + + + =UCase(Parameters!ClienteCiudad.Value) + + + + , + + + + =UCase(Parameters!ClienteEstado.Value) + + + + , + + + + =UCase(Parameters!ClientePais.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + OBSERVACIONES GENERALES: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + + Textbox3 + 6.90978cm + 4.83044cm + 0.44003cm + 9.60024cm + 27 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ImporteLetra.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Importe Con Letra: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Este documento es una representación impresa de un CFDI Version + + + + =IIf(Parameters!CFDIVersion.Value = "4.0","4.0","3.3") + + + + + + + Textbox19 + 3.39026in + 14.1724cm + 0.13921in + 2.40844in + 30 + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello Digital del CFDI + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CadenaSAT.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cadena Original del Complemento del Certificación Digital del SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.02226cm + 1.30058cm + 0.46066cm + 18.98926cm + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.57625cm + 5.06432cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.07893cm + 3.56258cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + 11.9011cm + 1.93497cm + 20.28984cm + 37 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + + + + + CartaPorteTimbrado + + + =Parameters!SRP_LogoPath.Value + + + =Parameters!SRP_RFC.Value + + + =Parameters!SRP_SerieFolio.Value + + + =Parameters!SRP_DomicilioFiscal.Value + + + =Parameters!SRP_RegimenFiscal.Value + + + =Parameters!SRP_DomicilioExpedicion.Value + + + =Parameters!SRP_ClienteDireccion.Value + + + =Parameters!SRP_ClienteNombre.Value + + + =Parameters!SRP_ClienteRFC.Value + + + =Parameters!SRP_MedioTransporte.Value + + + =Parameters!SRP_TransporteInternacional.Value + + + =Parameters!SRP_FolioFiscal.Value + + + =Parameters!SRP_FechaCertificacion.Value + + + =Parameters!SRP_CertificadoContribuyente.Value + + + =Parameters!SRP_SerieCertificadoSAT.Value + + + =Parameters!SRP_SelloCFDI.Value + + + =Parameters!SRP_CadenaOriginal.Value + + + =Parameters!SRP_SelloSAT.Value + + + =Parameters!SRP_QR.Value + + + =Parameters!SRP_PermisoSTCC.Value + + + =Parameters!SRP_NumPermiso.Value + + + =Parameters!SRP_Aseguradora.Value + + + =Parameters!SRP_NumPoliza.Value + + + =Parameters!SRP_PlacaVM.Value + + + =Parameters!SRP_AnioVM.Value + + + =Parameters!SRP_TipoTI.Value + + + =Parameters!SRP_ViaTI.Value + + + =Parameters!SRP_UsoCFDi.Value + + + =Parameters!SRP_SubTotal.Value + + + =Parameters!SRP_Total.Value + + + =Parameters!SRP_Descuentos.Value + + + =Parameters!SRP_NombreAseguradoraMedioAmbiente.Value + + + =Parameters!SRP_NumPolizaSeguroMedioAmbiente.Value + + + =Parameters!SRP_NombreAseguradoraCarga.Value + + + =Parameters!SRP_NumPolizaSeguroCarga.Value + + + =Parameters!SRP_RemolquePlaca1.Value + + + =Parameters!SRP_RemolqueSubtimo1.Value + + + =Parameters!SRP_RemolquePlaca2.Value + + + =Parameters!SRP_RemolqueSubtimo2.Value + + + =True + + + =Parameters!SRP_PesoNetoTotal.Value + + + =Parameters!SRP_DistanciaTotal.Value + + + =Parameters!SRP_UnidadPeso.Value + + + =Parameters!SRP_NumTotalMercancias.Value + + + =Parameters!SRP_PermisoSCTRemolque1.Value + + + =Parameters!SRP_PermisoSCTRemolque2.Value + + + =Parameters!SRP_ConfATR1.Value + + + =Parameters!SRP_ConfATR2.Value + + + 0.06863cm + 1.11461cm + 20.12945cm + + + + + + true + 5.65275cm + 1.2341cm + 20.2229cm + 38 + + = Not iif(IsNothing(Parameters!TieneCartaPorte), True, iif(Parameters!TieneCartaPorte.Value , True, False)) + + + + + + + true + true + + + + + Regimen Fiscal: + + + + + + + Textbox19 + 1.62527in + 10.5005cm + 0.17222in + 0.82757in + 39 + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!RegimenFiscalCodigo.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + External + =Parameters!QR.Value + FitProportional + 0.06848in + 0.0372in + 0.51336in + 0.79074in + + + + + + true + true + + + + + Serie del Certificado del Emisor + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. de Serie del Certificado de l SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora de Certificación + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + Textbox2 + 8.1126cm + 0.35889cm + 5.62289cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscal.Value + + + + + + + Textbox2 + 0.39417cm + 8.1126cm + 0.33067cm + 5.62289cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + Textbox2 + 0.76717cm + 8.1126cm + 0.3536cm + 5.62289cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaCertificacion.Value + + + + + + + Textbox2 + 1.1631cm + 8.1126cm + 0.31479cm + 5.62289cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 7.84409cm + 0.19628cm + 1.6525cm + 13.9708cm + 41 + + + + + + 13.83608cm + + + + + + + Textbox3 + 0.04232cm + 16.6252cm + 0.30896cm + 3.66464cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + + + =Today + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 1cm + 0.5cm + 1.27cm + @@ -489,7 +490,7 @@ Textbox88 0.07057cm - 4.6275cm + 4.54701cm 2.25463cm 16.27211cm 1 @@ -506,9 +507,9 @@ true 6.61175in - 0.06752in + 0.09419in 1.42169in - 8.23953in + 8.20784in @@ -519,34 +520,34 @@ - 0.54014in + 0.5387in - 0.59111in + 0.58967in - 0.80359in + 0.80215in - 0.66404in + 0.64011in - 2.11562in + 2.06124in - 0.6863in + 0.68486in - 0.69852in + 0.69708in - 0.6403in + 0.63886in - 0.67895in + 0.67751in - 0.80447in + 0.80303in @@ -1384,9 +1385,9 @@ DsOC 1.75278in - 0.09836in + 0.13771in 0.36206in - 8.22304in + 8.13325in 1 - 22.76324cm + 22.76325cm - - - =Parameters!Serie.Value - - - - - - - - - =Parameters!Folio.Value - - - - Por éste pagare prometo (emos) pagar incondicionalmente a la orden de VALPA SUPERVISIONES SA DE CV, a su vencimiento el - - - - =Parameters!Vencimiento.Value - - - - , en Hermosillo, Sonora o en el domicilio señalado a elección del acreedor o tenedor la cantidad de $ - - - - =Parameters!Total.Value - - - - SON: ( - - - - =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) - - - - ). Valor recibido a mi (nuestra) entera satisfacción. la falta de pago de éste documento a su vencimiento dará derecho a VALPA SUPERVISIONES SA DE CV o tenedor, desde el día siguiente a cobrar el 10% mensual de interes moratorios hasta su total liquidación y los gastos judiciales que se ocasionen. Lugar y Fecha de Suscripción: Hermosillo, Sonora a - - - - =CDATE(Parameters!Fecha.Value).ToString("dd/MM/yyyy") - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Nombre: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Dirección: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteNombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteDireccion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Acepto de conformidad - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 3.15cm - 15.1696cm - 0cm - 4.87315cm - 6 - - - - @@ -1533,10 +1150,8 @@ true - 3.58328cm 1.82156cm 20.12951cm - 7 =Microsoft.VisualBasic.Interaction.iif(Parameters!TipoRelacionTexto.Value <> "" Or Parameters!FolioFiscalRelacionado.Value <> "", False, True) @@ -1573,11 +1188,11 @@ Textbox5 - 5.54595cm + 1.96267cm 15.89718cm 0.49387cm 4.14557cm - 8 + 1 @@ -1590,8 +1205,8 @@ true - 17.24694cm - 6.03982cm + 17.27869cm + 2.45654cm 20.18336cm 16 @@ -1602,7 +1217,7 @@ - + 1.5pt @@ -1636,7 +1251,7 @@ Textbox19 1.60478in - 6.03032in + 6.03465in 0.22222in 1.89794in 17 @@ -2462,7 +2077,7 @@ - =Parameters!Moneda.Value + =IIF(Parameters!Moneda.Value="Pesos", "Peso Mexicano",Parameters!Moneda.Value) + true @@ -2593,7 +2209,7 @@ true 6.48302cm - 0.17537cm + 0.18636cm 7.01685cm 20.00799cm 18 @@ -3107,7 +2723,7 @@ true 13.60571cm - 0.17537cm + 0.18636cm 3.53187cm 20.00799cm 19 @@ -4522,9 +4138,9 @@ DsOC 4.62939cm - 0.17537cm + 0.18636cm 1.75603cm - 19.86738cm + 19.86739cm 20 - 23.28676cm + 19.73523cm @@ -187,6 +182,7 @@ 1pt Silver + 2pt @@ -238,159 +234,7 @@ 1pt Silver - - - - - - - - true - true - - - - - % de Pago - - - - - - - Textbox9 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - - - - - - - - true - true - - - - - Horas Dobles - - - - - - - Textbox11 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - - - - - - - - true - true - - - - - Horas Triples - - - - - - - Textbox7 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver + 2pt @@ -442,6 +286,59 @@ 1pt Silver + 2pt + + + + + + + + true + true + + + + + Observaciones + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt @@ -449,7 +346,7 @@ - 0.36188cm + 0.5cm @@ -496,6 +393,7 @@ 0.5pt + 2pt @@ -545,6 +443,7 @@ 0.5pt + 2pt @@ -594,134 +493,7 @@ 0.5pt - - - - - - - - true - true - - - - - =Fields!PorcentajePago.Value - - - - - 0.5pt - - - - - - - - - true - true - - - - - =IIf(Fields!HorasDobles.Value>0,Fields!HorasDobles.Value.ToString(),"") - - - - - 0.5pt - - - Gray - - 0.5pt - - - Gray - - 0.5pt - - - Gray - - 0.5pt - - - Gray - - 0.5pt - - - - - - - - - true - true - - - - - =IIf(Fields!HorasTriples.Value>0,Fields!HorasTriples.Value.ToString(),"") - - - - - 0.5pt - - - Gray - - 0.5pt - - - Gray - - 0.5pt - - - Gray - - 0.5pt - - - Gray - - 0.5pt - + 2pt @@ -771,6 +543,57 @@ 0.5pt + 2pt + + + + + + + + true + true + + + + + + + + + + 0.5pt + + + Gray + + 0.5pt + + + Gray + + 0.5pt + + + Gray + + 0.5pt + + + Gray + + 0.5pt + + 2pt @@ -786,8 +609,6 @@ - - @@ -803,8 +624,8 @@ DataSet1 3.2953cm 0.31432cm - 0.77667cm - 19.31368cm + 1cm + 19.31369cm diff --git a/GPS/FacturacionMasiva.aspx.vb b/GPS/FacturacionMasiva.aspx.vb index 9c4d12d65..18c9736c5 100644 --- a/GPS/FacturacionMasiva.aspx.vb +++ b/GPS/FacturacionMasiva.aspx.vb @@ -790,17 +790,12 @@ Partial Class Contratos_FacturacionMasiva End If importeMovimiento = 0 - - Case 13 'Iva por Trasladar importeMovimiento = ObjFactura.IVA * ValorMultiplicador importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago - IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - - End Select If importeMovimiento <> 0 Then diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 0f41c1d1d..6005f6427 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -696,7 +696,8 @@
    - + <%-- --%> +
    diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 499a811e2..41ec07a45 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -5955,10 +5955,10 @@ Partial Class Inventarios_EntradasSalidas End Sub Private Sub CargaClientesCarta() - DdlClienteCarta.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClienteCarta.DataBind() + 'DdlClienteCarta.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + 'DdlClienteCarta.DataBind() - DdlClienteCarta.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlClienteCarta.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlClienteCarta.SelectedValue = "-1" End Sub diff --git a/Inventarios/Remanufactura.aspx.vb b/Inventarios/Remanufactura.aspx.vb index cd1c6528e..7d2996a1b 100644 --- a/Inventarios/Remanufactura.aspx.vb +++ b/Inventarios/Remanufactura.aspx.vb @@ -867,7 +867,6 @@ Partial Class Inventarios_Remanufactura importeMovimiento = ObjFactura.IVA * ValorMultiplicador importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago - IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" Case 38 'IEPS por Trasladar diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index c946091fb..74565624e 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -466,7 +466,7 @@ - + diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 53fbda46b..11e1f5e05 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -972,7 +972,7 @@ Partial Class Inventarios_TraspasoAlmacen If Existencia < 0 Then ErrorExistencia = True - TextoExistencia.AppendFormat(" {1},", gvr.DataKey("No"), gvr.DataKey("CvePS"), If(gvr.DataKey("Serie").ToString().Trim().Length > 0, $"   Serie: {gvr.DataKey("Serie")}", ""), (Existencia + gvr.FCTextBox("TxtCantidad2").Text.ToEntero), MsgAdicional) + TextoExistencia.AppendFormat("-#{0} {1} {2}   Existencia: {3}{4}
    ", gvr.DataKey("No"), gvr.DataKey("PS"), If(gvr.DataKey("Serie").ToString().Trim().Length > 0, $"   Serie: {gvr.DataKey("Serie")}", ""), (Existencia + gvr.FCTextBox("TxtCantidad2").Text.ToDecimal()), MsgAdicional) End If Next diff --git a/Nomina/CatConceptos.aspx b/Nomina/CatConceptos.aspx index 112457d79..b7807d8bc 100644 --- a/Nomina/CatConceptos.aspx +++ b/Nomina/CatConceptos.aspx @@ -81,6 +81,11 @@ + + + + + diff --git a/Nomina/ChecadorAsistencia.aspx b/Nomina/ChecadorAsistencia.aspx index 410f6e3a6..d53037dc6 100644 --- a/Nomina/ChecadorAsistencia.aspx +++ b/Nomina/ChecadorAsistencia.aspx @@ -49,6 +49,7 @@ + Asistencia Cheador diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb index e5ff1a56f..7dd41fd4d 100644 --- a/PortalCliente/PortalCliente.aspx.vb +++ b/PortalCliente/PortalCliente.aspx.vb @@ -888,7 +888,6 @@ Partial Class Ventas_PortalCliente importeMX = importeMX.RoundSQL() TCGeneral = TCVenta - IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" Case 61 'IVA TRASLADADO @@ -905,7 +904,6 @@ Partial Class Ventas_PortalCliente importeMX = importeMX.RoundSQL() TCGeneral = TCFluctuacion - IdCtaContable = UsuarioActual.Empresa.IdCuentaIVATrasladado If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" Case 8 'RETIVA X TRASLADAR @@ -1024,7 +1022,6 @@ Partial Class Ventas_PortalCliente importeMX = importeMX.RoundSQL() TCGeneral = TCVenta - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" Case 39 'IEPS TRASLADADO @@ -1041,13 +1038,11 @@ Partial Class Ventas_PortalCliente importeMX = importeMX.RoundSQL() TCGeneral = TCFluctuacion - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" Case 64 'GANANCIA Continue For 'SKIPEA If CveMonedaVenta <> 1 Then - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria If TCPago > TCVenta AndAlso CveMonedaVenta = 2 Then ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta) ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta) @@ -1062,7 +1057,6 @@ Partial Class Ventas_PortalCliente Case 65 'PERDIDA Continue For 'SKIPEA If CveMonedaVenta <> 1 Then - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria If TCPago < TCVenta AndAlso CveMonedaVenta = 2 Then ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta) ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta) diff --git a/RH/ChecadorAsistencia.aspx b/RH/ChecadorAsistencia.aspx index 6e53815a5..b5d33bea8 100644 --- a/RH/ChecadorAsistencia.aspx +++ b/RH/ChecadorAsistencia.aspx @@ -5,7 +5,7 @@ - ASistencia Cheador + Asistencia Cheador diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index b98e6eb41..a223f1f8c 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -2136,99 +2136,100 @@ Partial Class RH_Personal CargaGvBitacora() If EnviarCorreoNomina AndAlso DDLUsuarioNomina.SelectedValue.ToEntero > 0 Then - EnviarCorreoNominista() + 'EnviarCorreoNominista() + EviarCorreoBajaReingresoNomista(TipoMovimientoRH.Alta) End If End Sub - Private Sub EnviarCorreoNominista() + 'Private Sub EnviarCorreoNominista() - If UsuarioActual.CveEmpresa.Contiene(7) Then + ' If UsuarioActual.CveEmpresa.Contiene(7) Then - Dim CorreoNominista As String = GlobalDTUsuarios(CveUsuario:=DDLUsuarioNomina.SelectedValue.ToEntero).Rows(0)("Correo").ToString + ' Dim CorreoNominista As String = GlobalDTUsuarios(CveUsuario:=DDLUsuarioNomina.SelectedValue.ToEntero).Rows(0)("Correo").ToString - If CorreoNominista = "" Then - Alert($"No se envio el correo de notificación a nominas, el nominista no tiene {DDLUsuarioNomina.SelectedItem.Text} correo electronico", TipoMensaje.MsgAdvertencia) - Exit Sub + ' If CorreoNominista = "" Then + ' Alert($"No se envio el correo de notificación a nominas, el nominista no tiene {DDLUsuarioNomina.SelectedItem.Text} correo electronico", TipoMensaje.MsgAdvertencia) + ' Exit Sub - End If + ' End If - Dim correo As New ClsSisMail - Dim Cuerpo As New StringBuilder + ' Dim correo As New ClsSisMail + ' Dim Cuerpo As New StringBuilder - Dim Puesto As String = "" - Dim Padre As String = "" - Dim Madre As String = "" - Dim FechaIngreso As String = "" + ' Dim Puesto As String = "" + ' Dim Padre As String = "" + ' Dim Madre As String = "" + ' Dim FechaIngreso As String = "" - Dim EmpresaDestino As String = If(DdlEmpresaAsignada.SelectedValue.ToEntero > 0, GlobalDTEmpresas(DdlEmpresaAsignada.SelectedValue.ToEntero).Rows(0)("Empresa").ToString, UsuarioActual.Empresa.Empresa) + ' Dim EmpresaDestino As String = If(DdlEmpresaAsignada.SelectedValue.ToEntero > 0, GlobalDTEmpresas(DdlEmpresaAsignada.SelectedValue.ToEntero).Rows(0)("Empresa").ToString, UsuarioActual.Empresa.Empresa) - Dim objRH As New ClsRH + ' Dim objRH As New ClsRH - If objRH.PersonalFamiliaresGet(-1, CvePersonal) Then + ' If objRH.PersonalFamiliaresGet(-1, CvePersonal) Then - Dim DtFamiliares As DataTable = objRH.DtResultados.FiltraParametros(" CveParentesco = 1 ") + ' Dim DtFamiliares As DataTable = objRH.DtResultados.FiltraParametros(" CveParentesco = 1 ") - If DtFamiliares.Rows.Count > 0 Then - Padre = DtFamiliares.Rows(0)("Nombre").ToString - End If + ' If DtFamiliares.Rows.Count > 0 Then + ' Padre = DtFamiliares.Rows(0)("Nombre").ToString + ' End If - DtFamiliares = objRH.DtResultados.FiltraParametros(" CveParentesco = 2 ") + ' DtFamiliares = objRH.DtResultados.FiltraParametros(" CveParentesco = 2 ") - If DtFamiliares.Rows.Count > 0 Then - Madre = DtFamiliares.Rows(0)("Nombre").ToString - End If + ' If DtFamiliares.Rows.Count > 0 Then + ' Madre = DtFamiliares.Rows(0)("Nombre").ToString + ' End If - End If + ' End If - objRH.Dispose() - Cuerpo.AppendLine("") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine("") - Cuerpo.AppendLine("
    { EmpresaDestino }
    { Now.ToShortDateString } { Now.ToShortTimeString }
    Notificacion por Alta de Nomina
    ") + ' objRH.Dispose() + ' Cuerpo.AppendLine("") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine("
    { EmpresaDestino }
    { Now.ToShortDateString } { Now.ToShortTimeString }
    Notificacion por Alta de Nomina
    ") - Cuerpo.AppendLine("
    ") - Cuerpo.AppendLine("
    ") + ' Cuerpo.AppendLine("
    ") + ' Cuerpo.AppendLine("
    ") - Cuerpo.AppendLine("") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine("
    Datos del Candidato
    Puesto:{If(DdlPuesto.SelectedIndex > 0, DdlPuesto.SelectedItem.Text, "") }
    Ruta/Servicio:{ If(DdlRuta.SelectedValue.ToEntero > 0, DdlRuta.SelectedItem.Text, "") }
    Fecha de ingreso:{TxtFechaIngreso.Text}
    Nombre:{ NombreCompleto }
    Fecha y Lugar de Nacimiento:{TxtFechaNacimiento.Text} {TxtLugarNacimiento.Text}
    Numero IMSS:{ TxtNumeroSS.Text }
    Numero Infonavit:{ If(TxtInfoNumCredito.Text.Trim = "", "NO CUENTA CON CREDITO", TxtInfoNumCredito.Text) }
    Sexo:{ If(DdlGenero.SelectedValue = "1", "Masculino", "Femenino") }
    R.F.C.:{ TxtRFC.Text }
    CURP:{ TxtCURP.Text }
    ") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") + ' Cuerpo.AppendLine($"") - If Padre.Length > 0 Then - Cuerpo.AppendLine($"") - End If + ' If Padre.Length > 0 Then + ' Cuerpo.AppendLine($"") + ' End If - If Madre.Length > 0 Then - Cuerpo.AppendLine($"") - End If + ' If Madre.Length > 0 Then + ' Cuerpo.AppendLine($"") + ' End If - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine($"") - Cuerpo.AppendLine("
    Datos del Candidato
    Puesto:{If(DdlPuesto.SelectedIndex > 0, DdlPuesto.SelectedItem.Text, "") }
    Ruta/Servicio:{ If(DdlRuta.SelectedValue.ToEntero > 0, DdlRuta.SelectedItem.Text, "") }
    Fecha de ingreso:{TxtFechaIngreso.Text}
    Nombre:{ NombreCompleto }
    Fecha y Lugar de Nacimiento:{TxtFechaNacimiento.Text} {TxtLugarNacimiento.Text}
    Numero IMSS:{ TxtNumeroSS.Text }
    Numero Infonavit:{ If(TxtInfoNumCredito.Text.Trim = "", "NO CUENTA CON CREDITO", TxtInfoNumCredito.Text) }
    Sexo:{ If(DdlGenero.SelectedValue = "1", "Masculino", "Femenino") }
    R.F.C.:{ TxtRFC.Text }
    CURP:{ TxtCURP.Text }
    Nombre del Padre:{ Padre }
    Nombre del Padre:{ Padre }
    Nombre de la Madre:{ Madre }
    Nombre de la Madre:{ Madre }
    Dirección:{ TxtCalle.Text }
    Escolaridad:{ If(DdlEscolaridad.SelectedIndex > 0, DdlEscolaridad.SelectedItem.Text, "") }
    Telefono:{ TxtCelular.Text},{TxtTelefono.Text}
    Correo:{ TxtCorreo.Text }
    ") + ' Cuerpo.AppendLine($"Dirección:{ TxtCalle.Text }") + ' Cuerpo.AppendLine($"Escolaridad:{ If(DdlEscolaridad.SelectedIndex > 0, DdlEscolaridad.SelectedItem.Text, "") }") + ' Cuerpo.AppendLine($"Telefono:{ TxtCelular.Text},{TxtTelefono.Text}") + ' Cuerpo.AppendLine($"Correo:{ TxtCorreo.Text }") + ' Cuerpo.AppendLine("") - correo.SendMail(EmpresaNotificaciones, CorreoNominista, "Notificacion por Alta de Nomina: " & NombreCompleto, Cuerpo.ToString) + ' correo.SendMail(EmpresaNotificaciones, CorreoNominista, "Notificacion por Alta de Nomina: " & NombreCompleto, Cuerpo.ToString) - End If + ' End If - End Sub + 'End Sub 'Private Sub MandaMails(Rutas As Object) ' Try @@ -7505,6 +7506,12 @@ Partial Class RH_Personal End Using End If + If continuar Then + + EviarCorreoBajaReingresoNomista(If(estatus = 1, TipoMovimientoRH.Reingreso, TipoMovimientoRH.Baja)) + + End If + If continuar Then RegistraScript("$('#ModalUpEstatus').modal('hide');") @@ -7647,5 +7654,115 @@ Partial Class RH_Personal End Sub + + +#Region "ENVIAR CORREO NOMINISTA" + + Enum TipoMovimientoRH + Alta + Baja + Reingreso + End Enum + + Private Sub EviarCorreoBajaReingresoNomista(eTipoMovimientoRH As TipoMovimientoRH) + + + Dim CorreoNominista As String = GlobalDTUsuarios(CveUsuario:=DDLUsuarioNomina.SelectedValue.ToEntero).FiltroPrimeroValor("Correo") + Dim correo As New ClsSisMail + Dim Cuerpo As New StringBuilder + + Dim CorreoUsuario As String = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario).FiltroPrimeroValor("Correo") + Dim CCP As String = If(CorreoUsuario.Trim.Length > 0, CorreoUsuario, "") + + If CorreoNominista = "" Then + Alert("No se envio el correo de notificación a nominas, el nominista no tiene correo electronico", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim Puesto As String = "" + Dim Padre As String = "" + Dim Madre As String = "" + Dim FechaIngreso As String = "" + + Dim objRH As New ClsRH + + If objRH.PersonalFamiliaresGet(-1, CvePersonal) Then + + Dim DtFamiliares As DataTable = objRH.DtResultados.FiltraParametros(" CveParentesco = 1 ") + + If DtFamiliares.Rows.Count > 0 Then + Padre = DtFamiliares.Rows(0)("Nombre").ToString + End If + + DtFamiliares = objRH.DtResultados.FiltraParametros(" CveParentesco = 2 ") + + If DtFamiliares.Rows.Count > 0 Then + Madre = DtFamiliares.Rows(0)("Nombre").ToString + End If + + End If + + Dim TimpoMovimiento As String = "" + + Select Case eTipoMovimientoRH + Case TipoMovimientoRH.Alta + TimpoMovimiento = "Alta" + Exit Select + Case TipoMovimientoRH.Baja + TimpoMovimiento = "Baja" + Exit Select + Case TipoMovimientoRH.Reingreso + TimpoMovimiento = "Reingreso" + Exit Select + End Select + + objRH.Dispose() + Cuerpo.AppendLine("") + Cuerpo.AppendLine($"") + + Cuerpo.AppendLine($"") + Cuerpo.AppendLine("
    { UsuarioActual.Empresa.Empresa }
    { Now.ToShortDateString } { Now.ToShortTimeString }
    Notificacion por { TimpoMovimiento } de Nomina
    ") + + Cuerpo.AppendLine("
    ") + Cuerpo.AppendLine("
    ") + + Cuerpo.AppendLine("") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + + Cuerpo.AppendLine($"") + + If eTipoMovimientoRH = TipoMovimientoRH.Baja Then + Cuerpo.AppendLine($"") + If Txobservacionesbaja.Text.Trim.Length > 0 Then + Cuerpo.AppendLine($"") + End If + End If + + + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine($"") + Cuerpo.AppendLine("
    Datos del Candidato
    Puesto:{IIf(DdlPuesto.SelectedIndex > 0, DdlPuesto.SelectedItem.Text, "") }
    Ruta/Servicio:{ DdlRuta.SelectedItem.Text }
    Fecha de { TimpoMovimiento }:{TxtFechaEstatus.Text}
    Motivo de Baja:{ DdlMotivoBaja.SelectedItem.Text }
    Observaciones :{ Txobservacionesbaja.Text.Trim }
    Nombre:{ NombreCompleto }
    Fecha y Lugar de Nacimiento:{TxtFechaNacimiento.Text} {TxtLugarNacimiento.Text}
    Numero IMSS:{ TxtNumeroSS.Text }
    Numero Infonavit:{ If(TxtInfoNumCredito.Text.Trim = "", "NO CUENTA CON CREDITO", TxtInfoNumCredito.Text) }
    Sexo:{ IIf(DdlGenero.SelectedValue = "1", "Masculino", "Femenino") }
    R.F.C.:{ TxtRFC.Text }
    CURP:{ TxtCURP.Text }
    Nombre del Padre:{ Padre }
    Nombre de la Madre:{ Madre }
    Dirección:{ TxtCalle.Text } No Ext.{ TxtNumExt.Text} No int.{TxtNumInt.Text}
    Escolaridad:{ IIf(DdlEscolaridad.SelectedIndex > 0, DdlEscolaridad.SelectedItem.Text, "") }
    Telefono:{ TxtCelular.Text},{TxtCelularPersonal.Text}
    Tel en Caso de Emergencia:{ TxtTelefonoEmergencia.Text }
    Correo:{ TxtCorreo.Text }
    ") + + correo.SendMail(EmpresaNotificaciones, CorreoNominista, $"Notificacion por { TimpoMovimiento }de Nomina: " & NombreCompleto, Cuerpo.ToString, CCP:=CCP) + + End Sub + + +#End Region + End Class diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb index 601001c2d..c980a831c 100644 --- a/Sistemas/Empresa.aspx.vb +++ b/Sistemas/Empresa.aspx.vb @@ -340,93 +340,93 @@ Partial Class Sistemas_Empresa CargaCuentasContables() CargaDDLs() - Dim Row As DataRow - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxAcreditar.ToString)) - If Not IsNothing(Row) Then - DdlIVAxAcreditar.Items.Add(New ListItem(Row("CtaCodigo").ToString, .IdCuentaIVAxAcreditar.ToString)) - DdlIVAxAcreditar.SelectedValue = .IdCuentaIVAxAcreditar.ToString - End If + 'Dim Row As DataRow + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxAcreditar.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIVAxAcreditar.Items.Add(New ListItem(Row("CtaCodigo").ToString, .IdCuentaIVAxAcreditar.ToString)) + ' DdlIVAxAcreditar.SelectedValue = .IdCuentaIVAxAcreditar.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAAcreditable.ToString)) - If Not IsNothing(Row) Then - DdlIVAAcreditable.Items.Add(New ListItem(Row("CtaCodigo").ToString, .IdCuentaIVAAcreditable.ToString)) - DdlIVAAcreditable.SelectedValue = .IdCuentaIVAAcreditable.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAAcreditable.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIVAAcreditable.Items.Add(New ListItem(Row("CtaCodigo").ToString, .IdCuentaIVAAcreditable.ToString)) + ' ' DdlIVAAcreditable.SelectedValue = .IdCuentaIVAAcreditable.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxTrasladar.ToString)) - If Not IsNothing(Row) Then - DdlIVAxTrasladar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxTrasladar.ToString))("CtaCodigo").ToString, .IdCuentaIVAxTrasladar.ToString)) - DdlIVAxTrasladar.SelectedValue = .IdCuentaIVAxTrasladar.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxTrasladar.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIVAxTrasladar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxTrasladar.ToString))("CtaCodigo").ToString, .IdCuentaIVAxTrasladar.ToString)) + ' DdlIVAxTrasladar.SelectedValue = .IdCuentaIVAxTrasladar.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVATrasladado.ToString)) - If Not IsNothing(Row) Then - DdlIVATrasladado.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVATrasladado.ToString))("CtaCodigo").ToString, .IdCuentaIVATrasladado.ToString)) - DdlIVATrasladado.SelectedValue = .IdCuentaIVATrasladado.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVATrasladado.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIVATrasladado.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVATrasladado.ToString))("CtaCodigo").ToString, .IdCuentaIVATrasladado.ToString)) + ' DdlIVATrasladado.SelectedValue = .IdCuentaIVATrasladado.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetIVACirculacion.ToString)) - If Not IsNothing(Row) Then - DdlIVARetenciones.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetIVACirculacion.ToString))("CtaCodigo").ToString, .IdCuentaRetIVACirculacion.ToString)) - DdlIVARetenciones.SelectedValue = .IdCuentaRetIVACirculacion.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetIVACirculacion.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIVARetenciones.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetIVACirculacion.ToString))("CtaCodigo").ToString, .IdCuentaRetIVACirculacion.ToString)) + ' DdlIVARetenciones.SelectedValue = .IdCuentaRetIVACirculacion.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetISRCirculacion.ToString)) - If Not IsNothing(Row) Then - DdlISRCirculacion.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetISRCirculacion.ToString))("CtaCodigo").ToString, .IdCuentaRetISRCirculacion.ToString)) - DdlISRCirculacion.SelectedValue = .IdCuentaRetISRCirculacion.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetISRCirculacion.ToString)) + 'If Not IsNothing(Row) Then + ' DdlISRCirculacion.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetISRCirculacion.ToString))("CtaCodigo").ToString, .IdCuentaRetISRCirculacion.ToString)) + ' DdlISRCirculacion.SelectedValue = .IdCuentaRetISRCirculacion.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaPerdidaCambiaria.ToString)) - If Not IsNothing(Row) Then - DdlCuentaPerdidaCambiaria.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaPerdidaCambiaria.ToString))("CtaCodigo").ToString, .IdCuentaPerdidaCambiaria.ToString)) - DdlCuentaPerdidaCambiaria.SelectedValue = .IdCuentaPerdidaCambiaria.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaPerdidaCambiaria.ToString)) + 'If Not IsNothing(Row) Then + ' DdlCuentaPerdidaCambiaria.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaPerdidaCambiaria.ToString))("CtaCodigo").ToString, .IdCuentaPerdidaCambiaria.ToString)) + ' DdlCuentaPerdidaCambiaria.SelectedValue = .IdCuentaPerdidaCambiaria.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaGananciaCambiaria.ToString)) - If Not IsNothing(Row) Then - DddlCuentaGananciaCambiaria.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaGananciaCambiaria.ToString))("CtaCodigo").ToString, .IdCuentaGananciaCambiaria.ToString)) - DddlCuentaGananciaCambiaria.SelectedValue = .IdCuentaGananciaCambiaria.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaGananciaCambiaria.ToString)) + 'If Not IsNothing(Row) Then + ' DddlCuentaGananciaCambiaria.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaGananciaCambiaria.ToString))("CtaCodigo").ToString, .IdCuentaGananciaCambiaria.ToString)) + ' DddlCuentaGananciaCambiaria.SelectedValue = .IdCuentaGananciaCambiaria.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaDSV.ToString)) - If Not IsNothing(Row) Then - DdlDSV.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaDSV.ToString))("CtaCodigo").ToString, .IdCuentaDSV.ToString)) - DdlDSV.SelectedValue = .IdCuentaDSV.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaDSV.ToString)) + 'If Not IsNothing(Row) Then + ' DdlDSV.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaDSV.ToString))("CtaCodigo").ToString, .IdCuentaDSV.ToString)) + ' DdlDSV.SelectedValue = .IdCuentaDSV.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaImpuestosLocales.ToString)) - If Not IsNothing(Row) Then - DdlImpuestosLocales.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaImpuestosLocales.ToString))("CtaCodigo").ToString, .IdCuentaImpuestosLocales.ToString)) - DdlImpuestosLocales.SelectedValue = .IdCuentaImpuestosLocales.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaImpuestosLocales.ToString)) + 'If Not IsNothing(Row) Then + ' DdlImpuestosLocales.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaImpuestosLocales.ToString))("CtaCodigo").ToString, .IdCuentaImpuestosLocales.ToString)) + ' DdlImpuestosLocales.SelectedValue = .IdCuentaImpuestosLocales.ToString + 'End If 'NUEVOS DATOS - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxAcreditar.ToString)) - If Not IsNothing(Row) Then - DdlIEPSxAcreditar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxAcreditar.ToString))("CtaCodigo").ToString, .IdCuentaIEPSxAcreditar.ToString)) - DdlIEPSxAcreditar.SelectedValue = .IdCuentaIEPSxAcreditar.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxAcreditar.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIEPSxAcreditar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxAcreditar.ToString))("CtaCodigo").ToString, .IdCuentaIEPSxAcreditar.ToString)) + ' DdlIEPSxAcreditar.SelectedValue = .IdCuentaIEPSxAcreditar.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSAcreditable.ToString)) - If Not IsNothing(Row) Then - DdlIEPSAcreditable.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSAcreditable.ToString))("CtaCodigo").ToString, .IdCuentaIEPSAcreditable.ToString)) - DdlIEPSAcreditable.SelectedValue = .IdCuentaIEPSAcreditable.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSAcreditable.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIEPSAcreditable.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSAcreditable.ToString))("CtaCodigo").ToString, .IdCuentaIEPSAcreditable.ToString)) + ' DdlIEPSAcreditable.SelectedValue = .IdCuentaIEPSAcreditable.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxTrasladar.ToString)) - If Not IsNothing(Row) Then - DdlIEPSxTrasladar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxTrasladar.ToString))("CtaCodigo").ToString, .IdCuentaIEPSxTrasladar.ToString)) - DdlIEPSxTrasladar.SelectedValue = .IdCuentaIEPSxTrasladar.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxTrasladar.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIEPSxTrasladar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxTrasladar.ToString))("CtaCodigo").ToString, .IdCuentaIEPSxTrasladar.ToString)) + ' DdlIEPSxTrasladar.SelectedValue = .IdCuentaIEPSxTrasladar.ToString + 'End If - Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSTrasladado.ToString)) - If Not IsNothing(Row) Then - DdlIEPSTrasladado.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSTrasladado.ToString))("CtaCodigo").ToString, .IdCuentaIEPSTrasladado.ToString)) - DdlIEPSTrasladado.SelectedValue = .IdCuentaIEPSTrasladado.ToString - End If + 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSTrasladado.ToString)) + 'If Not IsNothing(Row) Then + ' DdlIEPSTrasladado.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSTrasladado.ToString))("CtaCodigo").ToString, .IdCuentaIEPSTrasladado.ToString)) + ' DdlIEPSTrasladado.SelectedValue = .IdCuentaIEPSTrasladado.ToString + 'End If End If @@ -665,7 +665,7 @@ Partial Class Sistemas_Empresa Next End If - GlobalDTClasificacionPorcentaje(CveEmpresa) = Nothing + ' GlobalDTClasificacionPorcentaje(CveEmpresa) = Nothing End If diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index 57bdafa48..aaf580219 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -26,7 +26,7 @@ public class TareasJam : IHttpHandler switch (Metodo) { case "TestConexion": - retorno = PruebaConexionFTP("ftp://thalamus.exavault.com", "agrojam", "A12345678"); + retorno = PruebaConexionFTP("ftp://ftp.thalamuslive.com", "agrojam", "A12345678"); break; case "EjecutaThalamus": @@ -112,7 +112,7 @@ public class TareasJam : IHttpHandler //string FTPPass = "agj-3500"; - string FTPServer = "ftp://thalamus.exavault.com"; + string FTPServer = "ftp://ftp.thalamuslive.com"; string TFPUsr = "agrojam"; string FTPPass = "A12345678"; @@ -677,7 +677,7 @@ public class TareasJam : IHttpHandler { bool Respuesta = false; - FtpWebRequest request =(FtpWebRequest)WebRequest.Create($"{FTPServer}/Test.log"); + FtpWebRequest request =(FtpWebRequest)WebRequest.Create($"{FTPServer}/clientes/Test.xlsx"); request.Method = WebRequestMethods.Ftp.ListDirectory; request.Credentials = new NetworkCredential(FTPUsr, FTPPass); diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb index ffc9ae574..ebd33afe3 100644 --- a/Ventas/CatMetasVendedores.aspx.vb +++ b/Ventas/CatMetasVendedores.aspx.vb @@ -193,7 +193,7 @@ Partial Class CatMetasVendedores DtExcel.Rows.Add(dr) Next - + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) Dim FileExcel As New ExcelFile() Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName) diff --git a/Ventas/CatUnidadesMedida.aspx.vb b/Ventas/CatUnidadesMedida.aspx.vb index 259a38460..f075d3b40 100644 --- a/Ventas/CatUnidadesMedida.aspx.vb +++ b/Ventas/CatUnidadesMedida.aspx.vb @@ -31,7 +31,7 @@ Partial Class CatUnidadesMedida Dim ObjUnidadesMedida As New ClsUnidadesMedida If ObjUnidadesMedida.GetUnidadesMedida(UsuarioActual.CveEmpresa) Then - GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados + GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GvDatos.DataSource = ViewState("DTUnidadesMedida") GvDatos.DataBind() @@ -293,7 +293,7 @@ Partial Class CatUnidadesMedida If ObjUnidadesMedida.UpdateUnidadMedida(TxtUnidadMedida.Text.Trim, TxtAbreviatura.Text.Trim, "", "", "", CBool(Estatus), UsuarioActual.CveUsuario, HdnID.Value.ToEntero, DdlSATUnidadMedida.SelectedValue.ToEntero) Then GvDatos.EditIndex = -1 - GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados + GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index e9a1071eb..d72745756 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -378,7 +378,7 @@
    - + @@ -419,7 +419,7 @@
    - + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 386a974d3..e706f9aca 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1044,9 +1044,6 @@ Partial Class Clientes #Region "C A R G A S" - - - Private Sub CreaDtPago() DtPagos = New DataTable DtPagos.Columns.Add("CveTipoMovimiento", GetType(String)) @@ -1194,10 +1191,6 @@ Partial Class Clientes DdlCtaContableAnticipos.Attributes.Add("onclick", "CargaCuentas(2);") End If - 'DdlCtaContableRetIVA.Attributes.Add("onclick", "CargaCuentas(3);") - 'DdlCtaContableRetISR.Attributes.Add("onclick", "CargaCuentas(4);") - 'DdlCtaContableFondoGarantia.Attributes.Add("onclick", "CargaCuentas(5);") - If UsuarioActual.Empresa.Funcionalidad(248).ToEntero() > 0 Then DdlCtaContableCompClientes.Attributes.Add("onclick", "CargaCuentas(6);") End If @@ -1244,47 +1237,8 @@ Partial Class Clientes End Select UpFiscalContable.Update() - ' Las funcionalidades 246, 247 y 248 para DdlCtaContableClientes, DdlMonedaExtranjeraClientes y DdlCtaContableCompClientes tienen prioridad sobre las demas. - 'If UsuarioActual.Empresa.UsaContabilidad Then CargaCuentasContablesClientes() - - End Sub - 'Private Sub CargaCuentasContablesClientes() - ' If UsuarioActual.Empresa.ServerContPAQi = "" Then Exit Sub - ' ' Verifica si la empresas tienen las funcionalidades 246, 247 y 248 - ' Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) - - ' If UsuarioActual.Empresa.Funcionalidad(246).Toentero() > 0 Then - ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(246).Toentero(), "-1", 1) Then - ' DdlCtaContableClientes.Items.Clear() - ' DdlCtaContableClientes.Items.Add(New ListItem("Seleccione", "0")) - ' DdlCtaContableClientes.DataSource = ObjContabilidad.DtResultados - ' DdlCtaContableClientes.DataBind() - ' End If - ' End If - - ' If UsuarioActual.Empresa.Funcionalidad(247).Toentero() > 0 Then - ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(247).Toentero(), "-1", 1) Then - ' DdlMonedaExtranjeraClientes.Items.Clear() - ' DdlMonedaExtranjeraClientes.Items.Add(New ListItem("Seleccione", "0")) - ' DdlMonedaExtranjeraClientes.DataSource = ObjContabilidad.DtResultados - ' DdlMonedaExtranjeraClientes.DataBind() - ' End If - ' End If - - ' If UsuarioActual.Empresa.Funcionalidad(248).Toentero() > 0 Then - ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(248).Toentero(), "-1", 1) Then - ' DdlCtaContableCompClientes.Items.Clear() - ' DdlCtaContableCompClientes.Items.Add(New ListItem("Seleccione", "0")) - ' DdlCtaContableCompClientes.DataSource = ObjContabilidad.DtResultados - ' DdlCtaContableCompClientes.DataBind() - ' End If - ' End If - - ' ObjContabilidad.Dispose() - - 'End Sub Private Sub CargaDdlCuentasContables(Ddl As DropDownList, Optional CveFuncionalidad As Integer = -1) Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) If ObjContabilidad.GetCuentasRecursiva(CveFuncionalidad, 1) Then @@ -1506,23 +1460,13 @@ Partial Class Clientes Dim RetSC As Boolean = CargaSucursalesCliente() CargaUsuariosPortal() - 'CargaPersonalAsignado() - 'CargaOrdenesServiciosCliente() CargaImpuestosLocales() CargaCuentasContablesDdls() CargaResponsables() CargaCondicionesEntrega() - 'CargaClasificaciones() - ' CargaGridRetenciones() - ' CargaDocs() CargaCombos() CargaDocumentacionCliente() CargaSubProyectosSuscursales() - 'CargaMetodosPago33() - 'CargaFormaPago33() - 'CargaComboCFDI() - 'CargarPagosNoBancarios() - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then @@ -1774,12 +1718,6 @@ Partial Class Clientes DdlAdminTrayecto.SelectedValueExist(ObjClientes.DtResultados(0)("CveAdminTrayecto").ToString()) DdlAdminTrayecto_SelectedIndexChanged(DdlAdminTrayecto, EventArgs.Empty) - 'If ObjClientes.CveUsoCFDI > 0 Then DdlUsoCFDI.Items.RemoveAt(0) - 'If ObjClientes.CveMetodoPago33 > 0 Then DdlMetodoPago33.Items.RemoveAt(0) - 'If ObjClientes.CveFormaPago33 > 0 Then DdlFormaPago33.Items.RemoveAt(0) - - - 'DIAS DE PAGO If ObjClientes.RecepcionPagos <> "" AndAlso ObjClientes.RecepcionPagos.Length = 11 Then @@ -1806,15 +1744,7 @@ Partial Class Clientes 'Horario TxtHorario.Text = ObjClientes.Horario - 'If ObjClientes.Horario <> "" Then - ' Dim arrayHorario As String() = ObjClientes.Horario.Split(New Char() {"|"c}) - ' If arrayHorario.Count = 1 Then - ' TxtHorario1.Text = arrayHorario(0) - ' End If - ' If arrayHorario.Count = 2 Then - ' TxtHorario2.Text = arrayHorario(1) - ' End If - 'End If + TxtObsDiasRevision.Text = ObjClientes.ObservacionRevision TxtReferenciaFiscal.Text = ObjClientes.ReferenciaFiscal @@ -1872,24 +1802,7 @@ Partial Class Clientes Alert("El cliente actualmente se encuentra Inactivo.", TipoMensaje.MsgAdvertencia) End If - 'watch.Stop() - 'Alert(watch.ElapsedMilliseconds.ToString()) - 'watch.Start() - - CargaEventoBitacora() - 'If UsuarioActual.Empresa.Funcionalidad(300) = "1" Then - ' CargaCuentasConceptos() - ' divCuentas.Visible = True - ' divCuentasContp.Visible = False - 'Else - ' divCuentas.Visible = False - ' divCuentasContp.Visible = True - 'End If - - 'watch.Stop() - 'Alert(watch.ElapsedMilliseconds.ToString()) - 'watch.Start() If UsuarioActual.Empresa.TipoContabilidad = 1 Then CargaCuentasConceptos() diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index e6ab3292d..1d4659597 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -2504,11 +2504,11 @@ Partial Class Ventas_ClientesAbonar End If If TCPago > TCVenta Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "Ocurrio un error al saldar el movimiento" End If Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "Ocurrio un error al saldar el movimiento" End If End If @@ -2525,12 +2525,11 @@ Partial Class Ventas_ClientesAbonar Dim IdCtaIVAXTrasladar As Integer = 0 Dim CveCuentaIVAxTrasladar As Integer = 0 - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero - CveCuentaIVAxTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("CveCuentaIVAxTrasladar").ToString.ToEntero - End If + 'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + ' IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero + ' CveCuentaIVAxTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("CveCuentaIVAxTrasladar").ToString.ToEntero + 'End If - IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" @@ -2540,7 +2539,6 @@ Partial Class Ventas_ClientesAbonar MsgError = "Ocurrio un error al saldar el movimiento" End If - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 419974f7f..caebcc4a0 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -13866,10 +13866,10 @@ Partial Class Ventas SeContabiliza = False End If - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString().ToEntero() - IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString().ToEntero() - End If + 'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then + ' IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString().ToEntero() + ' IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString().ToEntero() + 'End If Dim UsaComplementariaClientes As Boolean = True @@ -14240,14 +14240,12 @@ Partial Class Ventas If IngresoIVA > 0 Then - IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, NombreCliente, Dr("Folio").ToString, FolioIE.ToString()) If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True Exit For End If 'IVA PAGADO - IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, NombreCliente, Dr("Folio").ToString, FolioIE.ToString()) If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True @@ -14259,14 +14257,14 @@ Partial Class Ventas If IngresoIEPS > 0 Then 'IEPS X TRASLADAR Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, Dr("Folio").ToString, FolioIE.ToString()) - If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then + If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 38, Concepto, Fecha, 0, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then ErrorPrepoliza = True Exit For End If 'IEPS PAGADO Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, NombreCliente, Dr("Folio").ToString, FolioIE.ToString()) - If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then + If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 39, Concepto, Fecha, 0, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then ErrorPrepoliza = True Exit For End If @@ -14323,11 +14321,9 @@ Partial Class Ventas If difFluctuacion < 0 Then CveConceptoFluctua = 65 TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria Else CveConceptoFluctua = 64 TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If Dim ImporteFluctuacion As Decimal = Math.Abs((Importe251 * difFluctuacion).RoundSQL) @@ -14433,11 +14429,9 @@ Partial Class Ventas If difFluctuacion < 0 Then CveConceptoFluctua = 65 TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria Else CveConceptoFluctua = 64 TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If Dim ImporteFluctuacion As Decimal = Math.Abs((importeMovimientoDev * difFluctuacion).RoundSQL) @@ -14794,30 +14788,30 @@ Partial Class Ventas ' If UsuarioActual.CveEmpresa = 119 Then 'código fijo en base el porcentaje iva, que se afecten las clasificaciones - For i = 0 To TmpDTDetalle.Rows.Count - 1 + 'For i = 0 To TmpDTDetalle.Rows.Count - 1 - 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso - If Not TmpDTDetalle(i)("CveClasificacion").ToString().Contiene("19958", "19933", "18097") Then + ' 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso + ' If Not TmpDTDetalle(i)("CveClasificacion").ToString().Contiene("19958", "19933", "18097", "24479") Then - 'If TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal > 0 Then - ' If TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal = 0.08 Then - ' TmpDTDetalle(i)("CveClasificacion") = 20242 'clasif: ventas tasa 8% - ' Else - ' TmpDTDetalle(i)("CveClasificacion") = 19929 'clasif: ventas tasa 16% - ' End If + ' 'If TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal > 0 Then + ' ' If TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal = 0.08 Then + ' ' TmpDTDetalle(i)("CveClasificacion") = 20242 'clasif: ventas tasa 8% + ' ' Else + ' ' TmpDTDetalle(i)("CveClasificacion") = 19929 'clasif: ventas tasa 16% + ' ' End If - ' Else - ' TmpDTDetalle(i)("CveClasificacion") = 19930 'clasif: ventas tasa 0% - ' End If + ' ' Else + ' ' TmpDTDetalle(i)("CveClasificacion") = 19930 'clasif: ventas tasa 0% + ' ' End If - 'reclasifica la clasificación del producto, por la del ingreso correspondiente a su iva - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal).Rows.Count > 0 Then - TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal).Rows(0)("CveClasificacion").ToString() - End If + ' 'reclasifica la clasificación del producto, por la del ingreso correspondiente a su iva + ' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal).Rows.Count > 0 Then + ' TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDecimal).Rows(0)("CveClasificacion").ToString() + ' End If - End If + ' End If - Next + 'Next ' End If @@ -14867,23 +14861,23 @@ Partial Class Ventas Dim CveVentaAplicar = ObjFactura.CveVenta Dim CveVentaAmortizacionAplicar = -1 - If UsuarioActual.CveEmpresa = 119 Then + 'If UsuarioActual.CveEmpresa = 119 Then - 'código fijo en base el porcentaje iva, que se afecten las clasificaciones - For i = 0 To TmpDTDetalle.Rows.Count - 1 + ' 'código fijo en base el porcentaje iva, que se afecten las clasificaciones + ' For i = 0 To TmpDTDetalle.Rows.Count - 1 - 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso - If Not TmpDTDetalle(i)("CveClasificacion").ToString().Contiene("19958", "19933", "18097") Then + ' 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso + ' If Not TmpDTDetalle(i)("CveClasificacion").ToString().Contiene("19958", "19933", "18097") Then - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then - TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString() - End If + ' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then + ' TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString() + ' End If - End If + ' End If - Next + ' Next - End If + 'End If DT = TmpDTDetalle.FiltraParametros($"CvePS <> {CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"}) @@ -15094,13 +15088,8 @@ Partial Class Ventas ConceptoContable = 61 importeMovimiento = importeMovimiento * -1 importeMX = importeMX * -1 - - IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) - Else - IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) End If - CveSubProyectoContabilizar = CveSubProyectoVenta If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" End If @@ -15249,13 +15238,10 @@ Partial Class Ventas End If - - If ObjFactura.IVA <> 0 Then Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeIVA").ToDecimal 'IVA X TRASLADAR - IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True @@ -15263,7 +15249,6 @@ Partial Class Ventas End If 'IVA PAGADO - IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IVA) / ObjFactura.Total, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True @@ -15271,21 +15256,19 @@ Partial Class Ventas End If End If - - If ObjFactura.IEPS <> 0 Then Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeIEPS").ToDecimal 'IEPS X TRASLADAR Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) - If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then + If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 38, Concepto, Fecha, 0, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True Exit For End If 'IEPS PAGADO Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) - If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then + If ObjFactura.IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total, Referencia, 39, Concepto, Fecha, 0, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.IEPS) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then ErrorPrepoliza = True Exit For End If @@ -16972,17 +16955,17 @@ Partial Class Ventas Dim FechaMovimiento As Date = Now Dim Concepto As String = ViewState("VentaFolio").ToString() Dim PrePolizaCorrecta = True - Dim PorcentajeImpuesto As Decimal = 0 + ' Dim PorcentajeImpuesto As Decimal = 0 Dim IdCtaIVAXTrasladar As Integer = 0 '13 Iva x Trasladar ImporteMovimiento = Importe13 * PorcentajeAmortizacion ImporteMX = Math.Round(ImporteMovimiento, 2) * TipoCambio - PorcentajeImpuesto = TmpDT.MAX("PorcentajeIVA").ToDecimal - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString().ToEntero() - End If - IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) + 'PorcentajeImpuesto = TmpDT.MAX("PorcentajeIVA").ToDecimal + 'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + ' IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString().ToEntero() + 'End If + 'IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) ' CveCuenta = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar) If ImporteMovimiento > 0 Then @@ -16992,7 +16975,7 @@ Partial Class Ventas End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 13, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImporteMX, PorcentajeImpuesto:=PorcentajeImpuesto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 13, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImporteMX) Then PrePolizaCorrecta = False End If End If @@ -17069,11 +17052,10 @@ Partial Class Ventas ImporteMovimiento = TxtIVA.Text.ToDecimal * PorcentajeAmortizacion ImporteMX = Math.Round(ImporteMovimiento * TipoCambio, 2) PorcentajeImpuesto = TmpDT.MAX("PorcentajeIVA").ToDecimal - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVATrasladado").ToString().ToEntero() - CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("CveCuentaIVATrasladado").ToString().ToEntero() - End If - IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) + 'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + ' IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVATrasladado").ToString().ToEntero() + ' CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("CveCuentaIVATrasladado").ToString().ToEntero() + 'End If 'CveCuenta = If(CveCuentaIVATrasladado > 0, CveCuentaIVATrasladado, UsuarioActual.Empresa.CveCuentaIVATrasladado) If ImporteMovimiento > 0 Then @@ -27400,11 +27382,11 @@ Partial Class Ventas Dim ImporteFluctuacion As Decimal = 0 ImporteFluctuacion = Saldo * (TCPago - TCVenta) If TCPago > TCVenta Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), SerieFolio, 64, ConceptoPartida, FechaPago, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), SerieFolio, 64, ConceptoPartida, FechaPago, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "Ocurrio un error al saldar el movimiento" End If Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), SerieFolio, 65, ConceptoPartida, FechaPago, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), SerieFolio, 65, ConceptoPartida, FechaPago, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "Ocurrio un error al saldar el movimiento" End If End If @@ -27416,15 +27398,14 @@ Partial Class Ventas Dim IdCtaIVAXTrasladar As Integer = 0 - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString().ToEntero() - End If + 'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then + ' IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString().ToEntero() + 'End If If IVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, SerieFolio, 13, ConceptoPartida, FechaPago, IdCtaIVAXTrasladar, -1, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteMX:=If(tCveMoneda = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, SerieFolio, 38, ConceptoPartida, FechaPago, IdCtaContable, -1, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteMX:=If(tCveMoneda = 1, IEPS, IEPS * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" End If