Skip to content

Commit

Permalink
Fixing missing percent in discount and charge check #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed May 13, 2024
1 parent f15577d commit ec2c336
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
12 changes: 10 additions & 2 deletions components/bill/invoice/lines.templ
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ templ discountRow(row *bill.Discount, ls *lineSupport) {
for _, cat := range ls.categories {
<td class="tax">
if combo := row.Taxes.Get(cat.Code); combo != nil {
@t.L(*combo.Percent)
if combo.Percent != nil {
@t.L(*combo.Percent)
} else {
&mdash;
}
} else {
<!-- empty -->
}
Expand Down Expand Up @@ -286,7 +290,11 @@ templ chargeRow(row *bill.Charge, ls *lineSupport) {
for _, cat := range ls.categories {
<td class="tax">
if combo := row.Taxes.Get(cat.Code); combo != nil {
@t.L(*combo.Percent)
if combo.Percent == nil {
&mdash;
} else {
@t.L(*combo.Percent)
}
} else {
<!-- empty -->
}
Expand Down
32 changes: 23 additions & 9 deletions components/bill/invoice/lines_templ.go

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

0 comments on commit ec2c336

Please sign in to comment.