From 2a92136ba29c9def9cfba2407ba274da3b4feec3 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 18 Oct 2024 14:06:44 -0700 Subject: [PATCH 01/11] -- SMS tipo de almacen --- Inventarios/CatAlmacenes.aspx.vb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Inventarios/CatAlmacenes.aspx.vb b/Inventarios/CatAlmacenes.aspx.vb index ec8b4d92f..7420d57a4 100644 --- a/Inventarios/CatAlmacenes.aspx.vb +++ b/Inventarios/CatAlmacenes.aspx.vb @@ -90,6 +90,10 @@ Partial Class Inventarios_CatAlmacenes DdlTipoAlmacenFiltro.DataBind() DdlTipoAlmacen.DataBind() + + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then + DdlTipoAlmacen.SelectedValueExist("4") ' tipo consignación por default + End If End Sub Private Sub CargaUsuarios() From 931b463bd21121b093029aa6d4c08de3353d478e Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 18 Oct 2024 14:06:56 -0700 Subject: [PATCH 02/11] -- mejora --- Transportes/RepContratoDetalle.aspx.vb | 9 +++++++-- Transportes/RepContratos.aspx.vb | 14 ++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index eb28e17b0..a697ff570 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -422,8 +422,13 @@ Partial Class RepContratoDetalle If Not ErrorProceso Then - If CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero Or CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero Or ImporteOrigial <> TxtImporte.Text.ToDecimal Or DescripcionOriginal <> TxtDescripcion.Text Or - TipoAFOriginal <> DdlTipoAF.SelectedItem.Text Or FolioOriginal <> TxtFolio.Text.Trim Then + If CveVentaRemision > 0 AndAlso (CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero OrElse + CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero OrElse + ImporteOrigial <> TxtImporte.Text.ToDecimal OrElse + DescripcionOriginal <> TxtDescripcion.Text OrElse + TipoAFOriginal <> DdlTipoAF.SelectedItem.Text OrElse + FolioOriginal <> TxtFolio.Text.Trim) Then + Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}" If Not UpdateRemision(ObjContratos.IniciaTransacSQL(), DdlSubProyecto.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, ObsRemisionPartida) Then ErrorProceso = True diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index aabc0d25a..dea02f48c 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -24,7 +24,7 @@ Partial Class ListadoContratos If Not IsPostBack Then txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString - txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString + txtFechaF.Text = DateTime.Now.AddDays(15).ToShortDateString InicializaCombos() CargaDatos() End If @@ -116,17 +116,15 @@ Partial Class ListadoContratos Directory.CreateDirectory(folderContratosPath) End If - If DdlClientes.SelectedValue = "" Then Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia) Exit Sub End If - 'Agregamos Contrato Dim ObjContratos As New ClsContratos - ObjContratos.IniciaTransacSQL() + Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL()) CveContrato = ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDateTime, TxtFechaRegreso.Text.ToDateTime, TxtUbicacion.Text, "", DdlSubProyectoModal.SelectedValue.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal, @@ -188,17 +186,13 @@ Partial Class ListadoContratos ErrorProceso = True Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia) End If - End If - - Else ErrorProceso = True End If If Not ErrorProceso Then 'Aumentamos Folio - Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL()) If Not ObjFolios.UpdateFolioActual(-1, "Con", True, UsuarioActual.CveEmpresa) Then ErrorProceso = True End If @@ -214,9 +208,9 @@ Partial Class ListadoContratos End If ObjContratos.Dispose() + ObjFolios.Dispose() ResetModal() - CargaDatos() RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1") End Sub @@ -264,7 +258,7 @@ Partial Class ListadoContratos ObjContratos.Dispose() End Sub Protected Sub Consultar(sender As Object, e As EventArgs) - + CargaDatos() End Sub Protected Sub Personalizar(sender As Object, e As EventArgs) GvContratos.Columns(6).Visible = ChkChofer.Checked From 3164ecc041524353f6beebd7cb4dd92f923c139f Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 15:59:46 -0700 Subject: [PATCH 03/11] =?UTF-8?q?--=20mejora=20en=20validaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AF/CatAF.aspx.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb index e8dfe0bfd..728bba33b 100644 --- a/AF/CatAF.aspx.vb +++ b/AF/CatAF.aspx.vb @@ -294,7 +294,9 @@ Partial Class AF_CatAF GvDatos.DataSource = DtActivosFijos GvDatos.DataBind() - LtlTotalRegistros.Text = DtActivosFijos.Rows.Count.ToString.FormatoNumero(0) + If DtActivosFijos IsNot Nothing Then + LtlTotalRegistros.Text = DtActivosFijos.Rows.Count.ToString.FormatoNumero(0) + End If UpGV.Update() OrdenaDatos() From 59f616a6008079504ca1e5f41e0ecace4b8ae93a Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:00:39 -0700 Subject: [PATCH 04/11] =?UTF-8?q?--validaci=C3=B3n=20resico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 6f24b4dac..3b98dd2bf 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1987,6 +1987,7 @@ Partial Class Compras_Compras Next If EmisorRegimenFiscal = "626" AndAlso Not RetISRResico Then SbValRet.Append(" La factura no tiene especificado una retención de ISR, ya que el proveedor es Resico.
") + BtnGuardar.Enabled = False End If If SbValRet.ToString.Trim.Length > 0 Then From 353c0bfcc1abb62cb6ed33008cbdeeb77b3ca3c5 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:00:59 -0700 Subject: [PATCH 05/11] whatsapp2 --- App_Code/modExtensiones.vb | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 5164ca1f2..148701a92 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -755,6 +755,68 @@ Namespace Extensiones End Try Return Retorno End Function + Public Function EnviarNotificacionWhatsApp2(NumeroTelefono As String, NombreUsuario As String, Mensaje As String) As Boolean + Dim RetornoObj As String = "{}" + Dim Retorno As Boolean = False + + Try + Dim TokenAutorizacion As String = $"Bearer {WhatsAppToken}" + Using httpClient = New HttpClient() + Using request = New HttpRequestMessage(HttpMethod.Post, New Uri("https://graph.facebook.com/v20.0/425866980604901/messages")) + + request.Headers.Add("Authorization", TokenAutorizacion) + Dim json = New Newtonsoft.Json.Linq.JObject() + json.Add(New Newtonsoft.Json.Linq.JProperty("messaging_product", "whatsapp")) + json.Add(New Newtonsoft.Json.Linq.JProperty("to", NumeroTelefono)) + + json.Add(New Newtonsoft.Json.Linq.JProperty("type", "template")) + + Dim plantilla As New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("name", "textolibre"), + New Newtonsoft.Json.Linq.JProperty("language", + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("code", "es_MX") + ) + ), + New Newtonsoft.Json.Linq.JProperty("components", + New Newtonsoft.Json.Linq.JArray( + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "body"), + New Newtonsoft.Json.Linq.JProperty("parameters", + New Newtonsoft.Json.Linq.JArray( + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "text"), + New Newtonsoft.Json.Linq.JProperty("text", Mensaje) + ) + ) + ) + ) + ) + ) + ) + + + json.Add(New Newtonsoft.Json.Linq.JProperty("template", plantilla)) + + Using content = New StringContent(json.ToString, Encoding.UTF8, "application/json") + request.Content = content + Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result + + If response.StatusCode = Net.HttpStatusCode.OK Then + RetornoObj = response.Content.ReadAsStringAsync().Result + Retorno = True + End If + End Using + + End Using + + End Using + Catch ex As Exception + RetornoObj = New Newtonsoft.Json.Linq.JObject(New Newtonsoft.Json.Linq.JProperty("Error", ex.ToString())).ToString() + GuardaLog("Ocurrió un error al enviar la informacion por whatsapp" & ex.Message) + End Try + Return Retorno + End Function #End Region From 6203d060e5e187e4ef3cb8670ad90106c8c6155f Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:01:17 -0700 Subject: [PATCH 06/11] =?UTF-8?q?validaci=C3=B3n=20de=20serie=20=C3=BAnica?= =?UTF-8?q?=20E140?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 231b52111..996e1641c 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1352,7 +1352,11 @@ Public Class ClsInventarios OnError(String.Format("El producto '{0}' con la serie: '{1}' ya fue ingresado previamente.", Ex1.Message.GetTagValue("codigops"), Serie), Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End If Else - Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + If Ex1.Message.Contains("50023") Then + Me.OnError(String.Format(" La Serie '{0}' ya se encuentra registrada.", Serie), Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If End If End If Catch ex As Exception From b0a8a4b4e4c017427bf95b0992cf647115a47b18 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:03:05 -0700 Subject: [PATCH 07/11] -- filtros de reportes de contratos por fechaing --- App_Code/ClsContratos.vb | 11 ++++++++-- Transportes/RepContratoDetalle.aspx.vb | 9 -------- Transportes/RepContratos.aspx.vb | 5 +++-- Transportes/RepContratosCalendario.aspx.vb | 25 +++++----------------- 4 files changed, 17 insertions(+), 33 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 22f47b871..7482500e9 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -197,7 +197,12 @@ Public Class ClsContratos #End Region #Region " C O N T R A T O S " - Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveCliente As Integer, Optional CveEstatus As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveTipoContrato As Integer = -1) As Boolean + Public Function GetContratosReporte(CveEmpresa As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveCliente As Integer, + Optional CveEstatus As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, + Optional CveTipoContrato As Integer = -1, + Optional FechaInicioIngreso As DateTime = MinFecha, + Optional FechaFinIngreso As DateTime = MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosReporteGet") @@ -210,7 +215,9 @@ Public Class ClsContratos .Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF .Add("@CveChofer", SqlDbType.Int).Value = CveChofer .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicioIngreso", SqlDbType.DateTime).Value = FechaInicioIngreso + .Add("@FechaFinIngreso", SqlDbType.DateTime).Value = FechaFinIngreso End With Try SqlAdapter.Fill(Data) diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index a697ff570..102bcd838 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -418,10 +418,7 @@ Partial Class RepContratoDetalle ErrorProceso = True End If - - If Not ErrorProceso Then - If CveVentaRemision > 0 AndAlso (CveSubProyectoOriginal <> DdlSubProyecto.SelectedValue.ToEntero OrElse CveMonedaOriginal <> DdlMoneda.SelectedValue.ToEntero OrElse ImporteOrigial <> TxtImporte.Text.ToDecimal OrElse @@ -434,8 +431,6 @@ Partial Class RepContratoDetalle ErrorProceso = True End If End If - - End If If Not ErrorProceso Then @@ -445,15 +440,11 @@ Partial Class RepContratoDetalle AgregarABitacora($"Actualización del contrato {CveContrato}") CargaDatos() Alert("Contrato actualizado correctamente") - Else - Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError) ObjContratos.RollBack() - End If - End Sub Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index dea02f48c..b745538a5 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -24,7 +24,7 @@ Partial Class ListadoContratos If Not IsPostBack Then txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString - txtFechaF.Text = DateTime.Now.AddDays(15).ToShortDateString + txtFechaF.Text = DateTime.Now.AddDays(1).ToShortDateString InicializaCombos() CargaDatos() End If @@ -60,7 +60,8 @@ Partial Class ListadoContratos Private Sub CargaDatos() Dim ObjContratos As New ClsContratos - If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, CveSubProyecto:=DdlCentroCostos.SelectedValue.ToEntero, CveTipoAF:=DdlTipoUnidad.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) Then + If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, CveSubProyecto:=DdlCentroCostos.SelectedValue.ToEntero, CveTipoAF:=DdlTipoUnidad.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, + FechaInicioIngreso:=txtFechaI.Text.ToDate, FechaFinIngreso:=txtFechaF.Text.ToDate) Then GvContratos.DataSource = ObjContratos.DtResultados End If diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index ae548d7bc..f43b37598 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -662,7 +662,6 @@ Partial Class RepContratosCalendario HidCveAF.Value = GvRow.DataKey("CveAF").ToString HidCveAFDes.Value = DdlAF.SelectedItem.Text End If - TxtMotivoCambioUnidad.Text = "" DVMotivoCambioAF.Visible = False @@ -676,8 +675,6 @@ Partial Class RepContratosCalendario LblSaldo.Text = "" End If - - CveContrato = GvRow.DataKey("CveContrato").ToEntero OcultarMostrarSegundoChofer() @@ -694,14 +691,12 @@ Partial Class RepContratosCalendario TxtMotivoCambioUnidad.Text = "" DVMotivoCambioAF.Visible = False - DdlClientes.SelectedText = HidModClienteNombre.Value DdlClientes.SelectedValue = HidModCveCliente.Value DdlClientes.txtText.Value = HidModClienteNombre.Value DdlClientes.txtValue.Value = HidModCveCliente.Value chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False) - OcultarMostrarSegundoChofer() HypRemision.Text = HidRemisionSerieFolio.Value @@ -713,14 +708,15 @@ Partial Class RepContratosCalendario End If CargaAFDdl(HidCveTipoAF.Value.ToEntero) - DdlAF.SelectedValueExist(HidCveAF.Value) + If HidCveAF.Value.ToEntero > 0 AndAlso DdlAF.SelectedValue <> HidCveAF.Value Then + DdlAF.Items.Insert(0, New ListItem(GlobalDTActivoFijos(UsuarioActual.CveEmpresa, CveActivoFijo:=HidCveAF.Value.ToEntero).FiltroPrimeroValor("CodigoDescripcion"), HidCveAF.Value)) + DdlAF.SelectedValueExist(HidCveAF.Value) + End If HidCveAFDes.Value = DdlAF.SelectedItem.Text - UpModal.Update() myModalLabel.InnerText = "Contrato: " & HdnNumContrato.Value - RegistraScript("$('#ModalActualizar').modal('show');") End Sub @@ -784,11 +780,7 @@ Partial Class RepContratosCalendario Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click - Dim SubProyecto As String = "" - - - SubProyecto = DdlSubProyectos.SelectedItem.Text - + Dim SubProyecto As String = DdlSubProyectos.SelectedItem.Text Dim SbFiltros As New StringBuilder() SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|") @@ -837,8 +829,6 @@ Partial Class RepContratosCalendario End Sub - - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) CargaDatos() End Sub @@ -850,11 +840,9 @@ Partial Class RepContratosCalendario End Sub Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs) - CargaDiagramadeGant(DdlTipoVista.SelectedValue.ToEntero) End Sub - Protected Sub DdlAF_SelectedIndexChanged(sender As Object, e As EventArgs) DVMotivoCambioAF.Visible = False @@ -865,11 +853,8 @@ Partial Class RepContratosCalendario UpModal.Update() End Sub - - Protected Sub DdlTipoVistaCalendario_SelectedIndexChanged(sender As Object, e As EventArgs) CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero) End Sub - End Class From 1f01e295289266b102715ecf0f365766c468d30c Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:03:19 -0700 Subject: [PATCH 08/11] pruebas whatsapp2 --- Sistemas/UsuarioDetalle.aspx | 15 +++++++++++++-- Sistemas/UsuarioDetalle.aspx.vb | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Sistemas/UsuarioDetalle.aspx b/Sistemas/UsuarioDetalle.aspx index 97a2511db..56ee93aaa 100644 --- a/Sistemas/UsuarioDetalle.aspx +++ b/Sistemas/UsuarioDetalle.aspx @@ -2650,10 +2650,21 @@ Enviar Mensaje: - + + + + - + + Enviar con Plant.: + + + + + + + diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 47e2e0e46..d5c09fa02 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -5106,4 +5106,7 @@ Partial Class Sistemas_UsuarioDetalle Protected Sub BtnNotifEnviar_Click(sender As Object, e As EventArgs) EnviarNotificacionWhatsApp($"52{TxtTelefono.Text}", TxtNotifMensaje.Text) End Sub + Protected Sub BtnNotifEnviarPlantilla_Click(sender As Object, e As EventArgs) + EnviarNotificacionWhatsApp2($"52{TxtTelefono.Text}", "", TxtNotifPlantilla.Text) + End Sub End Class From ea77c1a34c983c40eb419b8fd4130a6352210f4c Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:03:57 -0700 Subject: [PATCH 09/11] -- filtro de almacenes al editar pedido --- Ventas/Ventas.aspx.vb | 83 ++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 53 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 8cb6dbc4a..1ccbb5c4b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1017,7 +1017,6 @@ Partial Class Ventas Get Return ViewState("CvePSAmortizacion").ToString().ToEntero() End Get - Set(value As Integer) ViewState("CvePSAmortizacion") = value End Set @@ -2337,8 +2336,6 @@ Partial Class Ventas ViewState("ClienteEsDistribuidor") = value End Set End Property - - #End Region Public Property CveAlmacenAsignado As Integer @@ -2353,16 +2350,15 @@ Partial Class Ventas End Set End Property - - Public Property CveAlamcenFiltroDdl As Integer + Public Property CveAlmacenFiltroDdl As Integer Get - If ViewState("CveAlamcenFiltroDdl") Is Nothing Then - ViewState("CveAlamcenFiltroDdl") = -1 + If ViewState("CveAlmacenFiltroDdl") Is Nothing Then + ViewState("CveAlmacenFiltroDdl") = -1 End If - Return ViewState("CveAlamcenFiltroDdl").ToString.ToEntero + Return ViewState("CveAlmacenFiltroDdl").ToString.ToEntero End Get Set(value As Integer) - ViewState("CveAlamcenFiltroDdl") = value + ViewState("CveAlmacenFiltroDdl") = value End Set End Property @@ -5428,7 +5424,6 @@ Partial Class Ventas UPCondicionesPago.Update() End If - 'ESCONDE ACCIONES LnkRemisiones.Visible = False LnkPedido2SinFacturar.Visible = False @@ -5541,7 +5536,6 @@ Partial Class Ventas DdlUsoCFDI.SelectedValueExistInsert(DbRowVenta("CveUsoCFDI").ToString(), UsoCFDI) End If - If UsuarioActual.CveEmpresa = 126 Then CargaOrdenProduccion(2, CveVenta) If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then @@ -5573,7 +5567,6 @@ Partial Class Ventas LiComplementoPago.Visible = True - ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString() SerieVenta = DbRowVenta("Serie").ToString() @@ -5603,7 +5596,6 @@ Partial Class Ventas Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) End If - End If TxtRetISR.Text = DbRowVenta("RetISR").ToString().FormatoNumero(2) TxtIEPS.Text = DbRowVenta("IEPS").ToString().FormatoNumero(2) @@ -5626,7 +5618,6 @@ Partial Class Ventas TxtPedidoContrato.Enabled = False TxtKilometraje.Text = DbRowVenta("Kilometraje").ToString().PadLeft(6, "0"c) - VentaActual = New Venta(UsuarioActual) VentaActual.CveVenta = CveVenta VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate @@ -5657,12 +5648,6 @@ Partial Class Ventas BtnEmitir.Visible = False End If - 'HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString() - 'HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2) - 'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString() - 'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString() = "True" - - If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then TrTipoRelacion2.Visible = True LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString() @@ -5681,7 +5666,6 @@ Partial Class Ventas HLSaldarVenta.Visible = True End If - If (UsuarioActual.TienePermisoProceso(166) Or UsuarioActual.CveRol = 1) AndAlso (LblFolioFiscal.Text = "" Or LblFolioFiscal.Text = "test") Then LkEliminarFactura.Visible = True End If @@ -5853,14 +5837,6 @@ Partial Class Ventas ' BtnGenerarOS.OnClientClick = String.Format("/OS/OrdenesServicios.aspx?CveVenta={0}", CveVenta) End If - - '[IPP] COMENTADO 12/MARZO/2018 -SABRA QUE SE QUERIA ESCONDER - 'If DbRowVenta("TipoDocto").ToString() = "Rem" Then - ' GvPS.Columns(11).Visible = False - ' GvPS.Columns(12).Visible = False - 'End If - - 'Ocultamos los botones Clonar y Ordenar GvPS.Columns(19).Visible = False GvPS.Columns(20).Visible = False @@ -6259,7 +6235,8 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1) - + RBLTipoVenta.Items.Add(New ListItem("-", DbRowVenta("CveTipoVenta").ToString)) + RBLTipoVenta.SelectedValuesIfExist(CveTipoVenta.ToString) TrVentasMedicas3.Visible = True If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 2, 3, 5, 6) Then @@ -8514,9 +8491,9 @@ Partial Class Ventas Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1") End If - If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then - Objeto.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}") - Objeto.ddlWS.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}") + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then + Objeto.Attributes.Add("data-CveAlmacen", $"{CveAlmacenFiltroDdl}") + Objeto.ddlWS.Attributes.Add("data-CveAlmacen", $"{CveAlmacenFiltroDdl}") End If End If @@ -19352,7 +19329,7 @@ Partial Class Ventas Using ObjInv2 As New ClsInventarios If RBLTipoVenta.SelectedValue.ToEntero = 6 Then - Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlamcenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1, + Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlmacenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1, CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) Else @@ -23537,6 +23514,8 @@ Partial Class Ventas TxtPaciente.Enabled = True TxtEpisodio.Enabled = True TxtFolioRemision.Enabled = True + 'carga los almacenes para la existencias + AsignaAlmacenWS() End If @@ -38822,18 +38801,18 @@ Partial Class Ventas DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") End If ElseIf RBLTipoVenta.SelectedValue.Contiene("3") Then ' A vista - DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) - DdlTipoComprobante.SelectedValueExist("Ped") - TrVentasMedicas1.Visible = False - TrVentasMedicas2.Visible = False - ChkRequiereTecnico.Enabled = True - ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' consignacion - DdlTipoComprobante.SelectedValueExist("Ing") - TrVentasMedicas1.Visible = False - TrVentasMedicas2.Visible = False - ChkRequiereTecnico.Enabled = True - Else - DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) + DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) + DdlTipoComprobante.SelectedValueExist("Ped") + TrVentasMedicas1.Visible = False + TrVentasMedicas2.Visible = False + ChkRequiereTecnico.Enabled = True + ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' consignacion + DdlTipoComprobante.SelectedValueExist("Ing") + TrVentasMedicas1.Visible = False + TrVentasMedicas2.Visible = False + ChkRequiereTecnico.Enabled = True + Else + DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) DdlTipoComprobante.SelectedValueExist("Ped") TrVentasMedicas1.Visible = True TrVentasMedicas2.Visible = True @@ -39069,12 +39048,11 @@ Partial Class Ventas Private Sub AsignaAlmacenWS() - CveAlamcenFiltroDdl = -1 + CveAlmacenFiltroDdl = -1 Dim tCveAlmacenExistencia As Integer = -1 If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = GlobalDTClientesSucursales(UsuarioActual.CveEmpresa, CveCliente).FiltroPrimero($"CveClienteSucursal={DdlSucursalCliente.SelectedValue}") If drr IsNot Nothing Then @@ -39098,13 +39076,12 @@ Partial Class Ventas End If End If End If - CveAlamcenFiltroDdl = tCveAlmacenExistencia - If Not CveAlamcenFiltroDdl > 0 Then - CveAlamcenFiltroDdl = If(CveAlmacenAsignado > 0, CveAlmacenAsignado, -1) + CveAlmacenFiltroDdl = tCveAlmacenExistencia + If Not CveAlmacenFiltroDdl > 0 Then + CveAlmacenFiltroDdl = If(CveAlmacenAsignado > 0, CveAlmacenAsignado, -1) End If DdlPS.ddlWS.Attributes.Remove("data-CveAlmacen") - DdlPS.ddlWS.Attributes.Add("data-CveAlmacen", CveAlamcenFiltroDdl.ToString) - + DdlPS.ddlWS.Attributes.Add("data-CveAlmacen", CveAlmacenFiltroDdl.ToString) End If End Sub From f26b29859f0f2f1e68e7c4388b071f88a9ac337a Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:04:18 -0700 Subject: [PATCH 10/11] - gastos --- Ventas/CatMedicos.aspx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Ventas/CatMedicos.aspx b/Ventas/CatMedicos.aspx index ff33feadd..7a4d80479 100644 --- a/Ventas/CatMedicos.aspx +++ b/Ventas/CatMedicos.aspx @@ -148,25 +148,28 @@
-
+
- - - + - + + + + + + From 230fcd0023279d831ad94eb8a4d0bfbb1ed12ba2 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 22 Oct 2024 16:04:49 -0700 Subject: [PATCH 11/11] -- nombre de descarga de arcivo --- OC/RepOC.aspx.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OC/RepOC.aspx.vb b/OC/RepOC.aspx.vb index 26e7ebe69..32a7e9d63 100644 --- a/OC/RepOC.aspx.vb +++ b/OC/RepOC.aspx.vb @@ -550,12 +550,13 @@ Partial Class RepOC params.Add(New ReportParameter("Titulo", "REPORTE DE ORDENES DE COMPRA POR ATENDER")) params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) + Dim NombreArchivoDescargar As String = $"RepOCPorAtender{If(DdlProyectos.SelectedValue <> "-1", "_" & DdlProyectos.SelectedItem.Text, "")}_{DateTime.Now.ToShortDateString}" If Archivo.Exists Then - ImprimirPDF($"{UsuarioActual.Empresa.Ruta}Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, "RepOCPorAtender", Formato) + ImprimirPDF($"{UsuarioActual.Empresa.Ruta}Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, NombreArchivoDescargar, Formato) 'ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepOCPorAtender.rpt", DtPorAtender, params, "RepOCPorAtender", Formato), "RepOCPorAtender", Formato) Else - ImprimirPDF("Empresas/Grales/Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, "RepOCPorAtender", Formato) + ImprimirPDF("Empresas/Grales/Formatos/RepOCPorAtender.rdlc", DtPorAtender, params, NombreArchivoDescargar, Formato) 'ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepOCPorAtender.rpt"), DtPorAtender, params, "RepOCPorAtender", Formato), "RepOCPorAtender", Formato) End If