--Al crear/actualizar ps, precios, clientes a la otra empresa FUNC 563
This commit is contained in:
@@ -890,6 +890,32 @@ Public Class ClsClientes
|
||||
' Return Retorno
|
||||
'End Function
|
||||
|
||||
Public Function UpdateClienteFranquicia(CveCliente As Integer, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_ClientesFranquiciaUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveEmpresaActual", SqlDbType.Int).Value = CveEmpresaActual
|
||||
.Add("@CveEmpresaFranquicia", SqlDbType.Int).Value = CveEmpresaFranquicia
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 2627;") Then
|
||||
Alert("El Cliente no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al intentar Actualizar los datos del Cliente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al intentar Actualizar los datos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateClientePersonaFisica(CveCliente As Integer, ApellidoPaterno As String, ApellidoMaterno As String, Nombres As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
|
||||
@@ -2052,7 +2052,7 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
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
|
||||
Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1, Optional UpdateFranquicia As Boolean = False) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
|
||||
DataAdapter("PA_Vta_PrecioListaAdd")
|
||||
@@ -2064,6 +2064,7 @@ Public Class ClsVentas
|
||||
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
||||
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
||||
.Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar
|
||||
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -2084,7 +2085,7 @@ Public Class ClsVentas
|
||||
End Function
|
||||
|
||||
Public Function UpdatePrecioLista(PrecioLista As String, Estatus As Boolean, CveUsuario As Integer, Porcentaje As Double,
|
||||
Predeterminada As Boolean, CvePrecioLista As Integer) As Boolean
|
||||
Predeterminada As Boolean, CvePrecioLista As Integer, Optional UpdateFranquicia As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_PrecioListaUpdate")
|
||||
@@ -2096,6 +2097,7 @@ Public Class ClsVentas
|
||||
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
||||
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -65,25 +65,44 @@ Partial Class Ventas_CatPreciosLista
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim ObjVta As New ClsVentas
|
||||
Dim ActualizarFranquicias As Boolean = False
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, ChkPredeterminada.Checked, 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)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If ObjVta.UpdatePrecioLista(TxtPrecioLista.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, 0, ChkPredeterminada.Checked, CvePrecioLista) Then
|
||||
Alert("El Precio de Lista se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar al Precio de Lista", TipoMensaje.MsgError)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
ActualizarFranquicias = True
|
||||
End If
|
||||
|
||||
Dim ObjVta As New ClsVentas
|
||||
ObjVta.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
Try
|
||||
If EsEditar = 0 Then
|
||||
If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, ChkPredeterminada.Checked, 0, UpdateFranquicia:=ActualizarFranquicias) > 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)
|
||||
TieneError = True
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If ObjVta.UpdatePrecioLista(TxtPrecioLista.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, 0, ChkPredeterminada.Checked, CvePrecioLista, UpdateFranquicia:=ActualizarFranquicias) Then
|
||||
Alert("El Precio de Lista se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar al Precio de Lista", TipoMensaje.MsgError)
|
||||
TieneError = True
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
GuardaLog(ex.ToString())
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjVta.RollBack()
|
||||
Else
|
||||
ObjVta.Commit()
|
||||
End If
|
||||
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
|
||||
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
ObjVta.Dispose()
|
||||
@@ -94,6 +113,7 @@ Partial Class Ventas_CatPreciosLista
|
||||
UpDatos.Update()
|
||||
UpBodyCo.Update()
|
||||
|
||||
RecargaGlobal()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
@@ -105,6 +125,8 @@ Partial Class Ventas_CatPreciosLista
|
||||
ObjPrecioLista.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
|
||||
RecargaGlobal()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
@@ -131,155 +153,158 @@ Partial Class Ventas_CatPreciosLista
|
||||
dvEstatus.Visible = False
|
||||
UpBodyCo.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
Private Sub RecargaGlobal()
|
||||
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
|
||||
#Region "VIEJO"
|
||||
' Public Property PuedeEliminar As Boolean
|
||||
' Get
|
||||
' Return CBool(ViewState("PuedeEditar"))
|
||||
' End Get
|
||||
' Set(value As Boolean)
|
||||
' ViewState("PuedeEditar") = value
|
||||
' End Set
|
||||
' End Property
|
||||
|
||||
' Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
' If Not Page.IsPostBack Then
|
||||
|
||||
' CargaDatos()
|
||||
|
||||
' 'Permiso Registro
|
||||
' If UsuarioActual.TienePermisoProceso(132) Then LbAgregar.Enabled = True Else LbAgregar.Enabled = False
|
||||
|
||||
' 'Permiso Eliminar
|
||||
' If UsuarioActual.TienePermisoProceso(134) Then GvDatos.Columns(5).Visible = True Else GvDatos.Columns(6).Visible = False
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Private Sub CargaDatos()
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.GetPrecioListas(CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
' GvDatos.DataSource = ObjListas.DtResultados
|
||||
' GvDatos.DataBind()
|
||||
' Else
|
||||
' Me.GvDatos.DataSource = Nothing
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
' Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
' Dim ObjListas As New ClsVentas
|
||||
|
||||
' If HdnModalidad.Value = "I" Then
|
||||
' If ObjListas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text.Trim, TxtPorcentaje.Text.Trim.ToDouble) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La nueva Lista se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' ObjListas.Dispose()
|
||||
' Else
|
||||
' If HdnID.Value.ToEntero <> -1 Then
|
||||
' If ObjListas.UpdatePrecioLista(TxtPrecioLista.Text.Trim, True, UsuarioActual.CveUsuario, TxtPorcentaje.Text.Trim.ToDouble, HdnID.Value.ToEntero) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La lista se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End Sub
|
||||
|
||||
'#Region "G V D A T O S"
|
||||
' Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
' Dim URL As String = String.Format("javascript:CleanObjects();SetValue('HdnModalidad', 'U');SetValue('HdnID', '{0}'); SetObjects('{1}','{2}');ShowDivRegistro();return false;", e.Row.DBCampo("CvePrecioLista").ToEntero, e.Row.DBCampo("PrecioLista"), e.Row.DBCampo("Porcentaje"))
|
||||
|
||||
' 'GeneroLigas
|
||||
' Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
|
||||
' e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
' e.Row.FCLinkButton("ImgE").OnClientClick = URL
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
' Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.RemovePrecioLista(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("La Lista se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
' Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' Dim PrecioLista As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPrecioLista"), TextBox).Text.Trim
|
||||
' Dim Porcentaje As Double = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPorcentaje"), TextBox).Text.Trim.ToDouble
|
||||
' Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
' Dim CvePrecioLista As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
' If ObjListas.UpdatePrecioLista(PrecioLista, Estatus, UsuarioActual.CveUsuario, Porcentaje, CvePrecioLista) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
'#End Region
|
||||
|
||||
|
||||
'#Region " O R D E N A M I E N T O JAVASCRIPT"
|
||||
' Private Sub OrdenaDatos()
|
||||
' If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
' End If
|
||||
' End Sub
|
||||
'#End Region
|
||||
|
||||
|
||||
|
||||
' Private Sub OcultaDiv()
|
||||
' ScriptManager.RegisterStartupScript(Me, Me.GetType, "Llave", "HideDivRegistro();", True)
|
||||
' End Sub
|
||||
' Public Property PuedeEliminar As Boolean
|
||||
' Get
|
||||
' Return CBool(ViewState("PuedeEditar"))
|
||||
' End Get
|
||||
' Set(value As Boolean)
|
||||
' ViewState("PuedeEditar") = value
|
||||
' End Set
|
||||
' End Property
|
||||
|
||||
' Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
' If Not Page.IsPostBack Then
|
||||
|
||||
' CargaDatos()
|
||||
|
||||
' 'Permiso Registro
|
||||
' If UsuarioActual.TienePermisoProceso(132) Then LbAgregar.Enabled = True Else LbAgregar.Enabled = False
|
||||
|
||||
' 'Permiso Eliminar
|
||||
' If UsuarioActual.TienePermisoProceso(134) Then GvDatos.Columns(5).Visible = True Else GvDatos.Columns(6).Visible = False
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Private Sub CargaDatos()
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.GetPrecioListas(CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
' GvDatos.DataSource = ObjListas.DtResultados
|
||||
' GvDatos.DataBind()
|
||||
' Else
|
||||
' Me.GvDatos.DataSource = Nothing
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
' Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
' Dim ObjListas As New ClsVentas
|
||||
|
||||
' If HdnModalidad.Value = "I" Then
|
||||
' If ObjListas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text.Trim, TxtPorcentaje.Text.Trim.ToDouble) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La nueva Lista se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' ObjListas.Dispose()
|
||||
' Else
|
||||
' If HdnID.Value.ToEntero <> -1 Then
|
||||
' If ObjListas.UpdatePrecioLista(TxtPrecioLista.Text.Trim, True, UsuarioActual.CveUsuario, TxtPorcentaje.Text.Trim.ToDouble, HdnID.Value.ToEntero) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La lista se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End Sub
|
||||
|
||||
'#Region "G V D A T O S"
|
||||
' Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
' Dim URL As String = String.Format("javascript:CleanObjects();SetValue('HdnModalidad', 'U');SetValue('HdnID', '{0}'); SetObjects('{1}','{2}');ShowDivRegistro();return false;", e.Row.DBCampo("CvePrecioLista").ToEntero, e.Row.DBCampo("PrecioLista"), e.Row.DBCampo("Porcentaje"))
|
||||
|
||||
' 'GeneroLigas
|
||||
' Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
|
||||
' e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
' e.Row.FCLinkButton("ImgE").OnClientClick = URL
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
' Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.RemovePrecioLista(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("La Lista se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
' Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' Dim PrecioLista As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPrecioLista"), TextBox).Text.Trim
|
||||
' Dim Porcentaje As Double = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPorcentaje"), TextBox).Text.Trim.ToDouble
|
||||
' Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
' Dim CvePrecioLista As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
' If ObjListas.UpdatePrecioLista(PrecioLista, Estatus, UsuarioActual.CveUsuario, Porcentaje, CvePrecioLista) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
'#End Region
|
||||
|
||||
|
||||
'#Region " O R D E N A M I E N T O JAVASCRIPT"
|
||||
' Private Sub OrdenaDatos()
|
||||
' If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
' End If
|
||||
' End Sub
|
||||
'#End Region
|
||||
|
||||
|
||||
|
||||
' Private Sub OcultaDiv()
|
||||
' ScriptManager.RegisterStartupScript(Me, Me.GetType, "Llave", "HideDivRegistro();", True)
|
||||
' End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -781,7 +781,7 @@ Partial Class Clientes
|
||||
|
||||
'JM 05-02-19: CRM
|
||||
'If UsuarioActual.Empresa.UsaCRM Then
|
||||
If GlobalDTCRMTipoProceso(UsuarioActual.CveEmpresa).Rows.Count > 0 Then
|
||||
If GlobalDTCRMTipoProceso(UsuarioActual.CveEmpresa) IsNot Nothing AndAlso GlobalDTCRMTipoProceso(UsuarioActual.CveEmpresa).Rows.Count > 0 Then
|
||||
VerificaVinculacion()
|
||||
UpAccionesCRM.Update()
|
||||
End If
|
||||
@@ -2618,6 +2618,10 @@ Partial Class Clientes
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not ErrorProceso AndAlso UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
ErrorProceso = Not ActualizarClienteFranquicia(ObjClientes, CveClienteNuevo)
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
@@ -2671,6 +2675,10 @@ Partial Class Clientes
|
||||
If Not ErrorProceso AndAlso Not GuardarDocumentosClientes(objDoc, Me.CveCliente) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
If Not ErrorProceso AndAlso UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
ErrorProceso = Not ActualizarClienteFranquicia(ObjClientes, Me.CveCliente)
|
||||
End If
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
@@ -2773,6 +2781,23 @@ Partial Class Clientes
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function ActualizarClienteFranquicia(ByRef ObjClientes As ClsClientes, CveClienteRef As Integer) As Boolean
|
||||
Dim TieneError As Boolean = False
|
||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
|
||||
Dim Franquicias As String() = FranquiciasStr.Split(","c)
|
||||
|
||||
For Each Franquicia As String In Franquicias
|
||||
Dim CveEmpresaFranquicia As Integer = Franquicia.ToEntero
|
||||
If Not ObjClientes.UpdateClienteFranquicia(CveClienteRef, UsuarioActual.CveEmpresa, CveEmpresaFranquicia) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Not TieneError
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
@@ -3194,7 +3194,7 @@ Partial Class ProductosyServicios
|
||||
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
|
||||
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
|
||||
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv,
|
||||
EsPaquete, DdlSATPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
|
||||
EsPaquete, DdlSATPS.SelectedValue.ToEntero, CveEmpresaFranquicia, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
|
||||
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
|
||||
CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, IEPSGrabaIVA:=ChkIepsIVA.Checked,
|
||||
VentaMinima:=TxtVentaMinima.Text.ToDecimal, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, RetISR:=(TxtRetISR.Text.Trim.ToDouble / 100), PrecioMinimo:=TxtPrecioMinimo.Text.ToDecimal,
|
||||
|
||||
Reference in New Issue
Block a user