Skip to content

Instantly share code, notes, and snippets.

@dbarjs
Created March 3, 2017 21:53
Show Gist options
  • Save dbarjs/91cd9af7eb599ff43a2b2ba7a83fb670 to your computer and use it in GitHub Desktop.
Save dbarjs/91cd9af7eb599ff43a2b2ba7a83fb670 to your computer and use it in GitHub Desktop.
Filtro para mostrar pedidos não retirados
// filtro para mostrar todos pedidos com ingressos no retirados
// este filtro só exibe pedidos aprovados e com pelo menos um item de ingresso
var notShippedList = list.filter(function(item) {
if (item.ticketList.list.length > 0 && item.status == 'Aprovada') {
for (var i = item.ticketList.list.length; i--; ) {
if (!item.ticketList.list[i].shipping)
return item.clientName;
}
}
});
for (var i = notShippedList.length; i--; )
console.log(notShippedList[i].clientName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment