Primer commit del sistema avantika sin cambios
This commit is contained in:
155
javascript/devoluciones.js
Executable file
155
javascript/devoluciones.js
Executable file
@@ -0,0 +1,155 @@
|
||||
Event.observe(window, 'load', function() {
|
||||
|
||||
AddEditUsuarioListeners = function(e) {
|
||||
var el = e.element();
|
||||
var del = el.hasClassName('spanCancel');
|
||||
var id = el.identify();
|
||||
|
||||
if(del == true)
|
||||
{
|
||||
CancelDevolucion(id);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$('contenido').observe("click", AddEditUsuarioListeners);
|
||||
|
||||
});
|
||||
|
||||
function AddDevolucionDiv(id){
|
||||
|
||||
grayOut(true);
|
||||
$('fviewVta').show();
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/devoluciones.php',{
|
||||
method:'post',
|
||||
parameters: {type: "addDevolucion"},
|
||||
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+'/devoluciones-nueva">Lo sentimos, pero tu navegador no soporta IFRAMES.</iframe>';
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AddDevolucionDiv
|
||||
|
||||
function CancelDevolucion(id)
|
||||
{
|
||||
var message = "Realmente deseas cancelar esta venta?";
|
||||
if(!confirm(message))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/devoluciones.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type: "cancelDevolucion", 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 AddVentaDiv(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">Lo sentimos, pero tu navegador no soporta IFRAMES.</iframe>';
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AddVentaDiv
|
||||
|
||||
function LoadUsers(){
|
||||
|
||||
var sucursalId = $("sucursalId2").value;
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/usuarios.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type: "loadUsersVtas", sucursalId:sucursalId},
|
||||
onLoading: function(){
|
||||
$("enumUsr").innerHTML = LOADER;
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("enumUsr").innerHTML = splitResponse[1];
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
}
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function Search(){
|
||||
|
||||
var sucursalId = $("sucursalId2").value;
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/devoluciones.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmSearch').serialize(true),
|
||||
onLoading: function(){
|
||||
$("loadBusqueda").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loadBusqueda").hide();
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("contenido").innerHTML = splitResponse[1];
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
}
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function PrintTicket(id){
|
||||
|
||||
window.open(WEB_ROOT + "/devoluciones-ticket/devolucionId/" + id , "Ticket" , "width=350,height=300,scrollbars=YES")
|
||||
|
||||
}//printTicket
|
||||
Reference in New Issue
Block a user