diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 30e7962cc..308ebb7ed 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2125,13 +2125,14 @@ Public Class ClsNominas Return retorno End Function - Public Function GetCalculoSBC(CveEmpresa As Integer, FechaCalculo As String) As Boolean + Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() DataAdapter("PA_GetCalculoSBC", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = Tipo .Add("@Fecha", SqlDbType.Date).Value = FechaCalculo End With diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index 2619da69f..20e230d4d 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -137,13 +137,15 @@
- -
- +
+ +
+ - +
+
+
+ +
+ + + + + + + +
+
@@ -227,55 +251,89 @@ var ValorTotalSeleccionado = 0 var comision = 0; - var comisionNegativa = 0; + var descuento = 0; + var saldo = 0; function FnSuma(chk, cantidad) { - var saldo = ToDouble($('#C_lblValorTotal').text()); + var saldoInicial = ToDouble($('#C_lblValorTotal').text()); if (chk.checked == false) { cantidad = cantidad * -1; } - saldo = saldo + cantidad; - $('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); - $('#C_lblValorTotalSeleccionado').text(FormatoNumero(saldo, 2)); - ValorTotalSeleccionado = saldo + saldoInicial = saldoInicial + cantidad; + $('#C_lblValorTotal').text(FormatoNumero(saldoInicial, 2)); + $('#C_lblValorTotalSeleccionado').text(FormatoNumero(saldoInicial, 2)); + ValorTotalSeleccionado = saldoInicial } function txtSuma(txt) { - var saldo = ToDouble($('#C_lblValorTotal').text()); var comision2 = ToDouble($('#C_TxtComision').val()); + var comisionNegativa = 0; if (comision2 < 0) { comisionNegativa = comision2 * -1 } - if (comision2 > ValorTotalSeleccionado || comisionNegativa > ValorTotalSeleccionado) { + if (comisionNegativa > ValorTotalSeleccionado) { $('#C_TxtComision').val(comision) alert("No es posible poner una comision superior a lo seleccionado") } else { - comision2 = comision2 - comision - saldo = saldo + comision2; + saldo = ValorTotalSeleccionado + comision2 + descuento; $('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); comision = ToDouble($('#C_TxtComision').val()) - } - - if (comision != 0) { - $('#LblSubproyecto').css("display", "block"); - $('#divSubProyecto').css("display", "block"); - $('#LblClasificacion').css("display", "block"); - $('#divClasificacion').css("display", "block"); - - debugger; - - } else { - $('#LblSubproyecto').css("display", "none"); - $('#divSubProyecto').css("display", "none"); - $('#LblClasificacion').css("display", "none"); - $('#divClasificacion').css("display", "none"); debugger; } } + function txtSumaDescuento(txt) { + var comision2 = ToDouble($('#C_TxtDescuento').val()); + var comisionNegativa = 0; + if (comision2 < 0) { + comisionNegativa = comision2 * -1 + } + if (comisionNegativa > ValorTotalSeleccionado) { + $('#C_TxtDescuento').val(descuento) + alert("No es posible poner una comision superior a lo seleccionado") + } else { + saldo = ValorTotalSeleccionado + comision2 + comision; + $('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); + descuento = ToDouble($('#C_TxtDescuento').val()) + debugger; + } + } + + function CheckFaltante(chk) { + if (chk.checked == true) { + $('#DivComision').css("display", "block"); + $('#LblSubproyecto').css("display", "block"); + $('#divSubProyecto').css("display", "block"); + $('#LblClasificacion').css("display", "block"); + $('#divClasificacion').css("display", "block"); + } else { + $('#DivComision').css("display", "none"); + $('#divSubProyecto').css("display", "none"); + $('#divSubProyecto').css("display", "none"); + $('#LblClasificacion').css("display", "none"); + $('#divClasificacion').css("display", "none"); + } + } + + function CheckDescuento(chk) { + if (chk.checked == true) { + $('#DivDescuento').css("display", "block"); + $('#LblSubproyectoDescuento').css("display", "block"); + $('#divSubProyectoDescuento').css("display", "block"); + $('#LblClasificacionDescuento').css("display", "block"); + $('#divClasificacionDescuento').css("display", "block"); + } else { + + $('#DivDescuento').css("display", "none"); + $('#LblSubproyectoDescuento').css("display", "none"); + $('#divSubProyectoDescuento').css("display", "none"); + $('#LblClasificacionDescuento').css("display", "none"); + $('#divClasificacionDescuento').css("display", "none"); + } + } diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index d04585cfc..9274e79ab 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -22,8 +22,12 @@ Partial Class Bancos_DepositosCaja txtFechaI.Text = Now.AddDays(-1).ToShortDateString txtFechaF.Text = Now.ToShortDateString TxtComision.Attributes.Add("onKeyUp", "txtSuma(event);") + TxtDescuento.Attributes.Add("onKeyUp", "txtSumaDescuento(event);") CargaCuentas() + ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);") + ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);") + End If End Sub @@ -38,11 +42,22 @@ Partial Class Bancos_DepositosCaja DdlSubProyectos.DataBind() DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyectoDeposito.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) + DdlSubProyectoDeposito.DataSource = DdlSubProyectos.DataSource DdlSubProyectoDeposito.DataBind() + DdlSubProyectos.Items.Insert(0, New ListItem("Seleccione", "-1")) + + DdlSubProyectoDescuento.DataSource = DdlSubProyectos.DataSource + DdlSubProyectoDescuento.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")) + + DdlClasificacionDescuento.DataSource = DdlClasificacion.DataSource + DdlClasificacionDescuento.DataBind() + DdlSubProyectos.Items.Insert(0, New ListItem("Seleccione", "-1")) + End Sub Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click @@ -63,15 +78,17 @@ Partial Class Bancos_DepositosCaja UpGvFacturas.Update() GvFacturas.DataBind() lblValorTotal.Text = "0.00" + TxtComision.text = "" 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 +101,9 @@ Partial Class Bancos_DepositosCaja TotalImportePrePoliza = TotalImporte If Comision <> 0 Then - TotalImporte = TotalImporte + Comision - Comision = -(Comision) ' se inverte el valor, va cargada + 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 @@ -109,8 +127,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 CveSubProyecto As Integer = -1 + Dim CveSubProyectoDescuento As Integer = -1 + Dim CveClasificacion As Integer = -1 + Dim CveClasificacionDescuento As Integer = -1 Dim documentos As String = "Los Depósitos se realizaron exitósamente

" Dim imprimirFolios As String = "" If drOrigen IsNot Nothing Then @@ -137,13 +157,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, True, 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 + CveSubProyectoDescuento = DdlSubProyectoDescuento.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 +201,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 diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index 768463a0b..01b768cda 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -122,6 +122,8 @@ + +
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 3dd2dfad1..c11b25731 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -389,7 +389,7 @@ Partial Class Bancos_ProveedoresAbonar If UsuarioActual.TienePermisoProceso(98) Then PermiteModificarImporte = False End If - Calendario.StartDate = Now.AddMonths(-2) + Calendario.StartDate = Now.AddMonths(-4) 'proceso que restringue solo el pago de apartir del dia de hoy y como limite fin de mes If UsuarioActual.TienePermisoProceso(105) Then Calendario.StartDate = Now @@ -3391,6 +3391,7 @@ Partial Class Bancos_ProveedoresAbonar Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString + RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-4).ToShortDateString Calendario.EndDate = DateTime.Now End Sub diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 30c7a064f..8a7c0fff3 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -1068,10 +1068,10 @@ public partial class CRM_Acercamiento : ClsPaginas ClsOIEventos ObjEventos = new ClsOIEventos(); DateTime FechaInicio = TxtFechaInicioAgenda.Text.ToDateTime(); int CveContactoAgendar = DdlContactoAgenda.SelectedValue.ToEntero(); - + int CveEmpresaCRM = DdlEmpresaCRM.SelectedValue.ToEntero(); int CveEtapa = HdfEtapaSeleccionada.Value.ToEntero() == -1 ? CveEtapaActual : HdfEtapaSeleccionada.Value.ToEntero(); - if (ObjEventos.AddEventoAgenda(DdlTipoAgenda.SelectedValue.ToEntero(), TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridadAgenda.SelectedValue.ToEntero(), FechaInicio, FechaInicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoAgendar, CveEtapaProcesoCRM: CveEtapa)) + if (ObjEventos.AddEventoAgenda(DdlTipoAgenda.SelectedValue.ToEntero(), TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridadAgenda.SelectedValue.ToEntero(), FechaInicio, FechaInicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoAgendar, CveEtapaProcesoCRM: CveEtapa, CveEmpresaCRM:CveEmpresaCRM)) { limpiarModalAgendar(); RegistraScript("$('#ModalAgenda').modal('hide')"); diff --git a/CRM/CatEmpresasCRM.aspx.cs b/CRM/CatEmpresasCRM.aspx.cs index 61451a357..3f91131e8 100644 --- a/CRM/CatEmpresasCRM.aspx.cs +++ b/CRM/CatEmpresasCRM.aspx.cs @@ -64,6 +64,7 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas { DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}",DdlTipoProceso.SelectedValue)); DdlMedioCaptacion.DataBind(); + DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos", "-1")); } ObjCRM.Dispose(); } diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 7064cbbec..f0c780a36 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -122,6 +122,19 @@ + + <%--2021-04-15 contratos de obra--%> + + + +
  • + +
  • +
    + +
    + + @@ -5332,16 +5345,12 @@ --%> - - - - - -