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>
This commit is contained in:
parent
c7b34b149c
commit
75ef65c0ee
1 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue