diff --git a/Bancos/RepEgresosSinComprobante.aspx b/Bancos/RepEgresosSinComprobante.aspx index ba7f21cbb..8b3a02808 100644 --- a/Bancos/RepEgresosSinComprobante.aspx +++ b/Bancos/RepEgresosSinComprobante.aspx @@ -153,7 +153,7 @@ - + diff --git a/Bancos/RepEgresosSinComprobante.aspx.vb b/Bancos/RepEgresosSinComprobante.aspx.vb index f09a2051b..6718344f4 100644 --- a/Bancos/RepEgresosSinComprobante.aspx.vb +++ b/Bancos/RepEgresosSinComprobante.aspx.vb @@ -3,9 +3,7 @@ Option Strict On Imports System.Data Imports Extensiones -Imports Microsoft.Reporting.WebForms -Imports System.Linq - +Imports Microsoft.Reporting.WebForms Partial Class Bancos_RepEgresosSinComprobante Inherits ClsPaginas @@ -215,7 +213,7 @@ Partial Class Bancos_RepEgresosSinComprobante For Each gr As GridViewRow In GvESC.Rows If gr.FCCheckBox("Chk").Checked Then - Dim IdCtaContable As Integer = 0 + Dim ImporteSaldo As Decimal = gr.DataKey("Saldo").ToDecimal Dim TipoMovtoOtIngresos As Boolean = False Dim TipoMovtoConcepto As Boolean = True Dim CveConceptoContable As Integer @@ -236,28 +234,43 @@ Partial Class Bancos_RepEgresosSinComprobante Case 48 CveConceptoContable = 56 End Select + If gr.DataKey("CveMoneda").ToEntero > 1 Then + If CveConceptoContable = 21 Then CveConceptoContable = 339 + If CveConceptoContable = 56 Then CveConceptoContable = 346 + End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Folio"), CveConceptoContable, "Saldo de ExC por Sistema", Now, IdCtaContable, -1, - gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, - ImporteMX:=gr.DataKey("Saldo").ToDecimal, Contabilizable:=EsContabilizable) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, ImporteSaldo, ImporteSaldo, CveConceptoContable, gr.DataKey("Folio"), "Saldo de ExC por Sistema", -1, + CveIE:=gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, + Contabilizable:=EsContabilizable) Then MsgError = "Ocurrio un error al saldar el movimiento" Exit For End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOtIngresos, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Folio"), 211, "Saldo de ExC por Sistema", Now, UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, gr.DataKey("CveIE").ToEntero, - ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, Contabilizable:=EsContabilizable) Then - MsgError = "Ocurrio un error al saldar el movimiento" - Exit For - End If - - If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + If gr.DataKey("CveMoneda").ToEntero > 1 Then + If CveConceptoContable = 339 Then CveConceptoContable = 340 + If CveConceptoContable = 346 Then CveConceptoContable = 347 + Dim ImporteMN As Decimal = (ImporteSaldo * gr.DataKey("TipoCambio").ToDecimal - ImporteSaldo).RoundSQL + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, ImporteMN, ImporteMN, CveConceptoContable, gr.DataKey("Folio"), "Saldo de ExC por Sistema", -1, + CveIE:=gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, + ImporteME:=gr.DataKey("Saldo").ToDecimal, Contabilizable:=EsContabilizable) Then + MsgError = "Ocurrio un error al saldar el movimiento" + Exit For End If + ImporteSaldo += ImporteMN + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOtIngresos, ImporteSaldo, ImporteSaldo, 211, gr.DataKey("Folio"), "Saldo de ExC por Sistema", -1, + CveIE:=gr.DataKey("CveIE").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, Contabilizable:=EsContabilizable) Then + MsgError = "Ocurrio un error al saldar el movimiento" + Exit For End If End If Next + If MsgError = "" Then + If Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then + MsgError = "Error al validar." + End If + End If Else Alert("No se especificaron") End If @@ -280,8 +293,6 @@ Partial Class Bancos_RepEgresosSinComprobante Alert(MsgError, TipoMensaje.MsgError) End If - - ObjConta.Dispose() ObjProveedor.Dispose() End Sub