Created
August 15, 2014 17:49
-
-
Save jtallieu/5fc2100ae48e96778c90 to your computer and use it in GitHub Desktop.
Generated js to void closed Vend orders.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ids=["3b0e6b85-b0dc-2556-30e6-5b8f67d166b8","7deef2c5-c2c1-95d1-f17e-9c83e5f8169b"]; | |
var void_order = function(index){ | |
if (index < ids.length){ | |
var id = ids[index]; | |
console.log("(" + index + ") voiding order " + id); | |
$.ajax({ | |
type: "POST", | |
url: "/register_sale/void", | |
data: {id:id, return:null}, | |
success: function(data, stat, xhr){ | |
console.log("Success " + xhr.status); | |
void_order(++index); | |
}, | |
error: function(xhr, stat, err){ | |
console.log("ERROR " + xhr.status); | |
}, | |
}); | |
} | |
else{ | |
console.log("Complete"); | |
} | |
} | |
void_order(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment