diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ba9ec7593..71e703a33 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9372,6 +9372,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepIndicadoresPorProyecto.aspx".ToUpper(), 617) PaginaDict.Add("/Ventas/CatMedicos.aspx".ToUpper(), 1343) PaginaDict.Add("/Ventas/CatProcedimientos.aspx".ToUpper(), 1344) + PaginaDict.Add("/Ventas/CatProcedimientoDetalle.aspx".ToUpper(), 1344) PaginaDict.Add("/Ventas/VentasMedicas.aspx".ToUpper(), 1345) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index e8c7de4e4..0b0e7d59d 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1976,8 +1976,8 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Porcentaje As Double) As Boolean - Dim Retorno As Boolean = False + Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Porcentaje As Double) As Integer + Dim Retorno As Integer = -1 DataAdapter("PA_Vta_PrecioListaAdd") @@ -1986,19 +1986,20 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje + .Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output End With Try SqlAdapter.Fill(Data) - Retorno = True + Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrecioLista").Value.ToString.ToEntero Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") Then - Alert("Ya existe una Lista con el mismo Nombre: " & PrecioLista & ".", TipoMensaje.MsgAdvertencia) + Alert("Ya existe una lista con el mismo Nombre: " & PrecioLista & ".", TipoMensaje.MsgAdvertencia) Else - Me.OnError("Ocurrió un error al Guardar la Lista.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al guardar la lista.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If Catch ex As Exception - OnError("Ocurrió un error al la Lista", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al la lista", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno @@ -6100,22 +6101,25 @@ Public Class ClsVentas End Function - Public Function AddProcedimiento(Procedimiento As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddProcedimiento(Procedimiento As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Integer - Dim Retorno As Boolean = False + Dim Retorno As Integer = -1 DataAdapter("PA_Vta_ProcedimientosAdd") With SqlAdapter.SelectCommand.Parameters .Add("@Procedimiento", SqlDbType.VarChar).Value = Procedimiento .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveProcedimiento", SqlDbType.Int).Direction = ParameterDirection.Output End With Try SqlAdapter.Fill(Data) - Retorno = True + Retorno = SqlAdapter.SelectCommand.Parameters("@CveProcedimiento").Value.ToString.ToEntero + Catch ex As Exception OnError("Ocurrió un error al guardar el Procedimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try + Return Retorno End Function @@ -6149,9 +6153,17 @@ Public Class ClsVentas .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With + Try SqlAdapter.Fill(Data) + 'SqlAdapter.SelectCommand.ExecuteNonQuery() Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 547;") Then + Alert("El procedimiento no se pudo eliminar porque está siendo usado por un registro.", TipoMensaje.MsgAdvertencia) + Else + OnError("Ocurrió un error al eliminar el Procedimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If Catch ex As Exception OnError("Ocurrió un error al eliminar el Procedimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try @@ -6159,6 +6171,135 @@ Public Class ClsVentas End Function + + Public Function AddProcedimientoProducto(CveProcedimiento As Integer, CvePS As Integer, Autogenerado As Boolean, Estatus As Boolean, CveUsuario As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProcedimientosProductosAdd") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Autogenerado", SqlDbType.Bit).Value = Autogenerado + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al guardar el producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + + Public Function UpdateProcedimientoProducto(CveProcedimientoProducto As Integer, CvePS As Integer, Autogenerado As Boolean, Estatus As Boolean, CveUsuario As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProcedimientosProductosUpdate") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProcedimientoProducto", SqlDbType.Int).Value = CveProcedimientoProducto + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Autogenerado", SqlDbType.Bit).Value = Autogenerado + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + + Public Function SincronizacionProcedimientoProducto(CveProcedimiento As Integer, CveVenta As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProcedimientosProductosSincronizacion") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al sincronizar los Productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + Public Function GetProcedimientoProducto(CveProcedimiento As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProcedimientosProductosGet") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + Public Function RemoveProcedimientoProducto(CveProcedimientoProducto As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProcedimientosProductosRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProcedimientoProducto", SqlDbType.Int).Value = CveProcedimientoProducto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar los Productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + + + + Public Function GetProcedimientoVentas(CveProcedimiento As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProcedimientosVentasGet") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las ventas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + + End Function + + #End Region diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index a2f96e165..9fa7ffa8d 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -440,7 +440,7 @@
+ DataKeyNames="CvePrePolizaDetalle,CvePrePoliza,IdMov, CveConceptoContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra, CveProveedor, CveCliente, CvePersonal, CveCuenta, PorcentajeImpuesto,TipoMovto,EsComplementaria,EsMonedaExtranjera,Concepto,CveClasificacion,ContadoCuenta,ContadoTipoTransaccion,ContadoNumeroFolio,ContadoBeneficiario,ContadoObservaciones,ContadoImporte,TC,ImporteME,ImporteMN,Cargo,Abono,CveIE" Width="100%" > Movimiento diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 0073d92ad..40ef9cbe7 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -553,17 +553,17 @@ Partial Class ContabilidadC_RegPrePolizaS Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero - If CveConceptoContable.Contiene(1, 2, 12, 91, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 293, 294, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) - If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206, 323, 324, 341, 342, 343, 344, 304, 272, 259, 287, 288) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) - If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) - If CveConceptoContable.Contiene(30, 204, 66, 92, 202, 10, 21, 48, 56, 338, 339, 340, 345, 346, 347) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) + If CveConceptoContable.Contiene(1, 2, 12, 91, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 293, 294, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) + If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206, 323, 324, 341, 342, 343, 344, 304, 272, 259, 287, 288) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) + If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) + If CveConceptoContable.Contiene(30, 204, 66, 92, 202, 10, 21, 48, 56, 338, 339, 340, 345, 346, 347) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) - If e.Row.DBCampo("Modificado") = "True" Then - e.Row.FCCheckBox("chkModificado").Checked = True - End If - End If + If e.Row.DBCampo("Modificado") = "True" Then + e.Row.FCCheckBox("chkModificado").Checked = True + End If + End If - If e.Row.RowType = DataControlRowType.Header Then + If e.Row.RowType = DataControlRowType.Header Then 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind() 'e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1")) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 6bc4593c9..9781087fd 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -5522,9 +5522,10 @@ Partial Class Inventarios_EntradasSalidas End If End If + Else + ErrorMovInv = True End If End If - Catch ex As Exception ErrorMovInv = True End Try diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 1bb3a4ea3..a0c94bd2c 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -771,7 +771,7 @@ Partial Class Inventarios_EntregaAlmacen Dim Filtro As String '= If(ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString().Contiene({"Ing", "Dev", "Ped"}), "CveConcepto = 3", "CveConcepto = 9") Dim FiltroPS As String = "" Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString() - Case "Ing", "Ped" + Case "Ing" Filtro = "CveConcepto IN (3,40)" Case "Dev" 'cuand es devolucionventa=1, es cancelación de la devolución diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx index fbf6c963d..cf6a2dbd4 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx +++ b/Inventarios/PopUpExistenciasAlmacen.aspx @@ -1,156 +1,159 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpExistenciasAlmacen.aspx.vb" Inherits="Inventarios_Default" %> - -<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Filtros para búsqueda
Producto/Servicio: - - - - - - - -
Medida: - - -
- - - - - - - - - -
-
Rin: - - - -
C. Barras: - - - - - - - - -
Sucursal: - -
Compuesto: - -
- -
-
-
- - - - -
-
-
+<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpExistenciasAlmacen.aspx.vb" Inherits="Inventarios_Default" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Filtros para búsqueda
Producto/Servicio: + + + + + + + +
Medida: + + +
+ + + + + + + + + +
+
Rin: + +
Lista de precio: + +
C. Barras: + + + + + + + +
Sucursal: + +
Compuesto: + +
+ +
+
+
+ + + +
+
+
     - + +      - + +    - -      - + + +      + +   - - -
-
- -
-
-
-
- - - - - - - - - -<%-- - --%> - - -
-
- - - - <%----%> + + + +
+
+ +
+
+
+
+ + + + + + + + + + + +
+
+ + + @@ -158,13 +161,10 @@ - - <%----%> - <%-- --%> - - - - <%----%> + + + + @@ -172,7 +172,7 @@ - + @@ -180,111 +180,88 @@ - - + + - +
-
-
-
-
-
-
-
-
- - - - - + + + - - - - -
- + + - - + + + diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb index d12d6cc59..956d566e3 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb +++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb @@ -44,6 +44,17 @@ Partial Class Inventarios_Default If UsuarioActual.CveEmpresa.Contiene(119) Then LtPrecioPS.Visible = True DivSucursal.Visible = True + End If + + If UsuarioActual.CveEmpresa.Contiene(119) Then + LtPrecioPS.Visible = True + DivSucursal.Visible = True + End If + + + If UsuarioActual.CveEmpresa.Contiene(186) Then + LtPrecioPS.Visible = True + DivListasPrecios.Visible = True End If If UsuarioActual.CveRol = 1 Then @@ -83,6 +94,10 @@ Partial Class Inventarios_Default Dim Txt As String = IfNull(Request("Txt"), "").ToString If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt) + If UsuarioActual.CveEmpresa = 186 Then + CargaListasPrecios() + End If + End Sub Private Sub CargaSubProyecto() DdlSubProyecto.Items.Clear() @@ -94,6 +109,13 @@ Partial Class Inventarios_Default End Sub + Private Sub CargaListasPrecios() + DdlPrecioLista.DataSource = GlobalDTPrecioListas(UsuarioActual.CveEmpresa) + DdlPrecioLista.DataBind() + DdlPrecioLista.Items.Insert(0, New ListItem("-", "-1")) + + End Sub + Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then CargarDatosMedRin() @@ -150,6 +172,14 @@ Partial Class Inventarios_Default CvePrecioLista = -2 End If + If UsuarioActual.CveEmpresa = 186 Then + If DdlPrecioLista.SelectedValue.ToEntero() > 0 Then + CvePrecioLista = DdlPrecioLista.SelectedValue.ToEntero() + Else + CvePrecioLista = -2 + End If + End If + Dim ObjVta As New ClsVentas Dim objPS As New ClsProductosServicios If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then diff --git a/Transportes/CrearViaje.aspx b/Transportes/CrearViaje.aspx new file mode 100644 index 000000000..6dd2878c9 --- /dev/null +++ b/Transportes/CrearViaje.aspx @@ -0,0 +1,124 @@ +<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeFile="CrearViaje.aspx.vb" + Inherits="CrearViaje" %> + + + + Crear Viaje + + + + + +
+ +
+
+ + + + + + + +
+
+ +
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+
+ +
+
+ + + + + +
+
+
+ + +
+
+ +
diff --git a/Transportes/CrearViaje.aspx.vb b/Transportes/CrearViaje.aspx.vb new file mode 100644 index 000000000..c64594b95 --- /dev/null +++ b/Transportes/CrearViaje.aspx.vb @@ -0,0 +1,65 @@ +Partial Class CrearViaje + Inherits ClsPaginas + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not IsPostBack Then + CargaDatos() + End If + End Sub + + Private Sub CargaDatos() + 'Lista Activos Fijos' + Dim ObjAF As New ClsAF() + If ObjAF.GetActivosFijos(-1, 13, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, 1, "-1", -1, -1, -1) Then + If ObjAF.DtResultados.Rows.Count > 0 Then + DdlTransporte.DataSource = ObjAF.DtResultados + DdlTransporte.DataBind() + + DdlTransporte.Items.Insert(0, New ListItem("<--Seleccione Transporte-->", "")) + End If + End If + ObjAF.Dispose() + + 'Lista Rutas' + Dim ObjRutas As New ClsRH() + If ObjRutas.GetRutas(7) Then + Page.Response.Write("") + + If ObjRutas.DtResultados.Rows.Count > 0 Then + DdlRutas.DataSource = ObjRutas.DtResultados + DdlRutas.DataBind() + DdlRutas.Items.Insert(0, New ListItem("<--Seleccione Ruta-->", "")) + + DdlPartida.DataSource = ObjRutas.DtResultados + DdlPartida.DataBind() + DdlPartida.Items.Insert(0, New ListItem("<--Seleccione Partida-->", "")) + + DdlDestino.DataSource = ObjRutas.DtResultados + DdlDestino.DataBind() + DdlDestino.Items.Insert(0, New ListItem("<--Seleccione Destino-->", "")) + + End If + End If + ObjRutas.Dispose() + + 'Lista Chofer' + 'GlobalDTRHPersonal()' + 'CvePersonal - Text Nombre COmpleto' + Dim ObjAcar As New ClsAcarreos() + If ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1) Then + DdlChofer.DataSource = ObjAcar.DtResultados + DdlChofer.DataBind() + DdlChofer.Items.Insert(0, New ListItem("<--Seleccione Chofer-->", "")) + End If + ObjAcar.Dispose() + End Sub + + Protected Sub AddViaje(sender As Object, e As EventArgs) + 'Dónde están los PA para agregar viajes?' + 'Dónde están los PA para consultar Destinos y rutas viajes?' + 'Por qué siempre cambia el aside de Transportes V&A?' + Page.Response.Write("") + End Sub + +End Class \ No newline at end of file diff --git a/Ventas/CatPreciosLista.aspx.vb b/Ventas/CatPreciosLista.aspx.vb index cc62aeb6d..ef7b2f5c4 100644 --- a/Ventas/CatPreciosLista.aspx.vb +++ b/Ventas/CatPreciosLista.aspx.vb @@ -45,10 +45,8 @@ Partial Class Ventas_CatPreciosLista GvDatos.DataSource = Nothing End If ObjVta.Dispose() - GvDatos.DataBind() - - GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing - + GvDatos.DataBind() + End Sub Protected Sub imgE_Click(sender As Object, e As EventArgs) @@ -69,7 +67,7 @@ Partial Class Ventas_CatPreciosLista Dim ObjVta As New ClsVentas If EsEditar = 0 Then - If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0) Then + If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0) > 0 Then Alert("El Precio de Lista se agregó correctamente", TipoMensaje.MsgInformacion) Else Alert("Ocurrió un error al agregar el Precio de Lista", TipoMensaje.MsgError) @@ -84,6 +82,8 @@ Partial Class Ventas_CatPreciosLista dvEstatus.Visible = False BtnAgregarCatalogo.Text = "Agregar" End If + GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing + RegistraScript("$('#divAgregar').modal('hide')") ObjVta.Dispose() TxtPrecioLista.Text = "" diff --git a/Ventas/CatProcedimientoDetalle.aspx b/Ventas/CatProcedimientoDetalle.aspx new file mode 100644 index 000000000..34d26b50e --- /dev/null +++ b/Ventas/CatProcedimientoDetalle.aspx @@ -0,0 +1,260 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProcedimientoDetalle.aspx.vb" Inherits="Ventas_CatProcedimientoDetalle" %> + + + + + + + + + + + + + + + +
  • + +
  • + +
    +
    + +
    + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + General +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " class="btn btn-circle btn-sm label-info"> +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " class="btn btn-circle btn-sm label-info"> +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + +
    +
    + + + + + +
    + + + + + +
    + +
    +
    + + + + + + + + + +
    + + + diff --git a/Ventas/CatProcedimientoDetalle.aspx.vb b/Ventas/CatProcedimientoDetalle.aspx.vb new file mode 100644 index 000000000..d666e49bd --- /dev/null +++ b/Ventas/CatProcedimientoDetalle.aspx.vb @@ -0,0 +1,299 @@ +Imports System.Data +Imports System.Drawing +Imports Extensiones +Imports Microsoft.Owin.Security.Provider +Imports Microsoft.Reporting.WebForms +Partial Class Ventas_CatProcedimientoDetalle + Inherits ClsPaginas +#Region "Propiedades" + Private Property CveProcedimiento As Integer + Get + + If ViewState("CveProcedimiento") Is Nothing Then + ViewState("CveProcedimiento") = -1 + End If + + Return ViewState("CveProcedimiento").ToString.ToEntero + + End Get + Set(value As Integer) + ViewState("CveProcedimiento") = value + End Set + End Property + + Private Property CveProcedimientoProducto As Integer + Get + + If ViewState("CveProcedimientoProducto") Is Nothing Then + ViewState("CveProcedimientoProducto") = -1 + End If + + Return ViewState("CveProcedimientoProducto").ToString.ToEntero + + End Get + Set(value As Integer) + ViewState("CveProcedimientoProducto") = 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 + + CveProcedimiento = If(Request("CveProcedimiento") <> "", Request("CveProcedimiento").ToString.ToEntero, "-1".ToEntero) + + If CveProcedimiento > 0 Then + + CargaDatos() + CargaProductos() + CargaVentas() + TabProductos.Visible = True + TabVentas.Visible = True + LnkAgregarProducto.Visible = True + Else + ChkEstatus.Checked = True + End If + + DdlProducto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + + If Not DdlProducto.UsaWebService AndAlso CType(DdlProducto.DataSource, DataTable) Is Nothing Then + DdlProducto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2") + DdlProducto.DataBind() + DdlProducto.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + + End If + End Sub + + Private Sub CargaVentas() + + + Dim objVenta As New ClsVentas + + If objVenta.GetProcedimientoVentas(CveProcedimiento, UsuarioActual.CveEmpresa) Then + GvVentas.DataSource = objVenta.DtResultados + End If + + objVenta.Dispose() + + GvVentas.DataBind() + + UpTabVentas.Update() + End Sub + + Private Sub CargaDatos() + + + If CveProcedimiento > 0 Then + + Dim DTProcedimiento As New DataTable + Dim Objeto As New ClsVentas + If Objeto.GetProcedimientos(CveProcedimiento, UsuarioActual.CveEmpresa, -1) Then + + DTProcedimiento = Objeto.DtResultados + + If DTProcedimiento.Rows.Count > 0 Then + LblProcedimiento.Text = DTProcedimiento.FiltroPrimeroValor("Procedimiento") + TxtProcedimiento.Text = DTProcedimiento.FiltroPrimeroValor("Procedimiento") + + ChkEstatus.Checked = Boolean.Parse(DTProcedimiento.FiltroPrimeroValor("Estatus")) + + LblFecha.Text = DTProcedimiento.FiltroPrimeroValor("FechaIng").ToDate.ToShortDateString + LblUsuario.Text = DTProcedimiento.FiltroPrimeroValor("Usuario") + Else + Dim Liga As String = $"document.location.href=""/Ventas/CatProcedimientos.aspx"";" + Alert("El Procedimiento solicitado no existe.", TipoMensaje.MsgAdvertencia, Liga) + End If + + Objeto.Dispose() + End If + Else + + LblFechaAlta.Visible = False + LblUsuarioAlta.Visible = False + + End If + + + End Sub + + + + Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + + Dim ProcesoOK = False + Dim ObjVentas As New ClsVentas + + + If CveProcedimiento > 0 Then + If ObjVentas.UpdateProcedimiento(CveProcedimiento, TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert($"Procedimiento Actualizado Correctamente.") + ProcesoOK = True + End If + Else + + CveProcedimiento = ObjVentas.AddProcedimiento(TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveProcedimiento > 0 Then + ProcesoOK = True + TabProductos.Visible = True + TabVentas.Visible = True + LnkAgregarProducto.Visible = True + UpDatos.Update() + Alert($"Procedimiento Guardado Correctamente.") + End If + + End If + + ObjVentas.Dispose() + + If ProcesoOK Then + + 'RegistraScript("$('#DVAgregarProcedimiento').modal('hide');") + CargaDatos() + CargaGlobal() + UpDatos.Update() + End If + + End Sub + + Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) + + 'Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + 'CveProcedimiento = GvRow.DataKey("CveProcedimiento").ToEntero + + Dim ObjVentas As New ClsVentas + Dim ProcesoOK = False + + If ObjVentas.RemoveProcedimiento(CveProcedimiento, UsuarioActual.CveEmpresa) Then + ProcesoOK = True + End If + + ObjVentas.Dispose() + + + If ProcesoOK Then + CargaGlobal() + Dim Liga As String = $"document.location.href=""/Ventas/CatProcedimientos.aspx"";" + Alert("Procedimiento eliminando correctamente.", TipoMensaje.MsgInformacion, Liga) + End If + End Sub + + + Private Sub CargaGlobal() + GlobalDTProcedimientos(UsuarioActual.CveEmpresa) = Nothing + End Sub + + Protected Sub LnkAgregarProducto_Click() Handles LnkAgregarProducto.Click + + limpiarModal() + UpAgregar.Update() + RegistraScript("$('#ModalAgregar').modal()") + + End Sub + + Private Sub limpiarModal() + + LtlTituloAgregar.Text = "Agregar Producto" + CveProcedimientoProducto = -1 + DdlProducto.SelectedValue = "-1" + DdlProducto.SelectedText = "" + DVProdcutoEstatus.Visible = False + UpAgregar.Update() + + End Sub + + Protected Sub LkAgregarProducto_Click(sender As Object, e As EventArgs) + + Dim ProcesoOK As Boolean = False + + Dim objVenta As New ClsVentas + + If CveProcedimientoProducto > 0 Then + + If objVenta.UpdateProcedimientoProducto(CveProcedimientoProducto, DdlProducto.SelectedValue.ToEntero, False, True, UsuarioActual.CveUsuario) Then + ProcesoOK = True + End If + + Else + + If objVenta.AddProcedimientoProducto(CveProcedimiento, DdlProducto.SelectedValue.ToEntero, False, True, UsuarioActual.CveUsuario) Then + ProcesoOK = True + End If + + End If + + objVenta.Dispose() + + If ProcesoOK Then + RegistraScript("$('#ModalAgregar').modal('hide')") + + Alert($"Producto {If(CveProcedimientoProducto > 0, "actualizado", "agregado")} correctamente.") + + CargaProductos() + End If + + End Sub + + Private Sub CargaProductos() + + Dim objVenta As New ClsVentas + + If objVenta.GetProcedimientoProducto(CveProcedimiento, -1, UsuarioActual.CveEmpresa) Then + GvProductos.DataSource = objVenta.DtResultados + End If + + objVenta.Dispose() + + GvProductos.DataBind() + + UpTabProductos.Update() + + End Sub + + Protected Sub LnkEditarProducto_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + CveProcedimientoProducto = GvRow.DataKey("CveProcedimientoProducto").ToEntero + Dim CvePS As String = GvRow.DataKey("CvePS") + Dim CodigoPS As String = GvRow.DataKey("CodigoPS") + Dim Estatus As Boolean = Boolean.Parse(GvRow.DataKey("Estatus")) + + DdlProducto.ddl.SelectedValueExist(CvePS) + DdlProducto.txtText.Value = CodigoPS + DdlProducto.txtValue.Value = CvePS + ChkEstatusProducto.Checked = Estatus + LtlTituloAgregar.Text = "Actualizar producto" + + DVProdcutoEstatus.Visible = True + UpAgregar.Update() + + RegistraScript("$('#ModalAgregar').modal()") + + End Sub + + Protected Sub LnkEliminarProducto_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim CveProcedimientoProductoEliminar = GvRow.DataKey("CveProcedimientoProducto").ToEntero + + Dim ObjVentas As New ClsVentas + Dim ProcesoOK = False + + If ObjVentas.RemoveProcedimientoProducto(CveProcedimientoProductoEliminar, UsuarioActual.CveEmpresa) Then + ProcesoOK = True + End If + + ObjVentas.Dispose() + + If ProcesoOK Then + Alert("Producto eliminando correctamente.") + CargaProductos() + End If + + End Sub + + +End Class diff --git a/Ventas/CatProcedimientos.aspx b/Ventas/CatProcedimientos.aspx index d50048c14..90624dd83 100644 --- a/Ventas/CatProcedimientos.aspx +++ b/Ventas/CatProcedimientos.aspx @@ -17,7 +17,8 @@
  • - + Agregar Procedimiento
  • @@ -34,44 +35,47 @@
    -
    - - - +
    + + + + + + <%-- - - - - - - - + --%> - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
    diff --git a/Ventas/CatProcedimientos.aspx.vb b/Ventas/CatProcedimientos.aspx.vb index aeffa4613..038380e6e 100644 --- a/Ventas/CatProcedimientos.aspx.vb +++ b/Ventas/CatProcedimientos.aspx.vb @@ -56,7 +56,7 @@ Partial Class Ventas_CatProcedimientos ProcesoOK = True End If Else - If ObjVentas.AddProcedimiento(TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjVentas.AddProcedimiento(TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then ProcesoOK = True End If End If diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index a66330e2e..cb1ce56b8 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -7,6 +7,43 @@