Descuento
This commit is contained in:
@@ -137,13 +137,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-2" runat="server" id="DivFaltante">
|
||||||
<div class="col-md-3" runat="server" Id="DivComision" Visible="false">
|
<asp:CheckBox ID="ChkFaltante" runat="server" Text="Faltante/Sobrante"/>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3" id="DivComision" style="display: none">
|
||||||
<label style="width: 105px; ">Faltante/Sobrante:</label>
|
<label style="width: 105px; ">Faltante/Sobrante:</label>
|
||||||
<asp:TextBox runat="server" ID="TxtComision" Class=" input-sm " Width="75px"></asp:TextBox>
|
<asp:TextBox runat="server" ID="TxtComision" Class=" input-sm " Width="75px"></asp:TextBox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="col-md-1 truncate" style="width: 120px; font-size:1.2em; display: none" id="LblSubproyecto" >SubProyecto:</label>
|
<label class="col-md-1 truncate" style="width: 120px; display: none" id="LblSubproyecto" >SubProyecto:</label>
|
||||||
<div class="col-md-2" style="display: none" id="divSubProyecto">
|
<div class="col-md-2" style="display: none" id="divSubProyecto">
|
||||||
<asp:DropDownList ID="DdlSubProyectoDeposito" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
<asp:DropDownList ID="DdlSubProyectoDeposito" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
@@ -155,6 +157,23 @@
|
|||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2" runat="server" id="Div1">
|
||||||
|
<asp:CheckBox ID="ChkDescuento" runat="server" Text="Descuento"/>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3" id="DivDescuento" style="display: none">
|
||||||
|
<label style="width: 105px; ">Descuento:</label>
|
||||||
|
<asp:TextBox runat="server" ID="TxtDescuento" Class=" input-sm " Width="75px"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label class="col-md-1 truncate" style="width: 120px; display: none" id="LblClasificacionDescuento">Clasificación:</label>
|
||||||
|
<div class="col-md-2" style="display: none" id="divClasificacionDescuento">
|
||||||
|
<asp:DropDownList ID="DdlClasificacionDescuento" AutoPostBack="false" CssClass=" form-control input-sm select2me" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<div style="height:550px;overflow-x:scroll">
|
<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, SerieFolio" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%; " 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%; " GridLines="None">
|
||||||
@@ -256,7 +275,11 @@
|
|||||||
comision = ToDouble($('#C_TxtComision').val())
|
comision = ToDouble($('#C_TxtComision').val())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comision != 0) {
|
}
|
||||||
|
|
||||||
|
function CheckFaltante(chk) {
|
||||||
|
if (chk.checked == true) {
|
||||||
|
$('#DivComision').css("display", "block");
|
||||||
$('#LblSubproyecto').css("display", "block");
|
$('#LblSubproyecto').css("display", "block");
|
||||||
$('#divSubProyecto').css("display", "block");
|
$('#divSubProyecto').css("display", "block");
|
||||||
$('#LblClasificacion').css("display", "block");
|
$('#LblClasificacion').css("display", "block");
|
||||||
@@ -265,16 +288,30 @@
|
|||||||
debugger;
|
debugger;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
$('#DivComision').css("display", "none");
|
||||||
$('#LblSubproyecto').css("display", "none");
|
$('#LblSubproyecto').css("display", "none");
|
||||||
$('#divSubProyecto').css("display", "none");
|
$('#divSubProyecto').css("display", "none");
|
||||||
$('#LblClasificacion').css("display", "none");
|
$('#LblClasificacion').css("display", "none");
|
||||||
$('#divClasificacion').css("display", "none");
|
$('#divClasificacion').css("display", "none");
|
||||||
debugger;
|
debugger;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CheckDescuento(chk) {
|
||||||
|
if (chk.checked == true) {
|
||||||
|
$('#DivDescuento').css("display", "block");
|
||||||
|
$('#LblClasificacionDescuento').css("display", "block");
|
||||||
|
$('#divClasificacionDescuento').css("display", "block");
|
||||||
|
|
||||||
|
debugger;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('#DivDescuento').css("display", "none");
|
||||||
|
$('#LblClasificacionDescuento').css("display", "none");
|
||||||
|
$('#divClasificacionDescuento').css("display", "none");
|
||||||
|
debugger;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ Partial Class Bancos_DepositosCaja
|
|||||||
TxtComision.Attributes.Add("onKeyUp", "txtSuma(event);")
|
TxtComision.Attributes.Add("onKeyUp", "txtSuma(event);")
|
||||||
|
|
||||||
CargaCuentas()
|
CargaCuentas()
|
||||||
|
ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);")
|
||||||
|
ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);")
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -40,9 +43,13 @@ Partial Class Bancos_DepositosCaja
|
|||||||
|
|
||||||
DdlSubProyectoDeposito.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
DdlSubProyectoDeposito.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||||
DdlSubProyectoDeposito.DataBind()
|
DdlSubProyectoDeposito.DataBind()
|
||||||
|
DdlSubProyectos.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
|
|
||||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
|
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
|
||||||
DdlClasificacion.DataBind()
|
DdlClasificacion.DataBind()
|
||||||
|
DdlSubProyectos.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||||
@@ -64,14 +71,15 @@ Partial Class Bancos_DepositosCaja
|
|||||||
GvFacturas.DataBind()
|
GvFacturas.DataBind()
|
||||||
lblValorTotal.Text = "0.00"
|
lblValorTotal.Text = "0.00"
|
||||||
divLabelTotal.Visible = True
|
divLabelTotal.Visible = True
|
||||||
DivComision.Visible = True
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
|
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
|
||||||
|
|
||||||
Dim TotalImporte As Decimal = 0
|
Dim TotalImporte As Decimal = 0
|
||||||
Dim TotalImportePrePoliza As Decimal
|
Dim TotalImportePrePoliza As Decimal
|
||||||
Dim Comision As Decimal = TxtComision.Text.Todecimal
|
Dim Comision As Decimal = TxtComision.Text.ToDecimal
|
||||||
|
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal
|
||||||
|
|
||||||
|
|
||||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||||
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
|
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
|
||||||
@@ -84,8 +92,9 @@ Partial Class Bancos_DepositosCaja
|
|||||||
|
|
||||||
TotalImportePrePoliza = TotalImporte
|
TotalImportePrePoliza = TotalImporte
|
||||||
If Comision <> 0 Then
|
If Comision <> 0 Then
|
||||||
TotalImporte = TotalImporte + Comision
|
TotalImporte = TotalImporte + Comision + Descuento
|
||||||
Comision = -(Comision) ' se inverte el valor, va cargada
|
Comision = -(Comision) ' se inverte el valor, va cargada
|
||||||
|
Descuento = -(Descuento) ' se inverte el valor, va cargada
|
||||||
If DdlSubProyectoDeposito.SelectedValue.ToEntero = -1 Or DdlClasificacion.SelectedValue.ToEntero = -1 Then
|
If DdlSubProyectoDeposito.SelectedValue.ToEntero = -1 Or DdlClasificacion.SelectedValue.ToEntero = -1 Then
|
||||||
Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia)
|
Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -111,6 +120,8 @@ Partial Class Bancos_DepositosCaja
|
|||||||
Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuentaDeposito.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 CveSubProyecto As Integer = 0
|
||||||
Dim CveClasificacion As Integer = 0
|
Dim CveClasificacion As Integer = 0
|
||||||
|
Dim CveClasificacionDescuento As Integer = 0
|
||||||
|
|
||||||
Dim documentos As String = "Los Depósitos se realizaron exitósamente<br/><br/>"
|
Dim documentos As String = "Los Depósitos se realizaron exitósamente<br/><br/>"
|
||||||
Dim imprimirFolios As String = ""
|
Dim imprimirFolios As String = ""
|
||||||
If drOrigen IsNot Nothing Then
|
If drOrigen IsNot Nothing Then
|
||||||
@@ -137,13 +148,22 @@ Partial Class Bancos_DepositosCaja
|
|||||||
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a>     <br/> ", CveIEOrigen, FolioIE)
|
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, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
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, CveCuenta:=CveCuentaBancariaOrigen) Then
|
||||||
|
|
||||||
If Comision <> 0 Then
|
If ChkFaltante.Checked Then
|
||||||
CveSubProyecto = DdlSubProyectoDeposito.SelectedValue.ToEntero
|
CveSubProyecto = DdlSubProyectoDeposito.SelectedValue.ToEntero
|
||||||
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
|
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
|
||||||
|
|
||||||
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Comision, "Comisión", 51, "Depósito Bancario ", Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Comision, DdlClasificacion.SelectedItem.Text, 51, DdlClasificacion.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ChkDescuento.Checked Then
|
||||||
|
CveSubProyecto = DdlSubProyectoDeposito.SelectedValue.ToEntero
|
||||||
|
CveClasificacionDescuento = DdlClasificacionDescuento.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -172,7 +192,7 @@ Partial Class Bancos_DepositosCaja
|
|||||||
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)
|
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, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user