Cambio para poder agregar comison
This commit is contained in:
@@ -87,11 +87,16 @@
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate" style="width: 100px;">SubProyecto:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyectos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyectos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me" ValidationGroup="">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 truncate" style="width: 100px;">Clasificación:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClasificacion" AutoPostBack="false" CssClass=" form-control input-sm select2me" runat="server" Width="50%" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,15 +109,16 @@
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2 truncate"></div>
|
||||
<label class="col-md-2 truncate" style="width: 130px;">Cuenta Deposito:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 truncate" style="width: 70px;">Fecha:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding-top: 0; width: 140px !important;">
|
||||
<div class="col-md-5" runat="server">
|
||||
<label style="font-size:1.2em">Cuenta Deposito:</label>
|
||||
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" style="width: 300px;"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-2" runat="server">
|
||||
<div class="col-md-1" >
|
||||
<label style="width:70px; font-size:1.2em;">Fecha:</label>
|
||||
</div>
|
||||
<div class="col-md-1" >
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding-top: 0; width: 140px !important;">
|
||||
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgCalendarioFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
@@ -124,16 +130,22 @@
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="align-content: flex-end;">
|
||||
<div runat="server" id="divLabelTotal" style="width:100%;text-align:right;font-size:1.5em" visible="false">
|
||||
<asp:label runat="server">Importe seleccionado: $</asp:label><asp:label runat="server" ID="lblValorTotal">00.00</asp:label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" runat="server" ID="DivComision" Visible="false">
|
||||
<label style="width: 70px; font-size:1.2em">Comisión:</label>
|
||||
<asp:TextBox runat="server" ID="TxtComision"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" style="text-align: right; font-size:1.2em;" runat="server" id="divLabelTotal" visible="false">
|
||||
<asp:label runat="server">Importe seleccionado: $</asp:label>
|
||||
<asp:label runat="server" ID="lblValorTotal">00.00</asp:label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height:550px;overflow-x:scroll">
|
||||
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
|
||||
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe, SerieFolio" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
@@ -213,7 +225,21 @@
|
||||
debugger;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
debugger;
|
||||
}
|
||||
}
|
||||
|
||||
var comision = 0;
|
||||
|
||||
function txtSuma(txt) {
|
||||
var saldo = ToDouble($('#C_lblValorTotal').text());
|
||||
var comision2 = ToDouble($('#C_TxtComision').val());
|
||||
comision2 = comision2 - comision
|
||||
saldo = saldo - comision2;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
comision = ToDouble($('#C_TxtComision').val())
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ Partial Class Bancos_DepositosCaja
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
txtFechaI.Text = Now.AddDays(-1).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
TxtComision.Attributes.Add("onKeyUp", "txtSuma(event);")
|
||||
|
||||
CargaCuentas()
|
||||
End If
|
||||
End Sub
|
||||
@@ -35,6 +37,10 @@ Partial Class Bancos_DepositosCaja
|
||||
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyectos.DataBind()
|
||||
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
@@ -56,11 +62,14 @@ Partial Class Bancos_DepositosCaja
|
||||
GvFacturas.DataBind()
|
||||
lblValorTotal.Text = "00.00"
|
||||
divLabelTotal.Visible = True
|
||||
DivComision.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
|
||||
|
||||
Dim TotalImporte As Decimal = 0
|
||||
Dim TotalImportePrePoliza As Decimal
|
||||
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
|
||||
Next
|
||||
@@ -70,6 +79,14 @@ Partial Class Bancos_DepositosCaja
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
TotalImportePrePoliza = TotalImporte
|
||||
If TxtComision.Text.ToEntero > 0 Then
|
||||
TotalImporte = TotalImporte - TxtComision.Text.ToEntero
|
||||
If DdlSubProyectos.SelectedValue.ToEntero = -1 Or DdlClasificacion.SelectedValue.ToEntero = -1 Then
|
||||
Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim OcurrioError As Boolean = False
|
||||
Dim ObjContabilidad As New ClsContabilidad()
|
||||
@@ -88,7 +105,10 @@ Partial Class Bancos_DepositosCaja
|
||||
Dim CveCuentaBancariaDestino As Integer = 0
|
||||
Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
|
||||
Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuentaDeposito.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
|
||||
|
||||
Dim CveSubProyecto As Integer = 0
|
||||
Dim CveClasificacion As Integer = 0
|
||||
Dim documentos As String = "Los Depósitos se realizaron exitósamente<br/><br/>"
|
||||
Dim imprimirFolios As String = ""
|
||||
If drOrigen IsNot Nothing Then
|
||||
CveMoneda = drOrigen("CveMoneda").ToString.ToEntero
|
||||
IdCuentaBancariaOrigen = drOrigen("IdCtaContable").ToString.ToEntero
|
||||
@@ -101,7 +121,9 @@ Partial Class Bancos_DepositosCaja
|
||||
CveCuentaBancariaDestino = drDestino("IdCtaContableSIG").ToString.ToEntero
|
||||
End If
|
||||
|
||||
NuevaCvePrePoliza = ObjContabilidad.AddPrePolizas("Vta", 13, TotalImporte, TotalImporte, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
NuevaCvePrePoliza = ObjContabilidad.AddPrePolizas("Vta", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
|
||||
'Salida de Caja Chica
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
|
||||
@@ -110,42 +132,59 @@ Partial Class Bancos_DepositosCaja
|
||||
End If
|
||||
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
'Entrada a Bancos
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 8)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
If TxtComision.Text.ToEntero > 0 Then
|
||||
CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero
|
||||
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
|
||||
If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TxtComision.Text.ToEntero, "Comisión", 78, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=TxtComision.Text.ToEntero * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
Else OcurrioError = True
|
||||
End If
|
||||
Else
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
CveIEDestino = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 8, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
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 Double = Gvr.DataKey("Importe").ToDouble
|
||||
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(DdlCuentaDeposito.SelectedValue.ToEntero, 8)
|
||||
If Not FolioIE > 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
CveIEDestino = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 8, Fecha, FolioIE.ToString, "Depósito Bancario", Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Importe.ToDecimal, SerieFolio, 30, "Depósito Bancario", Fecha, IdCuentaBancariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=Importe.ToDecimal * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
'Asignamos la cuenta Deposito
|
||||
If Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
||||
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Documento {1}</a>     ", CveIEDestino.ToString, SerieFolio)
|
||||
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, SerieFolio)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
Else OcurrioError = True
|
||||
End If
|
||||
|
||||
|
||||
If OcurrioError Then
|
||||
ObjContabilidad.RollBack()
|
||||
@@ -153,12 +192,8 @@ Partial Class Bancos_DepositosCaja
|
||||
Else
|
||||
ObjContabilidad.Commit()
|
||||
CargaDatos()
|
||||
Dim SbMensaje As New StringBuilder()
|
||||
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
||||
SbMensaje.Append("Los Depósitos se realizaron exitósamente<br/><br/>")
|
||||
SbMensaje.AppendFormat("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Documento</a>     ", CveIEDestino)
|
||||
SbMensaje.AppendFormat("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir</a> ", StrEncript)
|
||||
Alert(SbMensaje.ToString)
|
||||
|
||||
Alert(documentos.ToString)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user