Clientes, Sunproyectos Precios de Lista Funcionalidad 404

This commit is contained in:
rakcsle
2023-12-26 17:15:52 -07:00
parent a879a49079
commit e5b0f0ff78
5 changed files with 275 additions and 183 deletions

View File

@@ -1976,7 +1976,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double) As Integer Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Vta_PrecioListaAdd") DataAdapter("PA_Vta_PrecioListaAdd")
@@ -1987,6 +1987,7 @@ Public Class ClsVentas
.Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista .Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada .Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
.Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar
.Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With

View File

@@ -402,8 +402,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group form-md-line-input input-iconright" runat="server"> <div class="form-group form-md-line-input input-iconright" runat="server" id="DVModalPrecioLista" visible="false">
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" DataTextField="PrecioLista" DataValueField="CvePrecioLista" CssClass="form-control select2me" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlPrecioLista" runat="server" CausesValidation="true" AppendDataBoundItems="true" DataTextField="PrecioLista" DataValueField="CvePrecioLista" CssClass="form-control select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlPrecioLista" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlPrecioLista"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lista de Precio''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlPrecioLista.ClientID.ToString()%>">Lista de Precio:</label> <label for="<%= DdlPrecioLista.ClientID.ToString()%>">Lista de Precio:</label>
</div> </div>
@@ -449,7 +452,7 @@
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="BtnGuardar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton> <asp:LinkButton ID="BtnGuardar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio" CausesValidation="true"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -92,6 +92,11 @@ Partial Class CatSubProyectos
DivSegmentoNegocio.Visible = True DivSegmentoNegocio.Visible = True
End If End If
BtnGuardar.OnClientClick = $"ValidaGuardar();" BtnGuardar.OnClientClick = $"ValidaGuardar();"
If UsuarioActual.Empresa.Funcionalidad(404) = "20" Then
DVModalPrecioLista.Visible = True
End If
End If End If
End Sub End Sub
@@ -285,6 +290,9 @@ Partial Class CatSubProyectos
End Sub End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs) Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Tab.ActiveTabIndex = 0
CveCentroCosto = (GvRow.DataKey("CveSubProyecto")).ToEntero CveCentroCosto = (GvRow.DataKey("CveSubProyecto")).ToEntero
HdnModalidad.Value = "U" HdnModalidad.Value = "U"
TxtCentroCosto.Text = (GvRow.DataKey("SubProyecto")) TxtCentroCosto.Text = (GvRow.DataKey("SubProyecto"))

View File

@@ -735,6 +735,9 @@
<div class="col-md-10"> <div class="col-md-10">
<div runat="server" class="form-group form-md-line-input input-iconright"> <div runat="server" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPrecioLista" runat="server" CssClass="form-control select2me" Width="100%" DataTextField="PrecioLista" DataValueField="CvePrecioLista"></asp:DropDownList> <asp:DropDownList ID="DdlPrecioLista" runat="server" CssClass="form-control select2me" Width="100%" DataTextField="PrecioLista" DataValueField="CvePrecioLista"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlPrecioLista" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlPrecioLista"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lista de Precio''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="<%= DdlPrecioLista.ClientID.ToString()%>">Precio Lista:</label> <label for="<%= DdlPrecioLista.ClientID.ToString()%>">Precio Lista:</label>
<i></i> <i></i>
</div> </div>

View File

@@ -2,6 +2,7 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.SqlClient
Imports System.Globalization Imports System.Globalization
Imports System.IO Imports System.IO
Imports System.Net Imports System.Net
@@ -12,9 +13,9 @@ Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq Imports Newtonsoft.Json.Linq
Partial Class Clientes Partial Class Clientes
Inherits ClsPaginas Inherits ClsPaginas
'Configuración 'Configuración
#Region "P R O P I E D A D E S" #Region "P R O P I E D A D E S"
Private Const NumeroDecimales As Integer = 2 Private Const NumeroDecimales As Integer = 2
Private CveVentaDeduccion As Integer Private CveVentaDeduccion As Integer
@@ -455,13 +456,13 @@ Partial Class Clientes
Set(value As DateTime) Set(value As DateTime)
ViewState("FechaIngLineaAdicional") = value ViewState("FechaIngLineaAdicional") = value
End Set End Set
End Property End Property
#End Region #End Region
#Region "Documentacion" #Region "Documentacion"
Private Property DTDocumentacion As DataTable Private Property DTDocumentacion As DataTable
Get Get
@@ -586,24 +587,24 @@ Partial Class Clientes
Set(value As Integer) Set(value As Integer)
ViewState("CveVendedorOriginal") = value ViewState("CveVendedorOriginal") = value
End Set End Set
End Property End Property
'Private ReadOnly Property CvePersonal As Integer 'Private ReadOnly Property CvePersonal As Integer
' Get ' Get
' If ViewState("CvePersonal") Is Nothing Then ' If ViewState("CvePersonal") Is Nothing Then
' Return -1 ' Return -1
' Else ' Else
' Return ViewState("CvePersonal").ToString().Toentero() ' Return ViewState("CvePersonal").ToString().Toentero()
' End If ' End If
' End Get ' End Get
'End Property 'End Property
#End Region #End Region
#Region " A C U M U L A D O R E S" #Region " A C U M U L A D O R E S"
Property CveVentaNota As Integer Property CveVentaNota As Integer
Get Get
@@ -643,10 +644,23 @@ Partial Class Clientes
Set(value As String) Set(value As String)
ViewState("SerieNotaAcumulador") = value ViewState("SerieNotaAcumulador") = value
End Set End Set
End Property End Property
#End Region #End Region
Property CvePrecioListaOriginal As Integer
Get
If ViewState("CvePrecioListaOriginal") Is Nothing Then
Return 0
Else
Return ViewState("CvePrecioListaOriginal").ToString().ToEntero()
End If
End Get
Set(value As Integer)
ViewState("CvePrecioListaOriginal") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -911,12 +925,12 @@ Partial Class Clientes
ChkPermiso5.Enabled = False ChkPermiso5.Enabled = False
ChkPermiso6.Enabled = False ChkPermiso6.Enabled = False
End Sub End Sub
#Region " PERMISOS PAGINAS " #Region " PERMISOS PAGINAS "
Private Sub MostrarTxtDireccionesClienteEnvio() Private Sub MostrarTxtDireccionesClienteEnvio()
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
@@ -953,15 +967,15 @@ Partial Class Clientes
If Not ChkEsDistribuidor.Checked Then If Not ChkEsDistribuidor.Checked Then
BtnGuardar.Visible = PermiteEditar() BtnGuardar.Visible = PermiteEditar()
End If End If
End Sub End Sub
#End Region #End Region
#Region "C A R G A S" #Region "C A R G A S"
Private Sub CreaDtPago() Private Sub CreaDtPago()
DtPagos = New DataTable DtPagos = New DataTable
DtPagos.Columns.Add("CveTipoMovimiento", GetType(String)) DtPagos.Columns.Add("CveTipoMovimiento", GetType(String))
@@ -1132,9 +1146,9 @@ Partial Class Clientes
Select Case HdnCuenta.Value Select Case HdnCuenta.Value
Case "1" Case "1"
CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).Toentero() CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).Toentero()
Case "2" Case "2"
CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).Toentero() CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).Toentero()
Case "3" Case "3"
CargaDdlCuentasContables(DdlCtaContableRetIVA, -1) CargaDdlCuentasContables(DdlCtaContableRetIVA, -1)
Case "4" Case "4"
@@ -1142,11 +1156,11 @@ Partial Class Clientes
Case "5" Case "5"
CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1) CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1)
Case "6" Case "6"
CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).Toentero() CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).Toentero()
Case "7" Case "7"
CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1) CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1)
Case "8" Case "8"
CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).Toentero() CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).Toentero()
Case "9" Case "9"
CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).Toentero() CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).Toentero()
End Select End Select
@@ -1231,7 +1245,7 @@ Partial Class Clientes
End If End If
UpDatos.Update()
End Sub End Sub
@@ -1452,7 +1466,8 @@ Partial Class Clientes
TxtNotificar.Text = ObjClientes.NotificarA TxtNotificar.Text = ObjClientes.NotificarA
TxtPagina.Text = ObjClientes.Pagina TxtPagina.Text = ObjClientes.Pagina
'TxtGiro.Text = ObjClientes.Giro 'TxtGiro.Text = ObjClientes.Giro
DdlPrecioLista.SelectedValue = ObjClientes.CvePrecioLista.ToString() DdlPrecioLista.SelectedValueExist(ObjClientes.CvePrecioLista.ToString())
CvePrecioListaOriginal = ObjClientes.CvePrecioLista
TxtCC.Text = ObjClientes.NotificarA TxtCC.Text = ObjClientes.NotificarA
ChkMail.Checked = ObjClientes.EnviarFactura ChkMail.Checked = ObjClientes.EnviarFactura
@@ -1997,11 +2012,11 @@ Partial Class Clientes
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
DdlSucursalUsoCFDI.DataBind() DdlSucursalUsoCFDI.DataBind()
UpFiscalContable.Update() UpFiscalContable.Update()
End Sub End Sub
#End Region #End Region
#Region "V E R M Á S" #Region "V E R M Á S"
Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs) Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs)
If BtnVerMasVentas.Text = "Ver Más" Then If BtnVerMasVentas.Text = "Ver Más" Then
CargaHistorial(-1) CargaHistorial(-1)
@@ -2031,12 +2046,12 @@ Partial Class Clientes
CargaBancos(51) CargaBancos(51)
BtnVerMasBancos.Text = "Ver Más" BtnVerMasBancos.Text = "Ver Más"
End If End If
End Sub End Sub
#End Region #End Region
#Region "B A N C O S" #Region "B A N C O S"
'CuentasxCobrar Activas (Pagos Recibidos) 'CuentasxCobrar Activas (Pagos Recibidos)
Private Sub CargaBancos(Optional SelectTop As Integer = 51, Optional CveClienteSucursal As Integer = -1) Private Sub CargaBancos(Optional SelectTop As Integer = 51, Optional CveClienteSucursal As Integer = -1)
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
'CxC Activas 'CxC Activas
@@ -2106,9 +2121,9 @@ Partial Class Clientes
TxtParaMail.Text = TxtCobranzaCorreo.Text TxtParaMail.Text = TxtCobranzaCorreo.Text
UpSendMail.Update() UpSendMail.Update()
RegistraScript("$('#ModalDivMail').modal('show');") RegistraScript("$('#ModalDivMail').modal('show');")
End Sub End Sub
#End Region #End Region
#Region "B T N ´ S" #Region "B T N ´ S"
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjClientes As New ClsClientes() Dim ObjClientes As New ClsClientes()
@@ -2483,7 +2498,7 @@ Partial Class Clientes
Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1)) Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1))
Dim GeneroCliente As Boolean = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False) Dim GeneroCliente As Boolean = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False)
Dim CvePrecioLista As Integer = DdlPrecioLista.SelectedValue.ToEntero()
'If DivCrearPrecioLista.Visible AndAlso ChkCrearPrecioLista.Checked Then 'If DivCrearPrecioLista.Visible AndAlso ChkCrearPrecioLista.Checked Then
' CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0) ' CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0)
@@ -2494,6 +2509,17 @@ Partial Class Clientes
' End If ' End If
'End If 'End If
If Not ErrorProceso AndAlso UsuarioActual.Empresa.Funcionalidad(404).Contiene("10", "30") Then
If DdlPrecioLista.SelectedValue.ToEntero.Contiene(-2, -3) Then
If Not AsignaLista(ObjClientes.IniciaTransacSQL) Then
ErrorProceso = True
Alert("Error al generar lista de precios.", TipoMensaje.MsgAdvertencia)
End If
End If
End If
Dim CvePrecioLista As Integer = DdlPrecioLista.SelectedValue.ToEntero()
If Not ErrorProceso Then If Not ErrorProceso Then
'VERIFICA SI ES CLIENTE NUEVO O ACTUALIZACION 'VERIFICA SI ES CLIENTE NUEVO O ACTUALIZACION
If Me.CveCliente = -1 Then If Me.CveCliente = -1 Then
@@ -2614,6 +2640,7 @@ Partial Class Clientes
If ErrorProceso Then If ErrorProceso Then
ObjClientes.RollBack() ObjClientes.RollBack()
CargaPrecioLista()
Alert("Ocurrió un error al guardar.", TipoMensaje.MsgError) Alert("Ocurrió un error al guardar.", TipoMensaje.MsgError)
Else Else
ObjClientes.Commit() ObjClientes.Commit()
@@ -2694,11 +2721,11 @@ Partial Class Clientes
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "G L O B L A L" #Region "G L O B L A L"
Private Sub RecargaGlobal() Private Sub RecargaGlobal()
@@ -2707,10 +2734,10 @@ Partial Class Clientes
Private Sub GeneraGlobalDT() Private Sub GeneraGlobalDT()
GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
End Sub End Sub
#End Region #End Region
#Region "G R I D V I E W S" #Region "G R I D V I E W S"
Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -2851,11 +2878,11 @@ Partial Class Clientes
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "R H" #Region "R H"
Private Sub CargaPersonalAsignado() Private Sub CargaPersonalAsignado()
Dim ObjPersonal As New ClsRH Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, CveCliente, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, CveCliente, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
@@ -2928,9 +2955,9 @@ Partial Class Clientes
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "S U C U R S A L E S" #Region "S U C U R S A L E S"
Private Sub LbAgregarSucursal_Click(sender As Object, e As EventArgs) Handles LbAgregarSucursal.Click Private Sub LbAgregarSucursal_Click(sender As Object, e As EventArgs) Handles LbAgregarSucursal.Click
ChkEstatusSucursal.Checked = True ChkEstatusSucursal.Checked = True
@@ -3062,7 +3089,7 @@ Partial Class Clientes
UpModalDivMapa.Update() UpModalDivMapa.Update()
End Sub End Sub
#Region "G V S U C U R S A L E S" #Region "G V S U C U R S A L E S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVSucursales.RowDataBound Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVSucursales.RowDataBound
@@ -3184,9 +3211,9 @@ Partial Class Clientes
Else Else
CargaGrid("", 0) CargaGrid("", 0)
End If End If
End Sub End Sub
#End Region #End Region
#Region "G V U S U A R I O S P O R T A L" #Region "G V U S U A R I O S P O R T A L"
Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand
If e.CommandName = "RestablecerContraseña" Then If e.CommandName = "RestablecerContraseña" Then
@@ -3338,9 +3365,9 @@ Partial Class Clientes
CargaGrid("", 1) CargaGrid("", 1)
End If End If
End Sub End Sub
#End Region #End Region
#Region "O R D E N A M I E N T O" #Region "O R D E N A M I E N T O"
Private Sub CargaGrid(Orden As String, gvi As Integer) Private Sub CargaGrid(Orden As String, gvi As Integer)
If gvi = 0 Then If gvi = 0 Then
@@ -3372,12 +3399,12 @@ Partial Class Clientes
UPPUsuarios.Update() UPPUsuarios.Update()
End If End If
End Sub End Sub
#End Region #End Region
#End Region #End Region
#Region "U S U A R I O S" #Region "U S U A R I O S"
Protected Sub LbSolicitudPortal_Click(sender As Object, e As EventArgs) Handles LbEnviarActivacionPortal.Click Protected Sub LbSolicitudPortal_Click(sender As Object, e As EventArgs) Handles LbEnviarActivacionPortal.Click
Dim ObjUsuario As New ClsSisUsuarios Dim ObjUsuario As New ClsSisUsuarios
@@ -3559,9 +3586,9 @@ Partial Class Clientes
ChkPermiso5.Checked = False ChkPermiso5.Checked = False
ChkPermiso6.Checked = False ChkPermiso6.Checked = False
ChkPermiso7.Checked = False ChkPermiso7.Checked = False
End Sub End Sub
#End Region #End Region
#Region "E V E N T O - B I T A C O R A" #Region "E V E N T O - B I T A C O R A"
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -5216,9 +5243,9 @@ Partial Class Clientes
End If End If
Return Retorno Return Retorno
End Function End Function
#End Region #End Region
#Region "GPS" #Region "GPS"
Protected Sub btnCargaArrayDisp_Click(sender As Object, e As EventArgs) Handles btnCargaArrayDisp.Click Protected Sub btnCargaArrayDisp_Click(sender As Object, e As EventArgs) Handles btnCargaArrayDisp.Click
If hdnArrayDispositivo.Value.Length > 0 Then If hdnArrayDispositivo.Value.Length > 0 Then
@@ -5359,10 +5386,10 @@ Partial Class Clientes
UpMoverDispositivo.Update() UpMoverDispositivo.Update()
RegistraScript($"CargaModalMoverDispositivo({GvRow.DataKey("CveDispositivo")});") RegistraScript($"CargaModalMoverDispositivo({GvRow.DataKey("CveDispositivo")});")
End Sub End Sub
#End Region #End Region
#Region "Sucursales" #Region "Sucursales"
Public Sub CreaDTSucursales() Public Sub CreaDTSucursales()
@@ -5653,14 +5680,14 @@ Partial Class Clientes
End If End If
UpDatos.Update() UpDatos.Update()
End Sub End Sub
#End Region #End Region
#Region "G P S" #Region "G P S"
Private Sub EnviaCorreoGPS(Liga As String, LigaActivar As String) Private Sub EnviaCorreoGPS(Liga As String, LigaActivar As String)
Try Try
@@ -5731,16 +5758,16 @@ Partial Class Clientes
End If End If
ObjClientes.Dispose() ObjClientes.Dispose()
End Sub End Sub
#End Region #End Region
#Region "C O N T R A T O S" #Region "C O N T R A T O S"
Private Sub CargaDatosContrato() Private Sub CargaDatosContrato()
If CveCliente <= 0 Then If CveCliente <= 0 Then
Exit Sub Exit Sub
@@ -5785,10 +5812,10 @@ Partial Class Clientes
e.Row.CssClass = "Totales white" e.Row.CssClass = "Totales white"
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "M E T O D O S " #Region "M E T O D O S "
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged
If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then
@@ -6172,12 +6199,12 @@ Partial Class Clientes
Else Else
Alert("No hay saldo pendiente del cliente. Por lo cual no se envió el mensaje.", TipoMensaje.MsgInformacion) Alert("No hay saldo pendiente del cliente. Por lo cual no se envió el mensaje.", TipoMensaje.MsgInformacion)
End If End If
End Sub End Sub
#End Region #End Region
#Region "IMPRIMIR GVHistorial" #Region "IMPRIMIR GVHistorial"
Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs) Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
Dim retorno As Byte() = Nothing Dim retorno As Byte() = Nothing
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -6251,18 +6278,18 @@ Partial Class Clientes
ObjClientes.Dispose() ObjClientes.Dispose()
Return retorno Return retorno
End Function End Function
#End Region #End Region
#Region "C O B R A N Z A" #Region "C O B R A N Z A"
Public Sub Visitas_Click(sender As Object, e As EventArgs) Public Sub Visitas_Click(sender As Object, e As EventArgs)
RegistraScript(String.Format("$('#{0}').modal();", "DivVisitas")) RegistraScript(String.Format("$('#{0}').modal();", "DivVisitas"))
End Sub End Sub
#End Region #End Region
#Region "Usuarios" #Region "Usuarios"
Protected Sub GvUsuarios_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting Protected Sub GvUsuarios_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting
Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero() Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero()
@@ -6298,12 +6325,12 @@ Partial Class Clientes
e.Row.Cells(5).Visible = False e.Row.Cells(5).Visible = False
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "C U E N T A S - B A N C A R I A S" #Region "C U E N T A S - B A N C A R I A S"
Private Sub CargaCuentasBancarias(Optional RecargaGlobal As Boolean = False) Private Sub CargaCuentasBancarias(Optional RecargaGlobal As Boolean = False)
If CveCliente <= 0 Then Exit Sub If CveCliente <= 0 Then Exit Sub
@@ -6475,8 +6502,8 @@ Partial Class Clientes
TxtNumeroCuenta2.Text = "" TxtNumeroCuenta2.Text = ""
TxtConvenioCIE2.Text = "" TxtConvenioCIE2.Text = ""
TxtReferencia2.Text = "" TxtReferencia2.Text = ""
End Sub End Sub
#Region "GRIDVIEW - CUENTAS BANCARIAS" #Region "GRIDVIEW - CUENTAS BANCARIAS"
Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -6527,10 +6554,10 @@ Partial Class Clientes
GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, -1) = Nothing GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, -1) = Nothing
End If End If
End Sub End Sub
#End Region #End Region
Private Sub CargaPSGridCuentasBancos() Private Sub CargaPSGridCuentasBancos()
If CveCliente > 0 Then If CveCliente > 0 Then
GvBancosCuentas.DataSource = DTCuentasBancos GvBancosCuentas.DataSource = DTCuentasBancos
@@ -6584,9 +6611,9 @@ Partial Class Clientes
divestatus.Visible = True divestatus.Visible = True
UpAddBancos.Update() UpAddBancos.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddCuentasBancarias")) RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddCuentasBancarias"))
End Sub End Sub
#End Region #End Region
#Region "C L I E N T E S P A G O S R E A L I Z A D O S I M P R I M I R P D F/Excel" #Region "C L I E N T E S P A G O S R E A L I Z A D O S I M P R I M I R P D F/Excel"
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click
GenerarPDF("Excel") GenerarPDF("Excel")
@@ -6608,11 +6635,11 @@ Partial Class Clientes
ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & NowADS().ToString("yyyyMMddhhmmss"), Formato:=Formato) ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & NowADS().ToString("yyyyMMddhhmmss"), Formato:=Formato)
End Sub End Sub
#End Region #End Region
#Region "VENTAS" #Region "VENTAS"
Public Function imprimirFacturaVenta(CveVenta As Integer) As Byte() Public Function imprimirFacturaVenta(CveVenta As Integer) As Byte()
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing Dim Vta As Modelos.Factura = Nothing
@@ -6843,10 +6870,10 @@ Partial Class Clientes
ObjVentas.Dispose() ObjVentas.Dispose()
Return PdfFactura(Vta) Return PdfFactura(Vta)
End Function End Function
#End Region #End Region
#Region "COMERCIO EXTERIOR" #Region "COMERCIO EXTERIOR"
Public Sub CargaCombosComercioExterior() Public Sub CargaCombosComercioExterior()
@@ -6970,12 +6997,12 @@ Partial Class Clientes
End Sub End Sub
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaColonia() CargaColonia()
End Sub End Sub
#End Region #End Region
#Region "D O C U M E N T A C I O N " #Region "D O C U M E N T A C I O N "
Private Sub CargaDocumentacionCliente() Private Sub CargaDocumentacionCliente()
Dim objRH As New ClsEdocumentacion() Dim objRH As New ClsEdocumentacion()
@@ -7577,12 +7604,12 @@ Partial Class Clientes
RegistraScript("Download('" & baseUrl & "')") RegistraScript("Download('" & baseUrl & "')")
End Sub End Sub
#End Region #End Region
#Region "D O C U M E N T O S V E N T A S" #Region "D O C U M E N T O S V E N T A S"
Private Sub CargaDocumentosVenta(tCveCliente As Integer) Private Sub CargaDocumentosVenta(tCveCliente As Integer)
Dim objInv As New ClsEdocumentacion Dim objInv As New ClsEdocumentacion
@@ -7750,11 +7777,11 @@ Partial Class Clientes
objRH.Dispose() objRH.Dispose()
End Sub End Sub
#End Region #End Region
#Region "PERSONA FISICA" #Region "PERSONA FISICA"
Protected Sub LnkPersonaFisica_Click(sender As Object, e As EventArgs) Protected Sub LnkPersonaFisica_Click(sender As Object, e As EventArgs)
RegistraScript("$('#DivModalPersonaFisica').modal();") RegistraScript("$('#DivModalPersonaFisica').modal();")
@@ -7779,9 +7806,9 @@ Partial Class Clientes
ObjCliente.Dispose() ObjCliente.Dispose()
UpDatos.Update() UpDatos.Update()
End Sub End Sub
#End Region #End Region
#Region "USUARIOS PLATAFORMA CLIENTE - 6 " #Region "USUARIOS PLATAFORMA CLIENTE - 6 "
Protected Sub CargaUsuariosPortalCliente() Protected Sub CargaUsuariosPortalCliente()
Dim objUsuario As ClsSisUsuarios = New ClsSisUsuarios Dim objUsuario As ClsSisUsuarios = New ClsSisUsuarios
@@ -7790,19 +7817,19 @@ Partial Class Clientes
GvUsuarios.DataBind() GvUsuarios.DataBind()
End If End If
objUsuario.Dispose() objUsuario.Dispose()
End Sub End Sub
#End Region #End Region
#Region " DEVOLVER DINERO ANT/NC " #Region " DEVOLVER DINERO ANT/NC "
Private Sub InicializaDevolverDinero() Private Sub InicializaDevolverDinero()
If UsuarioActual.TienePermisoProceso(247) Then If UsuarioActual.TienePermisoProceso(247) Then
GVAnticipos.Columns(6).Visible = True GVAnticipos.Columns(6).Visible = True
End If End If
End Sub End Sub
#End Region #End Region
#Region "MODAL GRAFICA/PEDIDOS" #Region "MODAL GRAFICA/PEDIDOS"
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs) Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
If CargaDatatables() Then If CargaDatatables() Then
RegistraScript("$('#DivModalGrafica').modal('show')") RegistraScript("$('#DivModalGrafica').modal('show')")
@@ -8139,13 +8166,13 @@ Partial Class Clientes
RegistraScript($"CargaGraficaCompratamientoSaldoMensual({Dt5.ToJson},{Dt6.ToJson.Replace($"{Chr(34)}True{Chr(34)}", "true").Replace($"{Chr(34)}False{Chr(34)}", "false")})", "55") RegistraScript($"CargaGraficaCompratamientoSaldoMensual({Dt5.ToJson},{Dt6.ToJson.Replace($"{Chr(34)}True{Chr(34)}", "true").Replace($"{Chr(34)}False{Chr(34)}", "false")})", "55")
UPModalProd.Update() UPModalProd.Update()
End Sub End Sub
#End Region #End Region
#Region "TAB - COMPORTAMIENTO DE VENTAS" #Region "TAB - COMPORTAMIENTO DE VENTAS"
Private Sub CargaGrupo() Private Sub CargaGrupo()
DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3")) DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3"))
DdlGrupo.Items.Insert(1, New ListItem("Clasificacion", "4")) DdlGrupo.Items.Insert(1, New ListItem("Clasificacion", "4"))
@@ -8262,12 +8289,12 @@ Partial Class Clientes
ObjVentas.Dispose() ObjVentas.Dispose()
GvComportamientoVenta.DataBind() GvComportamientoVenta.DataBind()
UpDatosComportamientoVenta.Update() UpDatosComportamientoVenta.Update()
End Sub End Sub
#End Region #End Region
#Region "DISPOSITIVOS" #Region "DISPOSITIVOS"
Protected Sub LnkMoverDispositivo_Click(sender As Object, e As EventArgs) Protected Sub LnkMoverDispositivo_Click(sender As Object, e As EventArgs)
Dim CveDispositivo As Integer = HdnCveDispositivoMover.Value.ToEntero() Dim CveDispositivo As Integer = HdnCveDispositivoMover.Value.ToEntero()
Dim CveCliente As Integer = DdlClienteDispositivo.SelectedValue.ToEntero() Dim CveCliente As Integer = DdlClienteDispositivo.SelectedValue.ToEntero()
@@ -8305,10 +8332,10 @@ Partial Class Clientes
CargaEventoBitacora() CargaEventoBitacora()
NombreDispositivo = "" NombreDispositivo = ""
RegistraScript("$('#DivMoverDispositivo').modal('hide');") RegistraScript("$('#DivMoverDispositivo').modal('hide');")
End Sub End Sub
#End Region #End Region
#Region "CRM" #Region "CRM"
Protected Sub CargaDatosCRM() Protected Sub CargaDatosCRM()
Dim ObjCRM As New ClsCRM() Dim ObjCRM As New ClsCRM()
@@ -8408,9 +8435,9 @@ Partial Class Clientes
Alert("Se Unificó correctamente al Cliente con la Empresa CRM.") Alert("Se Unificó correctamente al Cliente con la Empresa CRM.")
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "PORCENTAJE PRECIO DE MARCAS" #Region "PORCENTAJE PRECIO DE MARCAS"
Private Sub LnkPorcentajeMarcas_Click(sender As Object, e As EventArgs) Handles LnkPorcentajeMarcas.Click Private Sub LnkPorcentajeMarcas_Click(sender As Object, e As EventArgs) Handles LnkPorcentajeMarcas.Click
RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajeMarcas")) RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajeMarcas"))
@@ -8635,9 +8662,9 @@ Partial Class Clientes
ObjPS.Dispose() ObjPS.Dispose()
End Sub End Sub
#End Region #End Region
#Region "PORCENTAJE PRECIO DE PRODUCTOS" #Region "PORCENTAJE PRECIO DE PRODUCTOS"
Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click
RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios")) RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios"))
@@ -9509,11 +9536,11 @@ Partial Class Clientes
' ObjFactura.Timbre = PreParaTimbre(ObjFactura) ' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
End Sub End Sub
#End Region #End Region
#Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel" #Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel"
Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click
ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones") ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones")
@@ -9582,7 +9609,7 @@ Partial Class Clientes
Alert("Puntuación Inicializada") Alert("Puntuación Inicializada")
End If End If
Acum.Dispose() Acum.Dispose()
End Sub End Sub
#End Region #End Region
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
@@ -10300,25 +10327,75 @@ Partial Class Clientes
RegistraScript("$('#DivAgregarPrecioLista').modal('show');") RegistraScript("$('#DivAgregarPrecioLista').modal('show');")
End Sub End Sub
Protected Sub BtnGuardarPL_Click(sender As Object, e As EventArgs) Protected Sub BtnGuardarPL_Click(sender As Object, e As EventArgs)
Dim ObjVentas As New ClsVentas()
Dim CvePrecioListaNuevo As Integer = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, False, 0) LimpiaItemsListaPrecion()
If CvePrecioListaNuevo > 0 Then
Alert("La lista de precio se guardo correctamente") If DdlPrecioListaClonar.SelectedValue.ToEntero > 0 Then
RegistraScript("$('#DivAgregarPrecioLista').modal('hide');") DdlPrecioLista.Items.Add(New ListItem(TxtPrecioLista.Text, "-3"))
DdlPrecioLista.SelectedValueExist("-3")
Else Else
Alert("Ocurrió un error al guardar la lista de precio", TipoMensaje.MsgError) DdlPrecioLista.Items.Add(New ListItem(TxtPrecioLista.Text, "-2"))
DdlPrecioLista.SelectedValueExist("-2")
End If
'Alert("La lista de precio se guardo correctamente")
UpDatos.Update()
RegistraScript("$('#DivAgregarPrecioLista').modal('hide');")
End Sub
Private Sub LimpiaItemsListaPrecion()
DdlPrecioLista.SelectedValue = Nothing
DdlPrecioLista.ClearSelection()
For i As Integer = DdlPrecioLista.Items.Count - 1 To 0 Step -1
If DdlPrecioLista.Items(i).Value.Contiene("-2", "-3") Then
DdlPrecioLista.Items.RemoveAt(i)
End If
Next
End Sub
Private Function AsignaLista(ByRef transaccionSQL As SqlTransaction) As Boolean
Dim respuesta As Boolean = True
Dim CvePrecioListaClonar As Integer = -1
If DdlPrecioLista.SelectedValue.ToEntero = -3 Then 'Clñonar
CvePrecioListaClonar = DdlPrecioListaClonar.SelectedValue.ToEntero
End If
Dim ObjVentas As New ClsVentas(transaccionSQL)
Dim CvePrecioListaNuevo As Integer = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, False, 0, CvePrecioListaClonar:=CvePrecioListaClonar)
If Not CvePrecioListaNuevo > 0 Then
respuesta = False
End If End If
'RECARGA GLOBAL DE LISTA DE PRECIOS SI SE GENERO UNO NUEVO 'RECARGA GLOBAL DE LISTA DE PRECIOS SI SE GENERO UNO NUEVO
If CvePrecioListaNuevo > 0 Then If CvePrecioListaNuevo > 0 Then
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
If ObjVentas.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVentas.DtResultados
Else
DdlPrecioLista.DataSource = Nothing
End If
CargaPrecioLista() DdlPrecioLista.DataBind()
DdlPrecioLista.Items.Insert(0, New ListItem(" - ", "-1"))
'CargaPrecioLista()
DdlPrecioLista.SelectedValueExist(CvePrecioListaNuevo) DdlPrecioLista.SelectedValueExist(CvePrecioListaNuevo)
End If End If
UpDatos.Update() UpDatos.Update()
End Sub
Return respuesta
End Function
End Class End Class