Aplicar CveSubProyecto a conceptos 69,177,64,65,211

This commit is contained in:
Rakcsle Supertramp
2020-09-22 16:01:24 -07:00
parent e5522d8787
commit 33d1348d1f
14 changed files with 649 additions and 485 deletions

View File

@@ -145,9 +145,18 @@
<div class="col-md-1">
<h5>TC:<asp:Literal runat="server" ID="LtTipoCambioActual"></asp:Literal></h5>
</div>
<div class="col-md-3">
<div class="col-md-2">
<asp:TextBox ID="TxtConceptoFluctuacion" runat="server"></asp:TextBox>
</div>
<div class="col-md-2" style="width: 80px;" runat="server" id="LiSubProyectoLbl">
<asp:Label runat="server" ID="LblSubProyecto"></asp:Label>
</div>
<div class="col-md-1 " runat="server" id="LiSubProyectoDdl">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
</div>
</div>
</div>
<div class="portlet-body">

View File

@@ -19,6 +19,7 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargarCentrosDeCosto(Nothing, DdlSubproyecto, Nothing, LblSubProyecto)
CargaUltimaFluctuacion()
End If
End Sub
@@ -218,13 +219,19 @@ Partial Class Bancos_FluctuacionCambiaria
End If
ObjBancos.Dispose()
GvFiliales.DataBind()
End Sub
End Sub
#End Region
#Region "FLUCTUACION COMPRAS"
Protected Sub BtnGeneraCompras_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
@@ -245,7 +252,6 @@ Partial Class Bancos_FluctuacionCambiaria
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotal.ToDecimal
If Total > 0 Then
CveConceptoContable = 64
@@ -257,8 +263,11 @@ Partial Class Bancos_FluctuacionCambiaria
CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -284,13 +293,20 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.RollBack()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION VENTAS"
Protected Sub BtnGeneraVentas_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
@@ -323,7 +339,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -354,13 +370,20 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.RollBack()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION BANCOS"
Protected Sub BtnGeneraBancos_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Protected Sub BtnGeneraBancos_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
@@ -417,7 +440,7 @@ Partial Class Bancos_FluctuacionCambiaria
Exit For
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
End If
@@ -446,13 +469,20 @@ Partial Class Bancos_FluctuacionCambiaria
ObjContPaq.Dispose()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION DEUDOR"
Protected Sub BtnGeneraDedudores_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Protected Sub BtnGeneraDedudores_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
@@ -493,7 +523,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -519,13 +549,18 @@ Partial Class Bancos_FluctuacionCambiaria
End If
Conta.Dispose()
Banco.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION FILIALES"
Protected Sub BtnGeneraFiliales_Click(sender As Object, e As EventArgs)
Protected Sub BtnGeneraFiliales_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
@@ -571,7 +606,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -614,13 +649,19 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.Dispose()
Banco.Dispose()
ObjContPaq.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION ACREEDORES"
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
@@ -655,7 +696,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -680,162 +721,162 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.RollBack()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION GENERAL"
' Protected Sub BtnGenerar_Click(sender As Object, e As EventArgs)
' Dim AcumuladoGananciaCompras = 0.0, AcumuladoPerdidaCompras = 0.0, AcumuladoGananciaBancos = 0.0, AcumuladoPerdidaBancos = 0.0
' Dim IDPoliza = -1
' 'Valida datos de Compras
' For Each gvr As GridViewRow In GvCompras.Rows
' If gvr.DataKey("SinTipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Compras")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' 'Valida datos de Bancos
' For Each gvr As GridViewRow In GvCuentas.Rows
' If Not gvr.DataKey("TipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Cuentas Bancarias")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
' ObjConta.IniciaTransacSQL()
' Dim ObjBancos As New ClsBancos
' ObjBancos.IniciaTransacSQL()
' Dim ErrorGenerar = False
' Dim Fecha As Date = TxtFecha.Text.ToDate
' IDPoliza = ObjConta.AddPoliza(3, "Fluctuación Cambiaria", (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, UsuarioActual.CveUsuario, Fecha)
' If IDPoliza > 0 Then
' 'COMIENZA: AGREGA CUENTAS BANCARIAS
' If AcumuladoGananciaBancos > 0 Or AcumuladoPerdidaBancos > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCuentas.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Cuentas Bancarias", If(Fluc > 0, "Ganancia", "Perdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 2195, AcumuladoGananciaBancos > 0, AcumuladoGananciaBancos, "", "Acumulado Ganancia Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 4695, AcumuladoPerdidaBancos > 0, AcumuladoPerdidaBancos, "", "Acumulado Pérdida Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA CUENTAS BANCARIAS
' 'COMIENZA: AGREGA COMPRAS
' If AcumuladoGananciaCompras > 0 Or AcumuladoPerdidaCompras > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCompras.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Compras", If(Fluc > 0, "Ganancia", "Pérdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, Not AcumuladoGananciaCompras > 0, AcumuladoGananciaCompras, "", "Acumulado Ganancia Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, Not AcumuladoPerdidaCompras > 0, AcumuladoPerdidaCompras, "", "Acumulado Pérdida Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA COMPRAS
' Else
' ErrorGenerar = True
' End If
' 'Agrega en Bitacoras
' If Not ErrorGenerar Then
' If ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' If Not ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' ErrorGenerar = True
' End If
' Else
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar Then
' ObjConta.AjustaPoliza(IDPoliza)
' ObjConta.Commit()
' ObjBancos.Commit()
' Alert(String.Format("Fluctuación realizada con exito.<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza))
' Else
' ObjConta.RollBack()
' ObjBancos.RollBack()
' Alert("Ocurrio un error al generar la poliza", TipoMensaje.MsgAdvertencia)
' End If
' ObjConta.Dispose()
' ObjBancos.Dispose()
' End Sub
' Protected Sub BtnGenerar_Click(sender As Object, e As EventArgs)
' Dim AcumuladoGananciaCompras = 0.0, AcumuladoPerdidaCompras = 0.0, AcumuladoGananciaBancos = 0.0, AcumuladoPerdidaBancos = 0.0
' Dim IDPoliza = -1
' 'Valida datos de Compras
' For Each gvr As GridViewRow In GvCompras.Rows
' If gvr.DataKey("SinTipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Compras")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' 'Valida datos de Bancos
' For Each gvr As GridViewRow In GvCuentas.Rows
' If Not gvr.DataKey("TipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Cuentas Bancarias")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
' ObjConta.IniciaTransacSQL()
' Dim ObjBancos As New ClsBancos
' ObjBancos.IniciaTransacSQL()
' Dim ErrorGenerar = False
' Dim Fecha As Date = TxtFecha.Text.ToDate
' IDPoliza = ObjConta.AddPoliza(3, "Fluctuación Cambiaria", (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, UsuarioActual.CveUsuario, Fecha)
' If IDPoliza > 0 Then
' 'COMIENZA: AGREGA CUENTAS BANCARIAS
' If AcumuladoGananciaBancos > 0 Or AcumuladoPerdidaBancos > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCuentas.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Cuentas Bancarias", If(Fluc > 0, "Ganancia", "Perdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 2195, AcumuladoGananciaBancos > 0, AcumuladoGananciaBancos, "", "Acumulado Ganancia Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 4695, AcumuladoPerdidaBancos > 0, AcumuladoPerdidaBancos, "", "Acumulado Pérdida Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA CUENTAS BANCARIAS
' 'COMIENZA: AGREGA COMPRAS
' If AcumuladoGananciaCompras > 0 Or AcumuladoPerdidaCompras > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCompras.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Compras", If(Fluc > 0, "Ganancia", "Pérdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, Not AcumuladoGananciaCompras > 0, AcumuladoGananciaCompras, "", "Acumulado Ganancia Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, Not AcumuladoPerdidaCompras > 0, AcumuladoPerdidaCompras, "", "Acumulado Pérdida Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA COMPRAS
' Else
' ErrorGenerar = True
' End If
' 'Agrega en Bitacoras
' If Not ErrorGenerar Then
' If ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' If Not ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' ErrorGenerar = True
' End If
' Else
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar Then
' ObjConta.AjustaPoliza(IDPoliza)
' ObjConta.Commit()
' ObjBancos.Commit()
' Alert(String.Format("Fluctuación realizada con exito.<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza))
' Else
' ObjConta.RollBack()
' ObjBancos.RollBack()
' Alert("Ocurrio un error al generar la poliza", TipoMensaje.MsgAdvertencia)
' End If
' ObjConta.Dispose()
' ObjBancos.Dispose()
' End Sub
#End Region
#Region "GRIDVIEWS"
Protected Sub GvCompras_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompras.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble

View File

@@ -451,6 +451,23 @@ Partial Class Bancos_PopIECompras
End Set
End Property
Private Property CveSubProyecto As Integer
Get
If ViewState("CveSubProyecto") Is Nothing Then
Return -1
Else
Return ViewState("CveSubProyecto").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveSubProyecto") = value
End Set
End Property
#End Region
@@ -668,6 +685,8 @@ Partial Class Bancos_PopIECompras
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal
NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
LtlTitulo.Text = "Cuentas por Pagar"
LtlTipo2.Text = "Folio de la Compra"
LtlTipo3.Text = "Fecha de la Compra"
@@ -1473,8 +1492,9 @@ Partial Class Bancos_PopIECompras
Dim CveTipoPoliza As Integer = ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)
If RBLContado.SelectedValue = "6" Then CveTipoPoliza = 3
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/PopIECompras", CvePlantillaPoliza, ImportePagado, ImportePagado, CveMoneda, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=CveTipoPoliza)
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/PopIECompras", CvePlantillaPoliza, ImportePagado, ImportePagado, CveMoneda, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=CveTipoPoliza)
If Inserta Then
If CvePrePoliza > 0 Then
'SE AGREGA DETALLE DE UNA COMPRA
@@ -1534,6 +1554,9 @@ Partial Class Bancos_PopIECompras
'inserto las compras que voy a pagar
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
For Each Row As DataRow In ObjMov.DtResultados.Rows
Dim CveSubProyectoInsertar As Integer = -1
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
Dim ImporteMovimiento As Decimal = 0
@@ -2173,187 +2196,187 @@ Partial Class Bancos_PopIECompras
End If
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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = 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 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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' 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(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 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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, 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 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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' 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
' '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 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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = 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 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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' 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(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 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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, 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 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 = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' 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
' '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 por Acreditar
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
@@ -2577,84 +2600,84 @@ Partial Class Bancos_PopIECompras
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), 280, ConceptoMovimiento, Fecha, IdCtaContableNoIVA, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMXNoDeducible, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
'Case 280 'Iva Acreditable No Deducible
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
' Dim TotalImporte As Decimal
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' End If
' If TotalImporte = CompraSaldo Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' Else
' ImporteMovimiento = 0
' ImporteMX = 0
' End If
' Else
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' End If
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
' Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
' End If
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
' End If
' End If
End If
'Case 280 'Iva Acreditable No Deducible
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
' Dim TotalImporte As Decimal
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' End If
' If TotalImporte = CompraSaldo Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' Else
' ImporteMovimiento = 0
' ImporteMX = 0
' End If
' Else
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' End If
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
' Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
' End If
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
' End If
' End If
Case 25 'IEPS por Acreditar
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IEPS * PorcentajePago
@@ -2703,7 +2726,15 @@ Partial Class Bancos_PopIECompras
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero
End If
End If
Case 64 'Ganancia
Case 64 'Ganancia
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
End If
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
@@ -2723,6 +2754,13 @@ Partial Class Bancos_PopIECompras
ImporteMovimiento = 0
End If
Case 65 'Perdida
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
End If
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
@@ -3323,15 +3361,19 @@ Partial Class Bancos_PopIECompras
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
''Conta SIG
'If CveCuenta = 0 Then
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
' CveCuentaContabilizacion = 0
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
End If
''Conta SIG
'If CveCuenta = 0 Then
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
' CveCuentaContabilizacion = 0
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If

View File

@@ -3146,6 +3146,7 @@ Partial Class Bancos_ProveedoresAbonar
If gr.DataKey("CveTipoConcepto").ToEntero = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor
Dim ConceptoPartida As String = String.Format("Saldar compra {0}", gr.DataKey("SerieFolio").ToString)
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ProveedoresAbonar/Saldar", 98, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, TxtFechaIncobrable.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveMoneda > 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then
@@ -3223,15 +3224,23 @@ Partial Class Bancos_ProveedoresAbonar
If CveMoneda > 1 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCCompra)
If CveSubProyecto <= 0 Then
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
End If
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
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, CveSubProyecto:=CveSubProyecto, 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
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, CveSubProyecto:=CveSubProyecto, 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

View File

@@ -3896,6 +3896,7 @@ Partial Class Compras_Compras
'------------------INICIA VALIDACIONES------------------
Dim EstatusCredito As Integer = 0
Dim CveSubProyecto As Integer = 0
'Credito Multiple
If RBLPago.SelectedValue.ToEntero = 4 Then
@@ -4062,11 +4063,14 @@ Partial Class Compras_Compras
' Dim NotHas117 As Boolean = Not UsuarioActual.TienePermisoProceso(117)
' 'verifica que tenga proyecto y clasificacion
For Each Row As DataRow In TmpDT.Rows
If Row("CveSubProyecto").ToString.ToEntero <= 0 Then
Alert("No se ha completado la asignacion de proyectos en la compra. ", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
CveSubProyecto = Row("CveSubProyecto").ToString.ToEntero
If Row("CveClasificacionActualizar").ToString.ToEntero <= 0 Then 'If NotHas117 AndAlso Row("CveClasificacionActualizar").ToString.ToEntero <= 0 Then
Alert("Hay productos que no tienen clasificación asignada.<br> Favor de asignarle una y darle guardar.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -5690,6 +5694,8 @@ Partial Class Compras_Compras
For Each Row As DataRow In DTPlatilla.Rows
Dim CveSubProyectoInsertar As Integer = -1
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
Dim importeMovimiento As Decimal = 0
@@ -6291,6 +6297,15 @@ Partial Class Compras_Compras
' End If
' End If
Case 64 'Ganancia
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
ErrorPrepoliza = True
Alert("Concepto ganancia cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
End If
If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
@@ -6307,6 +6322,12 @@ Partial Class Compras_Compras
Case 65 'Perdida
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
ErrorPrepoliza = True
Alert("Concepto perdida cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
End If
If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
@@ -6597,11 +6618,17 @@ Partial Class Compras_Compras
'SumatoriaOCINV = -SumatoriaOCINV
Dim CveClasificacionCostoOC = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
Dim CveSubProyecto69 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If CveSubProyecto69 <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de constos", TipoMensaje.MsgAdvertencia)
ErrorPrepoliza = True
Exit For
End If
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69) Then
ErrorPrepoliza = True
Exit For
End If
@@ -6717,10 +6744,10 @@ Partial Class Compras_Compras
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
Dim CveSubProyecto259 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then
ErrorPrepoliza = True
End If
Else
@@ -7528,7 +7555,8 @@ Partial Class Compras_Compras
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
End If
@@ -19617,7 +19645,18 @@ Partial Class Compras_Compras
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If DiferenciaInvOC.RoundSQL() <> 0 Then
If CveSubProyecto <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de constos.", TipoMensaje.MsgAdvertencia)
Retorno = False
End If
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza > 0 Then

View File

@@ -291,7 +291,7 @@
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto">
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto">
<Columns>
<asp:TemplateField>
<HeaderTemplate>

View File

@@ -637,6 +637,9 @@ Partial Class Compras_ReembolsosComprobaciones
'inserto las compras que voy a pagar
For Each gvr As GridViewRow In GvCxP.Rows
If gvr.FCCheckBox("Chk").Checked Then
ConceptoMovimiento = $"{gvr.DataKey("Proveedor")} F:{gvr.DataKey("SerieFolio")} {If(DdlPersonal.Visible, DdlPersonal.SelectedItem.Text, DdlCajaChica.SelectedItem.Text)}"
Referencia = gvr.DataKey("SerieFolio").ToString
@@ -675,14 +678,19 @@ Partial Class Compras_ReembolsosComprobaciones
CveIEPago = CveIERegistrado
End If
'Otros Ingresos
If (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
If CveCajaChica > 0 AndAlso Not HdnCheque.Value.ToEntero > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
End If

View File

@@ -98,8 +98,7 @@
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Notas de Crédito" OnRowDataBound="GvDatos_RowDataBound"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None"
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,IdCtaContProveedores,
IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio">
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,IdCtaContProveedores,IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio,CveSubProyecto">
<Columns>
<asp:TemplateField ItemStyle-Width="7%">
<ItemTemplate>

View File

@@ -145,6 +145,7 @@ Partial Class Compras_RepNotasCredito
CvePrePoliza = ObjConta.AddPrePolizas("Compras/RepNotasCredito", 103, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldado manual", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveMoneda > 1 Then
IdCtaContable = gr.DataKey("IdCtaContExtranjera").ToEntero
ImporteMN = (gr.DataKey("Saldo").ToDecimal * TCCompra).RoundSQL
@@ -165,7 +166,7 @@ Partial Class Compras_RepNotasCredito
End If
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToString.ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
MsgError = "Ocurrio un Error al saldar el movimiento"
End If

View File

@@ -67,7 +67,7 @@
<asp:LinkButton ID="LnkBitacotaFacturas" runat="server" OnClick="LnkBitacotaFacturas_Click"><i class="fa fa-book" ></i> Bitácora Facturas</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkVinculacionMasivaComplementos" runat="server" OnClick="LnkVinculacionMasivaComplementos_Click" Visible ="true" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea realizar la vinculación masiva de complementos?" data-btn-ok-label="si"><i class="fa fa-tasks" ></i> Vinculación Masiva Complementos</asp:LinkButton>
<asp:LinkButton ID="LnkVinculacionMasivaComplementos" runat="server" OnClick="LnkVinculacionMasivaComplementos_Click" Visible ="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea realizar la vinculación masiva de complementos?" data-btn-ok-label="si"><i class="fa fa-tasks" ></i> Vinculación Masiva Complementos</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>

View File

@@ -816,13 +816,17 @@ Partial Class ContabilidadC_RegPrePolizaS
TipoMovto = False
End If
If CveConcepto = 41 Then
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
Else
CveIE = -1
End If
If CveConcepto <> 30 Then
If CveConcepto = 41 Then
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
Else
CveIE = -1
End If
End If
If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then
idCuentaContabilizacion = 0
End If

View File

@@ -199,7 +199,10 @@ Partial Class Inventarios_PrestamosdeProveedor
CveSubProyecto = ObjInventario.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero } ").FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
End If
If CveSubProyecto <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
ErrorMovInv = True
End If
Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS))
IdCtaContableOtro = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasifCosto}").ToEntero

View File

@@ -2819,6 +2819,12 @@ Partial Class OC
If CvePrePoliza > 0 Then
If DdlSubProyecto.SelectedValue <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
TieneError = True
Exit For
End If
If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL()
ImporteMEComp = (DiferenciaInvOC - ImporteME).RoundSQL()
@@ -2834,8 +2840,6 @@ Partial Class OC
' Exit For
'End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
TieneError = True
Exit For

View File

@@ -2662,12 +2662,17 @@ Partial Class Ventas_ClientesAbonar
If tCveMoneda = 2 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCVenta)
If CveSubProyecto <= 0 Then
MsgError = $"No se pudo obtener el sub proyecto de la venta {gr.DataKey("SerieFolio").ToString}"
End If
If TCPago > TCVenta 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, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=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, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) 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, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
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, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If