This commit is contained in:
Oscar Irigoyen
2023-04-20 16:16:11 -07:00
73 changed files with 13581 additions and 13456 deletions

View File

@@ -345,7 +345,6 @@ Partial Class Bancos_DepositoTerminal
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago
importeMX = Math.Round(ImporteMovimiento * tipoCambioVenta, 2)
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
Case 62 'Ret IVA Trasladado
@@ -387,7 +386,6 @@ Partial Class Bancos_DepositoTerminal
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago
importeMX = Math.Round(ImporteMovimiento * tipoCambioManual, 2)
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVATrasladado
If tipoCambioManual > 1 Then ConceptoMovimiento += $" TC:{tipoCambioManual} ${ImporteMovimiento.FormatoNumero(2)}"
Case 38 'IEPS por trasladar
@@ -395,14 +393,10 @@ Partial Class Bancos_DepositoTerminal
ImporteMovimiento = gvr.DataKey("IEPS").ToDecimal * PorcentajePago
importeMX = Math.Round(ImporteMovimiento * tipoCambioVenta, 2)
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar
Case 39 'IEPS Trasladado
ImporteMovimiento = gvr.DataKey("IEPS").ToDecimal * PorcentajePago
importeMX = Math.Round(ImporteMovimiento * tipoCambioManual, 2)
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado
Case 78 'Otros Ingresos
If ChkAjusteOI.Checked Then
ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal

View File

@@ -540,12 +540,12 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
//IVA
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 13, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 13, Conc, DateTime.Now, 0, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de IVA";
}
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 61, Conc, DateTime.Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, -gvr.FCTextBox("TxtIVA").Text.ToDecimal(), Ref, 61, Conc, DateTime.Now,0, -1, CveIE, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: DdlCliente.SelectedValue.ToEntero(), ImporteMX: -gvr.FCTextBox("TxtIVA").Text.ToDecimal()))
{
MsgError = "No se pudo insertar concepto de IVA";
}

View File

@@ -758,8 +758,60 @@
<asp:Label ID="LblTotalBancos" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabAcreedoresDiversos" HeaderText="AcreedoresDiversos">
<ContentTemplate>
<br />
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoAcreedoresDiversos" ClientIDMode="Static" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoAcreedoresDiversos"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarAcreedoresDiversos"></asp:RequiredFieldValidator>
<label for="TxtConceptoAcreedoresDiversos">Concepto:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoAcreedoresDiversos" ClientIDMode="Static" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
</asp:DropDownList>
<label for="DdlSubProyectoAcreedoresDiversos">
<asp:Label runat="server" ID="LblSubProyectoAcreedoresDiversos"></asp:Label>
</label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoAcreedoresDiversos" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarAcreedoresDiversos"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:HiddenField ID="HdnAcreedoresDiversosCvePrePoliza" runat="server" />
<asp:HyperLink ID="HplAcreedoresDiversosPoliza" runat="server" Text="Ver Póliza" CssClass="Texto" Visible="false" />
<asp:Button ID="BtnAcreedoresDiversosRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnAcreedoresDiversosRemove_Click" class="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="Está seguro de eliminar?" data-btn-ok-label="si" />
<asp:Button Text="Generar Acreedores Diversos" runat="server" ID="BtnGeneraAcreeedoresDiversos" OnClick="BtnGeneraAcreeedoresDiversos_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarAcreedoresDiversos" />
</div>
</div>
<br />
<div style="float: right; margin-right: 50px;">
</div>
<asp:GridView ID="GvAcreedorDiversos" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="TipoCambio,Fluctuacion,RazonSocial,CveProveedor"
EmptyDataText="No se Encontraron" ToolTip=""
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Acreedor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" 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="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
<asp:Label ID="LblTotalAcreedoresDiversos" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabFilial" HeaderText="Filial">
<ajax:TabPanel runat="server" ID="TabFilial" HeaderText="Filial" Visible="false" >
<ContentTemplate>
<br />
@@ -806,17 +858,7 @@
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
<asp:GridView ID="GvAcreedorDiversos" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="TipoCambio,Fluctuacion,RazonSocial,CveProveedor"
EmptyDataText="No se Encontraron" ToolTip=""
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Acreedor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" 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="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>

View File

@@ -36,6 +36,8 @@ Partial Class Bancos_FluctuacionCambiaria
CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreeedoresAnt, Nothing, LblSubProyectoAcreedoresAnt, "")
CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreedoresDiversos, Nothing, LblSubProyectoAcreedoresDiversos, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoDeudores, Nothing, LblSubProyectoDeudores, "")
CargaUltimaFluctuacion()
@@ -66,6 +68,10 @@ Partial Class Bancos_FluctuacionCambiaria
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Private Sub CargaDatos()
CargaTipoCambio()
If T.ActiveTabIndex = 0 Then CargaDatosProveedores()
If T.ActiveTabIndex = 1 Then CargaDatosProveedoresAnticipos()
@@ -77,7 +83,7 @@ Partial Class Bancos_FluctuacionCambiaria
If T.ActiveTabIndex = 7 Then CargaDatosAcreedoresDiversos() 'CargaDatosFiliales()
If T.ActiveTabIndex = 8 Then CargaDatosDeudores()
UpTabs.Update()
UpTabs.Update()
End Sub
@@ -288,8 +294,9 @@ Partial Class Bancos_FluctuacionCambiaria
HdnAcreedorAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
BtnAcreedoresAntRemove.Visible = HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0
BtnGeneraAcreedoresAnt.Visible = Not HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
HplAcreedorAntLiga.Visible = HdnAcreedorCvePrePoliza.Value.ToEntero > 0
HplAcreedorAntLiga.Visible = HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0
HplAcreedorAntLiga.NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", ObjBancos.DtResultados.MAX("CvePrePoliza").ToString)
GvAcreedoresAnt.DataSource = ObjBancos.DtResultados
LblTotalAcreedoresAnt.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
@@ -379,9 +386,17 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosAcreedoresDiversos()
Dim ObjBancos As New ClsBancos
LblTotalAcreedores.Text = "0.00"
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 88, UsuarioActual.CveEmpresa) Then
GvAcreedorDiversos.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0")
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 88, UsuarioActual.CveEmpresa) Then
HdnAcreedoresDiversosCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
BtnAcreedoresDiversosRemove.Visible = HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero > 0
BtnGeneraAcreeedoresDiversos.Visible = Not HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero > 0
HplAcreedoresDiversosPoliza.Visible = HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero > 0
HplAcreedoresDiversosPoliza.NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", ObjBancos.DtResultados.MAX("CvePrePoliza").ToString)
GvAcreedorDiversos.DataSource = ObjBancos.DtResultados
LblTotalAcreedoresDiversos.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
GvAcreedorDiversos.DataSource = Nothing
Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia)
@@ -413,9 +428,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotal.ToDecimal
@@ -493,9 +506,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotal.ToDecimal
@@ -577,9 +588,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
@@ -674,9 +683,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
@@ -780,9 +787,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalAcreedores.Text.ToDecimal
@@ -869,9 +874,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalAcreedoresAnt.Text.ToDecimal
@@ -952,9 +955,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveCuentaPerdida = 0 ' 55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalBancos.Text.ToDecimal
@@ -1038,9 +1039,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
@@ -1102,8 +1101,8 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
ObjContPaq.IniciaTransacSQL()
'Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
'ObjContPaq.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaFilial", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoFiliales.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
@@ -1116,9 +1115,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
CveCuentaGanancia = 0 ' 55382
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
@@ -1157,9 +1154,6 @@ Partial Class Bancos_FluctuacionCambiaria
Banco.UpdateBancosTipoCambioValuacion(TCCierreFluctuacion, gvr.DataKey("CveIE").ToEntero, UsuarioActual.CveEmpresa)
End If
Next
If Not ErrorRegistrar Then
@@ -1168,28 +1162,96 @@ Partial Class Bancos_FluctuacionCambiaria
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If AutoConta Then
If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
Else
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
End If
End If
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
'Fin autoconta
End If
' If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
'Fin autoconta
Conta.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}' class='Texto'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
ObjContPaq.RollBack()
'ObjContPaq.RollBack()
End If
Conta.Dispose()
Banco.Dispose()
ObjContPaq.Dispose()
'ObjContPaq.Dispose()
End Sub
#End Region
#Region "FLUCTUACION ACREEDORES DIVEROS"
Protected Sub BtnGeneraAcreeedoresDiversos_Click(sender As Object, e As EventArgs)
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaAD", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedoresDiversos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CveConceptoContable As Integer
Dim TipoMovto As Boolean
Dim ErrorRegistrar As Boolean = False
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Dim TotalAcumulado As Decimal = 0
Dim ConceptoFluctuacion As String = String.Format("Fluctuación Acreedores Diversos {0:d} ", FechaUltimoDiaMes)
For Each gvr As GridViewRow In GvAcreedorDiversos.Rows
TotalAcumulado += gvr.DataKey("Fluctuacion").ToDecimal
Next
'TotalAcumulado = GvAcreedorDiversos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) Convert.ToDecimal(GvAcreedorDiversos.DataKeys(gvr.RowIndex)("Fluctuacion")))
If TotalAcumulado < 0 Then
CveConceptoContable = 64 : TipoMovto = True
Else
CveConceptoContable = 65 : TipoMovto = False
End If
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvAcreedorDiversos.Rows
If gvr.DataKey("Fluctuacion").ToDecimal <> 0 Then
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, gvr.DataKey("Fluctuacion").ToDecimal, ConceptoFluctuacion, 351, ConceptoFluctuacion & gvr.DataKey("RazonSocial"), Now, 0, 0, TipoCambio:=TC, ImporteMX:=gvr.DataKey("Fluctuacion").ToDecimal, ImporteME:=gvr.DataKey("Fluctuacion").ToDecimal, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveSubProyecto:=DdlSubProyectoAcreedoresDiversos.SelectedValue.ToEntero) Then
ErrorRegistrar = True
Exit For
End If
End If
Next
If Not ErrorRegistrar Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(TotalAcumulado), ConceptoFluctuacion, CveConceptoContable, ConceptoFluctuacion, Now, 0, 0, ImporteMX:=Math.Abs(TotalAcumulado), CveSubProyecto:=DdlSubProyectoAcreedoresDiversos.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
End If
If Not ErrorRegistrar Then
If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 9, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
End If
Conta.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}' class='Texto'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
'ObjContPaq.RollBack()
End If
Conta.Dispose()
Banco.Dispose()
'ObjContPaq.Dispose()
End Sub
#End Region
#Region "GRIDVIEWS"
@@ -1236,7 +1298,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorCvePrePoliza.Value.ToEntero, 1, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnProveedoresRemove.visible = False
Alert("Flucturación eliminada.")
Alert("Fluctuación eliminada.")
Else
Banco.RollBack()
End If
@@ -1251,7 +1313,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorAntCvePrePoliza.Value.ToEntero, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnProveedoresAntRemove.Visible = False
Alert("Flucturación eliminada.")
Alert("Fluctuación eliminada.")
Else
Banco.RollBack()
End If
@@ -1265,7 +1327,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteCvePrePoliza.Value.ToEntero, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnClientesRemove.Visible = False
Alert("Flucturación eliminada.")
Alert("Fluctuación eliminada.")
Else
Banco.RollBack()
End If
@@ -1279,7 +1341,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteAntCvePrePoliza.Value.ToEntero, 4, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnClientesAntRemove.Visible = False
Alert("Flucturación eliminada.")
Alert("Fluctuación eliminada.")
Else
Banco.RollBack()
End If
@@ -1293,7 +1355,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorCvePrePoliza.Value.ToEntero, 5, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnAcreedoresRemove.Visible = False
Alert("Flucturación eliminada.")
Alert("Fluctuación eliminada.")
Else
Banco.RollBack()
End If
@@ -1307,7 +1369,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorAntCvePrePoliza.Value.ToEntero, 6, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnAcreedoresAntRemove.Visible = False
Alert("Flucturación eliminada.")
Alert("Fluctuación eliminada.")
Else
Banco.RollBack()
End If
@@ -1352,4 +1414,19 @@ Partial Class Bancos_FluctuacionCambiaria
End Sub
#End Region
Protected Sub BtnAcreedoresDiversosRemove_Click(sender As Object, e As EventArgs)
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedoresDiversosCvePrePoliza.Value.ToEntero, 9, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnAcreedoresDiversosRemove.Visible = False
CargaDatos()
Alert("Fluctuación eliminada.")
Else
Banco.RollBack()
End If
Banco.Dispose()
End Sub
End Class

View File

@@ -265,6 +265,7 @@
<asp:ListItem Value="C">Clientes</asp:ListItem>
<asp:ListItem Value="P">Proveedor</asp:ListItem>
<asp:ListItem Value="FE">Viáticos</asp:ListItem>
<asp:ListItem Value="AC">Acreedor</asp:ListItem>
</asp:RadioButtonList>
<asp:HiddenField ID="HdnCveCliente" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" />

View File

@@ -2818,7 +2818,7 @@ Partial Class Bancos_IE
If TxtIvaIxC.Text.ToDouble > 0 Then
Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2)
'Iva
ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=If(PorcentajeIVA.ToString().Contiene("0.08", "0.16"), PorcentajeIVA, 0))
ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, 0, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=If(PorcentajeIVA.ToString().Contiene("0.08", "0.16"), PorcentajeIVA, 0))
End If
'Bancos
@@ -2935,7 +2935,7 @@ Partial Class Bancos_IE
Dim CveConIVA As Integer = 61
If UsuarioActual.CveEmpresa = 70 Then CveConIVA = 299
Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2)
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, CveConIVA, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=PorcentajeIVA) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, CveConIVA, Concepto, FechaMovimiento, 0, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
End If
@@ -3244,14 +3244,14 @@ Partial Class Bancos_IE
If DiferenciaTC < 0 Then
'64
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
MsgError = "Ocurrió un error al registrar el asiento de ganancia cambiaria"
Exit Select
End If
Else
'65
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
MsgError = "Ocurrió un error al registrar el asiento de perdidada cfambiaria"
Exit Select
End If
@@ -3282,9 +3282,9 @@ Partial Class Bancos_IE
Dim IEPSDev As Decimal = dr("IEPS").ToString.ToDecimal
PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal
Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC)
Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
'Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC)
'Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
'Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
Dim IVADevMN As Decimal = 0
Dim IEPSDevMN As Decimal = 0
Dim PorcentajeDevolucion As Decimal = ((ImporteAplicar * 100D / TotalCompraDev) / 100).RoundSQL(2)
@@ -3305,11 +3305,11 @@ Partial Class Bancos_IE
If IVADev > 0 Then
IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC
' IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then
IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC
' IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
@@ -3453,14 +3453,14 @@ Partial Class Bancos_IE
If DiferenciaTC < 0 Then
'64
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
MsgError = "Ocurrió un error al registrar el asiento de ganancia cambiaria"
Exit Select
End If
Else
'65
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, 0, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, TipoCambio:=TCCompra) Then
MsgError = "Ocurrió un error al registrar el asiento de perdidada cfambiaria"
Exit Select
End If
@@ -3489,17 +3489,17 @@ Partial Class Bancos_IE
Dim IEPSDev As Decimal = dr("IEPS").ToString.ToDecimal
PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal
Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC)
'Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC)
Dim IdCtaIVAXAcreditarDevDinC As Integer
Dim IdCtaIVAAcreditableDevDinC As Integer
If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then
IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
Else
MsgError = "Sin Registros de porcentaje impuesto"
End If
'If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then
' IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
'Else
' MsgError = "Sin Registros de porcentaje impuesto"
'End If
Dim IVADevMN As Decimal = 0
Dim IEPSDevMN As Decimal = 0

View File

@@ -409,13 +409,11 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
if (TCPago > TC)
{
CveConceptoDiferenciaCambiaria = 65;
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria;
TipoMovto = false;
}
else if (TCPago < TC)
{
CveConceptoDiferenciaCambiaria = 64;
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria;
TipoMovto = true;
}
Importe = ((Importe * TCPago) - (Importe * TC)).Abs();

View File

@@ -780,16 +780,13 @@ public partial class Bancos_PagoDeudor : ClsPaginas
if (TC < TCDoc)
{
CveConceptoDiferenciaCambiaria = 65;
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria;
TipoMovto = false;
Importe = (Importe * gvr.DataKey("TipoCambio").ToDecimal()) - (Importe * TC);
}
else if (TC > TCDoc)
{
CveConceptoDiferenciaCambiaria = 64;
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria;
TipoMovto = true;
Importe = (Importe * TC) - (Importe * gvr.DataKey("TipoCambio").ToDecimal());
}
ImporteMN = Importe;

View File

@@ -108,7 +108,7 @@ Partial Class Bancos_PolizaCheque
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
Dim dt As DataTable = Nothing
If UsuarioActual.Empresa.UsaContabilidad Then
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
If Conta.GetCuentas(-1, "-1", 1) Then
@@ -118,6 +118,17 @@ Partial Class Bancos_PolizaCheque
End If
Conta.Dispose()
End If
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Dim Conta As New ClsContabilidad
If Conta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
dt = Conta.DtResultados
DtCuentasContables = Conta.DtResultados
Session("DtCuentas") = Conta.DtResultados
End If
Conta.Dispose()
End If
TipoPlantilla = 0
@@ -405,9 +416,8 @@ Partial Class Bancos_PolizaCheque
NombreCuenta = ""
If UsuarioActual.Empresa.UsaContabilidad Then
If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString))
If UsuarioActual.Empresa.TipoContabilidad = 1 AndAlso drt("CveCuenta").ToString.ToEntero > 0 Then
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", drt("CveCuenta").ToString))
If drr IsNot Nothing Then
IdCuenta = drt("IdCtaContable").ToString.ToEntero
@@ -416,41 +426,43 @@ Partial Class Bancos_PolizaCheque
'Cuenta = drr("Nombre").ToString()
End If
EsComodin = 0
End If
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString))
ElseIf drt("CveConcepto").ToString = "30" Then
'saco la clave de la cuenta bancaria seleccionada
If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero)))
If drr IsNot Nothing Then
IdCuenta = drr("Id").ToString.ToEntero
IdCuenta = drt("IdCtaContable").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString()
' Cuenta = drr("Nombre").ToString()
EsComodin = 1
Else
' Rad.Checked = False
If UsuarioActual.CveEmpresa <> 126 Then
Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia)
GvMov.DataBind()
UPMovs.Update()
Exit Sub
End If
'Cuenta = drr("Nombre").ToString()
End If
EsComodin = 0
ElseIf drt("CveConcepto").ToString = "30" Then
'saco la clave de la cuenta bancaria seleccionada
If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero)))
If drr IsNot Nothing Then
IdCuenta = drr("Id").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString()
' Cuenta = drr("Nombre").ToString()
EsComodin = 1
End If
End If
ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia))
IdCuenta = IdCtaFondoGarantia
CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
EsComodin = 0
End If
ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia))
IdCuenta = IdCtaFondoGarantia
CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
EsComodin = 0
End If
End If

View File

@@ -1122,7 +1122,7 @@ Partial Class Bancos_PopIEVentas
trCuentaDeposito.Visible = False
Dim Dep As New ClsGenerales
If Dep.GetCuentasDepositos(CveCliente:=CveCliente) Then
If Dep.GetCuentasDepositos(CveCliente:=CveCliente, CveEmpresa:=UsuarioActual.CveEmpresa) Then
If DdlTipoTransaccion.SelectedValue = "9" Then
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'")
@@ -1905,13 +1905,6 @@ Partial Class Bancos_PopIEVentas
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVAXTrasladar As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
Case 61 'Iva Trasladado
If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then
@@ -1937,13 +1930,7 @@ Partial Class Bancos_PopIEVentas
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVATrasladado As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
Case 38 'IEPS por trasladar
If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then
@@ -2078,7 +2065,6 @@ Partial Class Bancos_PopIEVentas
Case 64 'Ganancia
If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
Dim tImporteVenta, tImportePago, Diferencia As Decimal
ImporteMovimiento = 0
@@ -2100,11 +2086,9 @@ Partial Class Bancos_PopIEVentas
If tImporteVenta <> tImportePago Then
If tImporteVenta < tImportePago Then
ConceptoContable = 64
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
TipoMovimiento = True
Else
ConceptoContable = 65
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
TipoMovimiento = False
End If
Diferencia = Math.Abs(tImporteVenta - tImportePago)

View File

@@ -115,18 +115,18 @@
</div>
<div class="col-md-4" id="DivMovtoPermanente" runat="server" visible="false">
<div class="row">
<div class="col-md-3">
<div class="col-md-4 control-label">
<asp:Label runat="server" Text="Concep. Nom:"></asp:Label>
</div>
<div class="col-md-9">
<div class="col-md-8">
<asp:DropDownList ID="DdlConcepto" runat="server" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="col-md-4 control-label">
<asp:Label runat="server" Text="Tipo Desc.:"></asp:Label>
</div>
<div class="col-md-9">
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoDescto" runat="server" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardarPrestamo">
<asp:ListItem Value="-1" Text="Seleccione" Enabled="true"></asp:ListItem>
<%-- <asp:ListItem Value="1" Text="Importe"></asp:ListItem>
@@ -137,18 +137,18 @@
</div>
</div>
<div class="row" id="DivImportePrestamo" runat="server" visible="false">
<div class="col-md-3">
<div class="col-md-4 control-label">
<asp:Label runat="server" Text="Importe prestamo:"></asp:Label>
</div>
<div class="col-md-9">
<div class="col-md-8">
<asp:Label runat="server" Text="" ID="LblPrestamo" ClientIDMode="Static"></asp:Label>
</div>
</div>
<div class="row" id="DivValor" runat="server">
<div class="col-md-3">
<div class="col-md-4 control-label">
<asp:Label runat="server" Text="Valor:"></asp:Label>
</div>
<div class="col-md-9">
<div class="col-md-8">
<asp:TextBox ID="TxtValor" CssClass="form-control input-sm" runat="server" Style="text-align: right;" onkeyup="FormatoMoneda(this)" AutoComplete="off"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTVValor" runat="server" TargetControlID="TxtValor" FilterType="Custom, Numbers" ValidChars="+-.," />
<asp:RequiredFieldValidator ID="RfvMontoLimite" runat="server" Display="None" ControlToValidate="TxtValor" CssClass="help-block errorimput"

View File

@@ -1877,10 +1877,10 @@ Partial Class Bancos_ProveedoresAbonar
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
'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
Dim IVA As Decimal = PorcentajePago * gr.DataKey("IVA").ToDecimal
@@ -1930,11 +1930,11 @@ Partial Class Bancos_ProveedoresAbonar
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, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) 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, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If