numerus/web/template/tax-details.gohtml

169 lines
6.8 KiB
Plaintext
Raw Normal View History

{{ define "title" -}}
{{( pgettext "Tax Details" "title" )}}
{{- end }}
{{ define "content" }}
2023-02-03 12:58:10 +00:00
<nav>
<p>
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
<a>{{( pgettext "Tax Details" "title" )}}</a>
</p>
</nav>
<section class="dialog-content">
<h2>{{(pgettext "Tax Details" "title")}}</h2>
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.TaxDetailsPage*/ -}}
{{ with .DetailsForm }}
<form id="details" method="POST">
{{ csrfToken }}
{{ template "input-field" .BusinessName }}
{{ template "input-field" .VATIN }}
{{ template "input-field" .TradeName }}
{{ template "input-field" .Phone }}
{{ template "input-field" .Email }}
{{ template "input-field" .Web }}
{{ template "input-field" .Address | addInputAttr `class="width-2x"` }}
{{ template "input-field" .City }}
{{ template "input-field" .Province }}
{{ template "input-field" .PostalCode }}
{{ template "select-field" .Country | addSelectAttr `class="width-fixed"` }}
<fieldset>
<legend id="currency-legend">{{( pgettext "Currency" "title" )}}</legend>
{{ template "select-field" .Currency }}
</fieldset>
<fieldset>
<legend>{{( pgettext "Invoicing" "title" )}}</legend>
{{ template "input-field" .InvoiceNumberFormat }}
{{ template "input-field" .LegalDisclaimer }}
</fieldset>
</form>
{{ end }}
<form id="newtax" method="POST" action="{{ companyURI "/tax" }}">
{{ csrfToken }}
</form>
<fieldset>
<table>
<thead>
<tr>
<th width="50%"></th>
<th>{{( pgettext "Tax Name" "title" )}}</th>
<th>{{( pgettext "Rate (%)" "title" )}}</th>
<th>{{( pgettext "Class" "title" )}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{ with .Taxes }}
{{- range $tax := . }}
<tr>
<td></td>
<td>{{ .Name }}</td>
<td>{{ .Rate }}</td>
<td>{{ .Class }}</td>
<td>
<form method="POST" action="{{ companyURI "/tax"}}/{{ .Id }}">
{{ csrfToken }}
2023-02-03 12:29:10 +00:00
{{ deleteMethod }}
<button class="icon" aria-label="{{( gettext "Delete tax" )}}" type="submit"><i
class="ri-delete-back-2-line"></i></button>
</form>
</td>
</tr>
{{- end }}
{{ else }}
<tr>
<td colspan="4">{{( gettext "No taxes added yet." )}}</td>
</tr>
{{ end }}
</tbody>
<tfoot>
<tr>
<th scope="row">{{( pgettext "New Line" "title")}}</th>
<td>
{{ template "input-field" .NewTaxForm.Name | addInputAttr `form="newtax"` }}
</td>
<td>
{{ template "input-field" .NewTaxForm.Rate | addInputAttr `form="newtax"` }}
</td>
<td>
{{ template "select-field" .NewTaxForm.Class | addSelectAttr `form="newtax"` }}
</td>
</tr>
<tr>
<td colspan="2"></td>
<td colspan="2">
<button form="newtax" type="submit">{{( pgettext "Add new tax" "action" )}}</button>
</td>
</tr>
</tfoot>
</table>
</fieldset>
<form id="new-payment-method" method="POST" action="{{ companyURI "/payment-method" }}">
{{ csrfToken }}
</form>
<fieldset>
<table>
<thead>
<tr>
<th width="50%"></th>
<th>{{( pgettext "Payment Method" "title" )}}</th>
<th>{{( pgettext "Instructions" "title" )}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{ with .PaymentMethods }}
{{- range $method := . }}
<tr>
<td></td>
<td>{{ .Name }}</td>
<td>{{ .Instructions }}</td>
<td>
<form method="POST" action="{{ companyURI "/payment-method"}}/{{ .Id }}">
{{ csrfToken }}
{{ deleteMethod }}
<button class="icon" aria-label="{{( gettext "Delete payment method" )}}" type="submit"><i
class="ri-delete-back-2-line"></i></button>
</form>
</td>
</tr>
{{- end }}
{{ else }}
<tr>
<td colspan="4">{{( gettext "No payment methods added yet." )}}</td>
</tr>
{{ end }}
</tbody>
<tfoot>
<tr>
<th scope="row">{{( pgettext "New Line" "title")}}</th>
<td>
{{ template "input-field" .NewPaymentMethodForm.Name | addInputAttr `form="new-payment-method"` }}
</td>
<td>
{{ template "input-field" .NewPaymentMethodForm.Instructions | addInputAttr `form="new-payment-method"` }}
</td>
</tr>
<tr>
<td colspan="2"></td>
<td colspan="2">
<button form="new-payment-method" type="submit">{{( pgettext "Add new payment method" "action" )}}</button>
</td>
</tr>
</tfoot>
</table>
</fieldset>
<fieldset>
<button form="details" type="submit">{{( pgettext "Save changes" "action" )}}</button>
</fieldset>
</section>
{{- end }}