diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 3738ec5bf..942db4ee7 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -6091,6 +6091,22 @@ Public Class ClsVentas Return Retorno End Function + Public Function GetAutorizacion(CveAutorizacion As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_AutorizacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error la autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha, Optional CveUsuarioConsulta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_AutorizacionLimitesGet") diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index 6c03abd96..ad368f621 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -232,7 +232,7 @@ - diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index 121f3e5bc..7a798de81 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -120,7 +120,6 @@ Partial Class Inventarios_ReporteEntradasSalidas GvM.Columns(7).HeaderStyle.Width = 133 GvM.Columns(8).HeaderStyle.Width = 133 GvM.Columns(10).HeaderStyle.Width = 134 - GvM.CssClass = "table table-smallpadding table-striped table-hover ScrollAD" GvM.Width = 1074 dvArt.Attributes.Add("style", "text-align:center!important; font-size:14px;width:537px;") dvCan.Attributes.Add("style", "text-align:center!important; font-size:14px; border-right-color: white!important;border-left-color: white!important;width:537px;border-style: solid;") diff --git a/RH/CalculoSBC.aspx b/RH/CalculoSBC.aspx index c4b81e18c..6dc81a5e3 100644 --- a/RH/CalculoSBC.aspx +++ b/RH/CalculoSBC.aspx @@ -10,9 +10,11 @@ .GVCalculosSBC tr th:nth-child(n+13):not(:nth-child(n+16)) { background-color: #88d6cd !important; - }.GVDetalleParteVariable tr > td:nth-child(n+2) { - text-align: right; -} + } + + .GVDetalleParteVariable tr > td:nth-child(n+2) { + text-align: right; + } @@ -248,7 +250,7 @@ Modificación - + <%-- --%> @@ -474,7 +476,8 @@ + CssClass="table table-hover table-striped ScrollAD Widthall GVBuscaddor GVDetalleParteVariable"> + @@ -619,10 +622,20 @@ + + + + + + + + +
- Formatos + Formatos
- + -
- +
- - + diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs index ebbfe1881..cdac02a17 100644 --- a/RH/CalculoSBC.aspx.cs +++ b/RH/CalculoSBC.aspx.cs @@ -420,7 +420,7 @@ public partial class RH_CalculoSBC : ClsPaginas column++; libro.Cell(1, column).Value = "Empleado"; column++; - libro.Cell(1, column).Value = "TipodeSalario"; + libro.Cell(1, column).Value = "TipodeSalario"; libro.Row(1).CellsUsed().Style.Font.FontColor = ClosedXML.Excel.XLColor.White; libro.Row(1).CellsUsed().Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)); @@ -434,7 +434,7 @@ public partial class RH_CalculoSBC : ClsPaginas libro.Cell(Fila, column).Value = erow["Nombre"]; column++; - libro.Cell(Fila, column).Value = erow["TipodeSalario"]; + libro.Cell(Fila, column).Value = erow["TipodeSalario"]; } libro.Columns().AdjustToContents(); @@ -521,7 +521,7 @@ public partial class RH_CalculoSBC : ClsPaginas SalarioCotizacion = Salariovariable + SDI; if (objpersonal.UpdateSalarios(CvePersonal, txtfechacargamasiva.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Salariodiario.ToString().ToDouble(), SDI.ToString().ToDouble(), SalarioCotizacion.ToString().ToDouble(), Salariodiario.ToString().ToDouble(), - false,true,"True")) + false, true, "True")) { { @@ -574,7 +574,7 @@ public partial class RH_CalculoSBC : ClsPaginas } if (CvePersonal > 0) { - objpersonal.PersonalRPUpdate( CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa , RegistroPatronal); + objpersonal.PersonalRPUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RegistroPatronal); } } @@ -613,7 +613,7 @@ public partial class RH_CalculoSBC : ClsPaginas } if (CvePersonal > 0) { - objpersonal.PersonalTSUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipodeSalario); + objpersonal.PersonalTSUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipodeSalario); } } @@ -732,6 +732,7 @@ public partial class RH_CalculoSBC : ClsPaginas try { archivoW = new System.IO.StreamWriter(string.Format("{0}{1}.txt", rutarchivos, namearchivo), true, System.Text.Encoding.UTF8); } catch (Exception) { } if (archivoW != null) { + Alert(MovtosmodSalario); try { archivoW.WriteLine(MovtosmodSalario); } catch (Exception) { } try { @@ -758,7 +759,7 @@ public partial class RH_CalculoSBC : ClsPaginas double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2); if (continuar && (item.FCCheckBox("chkUpdate").Checked) &&//SalarioDiarioSSNuevo != SalarioDiarioSS && (continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario, - false,true,"True" + false, true, "True" ))) { @@ -915,16 +916,19 @@ public partial class RH_CalculoSBC : ClsPaginas string rutarchivos = string.Format("{0}\\modificacionsalarios\\", UsuarioActual.Empresa.Ruta); List lisaarchivos = new List(); - foreach (var urfile in System.IO.Directory.GetFiles(rutarchivos, "*")) + if (System.IO.Directory.Exists(rutarchivos)) { - if (urfile.Replace(rutarchivos, "").Length > 9) + foreach (var urfile in System.IO.Directory.GetFiles(rutarchivos, "*")) { - string cfecha = urfile.Replace(rutarchivos, "").Substring(0, 10).ToDateTime().ToString("dd/MM/yyyy"); + if (urfile.Replace(rutarchivos, "").Length > 9) + { + string cfecha = urfile.Replace(rutarchivos, "").Substring(0, 10).ToDateTime().ToString("dd/MM/yyyy"); - archivosD arch = new archivosD() { nombrearchivo = cfecha, ruta = urfile, fecha = System.IO.File.GetCreationTime(urfile) }; - lisaarchivos.Add(arch); + archivosD arch = new archivosD() { nombrearchivo = cfecha, ruta = urfile, fecha = System.IO.File.GetCreationTime(urfile) }; + lisaarchivos.Add(arch); + } } } GVDoctos.DataSource = lisaarchivos; @@ -936,7 +940,7 @@ public partial class RH_CalculoSBC : ClsPaginas protected void GVDetalleParteVariable_RowDataBound(object sender, GridViewRowEventArgs e) { - if(e.Row.RowType == DataControlRowType.DataRow) + if (e.Row.RowType == DataControlRowType.DataRow) { for (int i = 0; i < e.Row.Cells.Count; i++) { @@ -966,6 +970,28 @@ public partial class RH_CalculoSBC : ClsPaginas { } + protected void DescargarArchivobitacora(object sender, EventArgs e) + { + Button btn = (Button)sender; + GridViewRow row = (GridViewRow)btn.NamingContainer; + + // Obtener la ruta del archivo desde el DataKeyNames + string rutaArchivo = GVDoctos.DataKeys[row.RowIndex]["ruta"].ToString(); + string nombreArchivo = string.Format("{0}.txt",GVDoctos.DataKeys[row.RowIndex]["nombrearchivo"]); + + if (System.IO.File.Exists(rutaArchivo)) + { + Response.Clear(); + Response.ContentType = "application/octet-stream"; + Response.AddHeader("Content-Disposition", "attachment; filename=" + nombreArchivo); + Response.WriteFile(rutaArchivo); + Response.End(); + } + else + { + ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('El archivo no existe en el servidor');", true); + } + } } public class archivosD { diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index eb0c42851..f2495b84c 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -202,8 +202,11 @@ Partial Class Ventas_RepVentas DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14")) DdlGrupo.Items.Insert(13, New ListItem("Tipo Cliente", "20")) DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21")) - DdlGrupo.Items.Insert(13, New ListItem("Giro", "22")) + DdlGrupo.Items.Insert(13, New ListItem("Giro", "22")) + If UsuarioActual.Empresa.Funcionalidad(307) <> "" Then DdlGrupo.Items.Insert(10, New ListItem(UsuarioActual.Empresa.Funcionalidad(307), "23")) + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlGrupo.Items.Insert(13, New ListItem("Tipo Venta", "24")) DdlGrupo.DataBind() DdlGrupo.SelectedValueExist("3") @@ -222,6 +225,7 @@ Partial Class Ventas_RepVentas DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs' ") DdlTipoVenta.DataBind() + DdlTipoVenta.Items.Insert(0, New ListItem("Sin Asignar", "-2")) DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1")) End If @@ -314,11 +318,15 @@ Partial Class Ventas_RepVentas FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha) Dim ModalidadContable As Boolean = Not ChkLecturaAdmin.Checked + Dim CveTipoVenta As Integer = -1 + If DivTipoVenta.Visible Then + CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero() + End If If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable, - EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then + EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=CveTipoVenta) Then GvDatos.DataSource = ObjVentas.DtResultados DtVentas = ObjVentas.DtResultados Else diff --git a/Ventas/RepVentasDetalle.aspx.vb b/Ventas/RepVentasDetalle.aspx.vb index 1d7735992..ed2f94f20 100644 --- a/Ventas/RepVentasDetalle.aspx.vb +++ b/Ventas/RepVentasDetalle.aspx.vb @@ -5,6 +5,7 @@ Imports System.Data Imports Extensiones Imports Microsoft.Reporting.WebForms Imports System.Net.Http +Imports DocumentFormat.OpenXml.Office2010.PowerPoint Partial Class RepVentasDetalle Inherits ClsPaginas @@ -326,6 +327,7 @@ Partial Class RepVentasDetalle DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs'") DdlTipoVenta.DataBind() + DdlTipoVenta.Items.Insert(0, New ListItem("Sin Asignar", "-2")) DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1")) End If @@ -461,6 +463,11 @@ Partial Class RepVentasDetalle ChkLecturaAdmin.Checked = Not ModalidadContable CveProyecto = DdlProyecto.SelectedValue.ToEntero + Dim CveTipoVenta As Integer = -1 + If DivTipoVenta.Visible Then + CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero() + End If + Dim ObjVentas As New ClsVentas() 'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente, @@ -468,7 +475,7 @@ Partial Class RepVentasDetalle CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec, CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), - ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then + ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=CveTipoVenta) Then DtVentas = AddRows(ObjVentas.DtResultados) ImgImprimir.Enabled = True GvDatos.DataSource = AddRows(ObjVentas.DtResultados) @@ -536,6 +543,7 @@ Partial Class RepVentasDetalle ChkIEPS.Checked = UsuarioActual.Empresa.Funcionalidad(713) = "1" 'empresa deduce IEPS GvDatos.Columns(9).Visible = ChkIEPS.Checked ChkKilometraje.Visible = UsuarioActual.Empresa.Funcionalidad(558) = "1" 'empresa llantera + ChkTipoVenta.Visible = UsuarioActual.Empresa.Funcionalidad(531) = "1" 'empresa acumuladores End Sub Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound @@ -668,6 +676,11 @@ Partial Class RepVentasDetalle ChkEstatusFactura.Checked = True ChkCliente.Checked = True + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + ChkSucursal.Checked = False + ChkTipoVenta.Checked = True + End If + End Sub Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs) @@ -781,6 +794,8 @@ Partial Class RepVentasDetalle If ChkDescargarXML.Checked Then ListPersonalizada.Add("XML") + If ChkTipoVenta.Checked Then ListPersonalizada.Add("TipoVenta") + If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentaDetalles.aspx", String.Join("|", ListPersonalizada)) Then 'Alert("Personalizacion guardada") End If @@ -841,6 +856,7 @@ Partial Class RepVentasDetalle ChkDescargarPDF.Checked = False ChkDescargarXML.Checked = False + ChkTipoVenta.Checked = False Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c) For Each personalizacion As String In Personalizaciones @@ -980,6 +996,9 @@ Partial Class RepVentasDetalle Case "PDF" ChkDescargarPDF.Checked = True Exit Select + Case "TipoVenta" + ChkTipoVenta.Checked = True + Exit Select Case Else Exit Select End Select @@ -988,6 +1007,7 @@ Partial Class RepVentasDetalle Personaliza() Else PersonalizaDefault() + Personaliza() End If UPPersonalizar.Update() diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 7f4359172..b76727f61 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -417,9 +417,9 @@
  • Verificar Existencias
  • -
  • - Envio De Correo -
  • +
  • + Envio De Correo +
  • @@ -654,7 +654,7 @@ - + @@ -995,6 +995,11 @@ + + Tipo Venta:  + + + @@ -1345,7 +1350,7 @@
    - + @@ -7357,7 +7362,14 @@