Validacion de cancelacion por refacturacion
This commit is contained in:
@@ -219,7 +219,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
|
|
||||||
Dim CvePS = IfNull(context.Request("cveps"), "0").ToString.ToEntero
|
Dim CvePS = IfNull(context.Request("cveps"), "0").ToString.ToEntero
|
||||||
Dim objInv As New ClsInventarios
|
Dim objInv As New ClsInventarios
|
||||||
If objInv.GetExistenciasProducto(CvePS, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then
|
If objInv.GetExistenciasPS(CvePS, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then
|
||||||
|
|
||||||
' limpio los almacenes donde no tiene ningun producto existencia
|
' limpio los almacenes donde no tiene ningun producto existencia
|
||||||
For i = objInv.DtResultados.Columns.Count - 1 To 1 Step -1
|
For i = objInv.DtResultados.Columns.Count - 1 To 1 Step -1
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ Partial Class Inventarios_KardexAlmacen
|
|||||||
'End If
|
'End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Function CargarKardex(CvePS As Integer) As DataTable
|
Private Sub CargarKardex(CvePS As Integer)
|
||||||
Dim dt As DataTable = Nothing
|
Dim dt As DataTable = Nothing
|
||||||
Dim ObjMovimientos As New ClsInventarios
|
Dim ObjMovimientos As New ClsInventarios
|
||||||
Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
||||||
@@ -132,7 +132,7 @@ Partial Class Inventarios_KardexAlmacen
|
|||||||
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
|
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
|
||||||
dt = ObjMovimientos.DtResultados
|
dt = ObjMovimientos.DtResultados
|
||||||
Dim ListaBorrar As New List(Of DataColumn)
|
Dim ListaBorrar As New List(Of DataColumn)
|
||||||
For index = 2 To dt.Columns.Count - 1
|
For index = 3 To dt.Columns.Count - 1
|
||||||
Dim TotColumna As Double = 0
|
Dim TotColumna As Double = 0
|
||||||
For Each Dr As DataRow In dt.Rows
|
For Each Dr As DataRow In dt.Rows
|
||||||
TotColumna += Dr.Item(index).ToString.ToDouble
|
TotColumna += Dr.Item(index).ToString.ToDouble
|
||||||
@@ -149,25 +149,22 @@ Partial Class Inventarios_KardexAlmacen
|
|||||||
Else
|
Else
|
||||||
Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia)
|
Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia)
|
||||||
GvDatos.Columns.Clear()
|
GvDatos.Columns.Clear()
|
||||||
dt = Nothing
|
dt = Nothing
|
||||||
Return dt
|
Exit Sub
|
||||||
Exit Function
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ObjMovimientos.Dispose()
|
ObjMovimientos.Dispose()
|
||||||
Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError)
|
||||||
Exit Function
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
|
|
||||||
For index = 3 To GvDatos.Rows(0).Cells.Count - 1
|
For index = 4 To GvDatos.Rows(0).Cells.Count - 1
|
||||||
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|")(0)
|
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|")(0)
|
||||||
Next
|
Next
|
||||||
|
End Sub
|
||||||
Return dt
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||||
|
|
||||||
@@ -179,7 +176,8 @@ Partial Class Inventarios_KardexAlmacen
|
|||||||
e.Row.CssClass = "Totales"
|
e.Row.CssClass = "Totales"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
e.Row.HorizontalAlign = HorizontalAlign.Right
|
e.Row.HorizontalAlign = HorizontalAlign.Right
|
||||||
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||||
Dim Index As Integer = 0
|
Dim Index As Integer = 0
|
||||||
|
|
||||||
@@ -187,7 +185,7 @@ Partial Class Inventarios_KardexAlmacen
|
|||||||
Dim Celda As String = Cells.Text
|
Dim Celda As String = Cells.Text
|
||||||
If IsNumeric(Celda) Then
|
If IsNumeric(Celda) Then
|
||||||
Dim CveAlmacen2 As Integer = -1
|
Dim CveAlmacen2 As Integer = -1
|
||||||
If Index >= 4 Then
|
If Index >= 5 Then
|
||||||
Dim Array = GvDatos.HeaderRow.Cells(Index).Text.Split("|")
|
Dim Array = GvDatos.HeaderRow.Cells(Index).Text.Split("|")
|
||||||
If Array.Length > 1 Then
|
If Array.Length > 1 Then
|
||||||
CveAlmacen2 = Array(1)
|
CveAlmacen2 = Array(1)
|
||||||
@@ -224,10 +222,10 @@ Partial Class Inventarios_KardexAlmacen
|
|||||||
Private Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
|
Private Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
|
||||||
'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui).
|
'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui).
|
||||||
' e.Row.Cells(0).Width = New Unit("200px")
|
' e.Row.Cells(0).Width = New Unit("200px")
|
||||||
e.Row.Cells(1).Visible = False
|
|
||||||
e.Row.Cells(2).Visible = False
|
e.Row.Cells(2).Visible = False
|
||||||
|
e.Row.Cells(3).Visible = False
|
||||||
If e.Row.RowType = DataControlRowType.Header Then
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
e.Row.Cells(5).ToolTip = "Costo Promedio"
|
e.Row.Cells(6).ToolTip = "Costo Promedio"
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,9 @@ Partial Class Inventarios_ReporteEntradasSalidas
|
|||||||
Dim CveAlmacen = Request("CveAlmacen").ToString
|
Dim CveAlmacen = Request("CveAlmacen").ToString
|
||||||
Dim Almacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {Request("CveAlmacen").ToString}")
|
Dim Almacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {Request("CveAlmacen").ToString}")
|
||||||
DdlAlmacen.Items.Insert(0, New ListItem(Almacen, CveAlmacen))
|
DdlAlmacen.Items.Insert(0, New ListItem(Almacen, CveAlmacen))
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
DdlAlmacen.SelectedValuesIfExistM("-1")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Llenar dropdownlist de monedas
|
'Llenar dropdownlist de monedas
|
||||||
@@ -345,7 +347,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
|
|||||||
Dim FechaI As String = FechaInicial
|
Dim FechaI As String = FechaInicial
|
||||||
Dim FechaF As String = FechaFinal
|
Dim FechaF As String = FechaFinal
|
||||||
|
|
||||||
Dim Almacen = If(DdlAlmacen.SelectedValue = "-1", "", $" <b>Almacén:</b> {DdlAlmacen.SelectedItem.Text}")
|
Dim Almacen = If(DdlAlmacen.GetSelectedValuesM = "", "", $" <b>Almacenes:</b> {DdlAlmacen.GetSelectedText()}")
|
||||||
Dim TipoMov = If(DdlTipoMovimiento.SelectedValue = "-1", "", $" <b>Tipo Movimiento:</b> {DdlTipoMovimiento.SelectedItem.Text}")
|
Dim TipoMov = If(DdlTipoMovimiento.SelectedValue = "-1", "", $" <b>Tipo Movimiento:</b> {DdlTipoMovimiento.SelectedItem.Text}")
|
||||||
Dim Moneda = If(DdlMoneda.SelectedValue = "-1", "", $" <b>Moneda:</b> {DdlMoneda.SelectedItem.Text}")
|
Dim Moneda = If(DdlMoneda.SelectedValue = "-1", "", $" <b>Moneda:</b> {DdlMoneda.SelectedItem.Text}")
|
||||||
Dim SoloConMov = If(DdlMovs.SelectedValue = "-1", "", $" <b>Solo Movimientos:</b> {DdlMovs.SelectedItem.Text}")
|
Dim SoloConMov = If(DdlMovs.SelectedValue = "-1", "", $" <b>Solo Movimientos:</b> {DdlMovs.SelectedItem.Text}")
|
||||||
|
|||||||
@@ -78,7 +78,6 @@
|
|||||||
<!-- BEGIN LOGO -->
|
<!-- BEGIN LOGO -->
|
||||||
<div class="page-logo">
|
<div class="page-logo">
|
||||||
<asp:Literal ID="LitTit" runat="server"></asp:Literal>
|
<asp:Literal ID="LitTit" runat="server"></asp:Literal>
|
||||||
<asp:TextBox ID="TxtTit" BorderStyle="None" runat="server" Visible="false" Width="500px"></asp:TextBox>
|
|
||||||
<%--<a href="/Inicio.aspx">
|
<%--<a href="/Inicio.aspx">
|
||||||
<asp:Image ID="IMGLogo" runat="server" alt="logo" class="logo-default" style="height:40px; margin: 3px 0 0 0;"/>
|
<asp:Image ID="IMGLogo" runat="server" alt="logo" class="logo-default" style="height:40px; margin: 3px 0 0 0;"/>
|
||||||
<asp:Label ID="LblEmpresa" runat="server" CssClass="EmpresaName"></asp:Label>
|
<asp:Label ID="LblEmpresa" runat="server" CssClass="EmpresaName"></asp:Label>
|
||||||
@@ -368,13 +367,16 @@
|
|||||||
<div class='page-content <%=If(EsPopup, "mpoup", "") %>' style=''>
|
<div class='page-content <%=If(EsPopup, "mpoup", "") %>' style=''>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-7">
|
||||||
<h3 class="page-title" runat="server" id="headertitleh3">
|
<h3 class="page-title" runat="server" id="headertitleh3">
|
||||||
<asp:ContentPlaceHolder ID="E" runat="server">
|
<asp:ContentPlaceHolder ID="E" runat="server">
|
||||||
</asp:ContentPlaceHolder>
|
</asp:ContentPlaceHolder>
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 text-right" style="padding-top: 8px; white-space: nowrap;">
|
<div class="col-sm-3">
|
||||||
|
<asp:TextBox ID="TxtTit" BorderStyle="None" CssClass="form-control input-sm" runat="server" Visible="false" Width="100%"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 text-right" style="padding-top: 8px; white-space: nowrap;">
|
||||||
<i class="icon-calendar"></i>
|
<i class="icon-calendar"></i>
|
||||||
<asp:Label ID="lblFecha" CssClass="thin uppercase hidden-xs" runat="server"></asp:Label>
|
<asp:Label ID="lblFecha" CssClass="thin uppercase hidden-xs" runat="server"></asp:Label>
|
||||||
<asp:Label ID="lblTipoCambio" CssClass="thin uppercase hidden-xs" runat="server"></asp:Label>
|
<asp:Label ID="lblTipoCambio" CssClass="thin uppercase hidden-xs" runat="server"></asp:Label>
|
||||||
|
|||||||
993
Site.master.vb
993
Site.master.vb
@@ -1,498 +1,497 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
|
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Security.Cryptography.X509Certificates
|
Imports System.Security.Cryptography.X509Certificates
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
'Imports Microsoft.AspNet.SignalR.Client
|
'Imports Microsoft.AspNet.SignalR.Client
|
||||||
'Imports ChatHub
|
'Imports ChatHub
|
||||||
|
|
||||||
Partial Class Site
|
Partial Class Site
|
||||||
Inherits BaseMasterPage
|
Inherits BaseMasterPage
|
||||||
#Region "Propiedades"
|
#Region "Propiedades"
|
||||||
|
|
||||||
Public Overrides Property EsPopup() As Boolean
|
Public Overrides Property EsPopup() As Boolean
|
||||||
Get
|
Get
|
||||||
Return Convert.ToBoolean(HdnEsPopup.Value)
|
Return Convert.ToBoolean(HdnEsPopup.Value)
|
||||||
End Get
|
End Get
|
||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
HdnEsPopup.Value = value.ToString
|
HdnEsPopup.Value = value.ToString
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Overrides Property PopupWidth() As Integer
|
Public Overrides Property PopupWidth() As Integer
|
||||||
Get
|
Get
|
||||||
Return HdnPopUpWidth.Value.ToEntero
|
Return HdnPopUpWidth.Value.ToEntero
|
||||||
End Get
|
End Get
|
||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
HdnPopUpWidth.Value = value.ToString
|
HdnPopUpWidth.Value = value.ToString
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Property userx As Usuario
|
Public Property userx As Usuario
|
||||||
Get
|
Get
|
||||||
userx = DirectCast(ViewState("userx"), Usuario)
|
userx = DirectCast(ViewState("userx"), Usuario)
|
||||||
End Get
|
End Get
|
||||||
Set(value As Usuario)
|
Set(value As Usuario)
|
||||||
ViewState("userx") = value
|
ViewState("userx") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Property countNotificaciones As Integer
|
Public Property countNotificaciones As Integer
|
||||||
Get
|
Get
|
||||||
countNotificaciones = If(IsNothing(ViewState("countNotificaciones")), 0, ViewState("countNotificaciones").ToString.ToEntero)
|
countNotificaciones = If(IsNothing(ViewState("countNotificaciones")), 0, ViewState("countNotificaciones").ToString.ToEntero)
|
||||||
End Get
|
End Get
|
||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
ViewState("countNotificaciones") = value
|
ViewState("countNotificaciones") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Property UsuarioCve As Integer
|
Public Property UsuarioCve As Integer
|
||||||
Get
|
Get
|
||||||
Return 15
|
Return 15
|
||||||
End Get
|
End Get
|
||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
|
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
lblFecha.Text = DateTime.Now.ToString("dd.MMMyyyy HH:mm tt")
|
lblFecha.Text = DateTime.Now.ToString("dd.MMMyyyy HH:mm tt")
|
||||||
MasterChat.Visible = False
|
MasterChat.Visible = False
|
||||||
If UsuarioActual.CveUsuario = 100 Then
|
|
||||||
TxtTit.Visible = True
|
If Request("Masterimpoup") IsNot Nothing AndAlso Request("Masterimpoup").ToString = "true" Then EsPopup = True
|
||||||
End If
|
If UsuarioActual IsNot Nothing Then
|
||||||
If Request("Masterimpoup") IsNot Nothing AndAlso Request("Masterimpoup").ToString = "true" Then EsPopup = True
|
HdnCveE.Value = UsuarioActual.CveEmpresa.ToString
|
||||||
If UsuarioActual IsNot Nothing Then
|
HdnCveU.Value = UsuarioActual.CveUsuario.ToString
|
||||||
HdnCveE.Value = UsuarioActual.CveEmpresa.ToString
|
LitTit.Text = UsuarioActual.Empresa.EmpresaEncabezado
|
||||||
HdnCveU.Value = UsuarioActual.CveUsuario.ToString
|
If UsuarioActual.CveUsuario = 100 Then
|
||||||
LitTit.Text = UsuarioActual.Empresa.EmpresaEncabezado
|
LitTit.Text = String.Format("<span style='color:white; font-size:x-large'></span> <span style='color: #32A1CF; font-size:x-large'>Mi Empresa de Ventas ({0})</span> ", UsuarioActual.CveEmpresa)
|
||||||
If UsuarioActual.CveUsuario = 100 Then
|
TxtTit.Visible = True
|
||||||
LitTit.Text = String.Format("<span style='color:white; font-size:x-large'></span> <span style='color: #32A1CF; font-size:x-large'>Mi Empresa de Ventas ({0})</span> ", UsuarioActual.CveEmpresa)
|
End If
|
||||||
End If
|
|
||||||
|
Dim thisURL As String = Request.Url.Segments(Request.Url.Segments.Count - 1)
|
||||||
Dim thisURL As String = Request.Url.Segments(Request.Url.Segments.Count - 1)
|
If thisURL.Equals("WizardRegistro.aspx") OrElse thisURL.Equals("Registro.aspx") Then
|
||||||
If thisURL.Equals("WizardRegistro.aspx") OrElse thisURL.Equals("Registro.aspx") Then
|
LitTit.Text = "<span style='color:white; font-size:x-large'>AD</span> <span style='color: #32A1CF; font-size:x-large'> Soluciones en TI</span> "
|
||||||
LitTit.Text = "<span style='color:white; font-size:x-large'>AD</span> <span style='color: #32A1CF; font-size:x-large'> Soluciones en TI</span> "
|
End If
|
||||||
End If
|
|
||||||
|
userx = New Usuario
|
||||||
userx = New Usuario
|
userx.Empresa = New Empresa
|
||||||
userx.Empresa = New Empresa
|
userx.Referencia = Encripta(UsuarioActual.CveUsuario.ToString)
|
||||||
userx.Referencia = Encripta(UsuarioActual.CveUsuario.ToString)
|
userx.Usuario = Encripta(UsuarioActual.Usuario)
|
||||||
userx.Usuario = Encripta(UsuarioActual.Usuario)
|
userx.Liga = Encripta(UsuarioActual.Rol)
|
||||||
userx.Liga = Encripta(UsuarioActual.Rol)
|
|
||||||
|
If UsuarioActual.CvePersonal > 0 Then
|
||||||
If UsuarioActual.CvePersonal > 0 Then
|
DivPerfil.Visible = True
|
||||||
DivPerfil.Visible = True
|
End If
|
||||||
End If
|
|
||||||
|
If UsuarioActual.CveRol = 1 Then
|
||||||
If UsuarioActual.CveRol = 1 Then
|
userx.Empresa.Direccion = Encripta("-999")
|
||||||
userx.Empresa.Direccion = Encripta("-999")
|
userx.Empresa.Empresa = Encripta("ADSistemas")
|
||||||
userx.Empresa.Empresa = Encripta("ADSistemas")
|
Else
|
||||||
Else
|
'.Empresa.Direccion = Encripta(UsuarioActual.Empresa.CveEmpresa)
|
||||||
'.Empresa.Direccion = Encripta(UsuarioActual.Empresa.CveEmpresa)
|
'userx.Empresa.Empresa = Encripta(UsuarioActual.Empresa.Empresa)
|
||||||
'userx.Empresa.Empresa = Encripta(UsuarioActual.Empresa.Empresa)
|
End If
|
||||||
End If
|
|
||||||
|
If UsuarioActual.CveRol = 1200 Then
|
||||||
If UsuarioActual.CveRol = 1200 Then
|
dashboard.Visible = True
|
||||||
dashboard.Visible = True
|
End If
|
||||||
End If
|
|
||||||
|
If UsuarioActual.CvePlataforma = 6 Or UsuarioActual.CvePlataforma = 7 Then
|
||||||
If UsuarioActual.CvePlataforma = 6 Or UsuarioActual.CvePlataforma = 7 Then
|
header_search_bar.Visible = False
|
||||||
header_search_bar.Visible = False
|
header_notification_bar.Visible = False
|
||||||
header_notification_bar.Visible = False
|
End If
|
||||||
End If
|
|
||||||
|
If EsPopup Then
|
||||||
If EsPopup Then
|
|
||||||
|
scriptoppner.Visible = True
|
||||||
scriptoppner.Visible = True
|
divMenu.Visible = False
|
||||||
divMenu.Visible = False
|
RegistraScript("$('#barradenavegacion').css({'display':'none'})")
|
||||||
RegistraScript("$('#barradenavegacion').css({'display':'none'})")
|
divContenido.Attributes.CssStyle("background") = "white"
|
||||||
divContenido.Attributes.CssStyle("background") = "white"
|
divpagecontainer.Attributes.CssStyle("margin") = "0px !important"
|
||||||
divpagecontainer.Attributes.CssStyle("margin") = "0px !important"
|
headertitleh3.Attributes.CssStyle("margin") = "0px !important"
|
||||||
headertitleh3.Attributes.CssStyle("margin") = "0px !important"
|
divtopmenu.Visible = False
|
||||||
divtopmenu.Visible = False
|
Else
|
||||||
Else
|
'MyChat_Init(Nothing, Nothing)
|
||||||
'MyChat_Init(Nothing, Nothing)
|
|
||||||
|
'19/05/2018 - CARGA TIPO DE CAMBIO
|
||||||
'19/05/2018 - CARGA TIPO DE CAMBIO
|
'2018.08.14, se movió de la linea 59 a la actual
|
||||||
'2018.08.14, se movió de la linea 59 a la actual
|
CargaTipoCambio()
|
||||||
CargaTipoCambio()
|
|
||||||
|
|
||||||
|
If UsuarioActual.Portal = False Then
|
||||||
If UsuarioActual.Portal = False Then
|
CreaMenu()
|
||||||
CreaMenu()
|
'Configuracion()
|
||||||
'Configuracion()
|
CargaUsuario()
|
||||||
CargaUsuario()
|
CargaBuscadores()
|
||||||
CargaBuscadores()
|
Else
|
||||||
Else
|
LtMasterPerfil.Text = UsuarioActual.Rol
|
||||||
LtMasterPerfil.Text = UsuarioActual.Rol
|
LtMasterUsuario.Text = UsuarioActual.Usuario
|
||||||
LtMasterUsuario.Text = UsuarioActual.Usuario
|
End If
|
||||||
End If
|
|
||||||
|
End If
|
||||||
End If
|
CargarNotificaciones()
|
||||||
CargarNotificaciones()
|
Else
|
||||||
Else
|
|
||||||
|
Dim thisURL As String = Request.Url.Segments(Request.Url.Segments.Count - 1)
|
||||||
Dim thisURL As String = Request.Url.Segments(Request.Url.Segments.Count - 1)
|
If thisURL.Equals("WizardRegistro.aspx") OrElse thisURL.Equals("Registro.aspx") Then
|
||||||
If thisURL.Equals("WizardRegistro.aspx") OrElse thisURL.Equals("Registro.aspx") Then
|
LitTit.Text = "<span style='color:white; font-size:x-large'>AD</span> <span style='color: #32A1CF; font-size:x-large'> Soluciones en TI</span> "
|
||||||
LitTit.Text = "<span style='color:white; font-size:x-large'>AD</span> <span style='color: #32A1CF; font-size:x-large'> Soluciones en TI</span> "
|
|
||||||
|
End If
|
||||||
End If
|
|
||||||
|
End If
|
||||||
End If
|
Else
|
||||||
Else
|
'VALIDACION DE SEGURIDAD, EN LA QUE SE VALIDA QUE LA EMPRESA EN LA QUE SE GENERO LA PAGINA SEA LA MISMA A LA DE LA SESION,
|
||||||
'VALIDACION DE SEGURIDAD, EN LA QUE SE VALIDA QUE LA EMPRESA EN LA QUE SE GENERO LA PAGINA SEA LA MISMA A LA DE LA SESION,
|
'DE NO SER ASI, SE REDIRECCIONA A INICIO.
|
||||||
'DE NO SER ASI, SE REDIRECCIONA A INICIO.
|
If UsuarioActual IsNot Nothing AndAlso (HdnCveE.Value <> UsuarioActual.CveEmpresa.ToString OrElse HdnCveU.Value <> UsuarioActual.CveUsuario.ToString) Then
|
||||||
If UsuarioActual IsNot Nothing AndAlso (HdnCveE.Value <> UsuarioActual.CveEmpresa.ToString OrElse HdnCveU.Value <> UsuarioActual.CveUsuario.ToString) Then
|
Response.Redirect(FormsAuthentication.DefaultUrl)
|
||||||
Response.Redirect(FormsAuthentication.DefaultUrl)
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End Sub
|
||||||
End Sub
|
Private Sub CargaUsuario()
|
||||||
Private Sub CargaUsuario()
|
If UsuarioActual IsNot Nothing Then
|
||||||
If UsuarioActual IsNot Nothing Then
|
'LtMasterNombre.Text = UsuarioActual.Nombre
|
||||||
'LtMasterNombre.Text = UsuarioActual.Nombre
|
LtMasterPerfil.Text = UsuarioActual.Rol
|
||||||
LtMasterPerfil.Text = UsuarioActual.Rol
|
LtMasterUsuario.Text = UsuarioActual.Usuario
|
||||||
LtMasterUsuario.Text = UsuarioActual.Usuario
|
|
||||||
|
|
||||||
|
'DivConfiguracionEmpresa.Visible = True
|
||||||
'DivConfiguracionEmpresa.Visible = True
|
' BtnConfiguracionEmpresa.Attributes.Add("onclick", String.Format("javascript:document.location.href='/Sistemas/Empresa.aspx?CveEmpresa={0}'", UsuarioActual.CveEmpresa))
|
||||||
' BtnConfiguracionEmpresa.Attributes.Add("onclick", String.Format("javascript:document.location.href='/Sistemas/Empresa.aspx?CveEmpresa={0}'", UsuarioActual.CveEmpresa))
|
BtnConfiguracionEmpresa.Visible = False
|
||||||
BtnConfiguracionEmpresa.Visible = False
|
DivConfiguracionEmpresa.Visible = False
|
||||||
DivConfiguracionEmpresa.Visible = False
|
'loadchat()
|
||||||
'loadchat()
|
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.ModoSimulacion Then
|
||||||
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.ModoSimulacion Then
|
DivCambiarUsuario.Visible = True
|
||||||
DivCambiarUsuario.Visible = True
|
BtnCambiarUsuario.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpCambiaUsuario.aspx');")
|
||||||
BtnCambiarUsuario.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpCambiaUsuario.aspx');")
|
End If
|
||||||
End If
|
If UsuarioActual.MultipleEmpresa Then
|
||||||
If UsuarioActual.MultipleEmpresa Then
|
BtnCambiarEmpresa.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpSeleccionarEmpresa.aspx');")
|
||||||
BtnCambiarEmpresa.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpSeleccionarEmpresa.aspx');")
|
DivCambiarEmpresa.Visible = True
|
||||||
DivCambiarEmpresa.Visible = True
|
End If
|
||||||
End If
|
|
||||||
|
End If
|
||||||
End If
|
End Sub
|
||||||
End Sub
|
'Private Sub loadchat()
|
||||||
'Private Sub loadchat()
|
|
||||||
|
' If UsuarioActual.CveRol = 1 OrElse UsuarioActual.ModoSimulacion Then
|
||||||
' If UsuarioActual.CveRol = 1 OrElse UsuarioActual.ModoSimulacion Then
|
' Dim GlobalDTUsuarios As DataTable = DirectCast(Application("GlobalDTUsuarios"), DataTable)
|
||||||
' Dim GlobalDTUsuarios As DataTable = DirectCast(Application("GlobalDTUsuarios"), DataTable)
|
' Dim userconectedlist As List(Of Integer) = (From c In MyHub.usuarios Select c.CveUsuario Distinct).ToList
|
||||||
' Dim userconectedlist As List(Of Integer) = (From c In MyHub.usuarios Select c.CveUsuario Distinct).ToList
|
' Dim prefix As String = ""
|
||||||
' Dim prefix As String = ""
|
' Dim userstring As New StringBuilder
|
||||||
' Dim userstring As New StringBuilder
|
' For Each item As Integer In userconectedlist
|
||||||
' For Each item As Integer In userconectedlist
|
' userstring.AppendFormat("{0}{1} ", prefix, item)
|
||||||
' userstring.AppendFormat("{0}{1} ", prefix, item)
|
' prefix = ","
|
||||||
' prefix = ","
|
' Next
|
||||||
' Next
|
' stringusers = userstring.ToString
|
||||||
' stringusers = userstring.ToString
|
' If userconectedlist.Count > 0 Then
|
||||||
' If userconectedlist.Count > 0 Then
|
' GlobalDTUsuarios = GlobalDTUsuarios.FiltraParametros(String.Format("CveUsuario in ({0})", userstring))
|
||||||
' GlobalDTUsuarios = GlobalDTUsuarios.FiltraParametros(String.Format("CveUsuario in ({0})", userstring))
|
' RptChatEmpresa.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa >1", "", {"CveEmpresa", "Empresa"})
|
||||||
' RptChatEmpresa.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa >1", "", {"CveEmpresa", "Empresa"})
|
' RptChatEmpresa.DataBind()
|
||||||
' RptChatEmpresa.DataBind()
|
' End If
|
||||||
' End If
|
' MasterChat.Visible = True
|
||||||
' MasterChat.Visible = True
|
|
||||||
|
' End If
|
||||||
' End If
|
'End Sub
|
||||||
'End Sub
|
'Private stringusers As String = "0"
|
||||||
'Private stringusers As String = "0"
|
'Private Sub RptChatEmpresa_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles RptChatEmpresa.ItemDataBound
|
||||||
'Private Sub RptChatEmpresa_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles RptChatEmpresa.ItemDataBound
|
' Dim CveEmpresa As Integer = e.Item.DataItem("CveEmpresa").ToString.ToEntero
|
||||||
' Dim CveEmpresa As Integer = e.Item.DataItem("CveEmpresa").ToString.ToEntero
|
' Dim GlobalDTUsuarios As DataTable = DirectCast(Application("GlobalDTUsuarios"), DataTable).FiltraParametros(String.Format("CveUsuario in ({0}) AND CveEmpresa ={1}", stringusers, CveEmpresa))
|
||||||
' Dim GlobalDTUsuarios As DataTable = DirectCast(Application("GlobalDTUsuarios"), DataTable).FiltraParametros(String.Format("CveUsuario in ({0}) AND CveEmpresa ={1}", stringusers, CveEmpresa))
|
|
||||||
|
' Dim rpthijo As Repeater = DirectCast(e.Item.FindControl("RPTChatuser"), Repeater)
|
||||||
' Dim rpthijo As Repeater = DirectCast(e.Item.FindControl("RPTChatuser"), Repeater)
|
' rpthijo.DataSource = GlobalDTUsuarios
|
||||||
' rpthijo.DataSource = GlobalDTUsuarios
|
' rpthijo.DataBind()
|
||||||
' rpthijo.DataBind()
|
'End Sub
|
||||||
'End Sub
|
Private Sub CargaBuscadores()
|
||||||
Private Sub CargaBuscadores()
|
'Proveedores
|
||||||
'Proveedores
|
If UsuarioActual.TienePermisoPagina(37) Then tdProv.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(37) Then tdProv.Visible = True
|
|
||||||
|
'Clientes
|
||||||
'Clientes
|
If UsuarioActual.TienePermisoPagina(26) Then tdCliente.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(26) Then tdCliente.Visible = True
|
|
||||||
|
'Factura de Ventas
|
||||||
'Factura de Ventas
|
If UsuarioActual.TienePermisoPagina(6) Then tdVentas.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(6) Then tdVentas.Visible = True
|
|
||||||
|
'Personal
|
||||||
'Personal
|
If UsuarioActual.TienePermisoPagina(46) Then tdPersonal.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(46) Then tdPersonal.Visible = True
|
|
||||||
|
'Buscar Productos servicios
|
||||||
'Buscar Productos servicios
|
If UsuarioActual.TienePermisoPagina(13) Then tdBuscarPs.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(13) Then tdBuscarPs.Visible = True
|
|
||||||
|
'Compras
|
||||||
'Compras
|
If UsuarioActual.TienePermisoPagina(38) Then tdCompras.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(38) Then tdCompras.Visible = True
|
|
||||||
|
'Ordenes Servicio
|
||||||
'Ordenes Servicio
|
If UsuarioActual.TienePermisoPagina(135) Then tdOS.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(135) Then tdOS.Visible = True
|
|
||||||
|
'Ingresos / Egresos
|
||||||
'Ingresos / Egresos
|
If UsuarioActual.TienePermisoPagina(153) Then tdCheques.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(153) Then tdCheques.Visible = True
|
|
||||||
|
'Órdenes de Compra
|
||||||
'Órdenes de Compra
|
If UsuarioActual.TienePermisoPagina(103) Then tdOC.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(103) Then tdOC.Visible = True
|
|
||||||
|
'Cuando es Requisición
|
||||||
'Cuando es Requisición
|
If UsuarioActual.TienePermisoPagina(250) Then tdOC.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(250) Then tdOC.Visible = True
|
|
||||||
|
'Inventarios Movimientos
|
||||||
'Inventarios Movimientos
|
If UsuarioActual.TienePermisoPagina(219) Then TdMovInv.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(219) Then TdMovInv.Visible = True
|
|
||||||
|
'Prospectos
|
||||||
'Prospectos
|
If UsuarioActual.TienePermisoPagina(181) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx',980,547,'popBuscarProspectos');")
|
||||||
If UsuarioActual.TienePermisoPagina(181) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx',980,547,'popBuscarProspectos');")
|
'ProspectosRedes
|
||||||
'ProspectosRedes
|
If UsuarioActual.TienePermisoPagina(183) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx?Opt=Redes',980,547,'popBuscarProspectos');")
|
||||||
If UsuarioActual.TienePermisoPagina(183) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx?Opt=Redes',980,547,'popBuscarProspectos');")
|
'ProspectosG15
|
||||||
'ProspectosG15
|
If UsuarioActual.TienePermisoPagina(187) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx?Opt=Atn',980,547,'popBuscarProspectos');")
|
||||||
If UsuarioActual.TienePermisoPagina(187) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx?Opt=Atn',980,547,'popBuscarProspectos');")
|
'ProspectosSIP
|
||||||
'ProspectosSIP
|
If UsuarioActual.TienePermisoPagina(207) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx?Opt=SIP',980,547,'popBuscarProspectos');")
|
||||||
If UsuarioActual.TienePermisoPagina(207) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospectos/PopUpBuscarProspectos.aspx?Opt=SIP',980,547,'popBuscarProspectos');")
|
|
||||||
|
If UsuarioActual.TienePermisoPagina(392) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospeccion/PopUpBuscarProspectos.aspx',980,547,'popBuscarProspectos');")
|
||||||
If UsuarioActual.TienePermisoPagina(392) Then tdProspectos.Visible = True : ImgProspecto.Attributes.Add("onclick", "AbrirVentana('/Prospeccion/PopUpBuscarProspectos.aspx',980,547,'popBuscarProspectos');")
|
|
||||||
|
If UsuarioActual.TienePermisoPagina(228) Then tdBExi.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(228) Then tdBExi.Visible = True
|
|
||||||
|
'Contratos
|
||||||
'Contratos
|
If UsuarioActual.TienePermisoPagina(313) Then TdContratos.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(313) Then TdContratos.Visible = True
|
|
||||||
|
|
||||||
|
'BUSCAR MILITANTE
|
||||||
'BUSCAR MILITANTE
|
If UsuarioActual.TienePermisoPagina(1001) Then tdBuscarMilitante.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(1001) Then tdBuscarMilitante.Visible = True
|
|
||||||
|
'Orden Produccion'
|
||||||
'Orden Produccion'
|
If UsuarioActual.TienePermisoPagina(816) Then tdOP.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(816) Then tdOP.Visible = True
|
|
||||||
|
'Produccion'
|
||||||
'Produccion'
|
If UsuarioActual.TienePermisoPagina(823) Then tdP.Visible = True
|
||||||
If UsuarioActual.TienePermisoPagina(823) Then tdP.Visible = True
|
|
||||||
|
'BUSCAR ACERCAMIENTO CRM'
|
||||||
'BUSCAR ACERCAMIENTO CRM'
|
If UsuarioActual.TienePermisoProceso(251) Then TdCRMAcercamientos.Visible = True
|
||||||
If UsuarioActual.TienePermisoProceso(251) Then TdCRMAcercamientos.Visible = True
|
|
||||||
|
End Sub
|
||||||
End Sub
|
|
||||||
|
Protected Sub CerrarSesion_Click(sender As Object, e As EventArgs) Handles BtnCerrarSesion.ServerClick
|
||||||
Protected Sub CerrarSesion_Click(sender As Object, e As EventArgs) Handles BtnCerrarSesion.ServerClick
|
|
||||||
|
'If Request.ServerVariables("URL").ToUpper.Contiene("/PortalCliente/PortalCliente.aspx".ToUpper) Then
|
||||||
'If Request.ServerVariables("URL").ToUpper.Contiene("/PortalCliente/PortalCliente.aspx".ToUpper) Then
|
' UsuarioActual.CerrarSession(1)
|
||||||
' UsuarioActual.CerrarSession(1)
|
'ElseIf Request.ServerVariables("URL").ToUpper.Contiene("/PortalProveedores/PortalProveedor.aspx".ToUpper) Then
|
||||||
'ElseIf Request.ServerVariables("URL").ToUpper.Contiene("/PortalProveedores/PortalProveedor.aspx".ToUpper) Then
|
' UsuarioActual.CerrarSession(2)
|
||||||
' UsuarioActual.CerrarSession(2)
|
'Else
|
||||||
'Else
|
'MyHub.RemoveConexiones(UsuarioActual.CveUsuario)
|
||||||
'MyHub.RemoveConexiones(UsuarioActual.CveUsuario)
|
Usuario.CerrarSession()
|
||||||
Usuario.CerrarSession()
|
'End If
|
||||||
'End If
|
|
||||||
|
'UsuarioActual.Dispose()
|
||||||
'UsuarioActual.Dispose()
|
End Sub
|
||||||
End Sub
|
|
||||||
|
'Private Sub Configuracion()
|
||||||
'Private Sub Configuracion()
|
' Dim dt As New DataTable
|
||||||
' Dim dt As New DataTable
|
' dt.ReadXml(String.Format("{0}\Menu\ERP\{1}_Conf.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
|
||||||
' dt.ReadXml(String.Format("{0}\Menu\ERP\{1}_Conf.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
|
|
||||||
|
'End Sub
|
||||||
'End Sub
|
|
||||||
|
Private Sub CreaMenu()
|
||||||
Private Sub CreaMenu()
|
Dim dt As New DataTable
|
||||||
Dim dt As New DataTable
|
|
||||||
|
If UsuarioActual.CveRol = 1200 Then
|
||||||
If UsuarioActual.CveRol = 1200 Then
|
dt.ReadXml(String.Format("{0}\Menu\GPS\{1}.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
|
||||||
dt.ReadXml(String.Format("{0}\Menu\GPS\{1}.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
|
Else
|
||||||
Else
|
dt.ReadXml(String.Format("{0}\Menu\ERP\{1}.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
|
||||||
dt.ReadXml(String.Format("{0}\Menu\ERP\{1}.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
|
End If
|
||||||
End If
|
|
||||||
|
Dim Inicio = From i In dt.AsEnumerable Where i!CvePadre.Equals(0) Order By i!Orden
|
||||||
Dim Inicio = From i In dt.AsEnumerable Where i!CvePadre.Equals(0) Order By i!Orden
|
Dim CveModuloPadre, CveModuloPadreSeleccionado, CveModuloHijoSeleccionado, CveModuloNietoSeleccionado As Integer
|
||||||
Dim CveModuloPadre, CveModuloPadreSeleccionado, CveModuloHijoSeleccionado, CveModuloNietoSeleccionado As Integer
|
Dim CveModulo As Integer = CveModulomasterpage.Text.ToEntero
|
||||||
Dim CveModulo As Integer = CveModulomasterpage.Text.ToEntero
|
Dim ScriptColorGrupoModulo As String = ""
|
||||||
Dim ScriptColorGrupoModulo As String = ""
|
Dim LinkBase = "javascript:;"
|
||||||
Dim LinkBase = "javascript:;"
|
Dim HeaderBar As New StringBuilder("<li><i class='fa fa-home'></i><a href='/Inicio.aspx'>Inicio</a>")
|
||||||
Dim HeaderBar As New StringBuilder("<li><i class='fa fa-home'></i><a href='/Inicio.aspx'>Inicio</a>")
|
Dim LinkPadre = ""
|
||||||
Dim LinkPadre = ""
|
Dim Linkpapa As String = ""
|
||||||
Dim Linkpapa As String = ""
|
Dim LinkHijo = ""
|
||||||
Dim LinkHijo = ""
|
Dim Linkson As String = ""
|
||||||
Dim Linkson As String = ""
|
Dim LinkNieto = ""
|
||||||
Dim LinkNieto = ""
|
Dim ClassActive As String
|
||||||
Dim ClassActive As String
|
CveModuloPadreSeleccionado = 0 : CveModuloHijoSeleccionado = 0 : CveModuloNietoSeleccionado = 0
|
||||||
CveModuloPadreSeleccionado = 0 : CveModuloHijoSeleccionado = 0 : CveModuloNietoSeleccionado = 0
|
Dim MenuHTML As New StringBuilder
|
||||||
Dim MenuHTML As New StringBuilder
|
For Each drP As DataRow In Inicio
|
||||||
For Each drP As DataRow In Inicio
|
CveModuloPadre = drP("CveModulo").ToString.ToEntero
|
||||||
CveModuloPadre = drP("CveModulo").ToString.ToEntero
|
LinkPadre = drP("LIGA").ToString
|
||||||
LinkPadre = drP("LIGA").ToString
|
If drP("PopUp").ToString = "S" Then LinkPadre = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drP("LIGA"), drP("ANCHO"), drP("ALTO"))
|
||||||
If drP("PopUp").ToString = "S" Then LinkPadre = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drP("LIGA"), drP("ANCHO"), drP("ALTO"))
|
|
||||||
|
Dim Hijos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloPadre) Order By h!Orden
|
||||||
Dim Hijos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloPadre) Order By h!Orden
|
If CveModulo = drP("CveModulo").ToString.ToEntero Then
|
||||||
If CveModulo = drP("CveModulo").ToString.ToEntero Then
|
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i></li> <li><a href='{0}'>{1}</a>", LinkPadre, drP("Modulo").ToString)
|
||||||
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i></li> <li><a href='{0}'>{1}</a>", LinkPadre, drP("Modulo").ToString)
|
ScriptColorGrupoModulo = ColorPage(drP("CveGrupoModulo").ToString.ToEntero)
|
||||||
ScriptColorGrupoModulo = ColorPage(drP("CveGrupoModulo").ToString.ToEntero)
|
End If
|
||||||
End If
|
If Hijos.Count > 0 Then
|
||||||
If Hijos.Count > 0 Then
|
Linkpapa = LinkPadre
|
||||||
Linkpapa = LinkPadre
|
LinkPadre = LinkBase
|
||||||
LinkPadre = LinkBase
|
MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}<span class='title'>{1}</span><span id='j{3}' ></span><span class='arrow '></span></a><ul class='sub-menu'>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), ""), drP("CveModulo"))
|
||||||
MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}<span class='title'>{1}</span><span id='j{3}' ></span><span class='arrow '></span></a><ul class='sub-menu'>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), ""), drP("CveModulo"))
|
For Each drH As DataRow In Hijos
|
||||||
For Each drH As DataRow In Hijos
|
Dim CveModuloHijo As Integer = drH("CveModulo").ToString.ToEntero
|
||||||
Dim CveModuloHijo As Integer = drH("CveModulo").ToString.ToEntero
|
LinkHijo = drH("LIGA").ToString
|
||||||
LinkHijo = drH("LIGA").ToString
|
If CveModulo = drH("CveModulo").ToString.ToEntero Then
|
||||||
If CveModulo = drH("CveModulo").ToString.ToEntero Then
|
CveModuloPadreSeleccionado = CveModuloPadre
|
||||||
CveModuloPadreSeleccionado = CveModuloPadre
|
ClassActive = "class='active'"
|
||||||
ClassActive = "class='active'"
|
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a>", Linkpapa, drP("Modulo").ToString, LinkHijo, drH("Modulo").ToString)
|
||||||
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a>", Linkpapa, drP("Modulo").ToString, LinkHijo, drH("Modulo").ToString)
|
ScriptColorGrupoModulo = ColorPage(drH("CveGrupoModulo").ToString.ToEntero)
|
||||||
ScriptColorGrupoModulo = ColorPage(drH("CveGrupoModulo").ToString.ToEntero)
|
Else
|
||||||
Else
|
|
||||||
|
ClassActive = ""
|
||||||
ClassActive = ""
|
End If
|
||||||
End If
|
If drH("PopUp").ToString = "S" Then LinkHijo = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drH("LIGA"), drH("ANCHO"), drH("ALTO"))
|
||||||
If drH("PopUp").ToString = "S" Then LinkHijo = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drH("LIGA"), drH("ANCHO"), drH("ALTO"))
|
|
||||||
|
Dim Nietos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloHijo) Order By h!Orden
|
||||||
Dim Nietos = From h In dt.AsEnumerable Where h!CvePadre.Equals(CveModuloHijo) Order By h!Orden
|
If Nietos.Count > 0 Then
|
||||||
If Nietos.Count > 0 Then
|
Linkson = LinkHijo
|
||||||
Linkson = LinkHijo
|
LinkHijo = LinkBase
|
||||||
LinkHijo = LinkBase
|
MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}{1}<span class='arrow '></span> </a><ul class='sub-menu'>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), drH("CveModulo"))
|
||||||
MenuHTML.AppendFormat("<li id='m{3}'><a href='{0}'>{2}{1}<span class='arrow '></span> </a><ul class='sub-menu'>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), drH("CveModulo"))
|
For Each drN As DataRow In Nietos
|
||||||
For Each drN As DataRow In Nietos
|
LinkNieto = drN("LIGA").ToString
|
||||||
LinkNieto = drN("LIGA").ToString
|
If CveModulo = drN("CveModulo").ToString.ToEntero Then
|
||||||
If CveModulo = drN("CveModulo").ToString.ToEntero Then
|
CveModuloPadreSeleccionado = CveModuloPadre : CveModuloHijoSeleccionado = CveModuloHijo
|
||||||
CveModuloPadreSeleccionado = CveModuloPadre : CveModuloHijoSeleccionado = CveModuloHijo
|
ClassActive = "class='active'"
|
||||||
ClassActive = "class='active'"
|
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{4}'>{5}</a>", Linkpapa, drP("Modulo").ToString, Linkson, drH("Modulo").ToString, LinkNieto, drN("Modulo"))
|
||||||
HeaderBar.AppendFormat("<i class='fa fa-angle-right'></i> </li><li><a href='{0}'>{1}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{2}'>{3}</a> <i class='fa fa-angle-right'></i> </li><li><a href='{4}'>{5}</a>", Linkpapa, drP("Modulo").ToString, Linkson, drH("Modulo").ToString, LinkNieto, drN("Modulo"))
|
ScriptColorGrupoModulo = ColorPage(drN("CveGrupoModulo").ToString.ToEntero)
|
||||||
ScriptColorGrupoModulo = ColorPage(drN("CveGrupoModulo").ToString.ToEntero)
|
Else
|
||||||
Else
|
ClassActive = ""
|
||||||
ClassActive = ""
|
End If
|
||||||
End If
|
If drN("PopUp").ToString = "S" Then LinkNieto = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drN("LIGA"), drN("ANCHO"), drN("ALTO"))
|
||||||
If drN("PopUp").ToString = "S" Then LinkNieto = String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drN("LIGA"), drN("ANCHO"), drN("ALTO"))
|
MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkNieto, drN("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drN("Estilo")), ""), ClassActive)
|
||||||
MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkNieto, drN("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drN("Estilo")), ""), ClassActive)
|
Next
|
||||||
Next
|
MenuHTML.AppendFormat("</ul></li>")
|
||||||
MenuHTML.AppendFormat("</ul></li>")
|
Else
|
||||||
Else
|
MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), ClassActive)
|
||||||
MenuHTML.AppendFormat("<li {3}><a href=""{0}"">{2}{1}</a></li>", LinkHijo, drH("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drH("Estilo")), ""), ClassActive)
|
End If
|
||||||
End If
|
Next
|
||||||
Next
|
MenuHTML.AppendFormat("</ul></li>")
|
||||||
MenuHTML.AppendFormat("</ul></li>")
|
Else
|
||||||
Else
|
MenuHTML.AppendFormat("<li><a href=""{0}"">{2}<span class='title'>{1}</span></a></li>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), ""))
|
||||||
MenuHTML.AppendFormat("<li><a href=""{0}"">{2}<span class='title'>{1}</span></a></li>", LinkPadre, drP("Modulo"), If(drP("Estilo").ToString <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), ""))
|
End If
|
||||||
End If
|
Next
|
||||||
Next
|
|
||||||
|
If CveModuloPadreSeleccionado > 0 Then
|
||||||
If CveModuloPadreSeleccionado > 0 Then
|
MenuHTML = MenuHTML.Replace(String.Format("id='m{0}'", CveModuloPadreSeleccionado), String.Format("id='m{0}' class='active open'", CveModuloPadreSeleccionado))
|
||||||
MenuHTML = MenuHTML.Replace(String.Format("id='m{0}'", CveModuloPadreSeleccionado), String.Format("id='m{0}' class='active open'", CveModuloPadreSeleccionado))
|
MenuHTML = MenuHTML.Replace(String.Format("id='j{0}'", CveModuloPadreSeleccionado), String.Format("id='j{0}' class='selected'", CveModuloPadreSeleccionado))
|
||||||
MenuHTML = MenuHTML.Replace(String.Format("id='j{0}'", CveModuloPadreSeleccionado), String.Format("id='j{0}' class='selected'", CveModuloPadreSeleccionado))
|
Else
|
||||||
Else
|
End If
|
||||||
End If
|
If CveModuloHijoSeleccionado > 0 Then
|
||||||
If CveModuloHijoSeleccionado > 0 Then
|
MenuHTML = MenuHTML.Replace(String.Format("id='m{0}'", CveModuloHijoSeleccionado), String.Format("id='m{0}' class='open'", CveModuloHijoSeleccionado))
|
||||||
MenuHTML = MenuHTML.Replace(String.Format("id='m{0}'", CveModuloHijoSeleccionado), String.Format("id='m{0}' class='open'", CveModuloHijoSeleccionado))
|
MenuHTML = MenuHTML.Replace(String.Format("id='j{0}'", CveModuloHijoSeleccionado), String.Format("id='j{0}' class='selected'", CveModuloHijoSeleccionado))
|
||||||
MenuHTML = MenuHTML.Replace(String.Format("id='j{0}'", CveModuloHijoSeleccionado), String.Format("id='j{0}' class='selected'", CveModuloHijoSeleccionado))
|
End If
|
||||||
End If
|
HeaderBar.AppendFormat("</li>{0}", ScriptColorGrupoModulo)
|
||||||
HeaderBar.AppendFormat("</li>{0}", ScriptColorGrupoModulo)
|
BarraNavegacion.Text = HeaderBar.ToString
|
||||||
BarraNavegacion.Text = HeaderBar.ToString
|
CargaMenu(MenuHTML)
|
||||||
CargaMenu(MenuHTML)
|
End Sub
|
||||||
End Sub
|
|
||||||
|
|
||||||
|
Private Function ColorPage(value As Integer) As String
|
||||||
Private Function ColorPage(value As Integer) As String
|
|
||||||
|
Select Case value
|
||||||
Select Case value
|
Case 1
|
||||||
Case 1
|
Return "<script>$('body').addClass('ventasbody')</script>"
|
||||||
Return "<script>$('body').addClass('ventasbody')</script>"
|
Case 2
|
||||||
Case 2
|
Return "<script>$('body').addClass('comprasbody')</script>"
|
||||||
Return "<script>$('body').addClass('comprasbody')</script>"
|
Case 3
|
||||||
Case 3
|
Return "<script>$('body').addClass('bancosbody')</script>"
|
||||||
Return "<script>$('body').addClass('bancosbody')</script>"
|
Case 4
|
||||||
Case 4
|
Return "<script>$('body').addClass('ocomprabody')</script>"
|
||||||
Return "<script>$('body').addClass('ocomprabody')</script>"
|
Case 5
|
||||||
Case 5
|
Return "<script>$('body').addClass('inventariosbody')</script>"
|
||||||
Return "<script>$('body').addClass('inventariosbody')</script>"
|
Case 6
|
||||||
Case 6
|
Return "<script>$('body').addClass('oserviciobody')</script>"
|
||||||
Return "<script>$('body').addClass('oserviciobody')</script>"
|
Case 7
|
||||||
Case 7
|
Return "<script>$('body').addClass('oibody')</script>"
|
||||||
Return "<script>$('body').addClass('oibody')</script>"
|
Case 8
|
||||||
Case 8
|
Return "<script>$('body').addClass('contabilidadbody')</script>"
|
||||||
Return "<script>$('body').addClass('contabilidadbody')</script>"
|
Case 9
|
||||||
Case 9
|
Return "<script>$('body').addClass('rhumanosbody')</script>"
|
||||||
Return "<script>$('body').addClass('rhumanosbody')</script>"
|
Case 10
|
||||||
Case 10
|
Return "<script>$('body').addClass('afijosbody')</script>"
|
||||||
Return "<script>$('body').addClass('afijosbody')</script>"
|
Case Else
|
||||||
Case Else
|
Return ""
|
||||||
Return ""
|
End Select
|
||||||
End Select
|
End Function
|
||||||
End Function
|
|
||||||
|
Private Sub CargaMenu(Texto As StringBuilder)
|
||||||
Private Sub CargaMenu(Texto As StringBuilder)
|
Menu.Text = Texto.ToString
|
||||||
Menu.Text = Texto.ToString
|
End Sub
|
||||||
End Sub
|
|
||||||
|
#Region "Notificaciones"
|
||||||
#Region "Notificaciones"
|
|
||||||
|
Private Sub CargarNotificaciones()
|
||||||
Private Sub CargarNotificaciones()
|
Dim Notificaciones As New StringBuilder
|
||||||
Dim Notificaciones As New StringBuilder
|
|
||||||
|
'Bienvenida
|
||||||
'Bienvenida
|
Notificaciones.Append(ItemNotificaciones("Bienvenido a SIG ", "Hoy", "fa fa-bullhorn"))
|
||||||
Notificaciones.Append(ItemNotificaciones("Bienvenido a SIG ", "Hoy", "fa fa-bullhorn"))
|
|
||||||
|
'Certificado
|
||||||
'Certificado
|
Dim fechacer As String = ConvertCER()
|
||||||
Dim fechacer As String = ConvertCER()
|
If fechacer = "" OrElse (((DateTime.Parse(fechacer).Month - Now.Month) < 2) AndAlso ((DateTime.Parse(fechacer).Year - Now.Year) < 1)) Then
|
||||||
If fechacer = "" OrElse (((DateTime.Parse(fechacer).Month - Now.Month) < 2) AndAlso ((DateTime.Parse(fechacer).Year - Now.Year) < 1)) Then
|
Notificaciones.Append(ItemNotificaciones("Su certificado expira en: ", fechacer, Tipo:="warning"))
|
||||||
Notificaciones.Append(ItemNotificaciones("Su certificado expira en: ", fechacer, Tipo:="warning"))
|
countNotificaciones = countNotificaciones + 1
|
||||||
countNotificaciones = countNotificaciones + 1
|
Else
|
||||||
Else
|
Notificaciones.Append(ItemNotificaciones("Su certificado expira en: ", fechacer))
|
||||||
Notificaciones.Append(ItemNotificaciones("Su certificado expira en: ", fechacer))
|
End If
|
||||||
End If
|
|
||||||
|
'C A R G A - A L E R T A S - O R D E N E S D E C O M P R A
|
||||||
'C A R G A - A L E R T A S - O R D E N E S D E C O M P R A
|
If UsuarioActual.CveUsuario = 1459 Then
|
||||||
If UsuarioActual.CveUsuario = 1459 Then
|
Dim OC As New ClsOC
|
||||||
Dim OC As New ClsOC
|
If OC.GetOrdenesPendientes("-1", 0, UsuarioActual.CveEmpresa, -1, -1, -1, UsuarioActual.CveUsuario, -1) Then
|
||||||
If OC.GetOrdenesPendientes("-1", 0, UsuarioActual.CveEmpresa, -1, -1, -1, UsuarioActual.CveUsuario, -1) Then
|
If (OC.DtResultados.Rows.Count > 0) Then
|
||||||
If (OC.DtResultados.Rows.Count > 0) Then
|
Notificaciones.Append(ItemNotificaciones(String.Format("Orden de Compra por atender {0}", OC.DtResultados.Rows.Count), Ico:="fa fa-tags", Tipo:="warning", Link:="/OC/RepOC.aspx"))
|
||||||
Notificaciones.Append(ItemNotificaciones(String.Format("Orden de Compra por atender {0}", OC.DtResultados.Rows.Count), Ico:="fa fa-tags", Tipo:="warning", Link:="/OC/RepOC.aspx"))
|
countNotificaciones = countNotificaciones + 1
|
||||||
countNotificaciones = countNotificaciones + 1
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
OC.Dispose()
|
||||||
OC.Dispose()
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
|
''OC Pendientes por atender
|
||||||
''OC Pendientes por atender
|
'Dim OC As New ClsOC
|
||||||
'Dim OC As New ClsOC
|
'If OC.GetOrdenesPendientes("-1", 0, UsuarioActual.CveEmpresa, -1, -1, -1, UsuarioActual.CveUsuario, -1) Then
|
||||||
'If OC.GetOrdenesPendientes("-1", 0, UsuarioActual.CveEmpresa, -1, -1, -1, UsuarioActual.CveUsuario, -1) Then
|
' Notificaciones.Append(ItemNotificaciones(String.Format("REQ/OC por atender: <b>{0}</b>", OC.DtResultados.Rows.Count), Tipo:=If(OC.DtResultados.Rows.Count > 3, "warning", "info"), Link:="/OC/RepOC.aspx"))
|
||||||
' Notificaciones.Append(ItemNotificaciones(String.Format("REQ/OC por atender: <b>{0}</b>", OC.DtResultados.Rows.Count), Tipo:=If(OC.DtResultados.Rows.Count > 3, "warning", "info"), Link:="/OC/RepOC.aspx"))
|
' If OC.DtResultados.Rows.Count > 0 Then
|
||||||
' If OC.DtResultados.Rows.Count > 0 Then
|
' countNotificaciones = countNotificaciones + 1
|
||||||
' countNotificaciones = countNotificaciones + 1
|
' End If
|
||||||
' End If
|
'End If
|
||||||
'End If
|
'OC.Dispose()
|
||||||
'OC.Dispose()
|
|
||||||
|
LtlMNotificaciones.Text = LtlMNotificaciones.Text & Notificaciones.ToString
|
||||||
LtlMNotificaciones.Text = LtlMNotificaciones.Text & Notificaciones.ToString
|
End Sub
|
||||||
End Sub
|
|
||||||
|
|
||||||
|
Private Function ConvertCER() As String
|
||||||
Private Function ConvertCER() As String
|
Try
|
||||||
Try
|
Dim Archivo As String = String.Format("{0}Empresas\{1}\Certificados\{2}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.ArchivoCer)
|
||||||
Dim Archivo As String = String.Format("{0}Empresas\{1}\Certificados\{2}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.ArchivoCer)
|
If File.Exists(Archivo) Then
|
||||||
If File.Exists(Archivo) Then
|
Dim CerFile As New FileStream(Archivo, FileMode.Open, FileAccess.Read)
|
||||||
Dim CerFile As New FileStream(Archivo, FileMode.Open, FileAccess.Read)
|
Dim Size As Integer = CerFile.Length.ToString.ToEntero()
|
||||||
Dim Size As Integer = CerFile.Length.ToString.ToEntero()
|
Dim Data As Byte() = New Byte(Size - 1) {}
|
||||||
Dim Data As Byte() = New Byte(Size - 1) {}
|
Size = CerFile.Read(Data, 0, Size)
|
||||||
Size = CerFile.Read(Data, 0, Size)
|
CerFile.Close()
|
||||||
CerFile.Close()
|
CerFile.Dispose()
|
||||||
CerFile.Dispose()
|
|
||||||
|
Dim x509 As New X509Certificate2()
|
||||||
Dim x509 As New X509Certificate2()
|
x509.Import(Data)
|
||||||
x509.Import(Data)
|
Return x509.NotAfter.ToShortDateString()
|
||||||
Return x509.NotAfter.ToShortDateString()
|
End If
|
||||||
End If
|
|
||||||
|
Catch ex As Exception
|
||||||
Catch ex As Exception
|
Return ""
|
||||||
Return ""
|
End Try
|
||||||
End Try
|
Return ""
|
||||||
Return ""
|
End Function
|
||||||
End Function
|
|
||||||
|
#End Region
|
||||||
#End Region
|
|
||||||
|
#Region "TIPO DE CAMBIO"
|
||||||
#Region "TIPO DE CAMBIO"
|
Private Sub CargaTipoCambio()
|
||||||
Private Sub CargaTipoCambio()
|
Dim ObjGenerales As ClsGenerales = New ClsGenerales
|
||||||
Dim ObjGenerales As ClsGenerales = New ClsGenerales
|
If ObjGenerales.GetTipoCambio(-1, DateTime.Now) And ObjGenerales.DtResultados.Rows.Count > 0 Then
|
||||||
If ObjGenerales.GetTipoCambio(-1, DateTime.Now) And ObjGenerales.DtResultados.Rows.Count > 0 Then
|
lblTipoCambio.Text = String.Format(" | TC {0:C4}", ObjGenerales.DtResultados(0)("TipoCambio").ToString().ToDecimal())
|
||||||
lblTipoCambio.Text = String.Format(" | TC {0:C4}", ObjGenerales.DtResultados(0)("TipoCambio").ToString().ToDecimal())
|
End If
|
||||||
End If
|
ObjGenerales.Dispose()
|
||||||
ObjGenerales.Dispose()
|
End Sub
|
||||||
End Sub
|
#End Region
|
||||||
#End Region
|
|
||||||
End Class
|
End Class
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
<asp:BoundField HeaderText="Estatus" DataField="EstatusFactura" ItemStyle-Width="160px" />
|
<asp:BoundField HeaderText="Estatus" DataField="EstatusFactura" ItemStyle-Width="160px" />
|
||||||
<asp:TemplateField ItemStyle-Width="35px" HeaderText="Verificar">
|
<asp:TemplateField ItemStyle-Width="35px" HeaderText="Verificar">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton runat="server" OnClick="BtnValidar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea verificar la cancelación?" data-btn-ok-label="si"></asp:LinkButton>
|
<asp:LinkButton runat="server" OnClick="BtnValidarRefacturacion_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea verificar la cancelación?" data-btn-ok-label="si"></asp:LinkButton>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:HyperLinkField HeaderText="Refacturación" Text="Refacturar" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveDevolucion={0}&NuevaFactura=1" />
|
<asp:HyperLinkField HeaderText="Refacturación" Text="Refacturar" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveDevolucion={0}&NuevaFactura=1" />
|
||||||
|
|||||||
@@ -78,6 +78,25 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
Alert(VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total));
|
Alert(VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total));
|
||||||
}
|
}
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
|
}
|
||||||
|
protected void BtnValidarRefacturacion_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
||||||
|
int CveCliente = GvRow.DataKey("CveCliente").ToEntero();
|
||||||
|
string Total = GvRow.DataKey("Total");
|
||||||
|
string SubTotal = GvRow.DataKey("SubTotal");
|
||||||
|
string Uuid = GvRow.DataKey("FolioFiscal");
|
||||||
|
string RFCCliente = GvRow.DataKey("RFCCliente");
|
||||||
|
string Folio = GvRow.DataKey("Folio");
|
||||||
|
string TipoDocto = GvRow.DataKey("TipoDocto");
|
||||||
|
string Nombre = GvRow.DataKey("Nombre");
|
||||||
|
if (CveVenta > 0)
|
||||||
|
{
|
||||||
|
Alert(VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total, true));
|
||||||
|
}
|
||||||
|
CargaDatos();
|
||||||
}
|
}
|
||||||
private string VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false)
|
private string VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false)
|
||||||
{
|
{
|
||||||
@@ -132,7 +151,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes["Fecha"].Value.ToDate();
|
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes["Fecha"].Value.ToDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje;
|
var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion).Mensaje;
|
||||||
|
|
||||||
sb.AppendFormat("{0} <br/>", FueCancelado);
|
sb.AppendFormat("{0} <br/>", FueCancelado);
|
||||||
if (CveEstatus.Contiene(4, 5) && EsRefacturacion)
|
if (CveEstatus.Contiene(4, 5) && EsRefacturacion)
|
||||||
@@ -170,10 +189,19 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion)
|
private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false)
|
||||||
{
|
{
|
||||||
|
Modelos.Factura.MCancelacionVentaMensaje retorno = null;
|
||||||
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa);
|
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa);
|
||||||
var retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse);
|
if (EsRefacturacion)
|
||||||
|
{
|
||||||
|
retorno = factura.CancelarPorRefacturacion();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse);
|
||||||
|
}
|
||||||
|
|
||||||
return retorno;
|
return retorno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user