From 9c23b043bb418fc7fd2e66c3081b4e704a4db23b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 30 Nov 2020 12:25:54 -0700 Subject: [PATCH 01/10] se agregaron la seccion, serie, lote y fecha caducidad al realizar inventario fisico --- Inventarios/InventarioFisicoDetalle.aspx | 20 +++-- Inventarios/InventarioFisicoDetalle.aspx.vb | 96 ++++++++++++++++----- Inventarios/RepAnomalias.aspx | 2 + Inventarios/RepAnomalias.aspx.vb | 10 ++- 4 files changed, 97 insertions(+), 31 deletions(-) diff --git a/Inventarios/InventarioFisicoDetalle.aspx b/Inventarios/InventarioFisicoDetalle.aspx index 6a15e7ad1..e7c1feb0c 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx +++ b/Inventarios/InventarioFisicoDetalle.aspx @@ -229,7 +229,7 @@
- +
@@ -240,7 +240,7 @@
- +
@@ -259,12 +259,22 @@
-
-
- +
+ +
+ + <%--Seleccione--%> + + +
+
+
+
+
+
diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index a1678237c..a5abf5a98 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -6,7 +6,7 @@ Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Inventarios_InventarioFisicoDetalle - Inherits ClsPaginas + Inherits ClsPaginas #Region "Propiedades" Public Property DtEquivalencias() As DataTable Get @@ -39,9 +39,18 @@ Partial Class Inventarios_InventarioFisicoDetalle Set(value As DataTable) ViewState("DtVentas") = value End Set - End Property + End Property + Private Property CveAlmacenes As String + Get + Return ViewState("CveAlmacenes").ToString + End Get + Set(value As String) + ViewState("CveAlmacenes") = value + End Set + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then If Request("CveInventarioFisico") IsNot Nothing AndAlso Request("CveInventarioFisico").ToString.ToEntero > 0 Then @@ -51,10 +60,10 @@ Partial Class Inventarios_InventarioFisicoDetalle End If End If - End Sub - - - + End Sub + + + #Region " USUARIOS " Private Sub CargaUsuarios() ddlUsuario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "Nombre") @@ -82,9 +91,9 @@ Partial Class Inventarios_InventarioFisicoDetalle UPAgregarPro.Update() UPPInventario.Update() - End Sub + End Sub #End Region - + #Region " CARGA DATOS " Private Sub CargaDatos(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) @@ -135,13 +144,16 @@ Partial Class Inventarios_InventarioFisicoDetalle If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then Dim dt As DataTable = ObjInventario.DtResultados Dim str As New StringBuilder + Dim CveAlmacenesStr As New StringBuilder If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then For Each dr As DataRow In dt.Rows str.AppendFormat("{0},", dr("almacen")) + CveAlmacenesStr.AppendFormat("{0},", dr("CveAlmacen")) Next End If LblAlmacenes.Text = str.ToString + CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1) End If If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then @@ -246,11 +258,11 @@ Partial Class Inventarios_InventarioFisicoDetalle RegistraScript("OrdenarGV();") End If UPPInventario.Update() - End Sub + End Sub #End Region - + #Region " AGREGAR " - + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Dim Valido As Boolean = False @@ -260,8 +272,9 @@ Partial Class Inventarios_InventarioFisicoDetalle Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes Dim Serie As String = TxtCodigoSerie.Text.Trim Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1") - Dim FechaCaducidad As String=MinFecha.ToString + Dim FechaCaducidad As String = MinFecha.ToString Dim CveSeccionAlmacen As Integer = -1 + Dim SeccionAlmacen As String = "" Dim Cantidad = TxtCantidadProducto.Text.ToDouble @@ -279,11 +292,13 @@ Partial Class Inventarios_InventarioFisicoDetalle Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1" Dim AplicaLote As Boolean = dr("AplicaLote") = "1" Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1" + Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1" 'divSeccionAlmacen.Visible = AplicaSeccion divLote.Visible = AplicaLote divFechaCaducidad.Visible = AplicaCaducidad divSerie.Visible = AplicaSerie + UPAgregarPro.Update() If AplicaSerie And Serie = "" Then @@ -294,7 +309,7 @@ Partial Class Inventarios_InventarioFisicoDetalle RFVSerie.ValidationGroup = " " Exit Sub End If - If AplicaLote And Lote = "" Then + If AplicaLote And (Lote = "" Or Lote = "-1") Then RFVLote.Enabled = True RFVLote.Visible = True RFVLote.SetFocusOnError = True @@ -313,13 +328,46 @@ Partial Class Inventarios_InventarioFisicoDetalle End If FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString) End If - + If AplicaSeccion Then + Dim ObjInv As New ClsInventarios + Dim SeccionesAlmacenDelProducto As New DataTable + If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then + SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes)) + End If + 'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes)) + 'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString) + If SeccionesAlmacenDelProducto.Rows.Count = 1 Then + CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen") + Else + divSeccion.Visible = AplicaSeccion + If DdlSeccionAlmacen.Items.Count = 0 Then + DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto + DdlSeccionAlmacen.DataBind() + DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + If DdlSeccionAlmacen.SelectedValue = "-1" Then + RfvSeccionAlmacen.Enabled = True + RfvSeccionAlmacen.Visible = True + RfvSeccionAlmacen.SetFocusOnError = True + RfvSeccionAlmacen.Validate() + RfvSeccionAlmacen.ValidationGroup = " " + Exit Sub + End If + CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero + End If + ObjInv.Dispose() + SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen)) + End If + RFVSerie.ValidationGroup = "GrpIngresar" RFVSerie.Enabled = False RFVLote.ValidationGroup = "GrpIngresar" RFVLote.Enabled = False RFVCaducidad.ValidationGroup = "GrpIngresar" RFVCaducidad.Enabled = False + RfvSeccionAlmacen.ValidationGroup = "GrpIngresar" + RfvSeccionAlmacen.Enabled = False 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then @@ -331,7 +379,7 @@ Partial Class Inventarios_InventarioFisicoDetalle Using Inventarios As New ClsInventarios If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario, - CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then + CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0 GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "" @@ -344,7 +392,7 @@ Partial Class Inventarios_InventarioFisicoDetalle GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PSCodigo").ToString - GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = "" + GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad @@ -371,6 +419,7 @@ Partial Class Inventarios_InventarioFisicoDetalle divLote.Visible = False divFechaCaducidad.Visible = False divSerie.Visible = False + divSeccion.Visible = False RegistraScript("playsonidito('beep-07.wav')") Else TxtCodigoSerie.Text = "" @@ -386,6 +435,7 @@ Partial Class Inventarios_InventarioFisicoDetalle divLote.Visible = False divFechaCaducidad.Visible = False divSerie.Visible = False + divSeccion.Visible = False TxtLote.Text = "" TxtFechaCaducidad.Text = "" Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError) @@ -395,9 +445,9 @@ Partial Class Inventarios_InventarioFisicoDetalle DivBuscador.Visible = False UPPInventario.Update() - End Sub + End Sub #End Region - + #Region " ELIMINAR " Protected Sub gvInventarioFisicoDetalle_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvIFD.RowDeleting If ddlUsuario.SelectedValue = UsuarioActual.CveUsuario.ToString OrElse UsuarioActual.TienePermisoProceso(283) Then @@ -425,9 +475,9 @@ Partial Class Inventarios_InventarioFisicoDetalle Alert("No se puede eliminar un producto registrado por otro usuario.", TipoMensaje.MsgAdvertencia) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") End If - End Sub + End Sub #End Region - + #Region " FINALIZAR " Protected Sub btnFin_Click(sender As Object, e As EventArgs) Handles btnFin.Click If btnFin.Text.Contains("Iniciar") Then @@ -475,9 +525,9 @@ Partial Class Inventarios_InventarioFisicoDetalle UPAgregarPro.Update() UPPInventario.Update() - End Sub + End Sub #End Region - + #Region " VER AVANCE " Protected Sub LBAvance_Click(sender As Object, e As EventArgs) Response.Redirect($"~/Inventarios/RepAnomalias.aspx?CveInventarioFisico={CveInventarioFisico}&EsAvance=1") diff --git a/Inventarios/RepAnomalias.aspx b/Inventarios/RepAnomalias.aspx index 3751b969e..61dc09004 100644 --- a/Inventarios/RepAnomalias.aspx +++ b/Inventarios/RepAnomalias.aspx @@ -198,6 +198,7 @@ + @@ -232,6 +233,7 @@ + diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index a71900ab2..12433a1ec 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -194,6 +194,9 @@ Partial Class Inventarios_RepAnomalias e.Row.Cells(8).Text = "0" End If + If e.Row.Cells(7).Text = MinFecha Then + e.Row.Cells(7).Text = "" + End If e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1 End If @@ -273,9 +276,10 @@ Partial Class Inventarios_RepAnomalias #End Region Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable) - Gv.Columns(4).Visible = resultado.MAX("Serie") <> "" - Gv.Columns(5).Visible = resultado.MAX("Lote") <> "" - Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha + Gv.Columns(4).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0 + Gv.Columns(5).Visible = resultado.MAX("Serie") <> "" + Gv.Columns(6).Visible = resultado.MAX("Lote") <> "" + Gv.Columns(7).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha End Sub End Class From 72e3c16e24319aea10bc54cf9976a639795150aa Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 1 Dec 2020 13:01:01 -0700 Subject: [PATCH 02/10] -- funcionalidad de replicar, condicionada a que aplica para venta --- Ventas/ProductosServicios.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 6f9b5de8f..18dbbe908 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -1257,7 +1257,7 @@ Partial Class ProductosyServicios End If Next End If - If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then + If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True) End If @@ -1323,7 +1323,7 @@ Partial Class ProductosyServicios Next End If - If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then + If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False) End If From b41a312dfd5c22dda6ba4c3d56156c2cf8370d7b Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 1 Dec 2020 13:01:27 -0700 Subject: [PATCH 03/10] -- poder editar RetIVA, en cotizacion --- Ventas/Ventas.aspx.vb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 90038885c..2a8583eed 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6697,6 +6697,7 @@ Partial Class Ventas TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) + TmpDT.Rows(e.RowIndex)("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR @@ -16308,6 +16309,7 @@ Partial Class Ventas Row("IVA") = Row("PorcentajeIVA") Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales) Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales) + Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales) Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales) Row("PorcentajeRetIVA") = ClienteRetIVA Row("PorcentajeRetISR") = ClienteRetISR @@ -25691,7 +25693,8 @@ Partial Class Ventas If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(), Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6), Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), - PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString()) Then + PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(), + PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal) Then MensajeError = "Ocurrió un error al guardar las partidas de la cotización" OcurrioError = True Exit For From 70a42e26e30f28ed4e2702371ed01b400014b5b6 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 1 Dec 2020 13:01:37 -0700 Subject: [PATCH 04/10] envio del usuario que actualizo --- OC/CatEstatus.aspx.vb | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/OC/CatEstatus.aspx.vb b/OC/CatEstatus.aspx.vb index f44f0a3d6..7a9255c82 100644 --- a/OC/CatEstatus.aspx.vb +++ b/OC/CatEstatus.aspx.vb @@ -69,14 +69,14 @@ Partial Class OC_CatEstatus CargaDatos() CargaEstatus() CargaProyectos() - CargaUsuarios() - - 'SOLO MUESTRA SUBPROYECTO - If UsuarioActual.Empresa.GralSoloProyecto Then - 'TdProyecto.Visible = False - 'TdSubProyectoTitulo.Visible = False - - DivProyecto.Visible = False + CargaUsuarios() + + 'SOLO MUESTRA SUBPROYECTO + + 'TdProyecto.Visible = False + 'TdSubProyectoTitulo.Visible = False + + DivProyecto.Visible = False LblSubproyecto.Visible = False @@ -84,9 +84,9 @@ Partial Class OC_CatEstatus CboSubProyecto.DataBind() CboSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty) - End If - + CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty) + + chkMostrarLimites.Attributes.Add("onchange", "javascript:chkMostrarLimitesCambio();") MaintainScrollPositionOnPostBack = True @@ -614,7 +614,7 @@ Partial Class OC_CatEstatus 'Insertar el nuevo registro Else - If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True) Then + If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then HuboErrores = True Exit For End If @@ -699,6 +699,7 @@ Partial Class OC_CatEstatus If Not HuboErrores Then objEstatusOC.Commit() + GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing Alert("Se guardaron los Cambios exitosamente", TipoMensaje.MsgInformacion) Else objEstatusOC.RollBack() From a27c55e72152337a6296fa8ed962232028268329 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 1 Dec 2020 13:02:15 -0700 Subject: [PATCH 05/10] activacion cuadro cultivo, --- Compras/Compras.aspx | 13 +++++++++++++ Compras/Compras.aspx.vb | 18 ++++++++++++++++++ OC/OC.aspx | 5 ++--- OC/OC.aspx.vb | 7 ++++++- 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 092f884ab..d0118d925 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -632,6 +632,7 @@
+ Tipo de Gasto @@ -675,6 +676,7 @@ + @@ -4284,8 +4286,19 @@ <%-- --%> + + +
+
+ + + +
+
+ diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index fc53b60e5..da0b58856 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1319,6 +1319,15 @@ Partial Class Compras_Compras DdlPersonal.DataBind() DdlPersonalReembolso.DataBind() + If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then + DVCultivosCuadro.Visible = True + DdlSubProyecto.AutoPostBack = True + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataBind() + DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + End If + 'Carga Proveedor If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then @@ -17655,6 +17664,15 @@ Partial Class Compras_Compras If Modalidad <> "U" Or Not CveFactura > 0 Then DdlPSChange() End If + + If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then + + DdlCultivosCuadro.Items.Clear() + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataBind() + DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + End If End Sub Private Sub DdlPSChange() If CveProveedor > 0 Then diff --git a/OC/OC.aspx b/OC/OC.aspx index b7c9eb33e..a5c5ecb11 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -811,6 +811,7 @@
+ Cultivo: @@ -941,9 +942,7 @@ - - - + diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 07bd1ee2d..440141f5c 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -801,6 +801,9 @@ Partial Class OC If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then DVCultivosCuadro.Visible = True + DdlSubProyecto.AutoPostBack = True + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataBind() DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) End If @@ -3562,7 +3565,9 @@ Partial Class OC If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - e.Row.FCLiteral("LtlSubProyecto").Text = e.Row.DBCampo("SubProyecto") + Dim Str As String = e.Row.DBCampo("SubProyecto") + If e.Row.DBCampo("Cuadro") <> "" Then Str = String.Format("{0}
{1}", Str, e.Row.DBCampo("Cuadro")) + e.Row.FCLiteral("LtlSubProyecto").Text = Str End If End If From 3fa9c5030f22d19e81bb605fb4c5d71e60b66d8b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 1 Dec 2020 13:11:33 -0700 Subject: [PATCH 06/10] se agregaron las empresas franquicias a la generacion de codigo qr para econo --- App_Code/ClsPaginas.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b1d582319..8baa88e9c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6750,7 +6750,7 @@ Public Class ClsPaginas End If 'ECONOLLANTAS - AGREGAR QR DE DESCARGA - If UsuarioActual.CveEmpresa = 141 Then + If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then Dim QRDescarga As String = "" Dim cfdi As New RVCFDI33.GeneraCFDI() From 9032c10f35629c8bfc92cde854699bcf2b948b12 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 1 Dec 2020 18:41:34 -0700 Subject: [PATCH 07/10] =?UTF-8?q?nuevo=20cat=C3=A1logo=20de=20checadores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 1 + App_Code/ClsRH.vb | 75 +++++++++++++++++++++++++ RH/CatChecadores.aspx | 101 ++++++++++++++++++++++++++++++++++ RH/CatChecadores.aspx.cs | 115 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 292 insertions(+) create mode 100644 RH/CatChecadores.aspx create mode 100644 RH/CatChecadores.aspx.cs diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index bde4f584f..a704afaf3 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4860,6 +4860,7 @@ Public Class ClsPaginas PaginaDict.Add("/RH/SolicitudViaticos.aspx".ToUpper(), 663) PaginaDict.Add("/RH/ReporteViaticos.aspx".ToUpper(), 664) PaginaDict.Add("/RH/MiPerfil.aspx".ToUpper(), -1) ' se dejará libre el módulo para que cualquier que tenga cvepersonal, pueda acceder + PaginaDict.Add("/RH/CatChecadores.aspx".ToUpper(), 694) #End Region #Region "Sistema" 'Cargo las páginas que deben tener restricción diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 5508900fd..b7729c3f2 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -6879,6 +6879,81 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo #End Region +#Region "Checador" + Public Function GetChecadores(CveChecador As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ChecadorGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveChecador", SqlDbType.Int).Value = CveChecador + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el listado de checadores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function AddChecadores(Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, CveUsuario As Integer, Optional CveModelo As Integer = 1, Optional Estatus As Integer = 1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ChecadorAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Checador", SqlDbType.NVarChar).Value = Checador + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal + .Add("@Puerto", SqlDbType.NVarChar).Value = Puerto + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveModelo", SqlDbType.Int).Value = CveModelo + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateChecadores(CveChecador As Integer, Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, Optional CveModelo As Integer = 1, Optional Estatus As Boolean = True) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ChecadorUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveChecador", SqlDbType.Int).Value = CveChecador + .Add("@Checador", SqlDbType.NVarChar).Value = Checador + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal + .Add("@Puerto", SqlDbType.NVarChar).Value = Puerto + .Add("@CveModelo", SqlDbType.Int).Value = CveModelo + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveChecadores(CveChecador As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ChecadorDelete") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveChecador", SqlDbType.Int).Value = CveChecador + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region + 'Public msgsError As New StringBuilder() 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") diff --git a/RH/CatChecadores.aspx b/RH/CatChecadores.aspx new file mode 100644 index 000000000..0e7b07707 --- /dev/null +++ b/RH/CatChecadores.aspx @@ -0,0 +1,101 @@ +<%@ Page Title="RH - Catálogo de Checadores" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatChecadores.aspx.cs" Inherits="RH_CatChecadores" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Checadores + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RH/CatChecadores.aspx.cs b/RH/CatChecadores.aspx.cs new file mode 100644 index 000000000..c05160605 --- /dev/null +++ b/RH/CatChecadores.aspx.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class RH_CatChecadores : ClsPaginas +{ + private int CveChecador + { + get + { + return ViewState["CveChecador"].ToString().ToEntero(); + } + + set + { + ViewState["CveChecador"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + CargaSubProyectos(); + } + } + + private void CargaDatos() + { + ClsRH ObjRH = new ClsRH(); + if (ObjRH.GetChecadores(-1, UsuarioActual.CveEmpresa)) + { + GvDatos.DataSource = ObjRH.DtResultados; + } + ObjRH.Dispose(); + GvDatos.DataBind(); + } + + private void CargaSubProyectos() + { + DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa); + DdlSubProyecto.DataBind(); + } + + protected void BtnAgregarChecador_Click(object sender, EventArgs e) + { + TxtChecador.Text = ""; + DdlSubProyecto.SelectedValue = "-1"; + TxtIPLocal.Text = ""; + TxtPuerto.Text = ""; + BtnChecadorAgregar.Text = "Agregar"; + divChkEstatus.Visible = false; + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void BtnChecadorAgregar_Click(object sender, EventArgs e) + { + ClsRH ObjRH = new ClsRH(); + if (BtnChecadorAgregar.Text == "Agregar") + { + if (ObjRH.AddChecadores(TxtChecador.Text, DdlSubProyecto.SelectedValue.ToEntero(), TxtIPLocal.Text, TxtPuerto.Text, UsuarioActual.CveUsuario)) + { + Alert("Checador agregado correctamente"); + } + } + else + { + if (ObjRH.UpdateChecadores(CveChecador,TxtChecador.Text,DdlSubProyecto.SelectedValue.ToEntero(),TxtIPLocal.Text,TxtPuerto.Text,Estatus: ChkEstatus.Checked)) + { + Alert("Checador actualizado correctamente"); + } + } + ObjRH.Dispose(); + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + + CveChecador = GvRow.DataKey("CveChecador").ToEntero(); + TxtChecador.Text = GvRow.DataKey("Checador"); + DdlSubProyecto.SelectedValue = GvRow.DataKey("CveSubProyecto"); + TxtIPLocal.Text = GvRow.DataKey("IPLocal"); + TxtPuerto.Text = GvRow.DataKey("Puerto"); + BtnChecadorAgregar.Text = "Actualizar"; + ChkEstatus.Checked = GvRow.DataKey("Estatus") == "Activo"; + divChkEstatus.Visible = true; + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + + ClsRH ObjRH = new ClsRH(); + if (ObjRH.RemoveChecadores(GvRow.DataKey("CveChecador").ToEntero())) + { + Alert("Checador eliminado correctamente"); + CargaDatos(); + UpDatos.Update(); + } + ObjRH.Dispose(); + } +} \ No newline at end of file From 7e7dbe28b84e96f48af0eb99d6702187e86fb4b8 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Wed, 2 Dec 2020 13:41:41 -0700 Subject: [PATCH 08/10] --- App_Code/ClsClaseBase.vb | 93 ++++++++ Nomina/Aguinaldo.aspx | 97 +++++--- Nomina/Aguinaldo.aspx.cs | 479 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 635 insertions(+), 34 deletions(-) diff --git a/App_Code/ClsClaseBase.vb b/App_Code/ClsClaseBase.vb index a51bde5ba..d5857b782 100644 --- a/App_Code/ClsClaseBase.vb +++ b/App_Code/ClsClaseBase.vb @@ -120,6 +120,83 @@ Public Class ClsClaseBase SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor End If End Sub + + Public Function runQuerystr(Query As String, Optional Listaparametros As List(Of parametroQuery) = Nothing, Optional msgError As String = "", Optional mostrarError As Boolean = True) As Boolean + Dim retorno As Boolean = False + Try + If SqlConexion.State = ConnectionState.Open Then + SqlAdapter.SelectCommand.Parameters.Clear() + SqlAdapter.SelectCommand.CommandText = Query + SqlAdapter.SelectCommand.CommandType = CommandType.Text + Data = New DataTable() + If Not IsNothing(Listaparametros) Then + For Each pr As parametroQuery In Listaparametros + If Not IsNothing(pr.SqlDataType) Then + If Not IsNothing(pr.ParameterDirection) Then + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection + Else + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = If(Not IsNothing(pr.SqlValue), pr.SqlValue, DBNull.Value) + End If + Else + SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue) + End If + Next + End If + + SqlAdapter.Fill(Data) + retorno = True + Else + Dim InfoAdicional As String = "Se intenta realizar una conexion con una conexion cerrada" + InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}" + GuardaLog(InfoAdicional) + End If + Catch sqEx As SqlException + retorno = False + setOnError(msgError, sqEx) + Catch ex As Exception + retorno = False + setOnError(msgError, ex) + End Try + Return retorno + End Function + Public Function ExecQuery(Query As String, Optional Listaparametros As List(Of parametroQuery) = Nothing, Optional msgError As String = "", Optional mostrarError As Boolean = True) As Integer + Dim retorno As Integer = -1 + Try + If SqlConexion.State = ConnectionState.Open Then + SqlAdapter.SelectCommand.Parameters.Clear() + SqlAdapter.SelectCommand.CommandText = Query + SqlAdapter.SelectCommand.CommandType = CommandType.Text + If Not IsNothing(Listaparametros) Then + For Each pr As parametroQuery In Listaparametros + If Not IsNothing(pr.SqlDataType) Then + If Not IsNothing(pr.ParameterDirection) Then + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection + Else + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = If(Not IsNothing(pr.SqlValue), pr.SqlValue, DBNull.Value) + End If + Else + SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue) + End If + Next + End If + + retorno = SqlAdapter.SelectCommand.ExecuteNonQuery() + Else + Dim InfoAdicional As String = "Se intenta realizar una conexion con una conexion cerrada" + InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}" + GuardaLog(InfoAdicional) + End If + Catch sqEx As SqlException + retorno = -1 + setOnError(msgError, sqEx) + Catch ex As Exception + retorno = -1 + setOnError(msgError, ex) + End Try + Return retorno + End Function + + Protected Function RunQuery(msgOnError As String) As Boolean Dim retorno As Boolean = False @@ -203,3 +280,19 @@ Public Class ClsClaseBase End Sub End Class + +Public Class parametroQuery + Public Sub New(parameterName As String, sqlValue As Object, Optional sqlDataType As SqlDbType = Nothing, Optional parameterDirection As ParameterDirection = Nothing) + Me.ParameterName = parameterName + Me.SqlDataType = sqlDataType + Me.ParameterDirection = parameterDirection + Me.SqlValue = sqlValue + + End Sub + + Public Property ParameterName As String + Public Property SqlDataType As SqlDbType + Public Property ParameterDirection As ParameterDirection + Public Property SqlValue As Object + +End Class \ No newline at end of file diff --git a/Nomina/Aguinaldo.aspx b/Nomina/Aguinaldo.aspx index a4f20fae3..456282339 100644 --- a/Nomina/Aguinaldo.aspx +++ b/Nomina/Aguinaldo.aspx @@ -3,6 +3,26 @@ + @@ -51,7 +71,7 @@
    -
    +
    @@ -59,35 +79,55 @@
    - Total Aguinaldo + Total aguinaldo
    -
    +
    -
    + +
    Autorizado
    -
    +
    -
    + +
    Días ejercicio
    +
    +
    +
    +
    +
    + +
    +
    + UMA +
    +
    +
    +
    +
    +
    +
    + +
    @@ -97,37 +137,31 @@ - + - + - + - + - + - + - + - + - + - + - - - - - - - + @@ -135,7 +169,13 @@ - + + + + + + + @@ -143,6 +183,7 @@ + <%-- @@ -174,7 +215,7 @@
    diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs index c0d0f5939..e1507fd52 100644 --- a/Nomina/Aguinaldo.aspx.cs +++ b/Nomina/Aguinaldo.aspx.cs @@ -1,7 +1,10 @@ using System; using System.Collections.Generic; +using System.Configuration; using System.Data; +using System.Data.SqlClient; using System.Linq; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -42,6 +45,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas DdlTipoPeriodo.SelectedIndex = 0; } } + LtlUma.Text = "86.88"; } @@ -58,13 +62,14 @@ public partial class Nomina_Aguinaldo : ClsPaginas DTAguinaldos = objnom.DtResultados; GVCalcularAguinaldo.DataSource = DTAguinaldos; LtlTotal.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo")); - LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo","CveNomina>0")); - + LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo", "CveNomina>0")); + LtldiasEjercicio.Text = string.Format("{0}/12/31", ejercicio).ToDate().DayOfYear.ToString(); } GVCalcularAguinaldo.DataBind(); LnkAutorizarModal.Visible = true; + BtnRecalcular_Click(sender, null); upDatosPA_N.Update(); } private void CargaPeriodos() @@ -149,7 +154,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas { continuar = false; Alert("debe agregar un concepto para el calculo del aguinaldo", ModExtensiones.TipoMensaje.ToastAdventencia); - } + } } if (continuar) { @@ -169,9 +174,9 @@ public partial class Nomina_Aguinaldo : ClsPaginas ImporteGravado = row["AguinaldoGravado"].ToString().ToDecimal(); ImporteExento = Importe - ImporteGravado; ImporteValor = row["DiasLaborados"].ToString().ToDecimal(); - - if (CvePersonal > 0 && Importe>0 && row["CveNomina"].ToString().ToEntero()==0) + + if (CvePersonal > 0 && Importe > 0 && row["CveNomina"].ToString().ToEntero() == 0) { if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa)) { @@ -261,4 +266,466 @@ public partial class Nomina_Aguinaldo : ClsPaginas } } } -} \ No newline at end of file + + protected void BtnRecalcular_Click(object sender, EventArgs e) + { + decimal uma = 86.88m; + decimal aguiexentogral = uma * 30; + decimal salariodiario = 0; + decimal diasanio = 366; + decimal diaslaborados = 0; + decimal diasaguinaldo = 0; + decimal diasaguipago = 0; + decimal salariomensual = 0; + decimal aguinaldo = 0; + decimal aguinaldoexcento = 0; + decimal aguinaldogravado = 0; + decimal diasmes = 30.5m; + decimal FraccionI = 0; + decimal FraccionII_1 = 0; + decimal FraccionII_2 = 0; + decimal FraccionIII_1 = 0; + decimal FraccionIII_2 = 0; + decimal FraccionV = 0; + decimal FraccionIV = 0; + + decimal Aguinaldoapagar = 0; + decimal AguinaldoapagarTotal = 0; + StringBuilder str = new StringBuilder(); + using (ClsClaseBaseD objbase = new ClsClaseBaseD()) + { + + foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows) + { + salariodiario = gvrow.FCTextBox("TxtsueldoDiario").Text.ToDecimal(); + diaslaborados = gvrow.FCTextBox("TxtdiasLaborados").Text.ToDecimal(); + diasaguinaldo = gvrow.FCTextBox("TxtdiasAguinaldo").Text.ToDecimal(); + if (salariodiario > 0) + { + + diasaguipago = (diaslaborados / diasanio) * diasaguinaldo; + salariomensual = salariodiario * 30; + aguinaldo = diasaguipago * salariodiario; + aguinaldoexcento = (aguiexentogral > aguinaldo ? aguinaldo : aguiexentogral); + aguinaldogravado = aguinaldo - aguinaldoexcento; + if (aguinaldogravado > 0) { + FraccionI = (aguinaldogravado / diasanio) * diasmes; + FraccionII_1 = salariomensual + FraccionI; + str.Clear(); + str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes); + str.AppendFormat(" dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes); + if (objbase.runQuerystr(str.ToString())) + { + DataRow drow = objbase.DtResultados.Rows[0]; + FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal(); + FraccionIII_1 = drow["isrFraccionIII_1"].ToString().ToDecimal(); + } + else { break; } + + FraccionIII_2 = FraccionII_2 - FraccionIII_1; + FraccionV = FraccionIII_2 / FraccionI; + FraccionIV = aguinaldogravado * FraccionV; + Aguinaldoapagar = aguinaldo - FraccionIV; + } + else + { + + FraccionIV = 0; + Aguinaldoapagar = aguinaldo - FraccionIV; + } + } + else + { + aguinaldo = 0; + Aguinaldoapagar = 0; + aguinaldogravado = 0; + FraccionIV = 0; + } + AguinaldoapagarTotal += Aguinaldoapagar; + gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text = string.Format("${0:N2}", aguinaldo); + gvrow.FCLabel("lblAguinaldo").Text = string.Format("${0:N2}", Aguinaldoapagar); + gvrow.FCLabel("lblAguinaldoGravado").Text = string.Format("${0:N2}", aguinaldogravado); + gvrow.FCLabel("lblISRAguinaldo").Text = string.Format("${0:N2}", FraccionIV); + } + + } + LtlTotal.Text =string.Format("${0:N2}", AguinaldoapagarTotal); + + /* + * + * + + lblAguinaldo + lblAguinaldoGravado + lblISRAguinaldo + + salario diario +dias año +Dias laborados +dias Aguinaldo +dias aguinaldo(PAGO) +UMA +Salario mensual +Aguinaldo +Aguinaldo excento +Aguinaldo gravado + +dias mes +FraccionI +FraccionII +FraccionII +FraccionIII +FraccionIII +FraccionV +FraccionIV + +Aguinaldoapagar + + + + + * + */ + } +} + + class ClsClaseBaseD : IDisposable +{ + protected SqlConnection SqlConexion; + protected SqlDataAdapter SqlAdapter; + protected DataTable datos; + protected DataSet DTSet; + public DataTable DtResultados + { + get + { + return datos; + } + } + public DataSet DTSetResultados + { + get + { + return DTSet; + } + } + protected bool disposedValue = false; + protected bool EsTransaccion = false; + public string MyCurrentError; + // REGISTRAR CONEXIÓN + private int CveConexion = 0; + + public ClsClaseBaseD(ClsClaseBaseD adsObj = null) + { + if (adsObj != null && adsObj.SqlAdapter != null && adsObj.SqlAdapter.SelectCommand != null && adsObj.SqlAdapter.SelectCommand.Transaction != null) + { + SqlConexion = adsObj.SqlConexion; + SqlAdapter = adsObj.SqlAdapter; + EsTransaccion = true; + } + else + { + SqlConexion = new SqlConnection(); + SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString; + try + { + SqlConexion.Open(); + SqlAdapter = new SqlDataAdapter("", SqlConexion); + ConexionAdd(); + } + catch (Exception ex) + { + this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex); + } + } + } + + public void SqlDataAdapter(string StrSQL, CommandType TipoComando = CommandType.StoredProcedure) + { + if (SqlConexion.State == ConnectionState.Open) + { + SqlAdapter.SelectCommand.Parameters.Clear(); + SqlAdapter.SelectCommand.CommandText = StrSQL; + SqlAdapter.SelectCommand.CommandType = TipoComando; + datos = new DataTable(); + DTSet = new DataSet(); + } + } + protected void DataAdapter(string StrSQL, CommandType TipoComando = CommandType.Text) + { + + // if (SqlAdapter.SelectCommand == null) + // { + // if ((sqlCommand != null)) + // { + // SqlAdapter.SelectCommand = sqlCommand; + // } + // else + // { + // SqlAdapter.SelectCommand = new SqlCommand(); + // } + // SqlAdapter.SelectCommand.Connection = SqlConexion; + // } + + if (SqlConexion.State == ConnectionState.Open) + { + SqlAdapter.SelectCommand.Parameters.Clear(); + SqlAdapter.SelectCommand.CommandText = StrSQL; + SqlAdapter.SelectCommand.CommandType = TipoComando; + datos = new DataTable(); + DTSet = new DataSet(); + } + } + + private void ConexionAdd() + { + if (ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1") + { + try + { + SqlDataAdapter("PA_Sis_RegistrarConexion"); + { + var withBlock = SqlAdapter.SelectCommand.Parameters; + withBlock.Add("@Clase", SqlDbType.VarChar).Value = this.GetType().Name; + withBlock.Add("@Modulo", SqlDbType.VarChar).Value = string.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString(), HttpContext.Current.Request.QueryString.ToString()); + withBlock.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output; + } + SqlAdapter.Fill(datos); + CveConexion = SqlAdapter.SelectCommand.Parameters["@IDConexion"].Value.ToString().ToEntero(); + } + catch (Exception ex) + { + this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()); + } + } + } + + private void ConexionClose() + { + if (CveConexion > 0 && ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1") + { + SqlDataAdapter(string.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text); + + try + { + SqlAdapter.Fill(datos); + } + catch (Exception ex) + { + this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()); + } + CveConexion = 0; + } + } + protected void addParameters(string name, SqlDbType tipo, object valor) + { + if (SqlConexion.State == ConnectionState.Open) + SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor; + } + + public bool runQuerystr(string Query, List Listaparametros = null, string msgError = "", bool mostrarError = true) + { + bool retorno = false; + try + { + if (SqlConexion.State == ConnectionState.Open) + { + SqlAdapter.SelectCommand.Parameters.Clear(); + SqlAdapter.SelectCommand.CommandText = Query; + SqlAdapter.SelectCommand.CommandType = CommandType.Text; + datos = new DataTable(); + if (Listaparametros!= null) + { + foreach (parametroQuery pr in Listaparametros) + { + if (pr.SqlDataType != null) + { + if (pr.ParameterDirection != null) + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; + else + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value; + } + else + SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue); + } + } + + SqlAdapter.Fill(datos); + retorno = true; + } + else + { + string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada"; + InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}"; + ModExtensiones.GuardaLog(InfoAdicional); + } + } + catch (SqlException sqEx) + { + retorno = false; + setOnError(msgError, sqEx); + } + catch (Exception ex) + { + retorno = false; + setOnError(msgError, ex); + } + return retorno; + } + public int ExecQuery(string Query, List Listaparametros = null, string msgError = "", bool mostrarError = true) + { + int retorno = -1; + try + { + if (SqlConexion.State == ConnectionState.Open) + { + SqlAdapter.SelectCommand.Parameters.Clear(); + SqlAdapter.SelectCommand.CommandText = Query; + SqlAdapter.SelectCommand.CommandType = CommandType.Text; + if (Listaparametros!= null) + { + foreach (parametroQuery pr in Listaparametros) + { + if ( pr.SqlDataType != null) + { + if ( pr.ParameterDirection != null) + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; + else + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value; + } + else + SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue); + } + } + + retorno = SqlAdapter.SelectCommand.ExecuteNonQuery(); + } + else + { + string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada"; + InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}"; + this.GuardaLog(InfoAdicional); + } + } + catch (SqlException sqEx) + { + retorno = -1; + setOnError(msgError, sqEx); + } + catch (Exception ex) + { + retorno = -1; + setOnError(msgError, ex); + } + return retorno; + } + + + protected bool RunQuery(string msgOnError) + { + bool retorno = false; + + try + { + SqlAdapter.Fill(datos); + retorno = true; + } + catch (Exception ex) + { + retorno = false; + + setOnError(msgOnError, ex); + } + return retorno; + } + protected bool RunQueryDS(string msgOnError) + { + bool retorno = false; + + try + { + SqlAdapter.Fill(DTSet); + retorno = true; + } + catch (Exception ex) + { + retorno = false; + + setOnError(msgOnError, ex); + } + return retorno; + } + public void setOnError(string Mensaje, Exception Exeption) + { + string InfoAdicional = ""; + if (SqlAdapter != null && SqlAdapter.SelectCommand != null && SqlAdapter.SelectCommand.Parameters != null) + InfoAdicional = SqlAdapter.SelectCommand.Parameters.ParametrosInfo(); + MyCurrentError = string.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString(), "\r\n", InfoAdicional); + this.OnError(Mensaje, Exeption, InfoAdicional); + } + public void IniciaTransacSQL() + { + SqlAdapter.SelectCommand.Transaction = SqlConexion.BeginTransaction(); + EsTransaccion = true; + } + + public void Commit() + { + SqlAdapter.SelectCommand.Transaction.Commit(); + SqlConexion.Close(); + } + + public void RollBack() + { + SqlAdapter.SelectCommand.Transaction.Rollback(); + SqlConexion.Close(); + } + public void Dispose() + { + ConexionClose(); + if ((SqlConexion != null)) + { + if (SqlConexion.State == ConnectionState.Open) + { + try + { + if ((SqlAdapter != null)) + SqlAdapter.Dispose(); + + SqlConexion.Close(); + } + catch (Exception ex) + { + this.OnError("Ocurrió un error al intentar cerrar la base de datos.", ex); + } + } + SqlConexion.Dispose(); + } + + if (datos != null) + datos.Dispose(); + if (SqlAdapter != null) + SqlAdapter.Dispose(); + + if (DTSet != null) + DTSet.Dispose(); + + GC.SuppressFinalize(this); + } +} + +public class parametroQuery +{ + public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection)) + { + this.ParameterName = parameterName; + this.SqlDataType = sqlDataType; + this.ParameterDirection = parameterDirection; + this.SqlValue = sqlValue; + } + + public string ParameterName { get; set; } + public SqlDbType SqlDataType { get; set; } + public ParameterDirection ParameterDirection { get; set; } + public object SqlValue { get; set; } +} From f69da7bd8c3ca5e61c90faf3a73f124f6faa96d4 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 2 Dec 2020 21:14:48 -0700 Subject: [PATCH 09/10] nuevos filtros al reporte de solicitudes anticipo y en ventas al se puede cancenlar una factura de tipo docto pedi2 --- App_Code/ClsOC.vb | 4 +++- OC/RepSolicitudesAnticipo.aspx | 15 ++++++++++++++- OC/RepSolicitudesAnticipo.aspx.cs | 15 ++++++++++++++- Ventas/Ventas.aspx.vb | 12 ++++++++++-- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 98e94a859..829a5b2f1 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -2524,7 +2524,7 @@ Public Class ClsOC End Function #End Region #Region "REP SOLICITUDES ANTICIPO" - Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer) As Boolean + Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer, Optional CveUsuario As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RepSolicitudAnticipoGet") @@ -2534,6 +2534,8 @@ Public Class ClsOC .Add("@FechaI", SqlDbType.DateTime).Value = FechaI .Add("@FechaF", SqlDbType.DateTime).Value = FechaF .Add("@CveEventoEstatus", SqlDbType.Int).Value = CveEventoEstatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto End With Try diff --git a/OC/RepSolicitudesAnticipo.aspx b/OC/RepSolicitudesAnticipo.aspx index 4c03a5549..14e80d0fe 100644 --- a/OC/RepSolicitudesAnticipo.aspx +++ b/OC/RepSolicitudesAnticipo.aspx @@ -30,7 +30,7 @@
    - <%----%> +
    @@ -81,6 +81,19 @@
    diff --git a/OC/RepSolicitudesAnticipo.aspx.cs b/OC/RepSolicitudesAnticipo.aspx.cs index ae72827e5..67228491a 100644 --- a/OC/RepSolicitudesAnticipo.aspx.cs +++ b/OC/RepSolicitudesAnticipo.aspx.cs @@ -73,10 +73,23 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas txtFechaI.Text = DateTime.Now.AddMonths(-1).FirstDayOfMonth().ToShortDateString(); txtFechaF.Text = DateTime.Now.ToShortDateString(); CveProveedor = -1; + CargaSubProyectos(); CargaProveedor(); + CargaUsuarios(); CargaDatos(); } + private void CargaSubProyectos() + { + CargarCentrosDeCosto(null,DdlSubProyecto,null,lblSubProyecto); + } + + private void CargaUsuarios() + { + DdlUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa); + DdlUsuarios.DataBind(); + } + protected void CargaProveedor() { DdlProveedores.setEsWebService(true); @@ -93,7 +106,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas FechaI = (txtFechaI.Text.ToString() != "" ? txtFechaI.Text.ToDateTime() : MinFecha); FechaF = (txtFechaF.Text.ToString() != "" ? txtFechaF.Text.ToDateTime() : DateTime.Now); - if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero())) + if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero(),DdlUsuarios.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero())) { DtDatos = ObjOC.DtResultados; GvSolicitudes.DataSource = DtDatos; diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 2a8583eed..bc64ed41d 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3926,7 +3926,7 @@ Partial Class Ventas LblAlertRefacInv.Visible = True End If - If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then + If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then If UsuarioActual.TienePermisoProceso(159) Then Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) If TienePermiso <> "" Then @@ -20880,8 +20880,16 @@ Partial Class Ventas RegistraScript("$('#ModalCancelarDocumento').modal();") UpCancelarDocumento.Update() sb.Clear() + ElseIf DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then + Dim ObjVentas As New ClsVentas + If ObjVentas.UpdateEstatusVenta(CveVenta, 22, UsuarioActual.CveEmpresa) Then + Dim redirectString As String = String.Format("document.location.href=""/Ventas/Ventas.aspx?CveVenta={0}""", CveVenta) + Alert("Pedido cancelado.", JSBtnAceptar:=redirectString) + ', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta + End If + ObjVentas.Dispose() Else - CancelarDocumento() + CancelarDocumento() End If End Sub From b010ff29660fe02e7705213288557b49151ccd1c Mon Sep 17 00:00:00 2001 From: Raul Pimienta Date: Wed, 2 Dec 2020 23:19:24 -0700 Subject: [PATCH 10/10] Cambios en el reporte de comisiones JAM --- Ventas/RepComisionesJAM.aspx | 2 +- Ventas/RepComisionesJAM.aspx.cs | 48 +++++++++++++++------------------ 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/Ventas/RepComisionesJAM.aspx b/Ventas/RepComisionesJAM.aspx index 8fac2b313..cf06867b3 100644 --- a/Ventas/RepComisionesJAM.aspx +++ b/Ventas/RepComisionesJAM.aspx @@ -102,7 +102,7 @@ diff --git a/Ventas/RepComisionesJAM.aspx.cs b/Ventas/RepComisionesJAM.aspx.cs index 1dfcf5071..721d3f7cf 100644 --- a/Ventas/RepComisionesJAM.aspx.cs +++ b/Ventas/RepComisionesJAM.aspx.cs @@ -113,28 +113,24 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked) { e.Row.FCLinkButton("LnkInfo").Visible = true; - //if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0) - //{ - // //if (UsuarioActual.TienePermisoProceso(201)) - // //{ - // // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - // // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - // //} - // //else - // //{ - // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - // //} - //}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 ) - //{ - // e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}."; - // e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}."; - //}else if(e.Row.DBCampo("Comision").ToDouble() > 0) - //{ - // e.Row.Cells[21].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales."; - // e.Row.Cells[22].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales."; - //} - }else + if (!Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0) + { + e.Row.FCLinkButton("LnkInfo").ToolTip = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}."; + } + else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() > 0) + { + e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}."; + } + else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0) + { + e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}."; + } + else if (e.Row.DataKey("Comision").ToDouble() > 0) + { + e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. El producto es: {e.Row.DataKey("CodigoPS").ToString()}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}."; + } + } + else { e.Row.FCLinkButton("LnkInfo").Visible = false; } @@ -357,19 +353,19 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0) { - LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales.
    La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}. "; + LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales.
    La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}.
    % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()}
    Dias Pago: {gvRow.DataKey("DiasPago").ToString()}"; } else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0) { - LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. "; + LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos.
    % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()}
    Dias Pago: {gvRow.DataKey("DiasPago").ToString()}"; } else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0) { - LblInfo.Text = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos."; + LblInfo.Text = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos.
    % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()}
    Dias Pago: {gvRow.DataKey("DiasPago").ToString()}"; } else if (gvRow.DataKey("Comision").ToDouble() > 0) { - LblInfo.Text = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales.
    La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}.
    El producto es: {gvRow.DataKey("CodigoPS").ToString()}. "; + LblInfo.Text = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales.
    La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}.
    El producto es: {gvRow.DataKey("CodigoPS").ToString()}.
    % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()}
    Dias Pago: {gvRow.DataKey("DiasPago").ToString()}"; } this.RegistraScript("$('#DModalInfo').modal();"); UpModalInformacion.Update();