Redireccionamiento de refacturacion
This commit is contained in:
@@ -130,7 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<asp:Button ID="BtnEnviarMailCancelacion" runat="server" ClientIDMode="Static" Text="Enviar Mail Cliente" Style="display: none;" OnClick="BtnEnviarMailCancelacion_Click" />
|
<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">
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
|
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function BtnRefacturarDocumento() {
|
function RefacturarDocumento() {
|
||||||
$('#BtnRefacturarDocumento').click();
|
window.location.replace(HdnLigaRefacturar.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function BtnEnviarMailCancelacion() {
|
function BtnEnviarMailCancelacion() {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
}
|
}
|
||||||
private void CargaDatos()
|
private void CargaDatos()
|
||||||
{
|
{
|
||||||
|
HdnLigaRefacturar.Value = "";
|
||||||
if (Request["CveVenta"] != null)
|
if (Request["CveVenta"] != null)
|
||||||
{
|
{
|
||||||
this.CveVenta = Request["CveVenta"].ToString().ToEntero();
|
this.CveVenta = Request["CveVenta"].ToString().ToEntero();
|
||||||
@@ -63,7 +64,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
}
|
}
|
||||||
protected void BtnValidar_Click(object sender, EventArgs e)
|
protected void BtnValidar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
HdnLigaRefacturar.Value = "";
|
||||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
||||||
int CveCliente = GvRow.DataKey("CveCliente").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)
|
protected void BtnValidarRefacturacion_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
HdnLigaRefacturar.Value = "";
|
||||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
||||||
int CveCliente = GvRow.DataKey("CveCliente").ToEntero();
|
int CveCliente = GvRow.DataKey("CveCliente").ToEntero();
|
||||||
@@ -106,10 +107,17 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
if (CveVenta > 0)
|
if (CveVenta > 0)
|
||||||
{
|
{
|
||||||
var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total, true);
|
var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total, true);
|
||||||
|
CargaDatos();
|
||||||
Alert(respuesta.Mensaje);
|
if (respuesta.CveEstatus.Contiene(4,5))
|
||||||
CargaDatos();
|
{
|
||||||
|
HdnLigaRefacturar.Value = respuesta.LigaRefacturacion;
|
||||||
|
Alert(respuesta.Mensaje, JSBtnAceptar: $"RefacturarDocumento();");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert(respuesta.Mensaje,TipoMensaje.MsgAdvertencia);
|
||||||
|
}
|
||||||
|
|
||||||
//if (respuesta.IrARefacturar)
|
//if (respuesta.IrARefacturar)
|
||||||
//{
|
//{
|
||||||
// Server.Transfer(respuesta.LigaRefacturacion);
|
// Server.Transfer(respuesta.LigaRefacturacion);
|
||||||
@@ -120,10 +128,12 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
// CargaDatos();
|
// 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)
|
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()
|
var retorno = new MRespuestaSAT()
|
||||||
{
|
{
|
||||||
Mensaje = "",
|
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);
|
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)
|
if (!respCancelacion.HuboError)
|
||||||
{
|
{
|
||||||
|
CveEstatus = respCancelacion.CveEstatus;
|
||||||
retorno.EnviarAcuse = true;
|
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> <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)
|
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);
|
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)
|
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> <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)
|
if (respCancelacion.CveEstatus.Contiene(4, 5) && EsRefacturacion)
|
||||||
@@ -237,6 +256,8 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
return retorno;
|
return retorno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retorno.CveEstatus = CveEstatus;
|
||||||
|
|
||||||
retorno.Mensaje = sb.ToString();
|
retorno.Mensaje = sb.ToString();
|
||||||
return retorno;
|
return retorno;
|
||||||
}
|
}
|
||||||
@@ -413,10 +434,10 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public class MRespuestaSAT
|
public class MRespuestaSAT
|
||||||
{
|
{
|
||||||
|
public int CveEstatus { get; set; }
|
||||||
public bool EnviarAcuse { get; set; }
|
public bool EnviarAcuse { get; set; }
|
||||||
public string LigaRefacturacion { get; set; }
|
public string LigaRefacturacion { get; set; }
|
||||||
public bool IrARefacturar { get; set; }
|
public bool IrARefacturar { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user