-- manejo de dólares

This commit is contained in:
2023-06-30 18:08:33 -07:00
parent c9d387805a
commit 57715b2c07
2 changed files with 31 additions and 20 deletions

View File

@@ -153,7 +153,7 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvESC" runat="server" DataKeyNames="CveIE, Saldo, CveMoneda, CveConceptoContable, CveProveedor, CvePersonal,CveSubProyecto,Folio" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros de Egresos sin Comprobar de Proveedores" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None"> <asp:GridView ID="GvESC" runat="server" DataKeyNames="CveIE, Saldo, TipoCambio, CveMoneda, CveConceptoContable, CveProveedor, CvePersonal,CveSubProyecto,Folio" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros de Egresos sin Comprobar de Proveedores" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<Columns> <Columns>
<asp:TemplateField ItemStyle-Width="5%"> <asp:TemplateField ItemStyle-Width="5%">
<ItemTemplate> <ItemTemplate>

View File

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