diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 63ff870df..5fe30068f 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -1650,25 +1650,22 @@ Namespace Extensiones End Function - Public Function GetColumn(ByVal gv As GridView, ByVal name As String) As Integer - Dim index As Integer = 0 - Dim found As Boolean = False - - For Each c As DataControlField In gv.Columns - - If TypeOf c Is BoundField Then - Dim field As BoundField = CType(c, BoundField) - - If name = field.DataField OrElse name = field.SortExpression OrElse name = field.HeaderText Then - found = True - Exit For + Public Function FBColumn(gv As GridView, name As String) As DataControlField + name = name.ToLower + For Each col As DataControlField In gv.Columns + If TypeOf col Is BoundField Then + Dim field As BoundField = CType(col, BoundField) + If field.DataField.ToLower = name OrElse field.SortExpression.ToLower = name OrElse field.HeaderText.Trim.ToLower = name Then + Return col + End If + ElseIf TypeOf col Is HyperLinkField Then + Dim field As HyperLinkField = CType(col, HyperLinkField) + If field.DataTextField.ToLower = name OrElse field.SortExpression.ToLower = name OrElse field.HeaderText.Trim.ToLower = name Then + Return col End If End If - - index += 1 Next - - Return If(found, index, -1) + Return Nothing End Function diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 5d694eff3..5b7fb8098 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -292,10 +292,16 @@ public partial class CRM_EmpresaCRM : ClsPaginas CargarTiposEventos(); LimitaFechasAcercamiento(); CargaDatos(); - if (CveEncuestaCRM > 0) - { - CargaDatosTecnicos(); - } + + //if( Request["CveEmpresaCRM"] != null) + //{ + if (CveEncuestaCRM > 0) + { + CargaDatosTecnicos(); + } + // } + + VerificaPermisos(); CargaClasificaciones(); DdlPS.setEsWebService(true); @@ -1476,8 +1482,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas var responseGenericGetDatosTecnicosEmpresaCRM = encuestaService.GetDatosTecnicosEmpresaCRM(new RequestDatosTecnicosEmpresaCRMGet() { CveEmpresa = UsuarioActual.Empresa.CveEmpresa, CveEncuesta = CveEncuestaCRM, CveEncuestaAplicada = CveEncuestaAplicada, CvePregunta = -1 }); if (responseGenericGetDatosTecnicosEmpresaCRM.IsSuccess) { - GvDatosTecnicos.DataSource = responseGenericGetDatosTecnicosEmpresaCRM.Result; - if (responseGenericGetDatosTecnicosEmpresaCRM.Result.Count > 0) + + + var DTTemp = responseGenericGetDatosTecnicosEmpresaCRM.Result.ToDataTable(); + GvDatosTecnicos.DataSource = DTTemp; + if (DTTemp.Rows.Count > 0) { GvDatosTecnicos.Visible = true; } diff --git a/Compras/RepComprasAFDetalle.aspx b/Compras/RepComprasAFDetalle.aspx index bb5fbd9fa..98c3f24f4 100644 --- a/Compras/RepComprasAFDetalle.aspx +++ b/Compras/RepComprasAFDetalle.aspx @@ -8,6 +8,9 @@ max-width:600px; width:600px; } + .margenbound { + text-align: right; + } @@ -16,12 +19,20 @@ -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • +
  • + Personalizar +
  • +
  • + Excel Personalizado +
  • Ver Dlls en pesos
  • @@ -29,6 +40,13 @@ <%-- --%>   +
    + + + + + +
    @@ -150,13 +168,9 @@
    - - -
    Proyecto:
    -
    @@ -164,7 +178,6 @@ SubProyecto:
    -
    @@ -212,153 +225,31 @@
    - - - - - Factura - - - - - - - - - - SubProyecto - - - - - - - - - ActivoFijo - - - <%----%> - - - - - - - No. Serie - - - - - - - - - Producto - - - - - - - - - - Responsable - - - - - - - - - Horometro/Odometro - - - - - - - - - - Tipo Mantenimiento - - - - - - - - - Clasificación 2 - - - - - - - - - - - - - Unidad de Medida - - - - - - - - - Cantidad - - - - - - - - - PU - - - - - - - - - Total - - - - - - - - - Cuenta - - - - - - + + + + + + + + + + + + + + + + + + + - <%-- - --%>
    - - - + + + + + diff --git a/Compras/RepComprasAFDetalle.aspx.vb b/Compras/RepComprasAFDetalle.aspx.vb index 5b19beed7..9077f17ce 100644 --- a/Compras/RepComprasAFDetalle.aspx.vb +++ b/Compras/RepComprasAFDetalle.aspx.vb @@ -82,12 +82,13 @@ Partial Class Compras_RepComprasAFDetalle #End Region + Private Personalizado As Boolean = False + Private Sub Compras_RepComprasAFDetalle_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then CargaCombos() 'ImgPersonalizar.Attributes.Add("onclick", "javascript:$('#DivPersonalizar').show(1000); PosicionaObjeto(this.id,'DivPersonalizar');") - - + GvDatos.DataBind(True) Try Dim Fecha, FechaI, FechaF As String @@ -163,9 +164,11 @@ Partial Class Compras_RepComprasAFDetalle End If If UsuarioActual.CveEmpresa = 72 Then - GvDatos.Columns(3).Visible = True + GvDatos.FBColumn("NoSerie").Visible = True End If + UPDatos.Update() + End If End Sub @@ -226,31 +229,7 @@ Partial Class Compras_RepComprasAFDetalle DdlPS.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2")) End If - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - DdlProyecto.Visible = False - LblSubProyecto.Text = "Sucursal" - LblProyecto.Visible = False - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlProyecto.Visible = False - LblSubProyecto.Text = "Proyecto" - LblProyecto.Visible = False - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Or UsuarioActual.Empresa.Tipo_CentroCosto = 0 Then - LblProyecto.Text = "Proyecto" - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.Text = "Sucursal" - LblSubProyecto.Text = "Proyecto" - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - LblProyecto.Text = "Proyecto" - LblSubProyecto.Text = "Sucursal" - End If - + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) End Sub @@ -264,15 +243,19 @@ Partial Class Compras_RepComprasAFDetalle End Sub Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - CargaSubProyecto() + If DdlProyecto.SelectedValue = "-1" Then + DdlProyecto.Items.Clear() + DdlSubProyecto.Items.Clear() + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) + Else + CargaSubProyecto() + End If End Sub Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros(String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue), "SubProyecto") DdlSubProyecto.DataBind() DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click CargaDatos() @@ -304,18 +287,12 @@ Partial Class Compras_RepComprasAFDetalle CvePS, Anio.ToEntero, Mes.ToEntero, AnioMes, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero) Then DTDatos = ObjCompras.DtResultados - GvDatos.DataSource = ObjCompras.DtResultados - Else - GvDatos.DataSource = Nothing - DTDatos = Nothing + GvDatos.DataSource = DTDatos End If - ObjCompras.Dispose() - GvDatos.DataBind() - - - + GvDatos.DataBind(True) + UPDatos.Update() End Sub Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound @@ -360,6 +337,9 @@ Partial Class Compras_RepComprasAFDetalle Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click GenerarPDF() End Sub + Private Sub LnkExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles LnkExcelPersonalizado.Click + GvDatos.ExportToExcel("ComprasDetalle_" + DdlPS.txtValue.Value + Now.ToShortDateString) + End Sub Private Sub GenerarPDF(Optional Formato As String = "PDF") Dim ObjTareas As New ClsOIEventos @@ -372,12 +352,8 @@ Partial Class Compras_RepComprasAFDetalle End If Dim params As New List(Of ReportParameter) - - - Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - Dim FechaI, FechaF As String FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) @@ -390,7 +366,6 @@ Partial Class Compras_RepComprasAFDetalle params.Add(New ReportParameter("FechaFin", FechaF)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) - params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) ImprimirPDF(RutaPDF, DTDatos, params, "ReporteComprasAFDetalle_" & Now.ToString("yyyyMMddmmss"), Formato:=Formato) @@ -502,4 +477,38 @@ Partial Class Compras_RepComprasAFDetalle End If End Sub + + Protected Sub PersonalizarColumnas() + GvDatos.FBColumn("SerieFolio").Visible = ChkFactura.Checked + GvDatos.FBColumn("SubProyecto").Visible = ChkSubProyecto.Checked + GvDatos.FBColumn("CodigoAF").Visible = ChkAF.Checked + GvDatos.FBColumn("NoSerie").Visible = ChkNS.Checked + GvDatos.FBColumn("CodigoPS").Visible = ChkPS.Checked + GvDatos.FBColumn("NombreCompleto").Visible = ChkResp.Checked + GvDatos.FBColumn("AFMedida").Visible = ChkMedidaAF.Checked + GvDatos.FBColumn("AFTipoMantenimientoStr").Visible = ChkTipoMant.Checked + GvDatos.FBColumn("TipoActivoFijo").Visible = ChkTipoAF.Checked + GvDatos.FBColumn("SubTipoActivoFijo").Visible = ChkSubTipoAF.Checked + GvDatos.FBColumn("Clasificacion").Visible = ChkClasif.Checked + GvDatos.FBColumn("Clasificacion2").Visible = ChkClasif2.Checked + GvDatos.FBColumn("UnidadMedida").Visible = ChkUM.Checked + GvDatos.FBColumn("Cantidad").Visible = ChkCant.Checked + GvDatos.FBColumn("PU").Visible = ChkPU.Checked + GvDatos.FBColumn("Total").Visible = ChkTotal.Checked + GvDatos.FBColumn("Cuenta").Visible = ChkCuenta.Checked + UPDatos.Update() + + If Personalizado Then + LnkExcelPersonalizado.Visible = True + Else + LnkExcelPersonalizado.Visible = False + End If + UPAcciones.Update() + End Sub + + Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click + Personalizado = True + PersonalizarColumnas() + End Sub + End Class \ No newline at end of file diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 1d39150e5..5325a5a58 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -3228,6 +3228,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim Bytes As Byte() = Nothing Dim ImpresionPersonalizada As Integer = UsuarioActual.Empresa.Funcionalidad(282).ToEntero + Dim ConceptoPoliza As String = TxtConcepto.Text Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/PolizasResumen.rdlc", UsuarioActual.Empresa.Ruta)) @@ -3257,6 +3258,10 @@ Partial Class ContabilidadC_RegPrePolizaS params.Add(New ReportParameter("CodigoPostal", "")) params.Add(New ReportParameter("UsuarioRegistro", TxtUsuarioElaboro.Text)) + params.Add(New ReportParameter("ConceptoPoliza", ConceptoPoliza)) + + + If Logo.Exists Then diff --git a/General/RepIndicadorResumen.aspx.vb b/General/RepIndicadorResumen.aspx.vb index 8808e6002..c555565c5 100644 --- a/General/RepIndicadorResumen.aspx.vb +++ b/General/RepIndicadorResumen.aspx.vb @@ -50,10 +50,11 @@ Partial Class General_RepIndicadorResumen Dim ObjCompras As New ClsCompras Dim ObjMovtos As New ClsMovimientos Dim ObjCitrus As New ClsCGame + Dim Grupo As Integer = 28 'Clasificación - PS If ObjVentas.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), MinFecha, MaxFecha, -1, - -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:="Ing", TipoCambio:=1) Then - GvVxP.DataSource = ObjVentas.DtResultados.FiltraParametros("", "CveMoneda,SubTotal DESC") + -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:="Ing", TipoCambio:=1) Then + GvVxP.DataSource = ObjVentas.DtResultados End If If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text, UsuarioActual.CveUsuario, DdlSubProyecto.SelectedValue.ToEntero) Then @@ -88,8 +89,8 @@ Partial Class General_RepIndicadorResumen 'Mostrar gráficos y totales en portlets solo si hay datos en su respectiva tabla If GvVxP.Rows.Count > 0 Then UPGraficaVxP.Visible = True - PLVxPTot.InnerHtml = "" + "Cantidad: " + "" + String.Format("{0:n} Kg", CType(GvVxP.DataSource, DataTable).SUM("Cantidad", "Orden IS NOT NULL")) _ - + "" + "Total: " + "" + String.Format("{0:c} MXN", CType(GvVxP.DataSource, DataTable).SUM("SubTotalMN", "Orden IS NOT NULL")) + PLVxPTot.InnerHtml = "" + "Cantidad: " + "" + String.Format("{0:n} Kg", CType(GvVxP.DataSource, DataTable).SUM("Cantidad", "CodigoPS <> ''")) _ + + "" + "Total: " + "" + String.Format("{0:c} MXN", CType(GvVxP.DataSource, DataTable).SUM("SubTotalMN", "CodigoPS <> ''")) Else UPGraficaVxP.Visible = False PLVxPTot.InnerHtml = Nothing @@ -159,6 +160,10 @@ Partial Class General_RepIndicadorResumen If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("Orden") = "" Then e.Row.CssClass = "Totales" + Else + If e.Row.DBCampo("CodigoPS") = "" Then + e.Row.CssClass = "SubTotales" + End If End If End If End Sub @@ -253,7 +258,7 @@ Partial Class General_RepIndicadorResumen DtVxP.Columns.Add("Unidad") 'RowColorIndex = 0 For Each Dr As DataRow In CType(GvVxP.DataSource, DataTable).FiltraParametros("", "SubTotalMN DESC").Rows - If Not Dr("Orden").ToString = "" Then + If Not Dr("CodigoPS").ToString = "" Then Dim Row = DtVxP.NewRow() Row("Texto") = Dr("GPO").ToString Row("Valor") = Dr("SubTotalMN").ToString.FormatoNumero diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index 72404a554..c8b79970a 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -345,7 +345,7 @@ Partial Class Inventarios_ReporteEntradasSalidas ImprimiReporte("EXCEL") End Sub Private Sub LnkExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles LnkExcelPersonalizado.Click - GvM.ExportToExcel("EntradasSalidas_" + Now.ToShortDateString + ".xls") + GvM.ExportToExcel("EntradasSalidas_" + Now.ToShortDateString) End Sub Private Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click ImprimiReporte() diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index 4bcd4e740..39c129a0a 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -325,7 +325,8 @@
    - + diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index 6329d75bf..dc4fec606 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -592,16 +592,17 @@ Partial Class Portal_PortalProveedor Protected Sub GvBancos_comprobante(sender As Object, e As EventArgs) - Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - - Dim Path As String = String.Format("{0}{1}{2}{3}", UsuarioActual.Empresa.Ruta, "IE\", Gvr.FCHiddenField("CveIe").Value, ".png") + Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim Path As String = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, Gvr.DataKey("Comprobante")) + Dim Archivo As New System.IO.FileInfo(Path) If Archivo.Exists Then HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = "application/png" - HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=comprobante.png") + HttpContext.Current.Response.ContentType = "application/png" + HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) HttpContext.Current.Response.TransmitFile(Path) 'HttpContext.Current.Response.Flush() diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 342e0bd09..6920fa6c9 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -1111,7 +1111,8 @@
    - + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 2b438d38a..0c9c53526 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1656,7 +1656,8 @@ Partial Class Clientes DdlUsoCFDI.SelectedValueExist(ObjClientes.CveUsoCFDI.ToString()) DdlMetodoPago33.SelectedValueExist(ObjClientes.CveMetodoPago33.ToString()) - DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago33.ToString()) + 'DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago33.ToString()) + CargaFormaDePago(ObjClientes.CveFormaPago33) If ObjClientes.CveRegimenFiscal > 0 Then DdlRegimenFiscal.SelectedValueExist(ObjClientes.CveRegimenFiscal) ChkDesglosarIEPS.Checked = ObjClientes.DesglosaIEPS @@ -10583,5 +10584,36 @@ Partial Class Clientes UpLineaAdicionalmodal.Update() End Sub + + Protected Sub DdlMetodoPago33_SelectedIndexChanged(sender As Object, e As EventArgs) + + CargaFormaDePago(-1) + + End Sub + + Private Sub CargaFormaDePago(Optional CveFormaPago As Integer = -1) + + DdlFormaPago33.Items.Clear() + + If DdlMetodoPago33.SelectedValue.ToEntero = 3 Then + DdlFormaPago33.DataSource = GlobalDTVtaFormaPago.FiltraParametros("CveFormaPago = 20") + Else + DdlFormaPago33.DataSource = GlobalDTVtaFormaPago.FiltraParametros("CveFormaPago <> 20") + End If + + DdlFormaPago33.DataBind() + + If Not DdlMetodoPago33.SelectedValue.ToEntero = 3 Then + DdlFormaPago33.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + End If + + If CveFormaPago > 0 Then + DdlFormaPago33.SelectedValueExist(CveFormaPago) + End If + + UpFiscalContable.Update() + + End Sub + End Class