receiptline / receiptline

Markdown for receipts. Printable digital receipts. Generate receipt printer commands and images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Template Fields Question

experimenti opened this issue · comments

commented

Greetings and thank you very much for the amazing Receiptline!

We are building an F&B POS and hope to incorporate ReceiptLine. I have a general question. We wish to provide receipt templates for customization. This requires that, at runtime, we merge data fields into the ReceiptLine markdown. Visually:

image

We can do this now with the:

{ OURFIELDID }

Is that the intended use? Do you have any other suggestions for this general process?

Thank you very much for using receiptline.

I have seen your screenshot.
It's great. And I think you have the right idea.

Actually, our consortium's subcommittee has just started discussing the extended specifications of the template.
We have some rough drafts from some of our member companies.

I will share this information with the subcommittee.
I hope the specification will be compatible with your usage.

@receiptline I am very interested in the extended specifications that support templating. Is that something you can share?

The first idea was to extend receiptline to support templates.
However, this did not work.
The reason was that it was difficult to implement data selectors, multi-line grouping, and template hierarchies.

+-----------+     +-----------+     +-------+
|Transaction|     |ReceiptLine|     |Receipt| 
|Data(JSON) |---->|w/ Template|---->| Image |
+-----------+     +-----------+     +-------+
                  { JSONPath }

So we thought of separating the templates and connecting them in a pipeline.
And we created RceiptIO and transform streams.

+-----------+     +--------+     +-------+     +-------+
|Transaction|     |  Any   |     |Receipt|     |Receipt|
|   Data    |---->|Template|---->|  IO   |---->| Image |  Pipeline
+-----------+     +--------+     +-------+     +-------+
            Stream

We have not yet given up on developing an original template engine that fits into "Any Template".

Thanks!