This commit is contained in:
rmolina
2019-12-20 11:50:52 -07:00
parent 1b756201c8
commit 521528e4a4
7 changed files with 264 additions and 224 deletions

View File

@@ -1260,187 +1260,187 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
End If
'Case 16 'Ret ISR X Acreditar
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = tipoCambioCompra
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' 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 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 gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' 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
' '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 gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' 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
' '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 gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' 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
' '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
End If
'Case 16 'Ret ISR X Acreditar
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = tipoCambioCompra
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' 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 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 gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' 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
' '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 gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' 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
' '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 gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' 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
' '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 X Acreditar
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
@@ -1744,6 +1744,10 @@ Partial Class Bancos_ProveedoresAbonar
ImporteMovimiento = 0
End Select
If MsgError <> "" Then
Exit For
End If
If ImporteMovimiento <> 0 Then
'Conta ContPAQ
If IdCtaContable = 0 Then
@@ -1764,7 +1768,7 @@ Partial Class Bancos_ProveedoresAbonar
End If
Next
'Unificacion de PrePolizas
If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then
If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(219) = "1" Then
If Not ObjMov.PrePolizaUnificacion(CvePrePoliza, gvr.DataKey("CvePrePoliza").ToEntero) Then
MsgError = "No se pudo unificar la prepoliza"
Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError)
@@ -1775,7 +1779,7 @@ Partial Class Bancos_ProveedoresAbonar
'DESPROGRAMA LO PROGRAMADO DESPUES DE HACERLE UN PAGO
' If DdlTipoTransaccion.SelectedValue <> "9" Then 'SI ES LAYOUT SE DESPROGRAMA EN BANCOS/PAGOELECTRONICO, se comentó, 2018.07.31 peticion marilú.
If gvr.DataKey("ImporteProgramo").ToDouble > 0 Then
If MsgError = "" AndAlso gvr.DataKey("ImporteProgramo").ToDouble > 0 Then
ObjComp.ProgramarCompra(gvr.DataKey("CveCompra").ToEntero, 0, UsuarioActual.CveUsuario, -1)
End If
@@ -1834,7 +1838,7 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
If MsgError = "" And UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjMov.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
MsgError = "No se pudo simplificar los movimientos"
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
@@ -2733,25 +2737,12 @@ Partial Class Bancos_ProveedoresAbonar
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Saldo, gr.DataKey("SerieFolio").ToString, 17, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCCompra), ImporteME:=If(CveMoneda > 1, Saldo, 0), TipoCambio:=TCCompra, CveCuenta:=CveCuenta) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
'fluctuación.
If CveMoneda > 1 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCCompra)
If TCCompra > TCPago Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
End If
End If
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal
If gr.DataKey("IVA").ToDecimal > 0 Then
@@ -2797,13 +2788,42 @@ Partial Class Bancos_ProveedoresAbonar
MsgError = "Ocurrio un error al saldar el movimiento"
End If
'fluctuación.
If CveMoneda > 1 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCCompra)
If TCCompra > TCPago Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
Exit For
Exit For
Else
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
Else
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico"
End If
End If
End If
End If