From 12a43838036227b999eb1a714c5e33edbd905569 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 24 Nov 2023 10:44:29 -0700 Subject: [PATCH 1/2] --correciones de saldos iniciales --- General/SaldosIniciales.aspx.vb | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 9cd0a75ed..8dfde2983 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -294,20 +294,20 @@ Partial Class General_SaldosIniciales Exit Sub End If - If Not dt.Columns(15).ColumnName = "IEPS" Then - Alert("El nombre de la decimosexta columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If + 'If Not dt.Columns(15).ColumnName = "IEPS" Then + ' Alert("El nombre de la decimosexta columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError) + ' Exit Sub + 'End If - If Not dt.Columns(16).ColumnName = "RetIVAPorcentaje" Then - Alert("El nombre de la decimoséptima columna debe ser 'RetIVAPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If + 'If Not dt.Columns(16).ColumnName = "RetIVAPorcentaje" Then + ' Alert("El nombre de la decimoséptima columna debe ser 'RetIVAPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) + ' Exit Sub + 'End If - If Not dt.Columns(17).ColumnName = "RetISRPorcentaje" Then - Alert("El nombre de la decimoctava columna debe ser 'RetISRPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If + 'If Not dt.Columns(17).ColumnName = "RetISRPorcentaje" Then + ' Alert("El nombre de la decimoctava columna debe ser 'RetISRPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) + ' Exit Sub + 'End If 'If RblFormato.SelectedValue = "4" Then ' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then @@ -1491,12 +1491,12 @@ Partial Class General_SaldosIniciales Dim IVA As Decimal = Row("IVA").ToString().ToDecimal Dim Total As Decimal = Row("Total").ToString().ToDecimal Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal - Dim TipoDocto As String = Row("Tipo Documento").ToString() + Dim TipoDocumento As String = Row("Tipo Documento").ToString().Trim() Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString().ToEntero() GuardaLog(Sucursal + " - " + Row("Sucursal").ToString()) Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal Dim RetISR As Decimal = Row("Ret ISR").ToString().ToDecimal - Dim IEPS As Decimal = Row("IEPS").ToString().ToDecimal + Dim IEPS As Decimal = If(dt.Columns.Contains("IEPS"), Row("IEPS").ToString(), "0").ToDecimal Dim Moneda As String = Row("Moneda").ToString() Dim TipoCambio As String = Row("Tipo Cambio").ToString() Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate @@ -1504,8 +1504,8 @@ Partial Class General_SaldosIniciales Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString().ToEntero() Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString() Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString(), "0").ToDecimal - Dim RetIVAPorcentaje As Decimal = Row("RetIVAPorcentaje").ToString().ToDecimal - Dim RetISRPorcentaje As Decimal = Row("RetISRPorcentaje").ToString().ToDecimal + Dim RetIVAPorcentaje As Decimal = If(dt.Columns.Contains("RetIVAPorcentaje"), Row("RetIVAPorcentaje").ToString(), "0").ToDecimal + Dim RetISRPorcentaje As Decimal = If(dt.Columns.Contains("RetISRPorcentaje"), Row("RetISRPorcentaje").ToString(), "0").ToDecimal If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True @@ -1513,7 +1513,7 @@ Partial Class General_SaldosIniciales If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1 - TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString() + Dim TipoDocto = IIf(TipoDocumento.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString() @@ -1546,7 +1546,7 @@ Partial Class General_SaldosIniciales 'Compra If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero(), SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDecimal, FechaVencimiento, False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal, - NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total) Then + NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True Exit For End If From 65771e7fbb7c5f36972e5b354b614d63df68565a Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 25 Nov 2023 18:43:06 -0700 Subject: [PATCH 2/2] -- quitar timbrado de NC si se hace desde el boton emitir al emitir un Ingreso --- Ventas/Ventas.aspx.vb | 53 ++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 522b4753f..959bef263 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -16323,32 +16323,33 @@ Partial Class Ventas OnError("Ocurrió un error al enviar el PDF", ex) End Try - If ObjFactura.TipoDocto = "Ing" AndAlso ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "07" Then - CreaObjetosVentaAmortizacion(Nothing, ObjTimbrado.UUID, ObjFactura.CveVentaRelacion, CveVenta) - For Each Gvr As GridViewRow In GvAntNC.Rows - If Gvr.DataKey("FolioFiscal").ToString() = "" AndAlso Gvr.DataKey("TipoDocto") = "Egs" Then - ObjFacturaDevolucion.CveVenta = Gvr.DataKey("CveVenta").ToEntero() - ObjFacturaDevolucion.Serie = Gvr.DataKey("Serie").ToString() - ObjFacturaDevolucion.Folio = Gvr.DataKey("Folio").ToEntero() - ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion) - End If - Exit For - Next - If ObjFacturaDevolucion.CveVenta.ToEntero() > 0 Then - Dim Obj2 As New List(Of Object) - Obj2.Add(ObjFacturaDevolucion) - If Not IsNothing(Obj2) AndAlso Obj2.Count > 0 Then - Dim ofa As Modelos.Factura = CType(Obj2(0), Modelos.Factura) - ofa.Timbre.CFDIRelacionados.UUID.Clear() - ofa.Timbre.CFDIRelacionados.UUID.Add(ObjTimbrado.UUID) - If ObjTimbrado.TimbrarFactura(UsuarioActual, ofa) Then - MensajeAlert.AppendFormat(String.Format("
La {0}: {1} se timbro correctamente.

", ofa.TipoDocumento, ofa.SerieFolio)) - Else - MensajeAlert.AppendFormat(String.Format("
La {0}: {1} no se timbro correctamente.

", ofa.TipoDocumento, ofa.SerieFolio)) - End If - End If - End If - End If + 'SE COMENTA PORQUE SE GENERA LA NOTA DE CREDITO CON LOS IMPORTES DE LA VENTA + 'If ObjFactura.TipoDocto = "Ing" AndAlso ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "07" Then + ' CreaObjetosVentaAmortizacion(Nothing, ObjTimbrado.UUID, ObjFactura.CveVentaRelacion, CveVenta) + ' For Each Gvr As GridViewRow In GvAntNC.Rows + ' If Gvr.DataKey("FolioFiscal").ToString() = "" AndAlso Gvr.DataKey("TipoDocto") = "Egs" Then + ' ObjFacturaDevolucion.CveVenta = Gvr.DataKey("CveVenta").ToEntero() + ' ObjFacturaDevolucion.Serie = Gvr.DataKey("Serie").ToString() + ' ObjFacturaDevolucion.Folio = Gvr.DataKey("Folio").ToEntero() + ' ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion) + ' End If + ' Exit For + ' Next + ' If ObjFacturaDevolucion.CveVenta.ToEntero() > 0 Then + ' Dim Obj2 As New List(Of Object) + ' Obj2.Add(ObjFacturaDevolucion) + ' If Not IsNothing(Obj2) AndAlso Obj2.Count > 0 Then + ' Dim ofa As Modelos.Factura = CType(Obj2(0), Modelos.Factura) + ' ofa.Timbre.CFDIRelacionados.UUID.Clear() + ' ofa.Timbre.CFDIRelacionados.UUID.Add(ObjTimbrado.UUID) + ' If ObjTimbrado.TimbrarFactura(UsuarioActual, ofa) Then + ' MensajeAlert.AppendFormat(String.Format("
La {0}: {1} se timbro correctamente.

", ofa.TipoDocumento, ofa.SerieFolio)) + ' Else + ' MensajeAlert.AppendFormat(String.Format("
La {0}: {1} no se timbro correctamente.

", ofa.TipoDocumento, ofa.SerieFolio)) + ' End If + ' End If + ' End If + 'End If 'NOTIFICACION DE SMS