@@ -117,15 +117,15 @@ public function __construct($db)
117117 // Add ability ODT for Supplier orders
118118 $ this ->const [$ r ][0 ] = "SUPPLIER_ORDER_ADDON_PDF_ODT_PATH " ;
119119 $ this ->const [$ r ][1 ] = "chaine " ;
120- $ this ->const [$ r ][2 ] = "DOL_DATA_ROOT/doctemplates/supplier_orders " ;
120+ $ this ->const [$ r ][2 ] = "DOL_DATA_ROOT " .( $ conf -> entity > 1 ? ' / ' . $ conf -> entity : '' ). " /doctemplates/supplier_orders " ;
121121 $ this ->const [$ r ][3 ] = '' ;
122122 $ this ->const [$ r ][4 ] = 0 ;
123123 $ r ++;
124124
125125 // Add ability ODT for Supplier Invoices
126126 $ this ->const [$ r ][0 ] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH " ;
127127 $ this ->const [$ r ][1 ] = "chaine " ;
128- $ this ->const [$ r ][2 ] = "" ;
128+ $ this ->const [$ r ][2 ] = "DOL_DATA_ROOT " .( $ conf -> entity > 1 ? ' / ' . $ conf -> entity : '' ). " /doctemplates/supplier_invoices " ;
129129 $ this ->const [$ r ][3 ] = "" ;
130130 $ this ->const [$ r ][4 ] = 0 ;
131131 $ r ++;
@@ -972,7 +972,7 @@ public function init($options = '')
972972
973973 //ODT template for Supplier Orders
974974 $ src = DOL_DOCUMENT_ROOT .'/install/doctemplates/supplier_orders/template_supplier_order.odt ' ;
975- $ dirodt = DOL_DATA_ROOT .'/doctemplates/supplier_orders ' ;
975+ $ dirodt = DOL_DATA_ROOT .( $ conf -> entity > 1 ? ' / ' . $ conf -> entity : '' ). '/doctemplates/supplier_orders ' ;
976976 $ dest = $ dirodt .'/template_supplier_order.odt ' ;
977977
978978 if (file_exists ($ src ) && !file_exists ($ dest )) {
@@ -993,7 +993,7 @@ public function init($options = '')
993993
994994 //ODT template for Supplier Invoice
995995 $ src = DOL_DOCUMENT_ROOT .'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt ' ;
996- $ dirodt = DOL_DATA_ROOT .'/doctemplates/supplier_invoices ' ;
996+ $ dirodt = DOL_DATA_ROOT .( $ conf -> entity > 1 ? ' / ' . $ conf -> entity : '' ). '/doctemplates/supplier_invoices ' ;
997997 $ dest = $ dirodt .'/template_supplier_invoices.odt ' ;
998998
999999 if (file_exists ($ src ) && !file_exists ($ dest )) {
0 commit comments