{{define "settings_page"}}
<h2>Settings</h2>
{{if .Saved}}<p class="notice">Saved.</p>{{end}}
{{if .Error}}<p class="error">{{.Error}}</p>{{end}}
<form hx-post="/settings" hx-target="#main">
  <fieldset>
    <legend>Sender / company details (used on invoices)</legend>
    <p><label>Company name<br><input name="company_name" value="{{.Cfg.CompanyName}}"></label></p>
    <p><label>Address<br><input name="company_address" value="{{.Cfg.CompanyAddress}}"></label></p>
    <p><label>Phone<br><input name="company_phone" value="{{.Cfg.CompanyPhone}}"></label></p>
    <p><label>Email<br><input name="company_email" value="{{.Cfg.CompanyEmail}}"></label></p>
    <p><label>Web<br><input name="company_web" value="{{.Cfg.CompanyWeb}}"></label></p>
    <p><label>V-tal (tax ID)<br><input name="tax_id" value="{{.Cfg.TaxID}}"></label></p>
    <p><label>Bank info<br><textarea name="bank_info" rows="3">{{.Cfg.BankInfo}}</textarea></label></p>
  </fieldset>
  <fieldset>
    <legend>Invoice defaults</legend>
    <p><label>Payment terms (days)<br><input name="payment_terms_days" type="number" value="{{.Cfg.PaymentTermsDays}}"></label></p>
    <p><label>MVG %<br><input name="mvg_percent" type="number" step="0.01" value="{{money .Cfg.MVGPercent}}"></label></p>
  </fieldset>
  <p>
    <button type="submit">Save</button>
    <button type="button" hx-get="/main" hx-target="#main">Back</button>
  </p>
</form>
{{end}}
