Redireccionamiento de refacturacion
This commit is contained in:
@@ -130,7 +130,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:Button ID="BtnRefacturarDocumento" runat="server" ClientIDMode="Static" Text="Refacturar Documento" Style="display: none;" />
|
||||
<asp:HiddenField ID="HdnLigaRefacturar" runat="server" Value="" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:Button ID="BtnEnviarMailCancelacion" runat="server" ClientIDMode="Static" Text="Enviar Mail Cliente" Style="display: none;" OnClick="BtnEnviarMailCancelacion_Click" />
|
||||
@@ -138,8 +138,8 @@
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function BtnRefacturarDocumento() {
|
||||
$('#BtnRefacturarDocumento').click();
|
||||
function RefacturarDocumento() {
|
||||
window.location.replace(HdnLigaRefacturar.value);
|
||||
}
|
||||
|
||||
function BtnEnviarMailCancelacion() {
|
||||
|
||||
@@ -33,6 +33,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
}
|
||||
private void CargaDatos()
|
||||
{
|
||||
HdnLigaRefacturar.Value = "";
|
||||
if (Request["CveVenta"] != null)
|
||||
{
|
||||
this.CveVenta = Request["CveVenta"].ToString().ToEntero();
|
||||
@@ -63,7 +64,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
}
|
||||
protected void BtnValidar_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
HdnLigaRefacturar.Value = "";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
||||
int CveCliente = GvRow.DataKey("CveCliente").ToEntero();
|
||||
@@ -91,7 +92,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
}
|
||||
protected void BtnValidarRefacturacion_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
HdnLigaRefacturar.Value = "";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
||||
int CveCliente = GvRow.DataKey("CveCliente").ToEntero();
|
||||
@@ -106,10 +107,17 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
if (CveVenta > 0)
|
||||
{
|
||||
var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total, true);
|
||||
|
||||
Alert(respuesta.Mensaje);
|
||||
CargaDatos();
|
||||
|
||||
CargaDatos();
|
||||
if (respuesta.CveEstatus.Contiene(4,5))
|
||||
{
|
||||
HdnLigaRefacturar.Value = respuesta.LigaRefacturacion;
|
||||
Alert(respuesta.Mensaje, JSBtnAceptar: $"RefacturarDocumento();");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert(respuesta.Mensaje,TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
|
||||
//if (respuesta.IrARefacturar)
|
||||
//{
|
||||
// Server.Transfer(respuesta.LigaRefacturacion);
|
||||
@@ -120,10 +128,12 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
// CargaDatos();
|
||||
//}
|
||||
}
|
||||
UPDatos.Update();
|
||||
|
||||
}
|
||||
private MRespuestaSAT VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false)
|
||||
{
|
||||
HdnLigaRefacturar.Value = "";
|
||||
var retorno = new MRespuestaSAT()
|
||||
{
|
||||
Mensaje = "",
|
||||
@@ -161,14 +171,18 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
{
|
||||
var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion);
|
||||
|
||||
sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
||||
//sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
||||
if (!respCancelacion.HuboError)
|
||||
{
|
||||
CveEstatus = respCancelacion.CveEstatus;
|
||||
retorno.EnviarAcuse = true;
|
||||
|
||||
sb.Append("El Documento se canceló correctamente.");
|
||||
|
||||
sb.Append("El documento se canceló correctamente.");
|
||||
sb.Append($"</br> <a href='/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=CAN&CVEVTA={CveVenta}")}' class='Texto' target='_blank'>Imprimir Acuse</a>");
|
||||
sb.Append("</br></br> ¿Desea enviar el Acuse de Cancelación al Cliente?");
|
||||
if (!EsRefacturacion)
|
||||
{
|
||||
sb.Append("</br></br> ¿Desea enviar el Acuse de Cancelación al Cliente?");
|
||||
}
|
||||
}
|
||||
|
||||
if (respCancelacion.CveEstatus.Contiene(4, 5) && EsRefacturacion)
|
||||
@@ -192,12 +206,17 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
|
||||
var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion);
|
||||
|
||||
sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
||||
//sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
||||
if (!respCancelacion.HuboError)
|
||||
{
|
||||
sb.Append("El Documento se canceló correctamente.");
|
||||
retorno.EnviarAcuse = true;
|
||||
CveEstatus = respCancelacion.CveEstatus;
|
||||
sb.Append("El documento se canceló correctamente.");
|
||||
sb.Append($"</br> <a href='/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=CAN&CVEVTA={CveVenta}")}' class='Texto' target='_blank'>Imprimir Acuse</a>");
|
||||
sb.Append("</br></br> ¿Desea enviar el Acuse de Cancelación al Cliente?");
|
||||
if (!EsRefacturacion)
|
||||
{
|
||||
sb.Append("</br></br> ¿Desea enviar el Acuse de Cancelación al Cliente?");
|
||||
}
|
||||
}
|
||||
|
||||
if (respCancelacion.CveEstatus.Contiene(4, 5) && EsRefacturacion)
|
||||
@@ -237,6 +256,8 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
return retorno;
|
||||
}
|
||||
|
||||
retorno.CveEstatus = CveEstatus;
|
||||
|
||||
retorno.Mensaje = sb.ToString();
|
||||
return retorno;
|
||||
}
|
||||
@@ -413,10 +434,10 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public class MRespuestaSAT
|
||||
{
|
||||
public int CveEstatus { get; set; }
|
||||
public bool EnviarAcuse { get; set; }
|
||||
public string LigaRefacturacion { get; set; }
|
||||
public bool IrARefacturar { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user