From e0e946c761f6c54b40e5e8184e880685e4112ac6 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 8 Jan 2024 19:33:06 -0700 Subject: [PATCH 01/33] - cambio globaldt --- General/SaldosIniciales.aspx.vb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 2931f0efd..95f405963 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -682,13 +682,9 @@ Partial Class General_SaldosIniciales DtMarcas = ObjPS.DtResultados.Copy End If - If ObjGral.GetMedidas(UsuarioActual.CveEmpresa) Then - DtMedidas = ObjGral.DtResultados.Copy - End If + DtMedidas = GlobalDTPSMedidas(UsuarioActual.CveEmpresa) + DtRinTamaño = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa) - If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then - DtRinTamaño = ObjGral.DtResultados.Copy - End If If ObjGral.GetModelos(UsuarioActual.CveEmpresa) Then DtModelos = ObjGral.DtResultados.Copy @@ -782,7 +778,7 @@ Partial Class General_SaldosIniciales CveRinTamaño = DtRinTamaño.FiltroPrimeroValor("CveRinTamaño", $"RinTamaño = '{RinTamaño}'").ToString().ToEntero() If Not CveRinTamaño > 0 Then If ObjGral.AddRimTamanios(CveClasificacion, "", RinTamaño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then + If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then DtRinTamaño = ObjGral.DtResultados.Copy CveRinTamaño = DtRinTamaño.FiltroPrimeroValor("CveRinTamaño", $"RinTamaño = '{RinTamaño}'").ToString().ToEntero() End If From e2e2a3df04c2fa150bbda55f145fb93965b26e0b Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 10:44:11 -0700 Subject: [PATCH 02/33] -- faltabn dispose --- Transportes/Boletos.aspx.vb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index 68f508010..9f3d7435d 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -85,7 +85,7 @@ Partial Class Boletos Protected Sub InicializaCombos() 'Lista Destinos''carga específicos - Dim ObjDestinos As New ClsDestinos() + Dim ObjDestinos As New ClsTransportes() If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then If ObjDestinos.DtResultados.Rows.Count > 0 Then @@ -99,6 +99,7 @@ Partial Class Boletos DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "")) End If End If + ObjDestinos.Dispose() End Sub Protected Sub CotizarTarifa(sender As Object, e As EventArgs) @@ -107,6 +108,8 @@ Partial Class Boletos Dim ObjDestinos As New ClsTransportes() Dim retorno As Boolean = ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal + ObjDestinos.Dispose() + If retorno Then If ImporteR > 0 Then Dim redondeado As String = CStr(Math.Round(ImporteR, 2)) From 6eddb646c44820b398b273b3cc6e95085da858e6 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 10:44:31 -0700 Subject: [PATCH 03/33] - --- App_Code/ClsTransportes.vb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index b6cabeeb0..6705d9007 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -316,6 +316,24 @@ Public Class ClsTransportes End Function #End Region + Public Function GetDestinos(Optional CveRuta As Integer = 0) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Trans_DestinosGet") + If CveRuta <> 0 Then + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRuta", SqlDbType.Int).Value = CveRuta + End With + End If + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #Region "Tarifas" Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean From a30a3776010373258f7d34f2c35885a3fb79ec99 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 10:46:40 -0700 Subject: [PATCH 04/33] -- mejoras --- Transportes/Boletos.aspx.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index 9f3d7435d..cb4840b0e 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -86,6 +86,7 @@ Partial Class Boletos Protected Sub InicializaCombos() 'Lista Destinos''carga específicos Dim ObjDestinos As New ClsTransportes() + If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then If ObjDestinos.DtResultados.Rows.Count > 0 Then @@ -159,6 +160,7 @@ Partial Class Boletos ObjTransporte.Commit() End If Catch ex As Exception + ObjTransporte.RollBack() Alert($"No se pudo generar el boleto {ex}", TipoMensaje.MsgError) Finally ObjTransporte.Dispose() From da13fdd1817dc79ca3e0312be3127f90ba388c0e Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 9 Jan 2024 11:25:04 -0700 Subject: [PATCH 05/33] SMS Correcion Ventas FechaCirugia dd/MM/yyyy HH:mm --- App_Code/ClsPaginas.vb | 4 ++-- Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb | 11 +++++++---- Ventas/Ventas.aspx.vb | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 4574ac667..eacc08132 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5924,7 +5924,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion)) params.Add(New ReportParameter("Medico", Vta.Medico)) params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento)) - params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy hh:mm"))) + params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm"))) End If RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) @@ -6032,7 +6032,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion)) params.Add(New ReportParameter("Medico", Vta.Medico)) params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento)) - params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy hh:mm"))) + params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm"))) End If RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb index d840f90b0..3b5505acb 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb @@ -2130,6 +2130,12 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal If GvIngresosSubProyectoH.Columns(IndexGv).GetType.Name = "BoundField" Then + If dColumn.ColumnName = "SinSubProyecto" Then + 'TxtSub = "Sin SubProyecto" + 'Continue For + Exit For + End If + CType(GvIngresosSubProyectoH.Columns(IndexGv), BoundField).DataField = dColumn.ColumnName GvIngresosSubProyectoH.Columns(IndexGv).Visible = True @@ -2143,10 +2149,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Dim TxtSub As String = GlobalDTSubProyectos(-1, CveSubProyecto:=dColumn.ColumnName.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto") - If dColumn.ColumnName = "SinSubProyecto" Then - TxtSub = "Sin SubProyecto" - Continue For - End If + CType(GvIngresosSubProyectoH.Columns(IndexGv), BoundField).HeaderText = TxtSub diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 985f84d0e..fa5c496ef 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5322,7 +5322,7 @@ Partial Class Ventas End If If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso DbRowVenta("CveProcedimiento").ToString.ToEntero > 0 Then - TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy hh:mm") + TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy HH:mm") DVMEEFechaEje.Visible = False Else TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy") From 0aeb1d0035db4dae66304236e3f32c458243027e Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 9 Jan 2024 12:03:44 -0700 Subject: [PATCH 06/33] Ventas Editar DescripcionVenta --- App_Code/ClsVentas.vb | 5 ++++- Ventas/Ventas.aspx | 2 +- Ventas/Ventas.aspx.vb | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 08e1b50ed..eca64b3d1 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -604,7 +604,7 @@ Public Class ClsVentas End Function Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String, - Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer) As Boolean + Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasObservacionesUpdate") With SqlAdapter.SelectCommand.Parameters @@ -619,6 +619,9 @@ Public Class ClsVentas .Add("@Pedido", SqlDbType.NVarChar).Value = Pedido .Add("@OrdenCompra", SqlDbType.NVarChar).Value = OrdenCompra .Add("@FechaPago", SqlDbType.Date).Value = FechaPago + .Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta + + End With Try SqlAdapter.Fill(Data) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 256ff61ab..be622b490 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -4205,7 +4205,7 @@ - +
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index fa5c496ef..6ad972f7e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -33655,6 +33655,9 @@ Partial Class Ventas UpPS.Update() End If + TxtDescripcionVenta.Enabled = True + + UpCliente.Update() UpParametros.Update() UPObservaciones.Update() UpFacturar.Update() @@ -33673,7 +33676,7 @@ Partial Class Ventas ObjVentas.IniciaTransacSQL() If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, - TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero) Then + TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim) Then TieneError = True End If From 1ec186d12ab2273da05043014efb9ac8a10a1777 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 18:57:32 -0700 Subject: [PATCH 07/33] =?UTF-8?q?-=20activar=20emisi=C3=B3n=20de=20un=20su?= =?UTF-8?q?bproyecto=20USA=20para=20VyA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 4574ac667..b99bd4334 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5868,6 +5868,12 @@ Public Class ClsPaginas NombreArchivo = "Factura" NombreArchivoDescarga = "Factura" TipoDocumento = "INGRESO" + + If Vta.CveSubProyecto.Contiene(12696, 12698) Then + NombreArchivo = "FacturaUSA" + NombreArchivoDescarga = "FacturaUSA" + End If + If UsuarioActual.CveEmpresa.Contiene(137) Then params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString)) End If @@ -5915,6 +5921,10 @@ Public Class ClsPaginas NombreArchivo = "Remision" NombreArchivoDescarga = "Remisión" TipoDocumento = "REMISION" + If Vta.CveSubProyecto.Contiene(12696, 12698) Then + NombreArchivo = "FacturaUSA" + NombreArchivoDescarga = "FacturaUSA" + End If params.Add(New ReportParameter("TipoDocumento", NombreArchivoDescarga)) params.Add(New ReportParameter("Tipo", TipoDocumento)) params.Add(New ReportParameter("Ref", TipoDocumentoRef)) @@ -6346,7 +6356,7 @@ Public Class ClsPaginas Dim paramsArray As New JArray() For Each rds As ReportDataSource In DataSource Dim Nombre As String = rds.Name - If RutaReporte.Contains("Factura.mrt") OrElse RutaReporte.Contains("Remision.mrt") OrElse RutaReporte.Contains("Cotizacion.mrt") OrElse RutaReporte.Contains("NotaDevolucion.mrt") OrElse RutaReporte.Contains("Pedido.mrt") Then + If RutaReporte.Contains("Factura") OrElse RutaReporte.Contains("Remision") OrElse RutaReporte.Contains("Cotizacion") OrElse RutaReporte.Contains("NotaDevolucion") OrElse RutaReporte.Contains("Pedido") Then Select Case rds.Name Case "DsOC" Nombre = "DtDetalle" From 68daf702d443718c4e37aaf213c92b568a2ea96d Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 9 Jan 2024 19:16:16 -0700 Subject: [PATCH 08/33] SMS - 2024.01.08 Ventas actualizar CveMedico CveProcedimientio remision pedido, correiones EntregaAlamcen y OS --- App_Code/ClsVentas.vb | 8 ++- Inventarios/EntregaAlmacen.aspx.vb | 83 ++++++++++++++++++++++++------ OS/OrdenesServicios.aspx.vb | 2 +- Ventas/Ventas.aspx.vb | 13 ++++- 4 files changed, 86 insertions(+), 20 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index eca64b3d1..1a8ab4888 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -555,7 +555,7 @@ Public Class ClsVentas Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1, Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1, - Optional RequiereOS As Boolean = False) As Boolean + Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUpdate") @@ -591,6 +591,8 @@ Public Class ClsVentas .Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@RequiereOS", SqlDbType.Int).Value = RequiereOS + .Add("@CveMedico", SqlDbType.Int).Value = CveMedico + .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento End With Try @@ -604,7 +606,7 @@ Public Class ClsVentas End Function Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String, - Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1") As Boolean + Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasObservacionesUpdate") With SqlAdapter.SelectCommand.Parameters @@ -620,6 +622,8 @@ Public Class ClsVentas .Add("@OrdenCompra", SqlDbType.NVarChar).Value = OrdenCompra .Add("@FechaPago", SqlDbType.Date).Value = FechaPago .Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta + .Add("@CveMedico", SqlDbType.Int).Value = CveMedico + .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento End With diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index dc0b50a52..d6d20549f 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -5,7 +5,7 @@ Imports System.Data Imports System.Data.SqlClient Imports System.IO Imports Extensiones - +Imports Microsoft.Owin.Security.Provider Imports Microsoft.Reporting.WebForms Partial Class Inventarios_EntregaAlmacen @@ -4269,27 +4269,36 @@ Partial Class Inventarios_EntregaAlmacen Respuesta = ObjOS.UpdateOrdenesServiciosEstatus(CveOSEstatusFinalizada, UsuarioActual.CveUsuario, CveOSCerrar) + Dim cancelarPeido As Boolean = CancelarPedido(TransaccionSql, CveMovimientoGenerado, Respuesta) + If Respuesta Then - - Dim ObjInventario As New ClsInventarios(ObjOS.IniciaTransacSQL) - + Dim ObjInventario As New ClsInventarios(TransaccionSql) If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then + If Not cancelarPeido Then + For Each Dr As DataRow In ObjInventario.DtResultados.Rows - For Each Dr As DataRow In ObjInventario.DtResultados.Rows + Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero() + Dim Cantidad As Decimal = Dr("Cantidad").ToString().ToDecimal - Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero() - Dim Cantidad As Decimal = Dr("Cantidad").ToString().ToDecimal - - If CveVentaDetalle > 0 Then - If Not ObjInventario.UpdatePedidoDetalleCantidad(CveVentaDetalle, Cantidad) Then + If CveVentaDetalle > 0 Then + If Not ObjInventario.UpdatePedidoDetalleCantidad(CveVentaDetalle, Cantidad) Then + Respuesta = False + Exit For + End If + Else Respuesta = False - Exit For End If - Else - Respuesta = False - End If - Next + Next + End If + + End If + End If + + If Respuesta AndAlso cancelarPeido Then + Dim objVentas As New ClsVentas(TransaccionSql) + If Not objVentas.UpdateEstatusVenta(CveVentaSurtir, 4, UsuarioActual.CveEmpresa) Then + Respuesta = False End If End If @@ -4302,4 +4311,48 @@ Partial Class Inventarios_EntregaAlmacen End Function + Private Function CancelarPedido(ByRef TransaccionSql As SqlTransaction, CveMovimientoGenerado As Integer, ByRef RespuestaPadre As Boolean) As Boolean + + Dim Cancelar As Boolean = True + + Dim objVentas As New ClsVentas(TransaccionSql) + Dim ObjInventario As New ClsInventarios(TransaccionSql) + + Dim DTMovimiento As New DataTable + Dim DTPedidoDetalle As New DataTable + + If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then + DTMovimiento = ObjInventario.DtResultados + Else + RespuestaPadre = False + End If + + If objVentas.GetVentaDetalle(CveVentaSurtir) Then + DTPedidoDetalle = objVentas.DtResultados + Else + RespuestaPadre = False + End If + + + If RespuestaPadre Then + + For Each rowPedido As DataRow In DTPedidoDetalle.Rows + Dim CantidadPedido As Decimal = rowPedido("Cantidad").ToString.ToDecimal + Dim CveVentaDetalle As Integer = rowPedido("CveVentaDetalle").ToString.ToEntero + + Dim CantidadDevuelto As Decimal = DTMovimiento.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {CveVentaDetalle}").ToDecimal + + If CantidadPedido <> CantidadDevuelto Then + Cancelar = False + Exit For + End If + + Next + + End If + + Return Cancelar + + End Function + End Class diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 07c8b886f..36b7a9574 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -3072,7 +3072,7 @@ Partial Class OS_OrdenesServicios Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal If CantidadRegistro > 0 Then - Dim CveVentaDetalle As Integer = DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero + Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero ' DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero Dim Serie As String = GvRow.DataKey("Serie") diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 6ad972f7e..97adc1105 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2738,7 +2738,12 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then BtnCrearApartirDe.Visible = False If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True - If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then BtnPermisoEditarRemision.Visible = True + If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ped") Then BtnPermisoEditarRemision.Visible = True + + If DdlTipoComprobante.SelectedValue = "Ped" Then + BtnPermisoEditarRemision.Text = "Editar Pedido" + BtnEditarRemision.Text = "Actualizar Pedido" + End If DivFechaAnticipoCliente.Visible = True TxtFechaAnticipoCliente.Text = NowADS().ToShortDateString @@ -21686,6 +21691,9 @@ Partial Class Ventas ViewState("CveClienteAnterior") = CveCliente + DdlMedicoObservaciones.Enabled = True + DdlProcedimientoObservaciones.Enabled = True + Dim CantidadFacturadaRemision As Decimal = 0 'EN BDH NO DEBE PERMITIR EDITAR EL PU @@ -21748,6 +21756,7 @@ Partial Class Ventas UpPS.Update() UpCliente.Update() UPObservaciones.Update() + End Sub Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click Dim OcurrioError As Boolean = False @@ -21842,7 +21851,7 @@ Partial Class Ventas PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), - CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible) Then + CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then OcurrioError = True End If From 67b22d2f2b3d3a0d029554a8e8db3723a9e050fb Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 20:33:52 -0700 Subject: [PATCH 09/33] option explicit --- Ashx/E141.ashx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index 72879ad20..cea15c20e 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -98,8 +98,8 @@ Public Class E141 : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim retorno As String = "" Try - Dim Params = If(context.Request("P") = Nothing, "", context.Request("P").ToString()) - Dim ParamsV = If(context.Request("PV") = Nothing, "", context.Request("PV").ToString()) + Dim Params As String = If(context.Request("P") = Nothing, "", context.Request("P").ToString()) + Dim ParamsV As String = If(context.Request("PV") = Nothing, "", context.Request("PV").ToString()) Dim ParametrosNuevos As Boolean = False If Not String.IsNullOrEmpty(ParamsV) Then @@ -135,16 +135,16 @@ Public Class E141 : Implements IHttpHandler Else - Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString()) + Dim Metodo As String = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString()) 'OBTENER EXISTENCIAS If Metodo = "GetExistencia" Then context.Response.ContentType = "application/json" - Dim Codigo = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString()) + Dim Codigo As String = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString()) retorno = GetExistencia(context, Codigo) ElseIf Metodo = "ConsultarRFC" Then context.Response.ContentType = "application/json" - Dim Auth = ValidarSolicitud(context) + Dim Auth As AuthMessage = ValidarSolicitud(context) If Auth.IsSucces Then retorno = ConsultaRFC(context) @@ -155,7 +155,7 @@ Public Class E141 : Implements IHttpHandler ElseIf Metodo = "ValidarCarrito" Then context.Response.ContentType = "application/json" - Dim Auth = ValidarSolicitud(context) + Dim Auth As AuthMessage = ValidarSolicitud(context) If Auth.IsSucces Then retorno = ValidarCarrito(context) @@ -166,7 +166,7 @@ Public Class E141 : Implements IHttpHandler ElseIf Metodo = "RegistrarPedido" Then context.Response.ContentType = "application/json" - Dim Auth = ValidarSolicitud(context) + Dim Auth As AuthMessage = ValidarSolicitud(context) If Auth.IsSucces Then retorno = RegistrarPedido(context) From 3ae43d4c804d8907e24420f69bd0ee4f8e5aedfd Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 20:34:05 -0700 Subject: [PATCH 10/33] - mejora en registro de venta ecommerce --- Ashx/E119.ashx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx index 0be1294cf..36d4258df 100644 --- a/Ashx/E119.ashx +++ b/Ashx/E119.ashx @@ -384,8 +384,13 @@ Public Class E119 : Implements IHttpHandler CveMoneda = 1 Descuento = 0 MsgLog.AppendLine("1.3 billing") - Dim RFC As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString()) - Dim NombreCliente As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString() & " " & JsonRequest("billing")("last_name").ToString()) + Dim RFC As String = "" + Dim NombreCliente As String = "" + If JsonRequest("billing") IsNot Nothing Then + RFC = JsonRequest("billing").First("first_name").ToString() + NombreCliente = JsonRequest("billing").First("first_name").ToString() & " " & JsonRequest("billing").First("last_name").ToString() + End If + 'BUSCAR SI ESTÁ REGISTRADO EL CLIENTE If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then If ObjClientes.DtResultados.Rows.Count > 0 Then @@ -401,16 +406,16 @@ Public Class E119 : Implements IHttpHandler MsgLog.AppendLine("1.5 crear cliente") If JsonRequest("billing") IsNot Nothing Then Dim CveEstado As Integer = -1 - Dim Direccion As String = If(JsonRequest("billing")("address_1") Is Nothing, "", JsonRequest("billing")("address_1").ToString()) + Dim Direccion As String = If(JsonRequest("billing").First("address_1") Is Nothing, "", JsonRequest("billing").First("address_1").ToString()) Dim NumExt As String = "" Dim NumInt As String = "" Dim Colonia As String = "" - Dim Ciudad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString()) - Dim Localidad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString()) - Dim CP As String = If(JsonRequest("billing")("postcode") Is Nothing, "", JsonRequest("billing")("postcode").ToString()) - Dim Telefono As String = If(JsonRequest("billing")("phone") Is Nothing, "", JsonRequest("billing")("phone").ToString()) - Dim Correo As String = If(JsonRequest("billing")("email") Is Nothing, "", JsonRequest("billing")("email").ToString()) - Dim Estado As String = If(JsonRequest("billing")("state") Is Nothing, "", JsonRequest("billing")("state").ToString()) + Dim Ciudad As String = If(JsonRequest("billing").First("city") Is Nothing, "", JsonRequest("billing").First("city").ToString()) + Dim Localidad As String = If(JsonRequest("billing").First("city") Is Nothing, "", JsonRequest("billing").First("city").ToString()) + Dim CP As String = If(JsonRequest("billing").First("postcode") Is Nothing, "", JsonRequest("billing").First("postcode").ToString()) + Dim Telefono As String = If(JsonRequest("billing").First("phone") Is Nothing, "", JsonRequest("billing").First("phone").ToString()) + Dim Correo As String = If(JsonRequest("billing").First("email") Is Nothing, "", JsonRequest("billing").First("email").ToString()) + Dim Estado As String = If(JsonRequest("billing").First("state") Is Nothing, "", JsonRequest("billing").First("state").ToString()) If Not String.IsNullOrEmpty(Estado) Then CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero() If CveEstado <= 0 Then 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA From d5db746f6093a2ea8196f071720ab7efa6c1d7dd Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 20:34:12 -0700 Subject: [PATCH 11/33] -visual --- Sistemas/UsuarioDetalle.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sistemas/UsuarioDetalle.aspx b/Sistemas/UsuarioDetalle.aspx index 37ac85984..06a85cab7 100644 --- a/Sistemas/UsuarioDetalle.aspx +++ b/Sistemas/UsuarioDetalle.aspx @@ -109,7 +109,7 @@ Usuario: - +   From ebcd6c0e78cff71befb7259c926c5441ab0ca80e Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 9 Jan 2024 20:36:01 -0700 Subject: [PATCH 12/33] -- Empresa SMS, no visualizar columna subproyecto en dtalle --- Ventas/Ventas.aspx.vb | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 6ad972f7e..10a8649fd 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3387,19 +3387,27 @@ Partial Class Ventas End If End If - - If CveVenta <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then - EsVentaMedica = True - CargaTiposVenta() - - If CveCliente > 0 Then - SeleccionarClienteSucursal(CveCliente:=CveCliente) + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + If CveVenta <= 0 Then + EsVentaMedica = True + CargaTiposVenta() + If CveCliente > 0 Then + SeleccionarClienteSucursal(CveCliente:=CveCliente) + End If + End If + If CveVenta >= 0 Then + HLFAgregarOS.Visible = True + HLFAgregarOS.NavigateUrl = $"/OS/OrdenesServicios.aspx?CveVenta={CveVenta}" End If - End If - If CveVenta >= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then - HLFAgregarOS.Visible = True - HLFAgregarOS.NavigateUrl = $"/OS/OrdenesServicios.aspx?CveVenta={CveVenta}" + TxtPrecio.Enabled = False + 'ocultar la columna de subproyecto + GvPS.Columns(ColumnaSubProyecto).Visible = False + ThProyecto.Visible = False + ThProyecto2.Visible = False + + TxtCantidad.Text = "1" + TxtCantidad.Focus() End If If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then @@ -3418,10 +3426,6 @@ Partial Class Ventas RegistraScript("$('#TxtCantidad').focus();", "A1") End If - If EsVentaMedica Then - TxtPrecio.Enabled = False - End If - End If End Sub From 1c0ed51f534519151e3ef9bebadb6eacaafd2e8f Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Wed, 10 Jan 2024 00:07:37 -0700 Subject: [PATCH 13/33] ventas manifiesto --- App_Code/ClsVentas.vb | 19 +++++++++++++++++++ Ventas/Ventas.aspx.vb | 9 +++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 08e1b50ed..793ee709c 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -217,6 +217,25 @@ Public Class ClsVentas End Try Return retorno End Function + Public Function CGame_ManifiestoUpvta(cveVenta As Int32, cveUsuario As Int32, cveEmpresa As Int32, CveManifiesto As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_CGame_ManifiestoUpvta", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = cveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@CveManifiesto", SqlDbType.Int).Value = CveManifiesto + .Add("@CveUsuario", SqlDbType.Int).Value = cveUsuario + End With + + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar venta manifiesto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function GetVentaTerminal(CveVentaTerminal As Integer, Fecha As DateTime, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasGetTerminal") diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 5a7f08614..06355686c 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2678,8 +2678,7 @@ Partial Class Ventas Using ObjVentas As New ClsCGame() If ObjVentas.ManifiestoGet(Request("CveManifiesto").ToEntero(), -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, "-1", "-1") Then - 'DdlSubProyectoDatos.SelectedValueExist(ObjVentas.DtResultados.Rows(0)("CveSubProyecto").ToString()) - DdlSubProyectoDatos.SelectedValueExist("12629") + DdlSubProyectoDatos.SelectedValueExist(ObjVentas.DtResultados.Rows(0)("CveSubProyecto").ToString()) End If If ObjVentas.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveManifiesto").ToEntero()) Then @@ -10106,6 +10105,12 @@ Partial Class Ventas If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveEmbarqueManifiesto").ToEntero()) Then + End If + End If + If Request("CveManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveManifiesto")) AndAlso Request("CveManifiesto").ToEntero() > 0 Then + + If ObjVentas.CGame_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveManifiesto").ToEntero()) Then + End If End If Catch ex As Exception From 3b99b6ec6154353601bb63a17542b7cff885dc43 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 10 Jan 2024 06:35:07 -0700 Subject: [PATCH 14/33] =?UTF-8?q?--=20actualizaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsVentas.vb | 30 ++++++++++++++---------------- Ventas/Ventas.aspx | 10 ++++------ Ventas/Ventas.aspx.vb | 23 +++++++++++------------ 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 1a8ab4888..5fc629f5c 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -549,35 +549,33 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateVentas(SubTotal As Double, Descuento As Double, IVA As Double, IEPS As Double, Total As Double, CveMoneda As Integer, TipoCambio As Double, - Fecha As Date, Observaciones As String, CveEmpresa As Integer, CveVenta As Integer, CveMetodoPago As Integer, FormaPago As Integer, + Public Function UpdateVentas(SubTotal As Decimal, Descuento As Decimal, IVA As Decimal, IEPS As Decimal, Total As Decimal, CveMoneda As Integer, TipoCambio As Decimal, + Fecha As Date, Observaciones As String, CveEmpresa As Integer, CveVenta As Integer, Optional TipoDocto As String = "Cot", Optional Vigencia As Date = MinFecha, Optional CondicionesPago As Integer = -1, - Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, - Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1, - Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1, + Optional AtencionA As String = "", Optional PedidoContrato As String = "", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, + Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1, + Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1, Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUpdate") With SqlAdapter.SelectCommand.Parameters - .Add("@SubTotal", SqlDbType.Float).Value = SubTotal - .Add("@Descuento", SqlDbType.Float).Value = Descuento - .Add("@IVA", SqlDbType.Float).Value = IVA - .Add("@IEPS", SqlDbType.Float).Value = IEPS - .Add("@Total", SqlDbType.Float).Value = Total + .Add("@SubTotal", SqlDbType.Money).Value = SubTotal + .Add("@Descuento", SqlDbType.Money).Value = Descuento + .Add("@IVA", SqlDbType.Money).Value = IVA + .Add("@IEPS", SqlDbType.Money).Value = IEPS + .Add("@Total", SqlDbType.Money).Value = Total .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda - .Add("@TipoCambio", SqlDbType.Float).Value = TipoCambio - .Add("@RetIVA", SqlDbType.Float).Value = RetIVA - .Add("@RetISR", SqlDbType.Float).Value = RetISR + .Add("@TipoCambio", SqlDbType.Money).Value = TipoCambio + .Add("@RetIVA", SqlDbType.Money).Value = RetIVA + .Add("@RetISR", SqlDbType.Money).Value = RetISR .Add("@Fecha", SqlDbType.Date).Value = Fecha .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago .Add("@CondicionesPago", SqlDbType.Int).Value = CondicionesPago - .Add("@FormaPago", SqlDbType.Int).Value = FormaPago .Add("@AtencionA", SqlDbType.VarChar).Value = AtencionA .Add("@Vigencia", SqlDbType.Date).Value = Vigencia .Add("@PedidoContrato", SqlDbType.VarChar).Value = PedidoContrato @@ -586,7 +584,7 @@ Public Class ClsVentas .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal .Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra - .Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje + .Add("@Kilometraje", SqlDbType.Money).Value = Kilometraje .Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi .Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index be622b490..81e288727 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -446,16 +446,14 @@ :
-
- +
+ -
-
- -
+
+ diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index b9c4ee556..4205a02d6 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3392,7 +3392,7 @@ Partial Class Ventas End If End If - If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If CveVenta <= 0 Then EsVentaMedica = True CargaTiposVenta() @@ -21680,6 +21680,7 @@ Partial Class Ventas BtnEditarRemision.Visible = True BtnPermisoEditarRemision.Visible = False BtnCrearApartirDe.Visible = False + DdlSucursalCliente.Enabled = True TxtObsFact.Enabled = True TxtOrdenCompra.Enabled = True TxtPedidoContrato.Enabled = True @@ -21690,7 +21691,6 @@ Partial Class Ventas UPCondicionesPago.Update() If Me.PermiteCredito Then RBLPago.Enabled = True DdlVendedor.Enabled = True - ModalidadEdicion = True ViewState("CveClienteAnterior") = CveCliente @@ -21745,7 +21745,6 @@ Partial Class Ventas TxtPrecio.Enabled = True End If - LbAgregar.Enabled = True ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") LblSubTotal1.Text = TxtSubTotal.Text @@ -21772,8 +21771,9 @@ Partial Class Ventas Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble + Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal EditoRemision = True + CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero Try 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then @@ -21850,11 +21850,11 @@ Partial Class Ventas 'Actualizo los parametros de la venta If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, 0, 0, + UsuarioActual.CveEmpresa, CveVenta, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), - CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, - OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), + CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, + OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then OcurrioError = True End If @@ -30290,7 +30290,7 @@ Partial Class Ventas End If Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Double = TxtTipoCambio.Text.Trim.ToDecimal + Dim TipoCambio As Decimal = TxtTipoCambio.Text.Trim.ToDecimal If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then TipoCambio = 1 Moneda = 1 @@ -30377,15 +30377,14 @@ Partial Class Ventas Moneda = 1 End If - 'ACTUALIZA VENTA - If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDouble(), LblDescuentos.Text.ToDouble(), TxtIVA.Text.ToDouble(), TxtIEPS.Text.ToDouble(), TxtTotal.Text.ToDouble(), + If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal(), TxtIVA.Text.ToDecimal(), TxtIEPS.Text.ToDecimal(), TxtTotal.Text.ToDecimal(), Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, 0, 0, + UsuarioActual.CveEmpresa, CveVenta, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, - TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then + TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then MensajeError = "Ocurrió un error al actualizar la información de la cotización" OcurrioError = True End If From ecb7ef15d4a494bed90824f17733d84b273cf116 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 10 Jan 2024 06:35:24 -0700 Subject: [PATCH 15/33] =?UTF-8?q?-=20unificaci=C3=B3n=20de=20cls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsRutas.vb | 20 -------------------- App_Code/ClsTransportes.vb | 28 ++++++++++++++++++++++++++++ Transportes/ListadoViajes.aspx.vb | 14 ++++++-------- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/App_Code/ClsRutas.vb b/App_Code/ClsRutas.vb index 82f301ee0..bde0252dc 100644 --- a/App_Code/ClsRutas.vb +++ b/App_Code/ClsRutas.vb @@ -129,26 +129,6 @@ Public Class ClsRutas GC.SuppressFinalize(Me) End Sub #End Region - Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Trans_RutasGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRuta", SqlDbType.Int).Value = CveRuta - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Ruta", SqlDbType.VarChar).Value = Ruta - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function End Class diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index 6705d9007..0e1efccc8 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -316,6 +316,8 @@ Public Class ClsTransportes End Function #End Region + +#Region "Destinos" Public Function GetDestinos(Optional CveRuta As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Trans_DestinosGet") @@ -335,6 +337,32 @@ Public Class ClsTransportes Return Retorno End Function +#End Region + +#Region "Rutas" + Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Trans_RutasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRuta", SqlDbType.Int).Value = CveRuta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Ruta", SqlDbType.VarChar).Value = Ruta + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + #Region "Tarifas" Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/Transportes/ListadoViajes.aspx.vb b/Transportes/ListadoViajes.aspx.vb index 9a0ca63a4..755540f3a 100644 --- a/Transportes/ListadoViajes.aspx.vb +++ b/Transportes/ListadoViajes.aspx.vb @@ -46,7 +46,7 @@ Partial Class ListadoViajes ObjAF.Dispose() 'Lista Rutas' - Dim ObjRutas As New ClsRutas() + Dim ObjRutas As New ClsTransportes() If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then If ObjRutas.DtResultados.Rows.Count > 0 Then @@ -55,18 +55,16 @@ Partial Class ListadoViajes DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", "")) End If End If - ObjRutas.Dispose() - 'Lista Destinos' - Dim ObjDestinos As New ClsDestinos() - If ObjDestinos.GetDestinos() Then - If ObjDestinos.DtResultados.Rows.Count > 0 Then - DdlPartida.DataSource = ObjDestinos.DtResultados + If ObjRutas.GetDestinos() Then + + If ObjRutas.DtResultados.Rows.Count > 0 Then + DdlPartida.DataSource = ObjRutas.DtResultados DdlPartida.DataBind() DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "")) - DdlDestino.DataSource = ObjDestinos.DtResultados + DdlDestino.DataSource = ObjRutas.DtResultados DdlDestino.DataBind() DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "")) End If From de2259056bc72c9047f5317635720cb6288694fc Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 10 Jan 2024 08:21:23 -0700 Subject: [PATCH 16/33] -- mejoras --- OS/Asignaciones.aspx | 10 ++-------- OS/Asignaciones.aspx.vb | 6 ++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OS/Asignaciones.aspx b/OS/Asignaciones.aspx index cfa008873..8fd3c724f 100644 --- a/OS/Asignaciones.aspx +++ b/OS/Asignaciones.aspx @@ -203,10 +203,7 @@ - - - Fecha Servicio - + > @@ -224,10 +221,7 @@ - - - Hora Servicio - + > diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb index 62c3a9728..7ee3d5ced 100644 --- a/OS/Asignaciones.aspx.vb +++ b/OS/Asignaciones.aspx.vb @@ -45,6 +45,12 @@ Partial Class OS_Asignaciones CargaClientes() CargaSubProyecto() + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then + GvNA.Columns(2).HeaderText = "Hospital" + GvNA.Columns(7).HeaderText = "Fecha Cirugía" + GvNA.Columns(8).HeaderText = "Hora Cirugía" + End If + If UsuarioActual.TienePermisoProceso(171) Then CargaOrdenesServiciosAsignadasXPersona() CargaOrdenesServiciosNoAsignadas() From b740f2ad9803ded23f462b80a54655986fd1fc26 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 10 Jan 2024 08:21:39 -0700 Subject: [PATCH 17/33] - cambio en uso de global --- Inventarios/TraspasoAlmacen.aspx.vb | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 35b9b9014..f03c95e9e 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -2932,6 +2932,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim RowsCargados As Integer = 0 Dim RowsNoCargados As Integer = 0 Dim NoPSConSerie As Integer = 0 + DtMovimientos.Clear() Try Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) For Each RowExcel As DataRow In dt.Rows @@ -2970,23 +2971,23 @@ Partial Class Inventarios_TraspasoAlmacen End If If Valido AndAlso (Cantidad > 0 AndAlso RowPS("VentaMinima").ToString.ToDecimal > 0) Then - If Cantidad Mod RowPS("VentaMinima").ToString.ToDecimal <> 0 Then - Valido = False - ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString()) - End If + If Cantidad Mod RowPS("VentaMinima").ToString.ToDecimal <> 0 Then + Valido = False + ProductosNoCargados.AppendFormat("{0},", RowPS("PSCodigo").ToString()) End If + End If - If Valido Then - Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, -1, If(Not String.IsNullOrEmpty(Serie), Serie, "-1"), If(Not String.IsNullOrEmpty(Lote), Lote, "-1"), FechaCaducidad) - End If + If Valido Then + Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, -1, If(Not String.IsNullOrEmpty(Serie), Serie, "-1"), If(Not String.IsNullOrEmpty(Lote), Lote, "-1"), FechaCaducidad) + End If - If Valido Then - AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False) - RowsCargados = RowsCargados + 1 - Else - RowsNoCargados = RowsNoCargados + 1 - ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString()) - End If + If Valido Then + AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False) + RowsCargados = RowsCargados + 1 + Else + RowsNoCargados = RowsNoCargados + 1 + ProductosNoCargados.AppendFormat("{0},", RowPS("PSCodigo").ToString()) + End If Else RowsNoCargados = RowsNoCargados + 1 From 7bd8ed91b273f5929a07bfd11758e09c30667f2f Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 10 Jan 2024 08:21:57 -0700 Subject: [PATCH 18/33] -- cambio nombre region --- Inventarios/EntradasSalidas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 03c834585..85b32853a 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4433,7 +4433,7 @@ Partial Class Inventarios_EntradasSalidas #End Region -#Region "GUARDAR" +#Region "GUARDAR CAMBIO INVENTARIO FISICO " Private Sub BtnAplicarCambioInvFisico_Click(sender As Object, e As EventArgs) Handles BtnAplicarCambioInvFisico.Click If GvEntradas.Rows.Count = 0 And GvSalidas.Rows.Count = 0 Then From 08a26423c9fecf34bfe6af71c20236d83186d8f3 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 10 Jan 2024 08:22:28 -0700 Subject: [PATCH 19/33] =?UTF-8?q?--=20se=20quit=C3=B3=20llamado=20a=20gene?= =?UTF-8?q?rar=20pdf=20factura=20pyme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/PopUpVerFactura.aspx.vb | 83 ++------------------------------- 1 file changed, 5 insertions(+), 78 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 868b5c508..6d8c2930f 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -7,8 +7,7 @@ Imports System.Xml Imports Extensiones Imports iText.Barcodes.Dmcode Imports Microsoft.Reporting.WebForms -Imports Stimulsoft.Report -Imports Stimulsoft.Report.Web + Partial Class PopUpVerFactura Inherits ClsPaginas @@ -3400,12 +3399,8 @@ Partial Class PopUpVerFactura If Archivo.Exists Then If RegenerarPDF Then Archivo.Delete() - If UsuarioActual.Empresa.CvePlataforma = 2 Then - GeneraPDFVtaPyMe(Vta, "PDF") - Else - ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte, RegenerarQR:=True), Vta.SerieFolio, "PDF") - Vta = Nothing - End If + ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte, RegenerarQR:=True), Vta.SerieFolio, "PDF") + Vta = Nothing Else HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearContent() @@ -3418,20 +3413,11 @@ Partial Class PopUpVerFactura Archivo = Nothing End If Else - - '04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME - If UsuarioActual.Empresa.CvePlataforma = 2 Then - GeneraPDFVtaPyMe(Vta, "PDF") - Else - ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF") - Vta = Nothing - End If + ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF") + Vta = Nothing End If End If - - End If - End Sub #End Region @@ -6530,65 +6516,6 @@ Partial Class PopUpVerFactura End Sub #End Region -#Region "OP = VTA - PyME" - - ' 04/05/2018 - Pruebas de impresion de factura PyME - Private Sub GeneraPDFVtaPyMe(Venta As Modelos.Factura, Optional Formato As String = "PDF") - Dim Directorio1 As String = String.Format("{0}Formatos\Factura.mrt", UsuarioActual.Empresa.Ruta) - Dim File As FileInfo = New FileInfo(Directorio1) - - If File.Exists Then - Dim Reporte As StiReport = New StiReport() - Reporte.Load(Directorio1) - Reporte.Dictionary.DataSources.Clear() - - Dim ds As DataSet = New DataSet() - Venta.DtDetalle.TableName = "Datos" - - ds.Tables.Add(Venta.DtDetalle) - - Reporte.RegData(ds) - - Reporte.Dictionary.Variables("Empresa").Value = UsuarioActual.Empresa.Empresa - - Reporte.Dictionary.Variables("Tipo").Value = "Ingreso" - Reporte.Dictionary.Variables("RFC").Value = UsuarioActual.Empresa.RFC - Reporte.Dictionary.Variables("Serie").Value = Venta.Serie - Reporte.Dictionary.Variables("Folio").Value = Venta.Folio.ToString() - - Reporte.Dictionary.Variables("ClienteNombre").Value = Venta.Cliente.Nombre - Reporte.Dictionary.Variables("ClienteDireccion").Value = Venta.Cliente.Direccion - Reporte.Dictionary.Variables("ClienteLugar").Value = Venta.Cliente.Ciudad - Reporte.Dictionary.Variables("ClienteRFC").Value = Venta.Cliente.RFC - - Reporte.Dictionary.Variables("DomicilioExpedicion").Value = Venta.SubProyecto.Direccion - - Dim SubtTotal As Decimal = (Venta.DtDetalle.SUM("PU") * Venta.DtDetalle.SUM("Cantidad")) '* 0.16 lleva el IVA? - Dim IVA As Decimal = SubtTotal * 0.16D 'lleva IVA? - Dim Total As Decimal = SubtTotal + IVA - - 'Reporte.Dictionary.Variables("Importe").Value = - Reporte.Dictionary.Variables("ImporteLetra").Value = Total.Texto2Letras() - - Reporte.Dictionary.Variables("SubTotal").Value = SubtTotal.ToString() - Reporte.Dictionary.Variables("IVA").Value = IVA.ToString() - Reporte.Dictionary.Variables("Total").Value = Total.ToString() - - Reporte.Dictionary.Variables("UsoCFDI").Value = Venta.UsoCFDI - Reporte.Dictionary.Variables("MetodoPago").Value = Venta.MetodoPago33 - Reporte.Dictionary.Variables("FormaPago").Value = Venta.FormaPago33 - - Reporte.Dictionary.Variables("QR").Value = "lajgkfjsldasdhjsakd229312974tedghjbsadskuuhdkjsad" - Reporte.Dictionary.Variables("SelloCFDI").Value = "lajgkfjsldasdhjsakd229312974tedghjbsadskuuhdkjsadlajgkfjsldasdhjsakd229312974tedghjbsadskuuhdkjsadlajgkfjsldasdhjsakd229312974tedghjbsadskuuhdkjsad" - Reporte.Dictionary.Variables("SelloSAT").Value = "lajgkfjsldasdhjsakd229312974tedghjbsadskuuhdkjsad" - Reporte.Dictionary.Synchronize() - - StiReportResponse.ResponseAsPdf(Me, Reporte) - Else - RegistraScript("alert('No hay un formato de factura predefinido,favor de comunicar a soporte tecnico')") - End If - End Sub -#End Region #Region "OP = ENTREGAS - Entregas por realizar" Public Sub ImprimeEntregasPorRealizar(CveAsignacionEntrega As Long, pUsuarioEntregar As String) From d9837f08bc177d7c53b0365d8f5b3d92a412f667 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Wed, 10 Jan 2024 09:45:52 -0700 Subject: [PATCH 20/33] =?UTF-8?q?--Cambios=20para=20adaptar=20a=20la=20nue?= =?UTF-8?q?va=20BD=20RMF.=20Tanto=20m=C3=A9todos,=20PA=20y=20contenidos=20?= =?UTF-8?q?de=20las=20tablas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsDestinos.vb | 152 ------------------ App_Code/ClsPaginas.vb | 6 +- App_Code/ClsTransportes.vb | 8 +- Transportes/Boletos.aspx | 4 +- Transportes/Boletos.aspx.vb | 2 +- .../{ListadoBoletos.aspx => RepBoletos.aspx} | 8 +- ...tadoBoletos.aspx.vb => RepBoletos.aspx.vb} | 2 +- ...istadoContratos.aspx => RepContratos.aspx} | 10 +- ...Contratos.aspx.vb => RepContratos.aspx.vb} | 0 .../{ListadoViajes.aspx => RepViajes.aspx} | 6 +- ...istadoViajes.aspx.vb => RepViajes.aspx.vb} | 8 +- 11 files changed, 28 insertions(+), 178 deletions(-) delete mode 100644 App_Code/ClsDestinos.vb rename Transportes/{ListadoBoletos.aspx => RepBoletos.aspx} (97%) rename Transportes/{ListadoBoletos.aspx.vb => RepBoletos.aspx.vb} (98%) rename Transportes/{ListadoContratos.aspx => RepContratos.aspx} (99%) rename Transportes/{ListadoContratos.aspx.vb => RepContratos.aspx.vb} (100%) rename Transportes/{ListadoViajes.aspx => RepViajes.aspx} (99%) rename Transportes/{ListadoViajes.aspx.vb => RepViajes.aspx.vb} (97%) diff --git a/App_Code/ClsDestinos.vb b/App_Code/ClsDestinos.vb deleted file mode 100644 index ffca8e5a6..000000000 --- a/App_Code/ClsDestinos.vb +++ /dev/null @@ -1,152 +0,0 @@ -Imports System.Data -Imports System.Data.SqlClient -Imports Extensiones - -Public Class ClsDestinos - Implements IDisposable - -#Region "Campos" - 'SQL - Private SqlConexion As SqlConnection - Private SqlAdapter As SqlDataAdapter - Private SqlCommand As SqlCommand - Private SqlTransacc As SqlTransaction - Private Data As DataTable - Private DSet As New DataSet - - Private disposedValue As Boolean = False ' Para detectar llamadas redundantes - 'REGISTRAR CONEXIÓN - Private CveConexion As Integer = 0 - Public ReadOnly Property DtResultados() As DataTable - Get - DtResultados = Data - End Get - End Property - -#End Region - -#Region "Propiedades" - Public Property CveDestino As Integer - Public Property CveUsuario As Integer - Public Property CveEmpresa As Integer - Public Property Destino As String - Public Property Estatus As Boolean - Public Property EsNacional As Boolean - Public Property FechaIng As DateTime -#End Region - -#Region "Funciones básicas" - Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) - - If TransaccionCompartida Is Nothing Then - SqlConexion = New SqlConnection - SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString - Try - SqlConexion.Open() - Catch ex As Exception - OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) - End Try - Else - SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida - End If - - SqlAdapter = New SqlDataAdapter("", SqlConexion) - ConexionAdd() - End Sub - Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) - With SqlAdapter.SelectCommand - .Parameters.Clear() - .CommandText = StrSQL - .CommandType = TipoComando - End With - If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc - Data = New DataTable - End Sub -#Region "Conexiones" - - Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then - Try - DataAdapter("PA_Sis_RegistrarConexion") - With SqlAdapter.SelectCommand.Parameters - .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name - .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) - .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output - End With - SqlAdapter.Fill(Data) - CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero - Catch ex As Exception - OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - End If - End Sub - - Private Sub ConexionClose() - If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then - - DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text) - - Try - SqlAdapter.Fill(Data) - - Catch ex As Exception - OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - CveConexion = 0 - End If - - End Sub -#End Region - Public Function IniciaTransacSQL() As SqlTransaction - If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() - Return SqlTransacc - End Function - Public Sub RollBack() - SqlTransacc.Rollback() - End Sub - Public Sub Commit() - SqlTransacc.Commit() - End Sub - Protected Overridable Sub Dispose(ByVal disposing As Boolean) - If Not disposedValue Then - If disposing Then - If Not Data Is Nothing Then Data.Dispose() : Data = Nothing - If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing - If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing - If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() - If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing - - End If - End If - disposedValue = True - End Sub - Public Sub Dispose() Implements IDisposable.Dispose - ConexionClose() - Dispose(True) - GC.SuppressFinalize(Me) - End Sub -#End Region - Public Function GetDestinos(Optional CveRuta As Integer = 0) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Trans_DestinosGet") - If CveRuta <> 0 Then - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRuta", SqlDbType.Int).Value = CveRuta - End With - End If - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los destino.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - -End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 4574ac667..64be87ff7 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9621,9 +9621,9 @@ Public Class ClsPaginas #End Region #Region "Transportes" - PaginaDict.Add("/Transportes/ListadoContratos.aspx".ToUpper(), 598) - PaginaDict.Add("/Transportes/ListadoViajes.aspx".ToUpper(), 599) - PaginaDict.Add("/Transportes/ListadoBoletos.aspx".ToUpper(), 600) + PaginaDict.Add("/Transportes/RepContratos.aspx".ToUpper(), 598) + PaginaDict.Add("/Transportes/RepViajes.aspx".ToUpper(), 599) + PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 600) PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 601) #End Region 'Antes de aquí. diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index 6705d9007..061c528a7 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -241,7 +241,7 @@ Public Class ClsTransportes #End Region #Region "Boletos" - Public Function AddViajesPasajeros(CveViaje As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal, Asiento As Integer, Nombre As String, Visa As String, Celular As String, Sexo As Boolean, Observacion As String, CveUsuario As Integer) As Integer + Public Function AddViajesPasajeros(CveViaje As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal, Asiento As Integer, Nombre As String, Visa As String, Celular As String, Sexo As Boolean, Observacion As String, CveUsuario As Integer, CveVendedor As Integer) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Trans_ViajesPasajerosAdd") @@ -259,6 +259,7 @@ Public Class ClsTransportes .Add("@Sexo", SqlDbType.Bit).Value = Sexo .Add("@Observacion", SqlDbType.VarChar).Value = Observacion .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor End With @@ -299,7 +300,7 @@ Public Class ClsTransportes Public Function UpdateViajesPasajeros(CveViajePasajero As Integer, Optional Estatus As Boolean = True, Optional Activar As Boolean = False) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Trans_ViajesPasajerosUpdate") + DataAdapter("PA_Trans_ViajesPasajerosUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero .Add("@Estatus", SqlDbType.Int).Value = Estatus @@ -316,6 +317,8 @@ Public Class ClsTransportes End Function #End Region + +#Region "Destinos" Public Function GetDestinos(Optional CveRuta As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Trans_DestinosGet") @@ -334,6 +337,7 @@ Public Class ClsTransportes Return Retorno End Function +#End Region #Region "Tarifas" Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx index 715652dba..a7201422a 100644 --- a/Transportes/Boletos.aspx +++ b/Transportes/Boletos.aspx @@ -67,14 +67,14 @@ - +<%--
  • Viajes
  • -
    +
    --%> diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index cb4840b0e..8958a0446 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -154,7 +154,7 @@ Partial Class Boletos Try AsientoSeleccionado = AsientoSeleccionado.Replace("A", "") - Dim retorno As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario) + Dim retorno As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, AsientoSeleccionado.ToEntero, TxtNombre.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If retorno > 1 Then ObjTransporte.Commit() diff --git a/Transportes/ListadoBoletos.aspx b/Transportes/RepBoletos.aspx similarity index 97% rename from Transportes/ListadoBoletos.aspx rename to Transportes/RepBoletos.aspx index f178089be..a8ad845e8 100644 --- a/Transportes/ListadoBoletos.aspx +++ b/Transportes/RepBoletos.aspx @@ -1,5 +1,5 @@ <%@ Page Language="VB" Title="Transportes V&A - Boletos" AutoEventWireup="false" - MasterPageFile="~/Site.master" CodeFile="ListadoBoletos.aspx.vb" + MasterPageFile="~/Site.master" CodeFile="RepBoletos.aspx.vb" Inherits="ListadoBoletos" EnableEventValidation="true" %> @@ -14,9 +14,9 @@ - +<%-- - +--%>
    @@ -107,8 +107,6 @@
    - -
    diff --git a/Transportes/ListadoBoletos.aspx.vb b/Transportes/RepBoletos.aspx.vb similarity index 98% rename from Transportes/ListadoBoletos.aspx.vb rename to Transportes/RepBoletos.aspx.vb index 24a41e814..5c6020137 100644 --- a/Transportes/ListadoBoletos.aspx.vb +++ b/Transportes/RepBoletos.aspx.vb @@ -28,7 +28,7 @@ Partial Class ListadoBoletos Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then If Request.QueryString("CveViaje") Is Nothing Then - Response.Redirect("/Transportes/ListadoViajes.aspx") + Response.Redirect("/Transportes/RepViajes.aspx") End If CveViaje = Request.QueryString("CveViaje").ToEntero Ruta = Request.QueryString("Ruta") diff --git a/Transportes/ListadoContratos.aspx b/Transportes/RepContratos.aspx similarity index 99% rename from Transportes/ListadoContratos.aspx rename to Transportes/RepContratos.aspx index 9f37b10b0..49169da2a 100644 --- a/Transportes/ListadoContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -1,5 +1,5 @@ <%@ Page Language="VB" AutoEventWireup="false" Title="Transportes V&A - Contratos" MasterPageFile="~/Site.master" - CodeFile="ListadoContratos.aspx.vb" + CodeFile="RepContratos.aspx.vb" Inherits="ListadoContratos" %> @@ -38,14 +38,14 @@
  • Agregar Contrato
  • -
  • - + Contratos
  • - Viajes -
  • + --%> diff --git a/Transportes/ListadoContratos.aspx.vb b/Transportes/RepContratos.aspx.vb similarity index 100% rename from Transportes/ListadoContratos.aspx.vb rename to Transportes/RepContratos.aspx.vb diff --git a/Transportes/ListadoViajes.aspx b/Transportes/RepViajes.aspx similarity index 99% rename from Transportes/ListadoViajes.aspx rename to Transportes/RepViajes.aspx index 791cbfd9e..45d4d170c 100644 --- a/Transportes/ListadoViajes.aspx +++ b/Transportes/RepViajes.aspx @@ -1,5 +1,5 @@ <%@ Page Language="VB" Title="Transportes V&A - Viajes" AutoEventWireup="false" MasterPageFile="~/Site.master" - CodeFile="ListadoViajes.aspx.vb" + CodeFile="RepViajes.aspx.vb" Inherits="ListadoViajes" %> @@ -27,14 +27,14 @@
  • Agregar viaje
  • -
  • +<%--
  • Contratos
  • Viajes -
  • + --%>
    diff --git a/Transportes/ListadoViajes.aspx.vb b/Transportes/RepViajes.aspx.vb similarity index 97% rename from Transportes/ListadoViajes.aspx.vb rename to Transportes/RepViajes.aspx.vb index 9a0ca63a4..980136983 100644 --- a/Transportes/ListadoViajes.aspx.vb +++ b/Transportes/RepViajes.aspx.vb @@ -1,6 +1,5 @@ Option Explicit On Option Strict On -Imports ADSNetLibrary.SIGAPI.Helpers Imports Extensiones.ModExtensiones Partial Class ListadoViajes @@ -58,7 +57,7 @@ Partial Class ListadoViajes ObjRutas.Dispose() 'Lista Destinos' - Dim ObjDestinos As New ClsDestinos() + Dim ObjDestinos As New ClsTransportes() If ObjDestinos.GetDestinos() Then If ObjDestinos.DtResultados.Rows.Count > 0 Then @@ -72,8 +71,9 @@ Partial Class ListadoViajes End If End If ObjRutas.Dispose() + 'Lista Chofer' - DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) + DdlChofer.DataSource = GlobalDTRHPersonal(185) DdlChofer.DataBind() DdlChofer.Items.Insert(0, New ListItem("Seleccione Chofer", "")) @@ -256,7 +256,7 @@ Partial Class ListadoViajes Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim CveViaje As String = GvRow.DataKey("CveViaje") Dim Ruta As String = GvRow.DataKey("Ruta") - Response.Redirect(String.Format("~/Transportes/ListadoBoletos.aspx?CveViaje={0}&Ruta={1}", CveViaje, Ruta)) + Response.Redirect(String.Format("~/Transportes/RepBoletos.aspx?CveViaje={0}&Ruta={1}", CveViaje, Ruta)) End Sub End Class From 7bd9380710c273aa9b8bfe7544979cffa700747f Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 10 Jan 2024 09:56:53 -0700 Subject: [PATCH 21/33] SMS - 2024.01.08 Enviar Cvemedico y CveProcedimiento al facturar remision --- Ventas/Ventas.aspx.vb | 49 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 6634739e2..9eb41cd72 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -13189,6 +13189,23 @@ Partial Class Ventas Dim DescripcionVenta As String = "" If TxtDescripcionVenta.Text <> "" Then DescripcionVenta = TxtDescripcionVenta.Text + + Dim CveMedico As Integer = -1 + Dim CveProcedimiento As Integer = -1 + + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + If SeEstaFActurandoVentaMedica Then + CveMedico = DdlMedicoObservaciones.SelectedValue.ToEntero + CveProcedimiento = DdlProcedimientoObservaciones.SelectedValue.ToEntero + Else + CveMedico = DdlMedico.SelectedValue.ToEntero + CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero + End If + End If + + + + If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, @@ -13206,7 +13223,7 @@ Partial Class Ventas Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible, CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta, - CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, RequiereOS:=ChkRequiereTecnico.Checked) Then + CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, RequiereOS:=ChkRequiereTecnico.Checked) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then @@ -32179,6 +32196,8 @@ Partial Class Ventas End Function Private Sub EmitirDocumentoNuevo(TipoDoctoNuevo As String) + + If DdlVendedor.SelectedValue.ToEntero() <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDoctoNuevo = "Ing" Then Alert("Debe seleccionar un vendedor.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -32212,6 +32231,9 @@ Partial Class Ventas End If + If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso TipoDoctoNuevo = "Ing" Then + SeEstaFActurandoVentaMedica = True + End If If GvPagos.Rows.Count = 0 And UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 And RBLPago.SelectedValue.ToEntero() = 2 Then Alert("No se puede facturar hasta que se haya especificado detalladamente la forma de pago", TipoMensaje.MsgAdvertencia) @@ -33655,6 +33677,11 @@ Partial Class Ventas DdlUsoCFDI.Enabled = True End If + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then + DdlMedicoObservaciones.Enabled = True + DdlProcedimientoObservaciones.Enabled = True + End If + If UsuarioActual.TienePermisoProceso(289) Then If LblSeTimbro.Text = "No" Then DdlUsoCFDI.Enabled = False @@ -33693,8 +33720,12 @@ Partial Class Ventas Dim ObjVentas As New ClsVentas() ObjVentas.IniciaTransacSQL() + DdlMedicoObservaciones.Enabled = True + DdlProcedimientoObservaciones.Enabled = True + If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, - TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim) Then + TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim, + CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then TieneError = True End If @@ -35030,6 +35061,20 @@ Partial Class Ventas End Property + Property SeEstaFActurandoVentaMedica As Boolean + Get + If ViewState("SeEstaFActurandoVentaMedica") Is Nothing Then + ViewState("SeEstaFActurandoVentaMedica") = False + End If + + Return Boolean.Parse(ViewState("SeEstaFActurandoVentaMedica").ToString) + + End Get + Set(value As Boolean) + ViewState("SeEstaFActurandoVentaMedica") = value + End Set + End Property + From 2e7e559ea7d57094303aea76e9b489db98dbf51c Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 10 Jan 2024 10:11:45 -0700 Subject: [PATCH 22/33] =?UTF-8?q?SMS=20-=202023.12.13=20RecepcionAlmacen?= =?UTF-8?q?=20pierde=20lote=20y=20fecha=20caducidad=20del=20Gv=20al=20camb?= =?UTF-8?q?iar=20=20almac=C3=A9n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/RecepcionAlmacen.aspx | 2 +- Inventarios/RecepcionAlmacen.aspx.vb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx b/Inventarios/RecepcionAlmacen.aspx index 1da85b76c..937f907e0 100644 --- a/Inventarios/RecepcionAlmacen.aspx +++ b/Inventarios/RecepcionAlmacen.aspx @@ -192,7 +192,7 @@
    - +
    diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 40d70f44a..382b175f2 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -474,7 +474,7 @@ Partial Class Inventarios_RecepcionAlmacen CargaPendientes() CargaPermisos() - If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True + Dim PermisoEspecialCambioFecha As Boolean = False If UsuarioActual.CveUsuario.Contiene(100, 1937) Then PermisoEspecialCambioFecha = True @@ -591,9 +591,7 @@ Partial Class Inventarios_RecepcionAlmacen UpGenerales.Update() End Sub - Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) - RecargaporAlmacenes() - End Sub + Private Sub RecargaporAlmacenes() CveTipoAlmacen = -1 From ce121c268622cb093ff187f5aca899015b8426b4 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 10 Jan 2024 12:12:37 -0700 Subject: [PATCH 23/33] Rep Ventas. personalizar Detalles Descripcion Venta --- Inventarios/RepEntradasSalidas.aspx | 2 +- Inventarios/RepEntradasSalidas.aspx.vb | 21 ++++++++++++++++++++- Ventas/RepVentaDetalle.aspx | 13 ++++++++++++- Ventas/RepVentaDetalle.aspx.vb | 7 +++++++ 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index 8a60e98ab..4e6ef9959 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -209,7 +209,7 @@ diff --git a/Ventas/RepProductosServicios.aspx.vb b/Ventas/RepProductosServicios.aspx.vb index e14b4dea6..381395413 100644 --- a/Ventas/RepProductosServicios.aspx.vb +++ b/Ventas/RepProductosServicios.aspx.vb @@ -53,8 +53,6 @@ Partial Class Ventas_RepProductosServicios If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx") CargarMarcas() SetValues() - - End If End Sub @@ -115,8 +113,6 @@ Partial Class Ventas_RepProductosServicios divClasif2.Visible = True DdlGrupo.Items.Add(New ListItem("Clasificacion2", "25")) - - LblServicioDomicilioFiltro.Visible = True DVServicioDomicilio.Visible = True @@ -142,6 +138,12 @@ Partial Class Ventas_RepProductosServicios DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero) DdlPS.ddl.DataBind() DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1")) + End If + + If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then + ChkIEPS.Visible = True + ChkIEPS.Checked = True + GvDatos.Columns(6).Visible = True End If 'CargaEstatus @@ -334,43 +336,48 @@ Partial Class Ventas_RepProductosServicios Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click - - If ChkMaxSub.Checked Then + If ChkIEPS.Checked Then GvDatos.Columns(6).Visible = True Else GvDatos.Columns(6).Visible = False End If - If ChkAVGSub.Checked Then + If ChkMaxSub.Checked Then GvDatos.Columns(7).Visible = True Else GvDatos.Columns(7).Visible = False End If - If ChkMinSub.Checked Then + If ChkAVGSub.Checked Then GvDatos.Columns(8).Visible = True Else GvDatos.Columns(8).Visible = False End If - If ChkMaxTot.Checked Then + If ChkMinSub.Checked Then GvDatos.Columns(9).Visible = True Else GvDatos.Columns(9).Visible = False End If - If ChkAvgTot.Checked Then + If ChkMaxTot.Checked Then GvDatos.Columns(10).Visible = True Else GvDatos.Columns(10).Visible = False End If - If ChkMinTot.Checked Then + If ChkAvgTot.Checked Then GvDatos.Columns(11).Visible = True Else GvDatos.Columns(11).Visible = False End If + If ChkMinTot.Checked Then + GvDatos.Columns(12).Visible = True + Else + GvDatos.Columns(12).Visible = False + End If + UPDatos.Update() End Sub #End Region From 167a531a6e5ce501408e860e920ec718d2f9653a Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Thu, 11 Jan 2024 09:15:13 -0700 Subject: [PATCH 31/33] --- App_Code/ClsRH.vb | 24 ++++++++++++++++++++---- RH/CatPersonal.aspx.vb | 3 ++- RH/Personal.aspx | 10 ++++++++++ RH/Personal.aspx.vb | 7 +++++-- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 283f9be3b..6fb81455d 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1908,9 +1908,22 @@ Public Class ClsRH End Try Return Retorno + End Function + + Public Function PA_RH_PersonalSalarioMenorAlMinimo(cveEmpresa As Int32, calculaSalarioV As Boolean, guardar As Boolean, cveRegistroPatronal As Int32, salarioZonaA As Decimal, salarioZonaB As Decimal, salarioZonaC As Decimal, fecha As DateTime) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RH_PersonalSalarioMenorAlMinimo", CommandType.StoredProcedure) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@CalculaSalarioV", SqlDbType.Bit, calculaSalarioV) + addParameters("@Guardar", SqlDbType.Bit, guardar) + addParameters("@CveRegistroPatronal", SqlDbType.Int, cveRegistroPatronal) + addParameters("@SalarioZonaA", SqlDbType.Money, salarioZonaA) + addParameters("@SalarioZonaB", SqlDbType.Money, salarioZonaB) + addParameters("@SalarioZonaC", SqlDbType.Money, salarioZonaC) + addParameters("@Fecha", SqlDbType.Date, fecha) + retorno = RunQuery("Ocurrió un error al obtener el personal con salario menor al minimo.") + Return retorno End Function - - Public Function GetPersonalMasivo(CveTurno As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveSupervisor As Integer, CveEmpresa As Integer, Optional CveCliente As Integer = -1) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -1947,7 +1960,7 @@ Public Class ClsRH NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String, CveJornada As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Beneficiario As String, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Boolean = False, Optional CvePais As Integer = -1, - Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1, Optional CveTipoTrabajador As Integer = -1, Optional NetoPeriodo As Decimal = -1, Optional TipoSangre As String = "-1", Optional CveSubTipoPeriodo As Integer = -1) As Boolean + Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1, Optional CveTipoTrabajador As Integer = -1, Optional NetoPeriodo As Decimal = -1, Optional TipoSangre As String = "-1", Optional CveSubTipoPeriodo As Integer = -1, Optional AreaGeografica As String = "A") As Boolean Dim Retorno As Boolean = False Dim noguardoXcurp As Boolean = False @@ -2036,6 +2049,7 @@ Public Class ClsRH .Add("@CveTipoTrabajador", SqlDbType.Int).Value = CveTipoTrabajador .Add("@NetoPeriodo", SqlDbType.Money).Value = NetoPeriodo .Add("@TipoSangre", SqlDbType.VarChar).Value = TipoSangre + .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica .Add("@CveSubTipoPeriodo", SqlDbType.Int).Value = CveSubTipoPeriodo @@ -2079,7 +2093,7 @@ Public Class ClsRH Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1, Optional CveMedioTransporte As Integer = -1, Optional EsReserva As Integer = -1, Optional Fiscalizable As Integer = -1, Optional CveTipoTrabajador As Integer = -1, Optional NetoPeriodo As Decimal = -1, - Optional TipoSangre As String = "-1", Optional CveSubTipoPeriodo As Integer = -1) As Boolean + Optional TipoSangre As String = "-1", Optional CveSubTipoPeriodo As Integer = -1, Optional AreaGeografica As String = "") As Boolean Dim Retorno As Boolean = False @@ -2174,6 +2188,8 @@ Public Class ClsRH .Add("@CveTipoTrabajador", SqlDbType.Int).Value = CveTipoTrabajador .Add("@NetoPeriodo", SqlDbType.Money).Value = NetoPeriodo .Add("@TipoSangre", SqlDbType.VarChar).Value = TipoSangre + .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica + .Add("@CveSubTipoPeriodo", SqlDbType.Int).Value = CveSubTipoPeriodo End With diff --git a/RH/CatPersonal.aspx.vb b/RH/CatPersonal.aspx.vb index f6f4e2b7e..406889dd2 100644 --- a/RH/CatPersonal.aspx.vb +++ b/RH/CatPersonal.aspx.vb @@ -1196,7 +1196,8 @@ Partial Class RH_CatPersonal -1, DdlSubProyectoAsignadoAdd.SelectedValue.ToEntero, "", DdlSupervisor.SelectedValue.ToEntero, "", "", DdlJornada.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, "", -1, CveUniforme:=-1, TelefonoExtension:="", CelularPersonal:="", TelefonoMarcadoRapido:="", ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=isSindicalizado, CvePais:=151, - CveMedioTransporte:=DdlMedioTransporte.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero() + CveMedioTransporte:=DdlMedioTransporte.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), + AreaGeografica:=DdlAreageografica.SelectedValue ) Then Dim filesgral As List(Of Archivo) = TxtFoto.getfiles().Archivos Dim filemove As String = "" diff --git a/RH/Personal.aspx b/RH/Personal.aspx index c1a0d55b4..0b0bbf56c 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -1506,6 +1506,16 @@ + +
    + + + + + + + +
    diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 666f3b450..6bb04180a 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1702,6 +1702,7 @@ Partial Class RH_Personal TxtCodigo.Text = ObjPersonal.Codigo DdlEscolaridad.SelectedValue = ObjPersonal.CveEscolaridad.ToString() DdlEstadoCivil.SelectedValueExist(ObjPersonal.CveEstadoCivil.ToString()) + DdlAreageografica.SelectedValueExist(drow("Areageografica").ToString()) DdlGenero.SelectedValue = ObjPersonal.CveGenero.ToString() TxtFechaNacimiento.Text = ObjPersonal.FechaNacimiento.ToShortDateString TxtRFC.Text = ObjPersonal.RFC @@ -2051,7 +2052,8 @@ Partial Class RH_Personal UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=ChkSindicalizado.Checked, Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), - CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero, CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal, TipoSangre:=DdlTipoSangre.SelectedValue, CveSubTipoPeriodo:=CveSubTipoPeriodo) Then + CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero, CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal, TipoSangre:=DdlTipoSangre.SelectedValue, CveSubTipoPeriodo:=CveSubTipoPeriodo, + AreaGeografica:=DdlAreageografica.SelectedValue) Then If Archivo.Exists Then @@ -2137,7 +2139,8 @@ Partial Class RH_Personal TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario, CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero(), EsReserva:=If(chkEsReserva.Checked, 1, 0), - Fiscalizable:=If(chkNoFiscalizar.Checked, 0, 1), CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal, TipoSangre:=DdlTipoSangre.SelectedValue, CveSubTipoPeriodo:=CveSubTipoPeriodo) Then + Fiscalizable:=If(chkNoFiscalizar.Checked, 0, 1), CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal, TipoSangre:=DdlTipoSangre.SelectedValue, CveSubTipoPeriodo:=CveSubTipoPeriodo, + AreaGeografica:=DdlAreageografica.SelectedValue) Then 'Funcion usa RH Familiares If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then From f1c4c0d3597fe3893ed830843c1cfb2587ead5a1 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 11 Jan 2024 11:30:19 -0700 Subject: [PATCH 32/33] SMS - 2024.01.08 quitar Ddls Medico y Procedmiento de observaciones, solo dejar los que estan en el area de cliente --- App_Code/ClsVentas.vb | 4 +- Ventas/Ventas.aspx | 20 ++-- Ventas/Ventas.aspx.vb | 233 ++++++++++++++++++++++++++---------------- 3 files changed, 157 insertions(+), 100 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 2106523ac..df3125f98 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1380,7 +1380,8 @@ Public Class ClsVentas CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1, Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Decimal = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1, Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Decimal = 0, Optional PorcentajeRetIVA As Double = 0, - Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional NumTurnos As Decimal = 0D) As Boolean + Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, + Optional NumTurnos As Decimal = 0D, Optional EstatusAlmacen As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasDetalleAdd") @@ -1413,6 +1414,7 @@ Public Class ClsVentas .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@NumTurnos", SqlDbType.Decimal).Value = NumTurnos + .Add("@EstatusAlmacen", SqlDbType.Int).Value = EstatusAlmacen End With Try diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 81e288727..829110aba 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -582,16 +582,16 @@ - + Requiere Técnico: - + - + Fecha de Cirugia: - + @@ -4093,7 +4093,7 @@ - + <%-- Médico:  @@ -4114,7 +4114,7 @@ Seleccione uno - + --%> @@ -8405,13 +8405,13 @@ <%--Tipo Venta--%>
    -
    +
    -
    +
    -
    +
    @@ -8489,7 +8489,7 @@
    - Requiere Técnico: + Requiere Técnico:
    diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 246596a7e..4506bd264 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2282,6 +2282,53 @@ Partial Class Ventas End Set End Property + +#Region "VENTA MEDICA" + + Property EsVentaMedica As Boolean + Get + If ViewState("EsVentaMedica") Is Nothing Then + ViewState("EsVentaMedica") = False + End If + + Return Boolean.Parse(ViewState("EsVentaMedica").ToString) + + End Get + Set(value As Boolean) + ViewState("EsVentaMedica") = value + End Set + End Property + + + Property SeEstaFActurandoVentaMedica As Boolean + Get + If ViewState("SeEstaFActurandoVentaMedica") Is Nothing Then + ViewState("SeEstaFActurandoVentaMedica") = False + End If + + Return Boolean.Parse(ViewState("SeEstaFActurandoVentaMedica").ToString) + + End Get + Set(value As Boolean) + ViewState("SeEstaFActurandoVentaMedica") = value + End Set + End Property + + + Public Property CveTipoVenta As Integer + Get + If ViewState("CveTipoVenta") Is Nothing Then + ViewState("CveTipoVenta") = -1 + End If + Return ViewState("CveTipoVenta").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveTipoVenta") = value + End Set + End Property + +#End Region + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -3391,7 +3438,7 @@ Partial Class Ventas End If End If - If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then If CveVenta <= 0 Then EsVentaMedica = True CargaTiposVenta() @@ -5819,14 +5866,16 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then - If DbRowVenta("CveMedico").ToString.ToEntero > 0 Then - TrObsMedico1.Visible = True - TrObsMedico2.Visible = True - TrObsProcedimiento1.Visible = True - TrObsProcedimiento2.Visible = True + CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1) - DdlMedicoObservaciones.SelectedValueExist(DbRowVenta("CveMedico").ToString) - DdlProcedimientoObservaciones.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString) + If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 3, 5) Then + TrVentasMedicas1.Visible = True + DdlMedico.SelectedValueExist(DbRowVenta("CveMedico").ToString) + DdlProcedimiento.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString) + + + DdlMedico.Enabled = False + DdlProcedimiento.Enabled = False End If @@ -13192,20 +13241,15 @@ Partial Class Ventas Dim CveMedico As Integer = -1 Dim CveProcedimiento As Integer = -1 + Dim CveTipoVentaGuardar As Integer = -1 If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then - If SeEstaFActurandoVentaMedica Then - CveMedico = DdlMedicoObservaciones.SelectedValue.ToEntero - CveProcedimiento = DdlProcedimientoObservaciones.SelectedValue.ToEntero - Else - CveMedico = DdlMedico.SelectedValue.ToEntero - CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero - End If + CveMedico = DdlMedico.SelectedValue.ToEntero + CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero + CveTipoVentaGuardar = If(SeEstaFActurandoVentaMedica, CveTipoVenta, RBLTipoVenta.SelectedValue.ToEntero) End If - - If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, @@ -13223,7 +13267,7 @@ Partial Class Ventas Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible, CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta, - CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, RequiereOS:=ChkRequiereTecnico.Checked) Then + CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then @@ -13333,13 +13377,16 @@ Partial Class Ventas CargaNCDT(factura.CveVentaPadre, DdlTipoComprobante.SelectedValue, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas) End If + 'Dim EsatusAlmacen As Integer = If(RBLTipoVenta.SelectedValue = "5" AndAlso EsVentaMedica AndAlso DdlTipoComprobante.SelectedValue = "Ped", 1, 0) ', EstatusAlmacen:=EsatusAlmacen 'Se agregan los PS For Each Row As DataRow In TmpDTDetalle.Rows If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(), Row("PU").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDecimal, Math.Round((Row("Total").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), Row("Obs").ToString(), Row("Descuento").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal, - PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then + PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, + PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), + CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Exit For Else @@ -21702,7 +21749,6 @@ Partial Class Ventas BtnEditarRemision.Visible = True BtnPermisoEditarRemision.Visible = False BtnCrearApartirDe.Visible = False - DdlSucursalCliente.Enabled = True TxtObsFact.Enabled = True TxtOrdenCompra.Enabled = True TxtPedidoContrato.Enabled = True @@ -21713,12 +21759,17 @@ Partial Class Ventas UPCondicionesPago.Update() If Me.PermiteCredito Then RBLPago.Enabled = True DdlVendedor.Enabled = True + ModalidadEdicion = True ViewState("CveClienteAnterior") = CveCliente - DdlMedicoObservaciones.Enabled = True - DdlProcedimientoObservaciones.Enabled = True + If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 3, 5) Then + TrVentasMedicas1.Visible = True + DdlMedico.Enabled = True + DdlProcedimiento.Enabled = True + End If + Dim CantidadFacturadaRemision As Decimal = 0 @@ -21767,6 +21818,7 @@ Partial Class Ventas TxtPrecio.Enabled = True End If + LbAgregar.Enabled = True ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';") LblSubTotal1.Text = TxtSubTotal.Text @@ -21793,9 +21845,8 @@ Partial Class Ventas Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal + Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble EditoRemision = True - CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero Try 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then @@ -21872,12 +21923,12 @@ Partial Class Ventas 'Actualizo los parametros de la venta If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, + UsuarioActual.CveEmpresa, CveVenta, 0, 0, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), - CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, - OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), - CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then + CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, + OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), + CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then OcurrioError = True End If @@ -30312,7 +30363,7 @@ Partial Class Ventas End If Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Decimal = TxtTipoCambio.Text.Trim.ToDecimal + Dim TipoCambio As Double = TxtTipoCambio.Text.Trim.ToDecimal If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then TipoCambio = 1 Moneda = 1 @@ -30399,14 +30450,15 @@ Partial Class Ventas Moneda = 1 End If + 'ACTUALIZA VENTA - If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal(), TxtIVA.Text.ToDecimal(), TxtIEPS.Text.ToDecimal(), TxtTotal.Text.ToDecimal(), + If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDouble(), LblDescuentos.Text.ToDouble(), TxtIVA.Text.ToDouble(), TxtIEPS.Text.ToDouble(), TxtTotal.Text.ToDouble(), Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, + UsuarioActual.CveEmpresa, CveVenta, 0, 0, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, - TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then + TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then MensajeError = "Ocurrió un error al actualizar la información de la cotización" OcurrioError = True End If @@ -33676,9 +33728,10 @@ Partial Class Ventas DdlUsoCFDI.Enabled = True End If - If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then - DdlMedicoObservaciones.Enabled = True - DdlProcedimientoObservaciones.Enabled = True + If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(1, 3, 5) Then + TrVentasMedicas1.Visible = True + DdlMedico.Enabled = True + DdlProcedimiento.Enabled = True End If If UsuarioActual.TienePermisoProceso(289) Then @@ -33719,12 +33772,12 @@ Partial Class Ventas Dim ObjVentas As New ClsVentas() ObjVentas.IniciaTransacSQL() - DdlMedicoObservaciones.Enabled = True - DdlProcedimientoObservaciones.Enabled = True + 'DdlMedicoObservaciones.Enabled = True + 'DdlProcedimientoObservaciones.Enabled = True If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim, - CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then + CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then TieneError = True End If @@ -35045,34 +35098,7 @@ Partial Class Ventas End Set End Property - Property EsVentaMedica As Boolean - Get - If ViewState("EsVentaMedica") Is Nothing Then - ViewState("EsVentaMedica") = False - End If - Return Boolean.Parse(ViewState("EsVentaMedica").ToString) - - End Get - Set(value As Boolean) - ViewState("EsVentaMedica") = value - End Set - End Property - - - Property SeEstaFActurandoVentaMedica As Boolean - Get - If ViewState("SeEstaFActurandoVentaMedica") Is Nothing Then - ViewState("SeEstaFActurandoVentaMedica") = False - End If - - Return Boolean.Parse(ViewState("SeEstaFActurandoVentaMedica").ToString) - - End Get - Set(value As Boolean) - ViewState("SeEstaFActurandoVentaMedica") = value - End Set - End Property @@ -36057,7 +36083,7 @@ Partial Class Ventas RBLTipoVenta.DataSource = GlobalDTTipoVenta().FiltraParametros("Estatus = 'True' ") RBLTipoVenta.DataBind() - RBLTipoVenta.Items.Add(New ListItem("Otros", "5")) + RBLTipoVenta.Items.Add(New ListItem("Otros", "99")) TrVentasMedicas1.Visible = True TrVentasMedicas2.Visible = True @@ -36076,8 +36102,7 @@ Partial Class Ventas DdlProcedimientoModal.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlProcedimientoModal.DataBind() - DdlProcedimientoObservaciones.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa) - DdlProcedimientoObservaciones.DataBind() + End Sub @@ -36088,8 +36113,7 @@ Partial Class Ventas DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ") DdlMedicoModal.DataBind() - DdlMedicoObservaciones.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa) - DdlMedicoObservaciones.DataBind() + End Sub @@ -36140,7 +36164,11 @@ Partial Class Ventas End Sub Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs) - TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked + + + TdFechaOS1.Visible = ChkRequiereTecnico.Checked + TdFechaOS2.Visible = ChkRequiereTecnico.Checked + UpCliente.Update() End Sub @@ -36167,7 +36195,7 @@ Partial Class Ventas Select Case RBLTipoVenta.SelectedValue - Case "1" ' Fuera de linea + Case "1", "5" '1 Fuera de linea || 5 Consignación - Uso material ChkRequiereTecnicoModal.Checked = True ChkRequiereTecnicoModal.Enabled = True DvModalRequiereOSFecha.Visible = True @@ -36181,13 +36209,13 @@ Partial Class Ventas DvModalRequiereOSFecha.Visible = False DvModalTipoVentaPasoMedicoProcedimiento.Visible = False DVGvProductosProcedimiento.Visible = False - Case "4" 'Consigna + Case "4" 'Consignación ChkRequiereTecnicoModal.Checked = False DvModalTipoVentaPasoRequiereOS.Visible = False DvModalRequiereOSFecha.Visible = False DvModalTipoVentaPasoMedicoProcedimiento.Visible = False DVGvProductosProcedimiento.Visible = False - Case "5" ' Otros + Case "99" ' Otros LnkDvModalTipoVentaAceptar.Visible = False UpDvModalTipoVenta.Update() RegistraScript("$('#DvModalTipoVenta').modal('hide');") @@ -36290,6 +36318,8 @@ Partial Class Ventas Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs) + + If DdlClienteSucursalCliente() > 0 Then ViewState("CveCliente") = DdlClienteSucursalCliente() Else @@ -36318,21 +36348,46 @@ Partial Class Ventas DdlMedico.SelectedValueExist(DdlMedicoModal.SelectedValue) DdlProcedimiento.SelectedValueExist(DdlProcedimientoModal.SelectedValue) - 'si es pago directo es factura - If RBLTipoVenta.SelectedValue.Contiene("2") Then ' Pago Directo - DdlTipoComprobante.SelectedValueExist("Ing") - TdRequiereTecnico1.Visible = True - TdRequiereTecnico2.Visible = True - ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then ' Consigna - DdlTipoComprobante.SelectedValueExist("Ing") - Else - TdFechaOS1.Visible = True - TdFechaOS2.Visible = True - ChkRequiereTecnico.Checked = True - ChkRequiereTecnico.Enabled = False - DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Ped")) - DdlTipoComprobante.SelectedValueExist("Ped") - End If + + If RBLTipoVenta.SelectedValue.Contiene("2") Then 'si es pago directo es factura + DdlTipoComprobante.SelectedValueExist("Ing") + + TrVentasMedicas1.Visible = True + TrVentasMedicas2.Visible = True + + TdFechaOS1.Visible = True + TdFechaOS2.Visible = True + ChkRequiereTecnico.Checked = True + ChkRequiereTecnico.Enabled = False + + 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.SelectedValueExist("Ped") + + TrVentasMedicas1.Visible = True + TrVentasMedicas2.Visible = True + + TdFechaOS1.Visible = True + TdFechaOS2.Visible = True + + ChkRequiereTecnico.Enabled = True + ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked + TdFechaOS1.Visible = ChkRequiereTecnicoModal.Checked + TdFechaOS2.Visible = ChkRequiereTecnicoModal.Checked + + + End If DdlTipoComprobante.Enabled = False CargaCliente(CveCliente) From 2ed3aac55b2d31ac5fdcae8155693dcaceee3edd Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 11 Jan 2024 13:08:30 -0700 Subject: [PATCH 33/33] SMS Cambio quitar Ddls Medico y Procedimiento de obseraciones --- App_Code/ClsTransportes.vb | 2 +- Ventas/Ventas.aspx | 5 +++-- Ventas/Ventas.aspx.vb | 24 +++++++++++++----------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index 557fce9f3..c9fe13e3a 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -339,7 +339,7 @@ Public Class ClsTransportes End Function #End Region -#End Region + #Region "Rutas" Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 829110aba..b2441c917 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1976,12 +1976,13 @@
    + +
    - - +   diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 4506bd264..92cdcd354 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -13377,7 +13377,7 @@ Partial Class Ventas CargaNCDT(factura.CveVentaPadre, DdlTipoComprobante.SelectedValue, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas) End If - 'Dim EsatusAlmacen As Integer = If(RBLTipoVenta.SelectedValue = "5" AndAlso EsVentaMedica AndAlso DdlTipoComprobante.SelectedValue = "Ped", 1, 0) ', EstatusAlmacen:=EsatusAlmacen + Dim EsatusAlmacen As Integer = If(RBLTipoVenta.SelectedValue = "5" AndAlso EsVentaMedica AndAlso DdlTipoComprobante.SelectedValue = "Ped", 1, 0) ', EstatusAlmacen:=EsatusAlmacen 'Se agregan los PS For Each Row As DataRow In TmpDTDetalle.Rows If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(), @@ -13386,7 +13386,7 @@ Partial Class Ventas CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal, PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), - CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then + CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen) Then ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Exit For Else @@ -21845,7 +21845,7 @@ Partial Class Ventas Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble + Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal EditoRemision = True Try 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS @@ -21921,13 +21921,12 @@ Partial Class Ventas Moneda = 1 End If - 'Actualizo los parametros de la venta If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, 0, 0, + UsuarioActual.CveEmpresa, CveVenta, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), - CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, - OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), + CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, + OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then OcurrioError = True End If @@ -30363,7 +30362,7 @@ Partial Class Ventas End If Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - Dim TipoCambio As Double = TxtTipoCambio.Text.Trim.ToDecimal + Dim TipoCambio As Decimal = TxtTipoCambio.Text.Trim.ToDecimal If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then TipoCambio = 1 Moneda = 1 @@ -30452,17 +30451,20 @@ Partial Class Ventas 'ACTUALIZA VENTA - If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDouble(), LblDescuentos.Text.ToDouble(), TxtIVA.Text.ToDouble(), TxtIEPS.Text.ToDouble(), TxtTotal.Text.ToDouble(), + 'ACTUALIZA VENTA + If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal(), TxtIVA.Text.ToDecimal(), TxtIEPS.Text.ToDecimal(), TxtTotal.Text.ToDecimal(), Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, - UsuarioActual.CveEmpresa, CveVenta, 0, 0, + UsuarioActual.CveEmpresa, CveVenta, Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, - TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then + TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then MensajeError = "Ocurrió un error al actualizar la información de la cotización" OcurrioError = True End If + + 'ELIMINA DETALLES If Not ObjVentas.RemoveVentasDetalle(CveVenta) Then MensajeError = "Ocurrió un error al actualizar las partidas de la cotización"