Primer commit del sistema avantika sin cambios
This commit is contained in:
161
javascript/devoluciones-cedis-agregar.js
Executable file
161
javascript/devoluciones-cedis-agregar.js
Executable file
@@ -0,0 +1,161 @@
|
||||
function AddPedido(){
|
||||
|
||||
$("type").value = "saveDevolucion";
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/devoluciones-cedis.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmDevolucion').serialize(),
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
location.href = WEB_ROOT + "/devoluciones-cedis";
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
$("loader").hide();
|
||||
}
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AddPedido
|
||||
|
||||
function CancelDevolucion(id){
|
||||
|
||||
var message = "Realmente deseas cancelar esta devolucion?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
location.href = WEB_ROOT + "/devoluciones-cedis";
|
||||
|
||||
}
|
||||
|
||||
//PRODUCTOS
|
||||
|
||||
function AddProducto(){
|
||||
|
||||
$("type").value = "addProducto";
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/devoluciones-cedis.php',{
|
||||
method:'post',
|
||||
parameters: $('frmDevolucion').serialize(),
|
||||
onLoading: function(){
|
||||
$("productos").innerHTML = LOADER;
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("productos").innerHTML = splitResponse[1];
|
||||
|
||||
$("codigoBarra").value = "";
|
||||
$("productoId").value = "";
|
||||
$("enumAtributos").innerHTML = "";
|
||||
$("txtProveedor").innerHTML = "";
|
||||
$("txtDisponible").innerHTML = "";
|
||||
$("sucursalId").value = "";
|
||||
$("cantidad").value = "";
|
||||
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
$("productos").innerHTML = splitResponse[2];
|
||||
HideFview();
|
||||
}
|
||||
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
|
||||
}//AddProducto
|
||||
|
||||
function DeleteProducto(id){
|
||||
|
||||
var message = "Realmente deseas eliminar este producto?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
$("type").value = "deleteProducto";
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/devoluciones-cedis.php',{
|
||||
method:'post',
|
||||
parameters: {type:"deleteProducto", k:id},
|
||||
onLoading: function(){
|
||||
$("productos").innerHTML = LOADER;
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("productos").innerHTML = splitResponse[1];
|
||||
}
|
||||
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
|
||||
}//DeleteProducto
|
||||
|
||||
function SearchProducto()
|
||||
{
|
||||
var codigoBarra = $("codigoBarra").value;
|
||||
var sucursalId = $("sucursalId").value;
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/suggest_gral.php',
|
||||
{
|
||||
parameters: {codigoBarra:codigoBarra, type:"prodByCode2", sucursalId:sucursalId},
|
||||
method:'post',
|
||||
onLoading: function(){
|
||||
$("enumAtributos").innerHTML = LOADER;
|
||||
$("txtProveedor").innerHTML = LOADER;
|
||||
$("txtDisponible").innerHTML = LOADER;
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("enumAtributos").innerHTML = "";
|
||||
$("txtProveedor").innerHTML = "";
|
||||
$("txtDisponible").innerHTML = "";
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("enumAtributos").innerHTML = splitResponse[1];
|
||||
$("productoId").value = splitResponse[2];
|
||||
$("txtProveedor").innerHTML = splitResponse[3];
|
||||
$("txtDisponible").innerHTML = splitResponse[4];
|
||||
}else
|
||||
{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
|
||||
}//SearchProducto
|
||||
|
||||
function CheckKey(e){
|
||||
|
||||
if(window.event)
|
||||
keyCode = window.event.keyCode;
|
||||
else if(e)
|
||||
keyCode=e.which;
|
||||
|
||||
if(keyCode == 13){
|
||||
SearchProducto();
|
||||
}
|
||||
|
||||
}//CheckKey
|
||||
Reference in New Issue
Block a user