print: a .print template cannot group rows or sum over a group - a per-VAT-rate totals block is not expressible
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Read modules/parsers/document/README.md lines 200–224 to understand the current table and for syntax. Then trace how document print templates receive document lines and how their bindings are evaluated; the issue does not name implementation files or tests. Done means a unit test in parsers/document renders three VAT-rate groups with exact sums, plus a document integration test prints a mixed-rate invoice.
Written by the indexing model from the issue text.
Description
Problem
A .print template cannot group rows or sum over them. table / for expand per row and accept filter= / match= (modules/parsers/document/README.md:200-224), but there is no group-by and no aggregate. The data a print receives is the document plus its lines, so nothing derives figures per group.
The case that needs it: a Bulgarian (and generally EU) invoice with lines at different VAT rates must show the tax base and the VAT per rate in its totals (e.g. Данъчна основа 20%: 20.58 / ДДС 20%: 4.12 / Данъчна основа 9%: 4.60 / ДДС 9%: 0.41 / Общо: 29.71). Today every document print shows one tax base and one VAT total.
The model-side workaround — one filtered sum roll-up per rate — hard-codes the rates and is currently broken by #7905 (roll-ups sharing (entity, via) coalesce and drop all but one where:).
Proposal
A grouping loop in the print DSL, e.g.
<for source="items" groupBy="VatRate">
Данъчна основа {{VatRate}}%: {{sum(Net)}}
ДДС {{VatRate}}%: {{sum(Vat)}}
</for>
groupBy=names a row field; one iteration per distinct value, ordered by the value (ororderBy=).- Inside, the group key is addressable as itself,
sum(<field>)/count()aggregate over the group's rows; plain{{field}}reads the first row of the group. - Composes with
filter=(applied before grouping). - Decimal sums are exact (
BigDecimal), formatted like any other number binding.
Verify
A unit test in parsers/document over lines at 20/9/0 % rendering three groups with exact sums, and one document IT printing a mixed-rate invoice.
- Dominant language
- Java
- Stars
- 278
- Forks
- 97
- Avg merge
- 18h 53m
- Merged PRs (30d)
- 228
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-dirigible/dirigible
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
eclipse-dirigible/dirigible#7958 ·
Maintainers usually reply within 1 day
-
intent: a create-from without fromStatus answers 200 on a missing or unknown source id (no 400/404)Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-dirigible/dirigible#7945 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
eclipse-dirigible/dirigible#7891 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
eclipse-dirigible/dirigible#6538 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
eclipse-dirigible/dirigible#4812 ·
Maintainers usually reply within 1 day
All issues in eclipse-dirigible/dirigible
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
account bug communication lecture
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
area/server bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/java-sdk#1196 ·
Maintainers usually reply within 1 day