72 lines
1.6 KiB
JavaScript
Executable File
72 lines
1.6 KiB
JavaScript
Executable File
Event.observe(window, 'load', function() {
|
|
|
|
VentaListeners = function(e) {
|
|
var el = e.element();
|
|
var del = el.hasClassName('spanCancel');
|
|
var id = el.identify();
|
|
|
|
if(del == true)
|
|
{
|
|
DeleteVenta(id);
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
$('contenido').observe("click", VentaListeners);
|
|
|
|
});
|
|
|
|
function ContinuarVenta(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-nueva/venta2Id/'+id+'">Lo sentimos, pero tu navegador no soporta IFRAMES.</iframe>';
|
|
|
|
},
|
|
|
|
onFailure: function(){ alert('Something went wrong...') }
|
|
|
|
});
|
|
|
|
}//ContinuarVenta
|
|
|
|
function DeleteVenta(id)
|
|
{
|
|
var message = "Realmente deseas eliminar esta venta?";
|
|
if(!confirm(message))
|
|
{
|
|
return;
|
|
}
|
|
|
|
new Ajax.Request(WEB_ROOT+'/ajax/ventas.php',
|
|
{
|
|
method:'post',
|
|
parameters: {type: "deleteVenta2", 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...') }
|
|
});
|
|
} |