Commit Graph

4 Commits

Author SHA1 Message Date
296693ebd4 fix: auto-recover from a stuck sync instead of blocking for hours
Root cause of the 2-hour stall: a category page's PHP process hung
(CLI-run cron processes typically have no execution time limit) and never
returned, so it never reached the code path that marks a page complete,
queues the next page, or marks the run failed. Action Scheduler's own
watchdog eventually marked the action failed after its 3600s timeout, but
by then the plugin's own run-tracking option was permanently stuck at
status=running with no further pages ever queued - and since manual and
scheduled syncs both check the same lock, this silently blocked all future
syncs (not just this one) for the full 4-hour lock safety-net.

Adds an 'updated_at' timestamp refreshed on every batch/page, and checks
it in queue_full_sync(): if a "running" sync hasn't made progress in over
10 minutes, treat it as abandoned, clear the lock, and start fresh instead
of waiting out the multi-hour safety-net. Also caps the 429 retry-after
sleep at 30s rather than trusting an external API-supplied value without
bound, as a defensive measure against another unbounded stall.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 17:23:35 +02:00
0aff5cf6d8 feat: category filter, item reference SKU lookup, brand sync, and on-demand BC write-back
- Filter product sync to an allow-list of BC item category codes
- Look up items by ReferenciasArticulo item reference before falling back to GTIN/item number
- Sync BC item category to product_brand and parent category to product_cat via a new ItemCategoryHierarchy endpoint
- Add on-demand push of product name/photo back to BC (product edit meta box + bulk action), including binary PATCH support for item pictures

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 11:39:11 +02:00
2495b82e66 feat: integrate custom OData endpoints for stock and price sync
Replace broken itemLedgerEntries approach with custom ItemByLocation
OData V4 endpoint for location-specific stock. Add ListaPrecios
endpoint for price list sync (B2C regular, B2C_OF sale price) with
filters for active status and all-customers assignment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 13:14:15 +01:00
b64397dcd3 feat: WooCommerce Business Central integration plugin
Native PHP plugin (no Composer) that syncs:
- Product stock and pricing from BC to WooCommerce (scheduled cron)
- Orders from WooCommerce to BC (on payment received)
- Auto-creates customers in BC from WooCommerce billing data

Product matching: WooCommerce SKU → BC Item Number, fallback to GTIN (EAN).
OAuth2 client credentials auth with encrypted secret storage.
Admin settings page with connection test, manual sync, and log viewer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:59:53 +01:00