Commit graph

9 commits

Author SHA1 Message Date
9114d03857 chore: Bump version to 1.5, update changelog, add .gitignore
- Version 1.5.0 mit History-Tab und Aufschlag-Spalte
- ChangeLog dokumentiert alle Versionen seit 1.0.0
- .gitignore ignoriert bin/ Releases und temp. Dateien

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:53:47 +01:00
aa363920f9 feat: Show product margin in history price changes table
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:48:38 +01:00
91c1ddd919 feat: Add history/log tab to admin area
- New admin/history.php with two sections:
  - Cronjob run history with parsed output (updated/skipped/errors)
  - Price changes from llx_product_price (price_label='Preisbot')
  - Filter by 30/90/365 days or all
  - Direct link to product price page
- Add "Verlauf" tab to preisbotAdminPrepareHead()
- Add translation keys for history page (de_DE + en_US)
- Bump version to 1.3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:41:22 +01:00
5cd7e48041 fix: Pass notrigger=1 to updatePrice to prevent SMTP hang
Dolibarr fires internal triggers on price changes which can attempt
to send emails via SMTP. This causes the cronjob to hang indefinitely
when the SMTP connection blocks. notrigger=1 skips these internal
triggers since PreisBot sends its own notifications.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 14:31:28 +01:00
d48a2f063f chore: Bump version to 1.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:14:37 +01:00
886021bdd5 fix: Add timeout and user fallback for cronjob safety
- set_time_limit(300) prevents infinite SMTP hangs
- Fallback to admin user if $user is empty in cronjob context

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:14:14 +01:00
94356a92da fix: Fatal error in mail sender accessing $conf->global
Replace $conf->global->MAIN_INFO_SOCIETE_MAIL with getDolGlobalString()
to prevent fatal error when constant is not set. This caused the
cronjob to hang on the productive server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:13:05 +01:00
af137e7d83 fix: Add try-catch to prevent cronjob from hanging
- Wrap updatePrices() in try-catch for fatal errors
- Separate try-catch for GlobalNotify and mail sending
- Prevents SMTP timeouts from blocking the entire cronjob

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:07:48 +01:00
c478e5003b feat: Initial release of PreisBot module v1.0
Automatic sales price adjustment based on purchase prices and profit margin.

Features:
- Weekly cronjob for automatic price updates
- Configurable price source (cheapest/newest supplier)
- Configurable price direction (increase only / both)
- Minimum margin setting (default 20%)
- GlobalNotify integration for dashboard notifications
- Email reports with detailed price changes
- Extrafield "Gewinnaufschlag %" on products
- Price history entries with "PreisBot" label

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 12:13:44 +01:00