Customer wants kitchen Reprint to only print the item and not whole order. She doesn’t want it to print the whole order with the (R) next to the reprint. She wants this item on its own order ticket.
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.