Diff -- /var/www/vhosts/3dshawn.com/crm.3dshawn.com/TEMPLATES/webstls_admin_tax.html

O Operator
Diff

/var/www/vhosts/3dshawn.com/crm.3dshawn.com/TEMPLATES/webstls_admin_tax.html

added on local at 2026-07-11 18:32:04

Added
+0
lines
Removed
-0
lines
Context
500
unchanged
Blobs
from eb9d1adb6abc
to eb9d1adb6abc
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
11<style>
22 .at-tabs { display:flex;gap:0;border-bottom:1px solid var(--col-border);margin-bottom:18px;flex-wrap:wrap; }
33 .at-tab { padding:10px 18px;font-size:13px;font-weight:600;color:var(--col-text-2);text-decoration:none;border-bottom:2px solid transparent;letter-spacing:0.3px;transition:all 0.15s; }
44 .at-tab:hover { color:var(--col-text);background:var(--col-surface-2); }
55 .at-tab.is-active { color:var(--col-accent-bright);border-bottom-color:var(--col-accent); }
66
77 .tx-card { background:var(--col-surface-1);border:1px solid var(--col-border);border-radius:14px;padding:20px;margin-bottom:16px; }
88 .tx-card-title { font-family:var(--font-display,sans-serif);font-size:18px;color:var(--col-text);margin:0 0 4px; }
99 .tx-card-sub { font-size:12px;color:var(--col-text-3);margin-bottom:14px; }
1010
1111 table.tx-table { width:100%;border-collapse:collapse; }
1212 table.tx-table th { text-align:left;padding:9px 12px;font-size:11px;font-weight:700;color:var(--col-text-3);letter-spacing:1px;text-transform:uppercase;border-bottom:1px solid var(--col-border); }
1313 table.tx-table td { padding:10px 12px;font-size:13px;color:var(--col-text-2);border-bottom:1px solid var(--col-border); }
1414 table.tx-table tr:hover td { background:var(--col-surface-2);color:var(--col-text); }
1515 table.tx-table tr.is-inactive td { opacity:0.55; }
1616
1717 .tx-pill { display:inline-block;padding:3px 9px;border-radius:6px;font-size:11px;font-weight:700;letter-spacing:0.4px;text-transform:uppercase; }
1818 .tx-pill.on { background:rgba(34,197,94,0.15);color:#4ade80;border:1px solid rgba(34,197,94,0.40); }
1919 .tx-pill.off { background:rgba(148,163,184,0.10);color:var(--col-text-3);border:1px solid rgba(148,163,184,0.25); }
2020 .tx-pill.type { background:rgba(124,58,237,0.12);color:#a78bfa;border:1px solid rgba(124,58,237,0.32); }
2121
2222 .tx-form .grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px; }
2323 .tx-form label { display:block;font-size:11px;font-weight:700;color:var(--col-text-3);letter-spacing:0.7px;text-transform:uppercase;margin-bottom:5px; }
2424 .tx-form input[type=text], .tx-form input[type=number], .tx-form input[type=date],
2525 .tx-form select, .tx-form textarea {
2626 width:100%;background:var(--col-surface-2);border:1px solid var(--col-border);border-radius:8px;
2727 padding:9px 11px;color:var(--col-text);font-size:13px;font-family:inherit;box-sizing:border-box;
2828 }
2929 .tx-form textarea { min-height:64px;resize:vertical; }
3030 .tx-form .row-actions { display:flex;gap:10px;margin-top:14px; }
3131
3232 .tx-flash { padding:10px 14px;border-radius:8px;font-size:13px;margin-bottom:14px; }
3333 .tx-flash.ok { background:rgba(34,197,94,0.10);color:#4ade80;border:1px solid rgba(34,197,94,0.35); }
3434 .tx-flash.err { background:rgba(239,68,68,0.10);color:#fca5a5;border:1px solid rgba(239,68,68,0.35); }
3535</style>
3636
3737<div class="page-head">
3838 <div class="text-xs text-dim" style="letter-spacing:1.5px;text-transform:uppercase;font-weight:700">Admin &middot; Tax</div>
3939 <h1 class="page-title">Tax rates &amp; collection policy</h1>
4040 <p class="page-subtitle">
4141 Per-jurisdiction VAT / sales tax rates and marketplace-facilitator settings. Sellers see these as line items on
4242 their order receipts; the platform handles collection + remittance per the OSS scheme set below.
4343 </p>
4444</div>
4545
4646[if:$has_flash_ok]<div class="tx-flash ok">$flash_ok</div>[/if]
4747[if:$has_flash_err]<div class="tx-flash err">$flash_err</div>[/if]
4848
4949[if:$schema_missing]
5050<div class="tx-card">
5151 <strong>Tax schema not yet installed.</strong> Run the latest <code>db_schema.sql</code> to enable the tax tables.
5252</div>
5353[/if]
5454
5555[if:$schema_ready]
5656
5757[if:$not_super]
5858<div class="tx-card" style="border-color:rgba(245,158,11,0.35);background:rgba(245,158,11,0.06)">
5959 Tax configuration is super-admin only. You can view current rates + policy on this page but the save buttons are disabled.
6060</div>
6161[/if]
6262
6363<div class="at-tabs">
6464 <a class="at-tab[if:$tab_jurisdictions] is-active[/if]" href="/admin_tax.cgi?tab=jurisdictions">Jurisdictions &amp; Rates</a>
6565 <a class="at-tab[if:$tab_settings] is-active[/if]" href="/admin_tax.cgi?tab=settings">Collection Settings</a>
6666 <a class="at-tab[if:$tab_sellers] is-active[/if]" href="/admin_tax.cgi?tab=sellers">Seller Tax Modes</a>
6767 <a class="at-tab[if:$tab_reports] is-active[/if]" href="/admin_tax.cgi?tab=reports">Reports</a>
6868 <a class="at-tab[if:$tab_k1099] is-active[/if]" href="/admin_tax.cgi?tab=k1099">1099-K</a>
6969 <a class="at-tab[if:$tab_audit] is-active[/if]" href="/admin_tax.cgi?tab=audit">Audit Log</a>
7070</div>
7171
7272[if:$tab_jurisdictions]
7373<!-- ============ JURISDICTIONS ============ -->
7474<div class="tx-card">
7575 <div class="tx-card-title">Tax jurisdictions</div>
7676 <div class="tx-card-sub">
7777 One row per active tax rate. Region is blank for country-wide rates and set to a state/province code (e.g. CA, ON) for sub-national rates.
7878 Retired rates stay in the table greyed out so historical orders keep their snapshotted rate.
7979 </div>
8080 [if:$has_jur_rows]
8181 <table class="tx-table">
8282 <thead>
8383 <tr>
8484 <th>Country</th>
8585 <th>Region</th>
8686 <th>Name</th>
8787 <th>Type</th>
8888 <th style="text-align:right">Rate</th>
8989 <th>Applies to</th>
9090 <th>Effective</th>
9191 <th></th>
9292 </tr>
9393 </thead>
9494 <tbody>
9595 [loop:@jur_rows]
9696 <tr[if:!$loop1.is_active] class="is-inactive"[/if]>
9797 <td><strong style="color:var(--col-text);font-family:var(--font-mono,monospace)">$loop1.country</strong></td>
9898 <td style="font-family:var(--font-mono,monospace);color:var(--col-text-3)">$loop1.region</td>
9999 <td>$loop1.display_name</td>
100100 <td><span class="tx-pill type">$loop1.tax_type</span></td>
101101 <td style="text-align:right;font-family:var(--font-mono,monospace);font-weight:700;color:var(--col-text)">$loop1.rate%</td>
102102 <td>$loop1.applies_to</td>
103103 <td style="font-size:11px;color:var(--col-text-3)"><span class="ts" data-ts="$loop1.effective_from_epoch" data-fmt="date">$loop1.effective_from</span> &rarr; [if:$loop1.has_effective_to]<span class="ts" data-ts="$loop1.effective_to_epoch" data-fmt="date">$loop1.effective_to</span>[/if][if:!$loop1.has_effective_to]now[/if]</td>
104104 <td style="text-align:right"><a href="$loop1.edit_href" class="btn btn-secondary btn-sm">Edit</a></td>
105105 </tr>
106106 [/loop]
107107 </tbody>
108108 </table>
109109 [/if]
110110 [if:!$has_jur_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No jurisdictions yet.</div>[/if]
111111</div>
112112
113113[if:$is_super]
114114<div class="tx-card tx-form">
115115 [if:$has_edit_jur]
116116 <div class="tx-card-title">Edit jurisdiction #$ej_id</div>
117117 [/if]
118118 [if:!$has_edit_jur]
119119 <div class="tx-card-title">Add jurisdiction</div>
120120 <div class="tx-card-sub">Insert a new tax rate. To change an existing rate (rather than retire it), retire the old row and add a new one with an effective_from date matching the change.</div>
121121 [/if]
122122 <form method="POST" action="/admin_tax.cgi?tab=jurisdictions">
123123 <input type="hidden" name="action" value="[if:$has_edit_jur]jurisdiction_edit[/if][if:!$has_edit_jur]jurisdiction_create[/if]">
124124 [if:$has_edit_jur]<input type="hidden" name="id" value="$ej_id">[/if]
125125 <div class="grid">
126126 <div>
127127 <label>Country (ISO 3166 alpha-2)</label>
128128 <input type="text" name="country_iso2" maxlength="2" placeholder="US" value="[if:$has_edit_jur]$ej_country[/if]" required>
129129 </div>
130130 <div>
131131 <label>Region (state / province code, optional)</label>
132132 <input type="text" name="region_code" maxlength="10" placeholder="CA" value="[if:$has_edit_jur]$ej_region[/if]">
133133 </div>
134134 <div>
135135 <label>Display name</label>
136136 <input type="text" name="display_name" maxlength="120" placeholder="California Sales Tax" value="[if:$has_edit_jur]$ej_display[/if]" required>
137137 </div>
138138 <div>
139139 <label>Tax type</label>
140140 <select name="tax_type">
141141 <option value="vat" [if:$has_edit_jur]$ej_type_vat[/if]>VAT</option>
142142 <option value="sales" [if:$has_edit_jur]$ej_type_sales[/if]>Sales Tax</option>
143143 <option value="gst" [if:$has_edit_jur]$ej_type_gst[/if]>GST</option>
144144 <option value="hst" [if:$has_edit_jur]$ej_type_hst[/if]>HST</option>
145145 <option value="pst" [if:$has_edit_jur]$ej_type_pst[/if]>PST</option>
146146 <option value="qst" [if:$has_edit_jur]$ej_type_qst[/if]>QST</option>
147147 <option value="other" [if:$has_edit_jur]$ej_type_other[/if]>Other</option>
148148 </select>
149149 </div>
150150 <div>
151151 <label>Rate (percent, up to 4 decimals)</label>
152152 <input type="text" name="rate_pct" placeholder="20.0000" value="[if:$has_edit_jur]$ej_rate[/if]" required>
153153 </div>
154154 <div>
155155 <label>Applies to</label>
156156 <select name="applies_to">
157157 <option value="both" [if:$has_edit_jur]$ej_applies_both[/if]>Both digital + physical</option>
158158 <option value="digital" [if:$has_edit_jur]$ej_applies_digital[/if]>Digital only</option>
159159 <option value="physical" [if:$has_edit_jur]$ej_applies_physical[/if]>Physical only</option>
160160 </select>
161161 </div>
162162 <div>
163163 <label>Effective from (YYYY-MM-DD)</label>
164164 <input type="date" name="effective_from" value="[if:$has_edit_jur]$ej_eff_from[/if]" required>
165165 </div>
166166 <div>
167167 <label>Effective to (optional)</label>
168168 <input type="date" name="effective_to" value="[if:$has_edit_jur]$ej_eff_to[/if]">
169169 </div>
170170 <div>
171171 <label>Active</label>
172172 <select name="is_active">
173173 <option value="1" [if:$has_edit_jur][if:$ej_active]selected[/if][/if][if:!$has_edit_jur]selected[/if]>Active</option>
174174 <option value="0" [if:$has_edit_jur][if:!$ej_active]selected[/if][/if]>Retired</option>
175175 </select>
176176 </div>
177177 </div>
178178 <div style="margin-top:14px">
179179 <label>Notes (optional, 250 chars)</label>
180180 <textarea name="notes" maxlength="250">[if:$has_edit_jur]$ej_notes[/if]</textarea>
181181 </div>
182182 <div class="row-actions">
183183 <button type="submit" class="btn btn-primary">[if:$has_edit_jur]Save changes[/if][if:!$has_edit_jur]Add jurisdiction[/if]</button>
184184 [if:$has_edit_jur]
185185 <a href="/admin_tax.cgi?tab=jurisdictions" class="btn btn-secondary">Cancel</a>
186186 <button type="submit" class="btn btn-danger" name="action" value="jurisdiction_retire" onclick="return confirm('Retire this jurisdiction? Historical orders keep their snapshotted rate.');">Retire</button>
187187 [/if]
188188 </div>
189189 </form>
190190</div>
191191[/if]
192192[/if]
193193
194194
195195[if:$tab_settings]
196196<!-- ============ SETTINGS ============ -->
197197<div class="tx-card">
198198 <div class="tx-card-title">Collection settings (marketplace facilitator)</div>
199199 <div class="tx-card-sub">
200200 Per-jurisdiction toggle: does WebSTLs (the platform) collect this tax on behalf of sellers? Off = sellers self-collect outside the platform.
201201 OSS / scheme determines which return the collected tax is filed under.
202202 </div>
203203 [if:$has_set_rows]
204204 <table class="tx-table">
205205 <thead>
206206 <tr>
207207 <th>Country</th>
208208 <th>Region</th>
209209 <th>Platform collects</th>
210210 <th>Scheme</th>
211211 <th>Registration #</th>
212212 <th>Price display</th>
213213 <th></th>
214214 </tr>
215215 </thead>
216216 <tbody>
217217 [loop:@set_rows]
218218 <tr>
219219 <td><strong style="color:var(--col-text);font-family:var(--font-mono,monospace)">$loop1.country</strong></td>
220220 <td style="font-family:var(--font-mono,monospace);color:var(--col-text-3)">$loop1.region</td>
221221 <td>
222222 [if:$loop1.collects]<span class="tx-pill on">YES</span>[/if]
223223 [if:!$loop1.collects]<span class="tx-pill off">NO</span>[/if]
224224 </td>
225225 <td style="font-family:var(--font-mono,monospace);font-size:12px">$loop1.oss_scheme</td>
226226 <td style="font-family:var(--font-mono,monospace);font-size:12px;color:var(--col-text-3)">$loop1.reg_number</td>
227227 <td>$loop1.price_display</td>
228228 <td style="text-align:right"><a href="$loop1.edit_href" class="btn btn-secondary btn-sm">Edit</a></td>
229229 </tr>
230230 [/loop]
231231 </tbody>
232232 </table>
233233 [/if]
234234 [if:!$has_set_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No settings rows yet.</div>[/if]
235235</div>
236236
237237[if:$is_super][if:$has_edit_setting]
238238<div class="tx-card tx-form">
239239 <div class="tx-card-title">Edit collection policy &mdash; $es_country / $es_region</div>
240240 <form method="POST" action="/admin_tax.cgi?tab=settings">
241241 <input type="hidden" name="action" value="settings_edit">
242242 <input type="hidden" name="id" value="$es_id">
243243 <div class="grid">
244244 <div>
245245 <label>Platform collects?</label>
246246 <select name="platform_collects">
247247 <option value="1" [if:$es_collects]selected[/if]>YES &mdash; marketplace facilitator role active</option>
248248 <option value="0" [if:!$es_collects]selected[/if]>NO &mdash; not registered / sellers self-collect</option>
249249 </select>
250250 </div>
251251 <div>
252252 <label>OSS / scheme</label>
253253 <select name="oss_scheme">
254254 <option value="none" $es_scheme_none>None</option>
255255 <option value="eu_oss" $es_scheme_eu>EU One-Stop Shop</option>
256256 <option value="uk_vat" $es_scheme_uk>UK VAT</option>
257257 <option value="ioss" $es_scheme_ioss>EU IOSS (imports under EUR 150)</option>
258258 <option value="us_mpf" $es_scheme_us>US Marketplace Facilitator</option>
259259 <option value="ca_gst" $es_scheme_ca>Canada GST/HST</option>
260260 <option value="au_gst" $es_scheme_au>Australia GST</option>
261261 </select>
262262 </div>
263263 <div>
264264 <label>Registration #</label>
265265 <input type="text" name="registration_number" maxlength="64" value="$es_reg" placeholder="VAT/GST number or seller permit ID">
266266 </div>
267267 <div>
268268 <label>Price display</label>
269269 <select name="price_display">
270270 <option value="exclusive" $es_display_exc>Exclusive (tax added at checkout)</option>
271271 <option value="inclusive" $es_display_inc>Inclusive (price shown already includes tax)</option>
272272 </select>
273273 </div>
274274 </div>
275275 <div style="margin-top:14px">
276276 <label>Notes</label>
277277 <textarea name="notes" maxlength="2000">$es_notes</textarea>
278278 </div>
279279 <div class="row-actions">
280280 <button type="submit" class="btn btn-primary">Save</button>
281281 <a href="/admin_tax.cgi?tab=settings" class="btn btn-secondary">Cancel</a>
282282 </div>
283283 </form>
284284</div>
285285[/if][/if]
286286[/if]
287287
288288
289289[if:$tab_sellers]
290290<!-- ============ SELLER TAX MODES ============ -->
291291<div class="tx-card">
292292 <div class="tx-card-title">Per-seller tax mode</div>
293293 <div class="tx-card-sub">
294294 Each storefront can run in one of two modes. <strong>Platform collects</strong> (default, marketplace facilitator) means WebSTLs is the merchant of record for tax purposes -- buyers pay through the platform, the platform calculates and remits.
295295 <strong>Seller handles</strong> means the seller connects their own merchant account, the platform stays out of the money flow entirely, and the seller pays a flat monthly fee instead of the per-transaction percentage. Use this for sellers who are large enough to want full control of their own tax compliance.
296296 </div>
297297 <div style="font-size:13px;color:var(--col-text-3);margin-bottom:14px">
298298 Default mode for new signups: <strong style="color:var(--col-text)">$platform_default_mode</strong>
299299 &middot; Currently: <strong>$sel_count_platform</strong> on platform-collects, <strong>$sel_count_self</strong> on seller-handles
300300 </div>
301301
302302 [if:$has_sel_rows]
303303 <table class="tx-table">
304304 <thead>
305305 <tr>
306306 <th>Storefront</th>
307307 <th>Owner</th>
308308 <th>Mode</th>
309309 <th>Seller tax ID</th>
310310 <th></th>
311311 </tr>
312312 </thead>
313313 <tbody>
314314 [loop:@sel_rows]
315315 <tr>
316316 <td>
317317 <strong style="color:var(--col-text)">$loop1.name</strong>
318318 [if:$loop1.subdomain]<div style="font-size:11px;color:var(--col-text-3);font-family:var(--font-mono,monospace)">$loop1.subdomain</div>[/if]
319319 </td>
320320 <td>
321321 <div>$loop1.owner_name</div>
322322 <div style="font-size:11px;color:var(--col-text-3);font-family:var(--font-mono,monospace)">$loop1.owner_email</div>
323323 </td>
324324 <td>
325325 [if:$loop1.is_platform]<span class="tx-pill on">Platform collects</span>[/if]
326326 [if:$loop1.is_self]<span class="tx-pill off" style="background:rgba(245,158,11,0.15);color:#fbbf24;border-color:rgba(245,158,11,0.40)">Seller handles</span>[/if]
327327 </td>
328328 <td>
329329 [if:$loop1.has_tax_id]<span style="font-family:var(--font-mono,monospace);font-size:12px">$loop1.tax_id_kind: $loop1.tax_id_value</span>[/if]
330330 [if:!$loop1.has_tax_id]<span style="color:var(--col-text-3)">&mdash;</span>[/if]
331331 </td>
332332 <td style="text-align:right"><a href="$loop1.edit_href" class="btn btn-secondary btn-sm">Edit</a></td>
333333 </tr>
334334 [/loop]
335335 </tbody>
336336 </table>
337337 [/if]
338338 [if:!$has_sel_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No storefronts yet.</div>[/if]
339339</div>
340340
341341[if:$is_super][if:$has_edit_seller]
342342<div class="tx-card tx-form">
343343 <div class="tx-card-title">Edit tax mode &mdash; $esr_name</div>
344344 <div class="tx-card-sub">Owner: $esr_owner</div>
345345 <form method="POST" action="/admin_tax.cgi?tab=sellers">
346346 <input type="hidden" name="action" value="seller_mode_edit">
347347 <input type="hidden" name="sf_id" value="$esr_id">
348348 <div class="grid">
349349 <div>
350350 <label>Tax mode</label>
351351 <select name="tax_mode">
352352 <option value="platform_collects" [if:$esr_is_plat]selected[/if]>Platform collects (marketplace facilitator)</option>
353353 <option value="seller_handles" [if:$esr_is_self]selected[/if]>Seller handles (own merchant + own tax)</option>
354354 </select>
355355 </div>
356356 <div>
357357 <label>Seller tax ID kind (optional)</label>
358358 <select name="seller_tax_id_kind">
359359 <option value="">&mdash; none &mdash;</option>
360360 <option value="us_state_seller_permit" $esr_kind_us>US state seller permit</option>
361361 <option value="eu_vat" $esr_kind_eu>EU VAT number</option>
362362 <option value="gb_vat" $esr_kind_gb>UK VAT number</option>
363363 <option value="ca_gst" $esr_kind_ca>Canada GST/HST number</option>
364364 <option value="au_abn" $esr_kind_au>Australia ABN</option>
365365 <option value="other" $esr_kind_oth>Other</option>
366366 </select>
367367 </div>
368368 <div>
369369 <label>Seller tax ID value (optional)</label>
370370 <input type="text" name="seller_tax_id_value" maxlength="64" value="$esr_value" placeholder="e.g. DE123456789">
371371 </div>
372372 </div>
373373 <div class="row-actions">
374374 <button type="submit" class="btn btn-primary">Save mode</button>
375375 <a href="/admin_tax.cgi?tab=sellers" class="btn btn-secondary">Cancel</a>
376376 </div>
377377 </form>
378378</div>
379379[/if][/if]
380380[/if]
381381
382382
383383[if:$tab_reports]
384384<!-- ============ TAX REPORTS (per-jurisdiction) ============ -->
385385<div class="tx-card">
386386 <div class="tx-card-title">Tax collected by jurisdiction</div>
387387 <div class="tx-card-sub">
388388 Aggregate of all order_tax_lines for paid orders within the date range below. Use the CSV export to feed your accountant / OSS return / state filing.
389389 </div>
390390 <form method="GET" action="/admin_tax.cgi" style="display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:14px">
391391 <input type="hidden" name="tab" value="reports">
392392 <div><label class="text-xs text-dim" style="display:block;font-weight:700;letter-spacing:0.7px;text-transform:uppercase;margin-bottom:4px">From</label><input type="date" name="from" value="$rep_from" style="background:var(--col-surface-2);border:1px solid var(--col-border);border-radius:8px;padding:7px 10px;color:var(--col-text)"></div>
393393 <div><label class="text-xs text-dim" style="display:block;font-weight:700;letter-spacing:0.7px;text-transform:uppercase;margin-bottom:4px">To</label><input type="date" name="to" value="$rep_to" style="background:var(--col-surface-2);border:1px solid var(--col-border);border-radius:8px;padding:7px 10px;color:var(--col-text)"></div>
394394 <button type="submit" class="btn btn-primary">Refresh</button>
395395 <a href="$rep_csv_href" class="btn btn-secondary">Download CSV</a>
396396 </form>
397397 <div style="font-size:13px;color:var(--col-text-3);margin-bottom:10px">
398398 <strong>$rep_orders</strong> paid orders &middot; taxable basis <strong>$rep_taxable</strong> &middot; tax collected <strong style="color:var(--col-text)">$rep_total</strong>
399399 </div>
400400 [if:$has_rep_rows]
401401 <table class="tx-table">
402402 <thead><tr><th>Country</th><th>Region</th><th>Jurisdiction</th><th>Type</th><th style="text-align:right">Rate</th><th style="text-align:right">Orders</th><th style="text-align:right">Taxable</th><th style="text-align:right">Tax</th><th style="text-align:right">Reverse-charge</th></tr></thead>
403403 <tbody>
404404 [loop:@rep_rows]
405405 <tr>
406406 <td style="font-family:var(--font-mono,monospace)"><strong style="color:var(--col-text)">$loop1.country</strong></td>
407407 <td style="font-family:var(--font-mono,monospace);color:var(--col-text-3)">$loop1.region</td>
408408 <td>$loop1.label</td>
409409 <td><span class="tx-pill type">$loop1.type</span></td>
410410 <td style="text-align:right;font-family:var(--font-mono,monospace)">$loop1.rate%</td>
411411 <td style="text-align:right">$loop1.n_orders</td>
412412 <td style="text-align:right;font-family:var(--font-mono,monospace)">$loop1.taxable</td>
413413 <td style="text-align:right;font-family:var(--font-mono,monospace);font-weight:700;color:var(--col-text)">$loop1.tax</td>
414414 <td style="text-align:right">$loop1.n_reverse</td>
415415 </tr>
416416 [/loop]
417417 </tbody>
418418 </table>
419419 [/if]
420420 [if:!$has_rep_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No tax collected in this window yet.</div>[/if]
421421</div>
422422[/if]
423423
424424
425425[if:$tab_k1099]
426426<!-- ============ 1099-K (US per-seller annual) ============ -->
427427<div class="tx-card">
428428 <div class="tx-card-title">1099-K &middot; per-seller annual gross</div>
429429 <div class="tx-card-sub">
430430 Gross paid-order revenue per seller per year. Sellers over the US federal threshold ($k_threshold) need a 1099-K filed by January 31 of the following year. CSV export feeds Track1099 / TaxBandits / your tax prep.
431431 </div>
432432 <form method="GET" action="/admin_tax.cgi" style="display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:14px">
433433 <input type="hidden" name="tab" value="k1099">
434434 <div><label class="text-xs text-dim" style="display:block;font-weight:700;letter-spacing:0.7px;text-transform:uppercase;margin-bottom:4px">Year</label><input type="number" name="year" value="$k_year" min="2020" max="2099" style="background:var(--col-surface-2);border:1px solid var(--col-border);border-radius:8px;padding:7px 10px;color:var(--col-text);width:110px"></div>
435435 <button type="submit" class="btn btn-primary">Refresh</button>
436436 <a href="$k_csv_href" class="btn btn-secondary">Download CSV</a>
437437 </form>
438438 <div style="font-size:13px;color:var(--col-text-3);margin-bottom:10px">
439439 Year <strong style="color:var(--col-text)">$k_year</strong> &middot; total gross <strong style="color:var(--col-text)">$k_total</strong> &middot; <strong>$k_n_over</strong> sellers over threshold ($k_threshold)
440440 </div>
441441 [if:$has_k_rows]
442442 <table class="tx-table">
443443 <thead><tr><th>Seller</th><th>Storefront</th><th style="text-align:right">Orders</th><th style="text-align:right">Gross</th><th>1099-K?</th></tr></thead>
444444 <tbody>
445445 [loop:@k_rows]
446446 <tr>
447447 <td><strong style="color:var(--col-text)">$loop1.name</strong><div style="font-size:11px;color:var(--col-text-3);font-family:var(--font-mono,monospace)">$loop1.email</div></td>
448448 <td>$loop1.storefront</td>
449449 <td style="text-align:right;font-family:var(--font-mono,monospace)">$loop1.n_orders</td>
450450 <td style="text-align:right;font-family:var(--font-mono,monospace);font-weight:700;color:var(--col-text)">$loop1.gross</td>
451451 <td>[if:$loop1.over_th]<span class="tx-pill on">FILE 1099-K</span>[/if][if:!$loop1.over_th]<span class="tx-pill off">below threshold</span>[/if]</td>
452452 </tr>
453453 [/loop]
454454 </tbody>
455455 </table>
456456 [/if]
457457 [if:!$has_k_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No paid orders in this year yet.</div>[/if]
458458</div>
459459[/if]
460460
461461
462462[if:$tab_audit]
463463<!-- ============ AUDIT LOG ============ -->
464464<div class="tx-card">
465465 <div class="tx-card-title">Audit log (last 200 changes)</div>
466466 <div class="tx-card-sub">Every tax-rate or collection-policy change is logged here with who, when, and a before/after snapshot.</div>
467467 [if:$has_aud_rows]
468468 <table class="tx-table">
469469 <thead>
470470 <tr>
471471 <th>When</th>
472472 <th>Who</th>
473473 <th>Action</th>
474474 <th>Target</th>
475475 <th>Before / After</th>
476476 </tr>
477477 </thead>
478478 <tbody>
479479 [loop:@aud_rows]
480480 <tr>
481481 <td style="font-family:var(--font-mono,monospace);font-size:11px;color:var(--col-text-3)"><span class="ts" data-ts="$loop1.when_epoch" data-fmt="datetime">$loop1.when</span></td>
482482 <td>$loop1.actor</td>
483483 <td><span class="tx-pill type">$loop1.action</span></td>
484484 <td style="font-family:var(--font-mono,monospace);font-size:11px;color:var(--col-text-3)">$loop1.target</td>
485485 <td style="font-size:11px;color:var(--col-text-3);font-family:var(--font-mono,monospace)">
486486 [if:$loop1.before]<div><strong style="color:#fca5a5">before:</strong> $loop1.before</div>[/if]
487487 [if:$loop1.after]<div><strong style="color:#86efac">after:</strong> $loop1.after</div>[/if]
488488 </td>
489489 </tr>
490490 [/loop]
491491 </tbody>
492492 </table>
493493 [/if]
494494 [if:!$has_aud_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No tax changes logged yet.</div>[/if]
495495</div>
496496[/if]
497497
498498[/if]
499499
500500<div class="tx-foot-spacer" style="height:24px">&nbsp;</div>