From 3b99b6ec6154353601bb63a17542b7cff885dc43 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 10 Jan 2024 06:35:07 -0700 Subject: [PATCH 01/29] =?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 02/29] =?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 03/29] -- 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 04/29] - 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 05/29] -- 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 06/29] =?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 7bd9380710c273aa9b8bfe7544979cffa700747f Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 10 Jan 2024 09:56:53 -0700 Subject: [PATCH 07/29] 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 08/29] =?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 09/29] 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 17/29] --- 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 18/29] 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 19/29] 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" From 4b9e175f23774f61ae6e21c91e905ba5b4c11170 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 11 Jan 2024 18:24:11 -0700 Subject: [PATCH 20/29] =?UTF-8?q?--Mover=20a=20pantalla=20de=20cobranza(PV?= =?UTF-8?q?Cobranza.aspx).=20el=20inicio=20de=20turno=20y=20y=20ocultarlo?= =?UTF-8?q?=20en=20la=20pantalla=20de=20ventas,=20se=20activar=C3=A1=20en?= =?UTF-8?q?=20el=20proceso=20371?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/PVCobranza.aspx | 1144 +++++++++++++++++++++++++++---------- Ventas/PVCobranza.aspx.vb | 258 ++++++++- 2 files changed, 1080 insertions(+), 322 deletions(-) diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index f9d40297c..e4e8fa634 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -1,296 +1,822 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PVCobranza.aspx.vb" Inherits="Ventas_PVCobranza" %> - - - - - - - - - - - Cobranza - - - - - - - -
-
-
- - -
-
-
-
+<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PVCobranza.aspx.vb" Inherits="Ventas_PVCobranza" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> + + + + + + + + + +
  • + Estado de Caja +
  • +
  • + Ingreso de Efectivo +
  • +
  • + Retiro de Efectivo +
  • +
    +
    +
    + + Cobranza + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    Sucursal: -
    -
    - - - -
    -
    - Fecha Inicio Docto: -
    -
    -
    - - - - -
    - - - - - - -
    -
    - Fecha Fin Docto: -
    -
    -
    - - - - -
    - - - - - - -
    -
    -
    -
    - -
    -
    -
    - - -
    -
    - - - - - - - - - - - - - -
    -
    - -
    -
    - - Nombre: - -           - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    - $ - - -
    -
    - - - -
    -
    -
    - -
    -
    - -
    - $ - - -
    -
    - - - -
    -
    - - MSI - 3M - 6M - 9M - 12M - - <%-- - --%> -
    -
    -
    - -
    -
    - -
    - $ - - -
    -
    - - - -
    -
    -
    -
    -
    - -
    - $ - - -
    -
    - - - -
    -
    -
    - -
    -
    - -
    - $ - - -
    -
    - - - -
    -
    -
    - -
    -
    - -
    - - Otros - Credito - Debito - Cheque - -
    - -
    - $ - - -
    - -
    - - - -
    - -
    - - Meses - 3M - 6M - 9M - 12M - -
    - -
    -
    - -
    -
    - -
    - $ - - - -
    - -
    - $ - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - + +
    +
    + + + +
    +
    + Fecha Inicio Docto: + +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin Docto: + +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    + +
    +
    +
    + + +
    + + +
    + Turno: + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + +
    +
    + +
    +
    + Nombre: + +           + + + + + + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    + $ + + +
    +
    + + + +
    +
    +
    + +
    +
    + +
    + $ + + +
    +
    + + + +
    +
    + + MSI + 3M + 6M + 9M + 12M + + <%-- + --%> +
    +
    +
    + +
    +
    + +
    + $ + + +
    +
    + + + +
    +
    +
    +
    +
    + +
    + $ + + +
    +
    + + + +
    +
    +
    + +
    +
    + +
    + $ + + +
    +
    + + + +
    +
    +
    + +
    +
    + +
    + + Otros + Credito + Debito + Cheque + +
    + +
    + $ + + +
    + +
    + + + +
    + +
    + + Meses + 3M + 6M + 9M + 12M + +
    + +
    +
    + +
    +
    + +
    + $ + + + +
    + +
    + $ + + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + +
    + - + function CalculaDiferencia() { + ; + var total = 0 + total = ToDouble($('#C_TxtEfectivoEnCaja').val()) - ToDouble($('#C_LblEfectivoEsperado').text()); + $('#C_LblDiferenciaCaja').text(FormatoNumero(total)); + } + + function CalculaDiferenciaBloqueo() { + var total = 0; + total = ToDouble($('#C_TxtEfectivoCajaBloqueo').val()) - ToDouble($('#C_LblEfectivoBloqueo').text()); + $('#C_LblDiferenciaCajaBloqueo').val(FormatoNumero(total)); + } + + + diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index fa46e1e24..8161e583b 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -14,13 +14,24 @@ Partial Class Ventas_PVCobranza Set(value As Integer) ViewState("CveCorte") = value End Set + End Property + + Private Property DineroCaja As Double + Get + Return If(IsNothing(ViewState("DineroCaja")), 0, ViewState("DineroCaja").ToString().ToDecimal()) + End Get + Set(value As Double) + ViewState("DineroCaja") = value + End Set End Property Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then CveCorte = 0 CargaFiltros() - CargaCorteCaja() + If UsuarioActual.TienePermisoProceso(371) Then + CargaCorteCaja() + End If End If End Sub @@ -59,31 +70,118 @@ Partial Class Ventas_PVCobranza DdlCuentaTarjetaDebito.DataBind() DdlCuentaCheque.DataBind() DdlCuentaTransferencia.DataBind() + TxtImporteEfectivo.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteCredito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteCheque.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") TxtImporteTransferencia.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") - TxtImporteOtrosContado.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") + TxtImporteOtrosContado.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();") + + TxtEfectivoEnCaja.Attributes.Add("onKeyUp", "CalculaDiferencia();") + TxtEfectivoCajaBloqueo.Attributes.Add("onKeyUp", "CalculaDiferenciaBloqueo();") End Sub - Private Sub CargaCorteCaja() - Dim DebeCerrarCorte As Boolean = False - 'Checar si hay un Turno Abierto - Dim ObjPVenta As New ClsPuntoVenta - - If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then - - If ObjPVenta.DtResultados.Rows.Count > 0 Then - CveCorte = ObjPVenta.CveCorte - End If - End If - ObjPVenta.Dispose() - - + Private Sub CargaCorteCaja() + Dim DebeCerrarCorte As Boolean = False + 'Checar si hay un Turno Abierto + Dim ObjPVenta As New ClsPuntoVenta + + If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then + + If ObjPVenta.DtResultados.Rows.Count > 0 Then + CveCorte = ObjPVenta.CveCorte + Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5) + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then + DebeCerrarCorte = True + LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte." + Else + LblTurno.Text = ObjPVenta.FechaInicial.ToShortDateString + BtnIniciarTurno.Visible = False + LkbEstadodeCaja.Visible = True + LkbIngreso.Visible = True + LkbRetiro.Visible = True + UpTurno.Visible = True + End If + + Else + UpTurno.Visible = False + 'Ingresar un nuevo Turno + RegistraScript("window.onload = function MuestraCorteCaja() { document.getElementById(""C_btnShow"").click(); }") + End If + End If + ObjPVenta.Dispose() + + If DebeCerrarCorte Then + CargaDatosCorte() + RegistraScript("window.onload = function MuestraPantallaBloqueo() { document.getElementById(""C_btnShowBloqueo"").click(); }") + End If + End Sub + + Private Sub CargaDatosCorte() + Dim ObjPVenta As New ClsPuntoVenta + Dim Total As Double + + If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then + If ObjPVenta.DtResultados.Rows.Count > 0 Then + + Total = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble + ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble + ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble + DineroCaja = Total + LblEfectivoEsperado.Text = Total.FormatoNumero(2) + LblEfectivoBloqueo.Text = Total.FormatoNumero(2) + + Dim Dt As New DataTable + + Dt.Columns.Add("Descripcion", GetType(String)) + Dt.Columns.Add("Importe", GetType(Decimal)) + + Dim Dr1 As DataRow = Dt.NewRow + Dr1("Descripcion") = "Fondo de Caja" + Dr1("Importe") = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble + Dt.Rows.Add(Dr1) + + Dim Dr2 As DataRow = Dt.NewRow + Dr2("Descripcion") = "Ventas en Efectivo" + Dr2("Importe") = ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble + Dt.Rows.Add(Dr2) + + Dim Dr21 As DataRow = Dt.NewRow + Dr21("Descripcion") = "Devoluciones" + Dr21("Importe") = ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble + Dt.Rows.Add(Dr21) + + 'Dim Dr3 = Dt.NewRow + 'Dr3("Descripcion") = "Propinas" + 'Dr3("Importe") = ObjPVenta.DtResultados(0)("Propina").ToString().ToDouble + 'Dt.Rows.Add(Dr3) + + Dim Dr4 As DataRow = Dt.NewRow + Dr4("Descripcion") = "Entradas" + Dr4("Importe") = ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble + Dt.Rows.Add(Dr4) + + Dim Dr5 As DataRow = Dt.NewRow + Dr5("Descripcion") = "Salidas" + Dr5("Importe") = ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble + Dt.Rows.Add(Dr5) + + Dim Dr6 As DataRow = Dt.NewRow + Dr6("Descripcion") = "Total" + Dr6("Importe") = Total + Dt.Rows.Add(Dr6) + + GvDineroCaja.DataSource = Dt + GvDineroCaja.DataBind() + UpDineroCaja.Update() + UpTerminarCorte.Update() + + End If + End If + + ObjPVenta.Dispose() + End Sub - Private Sub CargaDatos() Dim ObjMovtos As New ClsMovimientos() @@ -276,6 +374,128 @@ Partial Class Ventas_PVCobranza End If Return Retorno - End Function - + End Function + + Protected Sub BtnCerrarCaja_Click(sender As Object, e As EventArgs) + RegistraScript("$('#DivEstadoCaja').modal('hide')") + RegistraScript("$('#DivTerminarCorte').modal()", "divterminarcorte") + End Sub + Protected Sub LkbIngreso_Click(sender As Object, e As EventArgs) + CargaIngresoEgreso(1) + End Sub + Public Sub CargaIngresoEgreso(Opcion As Integer) + RegistraScript("$('#DivIngresoEgreso').modal()") + If Opcion = 1 Then + LblTituloIE.Text = "Ingreso de Efectivo: " + HdnTipoMovimiento.Value = "1" + ElseIf Opcion = 0 Then + LblTituloIE.Text = "Retiro de Efectivo: " + HdnTipoMovimiento.Value = "0" + End If + UpIngresoEgreso.Update() + End Sub + Protected Sub LkbRetiro_Click(sender As Object, e As EventArgs) + CargaIngresoEgreso(0) + End Sub + + Private Sub LkbEstadodeCaja_Click(sender As Object, e As EventArgs) Handles LkbEstadodeCaja.Click + CargaDatosCorte() + CargaVentasPago() + CargaEntradasSalidas() + RegistraScript("$('#DivEstadoCaja').modal()") + End Sub + + Private Sub CargaVentasPago() + Dim ObjPVenta As New ClsPuntoVenta + + If ObjPVenta.GetVta_MetodosPago(CveCorte) Then + If ObjPVenta.DtResultados.Rows.Count > 0 Then + GvMetodosPago.DataSource = ObjPVenta.DtResultados + GvMetodosPago.DataBind() + UpMetodosPago.Update() + End If + End If + + ObjPVenta.Dispose() + End Sub + Private Sub CargaEntradasSalidas() + Dim ObjPVenta As New ClsPuntoVenta + + 'Salida + If ObjPVenta.GetVta_MovimientosCajas(CveCorte, 0) Then + If ObjPVenta.DtResultados.Rows.Count > 0 Then + GvEgresos.DataSource = ObjPVenta.DtResultados + GvEgresos.DataBind() + UpEgresos.Update() + End If + End If + + 'Entrada + If ObjPVenta.GetVta_MovimientosCajas(CveCorte, 1) Then + If ObjPVenta.DtResultados.Rows.Count > 0 Then + GvIngresos.DataSource = ObjPVenta.DtResultados + GvIngresos.DataBind() + UpIngresos.Update() + End If + End If + + ObjPVenta.Dispose() + End Sub + Private Sub BtnCerrarTurno_Click(sender As Object, e As EventArgs) Handles BtnCerrarTurno.Click + Dim ObjPVenta As New ClsPuntoVenta + If TxtEfectivoEnCaja.Text.Trim <> "" Then + If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then + RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir") + Dim Liga As String = "document.location.href=""/Ventas/PVCobranza.aspx"";" + Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga) + End If + End If + ObjPVenta.Dispose() + End Sub + Private Sub BtnCerrarBloqueo_Click(sender As Object, e As EventArgs) Handles BtnCerrarBloqueo.Click + Dim ObjPVenta As New ClsPuntoVenta + If TxtEfectivoCajaBloqueo.Text.Trim <> "" Then + If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then + RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir") + Dim Liga As String = "document.location.href=""/Ventas/PVCobranza.aspx"";" + Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga) + End If + Else + Alert("Debe especificar el efectivo en caja", TipoMensaje.MsgAdvertencia) + RegistraScript("window.onload = function MuestraPantallaBloqueo() { document.getElementById(""C_btnShowBloqueo"").click(); }") + End If + ObjPVenta.Dispose() + End Sub + Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click + Dim ObjPVenta As New ClsPuntoVenta + + ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa) + CveCorte = ObjPVenta.CveCorte + LblTurno.Text = NowADS().ToShortDateString + UpTurno.Visible = True + LkbEstadodeCaja.Visible = True + LkbIngreso.Visible = True + LkbRetiro.Visible = True + BtnIniciarTurno.Visible = False + + ObjPVenta.Dispose() + + RegistraScript("$('#DivCorteDeCaja').hide();") + + UpTurno.Update() + End Sub + + Private Sub BtnAceptarIE_Click(sender As Object, e As EventArgs) Handles BtnAceptarIE.Click + Dim ObjPVenta As New ClsPuntoVenta + If TxtCantidadIE.Text.ToEntero() > 0 Then + If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then + TxtCantidadIE.Text = "" + TxtDescripcionIE.Text = "" + RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso") + Alert("El movimiento se realizó correctamente") + UpIngresoEgreso.Update() + End If + End If + ObjPVenta.Dispose() + End Sub End Class From 81c93f48eeccd42905b7f5c575ba850f39771852 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 11 Jan 2024 18:24:42 -0700 Subject: [PATCH 21/29] =?UTF-8?q?Impresi=C3=B3n=20mini-printer=20directo?= =?UTF-8?q?=20pdf=20(ventas)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx | 34 ++++++++++++++++++++++++++++++++++ Ventas/Ventas.aspx.vb | 5 +++++ 2 files changed, 39 insertions(+) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 256ff61ab..f961c23e5 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -8547,6 +8547,40 @@