gigafibre-fsm/scripts/migration/check_missing_cat26.py
louispaulb 101faa21f1 feat: inline editing, search, notifications + full repo cleanup
- InlineField component + useInlineEdit composable for Odoo-style dblclick editing
- Client search by name, account ID, and legacy_customer_id (or_filters)
- SMS/Email notification panel on ContactCard via n8n webhooks
- Ticket reply thread via Communication docs
- All migration scripts (51 files) now tracked
- Client portal and field tech app added to monorepo
- README rewritten with full feature list, migration summary, architecture
- CHANGELOG updated with all recent work
- ROADMAP updated with current completion status
- Removed hardcoded tokens from docs (use $ERP_SERVICE_TOKEN)
- .gitignore updated (docker/, .claude/, exports/, .quasar/)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 07:34:41 -04:00

32 lines
1.1 KiB
Python

import pymysql
conn = pymysql.connect(host='10.100.80.100', user='facturation', password='VD67owoj',
database='gestionclient', cursorclass=pymysql.cursors.DictCursor)
with conn.cursor() as cur:
cur.execute("""
SELECT p.category, COUNT(*) as cnt, GROUP_CONCAT(DISTINCT p.sku) as skus
FROM service s
JOIN product p ON p.id = s.product_id
WHERE s.status = 1
AND p.category NOT IN (4,9,17,21,32,33)
GROUP BY p.category
ORDER BY cnt DESC
""")
total = 0
for r in cur.fetchall():
print("cat={}: {} services — SKUs: {}".format(r["category"], r["cnt"], r["skus"]))
total += r["cnt"]
print("\nTotal missing active services: {}".format(total))
cur.execute("""
SELECT p.sku, COUNT(*) as cnt, p.price
FROM service s
JOIN product p ON p.id = s.product_id
WHERE s.status = 1 AND p.category = 26
GROUP BY p.sku, p.price
ORDER BY cnt DESC
""")
print("\nCategory 26 breakdown:")
for r in cur.fetchall():
print(" {} x{} @ {:.2f}".format(r["sku"], r["cnt"], float(r["price"])))
conn.close()