Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -416,13 +416,19 @@
|
||||
comisionNegativa = txtcomision * -1;
|
||||
}
|
||||
if (comisionNegativa > saldo) {
|
||||
$('#C_TxtComision').val(0);
|
||||
comision = 0;
|
||||
descuento = 0;
|
||||
txtcomision = 0;
|
||||
alert("No es posible poner un importe Faltante/Sobrante superior a lo seleccionado");
|
||||
saldo = 0;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
|
||||
|
||||
//var opcion = confirm("El importe especificado es superior a lo seleccionado, está seguro?");
|
||||
//if (opcion != true) {
|
||||
// debugger;
|
||||
// $('#C_TxtComision').val(0);
|
||||
// comision = 0;
|
||||
// descuento = 0;
|
||||
// txtcomision = 0;
|
||||
// //alert("No es posible poner un importe Faltante/Sobrante superior a lo seleccionado");
|
||||
// saldo = 0;
|
||||
// $('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
|
||||
//}
|
||||
|
||||
} else {
|
||||
|
||||
//debugger;
|
||||
@@ -509,14 +515,18 @@
|
||||
if (comision2 < 0) {
|
||||
comisionNegativa = comision2 * -1;
|
||||
}
|
||||
if (comisionNegativa > ValorTotalSeleccionado) {
|
||||
$('#C_TxtComision').val(0)
|
||||
alert("No es posible poner una comision superior a lo seleccionado")
|
||||
} else {
|
||||
//if (comisionNegativa > ValorTotalSeleccionado) {
|
||||
// var opcion = confirm("El importe especificado es superior a lo seleccionado, está seguro?");
|
||||
// if (opcion != true) {
|
||||
// debugger;
|
||||
// $('#C_TxtComision').val(0)
|
||||
// // alert("No es posible poner una comision superior a lo seleccionado")
|
||||
// }
|
||||
//} else {
|
||||
saldo = ValorTotalSeleccionado + comision2 + descuento - IVA - ComisionIntermediario;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
comision = ToDouble($('#C_TxtComision').val())
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -236,17 +236,21 @@ Partial Class Bancos_DepositosCaja
|
||||
End If
|
||||
|
||||
End If
|
||||
Dim CveTransaccionBanco As Integer = 13
|
||||
|
||||
If TotalImporte < 0 Then 'que es una devolución, entonces como es negativo, se cambia el concetpo de bancos, por condición de trigger
|
||||
CveTransaccionBanco = 6
|
||||
End If
|
||||
|
||||
'Entrada a bancos
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 13)
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 13, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
|
||||
|
||||
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a>     <br/> ", CveIEOrigen, FolioIE)
|
||||
|
||||
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
|
||||
|
||||
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a>     <br/> ", CveIEOrigen, FolioIE)
|
||||
|
||||
If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio) Then
|
||||
|
||||
If ChkFaltante.Checked Then
|
||||
@@ -256,9 +260,7 @@ Partial Class Bancos_DepositosCaja
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Comision, DdlClasificacion.SelectedItem.Text, 51, DdlClasificacion.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionComision, CveSubProyecto:=CveSubProyectoComision, ImporteMX:=Comision * TipoCambio) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If ChkDescuento.Checked Then
|
||||
@@ -268,68 +270,64 @@ Partial Class Bancos_DepositosCaja
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text & " " & DdlPersonal.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyectoDescuento, ImporteMX:=Descuento * TipoCambio, CvePersonal:=DdlPersonal.SelectedValue.ToEntero) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
||||
'Datos de las Nuevas PrePolizas
|
||||
'Entrada a Bancos
|
||||
|
||||
Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
|
||||
Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
|
||||
|
||||
'Datos de las Prepolizas A Cancelar
|
||||
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
||||
Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
|
||||
Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero
|
||||
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'Asignamos la cuenta Deposito
|
||||
If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
If Not OcurrioError Then
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
||||
'Datos de las Nuevas PrePolizas
|
||||
'Entrada a Bancos
|
||||
|
||||
Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
|
||||
Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
|
||||
|
||||
'Datos de las Prepolizas A Cancelar
|
||||
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
||||
Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
|
||||
Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero
|
||||
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'Asignamos la cuenta Deposito
|
||||
If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
||||
|
||||
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
||||
documentos += String.Format("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
|
||||
|
||||
End If
|
||||
|
||||
documentos += String.Format("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
|
||||
|
||||
If OcurrioError Then
|
||||
ObjContabilidad.RollBack()
|
||||
Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjContabilidad.Commit()
|
||||
CargaDatos()
|
||||
|
||||
ObjContabilidad.Commit()
|
||||
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Prepóliza</a> <br/><br/> ", NuevaCvePrePoliza)
|
||||
|
||||
Alert(documentos.ToString)
|
||||
|
||||
Alert(documentos.ToString)
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
TxtComision.Text = ""
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
</div>
|
||||
<div style="float: right; margin-right: 10px;">
|
||||
<asp:Label runat="server" ID="LtlUltimaFluctuacion" Font-Italic="True"></asp:Label>
|
||||
<asp:HiddenField ID="HdnCveFluctuacionBitacora" runat="server" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -159,7 +160,7 @@
|
||||
<asp:UpdatePanel ID="UpTabs" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<ajax:TabContainer runat="server" ID="T">
|
||||
<ajax:TabPanel runat="server" ID="TabCompras" HeaderText="Compras">
|
||||
<ajax:TabPanel runat="server" ID="TabCompras" HeaderText="Proveedores">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpIndicadores" UpdateMode="Conditional" runat="server" Visible="False">
|
||||
<ContentTemplate>
|
||||
@@ -222,8 +223,7 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-5 form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtConceptoCompras" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control marginFixRow" Width="96%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtConceptoCompras" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoCompras"
|
||||
@@ -232,7 +232,7 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 form-group form-md-line-input input-iconright">
|
||||
<div class="col-md-2 form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubProyectoCompras" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSubProyectoCompras.ClientID.ToString()%>">
|
||||
@@ -241,33 +241,32 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" style="text-align: right!important">
|
||||
<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" />
|
||||
</div>
|
||||
<asp:HiddenField ID="HdnProveedorCvePrePoliza" runat="server" />
|
||||
<asp:Button ID="BtnProveedoresRemove" runat="server" Text="Eliminar" OnClick="BtnProveedoresRemove_Click" class="btn btn-primary" /></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
<asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio,FluctuacionTotal,PerdidaGanancia,IdCtaContComplementaria"
|
||||
DataKeyNames="CveCompra,CveProveedor,TipoCambio, Fluctuacion,SerieFolio, CveConceptoContable,FluctuacionTotal,PerdidaGanancia,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="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="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" />
|
||||
<asp:BoundField HeaderText="Perdida o Ganancia" DataField="PerdidaGanancia" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Perdida o Ganancia" DataField="PerdidaGanancia" ItemStyle-Width="100" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<%--<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>--%>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Ventas">
|
||||
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Clientes">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpIndicadoresVentas" UpdateMode="Conditional" runat="server" Visible="false">
|
||||
<ContentTemplate>
|
||||
@@ -308,6 +307,7 @@
|
||||
<div class="widget-thumb text-uppercase bordered">
|
||||
<h4 class="widget-thumb-heading">
|
||||
<asp:Label ID="LblVentasPerdidaGanancia" runat="server" Text=""></asp:Label></h4>
|
||||
|
||||
<div class="widget-thumb-wrap">
|
||||
<i id="IImagenFinalVentas" runat="server" class=""></i>
|
||||
<div class="widget-thumb-body">
|
||||
@@ -322,7 +322,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -339,7 +339,7 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 form-group form-md-line-input input-iconright">
|
||||
<div class="col-md-2 form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlsubProyectoVentas" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlsubProyectoVentas.ClientID.ToString()%>">
|
||||
@@ -353,7 +353,7 @@
|
||||
|
||||
<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" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -362,12 +362,13 @@
|
||||
|
||||
|
||||
<asp:GridView ID="GvVentas" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="TipoCambio,Fluctuacion,CveVenta,SerieFolio,CveIE,IdCtaContComplementaria" EmptyDataText="No se Encontraron Cuentas Bancarias."
|
||||
DataKeyNames="TipoCambio,Fluctuacion,CveVenta,SerieFolio,CveIE,IdCtaContComplementaria,TipoDocto,CveIE" 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" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataNavigateUrlFields="CveCliente" />
|
||||
<asp:BoundField DataField="SerieFolio" HeaderText="SerieFolio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:HyperLinkField DataTextField="Nombre" HeaderText="Cliente" Target="_blank" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataNavigateUrlFields="CveCliente" />
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" HeaderText="SerieFolio" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
|
||||
<asp:BoundField DataField="Fecha" HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="TipoDocto" HeaderText="Tipo" />
|
||||
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Diferencia" HeaderText="Diferencia TC" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N4}" />
|
||||
@@ -393,7 +394,7 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 form-group form-md-line-input input-iconright">
|
||||
<div class="col-md-2 form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubproyectoBancos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSubproyectoBancos.ClientID.ToString()%>">
|
||||
@@ -453,7 +454,7 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 form-group form-md-line-input input-iconright">
|
||||
<div class="col-md-2 form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubProyectoDeudores" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSubProyectoDeudores.ClientID.ToString()%>">
|
||||
@@ -504,7 +505,7 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 form-group form-md-line-input input-iconright">
|
||||
<div class="col-md-2 form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubProyectoAcreedores" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSubProyectoAcreedores.ClientID.ToString()%>">
|
||||
@@ -512,10 +513,7 @@
|
||||
</label>
|
||||
<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>
|
||||
<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>
|
||||
@@ -524,7 +522,7 @@
|
||||
|
||||
|
||||
<asp:GridView ID="GvAcreedores" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio"
|
||||
DataKeyNames="CveCompra,CveProveedor,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>
|
||||
@@ -553,7 +551,7 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 form-group form-md-line-input input-iconright">
|
||||
<div class="col-md-2 form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubProyectoFiliales" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSubProyectoFiliales.ClientID.ToString()%>">
|
||||
|
||||
@@ -131,7 +131,11 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
|
||||
|
||||
Dim Final As Double = GanaciaAux - PerdidaAux
|
||||
|
||||
HdnProveedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
|
||||
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
|
||||
BtnProveedoresRemove.Visible = HdnProveedorCvePrePoliza.Value.ToEntero > 0
|
||||
BtnGeneraCompras.Visible = Not HdnProveedorCvePrePoliza.Value.ToEntero > 0
|
||||
|
||||
IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
|
||||
|
||||
LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero
|
||||
@@ -280,8 +284,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Protected Sub BtnGeneraCompras_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
Dim Conta As New ClsContabilidad
|
||||
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
|
||||
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoCompras.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim idCta As Integer = 0
|
||||
@@ -316,32 +320,40 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
For Each gvr As GridViewRow In GvCompras.Rows
|
||||
Total = gvr.DataKey("Fluctuacion").ToDecimal
|
||||
'si es pérdida o ganancia
|
||||
|
||||
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CveBitacora <= 0 Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
For Each gvr As GridViewRow In GvCompras.Rows
|
||||
Total = gvr.DataKey("Fluctuacion").ToDecimal
|
||||
'si es pérdida o ganancia
|
||||
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero()
|
||||
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, 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.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 1, CveBitacora, UsuarioActual.CveEmpresa)
|
||||
|
||||
End If
|
||||
|
||||
If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
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()
|
||||
End If
|
||||
@@ -393,13 +405,18 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
End If
|
||||
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
|
||||
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CveBitacora <= 0 Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
Dim CveConconceptoCliente As Integer = 203
|
||||
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
@@ -408,24 +425,30 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
|
||||
|
||||
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
|
||||
If (gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0) OrElse (gvr.DataKey("CveVenta").ToEntero > 0 AndAlso gvr.DataKey("TipoDocto") = "Ant") Then
|
||||
CveConconceptoCliente = 226
|
||||
Else
|
||||
CveConconceptoCliente = 203
|
||||
End If
|
||||
|
||||
If Not Conta.UpdateVentaTCValuacion(gvr.DataKey("CveVenta").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
|
||||
If Not Conta.UpdateTCValuacion(gvr.DataKey("CveVenta").ToEntero, -1, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
@@ -705,7 +728,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
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
|
||||
@@ -735,24 +758,40 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
CveCuenta = CveCuentaPerdida
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
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
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
End If
|
||||
|
||||
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CveBitacora <= 0 Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
For Each gvr As GridViewRow In GvAcreedores.Rows
|
||||
Total = gvr.DataKey("Fluctuacion").ToDecimal
|
||||
'si es pérdida o ganancia
|
||||
|
||||
'si es pérdida o ganancia
|
||||
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
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
|
||||
' ErrorRegistrar = True
|
||||
' Exit For
|
||||
'End If
|
||||
|
||||
Next
|
||||
|
||||
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 5, CveBitacora, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
@@ -761,160 +800,11 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Conta.RollBack()
|
||||
End If
|
||||
Conta.Dispose()
|
||||
Banco.Dispose()
|
||||
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
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "GRIDVIEWS"
|
||||
|
||||
Protected Sub GvCompras_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompras.RowDataBound
|
||||
@@ -981,4 +871,17 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub BtnProveedoresRemove_Click(sender As Object, e As EventArgs)
|
||||
Dim Banco As New ClsBancos
|
||||
Banco.IniciaTransacSQL()
|
||||
|
||||
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorCvePrePoliza.Value.ToEntero, 1, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Banco.Commit()
|
||||
Alert("Flucturación eliminada.")
|
||||
Else
|
||||
Banco.RollBack()
|
||||
End If
|
||||
Banco.Dispose()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -4606,7 +4606,7 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
|
||||
|
||||
If Not ErrorCancelarComplemento Then
|
||||
If CveMotivoCancelacion > 0 AndAlso CveSATMotivoCancelacion > 0 Then
|
||||
|
||||
Dim ObjCancelacion As New Timbrado
|
||||
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||
@@ -4621,7 +4621,7 @@ Partial Class Bancos_IE
|
||||
Else
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
|
||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
CargaComplementosPago()
|
||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||
ErrorCancelarComplemento = False
|
||||
|
||||
Reference in New Issue
Block a user