Compras compra en dolares pago con anticipo en pesos

This commit is contained in:
rakcsle
2024-10-24 10:08:43 -07:00
parent fbc6faa63c
commit 4ba60b092e
11 changed files with 2067 additions and 1398 deletions

View File

@@ -6292,6 +6292,34 @@ Public Class ClsInventarios
Return Retorno
End Function
#Region " K P I "
Public Function GetVerComportamiento(CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveAlmacenes As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_VerComportamientoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacenes", SqlDbType.VarChar).Value = CveAlmacenes
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al consultar el comportamiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region " IDisposable Support "
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
@@ -6322,6 +6350,8 @@ Public Class ClsInventarios
End Sub
#End Region
End Class

View File

@@ -6137,7 +6137,8 @@
txt.value = SaldoCompra - txtvalue;
}
}
debugger;
let saldoVal = saldo;
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
saldoVal = ToDouble(saldo / TCAnticipo)
@@ -6145,7 +6146,9 @@
saldoVal = ToDouble(saldo * TCAnticipo)
}
if (saldoVal > SaldoCompra ) {
//(Math.round(saldoVal * 100) / 100);
if ((Math.round(saldoVal * 100) / 100) > SaldoCompra ) {
saldo = SaldoCompra;
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
saldoVal = ToDouble(saldo / TCAnticipo);
@@ -6160,7 +6163,8 @@
chk.checked = true;
} else {
chk.checked = false;
}
}
if (ToDouble(txtvalue) > saldoVal) {
txt.value = FormatoNumero(saldo, 2);

View File

@@ -401,6 +401,7 @@ Partial Class Compras_Compras
Public Property CvePersonal As Integer
Public Property CveCompra As Integer
Public Property CvePrePoliza As Integer
Public Property Fecha As Date
End Class
Private Property ArrAnticipos As ArrayList
Get
@@ -3698,12 +3699,26 @@ Partial Class Compras_Compras
ObjProveedor.Dispose()
End Sub
Private Sub CargaAnticipos(CveProveedor As Integer, Optional FiltroTipo As String = "-1")
Private Sub CargaAnticipos(CveProveedor As Integer, Optional FiltroTipo As String = "-1", Optional PagarDolaresEnPesos As Boolean = False)
Dim ObjMovtos As New ClsMovimientos()
DivPagarConPesos.Visible = False
If DdlMoneda.SelectedValue.ToEntero = 2 Then
DivPagarConPesos.Visible = True
End If
If ObjMovtos.GetAnticiposProveedor(CveProveedor, -1, CveMoneda:=-1, SelectTop:=-1, TipoDocto:=FiltroTipo) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then
Dim CveMoneda As Integer = If(ChkPagarConPesos.Checked, 1, If(ChkPagarConDolares.Checked, 2, DdlMoneda.SelectedValue.ToEntero))
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso CveCompra > 0 Then DivPagarConDolares.Visible = True Else If CveCompra > 0 Then DivPagarConPesos.Visible = True
GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Tipo = 'Act' AND CveMoneda = {CveMoneda}")
If PagarDolaresEnPesos Then
GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Tipo = 'Act' CveMoneda = 1")
Else
GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Tipo = 'Act' AND CveMoneda = {CveMoneda}")
End If
If ObjMovtos.DtResultados.FiltraParametros("Saldo > 0").Rows.Count > 0 Then
BtnAceptarAnticipos.Enabled = True
If DdlTipoComprobante.SelectedValue = "Fac" Then ImgAnticiposPendientes.Visible = True
@@ -7324,6 +7339,17 @@ Partial Class Compras_Compras
Pago.ImportePago = importeMovimiento + ImporComisionAnticipo
Pago.CveIE = Ant.CveIE
Pago.TCPago = Ant.TCCompra
If Pago.CveMonedaPago = 1 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
Pago.TCPago = 1 ' TxtTC.Text.ToDecimal
Pago.TCCambioMoneda = Ant.TCCompra 'GlobalTipoCambio(Now).ToDecimal
If Ant.TCCompra = 1 Then
Pago.TCCambioMoneda = 1 / GlobalTipoCambio(Ant.Fecha).ToDecimal
End If
End If
Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1)
Pago.OtroGastoIngreso = -ImporComisionAnticipo
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
@@ -8555,7 +8581,7 @@ Partial Class Compras_Compras
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto")})
ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto"), .Fecha = gvr.DataKey("Fecha").ToDate})
End If
Next

View File

@@ -85,7 +85,10 @@
<Width>2.06786cm</Width>
</TablixColumn>
<TablixColumn>
<Width>9.78709cm</Width>
<Width>7.28712cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.78414cm</Width>
@@ -282,6 +285,52 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Serie</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>None</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>None</Style>
<Width>1pt</Width>
</BottomBorder>
<BackgroundColor>#9cc3e5</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox13">
@@ -504,6 +553,34 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="SerieLote">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!SerieLote.Value</Value>
<Style>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>SerieLote</rd:DefaultName>
<Style>
<Border />
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(RowNumber(Nothing)=1,"1pt","0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Lote">
@@ -577,6 +654,7 @@
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
@@ -593,7 +671,7 @@
<Top>0.17639cm</Top>
<Left>0.07701cm</Left>
<Height>0.83488cm</Height>
<Width>19.71019cm</Width>
<Width>19.71022cm</Width>
<Style>
<Border>
<Style>None</Style>
@@ -604,10 +682,10 @@
<Height>0.58708in</Height>
<Style />
</Body>
<Width>7.85374in</Width>
<Width>7.79025in</Width>
<Page>
<PageHeader>
<Height>3.64919cm</Height>
<Height>3.86086cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
@@ -879,7 +957,7 @@ CIUDAD DE MEXICO</Value>
</Paragraphs>
<rd:DefaultName>Textbox15</rd:DefaultName>
<Top>0.00028cm</Top>
<Height>0.45889cm</Height>
<Height>0.59849cm</Height>
<Width>8.88123cm</Width>
<Style>
<Border>
@@ -895,7 +973,7 @@ CIUDAD DE MEXICO</Value>
<KeepTogether>true</KeepTogether>
<Top>3.05042cm</Top>
<Left>0.07701cm</Left>
<Height>0.49294cm</Height>
<Height>0.59877cm</Height>
<Width>19.7102cm</Width>
<ZIndex>7</ZIndex>
<Style>
@@ -950,7 +1028,7 @@ CIUDAD DE MEXICO</Value>
</Style>
</PageHeader>
<PageFooter>
<Height>6.20815cm</Height>
<Height>6.41982cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
@@ -1296,7 +1374,7 @@ CIUDAD DE MEXICO</Value>
<rd:DefaultName>Textbox29</rd:DefaultName>
<Top>5.57148cm</Top>
<Left>0.07701cm</Left>
<Height>0.41981cm</Height>
<Height>0.63667cm</Height>
<Width>7.15666cm</Width>
<ZIndex>10</ZIndex>
<Style>
@@ -1322,7 +1400,7 @@ CIUDAD DE MEXICO</Value>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!FechaImpresion.Value</Value>
<Value>=Format(Now(), "dd/MM/yyyy hh:mm tt")</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
@@ -1334,7 +1412,7 @@ CIUDAD DE MEXICO</Value>
<rd:DefaultName>Textbox31</rd:DefaultName>
<Top>5.57148cm</Top>
<Left>8.13262cm</Left>
<Height>0.41981cm</Height>
<Height>0.63667cm</Height>
<Width>6.04844cm</Width>
<ZIndex>11</ZIndex>
<Style>
@@ -1368,7 +1446,7 @@ CIUDAD DE MEXICO</Value>
<rd:DefaultName>Textbox35</rd:DefaultName>
<Top>5.5362cm</Top>
<Left>17.28722cm</Left>
<Height>0.45509cm</Height>
<Height>0.67195cm</Height>
<Width>2.5cm</Width>
<ZIndex>12</ZIndex>
<Style>

File diff suppressed because it is too large Load Diff

View File

@@ -144,6 +144,9 @@
&nbsp;<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#Kardex">&nbsp;&nbsp;</a>
</div>--%>
</li>
<li>
<asp:LinkButton ID="LnkKPIVerComportamiento" Visible="false" runat="server" OnClick="LnkKPIVerComportamiento_Click"><i class="fa fa-list"></i>Ver Comportamiento</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgImprimir" />
@@ -169,7 +172,7 @@
<div class="row" style="padding-top: 10px; position: relative;">
<asp:Label runat="server" ID="LblPS" CssClass="col-md-1 truncate">Producto:</asp:Label>
<div class="col-md-2 " style="min-width: 250px; max-width: 300px;">
<ADS:Dropdownlost ID="ddlProducto2" runat="server" autopostback="False" DataTextField="PSCodigo" IncluyeTodos="false" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width: 250px; "></ADS:Dropdownlost>
<ADS:Dropdownlost ID="ddlProducto2" runat="server" autopostback="False" DataTextField="PSCodigo" IncluyeTodos="false" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width: 250px; " Onselectedindexchange="ddlProducto2_selectedindexchange"></ADS:Dropdownlost>
</div>
<label class="col-md-1 truncate" style="max-width: 80px;" id="lblAlm" runat="server">Almacén:</label>
@@ -716,6 +719,44 @@
</asp:UpdatePanel>
</div>
<div id="DVKPIComportamiento" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalComporatmiento" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content" style="width:1000px!important">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="Literal4" Text="Comportamiento" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<asp:GridView ID="GVComportamiento" Width="100%" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="False" AllowPaging="False"
ShowFooter="True" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-advance table-hover ScrollAD" GridLines="None">
<Columns>
<asp:BoundField HeaderText="" DataField="Agrupador" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Enero" DataField="Enero" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Febrero" DataField="Febrero" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Marzo" DataField="Marzo" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Abril" DataField="Abril" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Mayo" DataField="Mayo" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Junio" DataField="Junio" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Julio" DataField="Julio" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Agosto" DataField="Agosto" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Septiembre" DataField="Septiembre" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Octubre" DataField="Octubre" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Noviembre" DataField="Noviembre" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Diciembre" DataField="Diciembre" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -763,5 +763,53 @@ Partial Class Inventarios_Kardex
ObjOC.Dispose()
UpIndicadores.Update()
#Region " K P I V E R C O M P O R T A M I E N T O "
#End Region
End Sub
Protected Sub LnkKPIVerComportamiento_Click(sender As Object, e As EventArgs)
CargaDatosKPIVerCoportamiento()
RegistraScript("$('#DVKPIComportamiento').modal('show');")
End Sub
Private Sub CargaDatosKPIVerCoportamiento()
If ddlProducto2.SelectedValue.ToEntero <= 0 Then
Alert("No hay un producto seleccionado.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjInvetarios As New ClsInventarios
Dim FechaInicio As New Date(Now.Year, 1, 1)
Dim FechaFin As New Date(Now.Year, 12, 31)
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
If ObjInvetarios.GetVerComportamiento(ddlProducto2.SelectedValue.ToEntero, FechaInicio, FechaFin, UsuarioActual.CveEmpresa, CveAlmacenes) Then
GVComportamiento.DataSource = ObjInvetarios.DtResultados
End If
ObjInvetarios.Dispose()
GVComportamiento.DataBind()
UpModalComporatmiento.Update()
End Sub
Protected Sub ddlProducto2_selectedindexchange(sender As Object, e As EventArgs)
LnkKPIVerComportamiento.Visible = False
If ddlProducto2.SelectedValue.ToEntero > 0 Then
LnkKPIVerComportamiento.Visible = True
End If
UpAcciones.Update()
End Sub
End Class

View File

@@ -1097,11 +1097,6 @@ Partial Class Inventarios_RecepcionAlmacen
End If
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If ObjCompras.GetCompraDetalle(pCveCompra, UsuarioActual.CveEmpresa) Then
TotalCompraOC = ObjCompras.DtResultados.SUM("Total", "CveTipoPS = 2")
End If
End If
CveSubProyecto = DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero

View File

@@ -87,7 +87,7 @@
<asp:UpdatePanel ID="UpDescarga" runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="LbPorAtenderPDF" runat="server" OnClick="LbPorAtenderPDF_Click"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF por Atender</asp:LinkButton>
<asp:LinkButton ID="LbPorAtenderPDF" runat="server" OnClick="LbPorAtenderPDF_Click" Visible="false"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF por Atender</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>

View File

@@ -368,6 +368,7 @@ Partial Class RepOC
#Region " CONSULTAR "
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click
LbPorAtenderPDF.Visible = False
LbPorAtender.Visible = False
LbPendientes.Visible = False
LbPendientesPDF.Visible = False
@@ -405,6 +406,11 @@ Partial Class RepOC
UPPIndicador.Update()
End If
If DtOC IsNot Nothing AndAlso DtOC.Rows.Count > 0 Then
LbPorAtenderPDF.Visible = True
End If
'SI NO TIENE DATOS, NO MOSTRAR LA COLUMNA
If OC.DtResultados.FiltraParametros("", DistinctColumns:={"UsuarioAsignado"}).FiltroPrimeroValor("UsuarioAsignado") = "" Then
GvConsultar.Columns(10).Visible = False
@@ -540,8 +546,18 @@ Partial Class RepOC
Dim Proveedor = If(DdlProveedores.SelectedValue = "-1", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedores.txtText.Value }")
Dim Cliente = If(ddlcliente.SelectedValue = "-1", "", $"&emsp;<b>Cliente:</b>&nbsp;{ddlcliente.SelectedItem.Text}")
If DtPorAtender IsNot Nothing AndAlso DtPorAtender.Rows.Count > 0 Then
Dim Cantidad As Integer = DtOC.COUNT("CveOrdenCompra")
Dim TotalPesos As Double = DtOC.SUM("Total", "CveMoneda = 1")
Dim TotalDolares As Double = DtOC.SUM("Total", "CveMoneda = 2")
Dim Total As Double = TotalPesos + (TotalDolares * GlobalTipoCambio)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
@@ -549,6 +565,12 @@ Partial Class RepOC
params.Add(New ReportParameter("SubProyectoHeader", LblSubProyecto.Text))
params.Add(New ReportParameter("Titulo", "REPORTE DE ORDENES DE COMPRA POR ATENDER"))
params.Add(New ReportParameter("Cantidad", Cantidad.ToString("###,###,###")))
params.Add(New ReportParameter("TotalPesos", TotalPesos.ToString("$###,###,###.00")))
params.Add(New ReportParameter("TotalDolares", TotalDolares.ToString("$###,###,###.00")))
params.Add(New ReportParameter("Total", Total.ToString("$###,###,###.00")))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
Dim NombreArchivoDescargar As String = $"RepOCPorAtender{If(DdlProyectos.SelectedValue <> "-1", "_" & DdlProyectos.SelectedItem.Text, "")}_{DateTime.Now.ToShortDateString}"

View File

@@ -6,6 +6,10 @@
<asp:Content ID="Content1" ContentPlaceHolderID="Css" runat="Server">
<style type="text/css">
#chart-header > div:nth-child(1) > svg:nth-child(1) > g:nth-child(2) > g:nth-child(2) > g:nth-child(1) > g:nth-child(1) > g:nth-child(1) > g:nth-child(1) > g:nth-child(1) > g:nth-child(1) > g:nth-child(1) > g:nth-child(1) > g:nth-child(1) > g:nth-child(2) > g:nth-child(8){
display:none!important
}
/* #chartdiv {
width: 100%;
height: 100%;
@@ -851,23 +855,37 @@
// Crear eje X (DateAxis) para el encabezado
var xAxisHeader = chartHeader.xAxes.push(new am4charts.DateAxis());
xAxisHeader.baseInterval = { timeUnit: "hour", count: 1 };
//xAxisHeader.baseInterval = { timeUnit: "hour", count: 1 };
xAxisHeader.baseInterval = { timeUnit: "day", count: 1 }; // Cambiado a "day"
xAxisHeader.minPeriod = "day"; // Añadido
xAxisHeader.min = minDate.getTime();
xAxisHeader.max = maxDate.getTime();
xAxisHeader.renderer.opposite = false; // Cambiado a false
xAxisHeader.renderer.minGridDistance = 50; // Ajusta según sea necesario para evitar superposición
xAxisHeader.renderer.minorGridEnabled = true;
xAxisHeader.renderer.minGridDistance = 1; // Ajusta según sea necesario para evitar superposición
xAxisHeader.renderer.minorGridEnabled = false;
xAxisHeader.markUnitChange = false;
// Configurar las líneas de cuadrícula
xAxisHeader.renderer.grid.template.disabled = false;
xAxisHeader.renderer.grid.template.location = 0;
xAxisHeader.renderer.grid.template.strokeOpacity = 1;
xAxisHeader.renderer.grid.template.strokeWidth = 1;
xAxisHeader.renderer.grid.template.stroke = am4core.color("#000000");
// Asegurar que todas las etiquetas se muestren
xAxisHeader.renderer.labels.template.forceShow = true;
xAxisHeader.renderer.labels.template.location = 0.5;
xAxisHeader.renderer.labels.template.fontSize = 14;
xAxisHeader.renderer.labels.template.fontWeight = "bold";
// Formatear las etiquetas de fecha
xAxisHeader.dateFormatter.dateFormat = "dd/MM";
xAxisHeader.periodChangeDateFormats.setKey("day", "dd/MM");
//xAxisHeader.dateFormats.setKey("day", "dd/MM"); // Añadido
xAxisHeader.periodChangeDateFormats.setKey("day", "dd/MM"); // Asegurado
xAxisHeader.periodChangeDateFormats.setKey("month", "MMMM"); // Opcional, si deseas mostrar meses
// Crear eje Y (ValueAxis) para el encabezado (dummy)
var yAxisHeader = chartHeader.yAxes.push(new am4charts.ValueAxis());
@@ -943,6 +961,8 @@
xAxisBody.renderer.labels.template.disabled = true;
xAxisBody.renderer.grid.template.disabled = true;
// Añadir la serie al gráfico principal
var seriesBody = chartBody.series.push(new am4charts.ColumnSeries());
seriesBody.dataFields.openDateX = "fromDate";