Skip to content

Commit

Permalink
Support for Ordering Identities
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed May 28, 2024
1 parent dfe2849 commit 643389c
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
12 changes: 12 additions & 0 deletions components/bill/invoice/summary.templ
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ templ summaryOrderingRows(inv *bill.Invoice) {
if inv.Ordering.Period != nil {
@summaryOrderPeriodRows(inv.Ordering.Period)
}
for _, ident := range inv.Ordering.Identities {
if ident.Label != "" {
<li class="ordering-ident">
<span class="label">
{ ident.Label }
</span>
<span class="value">
{ ident.Code.String() }
</span>
</li>
}
}
}

templ summaryOrderPeriodRows(p *cal.Period) {
Expand Down
40 changes: 37 additions & 3 deletions components/bill/invoice/summary_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/full-invoice.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@
],
"ordering": {
"code": "111-9244735-1237858",
"identities": [
{
"label": "Provider Ref.",
"code": "PROV1234"
}
],
"period": {
"label": "Service period",
"start": "2022-02-01",
Expand Down
8 changes: 8 additions & 0 deletions examples/out/full-invoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ <h2 class="title">
2022-02-01 to 2022-02-28
</span>
</li>
<li class="ordering-ident">
<span class="label">
Provider Ref.
</span>
<span class="value">
PROV1234
</span>
</li>
</ul>
</section>
</div>
Expand Down

0 comments on commit 643389c

Please sign in to comment.