Diff -- /var/www/vhosts/3dshawn.com/affiliate.3dshawn.com/TEMPLATES/webstls_admin_tax.html
Diff
/var/www/vhosts/3dshawn.com/affiliate.3dshawn.com/TEMPLATES/webstls_admin_tax.html
added on local at 2026-07-11 18:38:20
Added
+500
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to ccea3a9af22f
to ccea3a9af22f
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.| 1 | <style> | |
| 2 | .at-tabs { display:flex;gap:0;border-bottom:1px solid var(--col-border);margin-bottom:18px;flex-wrap:wrap; } | |
| 3 | .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; } | |
| 4 | .at-tab:hover { color:var(--col-text);background:var(--col-surface-2); } | |
| 5 | .at-tab.is-active { color:var(--col-accent-bright);border-bottom-color:var(--col-accent); } | |
| 6 | ||
| 7 | .tx-card { background:var(--col-surface-1);border:1px solid var(--col-border);border-radius:14px;padding:20px;margin-bottom:16px; } | |
| 8 | .tx-card-title { font-family:var(--font-display,sans-serif);font-size:18px;color:var(--col-text);margin:0 0 4px; } | |
| 9 | .tx-card-sub { font-size:12px;color:var(--col-text-3);margin-bottom:14px; } | |
| 10 | ||
| 11 | table.tx-table { width:100%;border-collapse:collapse; } | |
| 12 | 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); } | |
| 13 | table.tx-table td { padding:10px 12px;font-size:13px;color:var(--col-text-2);border-bottom:1px solid var(--col-border); } | |
| 14 | table.tx-table tr:hover td { background:var(--col-surface-2);color:var(--col-text); } | |
| 15 | table.tx-table tr.is-inactive td { opacity:0.55; } | |
| 16 | ||
| 17 | .tx-pill { display:inline-block;padding:3px 9px;border-radius:6px;font-size:11px;font-weight:700;letter-spacing:0.4px;text-transform:uppercase; } | |
| 18 | .tx-pill.on { background:rgba(34,197,94,0.15);color:#4ade80;border:1px solid rgba(34,197,94,0.40); } | |
| 19 | .tx-pill.off { background:rgba(148,163,184,0.10);color:var(--col-text-3);border:1px solid rgba(148,163,184,0.25); } | |
| 20 | .tx-pill.type { background:rgba(124,58,237,0.12);color:#a78bfa;border:1px solid rgba(124,58,237,0.32); } | |
| 21 | ||
| 22 | .tx-form .grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px; } | |
| 23 | .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; } | |
| 24 | .tx-form input[type=text], .tx-form input[type=number], .tx-form input[type=date], | |
| 25 | .tx-form select, .tx-form textarea { | |
| 26 | width:100%;background:var(--col-surface-2);border:1px solid var(--col-border);border-radius:8px; | |
| 27 | padding:9px 11px;color:var(--col-text);font-size:13px;font-family:inherit;box-sizing:border-box; | |
| 28 | } | |
| 29 | .tx-form textarea { min-height:64px;resize:vertical; } | |
| 30 | .tx-form .row-actions { display:flex;gap:10px;margin-top:14px; } | |
| 31 | ||
| 32 | .tx-flash { padding:10px 14px;border-radius:8px;font-size:13px;margin-bottom:14px; } | |
| 33 | .tx-flash.ok { background:rgba(34,197,94,0.10);color:#4ade80;border:1px solid rgba(34,197,94,0.35); } | |
| 34 | .tx-flash.err { background:rgba(239,68,68,0.10);color:#fca5a5;border:1px solid rgba(239,68,68,0.35); } | |
| 35 | </style> | |
| 36 | ||
| 37 | <div class="page-head"> | |
| 38 | <div class="text-xs text-dim" style="letter-spacing:1.5px;text-transform:uppercase;font-weight:700">Admin · Tax</div> | |
| 39 | <h1 class="page-title">Tax rates & collection policy</h1> | |
| 40 | <p class="page-subtitle"> | |
| 41 | Per-jurisdiction VAT / sales tax rates and marketplace-facilitator settings. Sellers see these as line items on | |
| 42 | their order receipts; the platform handles collection + remittance per the OSS scheme set below. | |
| 43 | </p> | |
| 44 | </div> | |
| 45 | ||
| 46 | [if:$has_flash_ok]<div class="tx-flash ok">$flash_ok</div>[/if] | |
| 47 | [if:$has_flash_err]<div class="tx-flash err">$flash_err</div>[/if] | |
| 48 | ||
| 49 | [if:$schema_missing] | |
| 50 | <div class="tx-card"> | |
| 51 | <strong>Tax schema not yet installed.</strong> Run the latest <code>db_schema.sql</code> to enable the tax tables. | |
| 52 | </div> | |
| 53 | [/if] | |
| 54 | ||
| 55 | [if:$schema_ready] | |
| 56 | ||
| 57 | [if:$not_super] | |
| 58 | <div class="tx-card" style="border-color:rgba(245,158,11,0.35);background:rgba(245,158,11,0.06)"> | |
| 59 | Tax configuration is super-admin only. You can view current rates + policy on this page but the save buttons are disabled. | |
| 60 | </div> | |
| 61 | [/if] | |
| 62 | ||
| 63 | <div class="at-tabs"> | |
| 64 | <a class="at-tab[if:$tab_jurisdictions] is-active[/if]" href="/admin_tax.cgi?tab=jurisdictions">Jurisdictions & Rates</a> | |
| 65 | <a class="at-tab[if:$tab_settings] is-active[/if]" href="/admin_tax.cgi?tab=settings">Collection Settings</a> | |
| 66 | <a class="at-tab[if:$tab_sellers] is-active[/if]" href="/admin_tax.cgi?tab=sellers">Seller Tax Modes</a> | |
| 67 | <a class="at-tab[if:$tab_reports] is-active[/if]" href="/admin_tax.cgi?tab=reports">Reports</a> | |
| 68 | <a class="at-tab[if:$tab_k1099] is-active[/if]" href="/admin_tax.cgi?tab=k1099">1099-K</a> | |
| 69 | <a class="at-tab[if:$tab_audit] is-active[/if]" href="/admin_tax.cgi?tab=audit">Audit Log</a> | |
| 70 | </div> | |
| 71 | ||
| 72 | [if:$tab_jurisdictions] | |
| 73 | <!-- ============ JURISDICTIONS ============ --> | |
| 74 | <div class="tx-card"> | |
| 75 | <div class="tx-card-title">Tax jurisdictions</div> | |
| 76 | <div class="tx-card-sub"> | |
| 77 | 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. | |
| 78 | Retired rates stay in the table greyed out so historical orders keep their snapshotted rate. | |
| 79 | </div> | |
| 80 | [if:$has_jur_rows] | |
| 81 | <table class="tx-table"> | |
| 82 | <thead> | |
| 83 | <tr> | |
| 84 | <th>Country</th> | |
| 85 | <th>Region</th> | |
| 86 | <th>Name</th> | |
| 87 | <th>Type</th> | |
| 88 | <th style="text-align:right">Rate</th> | |
| 89 | <th>Applies to</th> | |
| 90 | <th>Effective</th> | |
| 91 | <th></th> | |
| 92 | </tr> | |
| 93 | </thead> | |
| 94 | <tbody> | |
| 95 | [loop:@jur_rows] | |
| 96 | <tr[if:!$loop1.is_active] class="is-inactive"[/if]> | |
| 97 | <td><strong style="color:var(--col-text);font-family:var(--font-mono,monospace)">$loop1.country</strong></td> | |
| 98 | <td style="font-family:var(--font-mono,monospace);color:var(--col-text-3)">$loop1.region</td> | |
| 99 | <td>$loop1.display_name</td> | |
| 100 | <td><span class="tx-pill type">$loop1.tax_type</span></td> | |
| 101 | <td style="text-align:right;font-family:var(--font-mono,monospace);font-weight:700;color:var(--col-text)">$loop1.rate%</td> | |
| 102 | <td>$loop1.applies_to</td> | |
| 103 | <td style="font-size:11px;color:var(--col-text-3)">$loop1.effective</td> | |
| 104 | <td style="text-align:right"><a href="$loop1.edit_href" class="btn btn-secondary btn-sm">Edit</a></td> | |
| 105 | </tr> | |
| 106 | [/loop] | |
| 107 | </tbody> | |
| 108 | </table> | |
| 109 | [/if] | |
| 110 | [if:!$has_jur_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No jurisdictions yet.</div>[/if] | |
| 111 | </div> | |
| 112 | ||
| 113 | [if:$is_super] | |
| 114 | <div class="tx-card tx-form"> | |
| 115 | [if:$has_edit_jur] | |
| 116 | <div class="tx-card-title">Edit jurisdiction #$ej_id</div> | |
| 117 | [/if] | |
| 118 | [if:!$has_edit_jur] | |
| 119 | <div class="tx-card-title">Add jurisdiction</div> | |
| 120 | <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> | |
| 121 | [/if] | |
| 122 | <form method="POST" action="/admin_tax.cgi?tab=jurisdictions"> | |
| 123 | <input type="hidden" name="action" value="[if:$has_edit_jur]jurisdiction_edit[/if][if:!$has_edit_jur]jurisdiction_create[/if]"> | |
| 124 | [if:$has_edit_jur]<input type="hidden" name="id" value="$ej_id">[/if] | |
| 125 | <div class="grid"> | |
| 126 | <div> | |
| 127 | <label>Country (ISO 3166 alpha-2)</label> | |
| 128 | <input type="text" name="country_iso2" maxlength="2" placeholder="US" value="[if:$has_edit_jur]$ej_country[/if]" required> | |
| 129 | </div> | |
| 130 | <div> | |
| 131 | <label>Region (state / province code, optional)</label> | |
| 132 | <input type="text" name="region_code" maxlength="10" placeholder="CA" value="[if:$has_edit_jur]$ej_region[/if]"> | |
| 133 | </div> | |
| 134 | <div> | |
| 135 | <label>Display name</label> | |
| 136 | <input type="text" name="display_name" maxlength="120" placeholder="California Sales Tax" value="[if:$has_edit_jur]$ej_display[/if]" required> | |
| 137 | </div> | |
| 138 | <div> | |
| 139 | <label>Tax type</label> | |
| 140 | <select name="tax_type"> | |
| 141 | <option value="vat" [if:$has_edit_jur]$ej_type_vat[/if]>VAT</option> | |
| 142 | <option value="sales" [if:$has_edit_jur]$ej_type_sales[/if]>Sales Tax</option> | |
| 143 | <option value="gst" [if:$has_edit_jur]$ej_type_gst[/if]>GST</option> | |
| 144 | <option value="hst" [if:$has_edit_jur]$ej_type_hst[/if]>HST</option> | |
| 145 | <option value="pst" [if:$has_edit_jur]$ej_type_pst[/if]>PST</option> | |
| 146 | <option value="qst" [if:$has_edit_jur]$ej_type_qst[/if]>QST</option> | |
| 147 | <option value="other" [if:$has_edit_jur]$ej_type_other[/if]>Other</option> | |
| 148 | </select> | |
| 149 | </div> | |
| 150 | <div> | |
| 151 | <label>Rate (percent, up to 4 decimals)</label> | |
| 152 | <input type="text" name="rate_pct" placeholder="20.0000" value="[if:$has_edit_jur]$ej_rate[/if]" required> | |
| 153 | </div> | |
| 154 | <div> | |
| 155 | <label>Applies to</label> | |
| 156 | <select name="applies_to"> | |
| 157 | <option value="both" [if:$has_edit_jur]$ej_applies_both[/if]>Both digital + physical</option> | |
| 158 | <option value="digital" [if:$has_edit_jur]$ej_applies_digital[/if]>Digital only</option> | |
| 159 | <option value="physical" [if:$has_edit_jur]$ej_applies_physical[/if]>Physical only</option> | |
| 160 | </select> | |
| 161 | </div> | |
| 162 | <div> | |
| 163 | <label>Effective from (YYYY-MM-DD)</label> | |
| 164 | <input type="date" name="effective_from" value="[if:$has_edit_jur]$ej_eff_from[/if]" required> | |
| 165 | </div> | |
| 166 | <div> | |
| 167 | <label>Effective to (optional)</label> | |
| 168 | <input type="date" name="effective_to" value="[if:$has_edit_jur]$ej_eff_to[/if]"> | |
| 169 | </div> | |
| 170 | <div> | |
| 171 | <label>Active</label> | |
| 172 | <select name="is_active"> | |
| 173 | <option value="1" [if:$has_edit_jur][if:$ej_active]selected[/if][/if][if:!$has_edit_jur]selected[/if]>Active</option> | |
| 174 | <option value="0" [if:$has_edit_jur][if:!$ej_active]selected[/if][/if]>Retired</option> | |
| 175 | </select> | |
| 176 | </div> | |
| 177 | </div> | |
| 178 | <div style="margin-top:14px"> | |
| 179 | <label>Notes (optional, 250 chars)</label> | |
| 180 | <textarea name="notes" maxlength="250">[if:$has_edit_jur]$ej_notes[/if]</textarea> | |
| 181 | </div> | |
| 182 | <div class="row-actions"> | |
| 183 | <button type="submit" class="btn btn-primary">[if:$has_edit_jur]Save changes[/if][if:!$has_edit_jur]Add jurisdiction[/if]</button> | |
| 184 | [if:$has_edit_jur] | |
| 185 | <a href="/admin_tax.cgi?tab=jurisdictions" class="btn btn-secondary">Cancel</a> | |
| 186 | <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> | |
| 187 | [/if] | |
| 188 | </div> | |
| 189 | </form> | |
| 190 | </div> | |
| 191 | [/if] | |
| 192 | [/if] | |
| 193 | ||
| 194 | ||
| 195 | [if:$tab_settings] | |
| 196 | <!-- ============ SETTINGS ============ --> | |
| 197 | <div class="tx-card"> | |
| 198 | <div class="tx-card-title">Collection settings (marketplace facilitator)</div> | |
| 199 | <div class="tx-card-sub"> | |
| 200 | Per-jurisdiction toggle: does WebSTLs (the platform) collect this tax on behalf of sellers? Off = sellers self-collect outside the platform. | |
| 201 | OSS / scheme determines which return the collected tax is filed under. | |
| 202 | </div> | |
| 203 | [if:$has_set_rows] | |
| 204 | <table class="tx-table"> | |
| 205 | <thead> | |
| 206 | <tr> | |
| 207 | <th>Country</th> | |
| 208 | <th>Region</th> | |
| 209 | <th>Platform collects</th> | |
| 210 | <th>Scheme</th> | |
| 211 | <th>Registration #</th> | |
| 212 | <th>Price display</th> | |
| 213 | <th></th> | |
| 214 | </tr> | |
| 215 | </thead> | |
| 216 | <tbody> | |
| 217 | [loop:@set_rows] | |
| 218 | <tr> | |
| 219 | <td><strong style="color:var(--col-text);font-family:var(--font-mono,monospace)">$loop1.country</strong></td> | |
| 220 | <td style="font-family:var(--font-mono,monospace);color:var(--col-text-3)">$loop1.region</td> | |
| 221 | <td> | |
| 222 | [if:$loop1.collects]<span class="tx-pill on">YES</span>[/if] | |
| 223 | [if:!$loop1.collects]<span class="tx-pill off">NO</span>[/if] | |
| 224 | </td> | |
| 225 | <td style="font-family:var(--font-mono,monospace);font-size:12px">$loop1.oss_scheme</td> | |
| 226 | <td style="font-family:var(--font-mono,monospace);font-size:12px;color:var(--col-text-3)">$loop1.reg_number</td> | |
| 227 | <td>$loop1.price_display</td> | |
| 228 | <td style="text-align:right"><a href="$loop1.edit_href" class="btn btn-secondary btn-sm">Edit</a></td> | |
| 229 | </tr> | |
| 230 | [/loop] | |
| 231 | </tbody> | |
| 232 | </table> | |
| 233 | [/if] | |
| 234 | [if:!$has_set_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No settings rows yet.</div>[/if] | |
| 235 | </div> | |
| 236 | ||
| 237 | [if:$is_super][if:$has_edit_setting] | |
| 238 | <div class="tx-card tx-form"> | |
| 239 | <div class="tx-card-title">Edit collection policy — $es_country / $es_region</div> | |
| 240 | <form method="POST" action="/admin_tax.cgi?tab=settings"> | |
| 241 | <input type="hidden" name="action" value="settings_edit"> | |
| 242 | <input type="hidden" name="id" value="$es_id"> | |
| 243 | <div class="grid"> | |
| 244 | <div> | |
| 245 | <label>Platform collects?</label> | |
| 246 | <select name="platform_collects"> | |
| 247 | <option value="1" [if:$es_collects]selected[/if]>YES — marketplace facilitator role active</option> | |
| 248 | <option value="0" [if:!$es_collects]selected[/if]>NO — not registered / sellers self-collect</option> | |
| 249 | </select> | |
| 250 | </div> | |
| 251 | <div> | |
| 252 | <label>OSS / scheme</label> | |
| 253 | <select name="oss_scheme"> | |
| 254 | <option value="none" $es_scheme_none>None</option> | |
| 255 | <option value="eu_oss" $es_scheme_eu>EU One-Stop Shop</option> | |
| 256 | <option value="uk_vat" $es_scheme_uk>UK VAT</option> | |
| 257 | <option value="ioss" $es_scheme_ioss>EU IOSS (imports under EUR 150)</option> | |
| 258 | <option value="us_mpf" $es_scheme_us>US Marketplace Facilitator</option> | |
| 259 | <option value="ca_gst" $es_scheme_ca>Canada GST/HST</option> | |
| 260 | <option value="au_gst" $es_scheme_au>Australia GST</option> | |
| 261 | </select> | |
| 262 | </div> | |
| 263 | <div> | |
| 264 | <label>Registration #</label> | |
| 265 | <input type="text" name="registration_number" maxlength="64" value="$es_reg" placeholder="VAT/GST number or seller permit ID"> | |
| 266 | </div> | |
| 267 | <div> | |
| 268 | <label>Price display</label> | |
| 269 | <select name="price_display"> | |
| 270 | <option value="exclusive" $es_display_exc>Exclusive (tax added at checkout)</option> | |
| 271 | <option value="inclusive" $es_display_inc>Inclusive (price shown already includes tax)</option> | |
| 272 | </select> | |
| 273 | </div> | |
| 274 | </div> | |
| 275 | <div style="margin-top:14px"> | |
| 276 | <label>Notes</label> | |
| 277 | <textarea name="notes" maxlength="2000">$es_notes</textarea> | |
| 278 | </div> | |
| 279 | <div class="row-actions"> | |
| 280 | <button type="submit" class="btn btn-primary">Save</button> | |
| 281 | <a href="/admin_tax.cgi?tab=settings" class="btn btn-secondary">Cancel</a> | |
| 282 | </div> | |
| 283 | </form> | |
| 284 | </div> | |
| 285 | [/if][/if] | |
| 286 | [/if] | |
| 287 | ||
| 288 | ||
| 289 | [if:$tab_sellers] | |
| 290 | <!-- ============ SELLER TAX MODES ============ --> | |
| 291 | <div class="tx-card"> | |
| 292 | <div class="tx-card-title">Per-seller tax mode</div> | |
| 293 | <div class="tx-card-sub"> | |
| 294 | 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. | |
| 295 | <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. | |
| 296 | </div> | |
| 297 | <div style="font-size:13px;color:var(--col-text-3);margin-bottom:14px"> | |
| 298 | Default mode for new signups: <strong style="color:var(--col-text)">$platform_default_mode</strong> | |
| 299 | · Currently: <strong>$sel_count_platform</strong> on platform-collects, <strong>$sel_count_self</strong> on seller-handles | |
| 300 | </div> | |
| 301 | ||
| 302 | [if:$has_sel_rows] | |
| 303 | <table class="tx-table"> | |
| 304 | <thead> | |
| 305 | <tr> | |
| 306 | <th>Storefront</th> | |
| 307 | <th>Owner</th> | |
| 308 | <th>Mode</th> | |
| 309 | <th>Seller tax ID</th> | |
| 310 | <th></th> | |
| 311 | </tr> | |
| 312 | </thead> | |
| 313 | <tbody> | |
| 314 | [loop:@sel_rows] | |
| 315 | <tr> | |
| 316 | <td> | |
| 317 | <strong style="color:var(--col-text)">$loop1.name</strong> | |
| 318 | [if:$loop1.subdomain]<div style="font-size:11px;color:var(--col-text-3);font-family:var(--font-mono,monospace)">$loop1.subdomain</div>[/if] | |
| 319 | </td> | |
| 320 | <td> | |
| 321 | <div>$loop1.owner_name</div> | |
| 322 | <div style="font-size:11px;color:var(--col-text-3);font-family:var(--font-mono,monospace)">$loop1.owner_email</div> | |
| 323 | </td> | |
| 324 | <td> | |
| 325 | [if:$loop1.is_platform]<span class="tx-pill on">Platform collects</span>[/if] | |
| 326 | [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] | |
| 327 | </td> | |
| 328 | <td> | |
| 329 | [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] | |
| 330 | [if:!$loop1.has_tax_id]<span style="color:var(--col-text-3)">—</span>[/if] | |
| 331 | </td> | |
| 332 | <td style="text-align:right"><a href="$loop1.edit_href" class="btn btn-secondary btn-sm">Edit</a></td> | |
| 333 | </tr> | |
| 334 | [/loop] | |
| 335 | </tbody> | |
| 336 | </table> | |
| 337 | [/if] | |
| 338 | [if:!$has_sel_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No storefronts yet.</div>[/if] | |
| 339 | </div> | |
| 340 | ||
| 341 | [if:$is_super][if:$has_edit_seller] | |
| 342 | <div class="tx-card tx-form"> | |
| 343 | <div class="tx-card-title">Edit tax mode — $esr_name</div> | |
| 344 | <div class="tx-card-sub">Owner: $esr_owner</div> | |
| 345 | <form method="POST" action="/admin_tax.cgi?tab=sellers"> | |
| 346 | <input type="hidden" name="action" value="seller_mode_edit"> | |
| 347 | <input type="hidden" name="sf_id" value="$esr_id"> | |
| 348 | <div class="grid"> | |
| 349 | <div> | |
| 350 | <label>Tax mode</label> | |
| 351 | <select name="tax_mode"> | |
| 352 | <option value="platform_collects" [if:$esr_is_plat]selected[/if]>Platform collects (marketplace facilitator)</option> | |
| 353 | <option value="seller_handles" [if:$esr_is_self]selected[/if]>Seller handles (own merchant + own tax)</option> | |
| 354 | </select> | |
| 355 | </div> | |
| 356 | <div> | |
| 357 | <label>Seller tax ID kind (optional)</label> | |
| 358 | <select name="seller_tax_id_kind"> | |
| 359 | <option value="">— none —</option> | |
| 360 | <option value="us_state_seller_permit" $esr_kind_us>US state seller permit</option> | |
| 361 | <option value="eu_vat" $esr_kind_eu>EU VAT number</option> | |
| 362 | <option value="gb_vat" $esr_kind_gb>UK VAT number</option> | |
| 363 | <option value="ca_gst" $esr_kind_ca>Canada GST/HST number</option> | |
| 364 | <option value="au_abn" $esr_kind_au>Australia ABN</option> | |
| 365 | <option value="other" $esr_kind_oth>Other</option> | |
| 366 | </select> | |
| 367 | </div> | |
| 368 | <div> | |
| 369 | <label>Seller tax ID value (optional)</label> | |
| 370 | <input type="text" name="seller_tax_id_value" maxlength="64" value="$esr_value" placeholder="e.g. DE123456789"> | |
| 371 | </div> | |
| 372 | </div> | |
| 373 | <div class="row-actions"> | |
| 374 | <button type="submit" class="btn btn-primary">Save mode</button> | |
| 375 | <a href="/admin_tax.cgi?tab=sellers" class="btn btn-secondary">Cancel</a> | |
| 376 | </div> | |
| 377 | </form> | |
| 378 | </div> | |
| 379 | [/if][/if] | |
| 380 | [/if] | |
| 381 | ||
| 382 | ||
| 383 | [if:$tab_reports] | |
| 384 | <!-- ============ TAX REPORTS (per-jurisdiction) ============ --> | |
| 385 | <div class="tx-card"> | |
| 386 | <div class="tx-card-title">Tax collected by jurisdiction</div> | |
| 387 | <div class="tx-card-sub"> | |
| 388 | 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. | |
| 389 | </div> | |
| 390 | <form method="GET" action="/admin_tax.cgi" style="display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:14px"> | |
| 391 | <input type="hidden" name="tab" value="reports"> | |
| 392 | <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> | |
| 393 | <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> | |
| 394 | <button type="submit" class="btn btn-primary">Refresh</button> | |
| 395 | <a href="$rep_csv_href" class="btn btn-secondary">Download CSV</a> | |
| 396 | </form> | |
| 397 | <div style="font-size:13px;color:var(--col-text-3);margin-bottom:10px"> | |
| 398 | <strong>$rep_orders</strong> paid orders · taxable basis <strong>$rep_taxable</strong> · tax collected <strong style="color:var(--col-text)">$rep_total</strong> | |
| 399 | </div> | |
| 400 | [if:$has_rep_rows] | |
| 401 | <table class="tx-table"> | |
| 402 | <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> | |
| 403 | <tbody> | |
| 404 | [loop:@rep_rows] | |
| 405 | <tr> | |
| 406 | <td style="font-family:var(--font-mono,monospace)"><strong style="color:var(--col-text)">$loop1.country</strong></td> | |
| 407 | <td style="font-family:var(--font-mono,monospace);color:var(--col-text-3)">$loop1.region</td> | |
| 408 | <td>$loop1.label</td> | |
| 409 | <td><span class="tx-pill type">$loop1.type</span></td> | |
| 410 | <td style="text-align:right;font-family:var(--font-mono,monospace)">$loop1.rate%</td> | |
| 411 | <td style="text-align:right">$loop1.n_orders</td> | |
| 412 | <td style="text-align:right;font-family:var(--font-mono,monospace)">$loop1.taxable</td> | |
| 413 | <td style="text-align:right;font-family:var(--font-mono,monospace);font-weight:700;color:var(--col-text)">$loop1.tax</td> | |
| 414 | <td style="text-align:right">$loop1.n_reverse</td> | |
| 415 | </tr> | |
| 416 | [/loop] | |
| 417 | </tbody> | |
| 418 | </table> | |
| 419 | [/if] | |
| 420 | [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] | |
| 421 | </div> | |
| 422 | [/if] | |
| 423 | ||
| 424 | ||
| 425 | [if:$tab_k1099] | |
| 426 | <!-- ============ 1099-K (US per-seller annual) ============ --> | |
| 427 | <div class="tx-card"> | |
| 428 | <div class="tx-card-title">1099-K · per-seller annual gross</div> | |
| 429 | <div class="tx-card-sub"> | |
| 430 | 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. | |
| 431 | </div> | |
| 432 | <form method="GET" action="/admin_tax.cgi" style="display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:14px"> | |
| 433 | <input type="hidden" name="tab" value="k1099"> | |
| 434 | <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> | |
| 435 | <button type="submit" class="btn btn-primary">Refresh</button> | |
| 436 | <a href="$k_csv_href" class="btn btn-secondary">Download CSV</a> | |
| 437 | </form> | |
| 438 | <div style="font-size:13px;color:var(--col-text-3);margin-bottom:10px"> | |
| 439 | Year <strong style="color:var(--col-text)">$k_year</strong> · total gross <strong style="color:var(--col-text)">$k_total</strong> · <strong>$k_n_over</strong> sellers over threshold ($k_threshold) | |
| 440 | </div> | |
| 441 | [if:$has_k_rows] | |
| 442 | <table class="tx-table"> | |
| 443 | <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> | |
| 444 | <tbody> | |
| 445 | [loop:@k_rows] | |
| 446 | <tr> | |
| 447 | <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> | |
| 448 | <td>$loop1.storefront</td> | |
| 449 | <td style="text-align:right;font-family:var(--font-mono,monospace)">$loop1.n_orders</td> | |
| 450 | <td style="text-align:right;font-family:var(--font-mono,monospace);font-weight:700;color:var(--col-text)">$loop1.gross</td> | |
| 451 | <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> | |
| 452 | </tr> | |
| 453 | [/loop] | |
| 454 | </tbody> | |
| 455 | </table> | |
| 456 | [/if] | |
| 457 | [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] | |
| 458 | </div> | |
| 459 | [/if] | |
| 460 | ||
| 461 | ||
| 462 | [if:$tab_audit] | |
| 463 | <!-- ============ AUDIT LOG ============ --> | |
| 464 | <div class="tx-card"> | |
| 465 | <div class="tx-card-title">Audit log (last 200 changes)</div> | |
| 466 | <div class="tx-card-sub">Every tax-rate or collection-policy change is logged here with who, when, and a before/after snapshot.</div> | |
| 467 | [if:$has_aud_rows] | |
| 468 | <table class="tx-table"> | |
| 469 | <thead> | |
| 470 | <tr> | |
| 471 | <th>When</th> | |
| 472 | <th>Who</th> | |
| 473 | <th>Action</th> | |
| 474 | <th>Target</th> | |
| 475 | <th>Before / After</th> | |
| 476 | </tr> | |
| 477 | </thead> | |
| 478 | <tbody> | |
| 479 | [loop:@aud_rows] | |
| 480 | <tr> | |
| 481 | <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> | |
| 482 | <td>$loop1.actor</td> | |
| 483 | <td><span class="tx-pill type">$loop1.action</span></td> | |
| 484 | <td style="font-family:var(--font-mono,monospace);font-size:11px;color:var(--col-text-3)">$loop1.target</td> | |
| 485 | <td style="font-size:11px;color:var(--col-text-3);font-family:var(--font-mono,monospace)"> | |
| 486 | [if:$loop1.before]<div><strong style="color:#fca5a5">before:</strong> $loop1.before</div>[/if] | |
| 487 | [if:$loop1.after]<div><strong style="color:#86efac">after:</strong> $loop1.after</div>[/if] | |
| 488 | </td> | |
| 489 | </tr> | |
| 490 | [/loop] | |
| 491 | </tbody> | |
| 492 | </table> | |
| 493 | [/if] | |
| 494 | [if:!$has_aud_rows]<div style="color:var(--col-text-3);text-align:center;padding:30px">No tax changes logged yet.</div>[/if] | |
| 495 | </div> | |
| 496 | [/if] | |
| 497 | ||
| 498 | [/if] | |
| 499 | ||
| 500 | <div class="tx-foot-spacer" style="height:24px"> </div> |