Files
ventas_php/javascript/descuentos.js

82 lines
2.1 KiB
JavaScript
Executable File

function AplicarDescuento(id){
grayOut(true);
$('fviewVta').show();
new Ajax.Request(WEB_ROOT+'/ajax/ventas.php',{
method:'post',
parameters: {type: "addVenta"},
onSuccess: function(transport){
var response = transport.responseText || "no response text";
FViewOffSetVta(response);
$("divIframe").innerHTML = '<iframe width="1000" height="700" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+WEB_ROOT+'/descuentos-nuevo/ventaId/'+id+'">Lo sentimos, pero tu navegador no soporta IFRAMES.</iframe>';
},
onFailure: function(){ alert('Something went wrong...') }
});
}//AplicarDescuento
function CobrarVenta(id){
grayOut(true);
$('fviewVta').show();
new Ajax.Request(WEB_ROOT+'/ajax/ventas.php',{
method:'post',
parameters: {type: "addVenta"},
onSuccess: function(transport){
var response = transport.responseText || "no response text";
FViewOffSetVta(response);
$("divIframe").innerHTML = '<iframe width="1000" height="700" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+WEB_ROOT+'/ventas-cobrar/ventaId/'+id+'">Lo sentimos, pero tu navegador no soporta IFRAMES.</iframe>';
},
onFailure: function(){ alert('Something went wrong...') }
});
}//CobrarVenta
function CancelarVenta(id)
{
var message = "Realmente deseas cancelar este descuento?";
if(!confirm(message))
{
return;
}
new Ajax.Request(WEB_ROOT+'/ajax/descuentos.php',
{
method:'post',
parameters: {type: "cancelVenta", ventaId:id},
onSuccess: function(transport){
var response = transport.responseText || "no response text";
var splitResponse = response.split("[#]");
if(splitResponse[0] == "fail")
{
ShowStatus(splitResponse[1]);
}
else
{
ShowStatus(splitResponse[1]);
$('contenido').innerHTML = splitResponse[2];
HideFview();
}
},
onFailure: function(){ alert('Something went wrong...') }
});
}
function PrintTicket(id){
window.open(WEB_ROOT + "/ventas-ticket/descuentoId/" + id , "Ticket" , "width=350,height=300,scrollbars=YES")
}//printTicket