-- cambios en fluctuación de Bancos, para que sea esquema SIG
This commit is contained in:
@@ -738,8 +738,8 @@
|
|||||||
|
|
||||||
<br />
|
<br />
|
||||||
<asp:GridView ID="GvCuentas" Width="99%" runat="server" AutoGenerateColumns="False"
|
<asp:GridView ID="GvCuentas" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||||
DataKeyNames="IdCtaAfectable,IdCtaContable,IdCtaContableComplementaria,TipoCambio,Fluctuacion,
|
DataKeyNames=" TipoCambio,Fluctuacion,
|
||||||
Banco,NumCuenta,CveCuentaComplementaria,Saldo"
|
Banco,NumCuenta,CveCuentaMEComplementaria,SaldoME"
|
||||||
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip=""
|
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip=""
|
||||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
|
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
@@ -750,7 +750,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField HeaderText="Banco" DataField="Banco" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="Banco" DataField="Banco" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField HeaderText="# Cuenta" DataField="NumCuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="# Cuenta" DataField="NumCuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Saldo" DataField="SaldoME" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||||
</Columns>
|
</Columns>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
If T.ActiveTabIndex = 3 Then CargaDatosClientesAnticipos()
|
If T.ActiveTabIndex = 3 Then CargaDatosClientesAnticipos()
|
||||||
If T.ActiveTabIndex = 4 Then CargaDatosAcreedores()
|
If T.ActiveTabIndex = 4 Then CargaDatosAcreedores()
|
||||||
If T.ActiveTabIndex = 5 Then CargaDatosAcreedoresAnticipos()
|
If T.ActiveTabIndex = 5 Then CargaDatosAcreedoresAnticipos()
|
||||||
If T.ActiveTabIndex = 6 Then CargaDatosCuentas()
|
If T.ActiveTabIndex = 6 Then CargaDatosBancosCuentas()
|
||||||
|
|
||||||
If T.ActiveTabIndex = 7 Then CargaDatosFiliales()
|
If T.ActiveTabIndex = 7 Then CargaDatosFiliales()
|
||||||
If T.ActiveTabIndex = 8 Then CargaDatosDeudores()
|
If T.ActiveTabIndex = 8 Then CargaDatosDeudores()
|
||||||
@@ -301,42 +301,42 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
GvAcreedoresAnt.DataBind()
|
GvAcreedoresAnt.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaDatosCuentas()
|
Private Sub CargaDatosBancosCuentas()
|
||||||
Dim ObjBancos As New ClsBancos
|
Dim ObjBancos As New ClsBancos
|
||||||
LblTotalBancos.Text = "0.00"
|
LblTotalBancos.Text = "0.00"
|
||||||
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then
|
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 77, UsuarioActual.CveEmpresa) Then
|
||||||
Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy
|
Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy
|
||||||
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
|
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
|
||||||
Dim TotAcumulado As Decimal = 0
|
Dim TotAcumulado As Decimal = ObjBancos.DtResultados.SUMD("Fluctuacion")
|
||||||
Dim Conta As New ClsContabilidad
|
'Dim Conta As New ClsContabilidad
|
||||||
For Each Dr As DataRow In DtTemp.Rows
|
'For Each Dr As DataRow In DtTemp.Rows
|
||||||
Dim Total As Decimal = 0
|
' Dim Total As Decimal = 0
|
||||||
Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero
|
' Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero
|
||||||
If CveCuentaExtranjera > 0 Then
|
' If CveCuentaExtranjera > 0 Then
|
||||||
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then
|
' If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then
|
||||||
If Conta.DtResultados.Rows.Count > 1 Then
|
' If Conta.DtResultados.Rows.Count > 1 Then
|
||||||
Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
|
' Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
Dr("Saldo") = Total
|
' Dr("Saldo") = Total
|
||||||
Total = Total * TCCierreFluctuacion - Total
|
' Total = Total * TCCierreFluctuacion - Total
|
||||||
Dim SaldoActualContabilidad As Decimal = 0
|
' Dim SaldoActualContabilidad As Decimal = 0
|
||||||
Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero
|
' Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero
|
||||||
If CveCuentaComplementaria > 0 Then
|
' If CveCuentaComplementaria > 0 Then
|
||||||
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then
|
' If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then
|
||||||
If Conta.DtResultados.Rows.Count > 1 Then
|
' If Conta.DtResultados.Rows.Count > 1 Then
|
||||||
SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
|
' SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Total = Total - SaldoActualContabilidad
|
' Total = Total - SaldoActualContabilidad
|
||||||
TotAcumulado += Math.Round(Total, 2)
|
' TotAcumulado += Math.Round(Total, 2)
|
||||||
Dr("Fluctuacion") = Total
|
' Dr("Fluctuacion") = Total
|
||||||
Next
|
'Next
|
||||||
DtTemp.AcceptChanges()
|
'DtTemp.AcceptChanges()
|
||||||
Conta.Dispose()
|
'Conta.Dispose()
|
||||||
|
|
||||||
GvCuentas.DataSource = DtTemp
|
GvCuentas.DataSource = DtTemp
|
||||||
LblTotalBancos.Text = TotAcumulado.FormatoNumero
|
LblTotalBancos.Text = TotAcumulado.FormatoNumero
|
||||||
@@ -910,8 +910,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
Dim Total As Decimal = 0
|
Dim Total As Decimal = 0
|
||||||
Dim Conta As New ClsContabilidad
|
Dim Conta As New ClsContabilidad
|
||||||
Conta.IniciaTransacSQL()
|
Conta.IniciaTransacSQL()
|
||||||
Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
|
'Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
ObjContPaq.IniciaTransacSQL()
|
'ObjContPaq.IniciaTransacSQL()
|
||||||
Dim idCta As Integer = 0
|
Dim idCta As Integer = 0
|
||||||
Dim CveCuenta As Integer = 0
|
Dim CveCuenta As Integer = 0
|
||||||
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
|
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
|
||||||
@@ -937,8 +937,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
For Each gvr As GridViewRow In GvCuentas.Rows
|
For Each gvr As GridViewRow In GvCuentas.Rows
|
||||||
Dim cb As CheckBox = gvr.FCCheckBox("ChkGenerarBancos")
|
Dim cb As CheckBox = gvr.FCCheckBox("ChkGenerarBancos")
|
||||||
If cb.Checked Then
|
If cb.Checked Then
|
||||||
Total = gvr.DataKey("Fluctuacion").ToDecimal
|
Total = gvr.DataKey("Fluctuacion").ToDecimal
|
||||||
Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero
|
' Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero
|
||||||
Dim ConceptoReferencia As String = String.Format("{0} - {1} {2}", gvr.DataKey("Banco"), gvr.DataKey("NumCuenta"), MesTCtexto)
|
Dim ConceptoReferencia As String = String.Format("{0} - {1} {2}", gvr.DataKey("Banco"), gvr.DataKey("NumCuenta"), MesTCtexto)
|
||||||
|
|
||||||
'MOVIMIENTO DE FLUCTUACION
|
'MOVIMIENTO DE FLUCTUACION
|
||||||
@@ -952,15 +952,16 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
CveCuenta = CveCuentaPerdida
|
CveCuenta = CveCuentaPerdida
|
||||||
idCta = idCtaPerdida
|
idCta = idCtaPerdida
|
||||||
TipoMovto = False
|
TipoMovto = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'movimiento de complementaria
|
'movimiento de complementaria
|
||||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConconceptoBancos, ConceptoReferencia, Now, IdCtaComplementaria, 0, TipoCambio:=TC, ImporteMX:=Math.Abs(Total), ImporteME:=Math.Abs(Total)) Then
|
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConconceptoBancos, ConceptoReferencia, Now, 0, 0, TipoCambio:=TC, ImporteMX:=Math.Abs(Total), ImporteME:=Math.Abs(Total), CveCuenta:=gvr.DataKey("CveCuentaMEComplementaria").ToEntero) Then
|
||||||
ErrorRegistrar = True
|
ErrorRegistrar = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConceptoContable, ConceptoReferencia, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyectoBancos.SelectedValue.ToEntero) Then
|
|
||||||
|
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), Math.Abs(Total), CveConceptoContable, ConceptoReferencia, ConceptoReferencia, 0, CveSubProyecto:=DdlSubproyectoBancos.SelectedValue.ToEntero) Then
|
||||||
ErrorRegistrar = True
|
ErrorRegistrar = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -970,7 +971,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
|
|
||||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||||
If AutoConta Then
|
If AutoConta Then
|
||||||
If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
SeContabilizo = True
|
SeContabilizo = True
|
||||||
Else
|
Else
|
||||||
ErrorRegistrar = True
|
ErrorRegistrar = True
|
||||||
@@ -978,15 +979,15 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ErrorRegistrar And SeContabilizo Then
|
If Not ErrorRegistrar Then
|
||||||
|
|
||||||
Conta.Commit()
|
Conta.Commit()
|
||||||
ObjContPaq.Commit()
|
' ObjContPaq.Commit()
|
||||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||||
CargaDatosCuentas()
|
CargaDatosBancosCuentas()
|
||||||
Else
|
Else
|
||||||
Conta.RollBack()
|
Conta.RollBack()
|
||||||
ObjContPaq.Dispose()
|
' ObjContPaq.Dispose()
|
||||||
End If
|
End If
|
||||||
Conta.Dispose()
|
Conta.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1165,20 +1166,20 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
#Region "GRIDVIEWS"
|
#Region "GRIDVIEWS"
|
||||||
|
|
||||||
|
|
||||||
Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound
|
'Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble
|
' 'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble
|
||||||
'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString
|
' 'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString
|
||||||
'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio")
|
' 'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio")
|
||||||
'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString, "No aplica")
|
' 'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString, "No aplica")
|
||||||
|
|
||||||
If Not e.Row.DBCampo("IdCtaContable").ToString.ToEntero > 0 Then
|
' 'If Not e.Row.DBCampo("IdCtaContable").ToString.ToEntero > 0 Then
|
||||||
' e.Row.FCLabel("LabelBanco").ForeColor = Drawing.Color.Red
|
' ' ' e.Row.FCLabel("LabelBanco").ForeColor = Drawing.Color.Red
|
||||||
End If
|
' 'End If
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
End Sub
|
'End Sub
|
||||||
|
|
||||||
Private Sub GvFiliales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFiliales.RowDataBound
|
Private Sub GvFiliales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFiliales.RowDataBound
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user