app.dialog.prompt("Something went wrong while trying to scan the barcode. Type the location number to request a pickup.","Send Pickup Code",function(code){
if(code==""){
app.dialog.alert("You didn't enter a location number.","Error");
}else{
sendPickupCode(code);
}
},function(cancel){
},"");
});
}
functionsendPickupCode(code){
app.dialog.preloader("Loading...");
apirequest(SETTINGS.apis.dropandsendpickup,{
phone:getStorage("phonenumber"),
accountkey:getStorage("accountkey"),
locationnumber:code
},function(resp){
app.dialog.close();
if(resp.status=="OK"){
app.dialog.alert("Thank you for using Helena Express! You'll get an emailed receipt after we pick up and process your package(s).","Pickup Requested!");
}elseif(resp.status=="ERROR"){
app.dialog.alert(resp.msg,"Error");
}
},function(error){
app.dialog.close();
app.dialog.alert("There's a server or network problem. Check your Internet connection or try again later.","Error");