diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index 4e0ef922e..7b7617049 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -384,10 +384,32 @@ Public Class ClsGenerales
End Try
Return ds
- End Function
-
+ End Function
+
+ Public Function GetDashboardData(CveEmpresa As Integer) As DataSet
+ Dim ds As New DataSet
+ DataAdapter("PA_Gral_DashboardsGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Opcion", SqlDbType.Int).Value = 1
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FechaInicio", SqlDbType.Date).Value = Date.Now.AddYears(-1)
+ .Add("@FechaFin", SqlDbType.Date).Value = Date.Now
+ End With
+
+ Try
+ SqlAdapter.Fill(ds)
+ ds.Tables(0).TableName = "Indicadores"
+ ds.Tables(1).TableName = "DetalleDia"
+ Return ds
+ Catch ex As Exception
+ ' Manejo de errores
+ Return Nothing
+ End Try
+ End Function
+
+
#End Region
-
+
#Region " D I A S I N H A B I L E S "
Public Function DiasInhabiles_Add(CveEmpresa As Integer, CveUsuario As Integer, DiaInhabil As String, Descripcion As String, Estatus As Integer, FechaInhabil As Date) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index b48d0ecb2..a89c07bd9 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -10556,6 +10556,7 @@ Public Class ClsPaginas
PaginaDict.Add("/General/CatMedidaEquivalencia.aspx".ToUpper(), 773)
PaginaDict.Add("/General/RepIndicadorResumen.aspx".ToUpper(), 110)
PaginaDict.Add("/General/SaldosMenores.aspx".ToUpper(), -1)
+ PaginaDict.Add("/General/Dashboard.aspx".ToUpper(), 17)
#End Region
#Region "GPS"
PaginaDict.Add("/GPS/RepTemperatura.aspx".ToUpper(), 681)
diff --git a/General/Dashboard.aspx b/General/Dashboard.aspx
new file mode 100644
index 000000000..95553bddd
--- /dev/null
+++ b/General/Dashboard.aspx
@@ -0,0 +1,55 @@
+<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Dashboard.aspx.vb" Inherits="General_Dashboard" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/General/Dashboard.aspx.vb b/General/Dashboard.aspx.vb
new file mode 100644
index 000000000..7384cc14f
--- /dev/null
+++ b/General/Dashboard.aspx.vb
@@ -0,0 +1,101 @@
+
+Imports System.Data
+Imports Extensiones
+Imports System.Web.Services
+Imports Newtonsoft.Json
+Imports ADSNetLibrary.SIGAPI.Models.CRM.Request
+Imports ADSNetLibrary.SIGAPI.Services.CRM
+
+Partial Class General_Dashboard
+ Inherits ClsPaginas
+
+ Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
+ If Not IsPostBack Then
+ CargarIndicadores()
+ End If
+ End Sub
+
+ Private Sub CargarIndicadores()
+ Dim Gral As New ClsGenerales
+ Dim ds As DataSet = Gral.GetDashboardData(UsuarioActual.CveEmpresa)
+
+ If ds IsNot Nothing AndAlso ds.Tables.Count > 0 Then
+ ProcesarDatosIndicadores(ds.Tables(0))
+ End If
+ End Sub
+
+ Private Sub ProcesarDatosIndicadores(dt As DataTable)
+ If dt.Rows.Count > 0 Then
+ Dim dr As DataRow = dt.Rows(0)
+
+ ' Indicador Año
+ MuestraIndicador(DivIndicadores, "blue", "fa fa-calendar", "Año Actual", dr("AcumAño").ToString.FormatoNumero(0), "#", "Acumulado",
+ dr("AcumAñoPromedio").ToString.FormatoNumero(0), "#", "Promedio",
+ dr("AcumAñoContado").ToString.FormatoNumero(0), "#", "Contado",
+ dr("AcumAñoCredito").ToString.FormatoNumero(0), "#", "Crédito")
+
+ ' Indicador Mes
+ MuestraIndicador(DivIndicadores, "green", "fa fa-calendar-check-o", "Mes Actual",
+ dr("AcumMes").ToString.FormatoNumero(0), "#", "Acumulado",
+ dr("AcumMesPromedio").ToString.FormatoNumero(0), "#", "Promedio",
+ dr("AcumMesContado").ToString.FormatoNumero(0), "#", "Contado",
+ dr("AcumMesCredito").ToString.FormatoNumero(0), "#", "Crédito")
+
+ ' Indicador Semana
+ MuestraIndicador(DivIndicadores, "purple", "fa fa-calendar-minus-o", "Semana Actual",
+ dr("AcumSemana").ToString.FormatoNumero(0), "#", "Acumulado",
+ dr("AcumSemanaPromedio").ToString.FormatoNumero(0), "#", "Promedio",
+ dr("AcumSemanaContado").ToString.FormatoNumero(0), "#", "Contado",
+ dr("AcumSemanaCredito").ToString.FormatoNumero(0), "#", "Crédito")
+
+
+ MuestraIndicador(DivIndicadores, "red", "fa fa-sun-o", "Hoy",
+ "0".FormatoNumero(0), "#", "Acumulado",
+ "0".FormatoNumero(0), "#", "Promedio",
+ "0".FormatoNumero(0), "#", "Contado",
+ "0".FormatoNumero(0), "#", "Crédito")
+ End If
+ End Sub
+
+ Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String, Link As String, TitleComentario As String)
+ Dim htmldiv As New StringBuilder
+ htmldiv.AppendFormat("{0}
", Link)
+ DIV.InnerHtml = htmldiv.ToString
+ End Sub
+ Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String)
+ Dim htmldiv As New StringBuilder
+ htmldiv.AppendFormat("{0}
")
+ DIV.InnerHtml = htmldiv.ToString
+ End Sub
+ Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String)
+ Dim htmldiv As New StringBuilder
+ htmldiv.AppendFormat("{0}
")
+ DIV.InnerHtml = htmldiv.ToString
+ End Sub
+ Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String, C4 As String, CL4 As String, CT4 As String)
+ Dim htmldiv As New StringBuilder
+ htmldiv.AppendFormat("{0}
", CL1)
+ DIV.InnerHtml = htmldiv.ToString
+ End Sub
+
+End Class
diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
index 734b66b09..9df5b9e39 100644
--- a/Ventas/PVCobranza.aspx.vb
+++ b/Ventas/PVCobranza.aspx.vb
@@ -747,7 +747,7 @@ Partial Class Ventas_PVCobranza
CveVentaRemision = HdnCveVenta.Value.ToEntero
- respFactura = GenerarFactura(CveVendedor, VentaActual, ObjVentas2, ObjClientes, ObservacionesAlmacen, VentaContado, PlazoCobranza, Observaciones, PedidoContrato, OrdenCompra)
+ respFactura = GenerarFactura(tCveCorte, CveVendedor, VentaActual, ObjVentas2, ObjClientes, ObservacionesAlmacen, VentaContado, PlazoCobranza, Observaciones, PedidoContrato, OrdenCompra)
If respFactura Is Nothing Then
MsgError = "Ocurrió un error al generar la factura"
@@ -1281,7 +1281,7 @@ Partial Class Ventas_PVCobranza
UpL.Update()
End Sub
- Private Function GenerarFactura(CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes, ObservacionesAlmacen As String, VentaConta As Boolean, PlazoCobranza As Integer, Observaciones As String, PedidoContrato As String, OrdenCompra As String) As Modelos.Factura.MMensajeFactura
+ Private Function GenerarFactura(CveCorte As Integer, CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes, ObservacionesAlmacen As String, VentaConta As Boolean, PlazoCobranza As Integer, Observaciones As String, PedidoContrato As String, OrdenCompra As String) As Modelos.Factura.MMensajeFactura
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim SbAlert As New StringBuilder()
Dim SBAmortizaciones As New StringBuilder
@@ -1466,6 +1466,8 @@ Partial Class Ventas_PVCobranza
End If
End If
+ ObjFactura.CveCorte = CveCorte
+
Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjFactura