-- mejoras en fluctuaciones
-- candado de no eliminar en regprepolizas, si tiene fluctuación
This commit is contained in:
@@ -6599,26 +6599,6 @@ Public Class ClsContabilidad
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateCompraTCValuacion(CveCompra As Integer, TCValuacion As Decimal) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Conta_ComprasTCValuacionUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||
.Add("@TCValuacion", SqlDbType.Decimal).Value = TCValuacion
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "IDisposable Support"
|
||||
|
||||
@@ -242,9 +242,9 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarCompras" />
|
||||
<asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" Visible="false" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarCompras" />
|
||||
<asp:HiddenField ID="HdnProveedorCvePrePoliza" runat="server" />
|
||||
<asp:Button ID="BtnProveedoresRemove" runat="server" Text="Eliminar" OnClick="BtnProveedoresRemove_Click" class="btn btn-primary" /></div>
|
||||
<asp:Button ID="BtnProveedoresRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnProveedoresRemove_Click" class="btn btn-primary" /></div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
|
||||
<asp:HyperLinkField HeaderText="# Facturas" DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" DataNavigateUrlFields="CveCompra"/>
|
||||
<asp:BoundField DataField="TipoDocto" HeaderText="Tipo" />
|
||||
<asp:BoundField DataField="TipoDocto" HeaderText="Tipo" />
|
||||
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="FluctuacionTotal" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||
@@ -335,7 +335,7 @@
|
||||
<asp:TextBox ID="TxtConceptoVentas" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtConceptoVentas" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoVentas"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarVentas"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtConceptoCompras.ClientID.ToString()%>">Concepto:</label>
|
||||
<label for="<%= TxtConceptoVentas.ClientID.ToString()%>">Concepto:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
@@ -347,22 +347,19 @@
|
||||
</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlsubProyectoVentas" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlsubProyectoVentas" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarVentas"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Clientes" runat="server" ID="BtnGeneraVentas" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarVentas" />
|
||||
<asp:Button Text="Generar Ventas" runat="server" ID="BtnGeneraVentas" Visible="false" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarVentas" />
|
||||
<asp:HiddenField ID="HdnClienteCvePrePoliza" runat="server" />
|
||||
<asp:Button ID="BtnClientesRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnClientesRemove_Click" class="btn btn-primary" /></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<asp:GridView ID="GvVentas" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="TipoCambio,Fluctuacion,CveVenta,SerieFolio,CveIE,IdCtaContComplementaria,TipoDocto,CveIE" EmptyDataText="No se Encontraron Cuentas Bancarias."
|
||||
DataKeyNames="TipoCambio,Fluctuacion,CveVenta,SerieFolio,CveIE,IdCtaContComplementaria,TipoDocto" EmptyDataText="No se Encontraron Cuentas Bancarias."
|
||||
ToolTip="Listado de Cuentas Bancarias" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="Nombre" HeaderText="Cliente" Target="_blank" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataNavigateUrlFields="CveCliente" />
|
||||
@@ -380,11 +377,9 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" ID="TabCuentasBancarias" HeaderText="Cuentas Bancarias">
|
||||
<ContentTemplate>
|
||||
|
||||
<ContentTemplate>
|
||||
<br />
|
||||
<div class="row">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-5 form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtConceptoBancos" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
|
||||
@@ -402,17 +397,12 @@
|
||||
</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubproyectoBancos" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubproyectoBancos" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarBancos"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Bancos" runat="server" ID="BtnGeneraBancos" OnClick="BtnGeneraBancos_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarBancos" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<asp:GridView ID="GvCuentas" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
@@ -438,12 +428,7 @@
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" ID="TabDeudores" HeaderText="Deudores">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-5 form-group form-md-line-input input-iconright">
|
||||
@@ -462,8 +447,7 @@
|
||||
</label>
|
||||
<asp:RequiredFieldValidator ID="RFVRFVDdlSubProyectoDeudores" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoDeudores" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarDeudores"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Deudores" runat="server" ID="BtnGeneraDedudores" OnClick="BtnGeneraDedudores_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarDeudores" />
|
||||
@@ -514,20 +498,23 @@
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoAcreedores" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoAcreedores" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarAcreedores"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Acreedores" runat="server" ID="BtnGeneraAcreedores" OnClick="BtnGeneraAcreedores_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarAcreedores" />
|
||||
<div class="col-md-3" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Acreedores" runat="server" ID="BtnGeneraAcreedores" Visible="false" OnClick="BtnGeneraAcreedores_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarAcreedores" />
|
||||
<asp:HiddenField ID="HdnAcreedorCvePrePoliza" runat="server" />
|
||||
<asp:Button ID="BtnAcreedoresRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnAcreedoresRemove_Click" class="btn btn-primary" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<asp:GridView ID="GvAcreedores" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio,IdCtaContComplementaria,CveIE"
|
||||
DataKeyNames="CveCompra,CveProveedor,TipoCambio,Fluctuacion,SerieFolio,IdCtaContComplementaria,CveIE"
|
||||
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
|
||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
|
||||
<asp:BoundField HeaderText="# Facturas" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:HyperLinkField HeaderText="# Facturas" DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" DataNavigateUrlFields="CveCompra"/>
|
||||
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||
@@ -535,6 +522,7 @@
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:Label ID="LblTotalAcreedores" runat="server" Text=""></asp:Label>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" ID="TabFilial" HeaderText="Filial">
|
||||
@@ -559,20 +547,17 @@
|
||||
</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoFiliales" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoFiliales" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarFiliales"></asp:RequiredFieldValidator>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<asp:Button Text="Generar Filiales" runat="server" ID="BtnGeneraFiliales" OnClick="BtnGeneraFiliales_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarFiliales" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<div style="float: right; margin-right: 50px;">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<asp:GridView ID="GvFiliales" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE,Folio"
|
||||
|
||||
@@ -168,7 +168,11 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs
|
||||
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0")
|
||||
|
||||
Dim Final As Double = GanaciaAux - PerdidaAux
|
||||
Dim Final As Double = GanaciaAux - PerdidaAux
|
||||
HdnClienteCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
|
||||
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
|
||||
BtnClientesRemove.Visible = HdnClienteCvePrePoliza.Value.ToEntero > 0
|
||||
BtnGeneraVentas.Visible = Not HdnClienteCvePrePoliza.Value.ToEntero > 0
|
||||
|
||||
IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
|
||||
|
||||
@@ -255,6 +259,11 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 6, UsuarioActual.CveEmpresa) Then
|
||||
GvAcreedores.DataSource = ObjBancos.DtResultados
|
||||
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
|
||||
HdnAcreedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
|
||||
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
|
||||
BtnAcreedoresRemove.Visible = HdnAcreedorCvePrePoliza.Value.ToEntero > 0
|
||||
BtnGeneraAcreedores.Visible = Not HdnAcreedorCvePrePoliza.Value.ToEntero > 0
|
||||
|
||||
Else
|
||||
GvAcreedores.DataSource = Nothing
|
||||
Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia)
|
||||
@@ -344,7 +353,6 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 1, CveBitacora, UsuarioActual.CveEmpresa)
|
||||
@@ -353,9 +361,11 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
BtnGeneraCompras.Visible = False
|
||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Conta.RollBack()
|
||||
Conta.RollBack()
|
||||
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
|
||||
End If
|
||||
Conta.Dispose()
|
||||
End Sub
|
||||
@@ -448,13 +458,14 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
BtnGeneraVentas.Visible = False
|
||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
|
||||
Else
|
||||
Conta.RollBack()
|
||||
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
|
||||
End If
|
||||
Conta.Dispose()
|
||||
End Sub
|
||||
@@ -731,7 +742,6 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
|
||||
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim idCta As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
|
||||
Dim idCtaPerdida, IdCtaGanancia As Integer
|
||||
Dim TipoMovto As Boolean = False
|
||||
@@ -750,23 +760,21 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Total = LblTotalAcreedores.Text.ToDecimal
|
||||
If Total > 0 Then
|
||||
CveConceptoContable = 64
|
||||
CveCuenta = CveCuentaGanancia
|
||||
idCta = IdCtaGanancia
|
||||
TipoMovto = True
|
||||
Else
|
||||
CveConceptoContable = 65
|
||||
CveCuenta = CveCuentaPerdida
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
|
||||
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyectoAcreedores.SelectedValue.ToEntero) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoAcreedores.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 6, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CveBitacora <= 0 Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
@@ -778,26 +786,26 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
|
||||
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
' ErrorRegistrar = True
|
||||
' Exit For
|
||||
'End If
|
||||
|
||||
If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 5, CveBitacora, UsuarioActual.CveEmpresa)
|
||||
|
||||
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 6, CveBitacora, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
BtnGeneraAcreedores.Visible = False
|
||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Conta.RollBack()
|
||||
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
|
||||
End If
|
||||
Conta.Dispose()
|
||||
Banco.Dispose()
|
||||
@@ -884,4 +892,30 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Banco.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnClientesRemove_Click(sender As Object, e As EventArgs)
|
||||
Dim Banco As New ClsBancos
|
||||
Banco.IniciaTransacSQL()
|
||||
|
||||
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteCvePrePoliza.Value.ToEntero, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Banco.Commit()
|
||||
Alert("Flucturación eliminada.")
|
||||
Else
|
||||
Banco.RollBack()
|
||||
End If
|
||||
Banco.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAcreedoresRemove_Click(sender As Object, e As EventArgs)
|
||||
Dim Banco As New ClsBancos
|
||||
Banco.IniciaTransacSQL()
|
||||
|
||||
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorCvePrePoliza.Value.ToEntero, 6, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Banco.Commit()
|
||||
Alert("Flucturación eliminada.")
|
||||
Else
|
||||
Banco.RollBack()
|
||||
End If
|
||||
Banco.Dispose()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -474,6 +474,12 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
CargaCuentasContables()
|
||||
End If
|
||||
|
||||
If dr("Modulo").ToString.Contiene("Banc/FluctuaA", "Banc/FluctuaC", "Banc/FluctuaV", "Banc/FluctuaFilial") Then
|
||||
|
||||
BtnEliminar.Enabled = False
|
||||
BtnEliminar.ToolTip = "No se puede eliminar al prepóliza, eliminarlos desde el módulo"
|
||||
End If
|
||||
|
||||
ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza)
|
||||
|
||||
DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
||||
@@ -2114,7 +2120,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
Dim NombreArchivo As String
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim workbook As New ExcelFile()
|
||||
Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString())
|
||||
Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.Substring(1, 30))
|
||||
|
||||
Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero()
|
||||
Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden")
|
||||
|
||||
@@ -594,7 +594,6 @@
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="TxtRef" runat="server" Text='<%# Eval("Referencia") %>'></asp:Literal><br />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" Width="280px" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
@@ -602,7 +601,6 @@
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="TxtConcepto" runat="server" Text='<%# Eval("Concepto") %>'></asp:Literal><br />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" Width="400px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
@@ -635,9 +633,8 @@
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>TC</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTC" runat="server" Text='<%# String.Format("{0}-${1}", Eval("TC"), Eval("ImporteME", "{0:N2}")) %>'></asp:Literal><br />
|
||||
<asp:Literal ID="LtlTC" runat="server" Text='<%# String.Format("{0}-${1}", Eval("TC", "{0:#.####}"), Eval("ImporteME", "{0:N2}")) %>'></asp:Literal><br />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" Width="300px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Cargo</HeaderTemplate>
|
||||
@@ -666,14 +663,14 @@
|
||||
<asp:LinkButton ID="LnkGvPrePolizaEliminar" OnClick="LnkGvPrePolizaEliminar_Click" runat="server" AlternateText="Eliminar" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" Width="80px" />
|
||||
<ItemStyle Width="120px" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField >
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkModificado" Checked="false" Visible="false"/>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" Width="0px" />
|
||||
<ItemStyle HorizontalAlign="Right" Width="5px" />
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
|
||||
@@ -495,6 +495,12 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza)
|
||||
DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
||||
|
||||
If dr("Modulo").ToString.Contiene("Banc/FluctuaA", "Banc/FluctuaC", "Banc/FluctuaV", "Banc/FluctuaFilial") Then
|
||||
|
||||
BtnEliminar.Enabled = False
|
||||
BtnEliminar.ToolTip = "No se puede eliminar al prepóliza, eliminarlos desde el módulo"
|
||||
End If
|
||||
|
||||
|
||||
'DtMovimientos.DefaultView.Sort = "OrdenPP"
|
||||
'DtMovimientos = DtMovimientos.DefaultView.ToTable
|
||||
|
||||
Reference in New Issue
Block a user