question

tacs avatar image
tacs asked tacs commented

Custom information on standard receipt

Hi.
I can print my custom receipt now, but i was wondering if there's a way to do that automatically when the user prints the standard receipt?
Is there some way to listen for that action and call an activity of mine and then print the receipt?
Im thinking this workflow: user creates the order on register app, then hits print, my app has a listener to that action, so its called and i print the receipt and get back to register app?
I guess it doesnt work the way i said in order to protect the workflow, but there should be a way to add a button of my app on clover register app so that user can click there instead of doing the standard printing...?
Thanks.
Cheers.

Observation: i think the search on the forum should be improved, because i think it doesnt search on post titles nor its content, and most ppl dont set the tags properly, also because it has a limit number of words. Either an advance search or something to look in the title and/or body of the posts.

Edit 25 April: this post is getting spider webs and tree roots :)

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 tacs commented

You could try having a ContentObserver on PrintJobsContract.CONTENT_URI, then checking the PrintJobsContract.PrintJob.TYPE column to check the type of the receipt, and taking action on that. This is just an idea I have not tested it. No, you cannot override the print button in register to do something specific to your app. In general there's no way to override the default receipt behavior, and we only allow the most basic customization (see Smart Receipts).

EDIT: The above is incorrect. We do not expose a method to listen on the print jobs contract for changes.

4 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.

tacs avatar image tacs commented ·

@jeff thanks for the reply.
So if i want to add some custom information to a receipt, i have to create some interface that list the orders so the device operator can select the order and print the custom receipt?
Is there no way i can add custom information when the device operator prints a receipt using the register app?
Thanks.
Cheers.

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

(1) Well, I suggested something to try above. That's all I've got. (2) No, other than Smart Receipts.

0 Likes 0 ·
tacs avatar image tacs commented ·

@jeff thanks :)
So i was trying what you told me, but i cant find any PrintJobsContract.CONTENTURI, only AUTHORITYURI...
Neither can i find the PrintJobsContract.PrintJob....
I've checked this docs but it isnt there...
I'm gonna check for the broadcasts meanwhile
Cheers and thanks :)

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

You are right. We don't expose the URI on which to listen in our public SDK. I'm going to update the answer accordingly.

0 Likes 0 ·

Welcome to the
Clover Developer Community