--FIX. Cambios en mensaje de timbrado, cobro por caja

This commit is contained in:
2025-01-09 16:12:22 -07:00
parent 052185423c
commit 5520556dc9

View File

@@ -796,19 +796,22 @@ Partial Class Ventas_PVCobranza
Dim DebeTimbrar As Boolean = True
Dim SeTimbro As Boolean = False
Dim SeTimbroNC As Boolean = False
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If DebeTimbrar AndAlso respFactura IsNot Nothing Then
'VERIFICA SI SE GENERO NC
If respNC IsNot Nothing Then
AjustarTimbre(respFactura.Factura, respNC.Factura)
MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura)
MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura, SeTimbro, SeTimbroNC)
Else
AjustarTimbre(respFactura.Factura, Nothing)
MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing)
MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing, SeTimbro, SeTimbroNC)
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-warning' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>"
Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-danger' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong><br/> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>"
MsgTimbrado = StrEr
End If
@@ -816,27 +819,41 @@ Partial Class Ventas_PVCobranza
If respFactura IsNot Nothing Then
If RegistrarPago Then
msBuild.Append($"Pago Registrado correctamente.")
msBuild.Append("<span style=""font-size:14px;"">Pago Registrado correctamente. </span> <br/><br/>")
End If
For Each m In respFactura.Mensajes
msBuild.AppendFormat("<br/> {0}", m)
Next
msBuild.AppendFormat("<span style=""font-size:14px;""> La factura <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente. </span> <br/>", respFactura.CveVenta, respFactura.SerieFolio)
If SeTimbro Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respFactura.CveVenta, "XML", respFactura.SerieFolio, respFactura.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdf = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respFactura.CveVenta)))
msBuild.AppendFormat("{0}", pdf)
If respFactura.Factura.Inv_CveMovimiento > 0 Then
msBuild.AppendFormat("<b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", respFactura.Factura.Inv_CveMovimiento)
End If
If respNC IsNot Nothing Then
For Each m In respNC.Mensajes
msBuild.AppendFormat("<br/> {0}", m)
Next
msBuild.AppendFormat("<span style=""font-size:14px;""> La nota de crédito <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente.</span> <br/>", respNC.CveVenta, respNC.SerieFolio)
If SeTimbroNC Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respNC.CveVenta, "XML", respNC.SerieFolio, respNC.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdfNC = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respNC.CveVenta)))
msBuild.AppendFormat("{0}", pdfNC)
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End If
Else
msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>")
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/> {0}", MsgTimbrado)
End If
Alert(msBuild.ToString(), TipoMensaje.MsgInformacion)
Else
ObjVentas2.RollBack()
@@ -1256,9 +1273,11 @@ Partial Class Ventas_PVCobranza
End Sub
Private Function TimbrarFactura(ByRef ObjFactura As Modelos.Factura, ByRef ObjNC As Modelos.Factura) As String
Private Function TimbrarFactura(ByRef ObjFactura As Modelos.Factura, ByRef ObjNC As Modelos.Factura, ByRef SeTimbro As Boolean, ByRef SeTimbroNC As Boolean) As String
Dim MsgErrorTimbrado As String = ""
Dim SeTimbro As Boolean = False
'Dim SeTimbro As Boolean = False
'Dim TimbroNC As Boolean = False
Dim ObjTimbrado As New Timbrado
Try
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
@@ -1272,9 +1291,9 @@ Partial Class Ventas_PVCobranza
ObjNC.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura)
Dim ObjTimbradoNC As New Timbrado
Dim TimbroNC As Boolean = ObjTimbradoNC.TimbrarFactura(UsuarioActual, ObjNC)
SeTimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, ObjNC)
If Not TimbroNC Then
If Not SeTimbroNC Then
MsgErrorTimbrado = $"{MsgErrorTimbrado} {ObjTimbradoNC.MensajeErrorCFDI}"
End If
ObjTimbradoNC = Nothing