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