question

Bryanne Vega avatar image
Bryanne Vega asked dansl answered

Printing Failure

I'm getting the following error while printing receipts using sign on receipt option (my app updates receipt registration provider to add text to the receipt it'll print out, the signature receipt prints, but my receipt doesn't, here's the log:

05-31 15:55:31.855 562-562/? D/PrinterConnector: on service success: ResultStatus{statusCode=OK, statusMessage=null}
05-31 15:55:32.125 562-2124/? W/Seiko: onHandleIntent(PrinterIntentService.java:392): print failed, printer: Printer{uuid=XA99JW5FPC168, type=SEIKO_USB, name=Station, mac=null, ip=null, category=RECEIPT}
                                       java.lang.NullPointerException
                                           at com.clover.engine.services.ReceiptPrinterPlugins.ReceiptGenerator.createReceiptView(ReceiptGenerator.java:2241)
                                           at com.clover.engine.services.ReceiptPrinterPlugins.ReceiptGenerator.createReceiptView(ReceiptGenerator.java:1672)
                                           at com.clover.engine.services.ReceiptPrinterPlugins.seiko.Seiko.printReceipt(Seiko.java:58)
                                           at com.clover.engine.services.PrinterIntentService.onHandleIntent(PrinterIntentService.java:314)
                                           at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
                                           at android.os.Handler.dispatchMessage(Handler.java:99)
                                           at android.os.Looper.loop(Looper.java:137)
                                           at android.os.HandlerThread.run(HandlerThread.java:60)
05-31 15:55:32.165 562-2124/? I/Seiko: scheduleRepeat(PrinterIntentService.java:484): scheduling repeat, delaying 60000ms
05-31 15:55:32.185 562-562/? D/PrinterConnector: on service success: ResultStatus{statusCode=OK, statusMessage=null}
OrdersPrint
2 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.

sam avatar image sam commented ·

nullPointerException, is it possible it's printing a receipt on an order that doesn't have a payment? Can you share your snippet around where this failure occurs?

0 Likes 0 ·
Bryanne Vega avatar image Bryanne Vega commented ·

I would love to think it's that @Sam but it only happens when the receipt requires a signature (both on screen or printed). I noticed the problem also goes away IF you adjust the tip later it prints fine.

receiptregistrationprovider.updateReceiptAddOnText("my text");

new StaticReceiptPrintJob.Builder().order(order).build().print(context, account);
//clear in 4 seconds, I don't know how to target a specific receipt (in case merchant has auto print customer receipt etc) Thread.sleep(4000);
receiptregistrationprovider.updateReceiptAddOnText("");
0 Likes 0 ·

1 Answer

dansl avatar image
dansl answered
Not sure if the issue is related to this... but we had a similar printing issue recently. We found that for some reason the Order Object didn't have an "employee" assigned to it, so we just grabbed the Owners employee ID and added it to the Order Object before we tried to print it.
10 |2000

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

Welcome to the
Clover Developer Community