From 55cc085363e085ed1db879d4b29cc1b4696d0465 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 6 Sep 2021 03:43:00 -0700 Subject: [PATCH 01/11] --- App_Code/ClsGenerales.vb | 8 +- App_Code/ClsNominas.vb | 65 ++++ App_Code/ClsPaginas.vb | 1 + App_Code/LogicNominas.vb | 6 +- LogIn.aspx.vb | 3 +- Nomina/ChecadorAsistencia.aspx | 279 ++++++++++++++ Nomina/ChecadorAsistencia.aspx.cs | 255 +++++++++++++ Nomina/Nomina.aspx | 437 ++++++++++++++++++++- Nomina/Nomina.aspx.cs | 592 +++++++++++++++++++++++------ Nomina/ReportedeAcumulados.aspx.cs | 12 +- RH/CatPersonal.aspx | 16 +- RH/CatPersonal.aspx.vb | 6 +- RH/Personal.aspx | 220 +++++++++-- RH/Personal.aspx.vb | 123 ++++-- vwd.webinfo | 2 + 15 files changed, 1822 insertions(+), 203 deletions(-) create mode 100644 Nomina/ChecadorAsistencia.aspx create mode 100644 Nomina/ChecadorAsistencia.aspx.cs diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 43c95d644..9acc9375e 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -2525,7 +2525,7 @@ Public Class ClsGenerales Public Function GetHistorialBitacora(CveAcarreo As Integer, CveOrdenCompra As Integer, CveActivoFijo As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional CvePersonal As Integer = -1, - Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1) As Boolean + Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveConceptoNomina As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_HistorialBitacoraGet") @@ -2542,7 +2542,11 @@ Public Class ClsGenerales .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza - + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveConceptoNomina", SqlDbType.Int).Value = CveConceptoNomina + + + End With 'SqlTypes.SqlDateTime.Null Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 3fe0eeeb6..5ac824654 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2251,6 +2251,29 @@ Public Class ClsNominas End Try Return retorno End Function + Public Function GetchecadorAdistencia(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + + Try + DTSet = New DataSet() + DataAdapter("PA_RH_PersonalChecadorASistencia", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + SqlAdapter.Fill(DTSet) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al Realizar el calculo de asistencia.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al Realizar el calculo de asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetNominaAcumulado(Ejercicio As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodoI As Integer, CvePeriodoF As Integer, CveEmpresa As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean Dim retorno As Boolean = False @@ -2280,6 +2303,48 @@ Public Class ClsNominas Return retorno End Function +#Region "Vacaciones" + Public Function GETPersonalVacResumen(CveEmpresa As Integer, CvePersonal As Integer) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_PersonalVacResumenGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Decimal).Value = CvePersonal + End With + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GETPersonalVacaciones(CveEmpresa As Integer, CvePersonal As Integer) As Boolean + Dim retorno As Boolean = False + + Try + DataAdapter("PA_RH_PersonalVacacionesGET", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Decimal).Value = CvePersonal + End With + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener las vacaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function +#End Region Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean Dim retorno As Boolean = False Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6f614ab00..ca3dfd4b8 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3896,6 +3896,7 @@ Public Class ClsPaginas If Application("GlobalSIGAppPaginas") Is Nothing Then PaginaDict = New System.Collections.Hashtable + PaginaDict.Add("/Nomina/ChecadorAsistencia.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919) 'PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 35304a37d..12a49ab51 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -327,7 +327,7 @@ Public Class LogicNominas Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos) If DtPercepciones IsNot Nothing AndAlso DtPercepciones.Rows.Count > 0 Then For Each Row As DataRow In DtPercepciones.Rows - If Row("Importe").ToString().ToDecimal > 0 AndAlso Row("SATCveConcepto").ToString().ToEntero() <> 17 Then + If Row("Importe").ToString().ToDecimal > 0 OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("ImporteValor").ToString().ToDecimal().Abs() > 0) Then If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = If(Row("SATCveConcepto").ToString() = "999", "038", Row("SATCveConcepto").ToString()), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()}) @@ -352,7 +352,7 @@ Public Class LogicNominas If DtDeducciones IsNot Nothing AndAlso DtDeducciones.Rows.Count > 0 Then For Each Row As DataRow In DtDeducciones.Rows - If Row("Importe").ToString().ToDecimal <> 0 Then + If Row("Importe").ToString().ToDecimal <> 0 OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("ImporteValor").ToString().ToDecimal().Abs() > 0) Then If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 Then @@ -383,7 +383,7 @@ Public Class LogicNominas If DtOtrosPagos IsNot Nothing AndAlso DtOtrosPagos.Rows.Count > 0 Then For Each Row As DataRow In DtOtrosPagos.Rows - If (Row("Importe").ToString().ToDecimal() <> 0) OrElse + If (Row("Importe").ToString().ToDecimal() <> 0) OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("ImporteValor").ToString().ToDecimal().Abs() > 0) OrElse (Row("SATCveConcepto").ToString().ToEntero() = 2 AndAlso (CveRegimenContratacion.ToEntero() = 2 OrElse Row("Importe").ToString().ToDecimal() <> 0)) OrElse (Row("SATCveConcepto").ToString().ToEntero().Contiene(2, 4) AndAlso Row("Importe").ToString().ToDecimal() < 0) Then diff --git a/LogIn.aspx.vb b/LogIn.aspx.vb index 28fdeb150..4259f8660 100644 --- a/LogIn.aspx.vb +++ b/LogIn.aspx.vb @@ -191,7 +191,8 @@ Partial Class LogIn strdomain = strdomain.Replace(String.Format(":{0}", Request.Url.Port), "") End If ReturnUrl = String.Format("{0}:{1}/{2}", strdomain, Request("port"), ReturnUrl) - + ReturnUrl = ReturnUrl.Replace("https", "http") + ReturnUrl = ReturnUrl.Replace("HTTPS", "HTTP") End If If BtnLogIn_Clickenter = 0 Then 'esta variable se recicla con cada postaback BtnLogIn_Clickenter = 1 diff --git a/Nomina/ChecadorAsistencia.aspx b/Nomina/ChecadorAsistencia.aspx new file mode 100644 index 000000000..e9b06823b --- /dev/null +++ b/Nomina/ChecadorAsistencia.aspx @@ -0,0 +1,279 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ChecadorAsistencia.aspx.cs" Inherits="Nomina_ChecadorAsistencia" %> + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ + + +
+ + +
+ <%----%> + +
+ + + + + + + + +
+
+ +
+ <%----%> +
+ + + + + + + + +
+
+
+ +
+
+
+
+ +
+
+ +
+ +
+
+ + + + + + + + + + + + + + +
+ + + + diff --git a/Nomina/ChecadorAsistencia.aspx.cs b/Nomina/ChecadorAsistencia.aspx.cs new file mode 100644 index 000000000..09ee10ce6 --- /dev/null +++ b/Nomina/ChecadorAsistencia.aspx.cs @@ -0,0 +1,255 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Nomina_ChecadorAsistencia : ClsPaginas +{ + private DataTable dtper + { + get + { + if (ViewState["dtper"] == null) { return null; } + else { return (DataTable)ViewState["dtper"]; } + } + set { ViewState["dtper"] = value; } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaTiposPeriodo(); + TxtRpdFechaInicio.Text = "01/09/2021"; + TxtRpdFechaFin.Text = "15/09/2021"; + DdlTipoAsistencias.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)); + DdlTipoAsistencias.DataBind(); + + + DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros(string.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)); + DdlMotivoHoraExtra.DataBind(); + + CargarCentrosDeCosto(DdlAsisProyecto, DdlAsisSubProyecto, LblAsisProyecto, LblAsisSubProyecto); + PnlProyecto.Visible = DdlAsisProyecto.Visible; + if (PnlProyecto.Visible) + { + PnlSubProyecto.CssClass = "col-md-6"; + } + } + } + private void CargaTiposPeriodo() + { + DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'"); + DdlTipoPeriodo.DataBind(); + DdlTipoPeriodo.Items.Insert(0, new ListItem("Todos", "-1")); + if (DdlTipoPeriodo.Items.Count > 0) + { + DdlTipoPeriodo.SelectedIndex = 0; + } + } + private DataTable generateTable() + { + DateTime FechaI = TxtRpdFechaInicio.Text.ToDateTime(); + DateTime FechaF = TxtRpdFechaFin.Text.ToDateTime(); + DataTable dtCon = new DataTable(); + dtCon.Columns.Add(new DataColumn("Codigo", typeof(string))); + dtCon.Columns.Add(new DataColumn("Empleado", typeof(string))); + DateTime CFecha = FechaI; + while (FechaF > CFecha) + { + string Fecha = string.Format("{0:yyyyMMdd}", CFecha); + string FechaCol = string.Format("{0:dd-MM-yyyy}", CFecha); + dtCon.Columns.Add(new DataColumn(FechaCol, typeof(string)) { }); + CFecha = CFecha.AddDays(1); + } + using (ClsNominas objnom = new ClsNominas()) + { + if (objnom.GetchecadorAdistencia(FechaI, FechaF, UsuarioActual.CveEmpresa)) + { + DataTable dtASis = objnom.DTSetResultados.Tables[0]; + dtper = objnom.DTSetResultados.Tables[1]; + foreach (DataRow item in dtper.Rows) + { + DataRow drow = dtCon.NewRow(); + drow["Codigo"] = item["Codigo"]; + drow["Empleado"] = item["NombreCompleto"]; + CFecha = FechaI; + while (FechaF > CFecha) + { + int Fecha = string.Format("{0:yyyyMMdd}", CFecha).ToEntero(); + string FechaCol = string.Format("{0:dd-MM-yyyy}", CFecha); + string TipoAsis = "(Faltó)"; + DataRow drfec = dtASis.FiltroPrimero(string.Format("CvePersonal={0} AND Agrupador ={1}", item["CvePersonal"], Fecha), "Salida"); + if (drfec != null) + { + DataTable dtx = dtASis.FiltraParametros(string.Format("CvePersonal={0} AND Agrupador ={1}", item["CvePersonal"], Fecha), "Salida"); + + + string asistencia2 = ""; + string Horas2 = ""; + if (dtx.Rows.Count > 1) + { + Horas2 = drfec["Horas"].ToString(); + DataRow drf = dtx.Rows[1]; + asistencia2 = ""; + TipoAsis = drf["TipoAsistencia"].ToString(); + switch (drfec["Tipo"].ToString().ToEntero()) + { + case 1: + asistencia2 = ""; + break; + case 2: + asistencia2 = ""; + break; + case 3: + asistencia2 = ""; + break; + case 4: + asistencia2 = ""; + break; + case 5: + asistencia2 = ""; + break; + + default: + break; + } + } + string asistencia = ""; + TipoAsis = drfec["TipoAsistencia"].ToString(); + switch (drfec["Tipo"].ToString().ToEntero()) + { + case 1: + asistencia = ""; + break; + case 2: + asistencia = ""; + break; + case 3: + asistencia = ""; + break; + case 4: + asistencia = ""; + break; + case 5: + asistencia = ""; + break; + + default: + break; + } + drow[FechaCol] = string.Format("
{0}
{1}
{2}
{3}
", asistencia, drfec["Horas"], asistencia2, Horas2); + //drow[FechaCol] = string.Format("{0}
{1:HH}:{1:mm} - {2:HH}:{2:mm}", asistencia, drfec["Entrada"], drfec["Salida"]); + } + else + { + if (CFecha.DayOfWeek == DayOfWeek.Sunday) + { + drow[FechaCol] = ""; + TipoAsis = "(Descanso)"; + } + else + { + drow[FechaCol] = "
❌
"; + } + } + drow[FechaCol] = string.Format("
{0}
{1}
", drow[FechaCol], TipoAsis, FechaCol, item["CvePersonal"]); + //dtCon.Columns.Add(new DataColumn(FechaCol, typeof(string)));Widthall + CFecha = CFecha.AddDays(1); + } + dtCon.Rows.Add(drow); + } + } + } + //dtCon.Columns.Add(new DataColumn("LabelValorP", typeof(string))); + //dtCon.Columns.Add(new DataColumn("CveConceptoP", typeof(int))); + //dtCon.Columns.Add(new DataColumn("ImporteP", typeof(double))); + return dtCon; + } + protected void LnkConsultar_Click(object sender, EventArgs e) + { + DataTable dtCon = generateTable(); + GvNominas.DataSource = dtCon; + GvNominas.DataBind(); + UpDatos.Update(); + } + + protected void GvNominas_RowDataBound(object sender, GridViewRowEventArgs e) + { + + if (e.Row.RowType == DataControlRowType.DataRow) + { + for (int j = 0; j < e.Row.Cells.Count; j++) + { + string encoded = e.Row.Cells[j].Text; + e.Row.Cells[j].Text = Context.Server.HtmlDecode(encoded); + } + + } + } + + protected void BtnOpenModal_Click(object sender, EventArgs e) + { + DateTime fechai = TxtFecha.Text.ToDateTime(); + DateTime fechaf = fechai.AddDays(1); + int CvePersonal = TxtCvePersonal.Text.ToEntero(); + TxtFechalabel.Text = string.Format("{0:dd/MM/yyyy}", fechai); + using (ClsRH objRH = new ClsRH()) + { + if (objRH.PreAsistenciaRegistrosGet(fechai, fechaf, -1, UsuarioActual.Empresa.CveEmpresa)) + { + GvDetalleDias.DataSource = objRH.DtResultados.FiltraParametros(string.Format("FechaRegistro >='{0:yyyy/MM/dd HH:mm}' AND FechaRegistro <='{1:yyyy/MM/dd HH:mm}' AND CvePersonal = {2}", fechai.AddHours(6), fechaf.AddHours(6), CvePersonal), "FechaRegistro"); + GvDetalleDias.DataBind(); + } + DdlTipoAsistencias.Enabled = GvDetalleDias.Rows.Count > 0; + if (objRH.GetAsistencias(CvePersonal, -1, -1, -1, -1, -1, fechai, fechai, UsuarioActual.CveEmpresa)) + { + if (objRH.DtResultados.Rows.Count > 0) + { + DataRow dr = objRH.DtResultados.Rows[0]; + DdlTipoAsistencias.SelectedValueExist(dr["CveAsistenciasInasistencias"].ToString()); + DdlAsisSubProyecto.SelectedValueExist(dr["CveSubProyecto"].ToString()); + TxtPorPago.Text = dr["PorcentajePago"].ToString(); + TxtHorasDobles.Text = dr["HorasDobles"].ToString(); + TxtHorasTriples.Text = dr["HorasTriples"].ToString(); + DdlMotivoHoraExtra.SelectedValueExist(dr["CveMotivoHoraExtra"].ToString()); + TxtObservaciones.Text = dr["Observacion"].ToString(); + } + } + } + DataRow drow = dtper.FiltroPrimero(string.Format("CvePersonal = {0}", CvePersonal)); + if(drow != null) + { + TxtCodigolabel.Text = drow["Codigo"].ToString(); + TxtEmpleadolabel.Text = drow["NombreCompleto"].ToString(); + } + + UpDetallesDia.Update(); + + RegistraScript("$('#divDetallesDia').modal();"); + } + + protected void BtnEstusAsistenciaModal_Click(object sender, EventArgs e) + { + DateTime fecha = TxtFecha.Text.ToDateTime(); + int CvePersonal = TxtCvePersonal.Text.ToEntero(); + + //int CvePersonal = TxtasiscvePersonal.Text.ToEntero(); + //DateTime fecha = TxtasisFecha.Text.ToDate(); + using (ClsRH objpersonal = new ClsRH()) + { + + if (objpersonal.AddAsistencia(CvePersonal, -1, DdlAsisSubProyecto.SelectedValue.ToEntero(), fecha, DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim().ToDouble(), TxtHorasDobles.Text.Trim().ToDouble(), + TxtHorasTriples.Text.Trim().ToDouble(), DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + //Alert(string.Format("se ha guardado la asistencia satisfactoriamente
{0}
{1:dd/MM/yyyy}", TxtPersonal.Text, TxtasisFecha.Text.ToDate()), TipoMensaje.ToastInformacion); + Alert("Se ha guardado la asistencia satisfactoriamente"); + RegistraScript("$('#DModalModAsistencia').modal('hide');"); + + } + } + } +} \ No newline at end of file diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index edaa3a8d5..97bd06731 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -9,6 +9,11 @@ content: "\f1c1"; } + pre { + font-size: 11px; + padding: 3px; + } + table.gvasistencia tr:hover { background-color: #dddddd; } @@ -354,7 +359,7 @@
- +
@@ -399,7 +404,7 @@ - + @@ -825,6 +830,25 @@
Imprimir
+
@@ -884,6 +908,36 @@
+ + +
+
+
+ + Bitacora +
+
+ + +
+
+
+ + + + + + + + + + + + + + +
+
@@ -1409,16 +1463,13 @@ - -
- +
¿Prima Vacacional?
-
- +
¿Cobrar IMSS?
@@ -1758,6 +1809,371 @@
+ + + + + + + + + + +
@@ -2552,7 +2666,53 @@ - + + + + + + + - + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
+
+
+ diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index e6bb0c374..f845f6931 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -847,6 +847,7 @@ Partial Class RH_Personal If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero() > 0 Then ViewState("CvePersonal") = Request("CvePersonal") + DdlFormapagovacaciones_SelectedIndexChanged(Nothing, Nothing) 'CvePersonal = ViewState("CvePersonal").ToString().ToEntero() CargaDatos() CargaDocumentacionFirmaDecontratos() @@ -4503,43 +4504,70 @@ Partial Class RH_Personal Next End Sub - + Dim dtosvac As DataTable Private Sub CargaVacacionesResumenPeriodoActual() - Dim objRH As New ClsRH - - If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then - If objRH.DtResultados.Rows.Count > 0 Then - - VacInicioPeriodo = objRH.DtResultados(0)("InicioPeriodo").ToString().ToDate - VacFinPeriodo = objRH.DtResultados(0)("FinPeriodo").ToString().ToDate - VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero() - VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero() - VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero() - VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero() - VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero() - GvVacacionesResumen.DataSource = objRH.DtResultados - VacSupervisorNombre = objRH.DtResultados(0)("SupervisorNombre").ToString() - VacSupervisorCorreo = objRH.DtResultados(0)("SupervisorCorreo").ToString() - VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero() - - Else - VacInicioPeriodo = Now - VacFinPeriodo = Now - VacAnios = 0 - VacDias = 0 - VacDiasUsados = 0 - VacDiasCancelados = 0 - VacDiasDisponibles = 0 + Using objnom As New ClsNominas + If objnom.GETPersonalVacResumen(UsuarioActual.Empresa.CveEmpresa, CvePersonal) Then + RPTVacacionesResumen.DataSource = objnom.DtResultados End If - End If + If objnom.GETPersonalVacaciones(UsuarioActual.Empresa.CveEmpresa, CvePersonal) Then + dtosvac = objnom.DtResultados + GvVaczxy.DataSource = dtosvac + GvVaczxy.DataBind() + End If + End Using - objRH.Dispose() + RPTVacacionesResumen.DataBind() + Using objRH As New ClsRH + If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then + If objRH.DtResultados.Rows.Count > 0 Then + + VacInicioPeriodo = objRH.DtResultados(0)("InicioPeriodo").ToString().ToDate + VacFinPeriodo = objRH.DtResultados(0)("FinPeriodo").ToString().ToDate + VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero() + VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero() + VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero() + VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero() + VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero() + GvVacacionesResumen.DataSource = objRH.DtResultados + VacSupervisorNombre = objRH.DtResultados(0)("SupervisorNombre").ToString() + VacSupervisorCorreo = objRH.DtResultados(0)("SupervisorCorreo").ToString() + VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero() + + Else + VacInicioPeriodo = Now + VacFinPeriodo = Now + VacAnios = 0 + VacDias = 0 + VacDiasUsados = 0 + VacDiasCancelados = 0 + VacDiasDisponibles = 0 + End If + End If + + End Using GvVacacionesResumen.DataBind() UpGvVacacionesResumen.Update() End Sub + Protected Sub RPTVacacionesResumen_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) + + 'Dim item As DataRowView = DirectCast(e.Item.DataItem, DataRowView) + 'If (item IsNot Nothing AndAlso item("CveEmpresa") IsNot Nothing) Then + + ' Dim CveEmpresa As Integer = item("CveEmpresa").ToString().ToEntero() + ' Dim CvePersonal As Integer = item("CvePersonal").ToString().ToEntero() + ' Dim Ejercicio As Integer = item("Ejercicio").ToString().ToEntero() + ' Dim RptTitulo As GridView = DirectCast(e.Item.FindControl("GvVaczx"), GridView) + ' If dtosvac IsNot Nothing Then + ' RptTitulo.DataSource = dtosvac.FiltraParametros(String.Format("Ejercicio={0}", Ejercicio), "FechaIng") + ' RptTitulo.DataBind() + ' End If + 'End If + End Sub + Protected Sub BtnSolicitarVacaciones_Click(sender As Object, e As EventArgs) Handles BtnSolicitarVacaciones.Click Dim fInicio As Date = TxtFechaInicioVac.Text.ToDate() Dim fFin As Date = TxtFechaFinVac.Text.ToDate() @@ -4551,7 +4579,7 @@ Partial Class RH_Personal VacFolioActual = VacFolioActual + 1 Dim objRH As New ClsRH 'Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones) - Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil, CveTipoPago:=DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras:=TxtVacDiasExtra.Text.ToEntero()) + Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil, CveTipoPago:=DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras:=TxtVacDiasExtra.Text.ToEntero(), Ejercicio:=TxtVacEjercicio.Text.ToEntero(), PrimaVacacional:=If(ChkVacPrimaVacacional.Checked, 1, 0), CobrarImss:=If(ChkVacCobrarIMSS.Checked, 1, 0), diasPago:=TxtVacDiasPago.Text.ToEntero()) If objRH.DtResultados.Rows.Count > 0 Then Dim ShowError As String = objRH.DtResultados.Rows(0)("ShowError").ToString() If ShowError.Length > 0 Then @@ -5088,6 +5116,41 @@ Partial Class RH_Personal Return ListaTags End Function + Protected Sub DdlFormapagovacaciones_SelectedIndexChanged(sender As Object, e As EventArgs) + PnlVacfechas.Visible = False + PnlVacDias.Visible = False + PnlVacFechapago.Visible = False + PnlVacDiasPago.Visible = False + PnlVacChecks.Visible = False + TxtVacDiasPago.Text = "0" + + Select Case DdlFormapagovacaciones.SelectedValue.ToEntero() + Case 1 + PnlVacfechas.Visible = True + PnlVacDias.Visible = True + PnlVacFechapago.Visible = True + PnlVacDiasPago.Visible = True + PnlVacChecks.Visible = True + Case 2 + PnlVacfechas.Visible = True + PnlVacDias.Visible = True + PnlVacChecks.Visible = True + Case 3 + PnlVacfechas.Visible = True + PnlVacDias.Visible = True + PnlVacDiasPago.Visible = False + PnlVacFechapago.Visible = True + Case 4 + PnlVacFechapago.Visible = True + PnlVacDiasPago.Visible = True + PnlVacChecks.Visible = True + Case 5 + PnlVacfechas.Visible = True + Case 6 + PnlVacFechapago.Visible = True + PnlVacDiasPago.Visible = True + End Select + End Sub #End Region #Region "CURSOS" @@ -6601,5 +6664,7 @@ Partial Class RH_Personal End If End Sub + + End Class diff --git a/vwd.webinfo b/vwd.webinfo index 805171ec2..cfe841e39 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -312,6 +312,8 @@ + + From b0b4f509dc58ffdf965f72e27c98eb3131a7c4c4 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:38:30 -0700 Subject: [PATCH 02/11] Tareas Programadas Edo Cuenta E119 --- App_Code/Modelos.vb | 1 + Ashx/TareasProgramadas.ashx | 152 ++++++++++++++++++++++++++++-------- 2 files changed, 119 insertions(+), 34 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index b36f28a44..093752da9 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -9902,6 +9902,7 @@ Namespace Modelos Public Property EsDistribuidor As Boolean Public Property CorreoCotizacion As String Public Property ImprimeNombreSucursal As Integer + Public Property CobranzaCorreo As String End Class diff --git a/Ashx/TareasProgramadas.ashx b/Ashx/TareasProgramadas.ashx index e7168ab56..8171b5431 100644 --- a/Ashx/TareasProgramadas.ashx +++ b/Ashx/TareasProgramadas.ashx @@ -20,10 +20,12 @@ Public Class TareasProgramadas : Implements IHttpHandler Dim retorno As String = "no se encontro la variable" Try Dim metodo As String = "" + If context.Request("var") IsNot Nothing Then URLParametros = Parametros(context.Request("var")) metodo = URLParametros("metodo") - ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing Then + 'SI TRAE UN JSON COMO PARAMETRO + ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing AndAlso (context.Request("var") Is Nothing AndAlso context.Request("metodo") IsNot Nothing) Then context.Response.ContentType = "application/json" Using reader As New StreamReader(context.Request.InputStream) Dim json = reader.ReadToEnd() @@ -32,6 +34,8 @@ Public Class TareasProgramadas : Implements IHttpHandler metodo = JsonRequest("Metodo").ToString End If End Using + ElseIf context.Request("metodo") IsNot Nothing Then + metodo = context.Request("metodo").ToString() End If Select Case metodo @@ -282,9 +286,13 @@ Public Class TareasProgramadas : Implements IHttpHandler Retorno.Add(obj) Next + + DtEmpresas.Dispose() End If - context.Response.Write(Retorno.ToString()) + GuardaLogEdoCuenta(Retorno.ToString()) + + context.Response.Write("True") End Sub @@ -324,7 +332,8 @@ Public Class TareasProgramadas : Implements IHttpHandler Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, Optional pCveCliente As Integer = -1) As JObject - Dim ClientesSinEnviar As New JArray() + Dim ClientesSinEnviar As New JArray() + Dim ClientesEdoEnviado As New JArray() Dim Json As New JObject( New JProperty("Empresa", UsuarioActual.Empresa.Empresa), @@ -333,37 +342,80 @@ Public Class TareasProgramadas : Implements IHttpHandler ) Dim DTClientes As DataTable = Nothing - Using ObjCliente As New ClsClientes - If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - DTClientes = ObjCliente.DtResultados.Copy() - End If + 'Using ObjCliente As New ClsClientes + ' If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then + ' If ObjCliente.DtResultados.Rows.Count > 0 Then + ' DTClientes = ObjCliente.DtResultados.Copy() + ' End If + ' End If + 'End Using + + Using ObjMov As New ClsMovimientos + Dim FechaI As String = "-1" + Dim FechaF As String = "-1" + Dim FechaVI As String = "-1" + Dim FechaVF As String = "-1" + Dim TCEspecifico = -1 + + Dim CveCobranzaEstatus As Integer = -1 + Dim CveClienteClasificacion As Integer = -1 + Dim CveCliente As Integer = -1 + Dim AplicaAnticipos As Integer = 0 + + Dim CveSubProyecto As Integer = -1 + Dim CveVendedor As Integer = -1 + Dim Grupo As Integer = 5 + Dim TipoCambio As Integer = 1 + Dim TipoDocto As String = "-1" + Dim FechaCorte As DateTime = New DateTime(Now.Year, 12, 31) + + If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte, + EstatusCliente:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=-1, TipoCliente:=-1, AplicaAnticiposPagados:=AplicaAnticipos) Then + DTClientes = ObjMov.DtResultados.FiltraParametros("CveCliente > 0", DistinctColumns:={"CveCliente"}) End If + End Using If DTClientes IsNot Nothing Then - For Each RowCliente As DataRow In DTClientes.Rows - Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero() - Dim Correo As String = RowCliente("CobranzaCorreo").ToString() + 'DTClientes = DTClientes.FiltraParametros("CveCliente IN (227289,227429,227733,227838,228181,228544,229176,229481,230029,230432,230860,230911,230918,231197,231576,232173,232185,233055,233295,233357,233588,236379,236460,237161,237635,238285,238530,238622,238724,239033,239099,239865,239895,239903,240202,240235,240236,240238,240303,240340,262404,262517,264765,264806,264825,264848,264930,265063,265180,265213,265214,265236,265344,265492,265555,265669,265797,265952,265963,266156,266182,268346,268396,268488,268535,268539,268558,268562,268706,268726,268787,268868,268889,268910,268925,269023,269081,269089,272066,272070,272657,273080,273084,275627,276259,276587,281115,283110,284664,285392,287653,288711,291374,292444,295578,296375,296598,302728,303936,306897,307183,311007,320060,320685,320800,323520,323772,325237,326996,327801,330630,331741,332118,337105,340502,341796,342807,343858,355862,358123,365794,371524,375391,377122,377948,378267,380167,381210,381878,383098,383250,383339,383650,384472,385321,385585,386630,387114,388987,396341,396405,396541,401995,404175,408306,416386,416819,420275,438732,447566,447636,450284,464150,464376,468051,475172,475932,476984,477997,478426)") + + For Each RowCliente As DataRow In DTClientes.Rows + + Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero() Dim Cliente As New Modelos.ClienteModel(CveCliente, UsuarioActual.CveEmpresa) - Dim Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + If Cliente IsNot Nothing Then + Dim Correo As String = Cliente.CobranzaCorreo '"japmx95@gmail.com" 'RowCliente("CobranzaCorreo").ToString() - If Envio Then - Using ObjBitacora As New ClsOIEventos - ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente) - End Using - Else - ClientesSinEnviar.Add(New JObject( - New JProperty("CveCliente", Cliente.CveCliente), - New JProperty("Cliente", Cliente.Nombre) - )) - End If + Dim Envio As Boolean = False + If Not String.IsNullOrEmpty(Correo) Then + Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + End If + + If Envio Then + + ClientesEdoEnviado.Add(New JObject( + New JProperty("CveCliente", Cliente.CveCliente), + New JProperty("Cliente", Cliente.Nombre) + )) + + Using ObjBitacora As New ClsOIEventos + ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente) + End Using + Else + ClientesSinEnviar.Add(New JObject( + New JProperty("CveCliente", Cliente.CveCliente), + New JProperty("Cliente", Cliente.Nombre) + )) + End If + End If + Next DTClientes.Dispose() End If - Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar)) + Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar)) + Json.Add(New JProperty("ClientesEdoEnviado", ClientesEdoEnviado)) Return Json End Function @@ -616,10 +668,12 @@ Public Class TareasProgramadas : Implements IHttpHandler
ESTE CORREO SE GENERO EN FORMA AUTOMATICA.", Cliente.NombreComercial, UsuarioActual.Empresa.Empresa) - Retorno = MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo) + Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo)) + Hilo.Start() + Retorno = True Catch ex As Exception Retorno = False - OnError("Ocurrió un error al enviar el correo", ex) + OnError("Ocurrió error al mandar el correo de estado de cuenta", ex) End Try Else Retorno = False @@ -683,17 +737,47 @@ Public Class TareasProgramadas : Implements IHttpHandler Return Bytes End Function - Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean + Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean + 'Para = "japmx95@gmail.com" + Try + Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) + 'a.GuardaLog() + Dim Mail As New ClsSisMail() + + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"}) + + Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) + Catch ex As Exception + OnError("Ocurrió un error al enviar el correo de edo cuenta", ex) + Return False + End Try - Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) - 'a.GuardaLog() - Dim Mail As New ClsSisMail() - - Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"}) - - Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) End Function + + Public Sub GuardaLogEdoCuenta(Str As String) + Dim ArchivoW As StreamWriter + Dim strLineaTMP As String + + ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10) + strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString) + Try + ArchivoW = New StreamWriter(String.Format("{0}\Log\LogEdoCuenta.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8) + Catch ex As UnauthorizedAccessException + 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) + Exit Sub + Catch ex As Exception + Exit Sub + End Try + + Try + ArchivoW.WriteLine(strLineaTMP) + Catch + End Try + + ArchivoW.Close() + ArchivoW.Dispose() + End Sub #End Region End Class \ No newline at end of file From 475e32bfedf59b49df9ffd79239f1283d258d906 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:38:51 -0700 Subject: [PATCH 03/11] Impresion de Deposito de caja --- Bancos/DepositosCaja.aspx.vb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 8ad8491f4..a5a1fb0a0 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -304,17 +304,20 @@ Partial Class Bancos_DepositosCaja End If 'Asignamos la cuenta Deposito - If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then + If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then OcurrioError = True Exit For - End If - Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") - - 'documentos += String.Format("Imprimir {1}

", StrEncript, SerieFolio) + End If + + End If - Next - + Next + + Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") + + + documentos += String.Format("
Imprimir {1}

", StrEncript, "Depósito Bancario") If OcurrioError Then ObjContabilidad.RollBack() From 65235052f56a16ac58447257eecf6d3b53f7e334 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:39:07 -0700 Subject: [PATCH 04/11] Correcion en impresion de movimiento --- Compras/PopUpVerFactura.aspx.vb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 53ad84d4f..7bf565dd8 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -2448,7 +2448,11 @@ Partial Class PopUpVerFactura Dim ClienteNombre = "", EnvioContacto = "", EnvioDireccion = "", EnvioColonia = "", EnvioCiudad = "", EnvioEstado = "", ClientePais = "", EnvioCP = "", Contrato = "", Paqueteria = "", NumContrato = "", Guia = "" - Dim CveContrato As Integer = DtMovimientos(0)("CveContrato").ToString.ToEntero + Dim CveContrato As Integer = 0 + If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then + CveContrato = DtMovimientos(0)("CveContrato").ToString.ToEntero + End If + If CveContrato > 0 Then Contrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DescripcionContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") NumContrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NumeroContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") From 8b726f41fa9082e46286bfe60df3176e594692fa Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:39:27 -0700 Subject: [PATCH 05/11] Correcion de excel RepUtilidadPadre --- .../Formatos/RepVentasUtilidadPadre.rdlc | 3225 ++++++++--------- 1 file changed, 1588 insertions(+), 1637 deletions(-) diff --git a/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc b/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc index 5e314ec69..49340acb0 100644 --- a/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc +++ b/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc @@ -1,1638 +1,1589 @@ - - - - - - - - - - - - true - true - - - - - Grupo - - - - - - - Textbox28 - - - - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - 1.78756cm - - - 1.7468cm - - - 1.87995cm - - - 1.75936cm - - - 1.99234cm - - - 0.7279cm - - - 2.03612cm - - - 0.67438cm - - - 1.94909cm - - - 0.5862cm - - - 1.38875cm - - - - - 0.46771cm - - - - - true - true - - - - - =Fields!Ventas.Value - - - - - - - Ventas - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Descuento.Value - - - - - - - Descuento - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Bonificacion.Value - - - - - - - Bonificacion - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Costo.Value - - - - - - - Costo - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Utilidad.Value - - - - - - - Utilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorUtilidad.Value - - - - - - - PorUtilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Perdida.Value - - - - - - - Perdida - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorPerdida.Value - - - - - - - PorPerdida - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Neto.Value - - - - - - - Neto - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorNeto.Value - - - - - - - PorNeto - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Rentabilidad.Value - - - - - - - Rentabilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - 0.46771cm - - - true - true - - - - - Ventas - - - - - - - Textbox18 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Descuento - - - - - - - Textbox25 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Bonificacion - - - - - - - Textbox20 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Costo - - - - - - - Textbox17 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Utilidad - - - - - - - Textbox6 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox14 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Perdida - - - - - - - Textbox4 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox16 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Neto - - - - - - - Textbox15 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox19 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % Rent. - - - - - - - Textbox21 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - 3.0587cm - - - true - true - - - - - =iif(Fields!GPO.Value="","Total",Fields!GPO.Value) - - - - - - - GPO - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - DataSet1 - 3.29875cm - 0.06614cm - 0.93542cm - 19.58715cm - - - - - - true - true - - - - - =Parameters!Filtros.Value - HTML - - - - - - - Textbox1 - 0.07056cm - 0.06614cm - 0.58236cm - 19.58715cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(CDbl(Parameters!Neto.Value) > 0,"UTILIDAD","PERDIDA") - HTML - - - - - - - Textbox1 - 1.01452cm - 5.03122cm - 1.73771cm - 5.11444cm - 2 - - - =iif(CDbl(Parameters!Neto.Value) > 0,"SeaGreen","Maroon") - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Neto.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 5.34872cm - 0.58236cm - 2.59949cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!PorNeto.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 8.14257cm - 0.58236cm - 1.68559cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - = "RENTABILIDAD" - HTML - - - - - - - Textbox1 - 1.01452cm - 10.71594cm - 1.73771cm - 5.11444cm - 5 - - - SeaGreen - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Rentabilidad.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 12.93844cm - 0.58236cm - 2.59949cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - 1.667in - - - - - - - Textbox1 - 2.43857cm - 0.6cm - 14.68354cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE DE UTILIDAD O PÉRDIDA SOBRE VENTAS - - - - - - - - - - - - - - - - Textbox2 - 0.6cm - 2.40329cm - 0.52945cm - 14.68354cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.06614cm - 2.22362cm - 2.33715cm - 2 - - - - - - - - - - - 1.08126cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.40041cm - 16.97887cm - 0.68085cm - 2.06587cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, "Usuario: ", "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, Parameters!UsuarioImprimio.Value, "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, "Fecha Impresión: ", "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, Parameters!FechaImpresion.Value, "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 29.7cm - 21cm - 0.5cm - 0.5cm - 1cm - 1cm - 0.13cm - + + + + + + + + + HTML + + + + + + + + + =Parameters!Rentabilidad.Value + HTML + + + + + + + Textbox1 + 1.01452cm + 10.29851cm + 1.73771cm + 5.43074cm + + + SeaGreen + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + Grupo + + + + + + + Textbox28 + + + + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 1.78756cm + + + 1.7468cm + + + 1.87995cm + + + 1.75936cm + + + 1.99234cm + + + 0.7279cm + + + 2.03612cm + + + 0.67438cm + + + 1.94909cm + + + 0.5862cm + + + 1.38875cm + + + + + 0.46771cm + + + + + true + true + + + + + =Fields!Ventas.Value + + + + + + + Ventas + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descuento.Value + + + + + + + Descuento + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Bonificacion.Value + + + + + + + Bonificacion + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Costo.Value + + + + + + + Costo + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Utilidad.Value + + + + + + + Utilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorUtilidad.Value + + + + + + + PorUtilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Perdida.Value + + + + + + + Perdida + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorPerdida.Value + + + + + + + PorPerdida + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Neto.Value + + + + + + + Neto + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorNeto.Value + + + + + + + PorNeto + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Rentabilidad.Value + + + + + + + Rentabilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.46771cm + + + true + true + + + + + Ventas + + + + + + + Textbox18 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Descuento + + + + + + + Textbox25 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Bonificacion + + + + + + + Textbox20 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Costo + + + + + + + Textbox17 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Utilidad + + + + + + + Textbox6 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox14 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Perdida + + + + + + + Textbox4 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox16 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Neto + + + + + + + Textbox15 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox19 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % Rent. + + + + + + + Textbox21 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 3.0587cm + + + true + true + + + + + =iif(Fields!GPO.Value="","Total",Fields!GPO.Value) + + + + + + + GPO + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet1 + 3.29875cm + 0.06614cm + 0.93542cm + 19.58715cm + 1 + + + + + + true + true + + + + + =Parameters!Filtros.Value + HTML + + + + + + + Textbox1 + 0.07056cm + 0.06614cm + 0.58236cm + 19.58715cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + = "UTILIDAD" + HTML + + + + + + + + + + HTML + + + + + + + + + = ("$" + Parameters!Neto.Value + " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp " + Parameters!PorNeto.Value) + HTML + + + + + + + Textbox1 + 1.01452cm + 3.09309cm + 1.73771cm + 5.43074cm + 3 + + + SeaGreen + 2pt + 2pt + 2pt + 2pt + + + + 1.667in + + + + + + + Textbox1 + 2.43857cm + 0.6cm + 14.68354cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE UTILIDAD O PÉRDIDA SOBRE VENTAS + + + + + + + + + + + + + + + + Textbox2 + 0.6cm + 2.40329cm + 0.52945cm + 14.68354cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + + + + + + 1.08126cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.40041cm + 16.97887cm + 0.68085cm + 2.06587cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, "Usuario: ", "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, Parameters!UsuarioImprimio.Value, "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, "Fecha Impresión: ", "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, Parameters!FechaImpresion.Value, "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm +