481 lines
23 KiB
VB.net
481 lines
23 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports System.Linq
|
|
Imports Extensiones
|
|
|
|
Partial Class CatClasificaciones
|
|
Inherits ClsPaginas
|
|
|
|
#Region " PROPIEDADES "
|
|
Private Property DtCuentasContables As Data.DataTable
|
|
Get
|
|
Return CType(ViewState("DtCuentasContables"), DataTable)
|
|
End Get
|
|
Set(value As Data.DataTable)
|
|
ViewState("DtCuentasContables") = value
|
|
End Set
|
|
End Property
|
|
Public Property DtCuentas As DataTable
|
|
Get
|
|
Return CType((ViewState("DtCuentas")), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DtCuentas") = value
|
|
End Set
|
|
End Property
|
|
Private Property CveCuentaGastoActual As Integer
|
|
Get
|
|
Return CType(ViewState("CveCuentaGastoActual"), Integer)
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveCuentaGastoActual") = value
|
|
End Set
|
|
End Property
|
|
Private Property CargaGastos As Boolean
|
|
Get
|
|
Return CType(ViewState("CargaGastos"), Boolean)
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("CargaGastos") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveCuentaIngresoActual As Integer
|
|
Get
|
|
Return CType(ViewState("CveCuentaIngresoActual"), Integer)
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveCuentaIngresoActual") = value
|
|
End Set
|
|
End Property
|
|
Private Property CargaIngresos As Boolean
|
|
Get
|
|
Return CType(ViewState("CargaIngresos"), Boolean)
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("CargaIngresos") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private Property CveCuentaCostoActual As Integer
|
|
Get
|
|
Return CType(ViewState("CveCuentaCostoActual"), Integer)
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveCuentaCostoActual") = value
|
|
End Set
|
|
End Property
|
|
Private Property CargaCostos As Boolean
|
|
Get
|
|
Return CType(ViewState("CargaCostos"), Boolean)
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("CargaCostos") = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
|
|
CargaGastos = True
|
|
CargaCostos = True
|
|
CargaIngresos = True
|
|
DtCuentasContables = Nothing
|
|
|
|
CargaDdlSATPS()
|
|
CargaDDLs()
|
|
|
|
DdlCategoriaFiltro.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
|
DdlCategoriaFiltro.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
DdlCategoriaFiltro.DataBind()
|
|
|
|
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
|
DdlCategoria.DataBind()
|
|
|
|
'' 16/03/2018 - se mueve validacion de la culumna a Personaliza Columna
|
|
If UsuarioActual.CveEmpresa.Contiene(80, 72) Then
|
|
DivRequiereSerieLote.Visible = True
|
|
'GvDatos.Columns(5).Visible = True
|
|
TDReqSerie.Visible = True
|
|
Else
|
|
DivRequiereSerieLote.Visible = False
|
|
'GvDatos.Columns(5).Visible = False
|
|
TDReqSerie.Visible = False
|
|
End If
|
|
UpModalClasif.Update()
|
|
|
|
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
|
|
|
|
''COMENTADO DF 30 JUNIO 2017
|
|
'Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
|
|
'If Cuenta.GetCuentas(-1, "-1", 1, 20000) Then
|
|
' DtCuentas = Cuenta.DtResultados
|
|
'End If
|
|
'Cuenta.Dispose()
|
|
Else
|
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
|
DivCuentaIngresos.Visible = False
|
|
DivCuentaCostos.Visible = False
|
|
DivCuentaGasto.Visible = False
|
|
|
|
GvDatos.Columns(1).Visible = False
|
|
GvDatos.Columns(2).Visible = False
|
|
GvDatos.Columns(3).Visible = False
|
|
End If
|
|
|
|
End If
|
|
|
|
DdlCuentaGasto.Items.Insert(0, New ListItem("-", "-1"))
|
|
DdlCuentaCostos.Items.Insert(0, New ListItem("-", "-1"))
|
|
DdlCuentaIngresos.Items.Insert(0, New ListItem("-", "-1"))
|
|
|
|
CargaDatos()
|
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then ' Funcionalidad Es Distribuidor
|
|
DivEsAcumulador.Visible = True
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub CargaDatos()
|
|
Dim ObjClasificaciones As New ClsClasificaciones
|
|
If ObjClasificaciones.GetClasificaciones() Then
|
|
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
|
|
Else
|
|
Me.GvDatos.DataSource = Nothing
|
|
End If
|
|
ObjClasificaciones.Dispose()
|
|
CargaGrid()
|
|
End Sub
|
|
|
|
'Public Sub CargaGlobal()
|
|
|
|
' Dim ObjClasificaciones As New ClsClasificaciones
|
|
|
|
' If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
|
|
' ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
|
|
' GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
|
|
' Else
|
|
' Me.GvDatos.DataSource = Nothing
|
|
' Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
' End If
|
|
|
|
' ObjClasificaciones.Dispose()
|
|
'End Sub
|
|
|
|
|
|
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
|
Dim ObjClasificaciones As New ClsClasificaciones
|
|
Dim RequireSerieLote As Integer = If(ChkRequiereSerieLote.Checked, 1, 0)
|
|
|
|
If HdnModalidadClasificacion.Value = "A" Then
|
|
If ObjClasificaciones.AddClasificaciones(TxtClasificacion.Text.Trim, "",
|
|
DdlCuentaGasto.SelectedValue.ToEntero, DdlCuentaGasto.SelectedItem.Text,
|
|
DdlCuentaCostos.SelectedValue.ToEntero, DdlCuentaCostos.SelectedItem.Text,
|
|
DdlCuentaIngresos.SelectedValue.ToEntero, DdlCuentaIngresos.SelectedItem.Text,
|
|
DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero,
|
|
RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then
|
|
|
|
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
|
|
|
|
TxtClasificacion.Text = ""
|
|
TxtPrecioBaseCosto.Text = ""
|
|
DdlCuentaGasto.SelectedValueExist("0")
|
|
DdlCuentaCostos.SelectedValueExist("0")
|
|
DdlCuentaIngresos.SelectedValueExist("0")
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
|
|
Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
|
|
ElseIf HdnModalidadClasificacion.Value = "U" Then
|
|
Dim Clasificacion As String = TxtClasificacion.Text
|
|
Dim Estatus As Boolean = ChkEstatus.Checked
|
|
Dim CveClasificacion As Integer = HdnIDClasificacion.Value.ToEntero
|
|
Dim DdlGasto As DropDownList = DdlCuentaGasto
|
|
Dim DdlCosto As DropDownList = DdlCuentaCostos
|
|
Dim DdlIngresos As DropDownList = DdlCuentaIngresos
|
|
|
|
If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text,
|
|
DdlCosto.SelectedValue.ToEntero, DdlCosto.SelectedItem.Text, DdlIngresos.SelectedValue.ToEntero, DdlIngresos.SelectedItem.Text,
|
|
Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero,
|
|
RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then
|
|
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
|
|
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
|
|
|
Else
|
|
Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
End If
|
|
End If
|
|
|
|
GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
|
|
ObjClasificaciones.Dispose()
|
|
CargaDatos()
|
|
|
|
UpDatos.Update()
|
|
UpModalClasif.Update()
|
|
End Sub
|
|
|
|
|
|
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
|
|
|
|
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
|
|
|
|
Dim ObjEmpresa As New ClsSisEmpresas
|
|
Dim Empresa As Empresa = Nothing
|
|
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
|
Empresa = ObjEmpresa.Empresa
|
|
Dim ObjContabilidad As New ClsContPAQi(Empresa)
|
|
If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then
|
|
DtCuentasContables = ObjContabilidad.DtResultados
|
|
End If
|
|
ObjContabilidad.Dispose()
|
|
End If
|
|
ObjEmpresa.Dispose()
|
|
ElseIf UsuarioActual.Empresa.TipoContabilizacion = 2 Then
|
|
DdlCuentaGasto.DataValueField = "CveCuenta"
|
|
DdlCuentaGasto.DataTextField = "Cuenta"
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
|
|
Select Case HdnCuenta.Value
|
|
Case "1"
|
|
If DdlCuentaGasto.Attributes("onclick") <> "" And DtCuentasContables Is Nothing Then CargaCuentasContables(If(UsuarioActual.Empresa.Funcionalidad(216).ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(216).ToEntero, -1))
|
|
DdlCuentaGasto.Items.Clear() : DdlCuentaGasto.Items.Add(New ListItem("-", "-1"))
|
|
DdlCuentaGasto.DataSource = DtCuentasContables : DdlCuentaGasto.DataBind()
|
|
DdlCuentaGasto.AutoPostBack = False : DdlCuentaGasto.Attributes.Remove("onclick") : DdlCuentaGasto.CssClass &= " select2me" : UpModalClasif.Update()
|
|
DdlCuentaGasto.SelectedValueExist(CveCuentaGastoActual)
|
|
Case "2"
|
|
If DdlCuentaCostos.Attributes("onclick") <> "" And DtCuentasContables Is Nothing Then CargaCuentasContables(If(UsuarioActual.Empresa.Funcionalidad(216).ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(216).ToEntero, -1))
|
|
DdlCuentaCostos.Items.Clear() : DdlCuentaCostos.Items.Add(New ListItem("-", "-1"))
|
|
DdlCuentaCostos.DataSource = DtCuentasContables : DdlCuentaCostos.DataBind()
|
|
DdlCuentaCostos.AutoPostBack = False : DdlCuentaCostos.Attributes.Remove("onclick") : DdlCuentaCostos.CssClass &= " select2me" : UpModalClasif.Update()
|
|
DdlCuentaCostos.SelectedValueExist(CveCuentaCostoActual)
|
|
Case "3"
|
|
If DdlCuentaIngresos.Attributes("onclick") <> "" And DtCuentasContables Is Nothing Then CargaCuentasContables(If(UsuarioActual.Empresa.Funcionalidad(216).ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(216).ToEntero, -1))
|
|
DdlCuentaIngresos.Items.Clear() : DdlCuentaIngresos.Items.Add(New ListItem("-", "-1"))
|
|
DdlCuentaIngresos.DataSource = DtCuentasContables : DdlCuentaIngresos.DataBind()
|
|
DdlCuentaIngresos.AutoPostBack = False : DdlCuentaIngresos.Attributes.Remove("onclick") : DdlCuentaIngresos.CssClass &= " select2me" : UpModalClasif.Update()
|
|
DdlCuentaIngresos.SelectedValueExist(CveCuentaIngresoActual)
|
|
End Select
|
|
End Sub
|
|
|
|
|
|
Public Sub CargaDDLs()
|
|
If UsuarioActual.Empresa.UsaContabilidad Then
|
|
DdlCuentaGasto.AutoPostBack = True
|
|
DdlCuentaCostos.AutoPostBack = True
|
|
DdlCuentaIngresos.AutoPostBack = True
|
|
|
|
DdlCuentaGasto.Attributes.Add("onclick", "CargaCuentas(1);")
|
|
DdlCuentaCostos.Attributes.Add("onclick", "CargaCuentas(2);")
|
|
DdlCuentaIngresos.Attributes.Add("onclick", "CargaCuentas(3);")
|
|
UpModal.Update()
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub CargaDdlSATPS()
|
|
DdlSATPS.setEsWebService(True)
|
|
DdlSATPS.Attributes.Add("data-metodo", "getpssat")
|
|
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.Header Then
|
|
e.Row.Cells(5).Text = "<Label data-html='true' data-toggle='tooltip' data-placement='top' title='<b>Requiere Serie</b>'><b>Req. Serie</b><Label>"
|
|
End If
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(200)
|
|
e.Row.Cells(1).Width = Unit.Pixel(120)
|
|
e.Row.Cells(2).Width = Unit.Pixel(120)
|
|
e.Row.Cells(3).Width = Unit.Pixel(135)
|
|
|
|
e.Row.Cells(4).Width = Unit.Pixel(70)
|
|
e.Row.Cells(5).Width = Unit.Pixel(75)
|
|
e.Row.Cells(6).Width = Unit.Pixel(80)
|
|
e.Row.Cells(7).Width = Unit.Pixel(80)
|
|
e.Row.Cells(8).Width = Unit.Pixel(100)
|
|
e.Row.Cells(9).Width = Unit.Pixel(60)
|
|
End If
|
|
|
|
|
|
If e.Row.DBCampo("CuentaGasto") = "Seleccione" Or e.Row.DBCampo("CuentaGasto") = "" Then e.Row.FCLabel("LtlCuentaGasto").Text = "-"
|
|
If e.Row.DBCampo("CuentaCostos") = "Seleccione" Or e.Row.DBCampo("CuentaCostos") = "" Then e.Row.FCLabel("LtlCuentaCosto").Text = "-"
|
|
If e.Row.DBCampo("CuentaIngresos") = "Seleccione" Or e.Row.DBCampo("CuentaIngresos") = "" Then e.Row.FCLabel("LtlCuentaIngresos").Text = "-"
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
|
|
If UsuarioActual.Empresa.UsaContabilidad Then
|
|
e.Row.FCLabel("LtlClasificacion").Text = String.Format("<a Class='Texto' href='/Ventas/CatClasificacionesDetalle.aspx?CveClasificacion={0}'>{1}</a>", e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("Clasificacion"))
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
|
Dim ObjClasificaciones As New ClsClasificaciones
|
|
|
|
If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
|
GvDatos.EditIndex = -1
|
|
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
|
|
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
|
Else
|
|
Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
End If
|
|
|
|
ObjClasificaciones.Dispose()
|
|
CargaGrid()
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Private Sub CargaGrid()
|
|
GvDatos.DataSource = CType(ViewState("DTClasificaciones"), DataTable)
|
|
GvDatos.DataBind()
|
|
UpDatos.Update()
|
|
End Sub
|
|
|
|
Private Sub Limpiador()
|
|
CveCuentaGastoActual = -1
|
|
CveCuentaCostoActual = -1
|
|
CveCuentaIngresoActual = -1
|
|
DdlCuentaGasto.SelectedValue = "-1"
|
|
DdlCuentaCostos.SelectedValue = "-1"
|
|
DdlCuentaIngresos.SelectedValue = "-1"
|
|
End Sub
|
|
Private Sub HlAgregarClasifiacion(sender As Object, e As EventArgs) Handles HlAgregarClasificacion.Click
|
|
Limpiador()
|
|
|
|
TxtClasificacion.Text = ""
|
|
TxtPrecioBaseCosto.Text = ""
|
|
If DdlCategoria.Items.Count > 0 Then
|
|
DdlCategoria.SelectedIndex = 0
|
|
End If
|
|
DdlSATPS.SelectedValue = ""
|
|
DdlSATPS.SelectedText = ""
|
|
LtlTituloModal.Text = "Agregar Clasificación"
|
|
LbAgregar.Text = "Agregar"
|
|
HdnModalidadClasificacion.Value = "A"
|
|
|
|
ChkEstatus.Checked = True
|
|
|
|
ChkEsAcumulador.Checked = False
|
|
ChkRequiereSerieLote.Checked = False
|
|
ChkRequiereAFCompra.Checked = False
|
|
ChkRequiereAFInsumo.Checked = False
|
|
ChkRequierePersonal.Checked = False
|
|
|
|
UpModal.Update()
|
|
RegistraScript(String.Format("$('#{0}').modal();", "ModalClasificaciones"))
|
|
End Sub
|
|
|
|
Public Sub ActualizaClasificacion(sender As Object, e As EventArgs)
|
|
Limpiador()
|
|
|
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
|
Dim CveClasificacion As String = GvRow.DataKey("CveClasificacion").ToString
|
|
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
|
|
Dim PrecioBaseCosto As String = GvRow.DataKey("PrecioBaseCosto").ToString
|
|
Dim CveCategoria As String = GvRow.DataKey("CveCategoria").ToString
|
|
Dim CuentaGasto As String = GvRow.DataKey("CuentaGasto").ToString
|
|
Dim CuentaCostos As String = GvRow.DataKey("CuentaCostos").ToString
|
|
Dim CuentaIngresos As String = GvRow.DataKey("CuentaIngresos").ToString
|
|
Dim UsoClasificacion As String = GvRow.DataKey("UsoClasificacion").ToString
|
|
Dim TopVentas As Boolean = If(GvRow.DataKey("TopVentas") = "True", True, False)
|
|
Dim TopCompras As Boolean = If(GvRow.DataKey("TopCompras") = "True", True, False)
|
|
|
|
ChkTopCompras.Checked = TopCompras
|
|
ChkTopVentas.Checked = TopVentas
|
|
|
|
CveCuentaGastoActual = GvRow.DataKey("IdCuentaGasto").ToString.ToEntero
|
|
CveCuentaCostoActual = GvRow.DataKey("IdCuentaCostos").ToString.ToEntero
|
|
CveCuentaIngresoActual = GvRow.DataKey("IdCuentaIngresos").ToString.ToEntero
|
|
|
|
ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
|
|
ChkRequiereSerieLote.Checked = If(GvRow.DataKey("RequiereSerieLote") = "True", True, False)
|
|
|
|
ChkEsAcumulador.Checked = Boolean.Parse(GvRow.DataKey("EsAcumulador").ToString)
|
|
|
|
ChkRequiereAFCompra.Checked = If(GvRow.DataKey("RequiereAFCompra") = "True", True, False)
|
|
ChkRequiereAFInsumo.Checked = If(GvRow.DataKey("RequiereAFInsumo") = "True", True, False)
|
|
ChkRequierePersonal.Checked = If(GvRow.DataKey("RequierePersonal") = "True", True, False)
|
|
|
|
If CuentaGasto.Length > 1 And CargaGastos Then
|
|
DdlCuentaGasto.Items.Insert(0, New ListItem(CuentaGasto, CveCuentaGastoActual.ToString))
|
|
DdlCuentaGasto.SelectedIndex = 0
|
|
CargaGastos = False
|
|
Else
|
|
DdlCuentaGasto.SelectedValueExist(CveCuentaGastoActual)
|
|
End If
|
|
|
|
If CuentaCostos.Length > 1 And CargaCostos Then
|
|
DdlCuentaCostos.Items.Insert(0, New ListItem(CuentaCostos, CveCuentaCostoActual.ToString))
|
|
DdlCuentaCostos.SelectedIndex = 0
|
|
CargaCostos = False
|
|
Else
|
|
DdlCuentaCostos.SelectedValueExist(CveCuentaCostoActual)
|
|
End If
|
|
|
|
If CuentaIngresos.Length > 1 And CargaIngresos Then
|
|
DdlCuentaIngresos.Items.Insert(0, New ListItem(CuentaIngresos, CveCuentaIngresoActual.ToString))
|
|
DdlCuentaIngresos.SelectedIndex = 0
|
|
CargaIngresos = False
|
|
Else
|
|
DdlCuentaIngresos.SelectedValueExist(CveCuentaIngresoActual)
|
|
End If
|
|
|
|
|
|
TxtClasificacion.Text = Clasificacion
|
|
TxtPrecioBaseCosto.Text = PrecioBaseCosto.FormatoNumero(2)
|
|
DdlCategoria.SelectedValueExist(CveCategoria)
|
|
DdlUsoClasificacion.SelectedValue = UsoClasificacion
|
|
HdnIDClasificacion.Value = CveClasificacion
|
|
If GvRow.DataKey("CveSATPS").ToString <> Nothing Then
|
|
DdlSATPS.SelectedValue = GvRow.DataKey("CveSATPS").ToString
|
|
DdlSATPS.SelectedText = GvRow.DataKey("SATClaveProductoServicio").ToString
|
|
End If
|
|
HdnModalidadClasificacion.Value = "U"
|
|
LtlTituloModal.Text = "Actualizar Clasificación"
|
|
LbAgregar.Text = "Actualizar"
|
|
UpModal.Update()
|
|
RegistraScript(String.Format("$('#{0}').modal();", "ModalClasificaciones"))
|
|
End Sub
|
|
|
|
Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
|
|
RegistraScript("$('#DivPersonalizar').modal()")
|
|
UPPersonalizar.Update()
|
|
End Sub
|
|
Protected Sub BtnPersonalizar_Click(sender As Object, e As EventArgs)
|
|
|
|
If UsuarioActual.CveEmpresa.Contiene(80, 72) Then
|
|
GvDatos.Columns(5).Visible = ChkReqSerie.Checked
|
|
End If
|
|
GvDatos.Columns(8).Visible = ChkUsuario.Checked
|
|
GvDatos.Columns(10).Visible = ChkProductoSAT.Checked
|
|
GvDatos.Columns(11).Visible = ChkReqAFCompra.Checked
|
|
GvDatos.Columns(12).Visible = ChkReqAFInsumo.Checked
|
|
GvDatos.Columns(13).Visible = ChkReqPersonal.Checked
|
|
|
|
CargaDatos()
|
|
|
|
UpDatos.Update()
|
|
|
|
RegistraScript("$('#DivPersonalizar').modal('hide')")
|
|
End Sub
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
|
CargaDatos()
|
|
End Sub
|
|
End Class
|