I am using the below code to print an Order to the order printer. Multiple merchants using my app are having an issue of same order printing multiple times. Following are the scenarios:
Merchant 1: Has 6 different Clover Stations in their Store with one receipt printer each and 3 shared order printers When my app tries to print with below code. The order is printed 6 times on the receipt printer attached to one of the Stations (i.e. all 6 prints are coming out on the one & the same printer).
Merchant 2: Has 2 different Clover Stations in their Store with one receipt printer each. When my app tries to print with below code. The order is printed 2 times on the receipt printer attached to one of the Stations (i.e. all 2 prints are coming out on the one & the same printer).
// To get orderPrinter
List<printer> printers = mPrinterConnector.getPrinters();
if (printers != null && !printers.isEmpty()) {
orderPrinter = printers.get(0);
}
orderSet = mPrinterConnector.isPrinterSet(Category.ORDER);
Order order = mOrderConnector.getOrder(orderId); if(null !=order){ PrintJob printJob = new StaticOrderPrintJob.Builder().markPrinted(true).order(order).build(); new PrintJobsConnector(DbInit.this).print(orderPrinter, printJob); }
The app uses ContentObserver to watch for changes to the Order table. When new order is in it queries the orders to get the new order and fires the print.
OrderContract.Summaries.contentUriWithAccount(mCloverAccount)
Please help me understand why it is happening and whats the fix for this? Is there some configuration in the merchants end that doing this or something else?
We need to fix this situation asap for our merchants, please help!