Clientes busqueda cuenta, correcion descarga documentos cat documentos, ajustes servicio domicilio

This commit is contained in:
Oscar Irigoyen
2023-01-14 09:17:38 -07:00
parent b2362f5603
commit 19cdedbfd4
11 changed files with 137 additions and 63 deletions

View File

@@ -264,7 +264,8 @@ Public Class ClsClientes
End Sub
Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer,
CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1,
Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveUsuarioConsulta As Integer = -1) As Boolean
Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveUsuarioConsulta As Integer = -1,
Optional Cuenta As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ClientesGet")
@@ -287,6 +288,8 @@ Public Class ClsClientes
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@PermiteCredito", SqlDbType.Int).Value = PermiteCreditoFiltro
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
.Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -59,7 +59,7 @@
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet solid grey-cascade portlet-filter" style="" id="DVFILTROS">
<div class="portlet-title portlet-filterT" style="">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
@@ -124,10 +124,10 @@
</asp:DropDownList>
</li>
<li>Cuenta:&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Textbox runat="server" ID="TxtCuenta" Width="120px"/>
<asp:Textbox runat="server" ID="TxtCuenta" Width="120px" Height="30px" />
</li>
<li>Moneda:
<asp:DropDownList ID="DdlMoneda" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="Moneda" DataValueField="CveMoneda" Width="80px">
<asp:DropDownList ID="DdlMoneda" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="Moneda" DataValueField="CveMoneda" Width="120PX">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>

View File

@@ -69,13 +69,13 @@ Partial Class Bancos_RepCxCCliente
Mov.Dispose()
GvCxC.DataBind()
If (GvCxC.Rows.Count > 0) Then
GvCxC.UseAccessibleHeader = True
GvCxC.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
'If (GvCxC.Rows.Count > 0) Then
GvCxC.UseAccessibleHeader = True
GvCxC.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
UPDatos.Update()
UPDatos.Update()
End If
'End If
End Sub
Protected Sub GvCxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCxC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then

View File

@@ -1084,6 +1084,7 @@ Partial Class Compras_Compras
#End Region
Dim DTConceptos As DataTable
Private Property EmpresasOC As List(Of Integer)
Get
@@ -1185,6 +1186,18 @@ Partial Class Compras_Compras
End Property
Private Property EsDevolucionApoyoLogistico As Boolean
Get
If ViewState("EsDevolucionApoyoLogistico") Is Nothing Then
ViewState("EsDevolucionApoyoLogistico") = False
End If
Return CType(ViewState("EsDevolucionApoyoLogistico"), Boolean)
End Get
Set(value As Boolean)
ViewState("EsDevolucionApoyoLogistico") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -1610,7 +1623,13 @@ Partial Class Compras_Compras
NCSeleccionFacturasRelacionadas(UUIDSList)
End If
If CveFactura > 0 AndAlso Serie Isnot nothing AndAlso Serie.ToUpper = "NL" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
EsDevolucionApoyoLogistico = True
DdlTipoComprobante.Items.Clear()
DdlTipoComprobante.Items.Add(New ListItem("Devolución", "DEV"))
DdlTipoComprobante.SelectedValueExist("DEV")
End If
End If
@@ -5527,6 +5546,8 @@ Partial Class Compras_Compras
If DdlTipoComprobante.SelectedValue = "Fac" Then
For Each tCveAlmacen As Integer In ListAlmacenes
If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then
Continue For
@@ -5553,7 +5574,7 @@ Partial Class Compras_Compras
ListaMovimientosAlmacen.Add(CveMovimientoInventario)
Dim contadorAlamcen As Integer = 0
For Each Dr As DataRow In DtInv.Rows
CveProducto = Dr("CvePS").ToString.ToEntero
@@ -5594,22 +5615,26 @@ Partial Class Compras_Compras
End If
End If
'si no es por serie lote
ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar)
'si no es por serie lote
ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto)
If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
ErrorMovInv = True
Exit For
If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
ErrorMovInv = True
Exit For
End If
End If
End If
End If
i = i + 1
i = i + 1
contadorAlamcen = contadorAlamcen + 1
Next
End If
Next
End If
@@ -10988,7 +11013,16 @@ Partial Class Compras_Compras
e.Row.FCCheckBox("cbInv").Enabled = False
End If
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
If EsDevolucionApoyoLogistico Then
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 27") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
Else
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
End If
e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlEAlmacen").DataBind()
'e.Row.FCDropDownList("ddlEAlmacen").SelectedValue = If(e.Row.DBCampo("CveAlmacen").ToEntero <= 0, "-1", e.Row.DBCampo("CveAlmacen"))
@@ -11100,6 +11134,10 @@ Partial Class Compras_Compras
StrAlmacenes = $"Modalidad = 0"
End If
If EsDevolucionApoyoLogistico Then
StrAlmacenes = " CveTipoAlmacen = 27"
End If
e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlAlmacen").DataBind()
@@ -17625,6 +17663,8 @@ Partial Class Compras_Compras
'If GlobalDTProductosServiciosEquivalencias(CvePS, CveUM).Rows.Count = 0 Then Row("CveEq") = 1 Else Row("CveEq") = 0
Row("NoDeducible") = NoDeducible
Total = Math.Round(PU, DecimalesPermitidos) * Cantidad - Descuento
Row("PU") = Math.Round(PU, DecimalesPermitidos)
If CargaXml And (Version = "3.3" Or Version = "4.0") Then

View File

@@ -2042,7 +2042,7 @@ Partial Class Inventarios_EntradasSalidas
If Not ErrorAC And Not ErrorMovInv Then
If Not DdlDireccionEnvio.SelectedValue.ToEntero > 0 Then
If ChkEmitirTimbrado.Checked AndAlso Not DdlDireccionEnvio.SelectedValue.ToEntero > 0 Then
ErrorMovInv = True
Alert("La direccion destino es requerida.", TipoMensaje.MsgAdvertencia)
End If

View File

@@ -1180,24 +1180,10 @@
function InitCalendar() {
$(document).ready(function () {
//$("#TxtModalFechaOS").on("change paste keyup", function () {
// console.log('TxtModalFechaOS Modificado');
//});
//jQuery('#TxtModalFechaOS').on('input', function () {
// console.log('TxtModalFechaOS Modificado');
//});
//$("#TxtModalFechaOS").change(function () {
// console.log('TxtModalFechaOS Modificado');
//});
Calendario();
// CargaPickers();
// $("#TxtModalFechaOS").val("" + start.format("DD/MM/YYYY 08:00 tt"));
});

View File

@@ -1358,11 +1358,6 @@ Partial Class OS_RepServicioDomicilio
If DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then
'If ViewState("Validando") Is Nothing Then
' ViewState("Validando") = True
'Else
' Exit Sub
'End If
Dim objOS As New ClsOS

View File

@@ -50,7 +50,8 @@
<ContentTemplate>
<asp:GridView ID="GvDocumentos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveDocumentacion,Documentacion,DocumentacionFormato,Orden,Estatus,CveDocumentacionTipo,DocumentacionTipo,Requerido,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento" EmptyDataText="No se encontraron registros de documentos" CssClass="table table-hover table-advance Widthall" GridLines="None">
DataKeyNames="CveDocumentacion,Documentacion,DocumentacionFormato,Orden,Estatus,CveDocumentacionTipo,DocumentacionTipo,Requerido,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento"
EmptyDataText="No se encontraron registros de documentos" CssClass="table table-hover table-advance Widthall" GridLines="None" >
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="60px" HeaderText="Documento">
@@ -111,7 +112,8 @@
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px">
<ItemTemplate>
<asp:Literal ID="ImgDownLoad" runat="server"></asp:Literal>
<asp:LinkButton ID="ImgDownLoadFormato" CssClass="btn btn-circle btn-sm blue" OnClick="DownLoadFormato_ClickDocumentacion" runat="server" Visible="false"
Text="<i class='fa fa-download' style='color:white' title='Descargar formato'></i>" CausesValidation="False" />
</ItemTemplate>
</asp:TemplateField>

View File

@@ -418,8 +418,11 @@ Partial Class RH_CatDocumentos
If e.Row.RowType = DataControlRowType.DataRow Then
Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero
Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString
'Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato")
Dim separado As Char() = {"."}
Dim array() As String = DocumetacionFormato.Split(separado)
Dim extencion As String = ""
@@ -430,27 +433,50 @@ Partial Class RH_CatDocumentos
If DocumetacionFormato.Trim.Length > 0 Then
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato
If File.Exists(linkDescargaArchivo) Then
ImgDownLoad.Visible = True
If extencion.Length > 0 Then
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar Formato'></i></a>", linkDescarga, DocumetacionFormato)
Else
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar Formato'></i></a>", linkDescarga, DocumetacionFormato)
End If
Else
ImgDownLoad.Visible = False
End If
Else
ImgDownLoad.Visible = False
End If
Dim PathDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato
Dim FileD = New FileInfo(PathDescargaArchivo)
If FileD.Exists Then
ImgDownLoadFormato.Visible = True
ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
End If
End If
End If
End Sub
Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
'Dim Adjunto As String = GvRow.DataKey("Adjunto")
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
Dim DocumetacionFormato As String = GvRow.DataKey("DocumentacionFormato").ToString
Dim PathDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato
Dim FileD = New FileInfo(PathDescargaArchivo)
If FileD.Exists Then
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + FileD.Name)
Response.AddHeader("Content-Length", FileD.Length.ToString())
Response.ContentType = "text/octet-stream"
Response.Flush()
Response.TransmitFile(FileD.FullName)
Response.End()
End If
End Sub
#End Region
@@ -670,5 +696,7 @@ Partial Class RH_CatDocumentos
RegistraScript(String.Format("$('#{0}').modal('show');", "DVParametros"))
End Sub
End Class

View File

@@ -73,6 +73,19 @@
</asp:DropDownList>
</td>
</tr>
<tr align="left">
<td class="text-right"><b>Cuenta:</b></td>
<td>
<asp:Textbox runat="server" ID="TxtCuenta" Width="200px" MaxLength="50"/>
</td>
<td class="text-right"><b></b></td>
<td>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="4">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>

View File

@@ -2,6 +2,8 @@
Option Strict On
Imports Extensiones
Imports Microsoft.Owin.Security.Provider
Partial Class PopUpBuscarClientes
Inherits ClsPaginas
@@ -74,13 +76,17 @@ Partial Class PopUpBuscarClientes
Dim ObjClientes As New ClsClientes()
Dim CveUsuarioConsulta As Integer
Dim Cuenta As String = If(TxtCuenta.Text = "", "-1", TxtCuenta.Text)
If UsuarioActual.TienePermisoProceso(322) Then
CveUsuarioConsulta = UsuarioActual.CveVendedor
Else
CveUsuarioConsulta = -1
End If
If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100, CveUsuarioConsulta:=CveUsuarioConsulta) Then
DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100, CveUsuarioConsulta:=CveUsuarioConsulta, Cuenta:=Cuenta) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjClientes.DtResultados
@@ -150,6 +156,7 @@ Partial Class PopUpBuscarClientes
If TxtMail.Text.Trim <> String.Empty Then Return True
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
If TxtCuenta.Text.Trim.Length > 0 Then Return True
Return False
End Function