This commit is contained in:
2025-02-17 01:23:45 -07:00
8 changed files with 194 additions and 11 deletions

View File

@@ -4313,7 +4313,7 @@ Public Class ClsContabilidad
Return Retorno
End Function
Public Function GetAnexoCatalagoCC(CveCuenta As Integer, FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveEmpresa As Integer, Divisor As Integer, CveUsuario As Integer) As Boolean
Public Function GetAnexoCatalagoCC(CveCuenta As Integer, FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveEmpresa As Integer, Divisor As Integer, CveUsuario As Integer, Optional OpcionCuentas As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_AnexoCatalogoCCGet")
@@ -4326,6 +4326,7 @@ Public Class ClsContabilidad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Divisor", SqlDbType.Int).Value = Divisor
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@OpcionCuentas", SqlDbType.Int).Value = OpcionCuentas
End With
Try

View File

@@ -2393,6 +2393,28 @@ Namespace Extensiones
Dim worksheet As ExcelWorksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
'2025-02-15 OIC Este for es para que las celdas tomen formato numerico y se puedan sumar
For Each row In worksheet.Rows
For Each cell In row.AllocatedCells
If cell.Value IsNot Nothing Then
Dim valorTexto As String = cell.Value.ToString().Trim()
Dim numero As Decimal
' Intentar convertir a número
If Decimal.TryParse(valorTexto, System.Globalization.NumberStyles.Any,
System.Globalization.CultureInfo.InvariantCulture,
numero) Then
' Si se pudo convertir exitosamente, reasignar como Double
cell.Value = numero
End If
End If
Next
Next
Dim celdasConTexto As CellRange = worksheet.GetUsedCellRange(True)
If celdasConTexto Is Nothing Then Exit Sub 'No se recuperaron datos, salir de sin guardar porque soltará error
celdasConTexto.Style.Font.Name = "Calibri Light"

View File

@@ -22619,7 +22619,7 @@ Partial Class Compras_Compras
nRow("SubTotal") = subtotalParcial.RoundSQL(4)
nRow("Total") = totalParcialDeseado.RoundSQL(4)
nRow("PorcentajeIVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
nRow("PorcentajeIVA") = (ivaParcial / subtotalParcial).RoundSQL(2)
nRow("Porcentaje") = ((totalParcialDeseado.RoundSQL(4) * 100) / TotalOriginal).RoundSQL(2)
nRow("RetIVAPorcentaje") = (retIvaParcial / subtotalParcial).RoundSQL(4)

View File

@@ -26,6 +26,7 @@ Imports SharpCompress.Common
Imports SharpCompress.Reader
Imports Telerik.Web.UI
Imports System.Data.SqlClient
Imports Stimulsoft.Base.Serializing
'Imports Telerik.Web.UI
@@ -6073,6 +6074,145 @@ Partial Class Compras_eFacturas
End Function
Private Sub VinculacionAutomaticaRNC()
Dim ErrorProceso As Boolean = False
Dim ErrorProcesoStr As String = ""
Dim Contador As Integer = 0
Dim Objcompras As New ClsCompras
Objcompras.IniciaTransacSQL()
'DataKeyNames="CveFactura,CveCompra,CveProveedor,SerieFolio,NombreProveedor,UUID,RFCDe,RFCPara,TipoFactura,FueValidado,TipoComprobante,Version,RFCde,XML,PDF,BloquePorComplemento,Total,CveTipoProveedor,FechaFactura"
For Each GvRow As GridViewRow In GvD.Rows
If GvRow.FCCheckBox("chkRegistraFactura").Checked Then
Dim TotalFactura As Decimal = GvRow.DataKey("Total").ToDecimal
Dim SaldoFactura As Decimal = TotalFactura
Dim CFDIXmlPath As String = $"{UsuarioActual.Empresa.Ruta}Compras\{GvRow.DataKey("RFCDe")}\{GvRow.DataKey("XML")}"
If Not File.Exists(CFDIXmlPath) Then
ErrorProceso = True
Exit For
End If
Dim CompraActual As New ClsCompraManager(CFDIXmlPath, ClsCompraManager.EnumCargaCompra.DesdeArchivo, GlobalDTTiposGastos(UsuarioActual.CveEmpresa), UsuarioActual)
CompraActual.CveFactura = GvRow.DataKey("CveFactura").ToEntero
CompraActual.CveProveedor = GvRow.DataKey("CveProveedor").ToEntero
CompraActual.CveTipoProveedor = GvRow.DataKey("CveTipoProveedor").ToEntero
CompraActual.CveTipoConceptoProveedor = GvRow.DataKey("CveTipoProveedor").ToEntero
CompraActual.TipoCompra = ClsCompraManager.EnumTipoCompra.Sin_definir
CompraActual.IEPSGasto = True
CompraActual.Descripcion = TxtDescripcionCompra.Text.Trim
CompraActual.NombreProveedor = GvRow.DataKey("NombreProveedor")
Dim CvePersonal As Integer = -1 'DdlPersonalReembolso.SelectedValue.ToEntero
Dim CveCajachica As Integer = -1 'DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero
If RBLContado.SelectedValue.ToEntero = 6 Then 'Caja Chica
CveCajachica = DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero
ElseIf RBLContado.SelectedValue.ToEntero = 2 Then ' viaticos
CvePersonal = DdlPersonalReembolso.SelectedValue.ToEntero
ElseIf RBLContado.SelectedValue.ToEntero = 4 Then ' deudores
End If
If CompraActual.ConfiguraRegistroCompra(DdlPS.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, CveCajachica, CvePersonal,
DdlRetIVAConcepto.SelectedValue.ToEntero, DdlRetISRConcepto.SelectedValue.ToEntero, NumeroReembolso:=TxtNumeroReembolso.Text,
DTProrrateo:=DTProrrateo, DTPagosDeudores:=New DataTable) Then
'FIX ME OIC Recuerda cambiar el tipo de documento al registrar, actualmente tiene FAC y NC uno u otro, ajustar para que registre *** Egs *** cuado TipoComprobante = 'E'
If CompraActual.AddCompra(Objcompras.IniciaTransacSQL()) Then
Contador = Contador + 1
Else
ErrorProceso = True
ErrorProcesoStr = CompraActual.MensajeError
Exit For
End If
Else
ErrorProceso = True
ErrorProcesoStr = CompraActual.MensajeError
Exit For
End If
If RBLContado.SelectedValue.ToEntero = 4 Then 'Deudores
Dim CompraActualPagar = New Compra
If Objcompras.GetCompras(CompraActual.CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
If Objcompras.DtResultados IsNot Nothing AndAlso Objcompras.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = Objcompras.DtResultados.Rows(0)
CompraActualPagar.CveCompra = CompraActual.CveCompra
CompraActualPagar.CveTipoConceptoProveedor = dr("CveTipoConcepto").ToString.ToEntero
CompraActualPagar.CveProveedor = dr("CveProveedor").ToString.ToEntero
CompraActualPagar.CveMoneda = dr("CveMoneda").ToString.ToEntero
CompraActualPagar.Fecha = dr("Fecha").ToString.ToDate
CompraActualPagar.SerieFolio = dr("SerieFolio").ToString
'CompraActualPagar.ProveedorNombre = TxtPagueseA.Text
CompraActualPagar.TC = dr("TipoCambio").ToString.ToDecimal
CompraActualPagar.Total = dr("Total").ToString.ToDecimal
CompraActualPagar.IVA = dr("IVA").ToString.ToDecimal
CompraActualPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal.RoundSQL
CompraActualPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal.RoundSQL
CompraActualPagar.IEPS = dr("IEPS").ToString.ToDecimal
CompraActualPagar.RetIVA = dr("RetIVA").ToString.ToDecimal
CompraActualPagar.RetISR = dr("RetISR").ToString.ToDecimal
CompraActualPagar.CveConceptoRetIVA = dr("CveRetIVAConcepto").ToString.ToEntero
CompraActualPagar.CveConceptoRetISR = dr("CveRetISRConcepto").ToString.ToEntero
CompraActualPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
CompraActualPagar.UsuarioActual = UsuarioActual
CompraActualPagar.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
CompraActualPagar.EsImportacion = CBool(dr("EsImportacion"))
CompraActualPagar.CompraNoDeducible = dr("NoDeducible").ToString.ToEntero
Else
ErrorProceso = True
End If
Else
ErrorProceso = True
End If
End If
End If
If ErrorProceso Then
Exit For
End If
Next
If ErrorProceso Then
Objcompras.RollBack()
Alert($"Se registraron {Contador} Compras. error {ErrorProcesoStr}", TipoMensaje.MsgAdvertencia)
Else
Objcompras.Commit()
CargaDatos(NowADS())
CambieDeudor()
CargaDatos(NowADS())
If Contador > 0 Then
Alert($"Se registraron {Contador} Compras")
End If
End If
Objcompras.Dispose()
End Sub
End Class

View File

@@ -359,7 +359,13 @@
let currentid = 1;
function HandlerGraf(obj, evt) {
$("#DivModalGrafica").modal();
cdatos = $(obj).data('values');
//cdatos = $(obj).data('values');
cdatos = $(obj).data('values').sort(function (a, b) {
return b.Valor - a.Valor;
});
if (currentid == 1) {
CargaGraficaBarras();
} else {
@@ -369,6 +375,9 @@
}
function CargaGraficaBarras() {
let data = cdatos;
//let data = cdatos.sort(function (a, b) {
// return b.Valor - a.Valor;
//});
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
@@ -406,6 +415,11 @@
function CargaGraficaPastel() {
let data = cdatos;
//let data = cdatos.sort(function (a, b) {
// return b.Valor - a.Valor;
//});
var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",
"theme": "light",

View File

@@ -236,9 +236,15 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
Next
Dim CveCunetaRow As Integer = e.Row.DataKey("CveCuenta").ToEntero
If e.Row.Cells(2).Text.ToDecimal <> 0 Then
e.Row.Cells(2).Text = $"<a { If(e.Row.Cells(2).Text.ToDecimal < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={txtFechaF.Text}&FI={txtFechaI.Text}&ER=1&CveSubProyecto=-1&OpcionCuenta=3' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, e.Row.Cells(2).Text.ToDecimal.ToString("###,###,##0"), e.Row.Cells(2).Text.ToDecimal.ToString("###,###,###.00")) }</a>"
Else
e.Row.Cells(2).Text = $"-"
End If
Dim inicial As Boolean = True
Index = 4
For Each DRow As DataRow In DTHeaders.Rows
Dim Importe As Decimal = e.Row.DBCampo($"SubProyecto{DRow("SubProyecto")}").ToDecimal
@@ -249,7 +255,7 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
End If
If Importe <> 0 Then
e.Row.Cells(Index).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={txtFechaF.Text}&FI={txtFechaI.Text}&ER=1&CveSubProyecto={ If(DRow("CveSubProyecto").ToString.ToEntero > 0, DRow("CveSubProyecto").ToString, "-1")}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
e.Row.Cells(Index).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={txtFechaF.Text}&FI={txtFechaI.Text}&ER=1&CveSubProyecto={ If(DRow("CveSubProyecto").ToString.ToEntero > 0, DRow("CveSubProyecto").ToString, "-1")}&OpcionCuenta=3' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
End If
Index += 1

View File

@@ -51,7 +51,7 @@
<div class="col-md-1">
Cuenta:
</div>
<div class="col-md-3">
<div class="col-md-2">
<asp:DropDownList ID="DdlCuentas" runat="server" AppendDataBoundItems="true" DataTextField="CuentaFormatoNombre" DataValueField="CveCuenta" CssClass="form-control input-sm select2me" Enabled="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -97,11 +97,11 @@
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-1 truncate">
<div class="col-md-1 ">
Tipo Movto
</div>
<div class="col-md-2 truncate">
<asp:DropDownList ID="DdlOpcionCuentas" runat="server" DataTextField="Cuenta" DataValueField="CveCuenta" TabIndex="4" CssClass="form-control input-sm select2me" Width="100%">
<div class="col-md-2 ">
<asp:DropDownList ID="DdlOpcionCuentas" runat="server" DataTextField="Cuenta" DataValueField="CveCuenta" TabIndex="4" CssClass="select2me" Width="100%">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con movimientos" Value="1"></asp:ListItem>
<asp:ListItem Text="Saldo actual no igual a cero" Value="2"></asp:ListItem>
@@ -109,7 +109,7 @@
<asp:ListItem Text="Con movimientos o saldo no igual a cero" Value="4"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" id="tdTipoReporte" visible="false" runat="server">
<div class="col-md-1 " id="tdTipoReporte" visible="false" runat="server">
Tipo
</div>
<div class="col-md-2" id="tdTipoReporte2" visible="false" runat="server">

View File

@@ -129,7 +129,7 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo
' DdlTipoReporte.SelectedValue = TipoReporte.ToString
End If
DdlOpcionCuentas.SelectedValueExist(IfNull(Request("OpcionCuenta"), "-1")) 'OpcionCuenta
''If DdlTipoCuentas.Items.FindByValue(IdCuenta.ToString) IsNot Nothing Then
'' DdlTipoCuentas.SelectedValue = IdCuenta.ToString
''Else