Primer commit del sistema avantika sin cambios
This commit is contained in:
72
javascript/ventas-espera.js
Executable file
72
javascript/ventas-espera.js
Executable file
@@ -0,0 +1,72 @@
|
||||
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...') }
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user