OC rdl 189

This commit is contained in:
rakcsle
2024-11-07 16:15:53 -07:00
parent 8b07f996bb
commit 536b0c3e82
4 changed files with 287 additions and 92 deletions

View File

@@ -7808,12 +7808,13 @@ Public Class ClsPaginas
End If End If
If Not Archivo.Exists Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then ' If Not Archivo.Exists Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa.Contiene(197, 189)) Then
Dim SBDomicilioSucursal As New StringBuilder() Dim SBDomicilioSucursal As New StringBuilder()
Dim CiudadSucursal As String = "" Dim CiudadSucursal As String = ""
Dim ObjClientes As New ClsClientes Dim ObjClientes As New ClsClientes
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC)) params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
@@ -7860,7 +7861,7 @@ Public Class ClsPaginas
End If End If
End If End If
End If 'End If
Dim CveUsuarioSol As Integer = dtOC(0)("CveUsuarioSolicito").ToString.ToEntero Dim CveUsuarioSol As Integer = dtOC(0)("CveUsuarioSolicito").ToString.ToEntero
Dim CveUsuarioAut As Integer = dtOC(0)("CveUsuarioAutorizo").ToString.ToEntero Dim CveUsuarioAut As Integer = dtOC(0)("CveUsuarioAutorizo").ToString.ToEntero
@@ -7984,7 +7985,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("FirmaAutorizo", If(FirmaAut.Exists, ImageToBase64(Drawing.Image.FromFile(FirmaAut.FullName), Drawing.Imaging.ImageFormat.Png), ""))) params.Add(New ReportParameter("FirmaAutorizo", If(FirmaAut.Exists, ImageToBase64(Drawing.Image.FromFile(FirmaAut.FullName), Drawing.Imaging.ImageFormat.Png), "")))
If Not Archivo.Exists Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then 'If Not Archivo.Exists Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then
Dim ObjProveedor As New ClsCompProveedores Dim ObjProveedor As New ClsCompProveedores
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, ObjOC.CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, EmpresaActual.CveEmpresa) Then If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, ObjOC.CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, EmpresaActual.CveEmpresa) Then
@@ -7992,8 +7993,9 @@ Public Class ClsPaginas
params.Add(New ReportParameter("PlazoPago", ObjProveedor.PlazoPago.ToString)) params.Add(New ReportParameter("PlazoPago", ObjProveedor.PlazoPago.ToString))
End If End If
End If End If
ObjProveedor.Dispose()
End If 'End If
If Archivo.Exists Then If Archivo.Exists Then
bytes = StreamPDF(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta), DtDetalle, params, $"OC_{ObjOC.Folio.ToString}", RDSName:="DsOC", MR:=MR) bytes = StreamPDF(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta), DtDetalle, params, $"OC_{ObjOC.Folio.ToString}", RDSName:="DsOC", MR:=MR)

View File

@@ -4462,11 +4462,14 @@ Partial Class Compras_Compras
End If End If
If UsuarioActual.TienePermisoProceso(121) And Not (CveImportacion > 0 Or CveFlete > 0) Then 'valida que de salida, pero sino es importación o costoindirecto If UsuarioActual.TienePermisoProceso(121) And Not (CveImportacion > 0 Or CveFlete > 0) Then 'valida que de salida, pero sino es importación o costoindirecto
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
If Not NCDevolucion And Not ChkNCInvNC.Checked Then If Not NCDevolucion And Not ChkNCInvNC.Checked Then
Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia) Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
ValidaFechaDeAlamacen()
Else Else
Dim x As Integer = 0 Dim x As Integer = 0
For Each Dr As GridViewRow In GvInv.Rows For Each Dr As GridViewRow In GvInv.Rows
@@ -4480,11 +4483,13 @@ Partial Class Compras_Compras
Exit Sub Exit Sub
End If End If
End If End If
End If End If
If Not ValidaFechaDeAlamacen() Then
Exit Sub
End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
@@ -7820,13 +7825,37 @@ Partial Class Compras_Compras
'FechaCompra 'FechaCompra
Dim FechaMinima As DateTime = TxtFecha.Text.ToDate Dim FechaMinima As DateTime = TxtFecha.Text.ToDate
Dim CveAlmacenMov As Integer = ddlAlmacenAdd.SelectedValue.ToEntero
Dim DTAlamcen As New DataTable
If DDLDevolucion.SelectedValue.ToEntero > 0 Then
Dim objcompras As New ClsCompras()
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
GVDevolucion.DataSource = objcompras.DtResultados
End If
objcompras.Dispose()
GVDevolucion.DataBind()
For Each GvRow As GridViewRow In GVDevolucion.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
CveAlmacenMov = GvRow.DataKey("CveAlmacen").ToString.ToEntero
End If
Next
End If
If DtInv IsNot Nothing Then If DtInv IsNot Nothing Then
For Each Dr As DataRow In TmpDT.Rows For Each Dr As DataRow In TmpDT.Rows
Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero
If CveTipoPS = 2 Then If CveTipoPS = 2 Then
If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=ddlAlmacenAdd.SelectedValue.ToEntero, CvePS:=Dr("CvePS").ToString.ToEntero) Then If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenMov, CvePS:=Dr("CvePS").ToString.ToEntero) Then
If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then
Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate
@@ -7845,8 +7874,9 @@ Partial Class Compras_Compras
objInventario.Dispose() objInventario.Dispose()
If FechaMinima > TxtFecha.Text.ToDate Then If FechaMinima > TxtFecha.Text.ToDate Then
Alert($"Los productos tienen movientos, la fecha minima que se puede aplicar es {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia) Alert($"Los productos tienen movientos, la fecha minima que se cambio la fecha de compra as {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia)
respuesta = False 'respuesta = False
TxtFecha.Text = FechaMinima.ToString("dd/MM/yyyy")
Else Else
respuesta = True respuesta = True
End If End If

View File

@@ -375,14 +375,18 @@
</div> </div>
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<div id="chartdiv" style="text-align: center;height:600px!important">
</div>
<div id="div_ventas" runat="server" style="text-align: center;"> <div id="div_ventas" runat="server" style="text-align: center;">
<img src="/Metronic/assets/admin/layout/img/loading.gif" alt="loading" /> <%--<img src="/Metronic/assets/admin/layout/img/loading.gif" alt="loading" />--%>
</div> </div>
</div> </div>
</div> </div>
<!-- END REGIONAL STATS PORTLET--> <!-- END REGIONAL STATS PORTLET-->
</div> </div>
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script> <script>
@@ -396,50 +400,51 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function CargaGrafica() { } //function CargaGrafica() { }
function CargaGrafica3() { } //function CargaGrafica3() { }
function filldata() { //function filldata() {
// CargaGrafica();
// CargaGrafica3();
// if ($('#C_DivIndicadores')) {
// $('#C_DivIndicadores').slick({
// lazyLoad: 'ondemand',
// slidesToShow: 3,
// slidesToScroll: 1,
// dots: true,
// infinite: true,
// autoplay: true,
// autoplaySpeed: 5000,
// responsive: [
// {
// breakpoint: 1024,
// settings: {
// slidesToShow: 2,
// slidesToScroll: 1,
// infinite: true,
// dots: true
// }
// }, {
// breakpoint: 600,
// settings: {
// slidesToShow: 1,
// slidesToScroll: 1,
// infinite: true,
// dots: true
// }
// }]
// });
// $('#C_DivIndicadores').show();
// $('#C_chartcheckboxes').hide();
// }
//}
CargaGrafica();
CargaGrafica3();
if ($('#C_DivIndicadores')) {
$('#C_DivIndicadores').slick({
lazyLoad: 'ondemand',
slidesToShow: 3,
slidesToScroll: 1,
dots: true,
infinite: true,
autoplay: true,
autoplaySpeed: 5000,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
infinite: true,
dots: true
}
}, {
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
dots: true
}
}]
});
$('#C_DivIndicadores').show();
$('#C_chartcheckboxes').hide();
}
}
$(document).ready(function () { $(document).ready(function () {
filldata(); //filldata();
Sys.Application.add_load(function (s, e) { //Sys.Application.add_load(function (s, e) {
filldata() // filldata()
}); //});
}); });
function CargaDia(pFecha) { function CargaDia(pFecha) {
__doPostBack('txtFecha', pFecha); __doPostBack('txtFecha', pFecha);
@@ -465,5 +470,127 @@
}); });
</script> </script>
<!-- Librería principal de amCharts 4 -->
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<!-- Módulo de gráficos de XYChart -->
<script src="https://cdn.amcharts.com/lib/4/charts.js"></script>
<!-- Tema animado de amCharts 4 -->
<script src="https://cdn.amcharts.com/lib/4/themes/animated.js"></script>
<!-- Paquete de idioma español -->
<script src="https://cdn.amcharts.com/lib/4/lang/es_ES.js"></script>
<script >
// Función para crear series dinámicamente
function createSeries(field, name) {
var series = chart.series.push(new am4charts.LineSeries());
series.dataFields.valueY = field;
series.dataFields.categoryX = "mes";
series.name = name;
series.strokeWidth = 2;
// Añadir bullets a la serie
var bullet = series.bullets.push(new am4charts.CircleBullet());
bullet.circle.radius = 4;
bullet.circle.fill = am4core.color("#fff");
bullet.circle.strokeWidth = 2;
// Configurar el tooltip para cada serie
series.tooltipText = "{name}: [bold]{valueY}[/]";
series.tooltip.pointerOrientation = "vertical";
series.tooltip.background.cornerRadius = 5;
series.tooltip.background.fillOpacity = 0.8;
series.tooltip.label.padding(10, 10, 10, 10);
// Asegurar que el label del tooltip sea visible
series.tooltip.label.fill = am4core.color("#000"); // Texto en negro
// Mostrar el tooltip solo al pasar el cursor sobre la serie
series.tooltip.showInViewport = false;
// Habilitar interacciones en la serie
series.interactionsEnabled = true;
}
function generaGrafico(dtGrafico,dtseries) {
// Importar las librerías de amCharts
am4core.useTheme(am4themes_animated);
// Crear el gráfico
var chart = am4core.create("chartdiv", am4charts.XYChart);
// Ejemplo de datos dinámicos
chart.data = dtGrafico; //[
var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());
categoryAxis.dataFields.category = "mes";
categoryAxis.renderer.grid.template.location = 0;
categoryAxis.renderer.minGridDistance = 30;
// Configuración del eje Y (Importe)
var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());
valueAxis.title.text = "Importe";
for (var i = 0; i < dtseries.length; i++) {
var item = dtseries[i];
var key = Object.keys(item)[0];
var value = item[key];
var series = chart.series.push(new am4charts.LineSeries());
series.dataFields.valueY = key;
series.dataFields.categoryX = "mes";
series.name = value;
series.strokeWidth = 2;
// Añadir bullets a la serie
var bullet = series.bullets.push(new am4charts.CircleBullet());
bullet.circle.radius = 4;
bullet.circle.fill = am4core.color("#fff");
bullet.circle.strokeWidth = 2;
// Configurar el tooltip para cada serie
series.tooltipText = "{name}: [bold]{valueY}[/]";// "{" + value + "}: [bold]{" + key +"}[/]";
series.tooltip.pointerOrientation = "vertical";
series.tooltip.background.cornerRadius = 5;
series.tooltip.background.fillOpacity = 0.8;
series.tooltip.label.padding(10, 10, 10, 10);
// Asegurar que el label del tooltip sea visible
series.tooltip.label.fill = am4core.color("#000"); // Texto en negro
// Mostrar el tooltip solo al pasar el cursor sobre la serie
series.tooltip.showInViewport = false;
// Habilitar interacciones en la serie
series.interactionsEnabled = true;
}
// Habilitar el cursor pero deshabilitar su tooltip
chart.cursor = new am4charts.XYCursor();
chart.cursor.behavior = "none"; // Deshabilitar pan o zoom
chart.cursor.lineX.disabled = true;
chart.cursor.lineY.disabled = true;
chart.cursor.tooltipEnabled = false; // Deshabilitar el tooltip del cursor
// Leyenda
chart.legend = new am4charts.Legend();
// Exportar el gráfico
chart.exporting.menu = new am4core.ExportMenu();
}
</script>
</asp:Content> </asp:Content>

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using Extensiones; using Extensiones;
using System.Data; using System.Data;
using static Extensiones.ModExtensiones; using static Extensiones.ModExtensiones;
@@ -280,14 +280,19 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
CveClienteClasificacion: DdlClienteClasificacion.SelectedValue.ToEntero(), ModalidadContable: !ChkLecturaAdmin.Checked)) CveClienteClasificacion: DdlClienteClasificacion.SelectedValue.ToEntero(), ModalidadContable: !ChkLecturaAdmin.Checked))
{ {
GvDatos.DataSource = ObjVentas.DtResultados; GvDatos.DataSource = ObjVentas.DtResultados;
DtVentas = ObjVentas.DtResultados; DtVentas = ObjVentas.DtResultados;
} }
CveProyecto = DdlProyecto.SelectedValue.ToEntero(); CveProyecto = DdlProyecto.SelectedValue.ToEntero();
ObjVentas.Dispose(); ObjVentas.Dispose();
GvDatos.DataBind(); GvDatos.DataBind();
if (GvDatos.Rows.Count > 0) if (GvDatos.Rows.Count > 0)
{ {
//CargaGraficas(DtVentas); //CargaGraficas(DtVentas);
//this.DvGraficas.Visible = true;
}
else
{
this.DvGraficas.Visible = false;
} }
UPDatos.Update(); UPDatos.Update();
@@ -298,6 +303,37 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
} }
#endregion #endregion
#region GRAFICA
private void CargaGraficas(DataTable DtVentas)
{
MuestraGrafica(div_ventas, DtVentas, "GPO", "Total", "", "", "gh2", "");
}
private void CargaGraficaNEW(DataTable D_T_Datos)
{
JArray jsonData = new JArray();
for (int x=24; x <= 35 ; x++)
{
string Mes = D_T_Datos.Columns[x].ColumnName;
JObject obj = new JObject();
obj.Add(new JProperty("mes", Mes));
for (int y = 1; y <= D_T_Datos.Rows.Count - 1; y++) // y Empiesa en 1 para no agregar el total
{
obj.Add(new JProperty(D_T_Datos.Rows[y][4].ToString(), D_T_Datos.Rows[y][x].ToString()));
}
jsonData.Add(obj);
}
JArray jsonSeries = new JArray();
for (int y = 1; y <= D_T_Datos.Rows.Count - 1; y++) // y Empiesa en 1 para no agregar el total
{
JObject obj = new JObject(
new JProperty(D_T_Datos.Rows[y][4].ToString(), D_T_Datos.Rows[y][4].ToString())
);
jsonSeries.Add(obj);
} }
string jsdatos = jsonData.ToString(); string jsdatos = jsonData.ToString();
string jsseries = jsonSeries.ToString(); string jsseries = jsonSeries.ToString();