diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 0f8a67eae..5a804b329 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -1538,7 +1538,6 @@ Partial Class Bancos_PopIECompras Dim ImporteMovimientoNoDeducible As Decimal = 0 Dim ImporteMXNoDeducible As Decimal = 0 Dim IdCtaContable As Integer = 0 - Dim CveCuenta As Integer = 0 Dim ConceptoMovimiento = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, TxtObservaciones.Text, TxtFolio.Text.Trim) Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) Dim TimpocambioGeneral As Decimal = 1 @@ -1899,8 +1898,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1932,8 +1931,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago) ImporteMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = tipoCambioCompra If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1966,8 +1965,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2000,8 +1999,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2033,9 +2032,9 @@ Partial Class Bancos_PopIECompras ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) - End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + End If + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2069,8 +2068,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2103,8 +2102,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2156,17 +2155,7 @@ Partial Class Bancos_PopIECompras ' End If ' End If - ' 'Conta SIG - ' If CveCuentaRetISR <> 0 Then - ' CveCuenta = CveCuentaRetISR - ' 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 - ' End If + 'Case 23 'Ret ISR Acreditable ' If MovimientoPagar.ConceptoRetISR = 1 Then ' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then @@ -2201,16 +2190,6 @@ Partial Class Bancos_PopIECompras ' End If ' End If - ' 'Conta SIG - ' If CveCuentaRetISR <> 0 Then - ' CveCuenta = CveCuentaRetISR - ' 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 ' End If 'Case 243 'Ret ISR X Acreditar Terceros y Arrendamiento ' If MovimientoPagar.ConceptoRetISR = 2 Then @@ -2246,16 +2225,7 @@ Partial Class Bancos_PopIECompras ' End If ' End If - ' 'Conta SIG - ' If CveCuentaRetISR <> 0 Then - ' CveCuenta = CveCuentaRetISR - ' 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 + ' End If 'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento ' If MovimientoPagar.ConceptoRetISR = 2 Then @@ -2291,16 +2261,7 @@ Partial Class Bancos_PopIECompras ' End If ' End If - ' 'Conta SIG - ' If CveCuentaRetISR <> 0 Then - ' CveCuenta = CveCuentaRetISR - ' 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 + ' End If Case 14 'Iva por Acreditar If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then @@ -2331,8 +2292,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = MovimientoPagar.IVA ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = tipoCambioCompra If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2355,8 +2316,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.IVAPorPagar * PorcentajePago) ImporteMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2409,8 +2370,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.IVADeducible) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2433,8 +2394,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago) ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2517,7 +2478,6 @@ Partial Class Bancos_PopIECompras If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero - CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero End If End If @@ -2559,8 +2519,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = MovimientoPagar.IVA ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = tipoCambioCompra If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2582,8 +2542,8 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago) ImporteMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - ImporteMX = Math.Round(ImporteMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + ImporteMX = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -2603,7 +2563,6 @@ Partial Class Bancos_PopIECompras If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - CveCuenta = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If @@ -2745,7 +2704,6 @@ Partial Class Bancos_PopIECompras If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - CveCuenta = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If @@ -2828,7 +2786,6 @@ Partial Class Bancos_PopIECompras ' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then ' If ObjMov.DtResultados.Rows.Count > 0 Then ' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero - ' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero ' End If ' End If Case 25 'IEPS por Acreditar @@ -2888,7 +2845,6 @@ Partial Class Bancos_PopIECompras If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria - CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) TimpocambioGeneral = TCImpuestos '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra @@ -2914,7 +2870,6 @@ Partial Class Bancos_PopIECompras If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra If tipoCambioPago > tipoCambioCompra AndAlso CveMonedaCompra = 2 Then