Merge pull request #33077 from hregis/fix_20_sql_order_twice

FIX wrong path for odt models
This commit is contained in:
Laurent Destailleur 2025-02-13 17:46:03 +01:00 committed by GitHub
commit 4394fe635d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 7 deletions

View File

@ -5064,11 +5064,12 @@ class Facture extends CommonInvoice
//Avoid php warning Warning: mt_rand(): max(0) is smaller than min(1) when no product exists
if (empty($num_prods)) {
$num_prods = 1;
$prodids[$num_prods] = 1;
}
// Initialize parameters
$this->id = 0;
$this->entity = 1;
$this->entity = $conf->entity;
$this->ref = 'SPECIMEN';
$this->specimen = 1;
$this->socid = 1;

View File

@ -94,7 +94,7 @@ class modCommande extends DolibarrModules
$r++;
$this->const[$r][0] = "COMMANDE_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/orders";
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/orders";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
@ -459,7 +459,7 @@ class modCommande extends DolibarrModules
//ODT template
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/orders';
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/orders';
$dest = $dirodt.'/template_order.odt';
if (file_exists($src) && !file_exists($dest)) {

View File

@ -95,7 +95,7 @@ class modFacture extends DolibarrModules
$this->const[$r][0] = "FACTURE_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/invoices";
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/invoices";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
@ -773,7 +773,7 @@ class modFacture extends DolibarrModules
//ODT template
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/invoices/template_invoice.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/invoices';
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/invoices';
$dest = $dirodt.'/template_invoice.odt';
if (file_exists($src) && !file_exists($dest)) {

View File

@ -99,7 +99,7 @@ class modPropale extends DolibarrModules
$this->const[$r][0] = "PROPALE_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/proposals";
$this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/proposals";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
@ -489,7 +489,7 @@ class modPropale extends DolibarrModules
//ODT template
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/proposals/template_proposal.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/proposals';
$dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/proposals';
$dest = $dirodt.'/template_proposal.odt';
if (file_exists($src) && !file_exists($dest)) {