This commit is contained in:
2021-08-17 21:17:31 -07:00
39 changed files with 50420 additions and 1992 deletions

View File

@@ -1780,8 +1780,28 @@ Partial Class Bancos_PopIECompras
IdCtaContable = IdCtaProveedorExtranjera
End If
End If
Case 15 'Ret IVA X Acreditar Honorarios/Serv. Prof.
If MovimientoPagar.ConceptoRetIVA = 1 Then
Case 15 'Ret IVA X Acreditar Honorarios/Serv. Prof.
If MovimientoPagar.ConceptoRetIVA > 0 Then
Dim Funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetIVA = 1 Then
Funcionalidad = 307
ConceptoContable = 15
ElseIf MovimientoPagar.ConceptoRetIVA = 2 Then
Funcionalidad = 309
ConceptoContable = 183
ElseIf MovimientoPagar.ConceptoRetIVA = 3 Then
Funcionalidad = 311
ConceptoContable = 185
ElseIf MovimientoPagar.ConceptoRetIVA = 4 Then
Funcionalidad = 313
ConceptoContable = 248
ElseIf MovimientoPagar.ConceptoRetIVA = 5 Then
Funcionalidad = 578
ConceptoContable = 285
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
@@ -1815,7 +1835,24 @@ Partial Class Bancos_PopIECompras
End If
Case 22 'Ret IVA Acreditable Honorarios/Serv. Prof.
If MovimientoPagar.ConceptoRetIVA = 1 Then
If MovimientoPagar.ConceptoRetIVA > 0 Then
Dim Funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetIVA = 1 Then
Funcionalidad = 308
ConceptoContable = 22
ElseIf MovimientoPagar.ConceptoRetIVA = 2 Then
Funcionalidad = 310
ConceptoContable = 184
ElseIf MovimientoPagar.ConceptoRetIVA = 3 Then
Funcionalidad = 312
ConceptoContable = 186
ElseIf MovimientoPagar.ConceptoRetIVA = 4 Then
Funcionalidad = 314
ConceptoContable = 249
ElseIf MovimientoPagar.ConceptoRetIVA = 5 Then
Funcionalidad = 578
ConceptoContable = 286
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
@@ -1838,281 +1875,8 @@ Partial Class Bancos_PopIECompras
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(308).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 183 'Ret IVA X Acreditar Fletes P.F.
If MovimientoPagar.ConceptoRetIVA = 2 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(309).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(309).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 184 'Ret IVA Acreditable Fletes P.F.
If MovimientoPagar.ConceptoRetIVA = 2 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(310).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(310).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 185 'Ret IVA X Acreditar Fletes P.M.
If MovimientoPagar.ConceptoRetIVA = 3 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(311).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(311).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 186 'Ret IVA Acreditable Fletes P.M.
If MovimientoPagar.ConceptoRetIVA = 3 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(312).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(312).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 248 'Ret IVA x Acreditar Acreditable Arrendamiento
If MovimientoPagar.ConceptoRetIVA = 4 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(313).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(313).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 249 'Ret IVA Acreditable Arrendamiento
If MovimientoPagar.ConceptoRetIVA = 4 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(314).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(314).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 285 'Ret IVA x Acreditar Acreditable Servicios
If MovimientoPagar.ConceptoRetIVA = 5 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 286 'Ret IVA Acreditable Servicio
If MovimientoPagar.ConceptoRetIVA = 5 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
@@ -2121,223 +1885,169 @@ Partial Class Bancos_PopIECompras
End If
End If
End If
'Case 16 'Ret ISR X Acreditar
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = tipoCambioCompra
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Case 16 'Ret ISR X Acreditar
If MovimientoPagar.ConceptoRetISR > 0 Then
Dim funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetISR = 1 Then
funcionalidad = 315
ConceptoContable = 16
ElseIf MovimientoPagar.ConceptoRetISR = 2 Then
funcionalidad = 317
ConceptoContable = 243
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
' '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
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetISR > 0 Then
IdCtaContable = IdCtaContRetISR
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).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
End If
'Case 23 'Ret ISR Acreditable
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
Case 23 'Ret ISR Acreditable
If MovimientoPagar.ConceptoRetISR > 0 Then
Dim funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetISR = 1 Then
funcionalidad = 316
ConceptoContable = 23
ElseIf MovimientoPagar.ConceptoRetISR = 2 Then
funcionalidad = 318
ConceptoContable = 244
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
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 ContPAQ
If IdCtaContRetISRAcreditable > 0 Then
IdCtaContable = IdCtaContRetISRAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).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
' End If
'Case 243 'Ret ISR X Acreditar Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
End If
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Case 14 'Iva por Acreditar
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
' '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
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
' End If
'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, 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
' End If
Case 14 'Iva por Acreditar
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.IVA
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
'ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${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(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
End If
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
'ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${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(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
End If
End If
Case 19 'Iva Acreditable

View File

@@ -1040,7 +1040,25 @@ Partial Class Bancos_ProveedoresAbonar
IdCtaContable = IdCtaProveedorExtranjera
End If
Case 15 'Ret IVA X Acreditar Honorarios/Serv. Prof.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
If gvr.DataKey("CveRetIVAConcepto").ToEntero > 0 Then
Dim Funcionalidad As Integer = 0
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
Funcionalidad = 307
ConceptoContable = 15
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Funcionalidad = 309
ConceptoContable = 183
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
Funcionalidad = 311
ConceptoContable = 185
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
Funcionalidad = 313
ConceptoContable = 248
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
Funcionalidad = 578
ConceptoContable = 285
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
@@ -1066,8 +1084,8 @@ Partial Class Bancos_ProveedoresAbonar
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(307).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(307).ToEntero
ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
@@ -1075,10 +1093,29 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
End If
Case 22 'Ret IVA Acreditable Honorarios/Serv. Prof.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
Case 22 'Ret IVA Acreditable Honorarios/Serv. Prof.
If gvr.DataKey("CveRetIVAConcepto").ToEntero > 0 Then
Dim Funcionalidad As Integer = 0
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
Funcionalidad = 308
ConceptoContable = 22
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Funcionalidad = 310
ConceptoContable = 184
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
Funcionalidad = 312
ConceptoContable = 186
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
Funcionalidad = 314
ConceptoContable = 249
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
Funcionalidad = 578
ConceptoContable = 286
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
@@ -1103,8 +1140,8 @@ Partial Class Bancos_ProveedoresAbonar
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(308).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero
ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
@@ -1113,438 +1150,96 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
Case 183 'Ret IVA X Acreditar Fletes P.F.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Case 16 'Ret ISR X Acreditar
If gvr.DataKey("CveRetISRConcepto").ToEntero > 0 Then
Dim funcionalidad As Integer = 0
If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
funcionalidad = 315
ConceptoContable = 16
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
funcionalidad = 317
ConceptoContable = 243
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
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 IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(309).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(309).ToEntero
If IdCtaContRetISR > 0 Then
IdCtaContable = IdCtaContRetISR
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 184 'Ret IVA Acreditable Fletes P.F.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Case 23 'Ret ISR Acreditable
If gvr.DataKey("CveRetISRConcepto").ToEntero > 0 Then
Dim funcionalidad As Integer = 0
If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
funcionalidad = 316
ConceptoContable = 23
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
funcionalidad = 318
ConceptoContable = 244
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
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("RetIVA").ToDecimal * PorcentajePago)
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
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 IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(310).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(310).ToEntero
If IdCtaContRetISRAcreditable > 0 Then
IdCtaContable = IdCtaContRetISRAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 185 'Ret IVA X Acreditar Fletes P.M.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(311).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(311).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 186 'Ret IVA Acreditable Fletes P.M.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(312).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(312).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 248 'Ret IVA X Acreditar Arrendamiento
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioCompra
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(313).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(313).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 249 'Ret IVA Acreditable Arrendamiento
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(314).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(314).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 285 'Ret IVA x Acreditar Acreditable Servicios
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 286 'Ret IVA Acreditable Servicio
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
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
' 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
' 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
' 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
' 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
@@ -1966,6 +1661,40 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
'fluctuación.
Dim TCPago = TxtTCDolares.Text.ToDecimal
Dim ImporteFluctuacion As Decimal = 0 '((ImporteSeleccionado / TCPago) - TxtImporte.Text.ToDecimal)
Dim DtPrePoliza As DataTable = Nothing
If ObjMov.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then
DtPrePoliza = ObjMov.DtResultados.Copy
End If
Dim PagoProveedoresME = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 312 AND TipoMovto = 0")
Dim Bancos = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 30 AND TipoMovto = 1")
Dim BancosComplementaria = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 204 AND TipoMovto = 1")
DtPrePoliza.Dispose()
ImporteFluctuacion = PagoProveedoresME - (Bancos + BancosComplementaria)
If ImporteFluctuacion.RoundSQL() <> 0 Then
'SI EL PAGO DE PROVEEDORES ME ES MAYOR QUE BANCOS METER EL CONCEPTO DE GANANCIA
If ImporteFluctuacion > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Referencia, 64, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
ElseIf ImporteFluctuacion < 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Referencia, 65, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
End If
End If
Else
If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
TipoCambioPago = TxtTCDolares.Text.ToDecimal

View File

@@ -69,7 +69,7 @@
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblTitulo" runat="server" Text="Catálogo de Ingreso / Egreso"></asp:Label>
<asp:Label ID="LblTitulo" runat="server" Text="Reporteador Ingresos - Egresos"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>