This commit is contained in:
2025-06-23 21:09:42 -07:00
6 changed files with 284 additions and 103 deletions

View File

@@ -569,7 +569,7 @@ Partial Class Bancos_PagoElectronico
Header.Append(TipoArchivo.PadRight(2, Space)) 'TIPO ARCHIVO (2)
Header.Append("HA") 'TIPO REGISTRO (2)
Header.Append("JDF") 'SISTEMA-CENTRAL (3)
Header.Append(NumeroConvenio.PadLeft(7, Space)) 'NUMERO DE CONTRATO (7) ' ocupa 5 dígitos pero en el layout se usa 7
Header.Append(NumeroConvenio.PadLeft(7, Cero)) 'NUMERO DE CONTRATO (7) ' ocupa 5 dígitos pero en el layout se usa 7
Header.Append(NowADS.ToString("yyyyMMdd")) 'FECHA-SOLICITUD (8)
Header.Append("001") 'SECUENCIA (3)
Header.Append("M") 'MANTENIMIENTO-O-CONSULTA (1)
@@ -594,7 +594,7 @@ Partial Class Bancos_PagoElectronico
Dim CuentaDestino As String = ""
Dim cuentaDigitos As String = dr("CLABEDestino").ToString.Trim
Dim Clabe As String = dr("CLABE").ToString.Trim
Dim limite As String = (900000000 * 100D).ToEntero.ToString("F0")
Dim limite As String = (9000000000 * 100D).ToString("F0")
Dim banco As String = dr("CveBanco").ToString.PadLeft(3, Cero)
If cuentaDigitos.Length = 11 AndAlso banco = "044" Then
@@ -672,10 +672,10 @@ Partial Class Bancos_PagoElectronico
trailer.Append(TipoArchivo.PadRight(2, Space)) 'TIPO DE ARCHIVO (2)
trailer.Append("TA") 'TIPO DE REGISTRO (2)
trailer.Append(Altas.ToString.PadLeft(8, Space)) 'CANTIDAD DE MOVIMIENTOS ALTAS (8)
trailer.Append(Cambios.ToString.PadLeft(8, Space)) 'CANTIDAD DE MOVIMIENTOS CAMBIOS (8)
trailer.Append(Bajas.ToString.PadLeft(8, Space)) 'CANTIDAD DE MOVIMIENTOS BAJAS (8)
trailer.Append(Consultas.ToString.PadLeft(8, Space)) 'CANTIDAD DE CONSULTAS (8)
trailer.Append(Altas.ToString.PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS ALTAS (8)
trailer.Append(Cambios.ToString.PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS CAMBIOS (8)
trailer.Append(Bajas.ToString.PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS BAJAS (8)
trailer.Append(Consultas.ToString.PadLeft(8, Cero)) 'CANTIDAD DE CONSULTAS (8)
'MOVIMIENTOS ACEPTADOS
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS ALTAS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS CAMBIOS (8) *** Respusta de ScotiaBank ***
@@ -957,7 +957,7 @@ Partial Class Bancos_PagoElectronico
da.Append("".PadLeft(34, CERO)) ' 105-138 Uso Futuro
da.Append("".PadLeft(30, SPACE)) ' 139-168 Clave de Rastreo llenar con espacios en blanco
da.Append("".PadLeft(20, SPACE)) ' 169-188 Referencia de Abono Banxico
dm.Append("01") ' 189-190 Tipo de Operación anexo G
dm.Append(" ") ' 189-190 Tipo de Operación anexo G
da.Append("".PadLeft(232, SPACE)) ' 191-370 FILLER

View File

@@ -17690,9 +17690,9 @@ Partial Class Compras_Compras
Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ")
If NumNoDed > 0 Then GvPS.Columns(13).Visible = True 'visualiza columnas de nodeducibles
'If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 Then
' InicializaAplicaNCFact()
'End If
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 And CveCompra <= 0 Then
InicializaAplicaNCFact()
End If
End Sub
Private Sub OriginalesVisible(Accion As Boolean)

View File

@@ -262,12 +262,18 @@
<asp:UpdatePanel ID="UpCuentaDeposito" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row" id="trCuentaDeposito" runat="server" visible="False">
<div class="row" id="trCuentaDeposito" runat="server" visible="false">
<label class="col-md-2 control-label">Cuenta Depósito: </label>
<div class="col-md-10">
<asp:DropDownList ID="DdlCuentaDeposito" runat="server" DataTextField="CuentaDeposito" DataValueField="CveCuentaDeposito" CssClass="form-control input-sm select2me" Width="400px" AppendDataBoundItems="True"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuentaDeposito" runat="server" ControlToValidate="DdlCuentaDeposito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta de Depósito''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECuentaDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuentaDeposito" Width="300px"></ajax:ValidatorCalloutExtender>
<div runat="server" id="DVValidacionesCuentaDeposito" visible="false">
<asp:RequiredFieldValidator ID="RFVCuentaDeposito" runat="server" ControlToValidate="DdlCuentaDeposito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta de Depósito''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECuentaDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuentaDeposito" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<%--<asp:ImageButton ID="ImgUpdateCuentaDeposito" ImageUrl="/Imagenes/accept.png" OnClick="ImgUpdateCuentaDeposito_Click" ValidationGroup="GrpGuardar" runat="server" />--%>
</div>
</div>

View File

@@ -349,43 +349,52 @@ Partial Class Compras_ReembolsosComprobaciones
DdlCuentaDeposito.SelectedValue = Nothing
DdlCuentaDeposito.Items.Clear()
trCuentaDeposito.Visible = False
DdlCuentaDeposito.Enabled = False
DVValidacionesCuentaDeposito.Visible = False
'trCuentaDeposito.Visible = False
'DdlCuentaDeposito.Enabled = False
Dim CvePersonal As Integer = DdlPersonal.SelectedValue.ToEntero
If CvePersonal > 0 Then
If CvePersonal > 0 And DdlTipoPago.SelectedValue.ToEntero = 1 Then
If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then
'If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then
trCuentaDeposito.Visible = True
DdlCuentaDeposito.Enabled = True
trCuentaDeposito.Visible = True
DdlCuentaDeposito.Enabled = True
Dim Dep As New ClsGenerales
If Dep.GetCuentasDepositos(CvePersonal:=CvePersonal, CveEmpresa:=UsuarioActual.CveEmpresa) Then
Dim Dep As New ClsGenerales
If Dep.GetCuentasDepositos(CvePersonal:=CvePersonal, CveEmpresa:=UsuarioActual.CveEmpresa) Then
If DdlTipoTransaccion.SelectedValue = "9" Then
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros(" EstatusPagoElectronico = 'True'")
Else
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True'")
End If
If Dep.DtResultados.Rows.Count > 0 Then
trCuentaDeposito.Visible = True
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
End If
If DdlTipoTransaccion.SelectedValue = "9" Then
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros(" EstatusPagoElectronico = 'True'")
ElseIf DdlTipoTransaccion.SelectedValue = "17" Then
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True'")
Else
DdlCuentaDeposito.DataSource = Dep.DtResultados
End If
Dep.Dispose()
DdlCuentaDeposito.DataBind()
'If Dep.DtResultados.Rows.Count > 0 Then
trCuentaDeposito.Visible = True
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
'End If
End If
Dep.Dispose()
DdlCuentaDeposito.DataBind()
'End If
Else
trCuentaDeposito.Visible = False
End If
If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(9, 17) Then
DVValidacionesCuentaDeposito.Visible = True
Else
End If
UpCuentaDeposito.Update()

View File

@@ -22,6 +22,7 @@
}
.table td, .table th {
padding: 2px;
}
@@ -371,7 +372,9 @@
max-height: 170px;
}
#containerC_gvResumenSucursales tr.stickyRow th{
white-space:nowrap !important;
}
/* Estilos para el header */
@@ -405,6 +408,20 @@
background-color: #f8f9fa !important;
font-weight: bold;
}
.header-flex {
display: flex !important;
flex-direction: row !important;
align-items: center !important;
gap: 6px;
}
element.style {
display: flex
;
flex-direction: row;
align-items: center;
}
/*
.gvMaxHeight{
max-height: 160px;
@@ -499,12 +516,12 @@
<asp:TemplateField>
<HeaderTemplate>
<div style="display: flex; flex-direction: column; align-items: center;">
<div style="display: flex; flex-direction:row !important; flex-wrap: nowrap !important; white-space: nowrap;">
<span>Venta Anual</span>
<div>
<asp:CheckBox ID="chkVentaAnual" runat="server" CssClass="header-checkbox" data-field="VentaAnual" />
<label for="chkVentaAnual">Graficar</label>
</div>
<input type="checkbox" id="chkVentaAnual" class="header-checkbox" data-field="VentaAnual" style="margin-left: auto;" />
<%--<asp:CheckBox ID="chkVentaAnual" runat="server" CssClass="header-checkbox" data-field="VentaAnual" Style="margin-left: auto;" />--%>
<label for="chkVentaAnual" style="margin-bottom: 0; margin-left: 4px;">Graficar</label>
<span class="adssigrid-order" style="margin-left: 4px;"></span>
</div>
</HeaderTemplate>
<ItemTemplate>
@@ -514,7 +531,7 @@
<asp:TemplateField>
<HeaderTemplate>
<div style="display: flex; flex-direction: column; align-items: center;">
<div style="display: flex; align-items: center;">
<span>Utilidad Anual</span>
<div>
<asp:CheckBox ID="chkUtilidadAnual" runat="server" CssClass="header-checkbox" data-field="UtilidadAnual" />
@@ -529,7 +546,7 @@
<asp:TemplateField>
<HeaderTemplate>
<div style="display: flex; flex-direction: column; align-items: center;">
<div style="display: flex; align-items: center;">
<span>Venta Mensual</span>
<div>
<asp:CheckBox ID="chkVentaMensual" runat="server" CssClass="header-checkbox" data-field="VentaMensual" />
@@ -544,7 +561,7 @@
<asp:TemplateField>
<HeaderTemplate>
<div style="display: flex; flex-direction: column; align-items: center;">
<div style="display: flex; align-items: center;">
<span>Utilidad Mensual</span>
<div>
<asp:CheckBox ID="chkUtilidadMensual" runat="server" CssClass="header-checkbox" data-field="UtilidadMensual" />
@@ -2390,7 +2407,7 @@
<span class="caption-subject font-dark bold">Pagos por Proveedor</span>
</div>
</div>
<div class="portlet-body table-responsive">
<div class="portlet-body">
<asp:GridView ID="gvPagosPorProveedor" runat="server"
CssClass="adssigrid-scroll adssigrid-order table table-hover table-light custom-grid"
AutoGenerateColumns="false"
@@ -2483,22 +2500,26 @@
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivModalGrafica" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title" id="modalTitulo">Comparativo de Sucursales</h4>
</div>
<div class="modal-body">
<div id="chartContainer" style="width: 100%; height: 500px;"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
<div class="modal fade" id="DivModalGrafica" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title" id="modalTitulo">Comparativo de Sucursales</h4>
</div>
<div class="modal-body">
<asp:DropDownList ID="ddlTipoGrafica" runat="server">
<asp:ListItem Value="line">Líneas</asp:ListItem>
<asp:ListItem Value="pie">Pastel</asp:ListItem>
</asp:DropDownList>
<div id="chartContainer" style="width: 100%; height: 400px;"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
@@ -2511,13 +2532,57 @@
});
}
$(document).ready(function () {
console.log('Document ready - Configurando evento del dropdown');
// Función para asignar el evento al dropdown
function asignarEventoDropdown() {
// Buscar el dropdown usando un selector que funcione con WebForms
var $ddl = $('[id$="ddlTipoGrafica"]');
if ($ddl.length === 0) {
console.error('ERROR: No se encontró el dropdown con id que termine en ddlTipoGrafica');
return;
}
console.log('Dropdown encontrado, configurando evento...');
console.log('ID real del dropdown:', $ddl.attr('id'));
// Remover eventos anteriores y agregar el nuevo
$ddl.off('change').on('change', function () {
console.log('=== CAMBIO EN DROPDOWN ===');
console.log('Nuevo valor seleccionado:', $(this).val());
// Verificar qué función usar según el contexto
if ($('table[id$="gvResumenSucursales"]').length > 0) {
console.log('Usando generarGraficaSucursales()');
generarGraficaSucursales();
} else {
console.log('Usando generarGrafica() con gridId:', window.lastUsedGridId);
if (window.lastUsedGridId) {
generarGrafica(window.lastUsedGridId);
}
}
});
}
// Asignar evento al cargar la página
asignarEventoDropdown();
// Re-asignar evento después de postbacks de AJAX (si usas UpdatePanel)
if (typeof Sys !== "undefined" && Sys.WebForms) {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(asignarEventoDropdown);
}
});
function generarGraficaSucursales() {
// 1) Obtener la tabla completa
var $grid = $('table[id$="gvResumenSucursales"]');
// 2) Buscar TODOS los checkbox marcados
var $checks = $grid.find('input.header-checkbox:checked');
if ($checks.length === 0) {
alert('Por favor, seleccione al menos una columna para graficar.');
return false;
@@ -2535,20 +2600,16 @@
var $headerRows = $grid.find('tr').filter(function () {
return $(this).find('th').length > 1;
});
var $subThs = $headerRows.eq(1).find('th'); // esos 4 <th>
var $subThs = $headerRows.eq(1).find('th');
// 6) Construir las series
var series = $checks.map(function () {
var $chk = $(this);
var $th = $chk.closest('th');
// idxSub = posición dentro de los 4 subheaders (0..3)
var idxSub = $subThs.index($th);
// +1 porque la columna 0 es "Sucursal"
var colIndex = idxSub + 1;
// Leer data-field (VentaAnual, UtilidadAnual, etc.) y formatear nombre
var field = $chk.data('field');
var name = field.replace(/([a-z])([A-Z])/g, '$1 $2');
// Mapear los valores de cada fila para esta columna
var data = $dataRows.map(function () {
var txt = $(this).find('td').eq(colIndex).text().replace(/,/g, '');
return parseFloat(txt) || 0;
@@ -2556,38 +2617,90 @@
return { name: name, data: data };
}).get();
// 7) Dibujar Highcharts
Highcharts.chart('chartContainer', {
chart: { type: 'line' },
// 7) Obtener el tipo de gráfica seleccionado
var $ddl = $('[id$="ddlTipoGrafica"]');
var tipoGrafica = $ddl.length > 0 ? $ddl.val() : 'line';
// 8) Configuración base de Highcharts
var config = {
title: { text: 'Comparativo por Sucursal' },
xAxis: {
series: series
};
// 9) Configuración específica para cada tipo de gráfica
if (tipoGrafica === 'line') {
config.chart = { type: 'line' };
config.xAxis = {
categories: categorias,
title: { text: 'Sucursal' }
},
yAxis: {
};
config.yAxis = {
title: { text: 'Monto' },
labels: {
formatter: function () {
return '$' + Highcharts.numberFormat(this.value, 0);
}
}
},
tooltip: {
};
config.tooltip = {
headerFormat: '<b>{series.name}</b><br />',
pointFormat: 'Sucursal: <b>{point.category}</b><br />Valor: <b>${point.y:,.2f}</b>'
},
plotOptions: {
series: { marker: { enabled: true } }
},
series: series
});
};
config.plotOptions = { series: { marker: { enabled: true } } };
} else if (tipoGrafica === 'pie') {
config.chart = { type: 'pie' };
config.plotOptions = {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f}%'
}
}
};
config.tooltip = {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
};
// 8) Mostrar el modal
$('#DivModalGrafica').modal('show');
// Para gráfica de pastel, convertir las series a un formato diferente
if (series.length > 0) {
var firstSeries = series[0];
var pieData = categorias.map(function (categoria, index) {
return {
name: categoria,
y: firstSeries.data[index]
};
});
config.series = [{
name: firstSeries.name,
colorByPoint: true,
data: pieData
}];
}
}
// 10) Dibujar Highcharts
try {
Highcharts.chart('chartContainer', config);
console.log('Gráfica creada exitosamente');
} catch (error) {
console.error('Error al crear la gráfica:', error);
}
// 11) Mostrar el modal solo si no está visible
if (!$('#DivModalGrafica').hasClass('in') && !$('#DivModalGrafica').is(':visible')) {
$('#DivModalGrafica').modal('show');
}
return false;
}
function generarGrafica(gridId) {
// Guardar el último grid usado para el evento del dropdown
window.lastUsedGridId = gridId;
var $grid = $('#' + gridId);
// Encuentra las filas de encabezado (donde están los checkboxes)
@@ -2597,6 +2710,7 @@
// Buscar checkboxes marcados
var $checks = $grid.find('input.header-checkbox:checked');
if ($checks.length === 0) {
alert('Por favor, seleccione al menos una columna para graficar.');
return false;
@@ -2632,7 +2746,6 @@
var txt = $(this).find('td').eq(colIndex).text().replace(/,/g, '');
return parseFloat(txt) || 0;
}).get();
series.push({ name: name, data: data });
});
@@ -2641,37 +2754,90 @@
var modalTitulo = document.getElementById('modalTitulo');
if (modalTitulo) modalTitulo.innerText = 'Comparativo: ' + titulo;
// Dibujar gráfica
Highcharts.chart('chartContainer', {
chart: { type: 'line' },
title: { text: titulo }, // Usar el título dinámico
xAxis: {
// Obtener el tipo de gráfica seleccionado
var $ddl = $('[id$="ddlTipoGrafica"]');
var tipoGrafica = $ddl.length > 0 ? $ddl.val() : 'line';
// Configuración base de Highcharts
var config = {
title: { text: titulo },
series: series
};
// Configuración específica para cada tipo de gráfica
if (tipoGrafica === 'line') {
config.chart = { type: 'line' };
config.xAxis = {
categories: categorias,
title: { text: 'Categoría' } // Título genérico para el eje X
},
yAxis: {
title: { text: 'Categoría' }
};
config.yAxis = {
title: { text: 'Monto (MXN)' },
labels: {
formatter: function () {
return '$' + Highcharts.numberFormat(this.value, 0);
}
}
},
tooltip: {
};
config.tooltip = {
headerFormat: '<b>{series.name}</b><br />',
pointFormat: 'Categoría: <b>{point.category}</b><br />Valor: <b>${point.y:,.2f}</b>'
},
plotOptions: {
series: { marker: { enabled: true } }
},
series: series
});
};
config.plotOptions = { series: { marker: { enabled: true } } };
} else if (tipoGrafica === 'pie') {
config.chart = { type: 'pie' };
config.plotOptions = {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f}%'
}
}
};
config.tooltip = {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
};
// Para gráfica de pastel, usar solo la primera serie seleccionada
if (series.length > 0) {
var firstSeries = series[0];
console.log('Primera serie para pastel:', firstSeries);
var pieData = categorias.map(function (categoria, index) {
return {
name: categoria,
y: firstSeries.data[index]
};
});
console.log('Datos del pastel:', pieData);
config.series = [{
name: firstSeries.name,
colorByPoint: true,
data: pieData
}];
}
}
// Dibujar gráfica
try {
Highcharts.chart('chartContainer', config);
console.log('Gráfica creada exitosamente');
} catch (error) {
console.error('Error al crear la gráfica:', error);
}
// Mostrar el modal solo si no está visible
if (!$('#DivModalGrafica').hasClass('in') && !$('#DivModalGrafica').is(':visible')) {
$('#DivModalGrafica').modal('show');
}
$('#DivModalGrafica').modal('show');
return false;
}
</script>

View File

@@ -381,7 +381,7 @@ Partial Class General_Dashboard
Dim cellSucursal As New TableHeaderCell()
cellSucursal.RowSpan = 2
cellSucursal.VerticalAlign = VerticalAlign.Middle
'cellSucursal.VerticalAlign = VerticalAlign.Middle
cellSucursal.Controls.Add(New LiteralControl("<span>Sucursal</span>&nbsp;"))
Dim hypGrafica As New HyperLink()
hypGrafica.NavigateUrl = "javascript:void(0);"
@@ -393,13 +393,13 @@ Partial Class General_Dashboard
Dim cellAnio As New TableHeaderCell()
cellAnio.ColumnSpan = 2
cellAnio.HorizontalAlign = HorizontalAlign.Center
'cellAnio.HorizontalAlign = HorizontalAlign.Center
cellAnio.Text = "Año"
headerRow1.Cells.Add(cellAnio)
Dim cellMes As New TableHeaderCell()
cellMes.ColumnSpan = 2
cellMes.HorizontalAlign = HorizontalAlign.Center
'cellMes.HorizontalAlign = HorizontalAlign.Center
cellMes.Text = "Mes"
headerRow1.Cells.Add(cellMes)