diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index f71c30878..e7a7280d6 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -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) diff --git a/Bancos/RepCxCCliente.aspx b/Bancos/RepCxCCliente.aspx index 283a6e5ba..4c4067ef2 100644 --- a/Bancos/RepCxCCliente.aspx +++ b/Bancos/RepCxCCliente.aspx @@ -59,7 +59,7 @@ -
+
@@ -124,10 +124,10 @@
  • Cuenta:     - +
  • Moneda: - +
  • diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb index ffa1a3378..960811766 100644 --- a/Bancos/RepCxCCliente.aspx.vb +++ b/Bancos/RepCxCCliente.aspx.vb @@ -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 diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 405c5dcb1..479eefe24 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -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 diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 32792b00f..8db28f336 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -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 diff --git a/OS/RepServicioDomicilio.aspx b/OS/RepServicioDomicilio.aspx index 8b9b087d3..cca9c7ac9 100644 --- a/OS/RepServicioDomicilio.aspx +++ b/OS/RepServicioDomicilio.aspx @@ -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")); + }); diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index 2b5459bb0..33a77efd2 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -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 diff --git a/RH/CatDocumentos.aspx b/RH/CatDocumentos.aspx index 39c160e78..8b286199b 100644 --- a/RH/CatDocumentos.aspx +++ b/RH/CatDocumentos.aspx @@ -50,7 +50,8 @@ + 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" > @@ -111,7 +112,8 @@ - + diff --git a/RH/CatDocumentos.aspx.vb b/RH/CatDocumentos.aspx.vb index 61d32c97d..530066dbc 100644 --- a/RH/CatDocumentos.aspx.vb +++ b/RH/CatDocumentos.aspx.vb @@ -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(" ", linkDescarga, DocumetacionFormato) - Else - ImgDownLoad.Text = String.Format(" ", 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 diff --git a/Ventas/PopUpBuscarClientes.aspx b/Ventas/PopUpBuscarClientes.aspx index 11b583660..727fb9ca2 100644 --- a/Ventas/PopUpBuscarClientes.aspx +++ b/Ventas/PopUpBuscarClientes.aspx @@ -73,6 +73,19 @@ + + + + Cuenta: + + + + + + + + + diff --git a/Ventas/PopUpBuscarClientes.aspx.vb b/Ventas/PopUpBuscarClientes.aspx.vb index fa8690108..58141167d 100644 --- a/Ventas/PopUpBuscarClientes.aspx.vb +++ b/Ventas/PopUpBuscarClientes.aspx.vb @@ -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