printed
or not. Below is an example (Note: this code does not take into account items put onto a display; it only works for items that have been physically printed).
ArrayList<String> unprinted = new ArrayList<>(); List<LineItem> items = order.getLineItems(); for(LineItem item : items) { if (!item.getPrinted()){ unprinted.add(item.getId()); } } if(unprinted.isEmpty()){ Toast.makeText(MainActivity.this, "No new line items", Toast.LENGTH_SHORT).show(); } else { new StaticOrderPrintJob.Builder().itemIds(unprinted).markPrinted(true).order(order).build().print(MainActivity.this, account); }
1 Person is following this question.