Ahora el PopIECompras agrega prepolizadetalle con concepto 280 si viene con con iva no deducible dentro de la configuracion de prepoliza con concepto 19

This commit is contained in:
Antonio Gonzalez
2019-11-23 14:03:04 -07:00
parent f3a9e97bda
commit 2eaa7e5bec
2 changed files with 149 additions and 73 deletions

View File

@@ -1424,12 +1424,14 @@ Partial Class Bancos_PopIECompras
End If
'inserto las compras que voy a pagar
If ObjMov.GetPlantillaConceptos(2, CvePlantillaPoliza) Then
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
For Each Row As DataRow In ObjMov.DtResultados.Rows
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
Dim ImporteMovimiento As Decimal = 0
Dim ImporteMX As Decimal = 0
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)
@@ -2275,6 +2277,7 @@ Partial Class Bancos_PopIECompras
ImporteMovimiento = 0
ImporteMX = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVADeducible * PorcentajePago
@@ -2296,80 +2299,65 @@ Partial Class Bancos_PopIECompras
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0
If MovimientoPagar.IVANoDeducible.ToString.ToDecimal > 0 Then
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
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 280 'Iva Acreditable No Deducible
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
TotalImporte = ImportePagado.ToString.ToDecimal
End If
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible
ImporteMX = ImporteMovimiento
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * tipoCambioCompra
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
TotalImporte = ImportePagado.ToString.ToDecimal
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible
ImporteMXNoDeducible = ImporteMovimientoNoDeducible
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2)
ImporteMXNoDeducible = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}"
Else
ImporteMovimientoNoDeducible = 0
ImporteMXNoDeducible = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible * PorcentajePago
ImporteMXNoDeducible = ImporteMovimientoNoDeducible
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2)
ImporteMXNoDeducible = Math.Round(ImporteMXNoDeducible, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}"
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
@@ -2389,6 +2377,89 @@ Partial Class Bancos_PopIECompras
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
End If
End If
If MovimientoPagar.IVANoDeducible > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), 280, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMXNoDeducible, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
'Case 280 'Iva Acreditable No Deducible
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
' Dim TotalImporte As Decimal
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' End If
' If TotalImporte = CompraSaldo Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' Else
' ImporteMovimiento = 0
' ImporteMX = 0
' End If
' Else
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' End If
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
' Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
' End If
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
' 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
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IEPS * PorcentajePago
@@ -3066,6 +3137,7 @@ Partial Class Bancos_PopIECompras
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
Next

View File

@@ -687,23 +687,27 @@ Partial Class Compras_ReembolsosComprobaciones
End If
'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal), ImporteMX:=(gvr.DataKey("IVA").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
If gvr.DataKey("IVADeducible").ToDecimal > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVADeducible").ToDecimal, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVADeducible").ToDecimal), ImporteMX:=(gvr.DataKey("IVADeducible").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If
End If
Else
'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVA").ToDecimal * PorcentajePago
'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
If gvr.DataKey("IVADeducible").ToDecimal > 0 Then
Dim ImporteIVA As Decimal = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago
If ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteIVA, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteIVA), ImporteMX:=(ImporteIVA) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If
End If
If gvr.DataKey("NoDeducible") Then
If gvr.DataKey("IVANoDeducible").ToDecimal > 0 Then
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago