Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Send more fields to printer webhook to allow for customized labels #2318

Open
TinkerTob opened this issue Aug 20, 2023 · 2 comments

Comments

@TinkerTob
Copy link

TinkerTob commented Aug 20, 2023

Hi,

Would it be possible to send more data to the webhook when printing a stock entry label?

My preferred solution would be to send as much information as possible and let the webhook decide what to do with it. Maybe all the information visible on the "purchase" page, as well as product settings like parent, due date type, ...?

However, if that's not possible, the fields I'm most interested in are:

  • Category
  • Due date type
  • The quantity unit the label refers to
  • The date the stock entry was purchased
  • The date the stock entry was opened

Thank you!

Best regards,
Tobias

Edit: Added "as well as product settings like parent, due date type, ...?" and "- The date the stock entry was purchased / opened"

@berrnd
Copy link
Member

berrnd commented Aug 20, 2023

Technically already possible by utilizing Grocy's API:

@TinkerTob
Copy link
Author

TinkerTob commented Aug 20, 2023

That's good to know, thank you! I guess I'll go digging into the API then.

However, I still think this would be nice to have for the following reasons:

  • Complexity. From my POV, using the API would greatly increase the complexity of the webhook handler, while adding some fields seems like a rather small change to me. This is all the more relevant since API usage has to be implemented by each user on his/her own, while additional fields would be immediately available to everyone.
  • Overhead. Using the API would require additional requests and processing (which on my RasPi 1B print server might actually be problematic). Just passing a few more fields shouldn't cause any issues in that regard.

Edit: Maybe it would be possible to pass both the product object and the transaction object inside the request? I guess that would automatically include all current and future fields, while dispensing with any complications that might arise from using the API.

daywalker1180 added a commit to daywalker1180/brother_ql_web that referenced this issue Mar 30, 2024
Connect to GROCY API
Get note from stockitem
Get amount from stockitem
Get quantity_unit from Product
Put onto label (2D only)
idea from: grocy/grocy#2318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants