diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 0916d36a0..1b805eda7 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -1690,7 +1690,7 @@ Public Class ClsClientes .Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33 .Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista - .Add("@CvePrecioLista", SqlDbType.VarChar).Value = RegimenSociedad + .Add("@RegimenSociedad", SqlDbType.VarChar).Value = RegimenSociedad .Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona End With diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index cbbcfb90e..5a6526ea1 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -1074,7 +1074,7 @@ Public Class ClsContPAQi StrSQL.AppendLine(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ") StrSQL.AppendLine(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ") StrSQL.AppendLine(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ") - StrSQL.AppendLine(" LEFT JOIN SERVIDOR.Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ") + StrSQL.AppendLine(" LEFT JOIN SIG_Resp_2022_04_01.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ") StrSQL.AppendLine(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ") StrSQL.AppendLine(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ") StrSQL.AppendLine(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ") diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 6b6fce855..c1a58b3fb 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -4062,6 +4062,29 @@ Public Class ClsContabilidad Dim Retorno As Boolean = False DataAdapter("PA_Sis_InconsistenciasGet") + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener inconsistencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function GetPolizasDescuadre(Optional Ejercicio As Integer = -1, Optional Periodo As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_PolizasConDescuadreGet") + + + With SqlAdapter.SelectCommand.Parameters + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + .Add("@Periodo", SqlDbType.Int).Value = Periodo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 4b95212e9..72acf9130 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3684,7 +3684,7 @@ Public Class ClsGenerales Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0, - Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False) As Integer + Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False, Optional CveVenta As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Gral_TimbreAdd") @@ -3701,6 +3701,7 @@ Public Class ClsGenerales .Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output @@ -3722,7 +3723,7 @@ Public Class ClsGenerales Return Retorno End Function - Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer) As Boolean + Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer, Optional CveVenta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_TimbreGet") @@ -3734,7 +3735,7 @@ Public Class ClsGenerales .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento - + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta End With Try diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index fc9aacaa8..d33475899 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -3547,6 +3547,24 @@ Public Class ClsInventarios Return Retorno End Function + Public Function GetSaldoVentaDetalleAlmacen(CveVenta As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentaDetalleSaldoAlmacen") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener datos de almacen por detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function GetMovimientosDevoluciones(CveVenta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentaDetalleAlmacenDevolucion") diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index a340074f6..5ba4bc54a 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -529,7 +529,7 @@ Public Class ClsVentas Optional TipoDocto As String = "Cot", Optional Vigencia As Date = MinFecha, Optional CondicionesPago As Integer = -1, Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1, - Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False) As Boolean + Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUpdate") @@ -562,6 +562,7 @@ Public Class ClsVentas .Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje .Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi .Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor End With Try @@ -1014,13 +1015,14 @@ Public Class ClsVentas Return Retorno End Function - Public Function ObtenerClienteLimitesVenta(CveCliente As Integer, CveEmpresa As Integer) As Integer + Public Function ObtenerClienteLimitesVenta(CveCliente As Integer, CveEmpresa As Integer, Optional TipoVerificacion As Integer = -1) As Integer Dim Retorno As Integer = 0 DataAdapter("PA_Vta_ClientesLimitesVentaGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@TipoVerificacion", SqlDbType.Int).Value = TipoVerificacion .Add("@Opcion", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@OpcionMsg", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output End With @@ -5334,7 +5336,7 @@ Public Class ClsVentas #End Region - Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0) As Boolean + Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0, Optional Motivo As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_AutorizacionLimitesAdd") With SqlAdapter.SelectCommand.Parameters @@ -5347,6 +5349,7 @@ Public Class ClsVentas .Add("@TipoAutorizacion", SqlDbType.Int).Value = TipoAutorizacion .Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento .Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos + .Add("@Motivo", SqlDbType.VarChar).Value = Motivo End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 290ab5615..7167697c1 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -400,8 +400,8 @@ Namespace Modelos Me.VentaDesglosaIEPS = True End If SetTotales(ObjVentas.DtResultados, ObjVentas) - End If End If + End If If ObjVentas.GetVentaDetalle(CveVenta) Then Me.DtDetalle = ObjVentas.DtResultados.Copy() End If @@ -2208,12 +2208,11 @@ Namespace Modelos If DtMovimientosEntrada IsNot Nothing Then For Each Dr As DataRow In DtMovimientosEntrada.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then CveMovimiento = -1 Exit For End If Next - DtMovimientosEntrada.Dispose() DtMovimientosEntrada = Nothing End If @@ -5216,15 +5215,18 @@ Namespace Modelos Dim CveMovimientoDevolucion As Integer = 0 Dim Folio As Integer = 0 + Dim CveMovimientoSalida As Integer = -1 + Select Case RowMovimiento("CveConcepto").ToString().ToEntero() Case 3 CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() + CveMovimientoSalida = RowMovimiento("CveMovimiento").ToString().ToEntero() Case 40 CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() Case 18 - CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA + CveConceptoMovimiento = 3 'SALIDA DE ALMACEN CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() ''SI TIENE REMISIONES RELACIONADAS 'If DtRemisionesFacturadas.Rows.Count > 0 Then @@ -5249,7 +5251,7 @@ Namespace Modelos 'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION If ObjFactura.SaldoAlmacen <> 0 Then 'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN) - CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1") + CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="Mod/CV1") Folio = ObjInventario.Folio If CveMovimientoDevolucion > 0 Then @@ -5389,9 +5391,9 @@ Namespace Modelos If DtVirtuales IsNot Nothing Then For Each RowVirtual As DataRow In DtVirtuales.Rows 'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL - If Not ErrorCancelar AndAlso Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then + If Not ErrorCancelar AndAlso Not CancelarMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then ErrorCancelar = True - MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." + MensajeError = "Ocurrió un error al realizar la devolución del virtual. Por favor vuelva a intentar." End If Next End If @@ -5419,20 +5421,85 @@ Namespace Modelos 'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO) If Not ErrorCancelar AndAlso DtDevoluciones IsNot Nothing AndAlso DtDevoluciones.Rows.Count > 0 Then For Each CveRemision As Integer In ListaRemisionesCancelar - Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}") + Dim ObjRemision As New Factura(UsuarioActual, CveRemision, UsuarioActual.CveEmpresa) - Dim DtDevMovs = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"}) + If ObjRemision IsNot Nothing AndAlso ObjRemision.SaldoAlmacen <> 0 Then - For Each RowDevolucion As DataRow In DtDevMovs.Rows - CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero() - CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero() - - If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión." - Exit For + Dim SaldoAlmacenExA As Decimal = 0 + Dim SaldoAlmacenUsados As Decimal = 0 + Dim DtSaldosAlmacenRemision As DataTable = Nothing + 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO + If Not ErrorCancelar Then + If ObjInventario.GetSaldoVentaDetalleAlmacen(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then + DtSaldosAlmacenRemision = ObjInventario.DtResultados.Copy() + Else + ErrorCancelar = True + MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar." + End If End If - Next + + + Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}") + + Dim DtDevMovs = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"}) + + For Each RowDevolucion As DataRow In DtDevMovs.Rows + CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero() + CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero() + + If CveAlmacen > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then + SaldoAlmacenExA = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacen}") + End If + + If SaldoAlmacenExA <> 0 Then + If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión." + Exit For + End If + End If + + Next + + 'CANCELAR MOVIMIENTOS DE USADOS SI TIENE + If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + Dim CveAlmacenUsado As Integer = 0 + Dim CveMovimientoUsado As Integer = 0 + + If ObjInventario.GetInv_Mov(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then + CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero() + CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero() + Else + ErrorCancelar = True + MensajeError = "Ocurrió un error al cargar los datos de devolución de usado. Por favor vuelva a intentar." + End If + + If CveAlmacenUsado > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then + SaldoAlmacenUsados = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}") + End If + + If Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then + If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario) <= 0 Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al cancelar los usados. Por favor vuelva a intentar." + End If + End If + + End If + + If DtDevRemision IsNot Nothing Then + DtDevRemision.Dispose() + End If + + If DtDevMovs IsNot Nothing Then + DtDevMovs.Dispose() + End If + + End If + + If ObjRemision IsNot Nothing Then + ObjRemision.Dispose() + End If If ErrorCancelar Then Exit For @@ -5444,22 +5511,48 @@ Namespace Modelos End If 'CANCELACION DE MOVIMIENTOS DE REMISION - If Not ErrorCancelar AndAlso ObjFactura.TipoDocto = "Rem" AndAlso RealizarDevolucionAlmacen Then + If Not ErrorCancelar AndAlso ObjFactura.TipoDocto = "Rem" AndAlso RealizarDevolucionAlmacen AndAlso ObjFactura.SaldoAlmacen <> 0 Then + Dim CveMovimientoUsado As Integer = -1 + Dim CveAlmacenUsado As Integer = 0 Dim CveAlmacenGeneral As Integer = 0 + Dim CveAlmacenExA As Integer = 0 + + Dim SaldoAlmacenExA As Decimal = 0 + Dim SaldoAlmacenUsados As Decimal = 0 + Dim DtMovRemision As DataTable = Nothing 'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO) If Not ErrorCancelar Then If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10") CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero() + CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToString().ToEntero() + + CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero() + CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero() Else ErrorCancelar = True MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." End If End If + 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO + If Not ErrorCancelar Then + If ObjInventario.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then + If CveAlmacenExA > 0 Then + SaldoAlmacenExA = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenExA}") + End If + If CveAlmacenUsado > 0 Then + SaldoAlmacenUsados = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}") + End If + Else + ErrorCancelar = True + MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar." + End If + End If + 'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO) - If Not ErrorCancelar AndAlso DtMovRemision IsNot Nothing AndAlso DtMovRemision.Rows.Count > 0 Then + If Not ErrorCancelar AndAlso DtMovRemision IsNot Nothing AndAlso DtMovRemision.Rows.Count > 0 AndAlso SaldoAlmacenExA <> 0 Then Dim DtDevMovs = DtMovRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveAlmacen"}) @@ -5475,6 +5568,14 @@ Namespace Modelos End If + 'CANCELAR MOVIMIENTOS DE USADOS SI TIENE + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then + If CancelarInventarioUsado(ObjFactura, CveAlmacenUsado, CveMovimientoUsado, ObjInventario) <= 0 Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al cancelar los movimientos de usados." + End If + End If + End If 'VERIFICAR MOVIMIENTOS DE APARTADOS @@ -5739,41 +5840,134 @@ Namespace Modelos CveAlmacenVirtual = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero() End If - If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoRelacionado) Then - DtPSVirtual = ObjInventario.DtResultados - End If + Dim SaldoVirtual As Decimal = 0 - Dim CveConceptoMovimientoVirtual As Integer = 36 - Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento - - If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, - Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual") - - If CveMovimientoVirtual > 0 Then - For Each RowUsado As DataRow In DtPSVirtual.Rows - Dim CvePS = RowUsado("CvePS").ToString().ToEntero() - Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble() - Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() - Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() - - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then - ErrorCancelar = True - Exit For - End If - Next + 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO + If Not ErrorCancelar Then + If ObjInventario.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then + If CveAlmacenVirtual > 0 Then + SaldoVirtual = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenVirtual}") + End If Else ErrorCancelar = True End If - Else - If ValidaVirtual Then + End If + + If Not ErrorCancelar AndAlso SaldoVirtual <> 0 Then + If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoRelacionado) Then + DtPSVirtual = ObjInventario.DtResultados + End If + + Dim CveConceptoMovimientoVirtual As Integer = 36 + Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento + + If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, + Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual") + + If CveMovimientoVirtual > 0 Then + For Each RowUsado As DataRow In DtPSVirtual.Rows + Dim CvePS = RowUsado("CvePS").ToString().ToEntero() + Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble() + Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() + Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then + ErrorCancelar = True + Exit For + End If + Next + Else + ErrorCancelar = True + End If + Else + If ValidaVirtual Then + ErrorCancelar = True + End If + End If + + If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then ErrorCancelar = True End If End If - If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then - ErrorCancelar = True + + End If + Catch ex As Exception + OnError("Ocurrió un error al realizar la devolución al almacen virtual.", ex) + ErrorCancelar = True + End Try + + Return Not ErrorCancelar + End Function + + Private Function CancelarMovimientosVirtuales(CveVenta As Integer, CveMovimientoDevolucion As Integer, CveMovimientoVirtualSalida As Integer, ByRef ObjInventario As ClsInventarios) As Boolean + Dim ErrorCancelar As Boolean = False + Try + If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then + Dim CveMovimientoVirtual As Integer = -1 + Dim ValidaVirtual = True + Dim DtPSVirtual As New DataTable("DtTamanios") + + Dim CveAlmacenVirtual As Integer = -1 + + If ObjInventario.GetMovimientos(CveMovimientoVirtualSalida, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + CveAlmacenVirtual = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero() End If + + Dim SaldoVirtual As Decimal = 0 + + 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO + If Not ErrorCancelar Then + If ObjInventario.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then + If CveAlmacenVirtual > 0 Then + SaldoVirtual = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenVirtual}") + End If + Else + ErrorCancelar = True + End If + End If + + If Not ErrorCancelar AndAlso SaldoVirtual <> 0 Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtualSalida, UsuarioActual.CveEmpresa) Then + DtPSVirtual = ObjInventario.DtResultados + End If + + Dim CveConceptoMovimientoVirtual As Integer = 36 + Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimientoDevolucion + + If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, + Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual") + + If CveMovimientoVirtual > 0 Then + For Each RowUsado As DataRow In DtPSVirtual.Rows + Dim CvePS = RowUsado("CvePS").ToString().ToEntero() + Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble() + Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal() + Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() + Dim CveVentaDetalle As Integer = RowUsado("CveVentaDetalle").ToString().ToEntero() + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveVentaDetalle:=CveVentaDetalle) Then + ErrorCancelar = True + Exit For + End If + Next + Else + ErrorCancelar = True + End If + Else + If ValidaVirtual Then + ErrorCancelar = True + End If + End If + + If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then + ErrorCancelar = True + End If + End If + + End If Catch ex As Exception OnError("Ocurrió un error al realizar la devolución al almacen virtual.", ex) @@ -9921,7 +10115,9 @@ Namespace Modelos Public Property Colonia As String Public Property Localidad As String Public Property Municipio As String + Public Property CveEstado As Integer Public Property Estado As String + Public Property CvePais As Integer Public Property Pais As String Public Property CP As String Public Property IVA As Decimal diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index 4f8d15dc4..9c2c63e61 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -208,7 +208,7 @@ Public Class Timbres Dim Ubica As New CFDICartaPorteUbicacion Ubica.TipoEstacion = "" Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString, - .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", + .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", .NombreRemitenteDestinatario = drT("RemitenteNombre").ToString, .Domicilio = DomOrigen} CartaPorte.Ubicaciones.Add(Ubica) @@ -355,22 +355,268 @@ Public Class Timbres End If Return Timbre End Function - Public Function Timbrar() As Boolean - Dim Respuesta As Boolean = False - - Dim ObjTimbrado As New Timbrado - - If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then - Respuesta = True - Else - Respuesta = False - _MsgError.AppendLine(ObjTimbrado.MensajeErrorCFDI) - End If - - Return Respuesta - - End Function - - -End Class + Public Class MMensajeCartaPorte + Public Property TieneError As Boolean + Public Property Mensaje As String + Public Property CveMovimiento As Integer + Public Property FechaSalida As DateTime + Public Property CartaPorte As CFDICartaPorte + End Class + + Public Shared Function PreParaCartaPorteFactura(CveTimbre As Integer, Obj As Modelos.Factura, UsuarioActual As Usuario) As MMensajeCartaPorte + Dim Retorno As New MMensajeCartaPorte + + Try + Dim CartaPorte As New CFDICartaPorte + + Dim _MsgError As New StringBuilder + Dim TieneError As Boolean = False + + CartaPorte.TranspInternac = "No" + CartaPorte.EntradaSalidaMercancia = "" + CartaPorte.ViaEntradaSalida = "" + + CartaPorte.Mercancias.UnidadPeso = "KGM" + CartaPorte.Mercancias.CargoporTasacion = 0 + + Dim FI As Date = New Date(1900, 1, 1) + Dim FF As Date = New Date(9999, 1, 1) + + Dim FechaLlegada As DateTime + Dim Distancia As Integer = 1 + + Dim ObjGrales As New ClsGenerales + + If ObjGrales.GetGralTimbre(CveTimbre, "Man", FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then + + If ObjGrales.DtResultados.Rows.Count = 1 Then + Dim DtMovimientos As DataTable = Nothing + Dim drT As DataRow = ObjGrales.DtResultados.Rows(0) + + 'Timbre.Receptor.RFC = drT("DestinatarioRFC").ToString + 'Timbre.Receptor.Nombre = drT("DestinatarioNombre").ToString + + Retorno.CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero + Retorno.FechaSalida = drT("FechaEntrega").ToString.ToDateTime + + FechaLlegada = drT("FechaLlegada").ToString.ToDateTime + Distancia = drT("Distancia").ToString.ToEntero + + 'ObjFactura.Folio = drT("Folio").ToString.ToEntero + 'ObjFactura.Serie = drT("Serie").ToString + + 'Timbre.Comprobante.Serie = Obj.Serie + 'Timbre.Comprobante.Folio = Obj.Folio.ToString + + 'If drT("FolioFiscalRelacionado").ToString <> "" Then + + ' Timbre.CFDIRelacionados.TipoRelacion = "05" + ' Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString) + + 'End If + + If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then + DtMovimientos = ObjGrales.DtResultados + Else + TieneError = True + _MsgError.AppendLine("Error al obtener Movimientos") + End If + + 'ObjFactura.DtDetalle = DtMovimientos + + 'AplicaCP = Boolean.Parse(drT("AplicaCP").ToString) + + 'ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero + + 'ObjFactura.SetSubProyecto() + 'ObjFactura.SetSubProyectoMatriz() + + CartaPorte.FiguraTransporte.AutoTransporte.PermisoSCT = drT("ClaveTipoPermisoSCT").ToString '"TPAF01" + CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString + CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString + CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente = drT("NumPolizaSeguroMedioAmbiente").ToString + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroCarga = drT("NombreAseguradoraCarga").ToString + CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroCarga = drT("NumPolizaSeguroCarga").ToString + CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular = drT("ConfigCartaPorte").ToString + CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString + CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero + + If drT("ClaveTipoRemolque1").ToString <> "" Then + Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")} + CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1) + End If + + If drT("ClaveTipoRemolque2").ToString <> "" Then + Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")} + CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2) + End If + + + If drT("ClaveTipoRemolque1").ToString <> "" Then + Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")} + CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1) + End If + + If drT("ClaveTipoRemolque2").ToString <> "" Then + Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")} + CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2) + End If + + + Dim DomOrigen As CFDICartaPorteDomicilio = Nothing + DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString, + .Colonia = drT("DirOriClaveSATColonia").ToString, + .CP = drT("DirOriCP").ToString, + .Estado = drT("DirOriClaveSATEstado").ToString, + .Pais = drT("DirOriClaveSATPais").ToString, + .Municipio = drT("DIrOriClaveSATMunicipio").ToString, + .Localidad = drT("DirOriClaveSATLocalidad").ToString} + + Dim DomDestino As CFDICartaPorteDomicilio = Nothing + + + DomDestino = New CFDICartaPorteDomicilio With {.Calle = drT("DirDesCalle").ToString, + .Colonia = drT("DirDesClaveSATColonia").ToString, + .CP = drT("DirDesCP").ToString, + .Estado = drT("DirDesClaveSATEstado").ToString, + .Pais = drT("DirDesClaveSATPais").ToString, + .Municipio = drT("DirDesClaveSATMunicipio").ToString, + .Localidad = drT("DirDesClaveSATLocalidad").ToString} + + + Dim Ubica As New CFDICartaPorteUbicacion + Ubica.TipoEstacion = "" + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString, + .FechaHoraSalidaLlegada = Retorno.FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", + .NombreRemitenteDestinatario = drT("RemitenteNombre").ToString, + .Domicilio = DomOrigen} + CartaPorte.Ubicaciones.Add(Ubica) + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString, + .FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"), + .NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString, + .Domicilio = DomDestino, + .DistanciaRecorrida = Distancia} + + CartaPorte.Ubicaciones.Add(Ubica) + CartaPorte.FiguraTransporte.ClaveTransporte = "01" + + Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString, + .NumeroExterior = drT("FiguraNumeroExterior").ToString, + .NumeroInterior = drT("FiguraNumeroInterior").ToString, + .Colonia = drT("FiguraClaveSATColonia").ToString, + .Municipio = drT("FiguraClaveSATMunicipio").ToString, + .Estado = drT("FiguraClaveSATEstado").ToString, + .CP = drT("FiguraCP").ToString} + + + + CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With { + .RFCFigura = drT("FiguraRFC").ToString, + .NombreFigura = drT("FiguraChofer").ToString, + .NumLicencia = drT("FiguraLicencia").ToString, + .NumRegidTribFigura = drT("FiguraNumRegidTribFigura").ToString, + .ResidenciaFiscalFigura = drT("FiguraResidenciaFiscalFigura").ToString, + .Domicilio = DomicilioOperador}) + + + 'concepto único + Dim concepto As New CFDIConceptos With {.Cantidad = 1, + .Descripcion = "Flete", + .ValorUnitario = 0, + .Importe = 0, + .Descuento = 0, + .Unidad = "Servicio", + .ClaveUnidad = "E48", + .ClaveProdServ = "78101802", + .Noidentificacion = "", + .CuentaPredial = ""} + + + For Each drr As DataRow In DtMovimientos.Rows + + Dim tPS As String = "" + + If drr("PS").ToString.Length = 1 Then + tPS = drr("Obs").ToString + Else + If drr("PS").ToString.Length = 0 Then + tPS = "" + Else + tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) + End If + End If + + + Dim conceptoCarta As New CFDICartaPorteMercancia With { + .BienesTransp = drr("SATClaveProdServ").ToString, + .ClaveSTCC = "", 'para metodo ferroviario + .Cantidad = drr("Cantidad").ToString.ToDecimal, + .Descripción = tPS, + .ClaveUnidad = drr("SATClaveUM").ToString, + .Unidad = drr("UM").ToString, + .Dimensiones = drr("Dimensiones").ToString, + .PesoenKg = drr("PesoKg").ToString.ToDecimal, + .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""), + .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, + .Embalaje = drr("ClaveEmbalaje").ToString, + .DescripEmbalaje = drr("Embalaje").ToString, + .ValorMercancia = drr("PU").ToString.ToDecimal, + .Moneda = "MXN", 'temporal + .FraccionArrancelaria = "", + .UUIDComercioExt = "" + } + + Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal} + conceptoCarta.DetalleMercancia = DetalleMercancia + + Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"} + conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta) + + CartaPorte.Mercancias.Mercancias.Add(conceptoCarta) + Next + + Retorno.CartaPorte = CartaPorte + + Else + TieneError = True + _MsgError.AppendLine("Consultar datos de timbrado") + End If + + ObjGrales.Dispose() + Else + _MsgError.AppendLine("Consultar datos de timbrado") + End If + + Retorno.TieneError = If(_MsgError.ToString().Length > 0, True, False) + Retorno.Mensaje = _MsgError.ToString() + + Catch ex As Exception + Retorno.TieneError = True + Retorno.Mensaje = ex.ToString() + End Try + + Return Retorno + + End Function + Public Function Timbrar() As Boolean + + Dim Respuesta As Boolean = False + + Dim ObjTimbrado As New Timbrado + + If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then + Respuesta = True + Else + Respuesta = False + _MsgError.AppendLine(ObjTimbrado.MensajeErrorCFDI) + End If + + Return Respuesta + + End Function + + + End Class diff --git a/Bancos/CuentasBancarias.aspx.vb b/Bancos/CuentasBancarias.aspx.vb index 0726942d5..ce28b5f56 100644 --- a/Bancos/CuentasBancarias.aspx.vb +++ b/Bancos/CuentasBancarias.aspx.vb @@ -33,8 +33,9 @@ Partial Class Bancos_CuentasBancarias Public Sub CargaDatos() Dim ObjBancos As New ClsBancos If ObjBancos.GetBancosCuentas(-1) Then - ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + Dim dt = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa, "", {"CveCuenta", "TipoCuenta", "Banco", "NumCuenta", "CLABE", "Moneda", "FInicial", "Estatus", "Fecha", "Usuario"}) + ViewState("DTBancosCuentas") = dt + DtBan = dt Else Me.GvDatos.DataSource = Nothing End If @@ -66,14 +67,14 @@ Partial Class Bancos_CuentasBancarias If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - - GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing - - 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then - ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados - 'End If - + DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados + 'End If + Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 705ac9305..277f93f0e 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -5,8 +5,8 @@ Imports System.Data Imports Extensiones Partial Class Bancos_PopIEVentas - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "Propiedades" Private Property DtDeudores As DataTable Get @@ -302,8 +302,8 @@ Partial Class Bancos_PopIEVentas Set(value As String) ViewState("SerieFolio") = value End Set - End Property - + End Property + Private Property CveMonedaVenta As Integer Get Return ViewState("CveMonedaVenta").ToString.ToEntero @@ -520,9 +520,9 @@ Partial Class Bancos_PopIEVentas Set(value As Date) ViewState("Fecha") = value End Set - End Property + End Property #End Region - + Private Sub Bancos_PopIEVentas_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then @@ -596,11 +596,11 @@ Partial Class Bancos_PopIEVentas End If CargaTipoTransaccion(TipoTransaccion) - CargaCuentas() - - - - + CargaCuentas() + + + + Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day) Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate @@ -615,8 +615,8 @@ Partial Class Bancos_PopIEVentas TxtTCDolares.Text = GlobalTipoCambio(Fecha).FormatoNumero(4) End If End If - End Sub - + End Sub + #Region "C A M B I A R P A N E L" Private Sub RBLContado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLContado.SelectedIndexChanged Select Case RBLContado.SelectedValue @@ -667,9 +667,9 @@ Partial Class Bancos_PopIEVentas End Select UpGuardar.Update() - End Sub + End Sub #End Region - + #Region "C A R G A R I N F O R M A C I O N" Private Sub CargaVenta(pCveVenta As Integer) Dim ObjVenta As New ClsVentas() @@ -691,8 +691,8 @@ Partial Class Bancos_PopIEVentas If Valida.EsValida > 0 Then If Valida.EsValida = 2 Then - Validada = False - + Validada = False + BtnGuardar.Enabled = False If UsuarioActual.Empresa.UsaAC Then @@ -704,9 +704,9 @@ Partial Class Bancos_PopIEVentas Else Validada = True End If - Else - 'no se pudo validar, pero ya tuvo la primera vuelta de validacion - Alert("La factura no se pudo validar.", TipoMensaje.MsgAdvertencia) + Else + 'no se pudo validar, pero ya tuvo la primera vuelta de validacion + Alert("La factura no se pudo validar.", TipoMensaje.MsgAdvertencia) Validada = False BtnGuardar.Enabled = False BtnGuardar.ToolTip = "La factura no se pudo validar" @@ -716,100 +716,100 @@ Partial Class Bancos_PopIEVentas Validada = True End If - CveCliente = dr("CveCliente").ToString.ToEntero - CveClienteOriginal = dr("CveCliente").ToString.ToEntero - HdnCveCliente.Value = CveCliente.ToString - CargaCliente(CveCliente, "-1") - CveMoneda = dr("CveMoneda").ToString.ToEntero - CveMonedaVenta = dr("CveMoneda").ToString.ToEntero - CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero - NombreCliente = dr("ClienteNombre").ToString '' GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) - SerieFolio = dr("SerieFolio").ToString - TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal - CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero - - LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" - - 'Configuración de Modalidad Update - - 'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ") - - If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then - If dr("TipoDocto").ToString = "Rem" Then - Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia) - BtnGuardar.Visible = False - End If - End If - - MovimientoPagar = New IEMovimiento - MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal - MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal - MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal - MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal - MovimientoPagar.Total = dr("Total").ToString.ToDecimal - MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal - MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal - MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal - - LtlTitulo.Text = "Cuentas por Cobrar" - LtlTipo2.Text = "Folio de la Venta" - LtlTipo3.Text = "Fecha de la Venta" - LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") - LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() - LtlFolio.Text = dr("SerieFolio").ToString - - TxtFolio.Enabled = True - TxtFechaDocumento.Enabled = True - Calendario.Enabled = True - TxtPagueseA.Enabled = False - TxtImporte.Enabled = True - - DdlCuenta.Enabled = True - - DdlTipoTransaccion.Enabled = True - TxtObservaciones.Enabled = True - - RVImporte.Enabled = True - RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero - TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero - - FechaVenta = dr("Fecha").ToString.ToDate - SaldoVenta = dr("Saldo").ToString.ToDouble - - - 'Cortes de Caja - If UsuarioActual.TienePermisoProceso(160) Then - CargaCorteCaja() - End If - - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'toma como proridad el que viene de - CveCorte = dr("CveCorte").ToString.ToEntero - End If - - If RFCCliente.ToUpper <> "XAXX010101000" Then - Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero - - If CveProveedor > 0 Then - Dim Mov As New ClsMovimientos - If Mov.GetCxPProveedor(CveProveedor, MinFecha.ToShortDateString, MaxFecha.ToShortDateString, -1, -1, -1, -1, -1, 1, -1, -1, "-1", "-1", "-1") Then - If Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio").Rows.Count > 0 Then - RBLContado.Items(4).Enabled = True - End If - End If - - Mov.Dispose() - End If - - - 'Dim ObjCompras As New ClsCompras - 'If ObjCompras.GetCompras(-1, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, ProveedorRFC:=RFCCliente) Then - ' RBLContado.Items(4).Enabled = True - 'End If - 'ObjCompras.Dispose() + CveCliente = dr("CveCliente").ToString.ToEntero + CveClienteOriginal = dr("CveCliente").ToString.ToEntero + HdnCveCliente.Value = CveCliente.ToString + CargaCliente(CveCliente, "-1") + CveMoneda = dr("CveMoneda").ToString.ToEntero + CveMonedaVenta = dr("CveMoneda").ToString.ToEntero + CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero + NombreCliente = dr("ClienteNombre").ToString '' GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("Nombre", String.Format("CveCliente = {0}", CveCliente)) + SerieFolio = dr("SerieFolio").ToString + TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal + CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero + + LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" + + 'Configuración de Modalidad Update + + 'Dim RFCCliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RFC", $"CveCliente = {CveCliente} ") + + If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then + If dr("TipoDocto").ToString = "Rem" Then + Alert("Los documentos de tipo Remisión no se permite realizar el pago", TipoMensaje.MsgAdvertencia) + BtnGuardar.Visible = False + End If End If - If Not Validada Then - BtnGuardar.Visible = False + MovimientoPagar = New IEMovimiento + MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal + MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal + MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal + MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal + MovimientoPagar.Total = dr("Total").ToString.ToDecimal + MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal + MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal + MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal + + LtlTitulo.Text = "Cuentas por Cobrar" + LtlTipo2.Text = "Folio de la Venta" + LtlTipo3.Text = "Fecha de la Venta" + LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") + LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() + LtlFolio.Text = dr("SerieFolio").ToString + + TxtFolio.Enabled = True + TxtFechaDocumento.Enabled = True + Calendario.Enabled = True + TxtPagueseA.Enabled = False + TxtImporte.Enabled = True + + DdlCuenta.Enabled = True + + DdlTipoTransaccion.Enabled = True + TxtObservaciones.Enabled = True + + RVImporte.Enabled = True + RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero + TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero + + FechaVenta = dr("Fecha").ToString.ToDate + SaldoVenta = dr("Saldo").ToString.ToDouble + + + 'Cortes de Caja + If UsuarioActual.TienePermisoProceso(160) Then + CargaCorteCaja() + End If + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'toma como proridad el que viene de + CveCorte = dr("CveCorte").ToString.ToEntero + End If + + If RFCCliente.ToUpper <> "XAXX010101000" Then + Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero + + If CveProveedor > 0 Then + Dim Mov As New ClsMovimientos + If Mov.GetCxPProveedor(CveProveedor, MinFecha.ToShortDateString, MaxFecha.ToShortDateString, -1, -1, -1, -1, -1, 1, -1, -1, "-1", "-1", "-1") Then + If Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio").Rows.Count > 0 Then + RBLContado.Items(4).Enabled = True + End If + End If + + Mov.Dispose() + End If + + + 'Dim ObjCompras As New ClsCompras + 'If ObjCompras.GetCompras(-1, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, ProveedorRFC:=RFCCliente) Then + ' RBLContado.Items(4).Enabled = True + 'End If + 'ObjCompras.Dispose() + End If + + If Not Validada Then + BtnGuardar.Visible = False End If @@ -848,8 +848,8 @@ Partial Class Bancos_PopIEVentas ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR ViewState("IdCtaAnticipo") = ObjCliente.IdCtaContAnticipos ViewState("IdCtaContMonedaExtranjeraAnticipo") = ObjCliente.IdCtaMonedaExtranjeraAnticipos - ViewState("IdCtaContMonedaComplementariaAnticipo") = ObjCliente.IdCtaContCompAnticipos - + ViewState("IdCtaContMonedaComplementariaAnticipo") = ObjCliente.IdCtaContCompAnticipos + Else Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) End If @@ -968,8 +968,8 @@ Partial Class Bancos_PopIEVentas ViewState("IdCtaContRetIVAProveedor") = ObjProveedor.IdCtaContRetIVA ViewState("IdCtaContRetIVAAcreditableProveedor") = ObjProveedor.IdCtaContRetIVAAcreditable ViewState("IdCtaProveedorExtranjera") = ObjProveedor.IdCtaContProveedoresExtranjera - ViewState("IdCtaContComplementariaProveedor") = ObjProveedor.IdCtaContProveedoresComplementaria - + ViewState("IdCtaContComplementariaProveedor") = ObjProveedor.IdCtaContProveedoresComplementaria + End If End If @@ -1022,9 +1022,9 @@ Partial Class Bancos_PopIEVentas End If UpDeudores.Update() - End Sub + End Sub #End Region - + #Region "DDL'S CHANGED" Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged Dim valor As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero @@ -1114,8 +1114,8 @@ Partial Class Bancos_PopIEVentas Private Sub DdlDeudor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDeudor.SelectedIndexChanged CambieDeudor() - End Sub - + End Sub + #Region " CUENTAS DEPOSITOS" Private Sub CargaCuentasDepositos() DdlCuentaDeposito.Items.Clear() @@ -1183,10 +1183,10 @@ Partial Class Bancos_PopIEVentas End If Dep.Dispose() UpCuentaDeposito.Update() - End Sub + End Sub #End Region #End Region - + #Region "GV ROW DATA BOUND" Private Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvIngresos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -1235,12 +1235,12 @@ Partial Class Bancos_PopIEVentas Dim rv As RangeValidator = CType(e.Row.FindControl("RVSaldoDeudor"), RangeValidator) End If - End Sub - + End Sub + #End Region - + #Region "CHK TIPO CAMBIO" - + #Region "PAGAR CON PESOS" Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) If ChkPagarPesos.Checked Then @@ -1301,9 +1301,9 @@ Partial Class Bancos_PopIEVentas Else args.IsValid = False End If - End Sub + End Sub #End Region - + #Region "PAGAR CON DOLARES" Protected Sub ChkPagarDolares_CheckedChanged(sender As Object, e As EventArgs) If ChkPagarDolares.Checked Then @@ -1362,9 +1362,9 @@ Partial Class Bancos_PopIEVentas Else args.IsValid = False End If - End Sub + End Sub #End Region - + Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) CambiaTipoMoneda() End Sub @@ -1388,35 +1388,35 @@ Partial Class Bancos_PopIEVentas End If UpDatos.Update() - End Sub + End Sub #End Region - + #Region "G U A R D A R" - Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click - - - - - Dim FechaFactura As Date = FechaVenta - Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate - - Dim AnioFactura As Integer = FechaFactura.Year - Dim MesFactura As Integer = FechaFactura.Month - - Dim AnioDocumento As Integer = FechaDocumentoPago.Year - Dim MesDocumento As Integer = FechaDocumentoPago.Month - - If AnioFactura > AnioDocumento Then - Alert($"El mes de la fecha de venta no puede ser mayor al mes de la la fecha de pago
Fecha de venta: { FechaVenta.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia) - Exit Sub - ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then - Alert($"El mes de la fecha de venta no puede ser mayor al mes de la la fecha de pago
Fecha de venta: { FechaVenta.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - - - 'VALIDACION PARA LOS IMPORTES CUANDO SE QUIERE PAGAR EN DIFERENTE MONEDA + Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + + + + + Dim FechaFactura As Date = FechaVenta + Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate + + Dim AnioFactura As Integer = FechaFactura.Year + Dim MesFactura As Integer = FechaFactura.Month + + Dim AnioDocumento As Integer = FechaDocumentoPago.Year + Dim MesDocumento As Integer = FechaDocumentoPago.Month + + If AnioFactura > AnioDocumento Then + Alert($"El mes de la fecha de venta no puede ser mayor al mes de la la fecha de pago
Fecha de venta: { FechaVenta.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia) + Exit Sub + ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then + Alert($"El mes de la fecha de venta no puede ser mayor al mes de la la fecha de pago
Fecha de venta: { FechaVenta.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + + + 'VALIDACION PARA LOS IMPORTES CUANDO SE QUIERE PAGAR EN DIFERENTE MONEDA If Not Page.IsValid Then Exit Sub End If @@ -1518,18 +1518,18 @@ Partial Class Bancos_PopIEVentas Dim tFecha As Date = TxtFechaDocumento.Text.ToDate - Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) - - If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then - If UltimaFluctuacion.FechaFluctuacion <= tFecha Then - FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion - TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion - End If + Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) + + If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then + If UltimaFluctuacion.FechaFluctuacion <= tFecha Then + FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion + TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion + End If End If 'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then - ' If ObjIE.DtResultados.Rows.Count > 0 Then - + ' If ObjIE.DtResultados.Rows.Count > 0 Then + ' Dim strFecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day) ' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & strFecha & "#", "Fecha DESC") @@ -1596,7 +1596,10 @@ Partial Class Bancos_PopIEVentas CveIE = -1 End If Case Else - MsgError = "No se ha especificada opcion." + 'NO SE HA DEFINIDO PARA FUNCIONARIO Y EMPLEADO + If RBLContado.SelectedValue <> "2" Then + MsgError = "No se ha especificada opcion." + End If End Select @@ -1622,7 +1625,7 @@ Partial Class Bancos_PopIEVentas Select Case ConceptoContable Case 2 'Pago Cliente - If RBLContado.SelectedValue.Contiene("3", "4", "5") Then + If RBLContado.SelectedValue.Contiene("3", "4", "5") Then If CveMonedaVenta > 1 Then ConceptoContable = 292 For Each rw As GridViewRow In GvIngresos.Rows If rw.FCCheckBox("Chk").Checked Then @@ -1836,8 +1839,8 @@ Partial Class Bancos_PopIEVentas IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero End If End If - End If - + End If + Case 9 'Ret ISR If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago @@ -1870,8 +1873,8 @@ Partial Class Bancos_PopIEVentas IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero End If End If - End If - + End If + Case 13 'Iva por Trasladar If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago @@ -1897,8 +1900,8 @@ Partial Class Bancos_PopIEVentas PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA - Dim IdCtaIVAXTrasladar As Integer = 0 - + 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 @@ -2025,8 +2028,8 @@ Partial Class Bancos_PopIEVentas IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero End If End If - End If - + End If + Case 63 'Ret ISR Trasladado If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago @@ -2060,8 +2063,8 @@ Partial Class Bancos_PopIEVentas IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero End If End If - End If - + End If + Case 64 'Ganancia If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria @@ -2101,10 +2104,10 @@ Partial Class Bancos_PopIEVentas Dim TCImpuestos As Decimal = tipoCambioPago TimpocambioGeneral = TCImpuestos - Diferencia -= (((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IVA - Diferencia -= (((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetIVA - Diferencia -= (((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetISR - Diferencia -= (((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IEPS + Diferencia -= (((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IVA + Diferencia -= (((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetIVA + Diferencia -= (((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetISR + Diferencia -= (((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IEPS Diferencia = Math.Round(Diferencia, 2) End If @@ -2121,34 +2124,34 @@ Partial Class Bancos_PopIEVentas Else ImporteMovimiento = 0 End If - CveSubProyectoContabilizar = CveSubProyectoVenta - - 'Case 65 'Perdida - ' If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then - ' IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - ' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria - - ' Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - ' TimpocambioGeneral = TCImpuestos - - - ' Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta - ' Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA - ' Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA - ' Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR - ' Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS - ' Diferencia = Math.Round(Diferencia, 2) - - ' 'si la diferencia es negativa es pérdida, si es positiva es ganancia - ' If Diferencia > 0 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = Math.Abs(Diferencia) - ' ImporteMX = ImporteMovimiento - ' End If - ' Else - ' ImporteMovimiento = 0 - ' End If - ' CveSubProyectoContabilizar = CveSubProyectoVenta - + CveSubProyectoContabilizar = CveSubProyectoVenta + + 'Case 65 'Perdida + ' If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then + ' IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria + ' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria + + ' Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) + ' TimpocambioGeneral = TCImpuestos + + + ' Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta + ' Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA + ' Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA + ' Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR + ' Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS + ' Diferencia = Math.Round(Diferencia, 2) + + ' 'si la diferencia es negativa es pérdida, si es positiva es ganancia + ' If Diferencia > 0 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = Math.Abs(Diferencia) + ' ImporteMX = ImporteMovimiento + ' End If + ' Else + ' ImporteMovimiento = 0 + ' End If + ' CveSubProyectoContabilizar = CveSubProyectoVenta + Case 30 If RBLContado.SelectedValue = "1" Then If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then @@ -2453,8 +2456,8 @@ Partial Class Bancos_PopIEVentas IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero End If End If - End If - + End If + If ImporteMovimiento > 0 Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=rw.DataKey("TipoCambio").ToString.ToDecimal) Then MsgError = "No se pudo insertar la póliza" @@ -2552,8 +2555,8 @@ Partial Class Bancos_PopIEVentas IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero End If End If - End If - + End If + If ImporteMovimiento > 0 Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=rw.DataKey("TipoCambio").ToString.ToDecimal) Then MsgError = "No se pudo insertar la póliza" @@ -2699,8 +2702,8 @@ Partial Class Bancos_PopIEVentas IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero End If End If - End If - + End If + If ImporteMovimiento > 0 Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago)) Then MsgError = "No se pudo insertar la póliza" @@ -2808,217 +2811,217 @@ Partial Class Bancos_PopIEVentas End If Next ImporteMovimiento = 0 - End If - - 'Case 16 'Ret ISR X Acreditar COMPRA - ' If RBLContado.SelectedValue = "5" Then - ' For Each rw As GridViewRow In GvCompras.Rows - ' If rw.FCCheckBox("Chk").Checked Then - ' If rw.DataKey("CveRetIVAConcepto").ToString.ToDecimal = 1 Then - ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal - - ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra - ' ImporteMX = ImporteMovimiento - ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal - ' End If - ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ' ImporteMX = Math.Round(ImporteMX, 2) - - ' If rw.DataKey("TipoCambio").ToString.ToDecimal > 1 Then ConceptoMovimiento += $" TC:{rw.DataKey("TipoCambio").ToString.ToDecimal} ${ImporteMovimiento.FormatoNumero(2)}" - - ' 'Conta ContPAQ - ' If IdCtaContRetISRProveedor > 0 Then - ' IdCtaContable = IdCtaContRetISRProveedor - ' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero - ' Else - ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - - ' 'Conta SIG - ' If CveCuentaRetISRProveedor <> 0 Then - ' CveCuenta = CveCuentaRetISRProveedor - ' Else - ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero - ' End If - ' End If - ' End If - - ' If ImporteMovimiento > 0 Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=rw.DataKey("TipoCambio").ToString.ToDecimal) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - ' End If - ' End If - ' End If - ' Next - ' ImporteMovimiento = 0 - ' End If - - 'Case 23 'Ret ISR Acreditable COMPRA - ' If RBLContado.SelectedValue = "5" Then - ' For Each rw As GridViewRow In GvCompras.Rows - ' If rw.FCCheckBox("Chk").Checked Then - ' If rw.DataKey("CveRetIVAConcepto").ToString.ToDecimal = 1 Then - ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal - - ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra - ' ImporteMX = ImporteMovimiento - ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento '* If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) - ' End If - ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ' ImporteMX = Math.Round(ImporteMX, 2) - - ' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" - - ' 'Conta ContPAQ - ' If IdCtaContRetISRAcreditableProveedor > 0 Then - ' IdCtaContable = IdCtaContRetISRAcreditableProveedor - ' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero - ' Else - ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - - - - ' If ImporteMovimiento > 0 Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago)) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - ' End If - ' End If - ' End If - ' Next - ' ImporteMovimiento = 0 - ' End If - 'Case 243 'Ret ISR x Acreditar Terceros y Arrendamiento - ' If RBLContado.SelectedValue = "5" Then - ' For Each rw As GridViewRow In GvCompras.Rows - ' If rw.FCCheckBox("Chk").Checked Then - ' If rw.DataKey("CveRetISRConcepto").ToString.ToDecimal = 2 Then - ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal - - ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra - ' ImporteMX = ImporteMovimiento - ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal - ' End If - ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ' ImporteMX = Math.Round(ImporteMX, 2) - - ' If rw.DataKey("TipoCambio").ToString.ToDecimal > 1 Then ConceptoMovimiento += $" TC:{rw.DataKey("TipoCambio").ToString.ToDecimal} ${ImporteMovimiento.FormatoNumero(2)}" - - ' 'Conta ContPAQ - ' If IdCtaContRetISRProveedor > 0 Then - ' IdCtaContable = IdCtaContRetISRProveedor - ' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero - ' Else - ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - - - ' If ImporteMovimiento > 0 Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=rw.DataKey("TipoCambio").ToString.ToDecimal) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - ' End If - ' End If - ' End If - ' Next - ' ImporteMovimiento = 0 - ' End If - - 'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento - ' If RBLContado.SelectedValue = "5" Then - ' For Each rw As GridViewRow In GvCompras.Rows - ' If rw.FCCheckBox("Chk").Checked Then - ' If rw.DataKey("CveRetISRConcepto").ToString.ToDecimal = 2 Then - ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal - - ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra - ' ImporteMX = ImporteMovimiento - ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento '* If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) - ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then - ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) - ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) - ' End If - ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ' ImporteMX = Math.Round(ImporteMX, 2) - - ' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" - - ' 'Conta ContPAQ - ' If IdCtaContRetISRAcreditableProveedor > 0 Then - ' IdCtaContable = IdCtaContRetISRAcreditableProveedor - ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then - ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero - ' Else - ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - - ' If ImporteMovimiento > 0 Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago)) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - ' End If - ' End If - ' End If - ' Next - ' ImporteMovimiento = 0 - ' End If - + End If + + 'Case 16 'Ret ISR X Acreditar COMPRA + ' If RBLContado.SelectedValue = "5" Then + ' For Each rw As GridViewRow In GvCompras.Rows + ' If rw.FCCheckBox("Chk").Checked Then + ' If rw.DataKey("CveRetIVAConcepto").ToString.ToDecimal = 1 Then + ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal + + ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra + ' ImporteMX = ImporteMovimiento + ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal + ' End If + ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ' ImporteMX = Math.Round(ImporteMX, 2) + + ' If rw.DataKey("TipoCambio").ToString.ToDecimal > 1 Then ConceptoMovimiento += $" TC:{rw.DataKey("TipoCambio").ToString.ToDecimal} ${ImporteMovimiento.FormatoNumero(2)}" + + ' 'Conta ContPAQ + ' If IdCtaContRetISRProveedor > 0 Then + ' IdCtaContable = IdCtaContRetISRProveedor + ' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then + ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero + ' Else + ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + ' If ObjMov.DtResultados.Rows.Count > 0 Then + ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + ' End If + ' End If + ' End If + + ' 'Conta SIG + ' If CveCuentaRetISRProveedor <> 0 Then + ' CveCuenta = CveCuentaRetISRProveedor + ' Else + ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + ' If ObjMov.DtResultados.Rows.Count > 0 Then + ' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero + ' End If + ' End If + ' End If + + ' If ImporteMovimiento > 0 Then + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=rw.DataKey("TipoCambio").ToString.ToDecimal) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + ' End If + ' End If + ' End If + ' Next + ' ImporteMovimiento = 0 + ' End If + + 'Case 23 'Ret ISR Acreditable COMPRA + ' If RBLContado.SelectedValue = "5" Then + ' For Each rw As GridViewRow In GvCompras.Rows + ' If rw.FCCheckBox("Chk").Checked Then + ' If rw.DataKey("CveRetIVAConcepto").ToString.ToDecimal = 1 Then + ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal + + ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra + ' ImporteMX = ImporteMovimiento + ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento '* If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) + ' End If + ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ' ImporteMX = Math.Round(ImporteMX, 2) + + ' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" + + ' 'Conta ContPAQ + ' If IdCtaContRetISRAcreditableProveedor > 0 Then + ' IdCtaContable = IdCtaContRetISRAcreditableProveedor + ' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then + ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero + ' Else + ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + ' If ObjMov.DtResultados.Rows.Count > 0 Then + ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + ' End If + ' End If + ' End If + + + + ' If ImporteMovimiento > 0 Then + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago)) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + ' End If + ' End If + ' End If + ' Next + ' ImporteMovimiento = 0 + ' End If + 'Case 243 'Ret ISR x Acreditar Terceros y Arrendamiento + ' If RBLContado.SelectedValue = "5" Then + ' For Each rw As GridViewRow In GvCompras.Rows + ' If rw.FCCheckBox("Chk").Checked Then + ' If rw.DataKey("CveRetISRConcepto").ToString.ToDecimal = 2 Then + ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal + + ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra + ' ImporteMX = ImporteMovimiento + ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * rw.DataKey("TipoCambio").ToString.ToDecimal + ' End If + ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ' ImporteMX = Math.Round(ImporteMX, 2) + + ' If rw.DataKey("TipoCambio").ToString.ToDecimal > 1 Then ConceptoMovimiento += $" TC:{rw.DataKey("TipoCambio").ToString.ToDecimal} ${ImporteMovimiento.FormatoNumero(2)}" + + ' 'Conta ContPAQ + ' If IdCtaContRetISRProveedor > 0 Then + ' IdCtaContable = IdCtaContRetISRProveedor + ' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then + ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero + ' Else + ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + ' If ObjMov.DtResultados.Rows.Count > 0 Then + ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + ' End If + ' End If + ' End If + + + ' If ImporteMovimiento > 0 Then + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=rw.DataKey("TipoCambio").ToString.ToDecimal) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + ' End If + ' End If + ' End If + ' Next + ' ImporteMovimiento = 0 + ' End If + + 'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento + ' If RBLContado.SelectedValue = "5" Then + ' For Each rw As GridViewRow In GvCompras.Rows + ' If rw.FCCheckBox("Chk").Checked Then + ' If rw.DataKey("CveRetISRConcepto").ToString.ToDecimal = 2 Then + ' Dim PorcentajePagoCompra = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / rw.DataKey("Total").ToString.ToDecimal + + ' If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra + ' ImporteMX = ImporteMovimiento + ' ElseIf CveMoneda = 1 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento '* If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 1 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) + ' ElseIf CveMoneda = 2 AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (rw.DataKey("RetISR").ToString.ToDecimal * PorcentajePagoCompra) + ' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago) + ' End If + ' ImporteMovimiento = Math.Round(ImporteMovimiento, 2) + ' ImporteMX = Math.Round(ImporteMX, 2) + + ' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" + + ' 'Conta ContPAQ + ' If IdCtaContRetISRAcreditableProveedor > 0 Then + ' IdCtaContable = IdCtaContRetISRAcreditableProveedor + ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then + ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero + ' Else + ' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + ' If ObjMov.DtResultados.Rows.Count > 0 Then + ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + ' End If + ' End If + ' End If + + ' If ImporteMovimiento > 0 Then + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, rw.FCLiteral("LtlFolio").Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, CveVenta:=CveVenta, CveCompra:=rw.DataKey("CveCompra").ToString.ToEntero, CveProveedor:=rw.DataKey("CveProveedor").ToString.ToEntero, CvePersonal:=CvePersonal, ImporteMX:=ImporteMX, TipoCambio:=If(FuncionalidadFluctuacionImpuestos, rw.DataKey("TipoCambio").ToString.ToDecimal, tipoCambioPago)) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + ' End If + ' End If + ' End If + ' Next + ' ImporteMovimiento = 0 + ' End If + Case 14 'Iva por Acreditar COMPRA If RBLContado.SelectedValue = "5" Then For Each rw As GridViewRow In GvCompras.Rows @@ -3472,9 +3475,9 @@ Partial Class Bancos_PopIEVentas UpDatos.Update() UpGuardar.Update() - End Sub + End Sub #End Region - + #Region " COMPLEMENTOS PAGO " Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String If Not ChkComplementoPago.Checked Then @@ -3486,12 +3489,12 @@ Partial Class Bancos_PopIEVentas 'For i = 0 To CveVentas.Count - 1 Dim ObjBancos As New ClsBancos - If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then - If Not ObjBancos.DtResultados.Rows.Count > 0 Then - ObjBancos.Dispose() - Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia) - Return "" - End If + If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then + If Not ObjBancos.DtResultados.Rows.Count > 0 Then + ObjBancos.Dispose() + Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia) + Return "" + End If End If @@ -3539,14 +3542,14 @@ Partial Class Bancos_PopIEVentas ObjBancos.Dispose() ' Next Return Retorno.ToString - End Function - + End Function + #End Region - Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init - RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString - Calendario.EndDate = DateTime.Now - - End Sub - - + Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init + RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString + Calendario.EndDate = DateTime.Now + + End Sub + + End Class \ No newline at end of file diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index c4e0fa5cd..caed3305f 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -20229,6 +20229,8 @@ Partial Class Compras_Compras If FleteImportacionOpcion > 0 Then RblFleteImportacionOpcion.SelectedValue = FleteImportacionOpcion.ToString RegistraScript("$('#ModalFletesImportaciones').modal()") UpModalFletesImportaciones.Update() + + End Sub Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) CambiaTipo() diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index c07e6faa8..a9e63b2ef 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -4969,6 +4969,7 @@ Partial Class PopUpVerFactura Dim FolioFiscal = drv("FolioFiscal").ToString() Dim RFCReceptor = drv("RFCReceptor").ToString() Dim SelloCancelacion = drv("SelloCancelacion").ToString() + Dim SelloSolicitudCancelacion = drv("SelloSolicitudCancelacion").ToString() Dim EstadoCancelacion = drv("EstadoCancelacion").ToString() Dim FechaCancelacion = drv("FechaCancelacion").ToString.ToDateTime @@ -4994,6 +4995,12 @@ Partial Class PopUpVerFactura If CveEstatusFactura = 20 Then Titulo = "Acuse de solicitud de cancelación de CFDI" EstadoCFDI = "Vigente" + + 'SI TIENE DATOS EN EL SELLO DE SOLICITUD Y ESTA EN PROCESO, ENVIAR ESTE SELLO + If Not String.IsNullOrEmpty(SelloSolicitudCancelacion) Then + SelloCancelacion = SelloSolicitudCancelacion + End If + If String.IsNullOrEmpty(EstadoCancelacion) Then EstadoCancelacion = "Cancelable con aceptación" End If @@ -5751,6 +5758,7 @@ Partial Class PopUpVerFactura Dim MarcaAuto As String = RowAjuste("MarcaAuto").ToString Dim CodigoTD As String = RowAjuste("CodigoTD").ToString + Dim PSAjuste As String = "" Dim MarcaPS As String = "" Dim CveMarca As Integer = -1 @@ -5781,7 +5789,15 @@ Partial Class PopUpVerFactura Dim ObjPS As New ClsProductosServicios If ObjPS.GetPS(CvePSAjuste, -1, UsuarioActual.CveEmpresa) Then - MarcaPS = ObjPS.DtResultados.FiltroPrimeroValor("Marca", String.Format("CvePS = {0}", CvePSAjuste)) + Dim RowPS As DataRow = ObjPS.DtResultados.FiltroPrimero(String.Format("CvePS = {0}", CvePSAjuste)) + If RowPS IsNot Nothing Then + PSAjuste = RowPS("PS").ToString() + MarcaPS = RowPS("Marca").ToString() + 'SI ES MOTOBATERIAS PONER EL NOMBRE EN EL TIPO + If RowPS("CveClasificacion").ToString() = "20517" Then + BCIAjuste = PSAjuste + End If + End If End If ObjPS.Dispose() @@ -5879,6 +5895,7 @@ Partial Class PopUpVerFactura Dim MesesUso As String = "0" + Dim PSAjuste As String = "" Dim MarcaPS As String = "" Dim CveMarca As Integer = -1 @@ -5909,7 +5926,15 @@ Partial Class PopUpVerFactura Dim ObjPS As New ClsProductosServicios If ObjPS.GetPS(CvePSAjuste, -1, UsuarioActual.CveEmpresa) Then - MarcaPS = ObjPS.DtResultados.FiltroPrimeroValor("Marca", String.Format("CvePS = {0}", CvePSAjuste)) + Dim RowPS As DataRow = ObjPS.DtResultados.FiltroPrimero(String.Format("CvePS = {0}", CvePSAjuste)) + If RowPS IsNot Nothing Then + PSAjuste = RowPS("PS").ToString() + MarcaPS = RowPS("Marca").ToString() + 'SI ES MOTOBATERIAS PONER EL NOMBRE EN EL TIPO + If RowPS("CveClasificacion").ToString() = "20517" Then + BCIAjuste = PSAjuste + End If + End If End If ObjPS.Dispose() diff --git a/Contabilidad/RepPolizasCuadre.aspx b/Contabilidad/RepPolizasCuadre.aspx index 35aeef321..cad8bb655 100644 --- a/Contabilidad/RepPolizasCuadre.aspx +++ b/Contabilidad/RepPolizasCuadre.aspx @@ -15,19 +15,44 @@
- <%----%> +
- <%--
- -
-
-
--%> + +
+ + +
+ + +
+ +
+ + + + + + + + + + + + + + +
+ +
+ +
+ @@ -57,6 +82,42 @@ + + +<%-- FechaMovto Mensaje CveIE CveCompra CveVenta CvePrePoliza FolioPoliza--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Contabilidad/RepPolizasCuadre.aspx.vb b/Contabilidad/RepPolizasCuadre.aspx.vb index 3dc07cc5d..5f8e52790 100644 --- a/Contabilidad/RepPolizasCuadre.aspx.vb +++ b/Contabilidad/RepPolizasCuadre.aspx.vb @@ -4,12 +4,21 @@ Option Strict On Imports System.Data Imports System.Linq Imports Extensiones + Partial Class Contabilidad_RepPolizasCuadre Inherits ClsPaginas Private Sub Contabilidad_RepPolizasCuadre_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - CargaGrid() + + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + CargaEjercicios() + MuestraControlesContabilidadSIG() + CargaDatosContabilidaSIG() + Else + CargaGrid() + End If + End If End Sub @@ -25,6 +34,7 @@ Partial Class Contabilidad_RepPolizasCuadre UpDatos.Update() End Sub + Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim Liga1 As String = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", e.Row.DBCampo("IdPoliza")) @@ -32,4 +42,72 @@ Partial Class Contabilidad_RepPolizasCuadre End If End Sub + + +#Region " C O N T A B L I D A D S I G" + Private Sub MuestraControlesContabilidadSIG() + + GvDatos.Visible = False + + GvDatosSIG.Visible = True + + BtnConsultar.Visible = True + DvRowFiltrosContanSig1.Visible = True + + End Sub + + Private Sub CargaDatosContabilidaSIG() + + + Dim ObjP As New ClsContabilidad + + If ObjP.GetPolizasDescuadre(DdlEjercicio.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + + If ObjP.DtResultados.Rows.Count > 0 Then + GvDatosSIG.DataSource = ObjP.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") + Else + GvDatosSIG.DataSource = Nothing + End If + Else + GvDatosSIG.DataSource = Nothing + End If + + ObjP.Dispose() + + GvDatosSIG.DataBind() + UpDatos.Update() + + + + End Sub + + + Private Sub CargaEjercicios() + + Dim Clsconta As New ClsContabilidad + If Clsconta.GetEjercicios(UsuarioActual.CveEmpresa) Then + DdlEjercicio.DataSource = Clsconta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + Clsconta.Dispose() + + DdlEjercicio.DataBind() + DdlEjercicio.SelectedValue = Now.Year.ToString + + DdlPeriodo.SelectedValue = Now.Month.ToString + + End Sub + + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatosContabilidaSIG() + End Sub + + +#End Region + + + + End Class diff --git a/Contabilidad2/RepSituacionFinanciera.aspx.vb b/Contabilidad2/RepSituacionFinanciera.aspx.vb index f3f16dacf..fb092acf1 100644 --- a/Contabilidad2/RepSituacionFinanciera.aspx.vb +++ b/Contabilidad2/RepSituacionFinanciera.aspx.vb @@ -587,18 +587,30 @@ Partial Class AC2_SituacionFinanciera Private Sub ImprimirReporte(Optional Formato As String = "PDF") Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") - 'nombre del archivo a generar + Dim fileName As String = "EdoSituacionFinanciera" - 'ubicacion del rdlc + Dim reportpath As String = "Contabilidad2/Reportes/RepSituacionFinanciera.rdlc" - 'parametros a enviar al reporte + Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri)) + + + Dim ImgLogoInfo As New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}\Logo.png") + + + If ImgLogoInfo.Exists Then + params.Add(New ReportParameter("pImg", $"file://{ImgLogoInfo.FullName}")) + Else + params.Add(New ReportParameter("pImg", "")) + End If + + params.Add(New ReportParameter("pFirma1", If(ChkFirma.Checked, String.Format("{0}", vbCrLf), ""))) params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("{0}l", vbCrLf), ""))) params.Add(New ReportParameter("pFechaFin", FechaF)) + params.Add(New ReportParameter("periodo", String.Format("de {0} {1}", DdlPeriodo.SelectedItem.ToString, DdlEjercicio.SelectedItem.ToString))) ImprimirPDF(reportpath, DtDatos, params, fileName, Formato) End Sub diff --git a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc index 840e67f08..6c35c1cfe 100644 --- a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc +++ b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc @@ -3048,16 +3048,17 @@ =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteActual.Value, 0),"DataSet1") - =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteActual.Value, 0),"DataSet1") + =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteActual.Value, 0),"DataSet1") - =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteAnterior.Value, 0),"DataSet1") + =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteAnterior.Value, 0),"DataSet1") - =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteActual.Value, 0),"DataSet1") + =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteActual.Value, 0),"DataSet1") =Variables!TotalPasivoActual.Value+Variables!TotalPatrimonioHActual.Value + true =Variables!TotalPatrimonioHAnterior.Value+ Variables!TotalPasivoAnterior.Value diff --git a/CxC/RepCxC.aspx.vb b/CxC/RepCxC.aspx.vb index d7bda4f73..c0d5100a4 100644 --- a/CxC/RepCxC.aspx.vb +++ b/CxC/RepCxC.aspx.vb @@ -105,7 +105,7 @@ Partial Class RepCxC CargaCombos() CargaGvPersonalizarRaqngoColumnas() CargaDatos() - If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then ChkAnticipos.visible = True + If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True ActivaEnviarEstadoCuenta() If UsuarioActual.CveRol = 1 Or UsuarioActual.TienePermisoProceso(243) Then LnkDescargarSegmentos.Visible = True CreaDataTableColor() @@ -380,55 +380,57 @@ Partial Class RepCxC If e.Row.DBCampo("CveCliente").ToString.ToEntero > 0 Then e.Row.FCLiteral("LtlGrupo").Text = $"{e.Row.DBCampo("GPO")}" End If - End If + End If + + Dim AplicaAnticipos As Integer = If(ChkAnticipos.Checked, 1, 0) - Dim Liga1 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}", + Dim Liga1 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga2 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga2 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga3 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga3 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga4 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga4 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga5 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente{26}", + Dim Liga5 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente{26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga6 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga6 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga7 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga7 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga8 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga8 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga9 As String = String.Format("/CxC/RepCxCDetalle.aspx.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga9 As String = String.Format("/CxC/RepCxCDetalle.aspx.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga10 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga10 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim Liga11 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim Liga11 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) - Dim LigaTot As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", + Dim LigaTot As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}", DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), - e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) + e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos) e.Row.FCHyperLink("HplSaldo").NavigateUrl = LigaTot diff --git a/CxC/RepCxCDetalle.aspx b/CxC/RepCxCDetalle.aspx index 72a3d882d..cc3e6ad6f 100644 --- a/CxC/RepCxCDetalle.aspx +++ b/CxC/RepCxCDetalle.aspx @@ -312,6 +312,10 @@ +
+ +
+ @@ -324,11 +328,11 @@
-
-
+
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
+
diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index 976ec6d4f..8bc46cf4e 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -348,6 +348,11 @@ Partial Class RepCxCDetalle DdlSubProyecto.SelectedValueExist(CveSubProyecto) + + If Request("AplicaAnticiposPagados") IsNot Nothing Then + ChkAnticipos.Checked = If(Request("AplicaAnticiposPagados").ToEntero = 1, True, False) + End If + DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion) CargaClientes() If CveCliente > 0 Then @@ -410,7 +415,7 @@ Partial Class RepCxCDetalle DdlClientesWS.Attributes.Add("style", "!important width: 100%;") End If - + If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True End Sub Private Function CargaDatos() As DataTable Dim dt As DataTable = Nothing @@ -427,6 +432,7 @@ Partial Class RepCxCDetalle FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1") FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1") + 'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero Dim CveCliente = If(DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.SelectedValue.ToEntero, -1) If ObjMovtos.GetCxCDetalle(FechaI, FechaF, CveCliente, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, @@ -435,7 +441,7 @@ Partial Class RepCxCDetalle RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=DdlCobranzaEstatusFiltro.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, LimiteCredito:=LimiteCredito, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, - CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero) Then + CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=If(ChkAnticipos.Checked, 1, 0)) Then GvDatos.DataSource = ObjMovtos.DtResultados dt = ObjMovtos.DtResultados diff --git a/Empresas/Grales/Formatos/Ajuste.rdlc b/Empresas/Grales/Formatos/Ajuste.rdlc index bc19d8a58..609acd1cd 100644 --- a/Empresas/Grales/Formatos/Ajuste.rdlc +++ b/Empresas/Grales/Formatos/Ajuste.rdlc @@ -990,9 +990,9 @@ Textbox3 2.155in - 2.56338in + 2.76123in 0.16389in - 1.23952in + 1.04167in 22