Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiding tax sum if no taxes #20

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading