question

liju avatar image
liju asked liju commented

Receipt printer printing all unprinted orders when calling printjob from Clover SDK

Hi ,

Many of the merchants using my POS app in Clover are reporting a problem where their Receipt printer starts printing all previous orders that were not printed earlier when my android app issues a print job for a single order.

Following is the Clover SDK code snippet which is being used in my app to print a single order.

new ReceiptPrintJob.Builder().orderId(orderId).build().print(this, mCloverAccount);

Is there something wrong with the code i am using?

Could you please help on why this is happening and how to mitigate this for the merchants. Is this a problem or a default behavior of Clover?

Thanks

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered liju commented

If there are queued, but unprinted jobs in the queue, inserting a new element in the queue will cause all queued items to be printed (or, the system will attempt to print them). No, you can't change the behavior. Perhaps I don't understand the problem. Why is the merchant upset that receipts they printed are being printed?

7 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

liju avatar image liju commented ·

Jeff, Thanks for the response. How or when does the order gets queued? We know this from the merchants that they have created orders in their Register since the start of their day and they have not printed any receipts. Does such orders get queued for printing even though they chose not to print?

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

The only reason there'd be print jobs in their queue is if they printed something, or had otherwise set up Clover to auto-print. And the same rule applies: as soon as they print, it will also (attempt) to print any other unprinted print jobs. There's not a good explanation why they'd have many unprinted jobs in their queue, if that indeed is the case. Please note that ReceiptPrintJob is deprecated. Use one of the Static*PrintJob classes. Nothing in our apps' code uses anything but the static variety, so it's possible (but unlikely) there's a problem with how those are handled.

0 Likes 0 ·
liju avatar image liju commented ·

Thanks for the clarifications. I did try out using the static PrintJob with the following code. Unfortunately i am unable to get it working. Could you please suggest what may be wrong here? I am seeing a print job appear in the queue with a STATUS = Error and REASON = FAILURE. There is no other detail on why it is failing.

PrintJob printJob = new StaticOrderPrintJob.Builder().itemIds(itemIds).build(); new PrintJobsConnector(DbInit.this).print(orderPrinter, printJob);

Thanks

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Please attempt a print, wait for the error to show in the print job queue, and then capture a logcat. Provide a link to it (you can use pastebin).

0 Likes 0 ·
tester-manish-b avatar image tester-manish-b commented ·

Jeff - Thank you for your valuable input. Please find the error log from pastebin link.

http://pastebin.com/ShjfJfJV

Thanks

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community