Skip to content

Commit

Permalink
Support multi-currency and PL translation
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed May 9, 2024
1 parent 399ebcf commit 57c74e2
Show file tree
Hide file tree
Showing 30 changed files with 1,774 additions and 51 deletions.
13 changes: 13 additions & 0 deletions components/bill/invoice/invoice.templ
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ templ Invoice(env *gobl.Envelope, inv *bill.Invoice) {
section.lines .description .extensions .label {
font-weight: 500;
}
section.lines .alt-price {
display: block;
font-style: italic;
}
section.lines .alt-price:before {
content: '(';
}
section.lines .alt-price:after {
content: ')';
}
div.totals {
order: 8;
display: flex;
Expand Down Expand Up @@ -184,6 +194,9 @@ templ Invoice(env *gobl.Envelope, inv *bill.Invoice) {
section.totals tr.strong td {
font-weight: 600;
}
section.totals .exchange-rate {
font-style: italic;
}
section.taxes {
order: 1;
flex: 1;
Expand Down
6 changes: 3 additions & 3 deletions components/bill/invoice/invoice_templ.go

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

9 changes: 9 additions & 0 deletions components/bill/invoice/lines.templ
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ templ line(_ *bill.Invoice, l *bill.Line, ls *lineSupport) {
}
<td class="price">
@t.LM(l.Item.Price)
@lineItemAltPrices(l)
</td>
for _, cat := range ls.categories {
<td class="tax">
Expand Down Expand Up @@ -145,6 +146,14 @@ templ line(_ *bill.Invoice, l *bill.Line, ls *lineSupport) {
</tr>
}

templ lineItemAltPrices(l *bill.Line) {
for _, a := range l.Item.AltPrices {
<span class="alt-price">
@t.LCD(a.Value, a.Currency)
</span>
}
}

templ lineGroupDiscounts(l *bill.Line) {
for _, d := range l.Discounts {
if d.Percent != nil {
Expand Down
Loading

0 comments on commit 57c74e2

Please sign in to comment.