-- cambios para BDH, poder dejar un importe para devolución sobre la misma cuenta
This commit is contained in:
@@ -120,7 +120,8 @@
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate" style="width: 100px;">SubProyecto:</label>
|
||||
<label class="col-md-1 truncate" style="width: 100px;">
|
||||
<asp:Label ID="LblSub" runat="server" Text="SubProyecto"></asp:Label>:</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>
|
||||
@@ -218,16 +219,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row rowcheck truncate" id="DivDescuentocheck" style="margin-top: -25px;">
|
||||
<div class="col-md-1" runat="server" id="Div1" style="width: 155px">
|
||||
<asp:CheckBox ID="ChkDescuento" runat="server" Text="Descuento" CssClass="checkbox" />
|
||||
</div>
|
||||
<div class="col-md-10 rowcheckCampos" id="DivDescuento" style="display: none">
|
||||
|
||||
<div class="col-md-1" style="padding-right: 130px;">
|
||||
<label for="TxtDescuento">Importe:</label>
|
||||
<asp:TextBox runat="server" ID="TxtDescuento" Class=" input-sm " Width="100px" onkeypress="return numericOnly(this);" ondrop="return false;" onpaste="return false;" CssClass="Numeros"></asp:TextBox>
|
||||
@@ -253,7 +250,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row rowcheck truncate" id="DivIntercheck" style="margin-top: -25px;">
|
||||
<div class="row rowcheck truncate" id="DivIntercheck" style="margin-top: -15px;">
|
||||
|
||||
<div class="col-md-1" runat="server" id="Div2" style="width: 155px">
|
||||
<asp:CheckBox ID="ChkIntermediario" runat="server" Text="Intermediario" CssClass="checkbox" />
|
||||
@@ -287,6 +284,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row rowcheck truncate" id="DivRowCuenta" style="margin-top: -15px;" runat="server" visible="false" >
|
||||
|
||||
<div class="col-md-1" runat="server" id="Div3" style="width: 155px">
|
||||
<asp:CheckBox ID="ChkCuentaRetorno" runat="server" Text="Cuenta" CssClass="checkbox" />
|
||||
</div>
|
||||
<div class="col-md-10 rowcheckCampos" id="DivRowCuenta2" style="display: none">
|
||||
<div class="col-md-3" id="ddd" style="padding-right: 150px;">
|
||||
<label>Cuenta:</label>
|
||||
<asp:DropDownList ID="DdlCajaChicaRetorno" CssClassDdl="select2me" Width="150px" CssStyle="100%" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" runat="server"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-2" style="width: 205px;">
|
||||
<div class="col-md-6" id="DivCuentaImporte" style="padding-left: 0px; padding-right: 0px;">
|
||||
<label>Importe:</label>
|
||||
<asp:TextBox runat="server" ID="TxtCuentaRetorno" Class=" input-sm " Width="75px" onkeypress="return numericOnly(this);" ondrop="return false;" onpaste="return false;" CssClass="Numeros"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -406,8 +421,7 @@
|
||||
var saldo = 0;
|
||||
var IVA = 0;
|
||||
var ComisionIntermediario = 0;
|
||||
|
||||
|
||||
var CuentaRetorno = 0;
|
||||
|
||||
function FnSuma(chk, cantidad) {
|
||||
var saldoInicial = ToDouble($('#C_lblValorTotal').text());
|
||||
@@ -528,6 +542,30 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($('#C_ChkCuentaRetorno').attr('checked')) {
|
||||
var txtcuentaretorno = ToDouble($('#C_TxtCuentaRetorno').val());
|
||||
if (txtcuentaretorno != 0) {
|
||||
var DescuentoNegativa = 0;
|
||||
if (txtcuentaretorno > 0) {
|
||||
DescuentoNegativa = txtcuentaretorno * -1;
|
||||
}
|
||||
if (DescuentoNegativa > saldo) {
|
||||
$('#C_TxtCuentaRetorno').val(0);
|
||||
comision = 0;
|
||||
descuento = 0;
|
||||
txtdescuento = 0;
|
||||
alert("No es posible poner un descuento superior a lo seleccionado");
|
||||
saldo = 0;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
|
||||
} else {
|
||||
//saldo = ValorTotalSeleccionado + txtdescuento + comision;
|
||||
//$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
//descuento = ToDouble($('#C_TxtDescuento').val())
|
||||
//debugger;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -559,13 +597,28 @@
|
||||
$('#C_TxtDescuento').val(descuento)
|
||||
alert("No es posible poner un IVA superior a lo seleccionado")
|
||||
} else {
|
||||
saldo = ValorTotalSeleccionado - comision2 + comision - IVA - ComisionIntermediario;
|
||||
saldo = ValorTotalSeleccionado - comision2 + comision - IVA - ComisionIntermediario - CuentaRetorno;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
descuento = ToDouble($('#C_TxtDescuento').val())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function txtSumaCuentaRetorno(txt) {
|
||||
debugger;
|
||||
var comision2 = ToDouble($('#C_TxtCuentaRetorno').val());
|
||||
if (comision2 > ValorTotalSeleccionado) {
|
||||
$('#C_TxtCuentaRetorno').val(descuento)
|
||||
alert("No es posible poner un IVA superior a lo seleccionado")
|
||||
} else {
|
||||
saldo = ValorTotalSeleccionado - comision2 + comision - IVA - ComisionIntermediario;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
descuento = ToDouble($('#C_TxtCuentaRetorno').val())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function txtSumaIVA(txt) {
|
||||
var comision2 = ToDouble($('#C_TxtIVA').val());
|
||||
@@ -573,7 +626,7 @@
|
||||
$('#C_TxtIVA').val(IVA);
|
||||
alert("No es posible poner un IVA superior a lo seleccionado");
|
||||
} else {
|
||||
saldo = ValorTotalSeleccionado - descuento + comision - comision2 - ComisionIntermediario;
|
||||
saldo = ValorTotalSeleccionado - descuento + comision - comision2 - ComisionIntermediario - CuentaRetorno;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
IVA = ToDouble($('#C_TxtIVA').val());
|
||||
}
|
||||
@@ -586,7 +639,7 @@
|
||||
//$('#C_TxtComisionIntermediario').val(ComisionIntermediario);
|
||||
//alert("No es posible poner un importe superior a lo seleccionado");
|
||||
} else {
|
||||
saldo = ValorTotalSeleccionado - descuento + comision - comision2 - IVA;
|
||||
saldo = ValorTotalSeleccionado - descuento + comision - comision2 - IVA - CuentaRetorno;
|
||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||
ComisionIntermediario = ToDouble($('#C_TxtComisionIntermediario').val());
|
||||
}
|
||||
@@ -638,9 +691,19 @@
|
||||
|
||||
Recalcular();
|
||||
$('#DivInter').css("display", "none");
|
||||
$('#DivIntercheck').addClass("truncate");
|
||||
|
||||
$('#DivIntercheck').addClass("truncate");
|
||||
}
|
||||
}
|
||||
function CheckRowCuenta(chk) {
|
||||
if (chk.checked == true) {
|
||||
$('#DivRowCuenta2').css("display", "block");
|
||||
$('#DivRowCuenta').removeClass("truncate");
|
||||
|
||||
} else {
|
||||
|
||||
Recalcular();
|
||||
$('#DivRowCuenta2').css("display", "none");
|
||||
$('#DivRowCuenta').addClass("truncate");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,8 +713,9 @@
|
||||
var Descuento = ToDouble($('#C_TxtDescuento').val());
|
||||
var IVA = ToDouble($('#C_TxtIVA').val());
|
||||
var ImporteInter = ToDouble($('#C_TxtComisionIntermediario').val());
|
||||
var ImporteCuentaRetorno= ToDouble($('#C_TxtCuentaRetorno').val());
|
||||
|
||||
var total = ValorTotalSeleccionado + Comision - Descuento - IVA - ImporteInter
|
||||
var total = ValorTotalSeleccionado + Comision - Descuento - IVA - ImporteInter - ImporteCuentaRetorno
|
||||
$('#C_lblValorTotal').text(FormatoNumero(total, 2));
|
||||
debugger;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ Partial Class Bancos_DepositosCaja
|
||||
txtFechaF.Text = NowADS().ToShortDateString
|
||||
TxtComision.Attributes.Add("onKeyUp", "txtSuma(this);")
|
||||
TxtDescuento.Attributes.Add("onKeyUp", "txtSumaDescuento(this);")
|
||||
TxtCuentaRetorno.Attributes.Add("onKeyUp", "txtSumaCuentaRetorno(this);")
|
||||
TxtIVA.Attributes.Add("onKeyUp", "txtSumaIVA(this);")
|
||||
TxtComisionIntermediario.Attributes.Add("onKeyUp", "txtSumaTntermediario(this);")
|
||||
|
||||
@@ -32,7 +33,8 @@ Partial Class Bancos_DepositosCaja
|
||||
CargaCuentas()
|
||||
ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);")
|
||||
ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);")
|
||||
ChkIntermediario.Attributes.Add("onclick", "CheckIntermediario(this);")
|
||||
ChkIntermediario.Attributes.Add("onclick", "CheckIntermediario(this);")
|
||||
ChkCuentaRetorno.Attributes.Add("onclick", "CheckRowCuenta(this);")
|
||||
BtnConsultar.Attributes.Add("onclick", "Consultar(this);")
|
||||
BtnDepositar.Attributes.Add("onclick", "Depositar(this);")
|
||||
|
||||
@@ -41,7 +43,8 @@ Partial Class Bancos_DepositosCaja
|
||||
|
||||
Private Sub CargaCuentas()
|
||||
DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
||||
DdlCuentaDeposito.DataBind()
|
||||
DdlCuentaDeposito.DataBind()
|
||||
DdlCuentaDeposito.Items.Insert(0, New ListItem("-", "-1"))
|
||||
|
||||
DdlCajaChica.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
||||
DdlCajaChica.DataBind()
|
||||
@@ -54,6 +57,13 @@ Partial Class Bancos_DepositosCaja
|
||||
divFolio.Visible = True
|
||||
End If
|
||||
|
||||
DdlCajaChicaRetorno.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
||||
DdlCajaChicaRetorno.DataBind()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
DivRowCuenta.Visible = True
|
||||
End If
|
||||
|
||||
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyectos.DataBind()
|
||||
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
@@ -148,12 +158,19 @@ Partial Class Bancos_DepositosCaja
|
||||
Dim TotalImporte As Decimal = 0
|
||||
Dim TotalImportePrePoliza As Decimal
|
||||
Dim Comision As Decimal = TxtComision.Text.ToDecimal
|
||||
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal
|
||||
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal
|
||||
Dim CuentaRetorno As Decimal = TxtCuentaRetorno.Text.ToDecimal
|
||||
Dim IVA As Decimal = TxtIVA.Text.ToDecimal
|
||||
Dim ImporteInter As Decimal = TxtComisionIntermediario.Text.ToDecimal
|
||||
|
||||
Dim MsgError As String = "Ocurrió un error al realizar los depositos"
|
||||
|
||||
If DdlCuentaDeposito.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("No se ha especificado la cuenta a depositar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
|
||||
Next
|
||||
@@ -183,6 +200,15 @@ Partial Class Bancos_DepositosCaja
|
||||
End If
|
||||
End If
|
||||
|
||||
If CuentaRetorno <> 0 Then
|
||||
TotalImporte = TotalImporte - CuentaRetorno
|
||||
'Descuento = -(Descuento) ' se inverte el valor, va cargada
|
||||
'If DdlSubProyectoDescuento.SelectedValue.ToEntero = -1 Or DdlClasificacionDescuento.SelectedValue.ToEntero = -1 Then
|
||||
' Alert("Debes Seleccionar un Subproyecto y una Clasificación de descuento", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
End If
|
||||
|
||||
If TxtComisionIntermediario.Text.ToDecimal <> 0 Then
|
||||
TotalImporte = TotalImporte - TxtComisionIntermediario.Text.ToDecimal - IVA
|
||||
End If
|
||||
@@ -321,6 +347,17 @@ Partial Class Bancos_DepositosCaja
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then
|
||||
CveTransaccionBanco = 13
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChicaRetorno.SelectedValue.ToEntero, CveTransaccionBanco)
|
||||
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCajaChicaRetorno.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Retorno Depósito Bancario", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, "", "Retorno", CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigen) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
Dim i As Integer = 0
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
@@ -365,7 +402,7 @@ Partial Class Bancos_DepositosCaja
|
||||
Next
|
||||
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")
|
||||
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/> ", StrEncript, "Depósito Bancario")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user