This commit is contained in:
Luis Quijada
2025-04-22 12:42:45 -07:00
20 changed files with 814 additions and 411 deletions

View File

@@ -7697,7 +7697,7 @@ Public Class ClsVentas
End Function End Function
Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveVendedor As Integer, CveUsuarioTecnico As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_SMS_IndicadoresGet") DataAdapter("PA_SMS_IndicadoresGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -7705,6 +7705,8 @@ Public Class ClsVentas
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveUsuarioTecnico", SqlDbType.Int).Value = CveUsuarioTecnico
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try

View File

@@ -132,7 +132,8 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
Dim data As New JArray Dim data As New JArray
Dim dtt As New DataTable Dim dtt As New DataTable
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepRemisionesSinFacturar(Now.AddYears(-2).ToShortDateString, Now.ToShortDateString, Now.ToShortDateString, CveSubProyecto, -1, -1, "-1", CveEmpresa, CveUsuarioConsulta:=100, PrimerProducto:=True) Then Dim FechaInicio As String = Now.AddYears(-2).ToShortDateString
If ObjVentas.GetRepRemisionesSinFacturar(FechaInicio, Now.AddDays(1).ToShortDateString, Now.AddDays(1).ToShortDateString, CveSubProyecto, -1, -1, "-1", CveEmpresa, CveUsuarioConsulta:=100, PrimerProducto:=True) Then
dtt = ObjVentas.DtResultados.FiltraParametros("CveVenta > 0") dtt = ObjVentas.DtResultados.FiltraParametros("CveVenta > 0")
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
@@ -296,6 +297,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
End If End If
Else Else
TieneError = True TieneError = True
MsgError = "Falta información para completar la venta."
End If End If
End If End If
If Not TieneError Then If Not TieneError Then

View File

@@ -372,7 +372,7 @@
<ContentTemplate> <ContentTemplate>
<br /> <br />
<div style="height: 250px; overflow-x: scroll"> <div style="height: 250px; overflow-x: scroll">
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, Importe, SerieFolio,CveCuenta,CveSubProyecto" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%;" GridLines="None"> <asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, Importe, SerieFolio,CveCuenta,CveSubProyecto,SobranteFaltante" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>

View File

@@ -323,8 +323,17 @@ Partial Class Bancos_DepositosCaja
End If End If
End If End If
NuevaCvePrePoliza = ObjConta.AddPrePolizas("DepCaja", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, $"Depósito Bancario - {DdlTipoDeposito.SelectedItem.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=1) Dim ImporteSobFaltante As Decimal = 0
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
For Each Gvr As GridViewRow In GvFacturas.Rows
If Gvr.FCCheckBox("ChkFactura").Checked Then
ImporteSobFaltante += Gvr.DataKey("SobranteFaltante").ToDecimal()
End If
Next
End If
NuevaCvePrePoliza = ObjConta.AddPrePolizas("DepCaja", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, $"Depósito Bancario - {DdlTipoDeposito.SelectedItem.Text} {If(ImporteSobFaltante <> 0, $"- Sobrante/faltante: ${ImporteSobFaltante:N2}", "")}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=1)
Dim CveTransaccionBanco As Integer = DdlTipoDeposito.SelectedValue.ToEntero Dim CveTransaccionBanco As Integer = DdlTipoDeposito.SelectedValue.ToEntero

View File

@@ -1363,7 +1363,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--4--%> <%--4--%>
<asp:BoundField ItemStyle-Width="120px" HeaderText="P.U." DataField="PU" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField ItemStyle-Width="120px" HeaderText="P.U." DataField="PU" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" />
<%--5--%> <%--5--%>
<asp:TemplateField ItemStyle-Width="10%"> <asp:TemplateField ItemStyle-Width="10%">
<ItemTemplate> <ItemTemplate>

View File

@@ -17545,7 +17545,7 @@ Partial Class Compras_Compras
End If End If
If TxtDescuento.Text.ToDouble > 0 Then TrDescuento.Visible = True If TxtDescuento.Text.ToDouble > 0 Then TrDescuento.Visible = True
If ActualizaTotales And UsuarioActual.CveEmpresa = 72 Or Not CveCompraFactura > 0 Then If ActualizaTotales And (UsuarioActual.CveEmpresa = 72 Or Not CveCompraFactura > 0) Then
TxtTotal.Text = Total.ToString.FormatoNumero() TxtTotal.Text = Total.ToString.FormatoNumero()
If CveCompra > 0 AndAlso CveCompraFactura = 0 Then If CveCompra > 0 AndAlso CveCompraFactura = 0 Then
TxtIVA.Text = IVA.ToString.FormatoNumero() TxtIVA.Text = IVA.ToString.FormatoNumero()

View File

@@ -1168,7 +1168,7 @@ Partial Class Compras_eFacturas
'End If 'End If
Dim Funcionalidad123 As Integer = UsuarioActual.Empresa.Funcionalidad(123).ToEntero Dim Funcionalidad123 As Integer = UsuarioActual.Empresa.Funcionalidad(123).ToEntero
If Funcionalidad123 > 0 Then If Funcionalidad123 > 0 AndAlso Not e.Row.DataKey("CveFactura").ToEntero.Contiene(1223188) Then
If NowADS().Day >= Funcionalidad123 Then If NowADS().Day >= Funcionalidad123 Then
Dim FechaLimite As Date = New Date(NowADS().Year, NowADS().Month, 1) Dim FechaLimite As Date = New Date(NowADS().Year, NowADS().Month, 1)
If e.Row.DBCampo("FechaFactura").ToDate < FechaLimite Then If e.Row.DBCampo("FechaFactura").ToDate < FechaLimite Then

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DiarioPagos.aspx.vb" Inherits="Contabilidad_DiarioPagos" %> <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DiarioPagos.aspx.vb" Inherits="Contabilidad_DiarioPagos" ValidateRequest="false" %>
<%@ Import Namespace="Extensiones" %> <%@ Import Namespace="Extensiones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">

View File

@@ -1217,8 +1217,8 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>CAMELIA No.Ext: 619, Col: Libertad, <Value>SIMON BLEY No.Ext: 355, No.Int: A, Col: Olivares,
CP: 83130, Hermosillo,Sonora, México</Value> CP: 83180, Hermosillo,Sonora, México</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>

View File

@@ -1471,20 +1471,8 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>SIMON BLEY 355, COL. OLIVARES</Value> <Value>SIMON BLEY No.Ext: 355, No.Int: A, Col: Olivares,
<Style> CP: 83180, Hermosillo,Sonora, México</Value>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>HERMOSILLO SONORA CP 83180 MEXICO</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>

View File

@@ -1385,20 +1385,8 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>CAMELIA 619 LIBERTAD HERMOSILLO</Value> <Value>SIMON BLEY No.Ext: 355, No.Int: A, Col: Olivares,
<Style> CP: 83180, Hermosillo,Sonora, México</Value>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>HERMOSILLO SONORA CP 83130 MEXICO</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>

View File

@@ -630,8 +630,11 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Camelia No. Ext. 619</Value> <Value>SIMON BLEY No.Ext: 355, No.Int: A, </Value>
<Style /> <Style>
<FontFamily>Calibri</FontFamily>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
@@ -641,8 +644,11 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Col. Libertad C.P. 83130</Value> <Value>Col: Olivares, CP: 83180,</Value>
<Style /> <Style>
<FontFamily>Calibri</FontFamily>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
@@ -652,8 +658,11 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>México</Value> <Value> Hermosillo,Sonora, México</Value>
<Style /> <Style>
<FontFamily>Calibri</FontFamily>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>

View File

@@ -66,10 +66,9 @@
margin-left: 28%; margin-left: 28%;
} }
.calendariobody label { .calendariobody label {
font-size: 12px; font-size: 12px;
} }
.tareasinicio tr td:nth-child(1) { .tareasinicio tr td:nth-child(1) {
} }
@@ -107,11 +106,11 @@
display: block; display: block;
} }
#moopio a:hover { #moopio a:hover {
background-color: rgba(0,0,0,0.5); background-color: rgba(0,0,0,0.5);
transform: scale(1.2); transform: scale(1.2);
cursor: default; cursor: default;
} }
.MultiLineTextBox { .MultiLineTextBox {
@@ -124,7 +123,29 @@
} }
//#region highcharts
#divsmsdash {
/* Estilo general compacto */
--hcg-font-size: 8px !important;
--hcg-padding: 4px;
--hcg-border-radius: 6px;
}
.dashboard-container {
font-size: 16px; /* Tamaño base */
}
.highcharts-data-table table {
/* Estilo general compacto */
--hcg-font-size: 8px !important;
--hcg-padding: 4px;
--hcg-border-radius: 6px;
}
#divsmsdash .hcg-theme-default, .highcharts-datagrid-theme-default {
--hcg-font-size: 10px;
--hcg-padding: 5px;
}
.highcharts-figure, .highcharts-figure,
.highcharts-data-table table { .highcharts-data-table table {
min-width: 310px; min-width: 310px;
@@ -176,78 +197,78 @@
margin: 0.3rem 10px; margin: 0.3rem 10px;
} }
h1#title { h1#title {
padding-top: 10px; padding-top: 10px;
margin: 0; margin: 0;
background-color: #3d3d3d; background-color: #3d3d3d;
text-align: center; text-align: center;
color: #fff; color: #fff;
} }
#kpi-vitamin-a .highcharts-dashboards-component-title::before, #kpi-vitamin-a .highcharts-dashboards-component-title::before,
#kpi-iron .highcharts-dashboards-component-title::before { #kpi-iron .highcharts-dashboards-component-title::before {
width: 14px; width: 14px;
height: 14px; height: 14px;
border-radius: 28px; border-radius: 28px;
display: inline-block; display: inline-block;
padding: 0; padding: 0;
margin-right: 4px; margin-right: 4px;
background-color: var(--highcharts-color-0); background-color: var(--highcharts-color-0);
content: " "; content: " ";
} }
#kpi-iron .highcharts-dashboards-component-title::before { #kpi-iron .highcharts-dashboards-component-title::before {
background-color: var(--highcharts-color-2); background-color: var(--highcharts-color-2);
} }
#kpi-vitamin-a .highcharts-dashboards-component-kpi-subtitle, #kpi-vitamin-a .highcharts-dashboards-component-kpi-subtitle,
#kpi-iron .highcharts-dashboards-component-kpi-subtitle { #kpi-iron .highcharts-dashboards-component-kpi-subtitle {
margin-top: 10px; margin-top: 10px;
font-size: 1.2em; font-size: 1.2em;
color: var(--highcharts-neutral-color-60); color: var(--highcharts-neutral-color-60);
} }
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value, #kpi-vitamin-a .highcharts-dashboards-component-kpi-value,
#kpi-iron .highcharts-dashboards-component-kpi-value { #kpi-iron .highcharts-dashboards-component-kpi-value {
font-size: 4em; font-size: 4em;
line-height: 2.4rem; line-height: 2.4rem;
margin-top: 10px; margin-top: 10px;
color: var(--highcharts-color-0); color: var(--highcharts-color-0);
} }
#kpi-iron .highcharts-dashboards-component-kpi-value { #kpi-iron .highcharts-dashboards-component-kpi-value {
color: var(--highcharts-color-2); color: var(--highcharts-color-2);
} }
#dashboard-col-1 .highcharts-color-0 { #dashboard-col-1 .highcharts-color-0 {
fill: var(--highcharts-color-2); fill: var(--highcharts-color-2);
stroke: var(--highcharts-color-2); stroke: var(--highcharts-color-2);
} }
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value::after, #kpi-vitamin-a .highcharts-dashboards-component-kpi-value::after,
#kpi-iron .highcharts-dashboards-component-kpi-value::after { #kpi-iron .highcharts-dashboards-component-kpi-value::after {
content: ""; content: "";
display: block; display: block;
font-size: 1rem; font-size: 1rem;
} }
.highcharts-plot-line { .highcharts-plot-line {
stroke-dasharray: 2px; stroke-dasharray: 2px;
stroke: var(--highcharts-color-3); stroke: var(--highcharts-color-3);
} }
.highcharts-plot-line-label { .highcharts-plot-line-label {
fill: var(--highcharts-color-3); fill: var(--highcharts-color-3);
} }
.highcharts-description { .highcharts-description {
padding: 0 20px; padding: 0 20px;
} }
#kpi-vitamin-a, #kpi-vitamin-a,
#kpi-iron { #kpi-iron {
flex: 1 1 100%; flex: 1 1 100%;
height: 205px; height: 205px;
} }
/* LARGE */ /* LARGE */
@media (max-width: 1200px) { @media (max-width: 1200px) {
@@ -473,7 +494,7 @@
flex: 1 1 50%; flex: 1 1 50%;
} }
} }
//#endregion
</style> </style>
@@ -498,7 +519,7 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPPIndicador" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UPPIndicador" UpdateMode="Conditional" runat="server" class="row">
<ContentTemplate> <ContentTemplate>
<div style="background-color: #F9F9F9;"> <div style="background-color: #F9F9F9;">
<br /> <br />
@@ -506,10 +527,10 @@
<div class="col-md-2"></div> <div class="col-md-2"></div>
<div class="col-md-3"> <div class="col-md-3">
Indicador Indicador
<asp:DropDownList ID="DdlFiltroIndicador" CssClass="form-control select2me" runat="server" OnSelectedIndexChanged="DdlFiltroIndicador_SelectedIndexChanged"> <asp:DropDownList ID="DdlFiltroIndicador" CssClass="form-control select2me" runat="server" OnSelectedIndexChanged="DdlFiltroIndicador_SelectedIndexChanged">
<asp:ListItem Text="Gerencial" Selected="true" Value="Ger"></asp:ListItem> <asp:ListItem Text="Gerencial" Selected="true" Value="Ger"></asp:ListItem>
<asp:ListItem Text="Recursos Humanos" Value="RH"></asp:ListItem> <asp:ListItem Text="Recursos Humanos" Value="RH"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1"></div> <div class="col-md-1"></div>
<div class="col-md-3"> <div class="col-md-3">
@@ -527,9 +548,32 @@
</div> </div>
</div> </div>
<br /> <br />
<div class="row" runat="server" id="divsms1"> <div class="row" style="width: 95%; margin-right: 2.5%; margin-left: 2.5%;" runat="server" id="divsms1" visible="false">
<div class="row" > <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
<div id="divsmsdash" /> <ContentTemplate>
<div class="row" >
<div class="col-md-1">Opción:</div>
<div class="col-md-3">
<asp:DropDownList ID="DdlSMSOpciones" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlSMSOpciones_SelectedIndexChanged">
<asp:ListItem Text="Vendedor" Value="1" />
<asp:ListItem Text="Gerente Ventas" Value="2" Selected="True" />
<asp:ListItem Text="Almacen" Value="3" />
<asp:ListItem Text="Técnico" Value="4" />
<asp:ListItem Text="Gerente Técnico" Value="5" />
</asp:DropDownList>
</div>
<div class="col-md-3">
<asp:DropDownList ID="DdlSMSVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="DdlSMSVendedores_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="DdlSMSTecnico" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="DdlSMSTecnico_SelectedIndexChanged" >
</asp:DropDownList>
</div>
</div>
<div class="row" >
<div id="divsmsdash" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div> </div>
<br /> <br />

View File

@@ -4,7 +4,6 @@ Imports System.Web.Services
Imports Newtonsoft.Json Imports Newtonsoft.Json
Imports ADSNetLibrary.SIGAPI.Models.CRM.Request Imports ADSNetLibrary.SIGAPI.Models.CRM.Request
Imports ADSNetLibrary.SIGAPI.Services.CRM Imports ADSNetLibrary.SIGAPI.Services.CRM
Imports ADSNetLibrary.SIGAPI.Models.CRM.Response
Partial Class Inicio Partial Class Inicio
Inherits ClsPaginas Inherits ClsPaginas
@@ -191,8 +190,18 @@ Partial Class Inicio
If UsuarioActual.TienePermisoProceso(343) Then MuestraPsProximosAVencer() If UsuarioActual.TienePermisoProceso(343) Then MuestraPsProximosAVencer()
If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer() If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso UsuarioActual.CveRol.Contiene(1577, 1639, 1573) Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso UsuarioActual.CveUsuario = 3964 Then 'AndAlso UsuarioActual.CveRol.Contiene(1577, 1639, 1573) Then
CargaKPICirugias() Dim Opcion As Integer = 1
Dim CveVendedor As Integer = -1
Dim CveUsuarioTecnico As Integer = -1
divsms1.Visible = True
If UsuarioActual.CveRol = 1577 Then
Opcion = 1 'vendedor
CveVendedor = UsuarioActual.CveVendedor
ElseIf UsuarioActual.CveRol.Contiene(1639, 1573) Then ' rol admin. 1573
Opcion = 2 'gerente ventas
End If
CargaKPICirugias(Opcion, CveVendedor, CveUsuarioTecnico)
End If End If
If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then
@@ -1613,26 +1622,18 @@ Partial Class Inicio
#Region "S M S - I N D I C A D O R E S" #Region "S M S - I N D I C A D O R E S"
Private Sub CargaKPICirugias() Private Sub CargaKPICirugias(Opcion As Integer, Optional CveVendedor As Integer = -1, Optional CveUsuarioTecnico As Integer = -1)
DivIndicadores.InnerHtml = "" DivIndicadores.InnerHtml = ""
Dim Opcion As Integer = 1
Dim dtIndicadores As DataTable = Nothing Dim dtIndicadores As DataTable = Nothing
Dim dtRH As DataTable = Nothing Dim dtRH As DataTable = Nothing
Dim Gral As New ClsVentas Dim Gral As New ClsVentas
Dim ds As DataSet = Nothing Dim ds As DataSet = Nothing
If UsuarioActual.CveRol = 1577 Then
Opcion = 1 'vendedor
ElseIf UsuarioActual.CveRol.Contiene(1639, 1573) Then ' rol admin. 1573
Opcion = 2 'gerente ventas
End If
Dim FechaI As Date = Now.FirstDayOfMonth Dim FechaI As Date = Now.FirstDayOfMonth
Dim FechaF As Date = Now.LastDayOfMonth Dim FechaF As Date = Now.LastDayOfMonth
If Gral.GetSMSIndicadores(Opcion, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If Gral.GetSMSIndicadores(Opcion, FechaI, FechaF, UsuarioActual.CveUsuario, CveVendedor, CveUsuarioTecnico, UsuarioActual.CveEmpresa) Then
ds = Gral.DataSetResultados ds = Gral.DataSetResultados
End If End If
'0-ventas totales, 1-comisiones totales, 2-medicos sin consumo, 3-top10medicos, 4-top5marcas, 5-num pacientes '0-ventas totales, 1-comisiones totales, 2-medicos sin consumo, 3-top10medicos, 4-top5marcas, 5-num pacientes
@@ -1640,64 +1641,70 @@ Partial Class Inicio
Dim StrTexto As New StringBuilder Dim StrTexto As New StringBuilder
Dim StrSource As New StringBuilder Dim StrSource As New StringBuilder
Dim ComisionVendedor, ComisionTecnico, VentasTotales As Decimal Dim ComisionVendedor, ComisionTecnico, VentasTotales As Decimal
Dim TextoKPIVendedores As String Dim NumPacientes As Integer = 0
Dim TextoKPIVendedores As String = ""
Dim dtt As DataTable Dim dtt As DataTable
If Opcion = 1 Then If ds IsNot Nothing AndAlso ds.Tables.Count > 0 Then
If Opcion = 1 Then
#Region "VENDEDORES" #Region "VENDEDORES"
dtt = ds.Tables(0) dtt = ds.Tables(0)
If dtt IsNot Nothing Then If dtt IsNot Nothing Then
VentasTotales = dtt.FiltroPrimeroValor("Importe").ToDecimal VentasTotales = dtt.FiltroPrimeroValor("Importe").ToDecimal
End If End If
dtt = ds.Tables(1) dtt = ds.Tables(1)
If dtt IsNot Nothing Then If dtt IsNot Nothing Then
ComisionVendedor = dtt.FiltroPrimeroValor("ComisionVendedor").ToDecimal ComisionVendedor = dtt.FiltroPrimeroValor("ComisionVendedor").ToDecimal
ComisionTecnico = dtt.FiltroPrimeroValor("ComisionTecnico").ToDecimal ComisionTecnico = dtt.FiltroPrimeroValor("ComisionTecnico").ToDecimal
End If End If
dtt = ds.Tables(2) dtt = ds.Tables(2)
'médicos sin consumo 'médicos sin consumo
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.Rows For Each dr As DataRow In dtt.Rows
StrTexto.AppendFormat("['{0}'],", dr("NombreMedico")) StrTexto.AppendFormat("['{0}'],", dr("NombreMedico"))
Next Next
StrTexto.Length -= 1 StrTexto.Length -= 1
StrSource.Append("{id:'dtmedsinconsumo',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico'],data:[") StrSource.Append("{id:'dtmedsinconsumo',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico'],data:[")
StrSource.Append(StrTexto.ToString) StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}") StrSource.Append("]}}")
End If End If
'top 10 medicos 'top 10 medicos
dtt = ds.Tables(3) dtt = ds.Tables(3)
StrTexto.Clear() StrTexto.Clear()
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
StrTexto.AppendFormat("['{0}',{1}],", dr("Medico"), dr("Importe")) StrTexto.AppendFormat("['{0}',{1}],", dr("Medico"), dr("Importe"))
Next Next
StrTexto.Length -= 1 StrTexto.Length -= 1
StrSource.Append(",{id:'dtmedtop10',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Importe'],data:[") StrSource.Append(",{id:'dtmedtop10',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Importe'],data:[")
StrSource.Append(StrTexto.ToString) StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}") StrSource.Append("]}}")
End If End If
'top 5 marcas 'top 5 marcas
dtt = ds.Tables(4) dtt = ds.Tables(4)
StrTexto.Clear() StrTexto.Clear()
'top 5 marcas 'top 5 marcas
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
StrTexto.AppendFormat("['{0}',{1}],", dr("Marca"), dr("Importe")) StrTexto.AppendFormat("['{0}',{1}],", dr("Marca"), dr("Importe"))
Next Next
StrTexto.Length -= 1 StrTexto.Length -= 1
StrSource.Append(",{id:'dttop5marcas',type:'JSON',options:{firstRowAsNames:false,columnNames:['Marca','Importe'],data:[") StrSource.Append(",{id:'dttop5marcas',type:'JSON',options:{firstRowAsNames:false,columnNames:['Marca','Importe'],data:[")
StrSource.Append(StrTexto.ToString) StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}") StrSource.Append("]}}")
End If End If
'Dim TextoKPIVendedores As String = "Highcharts.setOptions({chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[{id:'micro-element',type:'JSON',options:{firstRowAsNames:false,columnNames:['Food','Vitamin A','Iron'],data:[['Beef Liver',6421,6.5],['Lamb Liver',2122,6.5],['Cod Liver Oil',1350,0.9],['Mackerel',388,1],['Tuna',214,0.6]]}}]},editMode:{enabled:true,contextMenu:{enabled:true}},components:[{type:'KPI',renderTo:'kpi-vitamin-a',value:900,valueFormat:'{value}',title:'Vitamin A',subtitle:'daily recommended dose'},{type:'KPI',renderTo:'kpi-iron',value:8,title:'Iron',valueFormat:'{value}',subtitle:'daily recommended dose'},{sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Vitamin A',data:['Food','Vitamin A']}]},renderTo:'dashboard-col-0',type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},plotLines:[{value:900,zIndex:7,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},title:{text:''},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Vitamin A in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Vitamin A amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 900 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-1',sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Iron',data:['Food','Iron']}]},type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},max:8,plotLines:[{value:8,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},title:{text:''},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Iron in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Iron amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 8 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-2',connector:{id:'micro-element'},type:'DataGrid',sync:{highlight:true,visibility:true},dataGridOptions:{credits:{enabled:false}}}]},true); 'Dim TextoKPIVendedores As String = "Highcharts.setOptions({chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[{id:'micro-element',type:'JSON',options:{firstRowAsNames:false,columnNames:['Food','Vitamin A','Iron'],data:[['Beef Liver',6421,6.5],['Lamb Liver',2122,6.5],['Cod Liver Oil',1350,0.9],['Mackerel',388,1],['Tuna',214,0.6]]}}]},editMode:{enabled:true,contextMenu:{enabled:true}},components:[{type:'KPI',renderTo:'kpi-vitamin-a',value:900,valueFormat:'{value}',title:'Vitamin A',subtitle:'daily recommended dose'},{type:'KPI',renderTo:'kpi-iron',value:8,title:'Iron',valueFormat:'{value}',subtitle:'daily recommended dose'},{sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Vitamin A',data:['Food','Vitamin A']}]},renderTo:'dashboard-col-0',type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},plotLines:[{value:900,zIndex:7,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},title:{text:''},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Vitamin A in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Vitamin A amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 900 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-1',sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Iron',data:['Food','Iron']}]},type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},max:8,plotLines:[{value:8,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},title:{text:''},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Iron in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Iron amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 8 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-2',connector:{id:'micro-element'},type:'DataGrid',sync:{highlight:true,visibility:true},dataGridOptions:{credits:{enabled:false}}}]},true);
dtt = ds.Tables(5)
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: { StrTexto.Clear()
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
NumPacientes = dtt.FiltroPrimeroValor("NumeroPacientes").ToEntero
End If
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: {
enabled: false, enabled: false,
contextMenu: { enabled: true } contextMenu: { enabled: true }
}, },
@@ -1757,8 +1764,8 @@ Partial Class Inicio
},{ },{
type: 'KPI', type: 'KPI',
renderTo: 'kpi-iron3', renderTo: 'kpi-iron3',
value: 18, value: " & NumPacientes & ",
title: 'Personas', title: 'Pacientes',
valueFormat: '{value}', valueFormat: '{value}',
subtitle: '-' subtitle: '-'
},{ },{
@@ -1844,96 +1851,100 @@ Partial Class Inicio
}, },
dataGridOptions: { dataGridOptions: {
caption: { caption: {
text: 'Médicos sin consumo en +30d', text: 'Médicos sin consumo en +30d'
rowHeight: 20, // ⬅️ Altura de cada fila en píxeles
style: {
fontSize: '8px',
fontWeight: 'bold'
}
},style: { },style: {
maxHeight: '350px', maxHeight: '350px',
overflowY: 'auto' overflowY: 'auto',
fontSize: '7pt',
fontWeight: 'normal'
}, },
credits: { enabled: false } credits: { enabled: false }
, cellStyle: {
fontWeight: 'normal',
fontSize: '8px'
}
} }
}] }]
}, true); " }, true); "
#End Region #End Region
ElseIf Opcion = 2 Then
Else
#Region "GERENTE" #Region "GERENTE"
dtt = ds.Tables(0) dtt = ds.Tables(0)
If dtt IsNot Nothing Then If dtt IsNot Nothing Then
VentasTotales = dtt.FiltroPrimeroValor("Importe").ToDecimal VentasTotales = dtt.FiltroPrimeroValor("Importe").ToDecimal
End If End If
dtt = ds.Tables(1) dtt = ds.Tables(1)
StrTexto.Clear() StrTexto.Clear()
'ventas por mes 'ventas por mes
If dtt IsNot Nothing Then If dtt IsNot Nothing Then
For Each dr As DataRow In dtt.FiltraParametros("AnioAnterior > 0 or AnioActual > 0", "MesNum").Rows For Each dr As DataRow In dtt.FiltraParametros("AnioAnterior > 0 or AnioActual > 0", "MesNum").Rows
StrTexto.AppendFormat("['{0}',{1}, {2}],", dr("Mes"), dr("AnioAnterior"), dr("AnioActual")) StrTexto.AppendFormat("['{0}',{1}, {2}],", dr("Mes"), dr("AnioAnterior"), dr("AnioActual"))
Next Next
StrTexto.Length -= 1 StrTexto.Length -= 1
StrSource.Append("{id:'dtmesxmes',type:'JSON',options:{firstRowAsNames:false,columnNames:['Mes','Anterior','Actual'],data:[") StrSource.Append("{id:'dtmesxmes',type:'JSON',options:{firstRowAsNames:false,columnNames:['Mes','Anterior','Actual'],data:[")
StrSource.Append(StrTexto.ToString) StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}") StrSource.Append("]}}")
End If End If
dtt = ds.Tables(2) dtt = ds.Tables(2)
StrTexto.Clear() StrTexto.Clear()
'médicos sin consumo 'médicos sin consumo
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.Rows For Each dr As DataRow In dtt.Rows
StrTexto.AppendFormat("['{0}','{1}'],", dr("NombreMedico"), dr("Vendedor")) StrTexto.AppendFormat("['{0}','{1}'],", dr("NombreMedico"), dr("Vendedor"))
Next Next
StrTexto.Length -= 1 StrTexto.Length -= 1
StrSource.Append(",{id:'dtmedsinconsumo',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Vendedor'],data:[") StrSource.Append(",{id:'dtmedsinconsumo',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Vendedor'],data:[")
StrSource.Append(StrTexto.ToString) StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}") StrSource.Append("]}}")
End If End If
'vendedores 'vendedores
dtt = ds.Tables(3) dtt = ds.Tables(3)
StrTexto.Clear() StrTexto.Clear()
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
StrTexto.AppendFormat("['{0}',{1}],", dr("Vendedor"), dr("Importe")) StrTexto.AppendFormat("['{0}',{1},'/a/a.aspx?CveI=1'],", If(dr("Vendedor").ToString.Length > 10, dr("Vendedor").ToString.Substring(0, 10), dr("Vendedor")), dr("Importe"))
Next Next
StrTexto.Length -= 1 StrTexto.Length -= 1
StrSource.Append(",{id:'dtvendedores',type:'JSON',options:{firstRowAsNames:false,columnNames:['Vendedor','Importe'],data:[") StrSource.Append(",{id:'dtvendedores',type:'JSON',options:{firstRowAsNames:false,columnNames:['Vendedor','Importe','Url'],data:[")
StrSource.Append(StrTexto.ToString) StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}") StrSource.Append("]}}")
End If End If
'top 10 medicos 'top 10 medicos
dtt = ds.Tables(4) dtt = ds.Tables(4)
StrTexto.Clear() StrTexto.Clear()
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
StrTexto.AppendFormat("['{0}',{1}],", dr("Medico"), dr("Importe")) StrTexto.AppendFormat("['{0}',{1}],", dr("Medico"), dr("Importe"))
Next Next
StrTexto.Length -= 1 StrTexto.Length -= 1
StrSource.Append(",{id:'dtmedtop10',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Importe'],data:[") StrSource.Append(",{id:'dtmedtop10',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Importe'],data:[")
StrSource.Append(StrTexto.ToString) StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}") StrSource.Append("]}}")
End If End If
'top 5 marcas 'top 5 marcas
dtt = ds.Tables(5) dtt = ds.Tables(5)
StrTexto.Clear() StrTexto.Clear()
'top 5 marcas If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows StrTexto.AppendFormat("['{0}',{1},'https://www.google.com'],", dr("Marca"), dr("Importe"))
StrTexto.AppendFormat("['{0}',{1}],", dr("Marca"), dr("Importe")) Next
Next StrTexto.Length -= 1
StrTexto.Length -= 1 StrSource.Append(",{id:'dttop5marcas',type:'JSON',options:{firstRowAsNames:false,columnNames:['Marca','Importe','Url'],data:[")
StrSource.Append(",{id:'dttop5marcas',type:'JSON',options:{firstRowAsNames:false,columnNames:['Marca','Importe'],data:[") StrSource.Append(StrTexto.ToString)
StrSource.Append(StrTexto.ToString) StrSource.Append("]}}")
StrSource.Append("]}}")
End If End If
'Dim TextoKPIVendedores As String = "Highcharts.setOptions({chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[{id:'micro-element',type:'JSON',options:{firstRowAsNames:false,columnNames:['Food','Vitamin A','Iron'],data:[['Beef Liver',6421,6.5],['Lamb Liver',2122,6.5],['Cod Liver Oil',1350,0.9],['Mackerel',388,1],['Tuna',214,0.6]]}}]},editMode:{enabled:true,contextMenu:{enabled:true}},components:[{type:'KPI',renderTo:'kpi-vitamin-a',value:900,valueFormat:'{value}',title:'Vitamin A',subtitle:'daily recommended dose'},{type:'KPI',renderTo:'kpi-iron',value:8,title:'Iron',valueFormat:'{value}',subtitle:'daily recommended dose'},{sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Vitamin A',data:['Food','Vitamin A']}]},renderTo:'dashboard-col-0',type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},plotLines:[{value:900,zIndex:7,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},title:{text:''},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Vitamin A in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Vitamin A amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 900 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-1',sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Iron',data:['Food','Iron']}]},type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},max:8,plotLines:[{value:8,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},title:{text:''},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Iron in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Iron amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 8 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-2',connector:{id:'micro-element'},type:'DataGrid',sync:{highlight:true,visibility:true},dataGridOptions:{credits:{enabled:false}}}]},true); dtt = ds.Tables(6)
StrTexto.Clear()
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
NumPacientes = dtt.FiltroPrimeroValor("NumeroPacientes").ToEntero
End If
'Dim TextoKPIVendedores As String = "Highcharts.setOptions({chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[{id:'micro-element',type:'JSON',options:{firstRowAsNames:false,columnNames:['Food','Vitamin A','Iron'],data:[['Beef Liver',6421,6.5],['Lamb Liver',2122,6.5],['Cod Liver Oil',1350,0.9],['Mackerel',388,1],['Tuna',214,0.6]]}}]},editMode:{enabled:true,contextMenu:{enabled:true}},components:[{type:'KPI',renderTo:'kpi-vitamin-a',value:900,valueFormat:'{value}',title:'Vitamin A',subtitle:'daily recommended dose'},{type:'KPI',renderTo:'kpi-iron',value:8,title:'Iron',valueFormat:'{value}',subtitle:'daily recommended dose'},{sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Vitamin A',data:['Food','Vitamin A']}]},renderTo:'dashboard-col-0',type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},plotLines:[{value:900,zIndex:7,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},title:{text:''},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Vitamin A in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Vitamin A amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 900 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-1',sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Iron',data:['Food','Iron']}]},type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},max:8,plotLines:[{value:8,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},title:{text:''},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Iron in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Iron amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 8 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-2',connector:{id:'micro-element'},type:'DataGrid',sync:{highlight:true,visibility:true},dataGridOptions:{credits:{enabled:false}}}]},true);
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: { TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: {
enabled: false, enabled: false,
contextMenu: { enabled: true } contextMenu: { enabled: true }
}, },
@@ -1979,8 +1990,8 @@ Partial Class Inicio
},{ },{
type: 'KPI', type: 'KPI',
renderTo: 'kpi-iron3', renderTo: 'kpi-iron3',
value: 18, value: " & NumPacientes & ",
title: 'Personas', title: 'Pacientes',
valueFormat: '{value}', valueFormat: '{value}',
subtitle: '-' subtitle: '-'
},{ },{
@@ -2021,40 +2032,54 @@ Partial Class Inicio
lang: { accessibility: { chartContainerLabel: '' } } lang: { accessibility: { chartContainerLabel: '' } }
} }
}, { }, {
renderTo: 'dashboard-col-1', renderTo: 'dashboard-col-1',
sync: { connector: {
visibility: true, id: 'dttop5marcas',
highlight: true, columnAssignment: [{
extremes: true seriesId: 'Top 5 Marcas',
}, data: ['Marca', 'Importe','Url']
connector: { }]
id: 'dttop5marcas',
columnAssignment: [{
seriesId: 'Top 5 Marcas',
data: ['Marca', 'Importe']
}]
},
type: 'Highcharts',
chartOptions: {
xAxis: {
type: 'category',
accessibility: { description: 'Groceries' }
}, },
yAxis: { title: { text: '' } }, type: 'Highcharts',
credits: { enabled: false }, chartOptions: {
title: { text: '' }, chart: {
legend: { enabled: true, verticalAlign: 'top' }, type: 'bar',
chart: { animation: false,
animation: false, type: 'bar', spacing: [30, 30, 30, 20]
spacing: [30, 30, 30, 20] },
}, title: { text: '' },
tooltip: { valueSuffix: ' ', stickOnContact: true }, credits: { enabled: false },
lang: { accessibility: { legend: { enabled: true, verticalAlign: 'top' },
chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.' xAxis: {
type: 'category',
accessibility: { description: 'Groceries' }
},
yAxis: { title: { text: '' } },
tooltip: {
valueSuffix: ' ',
stickOnContact: true
},
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
const url = this.options?.Url;
console.log('URL del punto:', url);
if (url) {
window.open(url, '_blank');
} else {
alert('No se encontró la URL del punto.');
}
}
}
}
}
} }
} }
} }, {
}, {
renderTo: 'dashboard-col-3', renderTo: 'dashboard-col-3',
sync: { sync: {
visibility: true, visibility: true,
@@ -2065,24 +2090,67 @@ Partial Class Inicio
id: 'dtvendedores', id: 'dtvendedores',
columnAssignment: [{ columnAssignment: [{
seriesId: 'Vendedores', seriesId: 'Vendedores',
data: ['Vendedor', 'Importe'] data: ['Vendedor', 'Importe','Url']
}] }]
}, },
type: 'Highcharts', type: 'Highcharts',
chartOptions: { chartOptions: {
xAxis: { xAxis: {
type: 'category', type: 'category',
accessibility: { description: 'Groceries' } accessibility: { description: '' }
}, },
yAxis: { title: { text: '' } }, yAxis: { title: { text: '' } },
credits: { enabled: false }, credits: { enabled: false },
title: { text: '' }, plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: [{
enabled: true,
distance: 20
}, {
enabled: true,
distance: -40,
format: '{point.percentage:.1f}%',
style: {
fontSize: '1.2em',
textOutline: 'none',
opacity: 0.7
},
filter: {
operator: '>',
property: 'percentage',
value: 10
}
}]
}
},
title: { text: 'Vendedores' },
legend: { enabled: true, verticalAlign: 'top' }, legend: { enabled: true, verticalAlign: 'top' },
chart: { chart: {
animation: false, type: 'bar', animation: false, type: 'pie'
spacing: [30, 30, 30, 20]
}, },
tooltip: { valueSuffix: ' ', stickOnContact: true }, tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b><br>Valor: <b>{point.y}</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
},
point: {
events: {
click: function () {
const url = this.options?.Url;
if (url) window.open(url, '_blank');
}
}
}
}
},
lang: { accessibility: { lang: { accessibility: {
chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.' chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.'
} }
@@ -2140,25 +2208,311 @@ Partial Class Inicio
highlight: true, highlight: true,
visibility: true visibility: true
}, },
dataGridOptions: { dataGridOptions: {
caption: { caption: {
text: 'Médicos sin consumo en +30d', text: 'Médicos sin consumo en +30d'
rowHeight: 20, // Altura de cada fila en píxeles
style: {
fontSize: '8pt',
fontWeight: 'bold'
}
},style: { },style: {
maxHeight: '350px', maxHeight: '350px',
overflowY: 'auto' overflowY: 'auto',
fontSize: '7pt',
fontWeight: 'normal'
}, },
credits: { enabled: false } credits: { enabled: false }
, cellStyle: {
fontWeight: 'normal',
fontSize: '8px'
}
} }
}] }]
}, true); " }, true); "
#End Region #End Region
ElseIf Opcion = 3 Then
#Region "ALMACEN"
Dim TotalEntregas, TotalRecoleciones, ProductosConExistencia, Ingresadas, NoUsadas As Integer
Dim EntregasDiarias As Decimal = 0
dtt = ds.Tables(0)
If dtt IsNot Nothing Then
TotalEntregas = dtt.FiltroPrimeroValor("TotalEntregas").ToEntero
TotalRecoleciones = dtt.FiltroPrimeroValor("TotalRecoleccion").ToEntero
ProductosConExistencia = dtt.FiltroPrimeroValor("ProductosExistencias").ToEntero
Ingresadas = dtt.FiltroPrimeroValor("Ingresadas").ToEntero
NoUsadas = dtt.FiltroPrimeroValor("NoUsadas").ToEntero
EntregasDiarias = dtt.FiltroPrimeroValor("EntregasDiarias").ToDecimal
End If
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: {
enabled: false,
contextMenu: { enabled: true }
},
gui: {
layouts: [{
rows: [{
cells: [{
id: 'kpi-wrapper',
layout: {
rows: [{
cells: [{
id: 'kpi-iron0'
}, {
id: 'kpi-iron1'
}, {
id: 'kpi-iron2'
}]
},{
cells: [{
id: 'kpi-iron3'
}, {
id: 'kpi-iron4'
}, {
id: 'kpi-iron5'
}]
}]
}
}]
}]
}]
},
components: [{
type: 'KPI',
renderTo: 'kpi-iron0',
value: " & TotalEntregas & ",
valueFormat: '{value}',
title: 'Total Entrega',
subtitle: '-'
}, {
type: 'KPI',
renderTo: 'kpi-iron1',
value: " & TotalRecoleciones & ",
title: 'Total Recolecciones',
valueFormat: '{value}',
valueStyle: { color: '#198754'},
subtitle: ''
}, {
type: 'KPI',
renderTo: 'kpi-iron2',
value: " & ProductosConExistencia & ",
title: 'Productos con Existencia',
valueFormat: '{value}',
subtitle: '-'
},{
type: 'KPI',
renderTo: 'kpi-iron3',
value: " & Ingresadas & ",
title: 'Ingresadas',
valueFormat: '{value}',
subtitle: '-'
},{
type: 'KPI',
renderTo: 'kpi-iron4',
value: " & NoUsadas & ",
title: 'No usadas',
valueFormat: '{value}',
subtitle: '-'
},{
type: 'KPI',
renderTo: 'kpi-iron5',
value: " & EntregasDiarias & ",
title: 'Prom Entrega diaria',
valueFormat: '{value:,.2f}',
subtitle: '-'
} ]
}, true); "
#End Region
ElseIf Opcion = 4 Then
#Region "TECNICO"
Dim CirugiasDiaSiguiente, Comision, NumCirugias As Integer
Dim MontoCirugias As Decimal = 0
dtt = ds.Tables(0)
If dtt IsNot Nothing Then
CirugiasDiaSiguiente = dtt.FiltroPrimeroValor("CirugiasDiaSiguiente").ToEntero
Comision = dtt.FiltroPrimeroValor("Comision").ToEntero
NumCirugias = dtt.FiltroPrimeroValor("NumCirugias").ToEntero
MontoCirugias = dtt.FiltroPrimeroValor("MontoCirugias").ToDecimal
End If
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: {
enabled: false,
contextMenu: { enabled: true }
},
gui: {
layouts: [{
rows: [{
cells: [{
id: 'kpi-wrapper',
layout: {
rows: [{
cells: [{
id: 'kpi-iron0'
}, {
id: 'kpi-iron1'
}]
},{
cells: [{
id: 'kpi-iron2'
},{
id: 'kpi-iron3'
} ]
}]
}
}]
}]
}]
},
components: [{
type: 'KPI',
renderTo: 'kpi-iron0',
value: " & CirugiasDiaSiguiente & ",
valueFormat: '{value}',
title: 'Cirugías Dia Sig',
subtitle: '-'
}, {
type: 'KPI',
renderTo: 'kpi-iron1',
value: " & Comision & ",
title: '$ Comisión',
valueFormat: '{value:,.2f}',
valueStyle: { color: '#198754'},
subtitle: ''
}, {
type: 'KPI',
renderTo: 'kpi-iron2',
value: " & NumCirugias & ",
title: '# Cirugías',
valueFormat: '{value}',
subtitle: '-'
},{
type: 'KPI',
renderTo: 'kpi-iron3',
value: " & MontoCirugias & ",
title: '$ Cirugías',
valueFormat: '{value:,.2f}',
subtitle: '-'
} ]
}, true); "
#End Region
ElseIf Opcion = 5 Then
#Region "GERENTE TECNICO"
Dim CirugiasAsistidas As Integer
Dim MontoCirugias, TicketPromedio As Decimal
dtt = ds.Tables(0)
If dtt IsNot Nothing Then
CirugiasAsistidas = dtt.FiltroPrimeroValor("CirugiasAsistidas").ToEntero
TicketPromedio = dtt.FiltroPrimeroValor("TicketPromedio").ToDecimal
End If
'top cirugias técnicos
dtt = ds.Tables(1)
StrTexto.Clear()
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.FiltraParametros("Cantidad > 0").Rows
StrTexto.AppendFormat("['{0}',{1}],", dr("NombreTecnico"), dr("Cantidad"))
Next
StrTexto.Length -= 1
StrSource.Append("{id:'dttecnicos',type:'JSON',options:{firstRowAsNames:false,columnNames:['NombreTecnico','Cantidad'],data:[")
StrSource.Append(StrTexto.ToString)
StrSource.Append("]}}")
End If
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: {
enabled: false,
contextMenu: { enabled: true }
},
gui: {
layouts: [{
rows: [{
cells: [{
id: 'kpi-wrapper',
layout: {
rows: [{
cells: [{
id: 'kpi-vitamin-a'
},{
id: 'kpi-iron3'
}]
}]
}
}]
}, {
cells: [{
id: 'dashboard-col-3'
}]
}]
}]
},
components: [{
type: 'KPI',
renderTo: 'kpi-vitamin-a',
value: " & CirugiasAsistidas & ",
valueFormat: '{value}',
title: 'Cirugías Asistidas',
subtitle: '-'
},{
type: 'KPI',
renderTo: 'kpi-iron',
value: " & TicketPromedio & ",
title: 'Ticket Promedio',
valueFormat: '{value}',
subtitle: '-'
}, {
renderTo: 'dashboard-col-3',
sync: {
visibility: true,
highlight: true,
extremes: true
},
connector: {
id: 'dttecnicos',
columnAssignment: [{
seriesId: 'Técnicos',
data: ['NombreTecnico', 'Cantidad']
}]
},
type: 'Highcharts',
chartOptions: {
xAxis: {
type: 'category',
accessibility: { description: '' }
},
yAxis: { title: { text: '' } },
credits: { enabled: false },
title: { text: 'Técnicos' },
legend: { enabled: true, verticalAlign: 'top' },
chart: {
animation: false, type: 'pie'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b><br>Valor: <b>{point.y}</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
},
point: {
events: {
click: function () {
const url = this.options?.Url;
if (url) window.open(url, '_blank');
}
}
}
}
},
lang: { accessibility: {
chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.'
}
}
}
}]
}, true); "
#End Region
End If
RegistraScript(TextoKPIVendedores, "top10")
End If End If
RegistraScript(TextoKPIVendedores, "top10")
dtIndicadores = Nothing dtIndicadores = Nothing
dtRH = Nothing dtRH = Nothing
@@ -2166,4 +2520,34 @@ Partial Class Inicio
End Sub End Sub
#End Region #End Region
Protected Sub DdlSMSOpciones_SelectedIndexChanged(sender As Object, e As EventArgs)
If DdlSMSOpciones.SelectedValue = "1" Then
DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("CveEstatus=1")
DdlSMSVendedores.DataBind()
DdlSMSVendedores.Visible = True
DdlSMSTecnico.Visible = False
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, DdlSMSVendedores.SelectedValue.ToEntero)
ElseIf DdlSMSOpciones.SelectedValue = "4" Then
DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582")
DdlSMSTecnico.DataBind()
DdlSMSTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSMSTecnico.Visible = True
DdlSMSVendedores.Visible = False
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, -1, DdlSMSTecnico.SelectedValue.ToEntero)
Else
DdlSMSVendedores.Visible = False
DdlSMSTecnico.Visible = False
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero)
End If
End Sub
Protected Sub DdlSMSVendedores_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, DdlSMSVendedores.SelectedValue.ToEntero)
End Sub
Protected Sub DdlSMSTecnico_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, -1, DdlSMSTecnico.SelectedValue.ToEntero)
End Sub
End Class End Class

View File

@@ -200,7 +200,6 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Private Sub InicializaValores() Private Sub InicializaValores()
CreaDtSeriesDesarmado() CreaDtSeriesDesarmado()
'CARGA PS PAQUETES 'CARGA PS PAQUETES
DdlPaqueteArmado.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros("CvePSPaquete > 0") DdlPaqueteArmado.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros("CvePSPaquete > 0")
DdlPaqueteArmado.DataBind() DdlPaqueteArmado.DataBind()
@@ -278,9 +277,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dim ObjProductosServicios As New ClsProductosServicios Dim ObjProductosServicios As New ClsProductosServicios
DtDatosArmado = New DataTable DtDatosArmado = New DataTable
Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("") Dim drP As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("")
Dim CveUMTemp As Integer = drP("CveUM").ToString.ToEntero Dim CveUMTemp As Integer = drP("CveUnidadMedida").ToString.ToEntero
If ObjProductosServicios.GetPaqueteDetalle(DdlPaqueteArmado.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUMTemp, TxtCantidadArmado.Text.ToDouble, DdlAlmacenArmado.SelectedValue.ToEntero, TxtFechaArmado.Text.ToDate, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) Then If ObjProductosServicios.GetPaqueteDetalle(DdlPaqueteArmado.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUMTemp, TxtCantidadArmado.Text.ToDouble, DdlAlmacenArmado.SelectedValue.ToEntero, TxtFechaArmado.Text.ToDate, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) Then
DtDatosArmado = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy DtDatosArmado = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy
Else Else
@@ -296,7 +295,6 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
CveVendedor = If(RowApartadosArmado.Visible, DdlVendedorArmado.SelectedValue.ToEntero, -1) CveVendedor = If(RowApartadosArmado.Visible, DdlVendedorArmado.SelectedValue.ToEntero, -1)
CveCliente = If(RowClienteArmado.Visible, DdlClienteArmado.SelectedValue.ToEntero, -1) CveCliente = If(RowClienteArmado.Visible, DdlClienteArmado.SelectedValue.ToEntero, -1)
If DtDatosArmado.Rows.Count > 0 Then If DtDatosArmado.Rows.Count > 0 Then
For Each Dr As DataRow In DtDatosArmado.Rows For Each Dr As DataRow In DtDatosArmado.Rows
Dr("Cantidad") = Dr("Cantidad").ToString.ToDecimal * TxtCantidadArmado.Text.ToDecimal Dr("Cantidad") = Dr("Cantidad").ToString.ToDecimal * TxtCantidadArmado.Text.ToDecimal
@@ -323,8 +321,6 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If End If
If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then
DivSeriesPaqueteArmado.Visible = True DivSeriesPaqueteArmado.Visible = True
Dim Dt As New DataTable Dim Dt As New DataTable
@@ -403,10 +399,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
GvSeriesPaqueteDesarmado.DataBind() GvSeriesPaqueteDesarmado.DataBind()
BtnAgregarSerieDesarmado.Enabled = True BtnAgregarSerieDesarmado.Enabled = True
Dim drP As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimero("")
Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimero("") Dim CveUMTemp As Integer = drP("CveUnidadMedida").ToString.ToEntero
Dim CveUMTemp As Integer = drP("CveUM").ToString.ToEntero
CveVendedor = If(RowApartadosDesarmado.Visible, DdlVendedorDesarmado.SelectedValue.ToEntero, -1) CveVendedor = If(RowApartadosDesarmado.Visible, DdlVendedorDesarmado.SelectedValue.ToEntero, -1)
CveCliente = If(RowClienteDesarmado.Visible, DdlClienteDesarmado.SelectedValue.ToEntero, -1) CveCliente = If(RowClienteDesarmado.Visible, DdlClienteDesarmado.SelectedValue.ToEntero, -1)
Dim FechaFin As String = TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd 23:59") Dim FechaFin As String = TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd 23:59")
@@ -506,7 +501,6 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Guardar(1) Guardar(1)
End Sub End Sub
@@ -568,7 +562,6 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
End If End If
Else Else
@@ -580,23 +573,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If End If
If gvr.DataKey("AplicaCaducidad") = "True" Then If gvr.DataKey("AplicaCaducidad") = "True" Then
If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
End If End If
End If End If
Next Next
Case 2 ' DESARMADO Case 2 ' DESARMADO
For Each gvr As GridViewRow In GvDatosDesarmado.Rows For Each gvr As GridViewRow In GvDatosDesarmado.Rows
If gvr.DataKey("AplicaSerie") = "True" Then If gvr.DataKey("AplicaSerie") = "True" Then
'If gvr.DataKey("AplicaSerie") = "True" Then 'If gvr.DataKey("AplicaSerie") = "True" Then
' 'If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then ' 'If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then
' ' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) ' ' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia)
@@ -619,15 +606,11 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If End If
If gvr.DataKey("AplicaCaducidad") = "True" Then If gvr.DataKey("AplicaCaducidad") = "True" Then
If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia) Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
End If End If
Next Next
End Select End Select
@@ -683,26 +666,20 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
For Each GvRow As GridViewRow In GvDatosArmado.Rows For Each GvRow As GridViewRow In GvDatosArmado.Rows
FechaCaducidad = If(CBool(GvRow.DataKey("AplicaCaducidad")) AndAlso GvRow.FCTextBox("TxtCaducidad").ToString().ToDate > MinFecha, GvRow.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha) FechaCaducidad = If(CBool(GvRow.DataKey("AplicaCaducidad")) AndAlso GvRow.FCTextBox("TxtCaducidad").Text.ToDate > MinFecha, GvRow.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha)
Lote = If(CBool(GvRow.DataKey("AplicaLote")), GvRow.FCTextBox("TxtLote").Text.Trim, "-1") Lote = If(CBool(GvRow.DataKey("AplicaLote")), GvRow.FCTextBox("TxtLote").Text.Trim, "-1")
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
Dim ArrayCaducidad As String() = GvRow.FCDropDownList("DdlCaducidadProducto").SelectedValue.Split("|"c)
Dim DdlCaducidadProducto As DropDownList = GvRow.FCDropDownList("DdlCaducidadProducto")
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
Lote = ArrayCaducidad(0) Lote = ArrayCaducidad(0)
FechaCaducidad = ArrayCaducidad(1).ToDate FechaCaducidad = ArrayCaducidad(1).ToDate
End If End If
Dim Existencia As Decimal = ObjInventarioVal.GetExistenciasPS(GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenArmado.SelectedValue.ToEntero(), FechaMovto:=TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:="-1", Lote:=Lote, FechaCaducidad:=FechaCaducidad) Dim Existencia As Decimal = ObjInventarioVal.GetExistenciasPS(GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenArmado.SelectedValue.ToEntero(), FechaMovto:=TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:="-1", Lote:=Lote, FechaCaducidad:=FechaCaducidad)
If GvRow.DataKey("Cantidad").ToDecimal > Existencia Then If GvRow.DataKey("Cantidad").ToDecimal > Existencia Then
TieneErrorExistencia = True TieneErrorExistencia = True
TextoError.AppendFormat("<b> - {0}</b> Existencia: {1:#,##0.##} <br/>", GvRow.DataKey("CodigoPS"), Existencia) TextoError.AppendFormat("<b> - {0}</b> Existencia: {1:#,##0.##} <br/>", GvRow.DataKey("CodigoPS"), Existencia)
End If End If
''If Dr("CantidadGV").ToString().ToDecimal > 0 Then ''If Dr("CantidadGV").ToString().ToDecimal > 0 Then
@@ -758,16 +735,10 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
Exit Sub Exit Sub
End If End If
End If End If
Dim ObjInventario As New ClsInventarios Dim ObjInventario As New ClsInventarios
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim MensajeError As String = "" Dim MensajeError As String = ""
@@ -801,13 +772,10 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text) Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text)
Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text) Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text)
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
Dim ArrayCaducidad As String() = Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Split("|"c)
Dim DdlCaducidadProducto As DropDownList = Gvr.FCDropDownList("DdlCaducidadProducto")
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
Lote = ArrayCaducidad(0) Lote = ArrayCaducidad(0)
FechaCaducidad = ArrayCaducidad(1) FechaCaducidad = ArrayCaducidad(1)
End If End If
Dim CveSeccionAlmacen As Integer = Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero() Dim CveSeccionAlmacen As Integer = Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
@@ -826,11 +794,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Exit For Exit For
End If End If
Next Next
If TieneError Then Exit For
If TieneError Then
Exit For
End If
Else Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.DataKey("Cantidad").ToString.ToDecimal, Gvr.DataKey("CveUM").ToString.ToEntero, If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.DataKey("Cantidad").ToString.ToDecimal, Gvr.DataKey("CveUM").ToString.ToEntero,
Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote,
@@ -860,16 +824,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
PUTemp = PUTemp / TxtCantidadArmado.Text.ToDecimal PUTemp = PUTemp / TxtCantidadArmado.Text.ToDecimal
Dim CvePSTemp = CvePaqueteArmado Dim CvePSTemp = CvePaqueteArmado
Dim CveSeccionAlmacen As Integer = -1 Dim CveSeccionAlmacen As Integer = -1
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimero("") Dim Drp As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimero("")
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero Dim CveUMTemp As Integer = Drp("CveUnidadMedida").ToString.ToEntero
Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
If AplicaSeccion Then If AplicaSeccion Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenArmado, CvePaqueteArmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenArmado, CvePaqueteArmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
End If End If
If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then
If AplicaSeriePaquete Then
Dim ContadorPaquete = 1 Dim ContadorPaquete = 1
Dim DtSeriesComponentes As New DataTable Dim DtSeriesComponentes As New DataTable
For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows
@@ -900,7 +863,6 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Next Next
End If End If
Next Next
ContadorPaquete = ContadorPaquete + 1 ContadorPaquete = ContadorPaquete + 1
Next Next
Else Else
@@ -934,7 +896,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dim CvePSTemp As Integer = CvePaqueteDesarmado Dim CvePSTemp As Integer = CvePaqueteDesarmado
Dim CveSeccionAlmacen As Integer = -1 Dim CveSeccionAlmacen As Integer = -1
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("") Dim Drp As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("")
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
'Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) 'Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
@@ -1070,9 +1032,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
If Not TieneError Then If Not TieneError Then
Dim Msg As New StringBuilder Dim Msg As New StringBuilder
Msg.AppendFormat("<br/>El Movimiento de salida se registro con el Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoSalida, FolioSalida) Msg.AppendFormat("<br/>El Movimiento de salida se registro con el Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"" class='Texto'>{1}</a></b>", CveMovimientoSalida, FolioSalida)
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
Msg.AppendFormat("<br/><br/><br/>El Movimiento de entrada se registro con el Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoEntrada, FolioEntrada) Msg.AppendFormat("<br/><br/>El Movimiento de entrada se registro con el Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"" class='Texto'>{1}</a></b>", CveMovimientoEntrada, FolioEntrada)
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
Alert(Msg.ToString, TipoMensaje.MsgInformacion) Alert(Msg.ToString, TipoMensaje.MsgInformacion)
ObjInventario.Commit() ObjInventario.Commit()
@@ -1659,8 +1621,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If End If
Dim AplicaCaducidad = False Dim AplicaCaducidad = False
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then If GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then
AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False) AplicaCaducidad = If(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
End If End If
Row("ConsecId") = CveConsecSerieLote Row("ConsecId") = CveConsecSerieLote
@@ -1754,7 +1716,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
'VERIFICA EXISTENCIAS 'VERIFICA EXISTENCIAS
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero Dim CveUMTemp = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie,
CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Lote:=Lote, FechaCaducidad:=FechaCaducidad) CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Lote:=Lote, FechaCaducidad:=FechaCaducidad)

View File

@@ -1382,6 +1382,7 @@ Partial Class Sistemas_UsuarioDetalle
' End If ' End If
'RECARGA GLOBAL ESTATUS 'RECARGA GLOBAL ESTATUS
GlobalDTOCEstatus(tCveEmpresa) = Nothing
GlobalDTOCEstatusUsuarios(tCveEmpresa) = Nothing GlobalDTOCEstatusUsuarios(tCveEmpresa) = Nothing
'If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing 'If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing

View File

@@ -315,6 +315,14 @@ Partial Class Ventas_ActualizarPrecios
GvMultiple.DataBind() GvMultiple.DataBind()
End If End If
'sms, ocultar las últimos 2 columnas, solo mostrar la columna de precio
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If Not UsuarioActual.TienePermisoProceso(201) Then 'puede ver importes de inventario
GvMultiple.Columns(GvMultiple.Columns.Count - 1).Visible = False
GvMultiple.Columns(GvMultiple.Columns.Count - 2).Visible = False
End If
End If
UpDescargar.Update() UpDescargar.Update()
UpDatos.Update() UpDatos.Update()
UPPrecioLista.Update() UPPrecioLista.Update()
@@ -998,7 +1006,6 @@ Partial Class Ventas_ActualizarPrecios
Dim TxtId As String = "TxtPrecio_" + (colIndex - 1).ToString() Dim TxtId As String = "TxtPrecio_" + (colIndex - 1).ToString()
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
Dim CvePrecioLista As Integer = GvMultiple.HeaderRow.FCLabel(LtlId).Attributes().Item("cvepreciolista").ToEntero() Dim CvePrecioLista As Integer = GvMultiple.HeaderRow.FCLabel(LtlId).Attributes().Item("cvepreciolista").ToEntero()
Dim Precio As Decimal = GvRow.FCTextBox(TxtId).Text.ToDecimal() Dim Precio As Decimal = GvRow.FCTextBox(TxtId).Text.ToDecimal()
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True) TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
@@ -1009,30 +1016,23 @@ Partial Class Ventas_ActualizarPrecios
Dim splitValues As String() = text.Split("|"c) Dim splitValues As String() = text.Split("|"c)
If splitValues.Length > 1 Then If splitValues.Length > 1 Then
Dim PrecioLista As String = splitValues(1) Dim PrecioLista As String = splitValues(1)
Dim DrPS = DtPS.FiltroPrimero($"CvePS = {CvePS}") Dim DrPS = DtPS.FiltroPrimero($"CvePS = {CvePS}")
If DrPS IsNot Nothing Then If DrPS IsNot Nothing Then
TieneError = ActualizarPreciosFranquicia(ObjPS, DrPS("Codigo").ToString(), Precio, 0, PrecioLista, UpdatePrecioMinimo:=False) TieneError = ActualizarPreciosFranquicia(ObjPS, DrPS("Codigo").ToString(), Precio, 0, PrecioLista, UpdatePrecioMinimo:=False)
Else Else
TieneError = True TieneError = True
End If End If
End If End If
Else Else
Exit For Exit For
End If End If
If TieneError Then If TieneError Then
Exit For Exit For
End If End If
End If End If
Next Next
End If End If
Next Next
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al actualizar precios", ex) OnError("Ocurrió un error al actualizar precios", ex)

View File

@@ -2606,18 +2606,7 @@ Partial Class Clientes
If DdlTipoCliente.SelectedValue = "1" Then If DdlTipoCliente.SelectedValue = "1" Then
If TxtContacto.Text.Trim() = "" Then InformacionCompleta = False If TxtContacto.Text.Trim() = "" Then InformacionCompleta = False
If TxtRepresentanteLegal.Text.Trim() = "" Then InformacionCompleta = False If TxtRepresentanteLegal.Text.Trim() = "" Then InformacionCompleta = False
'si es el concepto de pagaré
Dim tPagare As Integer = 0
For Each dRow As GridViewRow In GvDocumentosCliente.Rows
Dim CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToEntero()
If CveDocumentacion = 265 Then tPagare = 1
Next
If tPagare = 0 Then InformacionCompleta = False
tPagare = 0 'valida que cuando menos tenga una cuenta
For Each dRow As GridViewRow In GvBancosCuentas.Rows
tPagare = 1
Next
If tPagare = 0 Then InformacionCompleta = False
End If End If
End If End If

View File

@@ -1539,8 +1539,6 @@
} }
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
// $get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
} }
function FnSumaValoresAnt() { function FnSumaValoresAnt() {
@@ -1589,7 +1587,12 @@
$get("TxtCambio").value = FormatoNumero(cambio); $get("TxtCambio").value = FormatoNumero(cambio);
} else { } else {
$get("TxtFaltante").value = FormatoNumero(cambio); if (cambio == 'NaN') {
$get("TxtFaltante").value = "0.00";
} else {
$get("TxtFaltante").value = FormatoNumero(cambio);
}
$get("ChkSobFaltante").checked = true; $get("ChkSobFaltante").checked = true;
$get("TxtCambio").value = ""; $get("TxtCambio").value = "";
} }
@@ -1618,8 +1621,15 @@
} }
function ValidaSobranteFaltante() { function ValidaSobranteFaltante() {
if (ToDouble($get("TxtFaltante").value) > 1) {
alert("El sobrante/faltante no debe ser mayor a 1"); let sobFaltantePermitido = 1;
if (<%= If(UsuarioActual.Empresa.CveEmpresa = 189, 1, 0)%> == 1) {
sobFaltantePermitido = 10;
}
if (ToDouble($get("TxtFaltante").value) > sobFaltantePermitido) {
alert("El sobrante/faltante no debe ser mayor a " + sobFaltantePermitido);
$get("TxtFaltante").value = ""; $get("TxtFaltante").value = "";
$get("ChkSobFaltante").checked = false; $get("ChkSobFaltante").checked = false;
} else { } else {
@@ -1630,11 +1640,20 @@
function CargaSobranteFaltante() { function CargaSobranteFaltante() {
$('#ChkSobFaltante').change(function () { $('#ChkSobFaltante').change(function () {
if (this.checked == true) { if (this.checked == true) {
if (ToDouble($get("TxtCambio").value) > 1) { let sobFaltantePermitido = 1;
alert("El sobrante/faltante no debe ser mayor a 1")
if (<%= If(UsuarioActual.Empresa.CveEmpresa = 189, 1, 0)%> == 1) {
sobFaltantePermitido = 10;
}
if (ToDouble($get("TxtCambio").value) > sobFaltantePermitido) {
alert("El sobrante/faltante no debe ser mayor a " + sobFaltantePermitido)
$get("ChkSobFaltante").checked = false; $get("ChkSobFaltante").checked = false;
} else { } else {
$get("TxtFaltante").value = $get("TxtCambio").value; if ($get("TxtCambio").value == 'NaN') {
$get("TxtFaltante").value = "0.00";
} else {
$get("TxtFaltante").value = $get("TxtCambio").value;
}
} }
} }

View File

@@ -593,13 +593,19 @@ Partial Class Ventas_PVCobranza
Faltante = Math.Abs(TxtFaltante.Text.ToDecimal()) Faltante = Math.Abs(TxtFaltante.Text.ToDecimal())
End If End If
If Faltante > 1 Then Dim sobFaltantePermitido = 1
Alert("El faltante no puede ser mayor a 1.00", TipoMensaje.MsgAdvertencia)
If UsuarioActual.CveEmpresa = 189 Then
sobFaltantePermitido = 10
End If
If Faltante > sobFaltantePermitido Then
Alert($"El faltante no puede ser mayor a {sobFaltantePermitido}", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
If Sobrante > 1 Then If Sobrante > sobFaltantePermitido Then
Alert("El sobrante no puede ser mayor a 1.00", TipoMensaje.MsgAdvertencia) Alert($"El sobrante no puede ser mayor a {sobFaltantePermitido}", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -956,7 +962,7 @@ Partial Class Ventas_PVCobranza
GuardaLog(ex.ToString()) GuardaLog(ex.ToString())
End Try End Try
If MsgError = "" AndAlso Not ChkSobFaltante.Checked Then If MsgError = "" Then
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5, CveVenta:=CveVenta) Then If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5, CveVenta:=CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")