diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx
index ab57d8fba..dbbec3d15 100644
--- a/Bancos/DepositosCaja.aspx
+++ b/Bancos/DepositosCaja.aspx
@@ -137,13 +137,15 @@
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
@@ -255,8 +274,12 @@
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
comision = ToDouble($('#C_TxtComision').val())
}
+
+ }
- if (comision != 0) {
+ function CheckFaltante(chk) {
+ if (chk.checked == true) {
+ $('#DivComision').css("display", "block");
$('#LblSubproyecto').css("display", "block");
$('#divSubProyecto').css("display", "block");
$('#LblClasificacion').css("display", "block");
@@ -265,16 +288,30 @@
debugger;
} else {
+ $('#DivComision').css("display", "none");
$('#LblSubproyecto').css("display", "none");
$('#divSubProyecto').css("display", "none");
$('#LblClasificacion').css("display", "none");
$('#divClasificacion').css("display", "none");
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;
+ }
+ }
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index d04585cfc..675996c41 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -24,6 +24,9 @@ Partial Class Bancos_DepositosCaja
TxtComision.Attributes.Add("onKeyUp", "txtSuma(event);")
CargaCuentas()
+ ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);")
+ ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);")
+
End If
End Sub
@@ -40,9 +43,13 @@ Partial Class Bancos_DepositosCaja
DdlSubProyectoDeposito.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
DdlSubProyectoDeposito.DataBind()
+ DdlSubProyectos.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
DdlClasificacion.DataBind()
+ DdlSubProyectos.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
@@ -64,14 +71,15 @@ Partial Class Bancos_DepositosCaja
GvFacturas.DataBind()
lblValorTotal.Text = "0.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
- 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
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
@@ -84,8 +92,9 @@ Partial Class Bancos_DepositosCaja
TotalImportePrePoliza = TotalImporte
If Comision <> 0 Then
- TotalImporte = TotalImporte + Comision
+ TotalImporte = TotalImporte + Comision + Descuento
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
Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia)
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 CveSubProyecto As Integer = 0
Dim CveClasificacion As Integer = 0
+ Dim CveClasificacionDescuento As Integer = 0
+
Dim documentos As String = "Los Depósitos se realizaron exitósamente
"
Dim imprimirFolios As String = ""
If drOrigen IsNot Nothing Then
@@ -137,13 +148,22 @@ Partial Class Bancos_DepositosCaja
documentos += String.Format("Depósito: {1}    
", 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
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
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)
- 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
End If