Primer commit del sistema avantika sin cambios
This commit is contained in:
782
javascript/pedidos-detalles.js
Executable file
782
javascript/pedidos-detalles.js
Executable file
@@ -0,0 +1,782 @@
|
||||
function AprobarPedido(id, noPedido, proveedor, monto, tipo){
|
||||
|
||||
var message = "Esta seguro que desea autorizar el pedido No. " + noPedido;
|
||||
message += "\n al proveedor "+ proveedor;
|
||||
message += "\n y por un monto de $"+ monto;
|
||||
message += "\n Compra tipo "+ tipo +" ?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: {type: "aprobarPedido", pedidoId:id},
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AprobarPedido
|
||||
|
||||
function AutorizarPedido(id, noPedido, proveedor, monto, tipo){
|
||||
|
||||
var message = "Está seguro que desea autorizar la distribución del pedido No. " + noPedido;
|
||||
message += "\n al proveedor "+ proveedor;
|
||||
message += "\n y por un monto de $"+ monto;
|
||||
message += "\n Compra tipo "+ tipo;
|
||||
message += "\n y GENERAR LA ORDEN DE COMPRA AL PROVEEDOR?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: {type: "autorizarPedido", pedidoId:id},
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//AutorizarPedido
|
||||
|
||||
function RechazarPedidoPopup(id){
|
||||
|
||||
grayOut(true);
|
||||
|
||||
if(id == 0){
|
||||
$('fview').hide();
|
||||
grayOut(false);
|
||||
return;
|
||||
}
|
||||
$('fview').show();
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: {type: "rechazarPedidoPopup", pedidoId:id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
FViewOffSet(response);
|
||||
Event.observe($('btnSave'), "click", RechazarPedido);
|
||||
Event.observe($('btnCancel'), "click", function(){ HideFview(); });
|
||||
Event.observe($('fviewclose'), "click", function(){ HideFview(); });
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//RechazarPedidoPopup
|
||||
|
||||
function RechazarPedido(){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmRechazarPedido').serialize(),
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
window.location.href = WEB_ROOT + "/pedidos";
|
||||
else
|
||||
ShowStatusPopUp(splitResponse[1]);
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//RechazarPedido
|
||||
|
||||
function DistribucionPedido(){
|
||||
|
||||
var message = "Esta seguro que desea ENVIAR A AUTORIZACION su distribucion?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
$("type").value = "distribucionPedido";
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmDistribucion').serialize(),
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
window.location.href = WEB_ROOT + "/pedidos";
|
||||
else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//DistribucionPedido
|
||||
|
||||
function DistribucionPedido2(id){
|
||||
|
||||
var message = "Esta seguro que desea ENVIAR A AUTORIZACION su distribucion?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"distribucionPedido2", pedidoId:id},
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
window.location.href = WEB_ROOT + "/pedidos";
|
||||
else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//DistribucionPedido2
|
||||
|
||||
function EnviarSugerencias(id){
|
||||
|
||||
var message = "Desea enviar las sugerencias de distribucion?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: {type: "sugerenciasPedido", pedidoId:id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//EnviarSugerencias
|
||||
|
||||
function EnviarOrdenCompra(id, enviar){
|
||||
|
||||
if(enviar == 1)
|
||||
var message = "Desea enviar la Orden de Compra al Proveedor?";
|
||||
else
|
||||
var message = "Desea marcar como enviada la Orden de Compra al Proveedor?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: {type: "enviarOrdenCompra", pedidoId:id, enviar:enviar},
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
location.href = WEB_ROOT + "/pedidos-enviar-prov/id/"+id;
|
||||
}else if(splitResponse[0] == "ok2"){
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
}else if(splitResponse[0] == "noPzas"){
|
||||
if(enviar == 1)
|
||||
var resp = confirm("Aun no se han ingresado las Piezas por Caja. Esta seguro de enviar la Orden Compra al Proveedor?");
|
||||
else
|
||||
var resp = confirm("Aun no se han ingresado las Piezas por Caja. Esta seguro de marcar como enviada la Orden Compra?");
|
||||
if(!resp)
|
||||
return
|
||||
|
||||
EnviarOrdenCompra2(id,enviar);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//EnviarOrdenCompra
|
||||
|
||||
function EnviarOrdenCompra2(id,enviar){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: {type: "enviarOrdenCompra", pedidoId:id, aprobado:1, enviar:enviar},
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
location.href = WEB_ROOT + "/pedidos-enviar-prov/id/"+id;
|
||||
else if(splitResponse[0] == "ok2")
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//EnviarOrdenCompra2
|
||||
|
||||
function CancelarOrdenCompraEnv(id){
|
||||
|
||||
var message = "Desea CANCELAR la Orden de Compra Enviada al Proveedor?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
var enviarProv = confirm("Desea ENVIAR la Orden Cancelada al Proveedor?");
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: {type: "cancelarOrdenCompraEnv", pedidoId:id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
if(enviarProv == true)
|
||||
location.href = WEB_ROOT + "/pedidos-enviar-prov/cancelarId/"+id;
|
||||
else
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
}
|
||||
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//CancelarOrdenCompraEnv
|
||||
|
||||
function IngresarOrdenCompra(id, noPedido, proveedor, cantidad, total){
|
||||
|
||||
var message = "Esta seguro que desea ingresar la Orden de Compra No. " + noPedido;
|
||||
message += "\ndel proveedor " + proveedor +",";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
for(var ii=1; ii <= 5; ii++){
|
||||
var vFolio = $("folioProv_"+ii).value;
|
||||
$("folio_"+ii).value = vFolio;
|
||||
|
||||
var vFechaFolio = $("fechaFolioProv_"+ii).value;
|
||||
$("fechaFolio_"+ii).value = vFechaFolio;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',{
|
||||
method:'post',
|
||||
parameters: $("frmProdRec").serialize(true),
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
window.open(WEB_ROOT + "/pedidos-acuse/pedidoId/"+id , "Acuse de Recibo" , "scrollbars=NO")
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}//IngresarOrdenCompra
|
||||
|
||||
function ShowOtroMotivo(){
|
||||
|
||||
var motivoId = $("motivoId").value;
|
||||
var status;
|
||||
|
||||
if(motivoId == 3)
|
||||
status = "";
|
||||
else
|
||||
status = "none";
|
||||
|
||||
$("inputOtroMotivo").style.display = status;
|
||||
|
||||
if(motivoId == 4)
|
||||
status = "";
|
||||
else
|
||||
status = "none";
|
||||
|
||||
$("tblProdsE").style.display = status;
|
||||
|
||||
}
|
||||
|
||||
function ShowProductos(){
|
||||
|
||||
var resp = $("productos").style.display;
|
||||
var status;
|
||||
var txt
|
||||
|
||||
if(resp == "none"){
|
||||
status = "";
|
||||
txt = "[-]";
|
||||
}else{
|
||||
status = "none";
|
||||
txt = "[+]";
|
||||
}
|
||||
|
||||
$("productos").style.display = status;
|
||||
$("showProd").innerHTML = txt;
|
||||
|
||||
}
|
||||
|
||||
function ShowTotales(){
|
||||
|
||||
var resp = $("totales").style.display;
|
||||
var status;
|
||||
var txt
|
||||
|
||||
if(resp == "none"){
|
||||
status = "";
|
||||
txt = "[-]";
|
||||
}else{
|
||||
status = "none";
|
||||
txt = "[+]";
|
||||
}
|
||||
|
||||
$("totales").style.display = status;
|
||||
$("showTotal").innerHTML = txt;
|
||||
|
||||
}
|
||||
|
||||
//Productos Distribucion
|
||||
|
||||
function AprobarProd(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"aprobarProd", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function AprobarProd2(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"aprobarProd2", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function CancelProd(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"cancelProd", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
ShowBtnSug(idPedido);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function CancelProd2(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"cancelProd2", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
ShowBtnSug(idPedido);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function SugerirProd(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"sugerirProd", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function SugerirProd2(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"sugerirProd2", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function SaveSug(idPedido, idProducto){
|
||||
|
||||
$("pedidoId").value = idPedido;
|
||||
$("productoId").value = idProducto;
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmDistribucion').serialize(),
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
ShowBtnSug(idPedido);
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function DeleteSug(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"deleteSug", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
ShowBtnSug(idPedido);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function DeleteSug2(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"deleteSug2", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
ShowBtnSug(idPedido);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function CancelSug(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"cancelSug", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function CancelSug2(idPedido, idProducto){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"cancelSug2", pedidoId:idPedido, productoId:idProducto},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$("listProds").innerHTML = splitResponse[1];
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function UpdateSaldoPrendas(id){
|
||||
|
||||
$("type").value = "updateSaldoPrendas";
|
||||
$("idProd").value = id;
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmDistribucion').serialize(),
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$("txtCantPrendas_"+id).innerHTML = splitResponse[1];
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function SavePiezasCaja(){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmPzasCaja').serialize(),
|
||||
onLoading: function(){
|
||||
$("loader").show();
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$("loader").hide();
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
location.href = WEB_ROOT + "/pedidos";
|
||||
}else{
|
||||
ShowStatus(splitResponse[1]);
|
||||
HideFview();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function ShowBtnSug(idPedido){
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: {type:"showBtnSug", pedidoId:idPedido},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
if(splitResponse[0] == "ok"){
|
||||
|
||||
if(splitResponse[1] > 0){
|
||||
$("btnSug").show();
|
||||
$("btnAutorizar").hide();
|
||||
}else{
|
||||
$("btnSug").hide();
|
||||
$("btnAutorizar").show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function ShowInpProdsRec(id){
|
||||
|
||||
var entrego = $("prodsComp_"+id).value;
|
||||
|
||||
if(entrego == 1)
|
||||
$("inpProdsRec_"+id).hide();
|
||||
else
|
||||
$("inpProdsRec_"+id).show();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user