Debug v23 - PDF generation error if additional PDF name not set

This commit is contained in:
Laurent Destailleur
2026-01-15 15:37:33 +01:00
parent 87c01a3371
commit 24d7e4f24d
7 changed files with 19 additions and 17 deletions

View File

@@ -641,8 +641,8 @@ class pdf_einstein extends ModelePDFCommandes
}
// Add terms to sale
if (getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE") && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER') && $termsofsalefilename) {
$termsofsale = $conf->order->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->order->multidir_output[$conf->entity])) {
$termsofsale = $conf->order->multidir_output[$conf->entity].'/'.$termsofsalefilename;

View File

@@ -912,8 +912,8 @@ class pdf_eratosthene extends ModelePDFCommandes
}
// Add terms to sale
if (getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE") && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_ORDER') && $termsofsalefilename) {
$termsofsale = $conf->order->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->order->multidir_output[$conf->entity])) {
$termsofsale = $conf->order->multidir_output[$conf->entity].'/'.$termsofsalefilename;

View File

@@ -916,8 +916,8 @@ class pdf_crabe extends ModelePDFFactures
}
// Add terms to sale
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE') && $termsofsalefilename) {
$termsofsale = $conf->invoice->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->invoice->multidir_output[$object->entity ?? $conf->entity])) {
$termsofsale = $conf->invoice->multidir_output[$object->entity ?? $conf->entity].'/'.$termsofsalefilename;

View File

@@ -1190,8 +1190,8 @@ class pdf_octopus extends ModelePDFFactures
$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
}
// Add terms to sale
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE') && $termsofsalefilename) {
$termsofsale = $conf->invoice->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->invoice->multidir_output[$object->entity ?? $conf->entity])) {
$termsofsale = $conf->invoice->multidir_output[$object->entity ?? $conf->entity].'/'.$termsofsalefilename;
@@ -1220,8 +1220,8 @@ class pdf_octopus extends ModelePDFFactures
}
// Add terms to sale
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE') && $termsofsalefilename) {
$termsofsale = $conf->invoice->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->invoice->multidir_output[$object->entity ?? $conf->entity])) {
$termsofsale = $conf->invoice->multidir_output[$object->entity ?? $conf->entity].'/'.$termsofsalefilename;

View File

@@ -1107,13 +1107,15 @@ class pdf_sponge extends ModelePDFFactures
if (method_exists($pdf, 'AliasNbPages')) {
$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
}
// Add terms to sale
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_INVOICE_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE') && $termsofsalefilename) {
$termsofsale = $conf->invoice->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->invoice->multidir_output[$object->entity ?? $conf->entity])) {
$termsofsale = $conf->invoice->multidir_output[$object->entity ?? $conf->entity].'/'.$termsofsalefilename;
}
if (file_exists($termsofsale) && is_readable($termsofsale)) {
$pagecount = $pdf->setSourceFile($termsofsale);
for ($i = 1; $i <= $pagecount; $i++) {
@@ -1498,7 +1500,7 @@ class pdf_sponge extends ModelePDFFactures
}
// Show payments conditions
if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) {
if ($object->type != 2 && $object->cond_reglement_code) {
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':';

View File

@@ -771,8 +771,8 @@ class pdf_azur extends ModelePDFPropales
}
// Add terms to sale
if (getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE') && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_PROPAL') && $termsofsalefilename) {
$termsofsale = $conf->propal->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->propal->multidir_output[$object->entity ?? $conf->entity])) {
$termsofsale = $conf->propal->multidir_output[$object->entity ?? $conf->entity].'/'.$termsofsalefilename;

View File

@@ -942,8 +942,8 @@ class pdf_cyan extends ModelePDFPropales
}
// Add terms to sale
if (getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE') && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) {
$termsofsalefilename = getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE');
$termsofsalefilename = getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE');
if (getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_PROPAL') && $termsofsalefilename) {
$termsofsale = $conf->propal->dir_output.'/'.$termsofsalefilename;
if (!empty($conf->propal->multidir_output[$object->entity ?? $conf->entity])) {
$termsofsale = $conf->propal->multidir_output[$object->entity ?? $conf->entity].'/'.$termsofsalefilename;