diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 23fd65a2e..714db7d74 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1304,7 +1304,7 @@ Public Class ClsOC DataAdapter("PA_OC_EstatusGet") With SqlAdapter.SelectCommand.Parameters - .Add("@_CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 654ec873e..e8b616db1 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2756,6 +2756,8 @@ Namespace Modelos End If ImporteAcumulado91 += (ImporteMN91).RoundSQL + Dim tCveConcepto As Integer = 251 + If Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then tCveConcepto = 301 If UsaComplementariaClientes = True AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then Dim ImporteComplementarioNC As Decimal = ((Importe251 * Dr("TCCambioValuacion").ToString.ToDecimal) - Importe251).RoundSQL If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 207, Concepto, FechaMovimiento, IdCtaContableClienteComplementaria, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteComplementarioNC, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal) Then @@ -2763,7 +2765,7 @@ Namespace Modelos Exit For End If End If - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=Importe251, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, tCveConcepto, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=Importe251, ImporteME:=If(Dr("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then ErrorPrepoliza = True Exit For End If @@ -8916,13 +8918,6 @@ Namespace Modelos Public Property CuentaInventario As String Public Property IdCuentaIngresos As Integer? Public Property CuentaIngresos As String - Public Property IdCuentaContableSIG As Integer? - Public Property IdCuentaCostosSIG As Integer? - Public Property IdCuentaGastoSIG As Integer? - Public Property IdCuentaIngresosSIG As Integer? - Public Property IdCuentaInventarioSIG As Integer? - Public Property IdCuentaRetIVASIG As Integer? - Public Property IdCuentaRetISRSIG As Integer? Public Property Estado As Boolean Public Property Estatus As String Public Property RequiereSerieLote As Boolean? diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 78e3472d1..01c04feba 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -48,6 +48,7 @@ Partial Class Bancos_DepositosCaja DdlCajaChica.Items.Add(New ListItem("Todas", "-1")) DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Solidaridad", "7850")) DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Obregón", "7853")) + DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Matriz", "7861")) divFolio.Visible = True End If diff --git a/Nomina/FiniquitoOld.aspx b/Nomina/FiniquitoOld.aspx deleted file mode 100644 index df6cee227..000000000 --- a/Nomina/FiniquitoOld.aspx +++ /dev/null @@ -1,516 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="FiniquitoOld.aspx.cs" Inherits="Nomina_Finiquito" %> - - - - - - - - Finiquito - - - - - - - -
  • - Cambiar Empleado
  • -
  • - ReCalcular
  • -
  • - done_allAutorizar
  • -
  • - Timbrar
  • -
  • - Formato Renuncia
  • -
    -
    -
    - - - - - - -
    -
    - -
    -
    -
    - - Datos del Empleado -
    -
    - - -
    -
    -
    -
    -
    Empleado:
    -
    - -
    -
    -
    -
    Estatus
    -
    - -
    -
    -
    -
    Motivo Baja
    -
    - -
    -
    -
    -
    Fecha Baja
    -
    - -
    -
    -
    -
    Perido Finiquito
    -
    - -
    -
    -
    -
    -
    - -
    - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - -
    - -
    -
    -
    -
    -
    $
    -
    -
    -
    Aguinaldo ejercicio completo
    -
    -
    -
    -
    -
    $
    -
    -
    -
    Aguinaldo
    -
    -
    -
    -
    -
    -
    -
    -
    Aguinaldo Pagado
    -
    -
    -
    -
    -
    -
    -
    -
    Aguinaldo por pagar
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    Dias Ejercicio
    -
    -
    -
    -
    -
    -
    -
    -
    Dias Laborados
    -
    -
    -
    -
    -
    -
    -
    -
    Dias pago Aguinaldo
    -
    -
    -
    -
    - -
    -
    -
    - - -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - -
    -
    -
    - - <%--" PercepcionesDeducciones "--%> - - diff --git a/Nomina/FiniquitoOld.aspx.cs b/Nomina/FiniquitoOld.aspx.cs deleted file mode 100644 index 95eeedff3..000000000 --- a/Nomina/FiniquitoOld.aspx.cs +++ /dev/null @@ -1,515 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualBasic; -using System.Data; -using Extensiones; -using System.Web.UI.WebControls; - -partial class Nomina_Finiquito : ClsPaginas -{ - private class NConcepto - { - //Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD - - - - public string NoConceptoP { get; set; } - public string ConceptoP { get; set; } - public string LabelValorP { get; set; } - public int CveConceptoP { get; set; } - public double ImporteP { get; set; } - public double ValorP { get; set; } - public int EstatusP { get; set; } - public bool isEditedP { get; set; } - - - public string NoConceptoD { get; set; } - public string ConceptoD { get; set; } - public string LabelValorD { get; set; } - public int CveConceptoD { get; set; } - public double ImporteD { get; set; } - public double ValorD { get; set; } - public int EstatusD { get; set; } - public bool isEditedD { get; set; } - } - - private class ConceptosPersonal - { - public ConceptosPersonal() - { - Concepto = ""; - ConceptoD = ""; - CveConcepto = 0; - CveConceptoD = 0; - Estatus = 0; - Estatus = 0; - } - public string Concepto { get; set; } - public int CveConcepto { get; set; } - public decimal Importe { get; set; } - public int Estatus { get; set; } - - public string ConceptoD { get; set; } - public int CveConceptoD { get; set; } - public decimal ImporteD { get; set; } - public int EstatusD { get; set; } - } - #region Propiedades - private int CvePersonal - { - get { return ViewState["CvePersonal"] != null ? ViewState["CvePersonal"].ToString().ToEntero() : 0; } - set { ViewState["CvePersonal"] = value; } - } - private int CveTipoPeriodo - { - get { return ViewState["CveTipoPeriodo"] != null ? ViewState["CveTipoPeriodo"].ToString().ToEntero() : 0; } - set - { - ViewState["CveTipoPeriodo"] = value; - } - } - private int CvePeriodoFiniquito - { - get { return ViewState["CvePeriodoFiniquito"] != null ? ViewState["CvePeriodoFiniquito"].ToString().ToEntero() : 0; } - set { ViewState["CvePeriodoFiniquito"] = value; } - } - - private int GCEstatus - { - get { return ViewState["GCEstatus"] != null ? ViewState["GCEstatus"].ToString().ToEntero() : 0; } - set { ViewState["GCEstatus"] = value; } - } - private int GCCveConcepto - { - get { return ViewState["GCCveConcepto"] != null ? ViewState["GCCveConcepto"].ToString().ToEntero() : 0; } - set { ViewState["GCCveConcepto"] = value; } - } - private decimal GCImporte - { - get { return ViewState["GCImporte"] != null ? ViewState["GCImporte"].ToString().ToDecimal() : 0; } - set { ViewState["GCImporte"] = value; } - } - - - private DataTable DTConceptosPersonal - { - get { return ViewState["DTConceptosPersonal"] != null ? (DataTable)ViewState["DTConceptosPersonal"] : null; } - set { ViewState["DTConceptosPersonal"] = value; } - } - private DataTable DTConceptos - { - get { return ViewState["DTConceptos"] != null ? (DataTable)ViewState["DTConceptos"] : null; } - set { ViewState["DTConceptos"] = value; } - } - private bool esLiquidacion - { - get { return ViewState["esLiquidacion"] != null ? System.Convert.ToBoolean(ViewState["esLiquidacion"]) : false; } - set { ViewState["esLiquidacion"] = value; } - } - #endregion - - private List ConceptsPersonas - { - get - { - List listaconceptos = new List(); - decimal TotalP = 0; - decimal TotalD = 0; - if ((!Information.IsNothing(DTConceptosPersonal) && DTConceptosPersonal.Rows.Count > 0)) - { - DataTable dtP = DTConceptosPersonal.FiltraParametros("Tipo=1"); - DataTable dtD = DTConceptosPersonal.FiltraParametros("Tipo=2"); - var noP = dtP.Rows.Count; - var noD = dtD.Rows.Count; - var max = noP > noD ? noP : noD; - TotalP = dtP.SUM("Importe").ToString().ToDecimal(); - TotalD = dtD.SUM("Importe").ToString().ToDecimal(); - for (int index = 0; index <= max; index++) - { - ConceptosPersonal obj = new ConceptosPersonal(); - if (index < noP) - { - obj.Importe = dtP.Rows[index]["Importe"].ToString().ToDecimal(); - obj.CveConcepto = dtP.Rows[index]["CveConcepto"].ToString().ToEntero(); - obj.Concepto = dtP.Rows[index]["Concepto"].ToString(); - obj.Estatus = dtP.Rows[index]["Estatus"].ToString().ToEntero(); - } - else if (index == noP) - { - obj.Estatus = -1; - obj.Concepto = "Agregar"; - } - if (index < noD) - { - obj.ImporteD = dtD.Rows[index]["Importe"].ToString().ToDecimal(); - obj.CveConceptoD = dtD.Rows[index]["CveConcepto"].ToString().ToEntero(); - obj.ConceptoD = dtD.Rows[index]["Concepto"].ToString(); - obj.EstatusD = dtD.Rows[index]["Estatus"].ToString().ToEntero(); - } - else if (index == noD) - { - obj.EstatusD = -1; - obj.ConceptoD = "Agregar"; - } - listaconceptos.Add(obj); - } - } - listaconceptos.Add(new ConceptosPersonal()); - - - ConceptosPersonal objST = new ConceptosPersonal(); - objST.Importe = TotalP; - objST.CveConcepto = 0; - objST.Concepto = "Total Percepciones"; - objST.Estatus = -2; - objST.ImporteD = TotalD; - objST.CveConceptoD = 0; - objST.ConceptoD = "Total Deducciones"; - objST.EstatusD = -2; - - listaconceptos.Add(objST); - - ConceptosPersonal objT = new ConceptosPersonal(); - - objT.CveConcepto = 0; - objT.Concepto = ""; - objT.Estatus = -3; - objT.ImporteD = objST.Importe + objST.ImporteD; - objT.CveConceptoD = 0; - objT.ConceptoD = "Total"; - objT.EstatusD = -3; - listaconceptos.Add(objT); - return listaconceptos; - } - } - - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - CargaDdlPersonal(); - CargaMotivoBaja(); - CvePeriodoFiniquito = 0; - if (Request["CvePersonal"] != null && Request["CvePersonal"].ToString().ToEntero() > 0) - { - CvePersonal = Request["CvePersonal"].ToString().ToEntero(); - } - else - { - CvePersonal = -1; - } - if (!CargaDatosFiniquito()) - { - } - RegistraScript("$('#ModalEmpleados').modal();"); - } - - if (CvePersonal > 0 & CvePeriodoFiniquito > 0) - { - LtlEmpleadoCancelar.Visible = true; - } - } - - private void CargaMotivoBaja() - { - DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa); - DdlMotivoBaja.DataBind(); - } - private void CargaDdlPersonal() - { - ClsRH ObjPersonal = new ClsRH(); - if (ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)) - { - DdlPersonal.DataSource = ObjPersonal.DtResultados; - DdlPersonal.DataBind(); - } - ObjPersonal.Dispose(); - } - - private bool CargaDatosFiniquito() - { - bool retorno = true; - if (CvePersonal > 0) - { - DdlPersonal.SelectedValueExist(CvePersonal.ToString()); - string Nombre = ""; - string FechaBaja = ""; - string EstatusPersonal = ""; - CvePeriodoFiniquito = 0; - CveTipoPeriodo = 0; - esLiquidacion = false; - pnlupValoresFiniquito.Visible = false; - DdlMotivoBaja.SelectedValue = "-1"; - using (ClsRH ObjPersonal = new ClsRH()) - { - if (ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) && ObjPersonal.DtResultados.Rows.Count > 0) - { - DataRow prow = ObjPersonal.DtResultados.Rows[0]; - Nombre = prow["Nombre"].ToString(); - FechaBaja = string.Format("{0:dd/MM/yyyy}", ObjPersonal.FechaBaja); - EstatusPersonal = string.Format("{0}", prow["EstatusPersonal"]); - CveTipoPeriodo = prow["CveTipoPeriodo"].ToString().ToEntero(); - } - if (ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) - { - DataRow prow = ObjPersonal.DtResultados.Rows[0]; - CvePeriodoFiniquito = prow["CvePeriodoFiniquito"].ToString().ToEntero(); - FechaBaja = string.Format("{0:dd/MM/yyyy}", prow["FechaFin"]); - DdlMotivoBaja.SelectedValueExist(prow["CveMotivoBaja"].ToString().ToEntero()); - var stringesliquidacion = prow["esLiquidacion"].ToString(); - esLiquidacion = (stringesliquidacion == "True" || stringesliquidacion == "1"); - ChkesLiquidacion.Checked = esLiquidacion; - } - } - Timbrado tr; - if (DdlMotivoBaja.SelectedValue.ToEntero() > 0) - LblMotivoBaja.Text = DdlMotivoBaja.SelectedItem.Text; - else - LblMotivoBaja.Text = ""; - HypEmpleado.Text = Nombre; - HypEmpleado.NavigateUrl = string.Format("/RH/Personal.aspx?CvePersonal={0}", CvePersonal); - LblFechaBaja.Text = FechaBaja; - LblEstatus.Text = EstatusPersonal; - TxtFechaBaja.Text = FechaBaja; - DdlTipoPeriodo_SelectedIndexChanged(null, null); - LblPerido.Text = DdlPeriodo.SelectedItem.Text; - if (CvePeriodoFiniquito <= 0) - retorno = false; - pnlupValoresFiniquito.Visible = true; - using (ClsNominas ObjNom = new ClsNominas()) - { - if (ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa)) - { - DataRow finrow = ObjNom.DtResultados.Rows[0]; - TxtAntiguedad.Text = $"{finrow["Antiguedad"]}"; - TxtdiasVacaciones.Text = $"{finrow["Diasvacaciones"]}"; - TxtDiasLaborados.Text = $"{finrow["diaslaborados"]}"; - TxtDiasProporcion.Text = $"{finrow["diasProporcion"]}"; - - TxtVaciones.Text = $"{finrow["Vacaciones"]}"; - TxtDiasPago.Text = $"{finrow["Diasvacaciones"]}"; - TxtDiasPendientes.Text = $"{finrow["diasporpagar"]}"; - TxtVacacionesporPagar.Text = $"{finrow["VacacionesporPagar"]}"; - - TxtPorcentjePrima.Text = $"{finrow["PrimaPorcentaje"]}"; - TxtPrimaVacacional.Text = $"{finrow["PrimaVacacional"]}"; - TxtPrimaPagada.Text = $"{finrow["PrimaPagada"]}"; - TxtPrimaPorPagar.Text = $"{finrow["PrimaVacacionalPorPagar"]}"; - } - if (ObjNom.DTSetResultados.Tables.Count > 5) - { - DataTable dtconceptos = ObjNom.DTSetResultados.Tables[1]; - DataTable dtconpersonal = ObjNom.DTSetResultados.Tables[5]; - - int maxFila = dtconpersonal.MAX("Fila", "Tipo<3").ToEntero(); - List lfin = new List(); - - if (maxFila > 0) - { - DataRow conPerrow; - DataRow conrow; - NConcepto sr; - - for (int i = 1; i <= maxFila; i++) - { - sr = new NConcepto(); - conPerrow = dtconpersonal.FiltroPrimero(string.Format("Tipo=1 AND Fila ={0}", i)); - if (conPerrow != null) - { - sr.CveConceptoP = conPerrow["CveConcepto"].ToString().ToEntero(); - conrow = dtconceptos.FiltroPrimero(string.Format("CveConcepto ={0}", sr.CveConceptoP)); - sr.ConceptoP = conrow["Concepto"].ToString(); - sr.ValorP = conPerrow["Valor"].ToString().ToDouble(); - sr.ImporteP = conPerrow["Importe"].ToString().ToDouble(); - sr.NoConceptoP = conrow["Codigo"].ToString(); - } - - - conPerrow = dtconpersonal.FiltroPrimero(string.Format("Tipo=2 AND Fila ={0}", i)); - if (conPerrow != null) - { - sr.CveConceptoD = conPerrow["CveConcepto"].ToString().ToEntero(); - conrow = dtconceptos.FiltroPrimero(string.Format("CveConcepto ={0}", sr.CveConceptoD)); - sr.ConceptoD = conrow["Concepto"].ToString(); - sr.ValorD= conPerrow["Valor"].ToString().ToDouble(); - sr.ImporteD = conPerrow["Importe"].ToString().ToDouble(); - sr.NoConceptoD = conrow["Codigo"].ToString(); - } - - - - lfin.Add(sr); - } - } - GvConceptos.DataSource = lfin; - GvConceptos.DataBind(); - } - } - //GvConceptos.DataSource = ConceptsPersonas; - //GvConceptos.DataBind(); - } - else - retorno = false; - return retorno; - } - - - protected void LnkCampiarEmpleado_Click(object sender, EventArgs e) - { - CvePersonal = DdlPersonal.SelectedValue.ToEntero(); - - - using (ClsRH ObjPersonal = new ClsRH()) - { - if (ObjPersonal.UpPersonalAltas(CvePersonal, UsuarioActual.CveUsuario, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked) && ObjPersonal.DtResultados.Rows.Count > 0) - { - } - } - if (pnlupValoresFiniquito.Visible) - { - } - if (!CargaDatosFiniquito()) - RegistraScript("$('#ModalEmpleados').modal('hide');"); - upDatos.Update(); - } - protected void LnkCalcular_Click(object sender, EventArgs e) - { - } - protected void LnkAutorizar_Click(object sender, EventArgs e) - { - } - protected void LnkTimbrar_Click(object sender, EventArgs e) - { - } - protected void LnkFormatoRenuncia_Click(object sender, EventArgs e) - { - } - protected void DdlPersonal_SelectedIndexChanged(object sender, EventArgs e) - { - Response.Redirect($"/Nomina/Finiquito.aspx?CvePersonal={DdlPersonal.SelectedValue}"); - } - protected void DdlTipoPeriodo_SelectedIndexChanged(object sender, EventArgs e) - { - int CveTipoPeriodoactual = DdlTipoPeriodo.SelectedValue.ToEntero() > 0 ? DdlTipoPeriodo.SelectedValue.ToEntero() : CveTipoPeriodo; - string fechabaja = TxtFechaBaja.Text; - DataTable dtperiodos = new DataTable(); - ClsNominas ObjPeriodos = new ClsNominas(); - if (ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, -1)) - { - dtperiodos = ObjPeriodos.DtResultados; - if (Information.IsNothing(sender) && CvePeriodoFiniquito > 0) - { - DataRow row = dtperiodos.FiltroPrimero(string.Format("CvePeriodo={0} ", CvePeriodoFiniquito)); - if (!Information.IsNothing(row)) - { - CveTipoPeriodoactual = row["CveTipoPeriodo"].ToString().ToEntero(); - DdlTipoPeriodo.SelectedValueExist(CveTipoPeriodoactual == 6 ? "6" : "-1"); - } - } - dtperiodos = ObjPeriodos.DtResultados.FiltraParametros(string.Format("(Estatus IN (1,2,3,4) AND CveTipoPeriodo={0}) ", CveTipoPeriodoactual)); - // FechaInicio, P.FechaFin - DdlPeriodo.Items.Clear(); - DdlPeriodo.Items.Add(new ListItem("Seleccione", "-1")); - DdlPeriodo.SelectedValue = "-1"; - DdlPeriodo.DataSource = dtperiodos; - } - else - DdlPeriodo.DataSource = null; - ObjPeriodos.Dispose(); - DdlPeriodo.DataBind(); - if (fechabaja.Length > 0 && dtperiodos.Rows.Count > 0) - { - if ((CvePeriodoFiniquito > 0) && Information.IsNothing(sender)) - DdlPeriodo.SelectedValueExist(CvePeriodoFiniquito); - else - { - DataRow row = dtperiodos.FiltroPrimero(string.Format("(FechaInicio<='{0:yyyy/MM/dd}' AND FechaFin>='{0:yyyy/MM/dd}') ", fechabaja.ToDate())); - if (!Information.IsNothing(row)) - DdlPeriodo.SelectedValueExist(row["CvePeriodo"]); - } - } - } - - protected void GvConceptos_RowDataBound(object sender, GridViewRowEventArgs e) - { - if (e.Row.RowType == DataControlRowType.DataRow) - { - // Datakeys - // Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD - int CveConcepto = e.Row.DataKey("CveConceptoP").ToEntero(); - int CveConceptoD = e.Row.DataKey("CveConceptoD").ToEntero(); - // Dim Importe As Decimal = e.Row.DataKey("Importe").ToDecimal() - // Dim ImporteD As Decimal = e.Row.DataKey("ImporteD").ToDecimal() - int Estatus = e.Row.DataKey("EstatusP").ToEntero(); - int EstatusD = e.Row.DataKey("EstatusD").ToEntero(); - - // Controles - Label LtlConcepto = e.Row.FCLabel("LtlConcepto"); - LinkButton LnkConcepto = e.Row.FCLinkButton("LnkConcepto"); - Label LtlConceptoD = e.Row.FCLabel("LtlConceptoD"); - LinkButton LnkConceptoD = e.Row.FCLinkButton("LnkConceptod"); - Label LtlImporte = e.Row.FCLabel("LtlImporte"); - LinkButton LnkImporte = e.Row.FCLinkButton("LnkImporte"); - Label LtlImporteD = e.Row.FCLabel("LtlImporteD"); - LinkButton LnkImporteD = e.Row.FCLinkButton("LnkImporteD"); - - if (Estatus < -1 | EstatusD < -1) - e.Row.CssClass = "ConceptosTotales"; - if (CveConcepto == 0 && (Estatus == 0 || Estatus == -1 || Estatus == -3)) - LtlImporte.Text = ""; - - if (CveConceptoD == 0 && (EstatusD == 0 || EstatusD == -1)) - LtlImporteD.Text = ""; - - if (Estatus == -1) - LtlConcepto.Visible = false; - else if (Estatus > 0) - LtlImporte.Visible = false; - - if (EstatusD == -1) - LtlConceptoD.Visible = false; - else if (EstatusD > 0) - LtlImporteD.Visible = false; - - - LnkConcepto.Visible = !LtlConcepto.Visible; - LnkConceptoD.Visible = !LtlConceptoD.Visible; - LnkImporte.Visible = !LtlImporte.Visible; - LnkImporteD.Visible = !LtlImporteD.Visible; - } - } - - protected void LnkConcepto_Click(object sender, EventArgs e) - { - GridViewRow gvRow = (GridViewRow)((LinkButton)sender).NamingContainer; - GCEstatus = gvRow.DataKey("Estatus").ToEntero(); - GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero(); - GCImporte = gvRow.DataKey("Importe").ToDecimal(); - OpenModalConceptos(1); - } - protected void LnkConceptoD_Click(object sender, EventArgs e) - { - GridViewRow gvRow = (GridViewRow)((LinkButton)sender).NamingContainer; - GCEstatus = gvRow.DataKey("Estatus").ToEntero(); - GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero(); - GCImporte = gvRow.DataKey("Importe").ToDecimal(); - OpenModalConceptos(2); - } - - private void OpenModalConceptos(int Tipo) - { - if (GCEstatus == -1) - { - } - else - { - } - RegistraScript("$('#ModalConceptos').modal();"); - } - - protected void LnkAceptarConceptos_Click(object sender, EventArgs e) - { - RegistraScript("$('#ModalConceptos').modal('hide');"); - } -} diff --git a/Nomina/FiniquitoOld.aspx.vb b/Nomina/FiniquitoOld.aspx.vb deleted file mode 100644 index 18c1cda0f..000000000 --- a/Nomina/FiniquitoOld.aspx.vb +++ /dev/null @@ -1,462 +0,0 @@ -Option Strict On - -Imports System.Data -Imports Extensiones - -Partial Class Nomina_FiniquitoVB - Inherits ClsPaginas - Private Class ConceptosPersonal - Public Sub New() - Concepto = "" - ConceptoD = "" - CveConcepto = 0 - CveConceptoD = 0 - Estatus = 0 - Estatus = 0 - End Sub - Public Property Concepto As String - Public Property CveConcepto As Integer - Public Property Importe As Decimal - Public Property Estatus As Integer - - Public Property ConceptoD As String - Public Property CveConceptoD As Integer - Public Property ImporteD As Decimal - Public Property EstatusD As Integer - End Class -#Region "Propiedades" - - Private Property CvePersonal As Integer - Get - If Not IsNothing(ViewState("CvePersonal")) Then - Return ViewState("CvePersonal").ToString().ToEntero() - Else - Return 0 - End If - End Get - Set(value As Integer) - ViewState("CvePersonal") = value - End Set - End Property - Private Property CveTipoPeriodo As Integer - Get - If Not IsNothing(ViewState("CveTipoPeriodo")) Then - Return ViewState("CveTipoPeriodo").ToString().ToEntero() - Else - Return 0 - End If - End Get - Set(value As Integer) - ViewState("CveTipoPeriodo") = value - End Set - End Property - Private Property CvePeriodoFiniquito As Integer - Get - If Not IsNothing(ViewState("CvePeriodoFiniquito")) Then - Return ViewState("CvePeriodoFiniquito").ToString().ToEntero() - Else - Return 0 - End If - End Get - Set(value As Integer) - ViewState("CvePeriodoFiniquito") = value - End Set - End Property - - Private Property GCEstatus As Integer - Get - If Not IsNothing(ViewState("GCEstatus")) Then - Return ViewState("GCEstatus").ToString().ToEntero() - Else - Return 0 - End If - End Get - Set - ViewState("GCEstatus") = Value - End Set - End Property - Private Property GCCveConcepto As Integer - Get - If Not IsNothing(ViewState("GCCveConcepto")) Then - Return ViewState("GCCveConcepto").ToString().ToEntero() - Else - Return 0 - End If - End Get - Set - ViewState("GCCveConcepto") = Value - End Set - End Property - Private Property GCImporte As Decimal - Get - If Not IsNothing(ViewState("GCImporte")) Then - Return ViewState("GCImporte").ToString().ToDecimal() - Else - Return 0 - End If - End Get - Set - ViewState("GCImporte") = Value - End Set - End Property - Private ReadOnly Property ConceptsPersonas As List(Of ConceptosPersonal) - Get - Dim listaconceptos As New List(Of ConceptosPersonal) - Dim TotalP As Decimal = 0 - Dim TotalD As Decimal = 0 - If (Not IsNothing(DTConceptosPersonal) AndAlso DTConceptosPersonal.Rows.Count > 0) Then - Dim dtP As DataTable = DTConceptosPersonal.FiltraParametros("Tipo=1") - Dim dtD As DataTable = DTConceptosPersonal.FiltraParametros("Tipo=2") - Dim noP = dtP.Rows.Count() - Dim noD = dtD.Rows.Count() - Dim max = If(noP > noD, noP, noD) - TotalP = dtP.SUM("Importe").ToString().ToDecimal() - TotalD = dtD.SUM("Importe").ToString().ToDecimal() - For index = 0 To max - Dim obj As New ConceptosPersonal() - If index < noP Then - obj.Importe = dtP.Rows(index)("Importe").ToString().ToDecimal() - obj.CveConcepto = dtP.Rows(index)("CveConcepto").ToString().ToEntero() - obj.Concepto = dtP.Rows(index)("Concepto").ToString() - obj.Estatus = dtP.Rows(index)("Estatus").ToString().ToEntero() - ElseIf index = noP Then - obj.Estatus = -1 - obj.Concepto = "Agregar" - End If - If index < noD Then - obj.ImporteD = dtD.Rows(index)("Importe").ToString().ToDecimal() - obj.CveConceptoD = dtD.Rows(index)("CveConcepto").ToString().ToEntero() - obj.ConceptoD = dtD.Rows(index)("Concepto").ToString() - obj.EstatusD = dtD.Rows(index)("Estatus").ToString().ToEntero() - ElseIf index = noD Then - obj.EstatusD = -1 - obj.ConceptoD = "Agregar" - End If - listaconceptos.Add(obj) - Next - End If - listaconceptos.Add(New ConceptosPersonal()) - - - Dim objST As New ConceptosPersonal() - objST.Importe = TotalP - objST.CveConcepto = 0 - objST.Concepto = "Total Percepciones" - objST.Estatus = -2 - objST.ImporteD = TotalD - objST.CveConceptoD = 0 - objST.ConceptoD = "Total Deducciones" - objST.EstatusD = -2 - - listaconceptos.Add(objST) - - Dim objT As New ConceptosPersonal() - - objT.CveConcepto = 0 - objT.Concepto = "" - objT.Estatus = -3 - objT.ImporteD = objST.Importe + objST.ImporteD - objT.CveConceptoD = 0 - objT.ConceptoD = "Total" - objT.EstatusD = -3 - listaconceptos.Add(objT) - Return listaconceptos - End Get - End Property - - Private Property DTConceptosPersonal As DataTable - Get - If Not IsNothing(ViewState("DTConceptosPersonal")) Then - Return DirectCast(ViewState("DTConceptosPersonal"), DataTable) - Else - Return Nothing - End If - End Get - Set - ViewState("DTConceptosPersonal") = Value - End Set - End Property - Private Property DTConceptos As DataTable - Get - If Not IsNothing(ViewState("DTConceptos")) Then - Return DirectCast(ViewState("DTConceptos"), DataTable) - Else - Return Nothing - End If - End Get - Set - ViewState("DTConceptos") = Value - End Set - End Property - - - Private Property esLiquidacion As Boolean - Get - If Not IsNothing(ViewState("esLiquidacion")) Then - Return CBool(ViewState("esLiquidacion")) - Else - Return False - End If - End Get - Set - ViewState("esLiquidacion") = Value - End Set - End Property -#End Region - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - If Not Page.IsPostBack Then - - CargaDdlPersonal() - CargaMotivoBaja() - CvePeriodoFiniquito = 0 - If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then - ViewState("CvePersonal") = Request("CvePersonal") - Else - CvePersonal = -1 - End If - If Not CargaDatosFiniquito() Then - End If - RegistraScript("$('#ModalEmpleados').modal();") - - End If - - If CvePersonal > 0 And CvePeriodoFiniquito > 0 Then - LtlEmpleadoCancelar.Visible = True - End If - End Sub - - Private Sub CargaMotivoBaja() - DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DdlMotivoBaja.DataBind() - End Sub - Private Sub CargaDdlPersonal() - Dim ObjPersonal As New ClsRH - If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then - DdlPersonal.DataSource = ObjPersonal.DtResultados - DdlPersonal.DataBind() - End If - ObjPersonal.Dispose() - End Sub - - Private Function CargaDatosFiniquito() As Boolean - Dim retorno As Boolean = True - If CvePersonal > 0 Then - - DdlPersonal.SelectedValueExist(CvePersonal.ToString()) - Dim Nombre As String = "" - Dim FechaBaja As String = "" - Dim EstatusPersonal As String = "" - CvePeriodoFiniquito = 0 - CveTipoPeriodo = 0 - esLiquidacion = False - pnlupValoresFiniquito.Visible = False - DdlMotivoBaja.SelectedValue = "-1" - Using ObjPersonal As New ClsRH() - If ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then - Nombre = ObjPersonal.DtResultados.Rows(0)("Nombre").ToString() - FechaBaja = String.Format("{0:dd/MM/yyyy}", ObjPersonal.FechaBaja) - EstatusPersonal = String.Format("{0}", ObjPersonal.DtResultados.Rows(0)("EstatusPersonal")) - CveTipoPeriodo = ObjPersonal.DtResultados.Rows(0)("CveTipoPeriodo").ToString().ToEntero() - End If - If ObjPersonal.GetPersonalAltas(CvePersonal) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then - CvePeriodoFiniquito = ObjPersonal.DtResultados.Rows(0)("CvePeriodoFiniquito").ToString().ToEntero() - FechaBaja = String.Format("{0:dd/MM/yyyy}", ObjPersonal.DtResultados.Rows(0)("FechaFin")) - DdlMotivoBaja.SelectedValueExist(ObjPersonal.DtResultados.Rows(0)("CveMotivoBaja").ToString().ToEntero()) - Dim stringesliquidacion = ObjPersonal.DtResultados.Rows(0)("esLiquidacion").ToString() - esLiquidacion = (stringesliquidacion = "True" OrElse stringesliquidacion = "1") - ChkesLiquidacion.Checked = esLiquidacion - End If - End Using - If DdlMotivoBaja.SelectedValue.ToEntero() > 0 Then - LblMotivoBaja.Text = DdlMotivoBaja.SelectedItem.Text - Else - LblMotivoBaja.Text = "" - End If - HypEmpleado.Text = Nombre - HypEmpleado.NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", CvePersonal) - LblFechaBaja.Text = FechaBaja - LblEstatus.Text = EstatusPersonal - TxtFechaBaja.Text = FechaBaja - DdlTipoPeriodo_SelectedIndexChanged(Nothing, Nothing) - LblPerido.Text = DdlPeriodo.SelectedItem.Text - If CvePeriodoFiniquito <= 0 Then - retorno = False - End If - pnlupValoresFiniquito.Visible = True - Using ObjNom As New ClsNominas() - 'If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then - ' DTConceptosPersonal = ObjNom.DtResultados - 'Autoriza nomina - 'Finiquita Liquidación - 'Rep Nomina - 'RepInversion de nomina - 'Alertas Altas /Bajas - ' - 'End If - End Using - GvConceptos.DataSource = ConceptsPersonas - GvConceptos.DataBind() - Else - retorno = False - End If - Return retorno - End Function - - - Protected Sub LnkCampiarEmpleado_Click(sender As Object, e As EventArgs) - CvePersonal = DdlPersonal.SelectedValue.ToEntero() - - - Using ObjPersonal As New ClsRH() - If ObjPersonal.UpPersonalAltas(CvePersonal, UsuarioActual.CveUsuario, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), DdlPeriodo.SelectedValue.ToEntero(), DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked) AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then - - End If - End Using - If pnlupValoresFiniquito.Visible Then - - End If - If Not CargaDatosFiniquito() Then - - RegistraScript("$('#ModalEmpleados').modal('hide');") - End If - upDatos.Update() - End Sub - Protected Sub LnkCalcular_Click(sender As Object, e As EventArgs) - - End Sub - Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs) - - End Sub - Protected Sub LnkTimbrar_Click(sender As Object, e As EventArgs) - - End Sub - Protected Sub LnkFormatoRenuncia_Click(sender As Object, e As EventArgs) - - End Sub - Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) - Response.Redirect($"/Nomina/Finiquito.aspx?CvePersonal={DdlPersonal.SelectedValue}") - 'Alert($"insertParam('CvePersonal','{DdlPersonal.SelectedValue}')") - 'RegistraScript($"insertParam('CvePersonal','{DdlPersonal.SelectedValue}')") - End Sub - Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) - Dim CveTipoPeriodoactual As Integer = If(DdlTipoPeriodo.SelectedValue.ToEntero() > 0, DdlTipoPeriodo.SelectedValue.ToEntero(), CveTipoPeriodo) - Dim fechabaja As String = TxtFechaBaja.Text - Dim dtperiodos As New DataTable - Dim ObjPeriodos As New ClsNominas - If ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, -1) Then - dtperiodos = ObjPeriodos.DtResultados - If IsNothing(sender) AndAlso CvePeriodoFiniquito > 0 Then - Dim row As DataRow = dtperiodos.FiltroPrimero(String.Format("CvePeriodo={0} ", CvePeriodoFiniquito)) - If Not IsNothing(row) Then - CveTipoPeriodoactual = row("CveTipoPeriodo").ToString().ToEntero() - DdlTipoPeriodo.SelectedValueExist(If(CveTipoPeriodoactual = 6, "6", "-1")) - End If - End If - dtperiodos = ObjPeriodos.DtResultados.FiltraParametros(String.Format("(Estatus IN (1,2,3,4) AND CveTipoPeriodo={0}) ", CveTipoPeriodoactual)) - 'FechaInicio, P.FechaFin - DdlPeriodo.Items.Clear() - DdlPeriodo.Items.Add(New ListItem("Seleccione", "-1")) - DdlPeriodo.SelectedValue = "-1" - DdlPeriodo.DataSource = dtperiodos - Else - DdlPeriodo.DataSource = Nothing - End If - ObjPeriodos.Dispose() - DdlPeriodo.DataBind() - If fechabaja.Length > 0 AndAlso dtperiodos.Rows.Count > 0 Then - If (CvePeriodoFiniquito > 0) AndAlso IsNothing(sender) Then - DdlPeriodo.SelectedValueExist(CvePeriodoFiniquito) - Else - Dim row As DataRow = dtperiodos.FiltroPrimero(String.Format("(FechaInicio<='{0:yyyy/MM/dd}' AND FechaFin>='{0:yyyy/MM/dd}') ", fechabaja.ToDate())) - If Not IsNothing(row) Then - DdlPeriodo.SelectedValueExist(row("CvePeriodo")) - End If - End If - - End If - End Sub - -#Region "Conceptos" - Protected Sub GvConceptos_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - 'Datakeys - 'Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD - Dim CveConcepto As Integer = e.Row.DataKey("CveConcepto").ToEntero() - Dim CveConceptoD As Integer = e.Row.DataKey("CveConceptoD").ToEntero() - 'Dim Importe As Decimal = e.Row.DataKey("Importe").ToDecimal() - 'Dim ImporteD As Decimal = e.Row.DataKey("ImporteD").ToDecimal() - Dim Estatus As Integer = e.Row.DataKey("Estatus").ToEntero() - Dim EstatusD As Integer = e.Row.DataKey("EstatusD").ToEntero() - - 'Controles - Dim LtlConcepto As Label = e.Row.FCLabel("LtlConcepto") - Dim LnkConcepto As LinkButton = e.Row.FCLinkButton("LnkConcepto") - Dim LtlConceptoD As Label = e.Row.FCLabel("LtlConceptoD") - Dim LnkConceptoD As LinkButton = e.Row.FCLinkButton("LnkConceptod") - Dim LtlImporte As Label = e.Row.FCLabel("LtlImporte") - Dim LnkImporte As LinkButton = e.Row.FCLinkButton("LnkImporte") - Dim LtlImporteD As Label = e.Row.FCLabel("LtlImporteD") - Dim LnkImporteD As LinkButton = e.Row.FCLinkButton("LnkImporteD") - - If Estatus < -1 Or EstatusD < -1 Then - e.Row.CssClass = "ConceptosTotales" - End If - If CveConcepto = 0 AndAlso (Estatus = 0 OrElse Estatus = -1 OrElse Estatus = -3) Then - LtlImporte.Text = "" - End If - - If CveConceptoD = 0 AndAlso (EstatusD = 0 OrElse EstatusD = -1) Then - LtlImporteD.Text = "" - End If - - If Estatus = -1 Then - LtlConcepto.Visible = False - ElseIf Estatus > 0 Then - LtlImporte.Visible = False - End If - - If EstatusD = -1 Then - LtlConceptoD.Visible = False - ElseIf EstatusD > 0 Then - LtlImporteD.Visible = False - End If - - - LnkConcepto.Visible = Not LtlConcepto.Visible - LnkConceptoD.Visible = Not LtlConceptoD.Visible - LnkImporte.Visible = Not LtlImporte.Visible - LnkImporteD.Visible = Not LtlImporteD.Visible - - End If - End Sub - - Protected Sub LnkConcepto_Click(sender As Object, e As EventArgs) - Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - GCEstatus = gvRow.DataKey("Estatus").ToEntero() - GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero() - GCImporte = gvRow.DataKey("Importe").ToDecimal() - OpenModalConceptos(1) - End Sub - Protected Sub LnkConceptoD_Click(sender As Object, e As EventArgs) - Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - GCEstatus = gvRow.DataKey("Estatus").ToEntero() - GCCveConcepto = gvRow.DataKey("CveConcepto").ToEntero() - GCImporte = gvRow.DataKey("Importe").ToDecimal() - OpenModalConceptos(2) - End Sub - - Private Sub OpenModalConceptos(Tipo As Integer) - If GCEstatus = -1 Then - Else - - End If - RegistraScript("$('#ModalConceptos').modal();") - End Sub - - Protected Sub LnkAceptarConceptos_Click(sender As Object, e As EventArgs) - - RegistraScript("$('#ModalConceptos').modal('hide');") - End Sub - -#End Region -End Class diff --git a/OC/CatEstatus.aspx.vb b/OC/CatEstatus.aspx.vb index 7a5600c37..48e439649 100644 --- a/OC/CatEstatus.aspx.vb +++ b/OC/CatEstatus.aspx.vb @@ -2,13 +2,14 @@ Option Strict On Imports System.Data +Imports System.Diagnostics Imports Extensiones Partial Class OC_CatEstatus - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "Propiedades" - 'Local + 'Local Private Property DTEstatusUsuarios As DataTable Get Return CType(ViewState("DTEstatusUsuarios"), DataTable) @@ -56,9 +57,9 @@ Partial Class OC_CatEstatus Set(value As Integer) ViewState("CveEstatus") = value End Set - End Property + End Property #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then CreaGrid("Req") @@ -70,13 +71,14 @@ Partial Class OC_CatEstatus CargaEstatus() CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargaUsuarios() + sssss() 'SOLO MUESTRA SUBPROYECTO 'TdProyecto.Visible = False 'TdSubProyectoTitulo.Visible = False - 'DivProyecto.Visible = False + 'DivProyecto.Visible = False 'LblSubProyecto.Visible = False DdlSubProyecto_SelectedIndexChanged(DdlSubProyecto, EventArgs.Empty) @@ -87,11 +89,61 @@ Partial Class OC_CatEstatus End If End Sub + Private Sub sssss() + Dim length = 200000 + Dim concatString = "" + Dim aaa As New StringBuilder + Dim stopWatch = New Stopwatch() + stopWatch.Start() + + For i As Integer = 0 To length - 1 + concatString = concatString & i + Next + + stopWatch.[Stop]() + aaa.Append($"String Concat took: {stopWatch.ElapsedMilliseconds} ms, for {length} iterations.
    ") + stopWatch.Reset() + concatString = String.Empty + stopWatch.Start() + + For i As Integer = 0 To length - 1 + concatString = $"{concatString}a" + Next + + stopWatch.[Stop]() + aaa.Append($"String Interpolation took: {stopWatch.ElapsedMilliseconds} ms, for {length} iterations.
    ") + stopWatch.Reset() + concatString = String.Empty + Dim stringBuilder = New StringBuilder() + stopWatch.Start() + + For i As Integer = 0 To length - 1 + stringBuilder.Append("a") + Next + + concatString = stringBuilder.ToString() + stopWatch.[Stop]() + aaa.Append($"String Builder took: {stopWatch.ElapsedMilliseconds} ms, for {length} iterations.
    ") + stopWatch.Reset() + concatString = String.Empty + + stopWatch.Start() + + For i As Integer = 0 To length - 1 + concatString = String.Format("a{0}", i) + Next + + stopWatch.[Stop]() + aaa.Append($"String.Format took: {stopWatch.ElapsedMilliseconds} ms, for {length} iterations.
    ") + Alert(aaa.ToString) + + End Sub + #Region "C A T A L O G O " Public Sub CargaDatos() Dim ObjEstatus As New ClsOC - If ObjEstatus.GetEstatus() Then + If ObjEstatus.GetEstatus(UsuarioActual.CveEmpresa) Then ViewState("DTOCEstatus") = ObjEstatus.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) GlobalDTOCEstatus(UsuarioActual.CveEmpresa) = ObjEstatus.DtResultados Else @@ -682,10 +734,13 @@ Partial Class OC_CatEstatus objEstatusOC.Dispose() CargaGridEstatusUsuarios("OC") - End Sub + End Sub + + + #End Region #End Region - - - + + + End Class diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index bd06ab0dd..f3820c77b 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -526,13 +526,13 @@ Partial Class Clientes Set(value As DateTime) ViewState("FechaIngLineaAdicional") = value End Set - End Property - - - - + End Property + + + + #End Region - + #Region "Documentacion" Private Property DTDocumentacion As DataTable Get @@ -881,8 +881,8 @@ Partial Class Clientes Else - 'Configuración de Modalidad Insert - CargaEstados() + 'Configuración de Modalidad Insert + CargaEstados() BtnGuardar.Visible = PermiteGuardar() If UsuarioActual.Empresa.Funcionalidad(525) = "1" Then @@ -1301,7 +1301,6 @@ Partial Class Clientes Private Sub CargaCombos() - CargaSubProyectoss() CargaMetodosPago() CargaPrecioLista() CargaVendedores() @@ -9853,7 +9852,7 @@ Partial Class Clientes Alert("Puntuación Inicializada") End If Acum.Dispose() - End Sub + End Sub #End Region Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs) If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 19d47eaed..ac6acc141 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -824,7 +824,7 @@ Partial Class Ventas_ClientesAbonar If DdlCuenta.SelectedValue > 0 Then CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero Else - CveMoneda = If(Request("CveMoneda").ToString.ToEntero > 0, Request("CveMoneda").ToString.ToEntero, 1) + CveMoneda = IfNull(Request("CveMoneda"), "1").ToString.ToEntero End If CvePrePoliza = ObjMov.AddPrePolizas("Ventas/ClientesAbonar", 11, TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -1151,7 +1151,7 @@ Partial Class Ventas_ClientesAbonar Dim ImporteMN As Decimal = (ImporteMovimiento * tipoCambioPago).RoundSQL Dim IdCtaContable As Integer = 0 - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, VentaActual.SerieFolio, 134, VentaActual.SerieFolio, IdCtaContable, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 134, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero) Then MsgError = "No se pudo insertar la póliza" End If End If