Compare commits

..

3 commits
v5.5 ... main

Author SHA1 Message Date
f1dded0803 docs: v5.7 - PDF-Pfad-Fix für Cron/Batch-Import
- CHANGELOG und README für Version 5.7 aktualisiert
- Dokumentiert: PDF-Pfad-Fix und Fallback für alte Pfade

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 11:45:41 +01:00
75ef65c0ee fix: Fallback für alte PDF-Pfade beim Anhängen an Rechnung
Sucht jetzt auch im alten Format /imports/{ref}_{filename}
falls die Datei nicht im neuen Pfad /imports/{id}/{filename} liegt.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 11:35:43 +01:00
c7b34b149c fix: PDF-Pfad bei Cron/Batch-Import korrigiert
PDF wird jetzt korrekt nach /imports/{id}/{filename} gespeichert,
sodass sie beim Erstellen der Lieferantenrechnung gefunden und
angehängt werden kann.

Vorher: /imports/{ref}_{filename}
Jetzt: /imports/{id}/{filename} (konsistent mit manuellem Upload)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 11:28:39 +01:00
4 changed files with 23 additions and 4 deletions

View file

@ -2,6 +2,16 @@
Alle wesentlichen Änderungen an diesem Projekt werden in dieser Datei dokumentiert.
## [5.7] - 2026-03-04
### Behoben
- **PDF-Pfad bei Cron/Batch-Import**: PDFs werden jetzt korrekt nach `/imports/{id}/{filename}` gespeichert
- Problem: Cron speicherte nach `/imports/{ref}_{filename}`, aber beim Erstellen der Rechnung wurde nach `/imports/{id}/{filename}` gesucht
- Lösung: Einheitlicher Pfad für manuellen und Cron-Import
- **Fallback für alte PDF-Pfade**: Beim Anhängen an Lieferantenrechnung wird auch im alten Pfadformat gesucht
- Ermöglicht korrekte Verarbeitung von Imports die vor dem Fix erstellt wurden
- Sucht zuerst `/imports/{id}/{filename}`, dann `/imports/{ref}_{filename}`
## [5.5] - 2026-03-03
### Behoben

View file

@ -104,7 +104,11 @@ Available in:
See [CHANGELOG.md](CHANGELOG.md) for detailed version history.
### 5.5 (Current)
### 5.7 (Current)
- Fixed PDF path for Cron/Batch imports - now correctly saved to `/imports/{id}/{filename}`
- Added fallback for old PDF paths when attaching to supplier invoices
### 5.5
- Fixed copper surcharge scaling in mass update (different quantities between Dolibarr and Datanorm)
- Fixed VAT rate preservation when updating prices
- New filters for price direction (up/down) in mass update

View file

@ -675,12 +675,12 @@ class ZugferdImport extends CommonObject
$this->status = self::STATUS_IMPORTED;
}
// Copy PDF to documents
$destdir = $conf->importzugferd->dir_output . '/imports';
// Copy PDF to documents (in subfolder by import ID)
$destdir = $conf->importzugferd->dir_output . '/imports/' . $this->id;
if (!is_dir($destdir)) {
dol_mkdir($destdir);
}
$destfile = $destdir . '/' . $this->ref . '_' . basename($file_path);
$destfile = $destdir . '/' . $this->pdf_filename;
copy($file_path, $destfile);
// Update status

View file

@ -2146,7 +2146,12 @@ if ($action == 'createinvoice' && $id > 0) {
// Invoice stays as draft - user can validate manually
// Copy PDF to invoice and register in ECM
// Neuer Pfad: /imports/{id}/{filename}
$source_pdf = $conf->importzugferd->dir_output.'/imports/'.$import->id.'/'.$import->pdf_filename;
// Fallback: Alter Pfad /imports/{ref}_{filename}
if (!file_exists($source_pdf)) {
$source_pdf = $conf->importzugferd->dir_output.'/imports/'.$import->ref.'_'.$import->pdf_filename;
}
if (file_exists($source_pdf)) {
// Relativer Pfad für ECM (ohne DOL_DATA_ROOT Prefix)
$rel_dir = 'fournisseur/facture/'.get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier').$invoice->ref;