Skip to content

Commit

Permalink
Merge pull request #20 from invopop/hide-tax-sum
Browse files Browse the repository at this point in the history
Hiding tax sum if no taxes
  • Loading branch information
samlown authored Oct 15, 2024
2 parents 84d3600 + 3365ba5 commit e70b522
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-go@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
id: go

- name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.55
version: v1.58
2 changes: 1 addition & 1 deletion components/bill/invoice/totals.templ
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ templ totalsBaseRows(inv *bill.Invoice, totals *bill.Totals) {
</td>
</tr>
}
if totals.TaxIncluded == nil || !totals.TaxIncluded.Equals(totals.Tax) {
if totals.Taxes != nil && len(totals.Taxes.Categories) > 0 && (totals.TaxIncluded == nil || !totals.TaxIncluded.Equals(totals.Tax)) {
<tr class="tax">
<th>
@t.T(".taxes")
Expand Down
2 changes: 1 addition & 1 deletion components/bill/invoice/totals_templ.go

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

8 changes: 0 additions & 8 deletions examples/out/us-invoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,6 @@ <h2>
$4,800.00
</td>
</tr>
<tr class="tax">
<th>
Tax
</th>
<td>
$0.00
</td>
</tr>
<tr class="payable strong">
<th>
Total to pay
Expand Down

0 comments on commit e70b522

Please sign in to comment.