myron f54cdb11db Auto-debit platform credits when purchase is approved
When a pending purchase is resolved as completed:
- Inserts a debit row into platform_credits for the matching platform
  (joins token_purchases.platform_id slug → platforms.id)
- Debit notes include purchase #, player name, username, token count, amount, method
- Total shown in credit modal now subtracts debits from credits (net balance)

Credit history table updates:
- CREDIT/DEBIT type badges, debit rows tinted red with − prefix
- Debit rows show "Purchase #X ↗" button that closes modal, jumps to
  the Purchases section (all tab), and highlights that purchase row
- Edit/delete buttons hidden on auto-generated debit rows

Also fixes: resolve_purchase was echoing $sent (undefined variable bug)
Also fixes: purchaseCard div now has id="pr-N" so jump-highlight works

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 21:38:03 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
2026-05-22 12:52:50 +00:00
S
Description
Mirror of github.com/myronblair/tomtomgames
262 KiB
Languages
PHP 99.8%
Shell 0.2%