From 65fef47bdb8e0f7bf72545e5cd75572ec6ddc7e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Jan 2020 01:05:30 +0100 Subject: [PATCH] Enable new pdf templates as stable --- htdocs/admin/agenda_other.php | 4 +- htdocs/admin/bom.php | 8 ++-- htdocs/admin/commande.php | 23 ++++++----- htdocs/admin/contract.php | 23 ++++++----- htdocs/admin/facture.php | 25 ++++++----- htdocs/admin/fichinter.php | 5 ++- htdocs/admin/holiday.php | 7 +++- htdocs/admin/mrp.php | 14 ++++--- htdocs/admin/propal.php | 11 +++-- htdocs/admin/reception_setup.php | 9 ++-- htdocs/admin/supplier_invoice.php | 13 +++--- htdocs/admin/supplier_order.php | 9 ++-- htdocs/admin/supplier_payment.php | 7 +++- htdocs/admin/supplier_proposal.php | 11 +++-- htdocs/admin/ticket.php | 4 +- .../commande/doc/pdf_einstein.modules.php | 2 +- .../commande/doc/pdf_eratosthene.modules.php | 24 +++++++---- .../commande/doc/pdf_proforma.modules.php | 4 +- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../facture/doc/pdf_sponge.modules.php | 41 +++++++++++-------- .../modules/propale/doc/pdf_azur.modules.php | 4 +- .../modules/propale/doc/pdf_cyan.modules.php | 26 ++++++------ .../supplier_invoice/{pdf => doc}/index.html | 0 .../{pdf => doc}/pdf_canelle.modules.php | 2 +- ...doc_generic_supplier_order_odt.modules.php | 2 +- .../supplier_order/{pdf => doc}/index.html | 0 .../{pdf => doc}/pdf_cornas.modules.php | 10 ++--- .../{pdf => doc}/pdf_muscadet.modules.php | 6 +-- .../class/fournisseur.commande.class.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 2 +- htdocs/langs/en_US/admin.lang | 5 ++- htdocs/langs/en_US/bills.lang | 2 +- htdocs/langs/en_US/orders.lang | 6 +-- htdocs/langs/en_US/propal.lang | 4 +- 34 files changed, 184 insertions(+), 133 deletions(-) rename htdocs/core/modules/supplier_invoice/{pdf => doc}/index.html (100%) rename htdocs/core/modules/supplier_invoice/{pdf => doc}/pdf_canelle.modules.php (99%) rename htdocs/core/modules/supplier_order/{pdf => doc}/doc_generic_supplier_order_odt.modules.php (99%) rename htdocs/core/modules/supplier_order/{pdf => doc}/index.html (100%) rename htdocs/core/modules/supplier_order/{pdf => doc}/pdf_cornas.modules.php (99%) rename htdocs/core/modules/supplier_order/{pdf => doc}/pdf_muscadet.modules.php (99%) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 0ea6a932fe7..5338010772f 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -235,7 +235,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/action/doc/"); + $dir = dol_buildpath($reldir."core/modules/action/doc"); if (is_dir($dir)) { @@ -257,7 +257,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print (empty($module->name) ? $name : $module->name); print "\n"; print "\n"; - require_once $dir.$file; + require_once $dir.'/'.$file; $module = new $classname($db, $specimenthirdparty); if (method_exists($module, 'info')) print $module->info($langs); diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 9a10c2f3886..6d37def3187 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -350,7 +350,8 @@ foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/bom".$valdir); + $realpath = $reldir."core/modules/bom".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -382,7 +383,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print ''; print (empty($module->name) ? $name : $module->name); print "\n"; @@ -425,7 +425,9 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 2688b252d58..ef1d8e710d4 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -403,7 +403,8 @@ foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/commande".$valdir); + $realpath = $reldir."core/modules/commande".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -472,19 +473,21 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') { $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - //$htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); - //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + //$htmltooltip .= '
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); + //$htmltooltip .= '
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); + $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 3c727fe1397..0e2680f3d0b 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -339,7 +339,8 @@ foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/contract".$valdir); + $realpath = $reldir."core/modules/contract".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -407,18 +408,20 @@ foreach ($dirmodels as $reldir) print ''; // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') { - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 669e9e4f5a9..b84d77cae16 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -486,7 +486,8 @@ foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/facture".$valdir); + $realpath = $reldir."core/modules/facture".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -555,19 +556,21 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') { - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); - $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte, 1, 1); - $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note, 1, 1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark, 1, 1); + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip .= '
'.$langs->trans("Discounts").': '.yn($module->option_escompte, 1, 1); + $htmltooltip .= '
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note, 1, 1); + $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark, 1, 1); print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 149a1e0376d..055384c0084 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -409,7 +409,8 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/fichinter/doc/"); + $realpath = $reldir."core/modules/fichinter/doc"; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -480,6 +481,8 @@ foreach ($dirmodels as $reldir) $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 8cef5be5f26..aafe01bf5bd 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -355,7 +355,8 @@ foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/holiday".$valdir); + $realpath = $reldir."core/modules/holiday".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -429,7 +430,9 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 32af954f059..a686422a21e 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -351,7 +351,8 @@ foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/mrp".$valdir); + $realpath = $reldir."core/modules/mrp".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -383,7 +384,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print ''; print (empty($module->name)?$name:$module->name); print "\n"; @@ -421,14 +421,16 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') { $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftMOs").': '.yn($module->option_draft_watermark, 1, 1); + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftMOs").': '.yn($module->option_draft_watermark, 1, 1); print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index ee814ec46fb..781d7da5f6f 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -271,7 +271,7 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/propale/"); + $dir = dol_buildpath($reldir."core/modules/propale"); if (is_dir($dir)) { @@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file) - 4); - require_once $dir.$file.'.php'; + require_once $dir.'/'.$file.'.php'; $module = new $file; @@ -399,7 +399,8 @@ foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/propale".$valdir); + $realpath = $reldir."core/modules/propale".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -474,7 +475,9 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 6ee3eeb8f05..bd126d98341 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -221,7 +221,7 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/reception/"); + $dir = dol_buildpath($reldir."core/modules/reception"); if (is_dir($dir)) { @@ -353,7 +353,8 @@ foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/reception".$valdir); + $realpath = $reldir."core/modules/reception".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -427,7 +428,9 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index bfbe5eb0f96..9a17916cb49 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -90,7 +90,7 @@ if ($action == 'specimen') // For invoices $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir."core/modules/supplier_invoice/pdf/pdf_".$modele.".modules.php", 0); + $file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound = 1; @@ -230,7 +230,7 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/supplier_invoice/"); + $dir = dol_buildpath($reldir."core/modules/supplier_invoice"); if (is_dir($dir)) { @@ -243,7 +243,7 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file) - 4); - require_once $dir.$file.'.php'; + require_once $dir.'/'.$file.'.php'; $module = new $file; @@ -360,7 +360,8 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/supplier_invoice/pdf/"); + $realpath = $reldir."core/modules/supplier_invoice/doc"; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -385,7 +386,7 @@ foreach ($dirmodels as $reldir) print (empty($module->name) ? $name : $module->name); print "\n"; print "\n"; - require_once $dir.$file; + require_once $dir.'/'.$file; $module = new $classname($db, $specimenthirdparty); if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; @@ -434,6 +435,8 @@ foreach ($dirmodels as $reldir) $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 55c14a22e4d..15e1a452dff 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -86,7 +86,7 @@ elseif ($action == 'specimen') // For orders $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir."core/modules/supplier_order/pdf/pdf_".$modele.".modules.php", 0); + $file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound = 1; @@ -388,7 +388,8 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/supplier_order/pdf/"); + $realpath = $reldir."core/modules/supplier_order/doc"; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -411,7 +412,7 @@ foreach ($dirmodels as $reldir) print (empty($module->name) ? $name : $module->name); print "\n"; print "\n"; - require_once $dir.$file; + require_once $dir.'/'.$file; $module = new $classname($db, $specimenthirdparty); if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; @@ -456,6 +457,8 @@ foreach ($dirmodels as $reldir) $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 1f368eb2b50..d533ba0d8eb 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -332,7 +332,8 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/supplier_payment/doc/"); + $realpath = $reldir."core/modules/supplier_payment/doc"; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -356,7 +357,7 @@ foreach ($dirmodels as $reldir) print (empty($module->name) ? $name : $module->name); print "\n"; print "\n"; - require_once $dir.$file; + require_once $dir.'/'.$file; $module = new $classname($db, $specimenthirdparty); if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; @@ -405,6 +406,8 @@ foreach ($dirmodels as $reldir) $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 6f297514999..c1007623a54 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -239,7 +239,7 @@ print ''."\n"; clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/supplier_proposal/"); + $dir = dol_buildpath($reldir."core/modules/supplier_proposal"); if (is_dir($dir)) { @@ -252,7 +252,7 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file) - 4); - require_once $dir.$file.'.php'; + require_once $dir.'/'.$file.'.php'; $module = new $file; @@ -366,7 +366,8 @@ foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/supplier_proposal".$valdir); + $realpath = $reldir."core/modules/supplier_proposal".$valdir; + $dir = dol_buildpath($realpath); if (is_dir($dir)) { @@ -440,7 +441,9 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } - $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; + + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 97d81a3e03c..dba1f827748 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -209,7 +209,7 @@ print "\n"; clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/ticket/"); + $dir = dol_buildpath($reldir."core/modules/ticket"); if (is_dir($dir)) { $handle = opendir($dir); @@ -219,7 +219,7 @@ foreach ($dirmodels as $reldir) { $file = $reg[1]; $classname = substr($file, 4); - include_once $dir.$file.'.php'; + include_once $dir.'/'.$file.'.php'; $module = new $file; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 075ba0efb84..6bfee834b9b 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -116,7 +116,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Issuer - * @var Societe object that emits + * @var Societe Object that emits */ public $emetteur; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 6342cd6ce74..728214b4b07 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -77,7 +77,7 @@ class pdf_eratosthene extends ModelePDFCommandes * Dolibarr version of the loaded document * @var string */ - public $version = 'development'; + public $version = 'dolibarr'; /** * @var int page_largeur @@ -116,7 +116,7 @@ class pdf_eratosthene extends ModelePDFCommandes /** * Issuer - * @var Societe + * @var Societe Object that emits */ public $emetteur; @@ -200,7 +200,7 @@ class pdf_eratosthene extends ModelePDFCommandes // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); $nblines = count($object->lines); @@ -391,7 +391,7 @@ class pdf_eratosthene extends ModelePDFCommandes } } - // Affiche notes + // Displays notes $notetoshow=empty($object->note_public)?'':$object->note_public; if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) { @@ -1077,7 +1077,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); @@ -1360,14 +1360,14 @@ class pdf_eratosthene extends ModelePDFCommandes * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @param string $titlekey Translation key to show as title of document - * @return void + * @return int Return topshift value */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle") { // phpcs:enable global $conf,$langs,$hookmanager; - // Translations + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1449,8 +1449,16 @@ class pdf_eratosthene extends ModelePDFCommandes $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date, "%d %b %Y", false, $outputlangs, true), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && ! empty($object->thirdparty->code_client)) + { + $posy+=4; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R'); + } + // Get contact if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) { diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index 9ba5c731ef5..c36b78d66ab 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -28,7 +28,7 @@ * \brief File of Class to generate PDF orders with template Proforma */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_einstein.modules.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_eratosthene.modules.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to generate PDF orders with template Proforma */ -class pdf_proforma extends pdf_einstein +class pdf_proforma extends pdf_eratosthene { /** diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 64aa3c52e25..0f7b892cf9a 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -117,7 +117,7 @@ class pdf_crabe extends ModelePDFFactures /** * Issuer - * @var Societe object that emits + * @var Societe Object that emits */ public $emetteur; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 3e00e2cab68..da506c10a9f 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -78,7 +78,7 @@ class pdf_sponge extends ModelePDFFactures * Dolibarr version of the loaded document * @var string */ - public $version = 'development'; + public $version = 'dolibarr'; /** * @var int page_largeur @@ -117,7 +117,7 @@ class pdf_sponge extends ModelePDFFactures /** * Issuer - * @var Societe + * @var Societe Object that emits */ public $emetteur; @@ -209,13 +209,15 @@ class pdf_sponge extends ModelePDFFactures public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) { // phpcs:enable - global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblines; + global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines; + dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null')); + if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load translation files required by the page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); $nblines = count($object->lines); @@ -340,7 +342,7 @@ class pdf_sponge extends ModelePDFFactures $heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)?12:22); // Height reserved to output the footer (value include bottom margin) + $heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { @@ -944,7 +946,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 4); - // Loop on each deposits and credit notes included + // Loop on each discount available (deposits and credit notes and excess of payment included) $sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,"; $sql .= " re.description, re.fk_facture_source,"; $sql .= " f.type, f.datef"; @@ -961,9 +963,10 @@ class pdf_sponge extends ModelePDFFactures $y += 3; $obj = $this->db->fetch_object($resql); - if ($obj->type == 2) $text = $outputlangs->trans("CreditNote"); - elseif ($obj->type == 3) $text = $outputlangs->trans("Deposit"); - else $text = $outputlangs->trans("UnknownType"); + if ($obj->type == 2) $text = $outputlangs->transnoentities("CreditNote"); + elseif ($obj->type == 3) $text = $outputlangs->transnoentities("Deposit"); + elseif ($obj->type == 0) $text = $outputlangs->transnoentities("ExcessReceived"); + else $text = $outputlangs->transnoentities("UnknownType"); $invoice->fetch($obj->fk_facture_source); @@ -1190,9 +1193,9 @@ class pdf_sponge extends ModelePDFFactures /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice - * @param int $deja_regle Montant deja regle + * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart * @param Translate $outputlangs Objet langs * @return int Position pour suite @@ -1381,6 +1384,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); @@ -1648,7 +1652,7 @@ class pdf_sponge extends ModelePDFFactures // Billed - retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFEVOLToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFEVOLToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); @@ -1658,7 +1662,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $retainedWarrantyToPayOn = $outputlangs->transnoentities("PDFEVOLRetainedWarranty") . ' ('.$object->retained_warranty.'%)'; - $retainedWarrantyToPayOn.= !empty($object->retained_warranty_date_limit)?' '.$outputlangs->transnoentities("PDFEVOLtoPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')):''; + $retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit)?' '.$outputlangs->transnoentities("PDFEVOLtoPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')):''; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -1670,11 +1674,11 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(0, 0, 0); - $creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); - $depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); + $creditnoteamount = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received + $depositsamount = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); - if ($object->paye) $resteapayer=0; + if (!empty($object->paye)) $resteapayer = 0; if (($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS)) { @@ -1688,9 +1692,10 @@ class pdf_sponge extends ModelePDFFactures // Credit note if ($creditnoteamount) { + $labeltouse = ($outputlangs->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangs->transnoentities("CreditNotesOrExcessReceived") : $outputlangs->transnoentities("CreditNotes"); $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', 0); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); } @@ -1806,7 +1811,7 @@ class pdf_sponge extends ModelePDFFactures { global $conf, $langs; - // Translations + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "propal", "companies")); $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 9219de5863c..cd0240c4da7 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -58,7 +58,7 @@ class pdf_azur extends ModelePDFPropales public $description; /** - * @var string Save the name of generated file as the main doc when generating a doc with this template + * @var string Save the name of generated file as the main doc when generating a doc with this template */ public $update_main_doc_field; @@ -116,7 +116,7 @@ class pdf_azur extends ModelePDFPropales /** * Issuer - * @var Societe object that emits + * @var Societe Object that emits */ public $emetteur; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 1e67ac6485c..96513b5bba3 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -57,7 +57,7 @@ class pdf_cyan extends ModelePDFPropales public $description; /** - * @var int Save the name of generated file as the main doc when generating a doc with this template + * @var string Save the name of generated file as the main doc when generating a doc with this template */ public $update_main_doc_field; @@ -76,7 +76,7 @@ class pdf_cyan extends ModelePDFPropales * Dolibarr version of the loaded document * @var string */ - public $version = 'development'; + public $version = 'dolibarr'; /** * @var int page_largeur @@ -115,7 +115,7 @@ class pdf_cyan extends ModelePDFPropales /** * Issuer - * @var Societe + * @var Societe Object that emits */ public $emetteur; @@ -199,7 +199,7 @@ class pdf_cyan extends ModelePDFPropales // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - // Translations + // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); $nblines = count($object->lines); @@ -238,7 +238,11 @@ class pdf_cyan extends ModelePDFPropales { if (! $arephoto) { - $dir = $conf->product->dir_output.'/'.$midir; + if ($conf->product->entity != $objphoto->entity) { + $dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities + } else { + $dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product + } foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { @@ -413,7 +417,7 @@ class pdf_cyan extends ModelePDFPropales { $tmpuser=new User($this->db); $tmpuser->fetch($object->user_author_id); - $notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs); + $notetoshow .= $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email; if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone; } @@ -1169,7 +1173,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); @@ -1475,11 +1479,9 @@ class pdf_cyan extends ModelePDFPropales { global $conf, $langs; - $outputlangs->load("main"); - $outputlangs->load("bills"); - $outputlangs->load("propal"); - $outputlangs->load("companies"); - + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "propal", "companies", "bills")); + $default_font_size = pdf_getPDFFontSize($outputlangs); pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); diff --git a/htdocs/core/modules/supplier_invoice/pdf/index.html b/htdocs/core/modules/supplier_invoice/doc/index.html similarity index 100% rename from htdocs/core/modules/supplier_invoice/pdf/index.html rename to htdocs/core/modules/supplier_invoice/doc/index.html diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php similarity index 99% rename from htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php rename to htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 32926e098e3..bd3ca0002e5 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php + * \file htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php * \ingroup fournisseur * \brief Class file to generate the supplier invoices with the canelle model */ diff --git a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php similarity index 99% rename from htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php rename to htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index e3c46904c1f..c71fe8f59ec 100644 --- a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -23,7 +23,7 @@ */ /** - * \file htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php + * \file htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php * \ingroup commande * \brief File of class to build ODT documents for supplier orders */ diff --git a/htdocs/core/modules/supplier_order/pdf/index.html b/htdocs/core/modules/supplier_order/doc/index.html similarity index 100% rename from htdocs/core/modules/supplier_order/pdf/index.html rename to htdocs/core/modules/supplier_order/doc/index.html diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php similarity index 99% rename from htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php rename to htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 8ff4c3ad429..6bbc208651b 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -23,7 +23,7 @@ */ /** - * \file htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php + * \file htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php * \ingroup fournisseur * \brief File of class to generate suppliers orders from cornas model */ @@ -71,7 +71,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders * Dolibarr version of the loaded document * @var string */ - public $version = 'development'; + public $version = 'dolibarr'; /** * @var int page_largeur @@ -328,8 +328,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders } } - - // New page $pdf->AddPage(); if (!empty($tplidx)) $pdf->useTemplate($tplidx); @@ -1364,9 +1362,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders - // If BILLING contact defined on order, we use it + // If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER' $usecontact = false; - $arrayidcontact = $object->getIdContact('external', 'BILLING'); + $arrayidcontact = $object->getIdContact('external', 'CUSTOMER'); if (count($arrayidcontact) > 0) { $usecontact = true; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php similarity index 99% rename from htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php rename to htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index a30232f0b41..8961644a2aa 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -23,7 +23,7 @@ */ /** - * \file htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php + * \file htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php * \ingroup fournisseur * \brief File of class to generate suppliers orders from muscadet model */ @@ -129,7 +129,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->db = $db; $this->name = "muscadet"; - $this->description = $langs->trans('SuppliersCommandModel'); + $this->description = $langs->trans('SuppliersCommandModelMuscadet'); // Page size for A4 format $this->type = 'pdf'; @@ -1302,7 +1302,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER' $usecontact=false; - $arrayidcontact=$object->getIdContact('external', 'CUSTOMER'); + $arrayidcontact = $object->getIdContact('external', 'CUSTOMER'); if (count($arrayidcontact) > 0) { $usecontact=true; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e03b050d693..08cd3e84909 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2953,7 +2953,7 @@ class CommandeFournisseur extends CommonOrder } } - $modelpath = "core/modules/supplier_order/pdf/"; + $modelpath = "core/modules/supplier_order/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index cebd91ee408..380d0a08860 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2649,7 +2649,7 @@ class FactureFournisseur extends CommonInvoice } else { - $modelpath = "core/modules/supplier_invoice/pdf/"; + $modelpath = "core/modules/supplier_invoice/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9cd2d3b3f1e..687dee741b3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1713,8 +1713,9 @@ ChequeReceiptsNumberingModule=Check Receipts Numbering Module MultiCompanySetup=Multi-company module setup ##### Suppliers ##### SuppliersSetup=Vendor module setup -SuppliersCommandModel=Complete template of purchase order (logo...) -SuppliersInvoiceModel=Complete template of vendor invoice (logo...) +SuppliersCommandModel=Complete template of Purchase Order +SuppliersCommandModelMuscadet=Complete template of Purchase Order (old implementation of cornas template) +SuppliersInvoiceModel=Complete template of Vendor Invoice SuppliersInvoiceNumberingModel=Vendor invoices numbering models IfSetToYesDontForgetPermission=If set to a non null value, don't forget to provide permissions to groups or users allowed for the second approval ##### GeoIPMaxmind ##### diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 83ebdece24b..c3d6ea3a303 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -512,7 +512,7 @@ RevenueStamp=Revenue stamp YouMustCreateInvoiceFromThird=This option is only available when creating an invoice from tab "Customer" of third party YouMustCreateInvoiceFromSupplierThird=This option is only available when creating an invoice from tab "Vendor" of third party YouMustCreateStandardInvoiceFirstDesc=You have to create a standard invoice first and convert it to "template" to create a new template invoice -PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (recommended Template) +PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (old implementation of Sponge template) PDFSpongeDescription=Invoice PDF template Sponge. A complete invoice template PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice template for situation invoices TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 558076ba11d..505fd0a97db 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -141,10 +141,10 @@ OrderByEMail=Email OrderByWWW=Online OrderByPhone=Phone # Documents models -PDFEinsteinDescription=A complete order model (logo...) -PDFEratostheneDescription=A complete order model (logo...) +PDFEinsteinDescription=A complete order model (old implementation of Eratosthene template) +PDFEratostheneDescription=A complete order model PDFEdisonDescription=A simple order model -PDFProformaDescription=A complete proforma invoice (logo…) +PDFProformaDescription=A complete Proforma invoice template CreateInvoiceForThisCustomer=Bill orders NoOrdersToInvoice=No orders billable CloseProcessedOrdersAutomatically=Classify "Processed" all selected orders. diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index ca88cd480d5..71d6857c909 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -76,8 +76,8 @@ TypeContact_propal_external_BILLING=Customer invoice contact TypeContact_propal_external_CUSTOMER=Customer contact following-up proposal TypeContact_propal_external_SHIPPING=Customer contact for delivery # Document models -DocModelAzurDescription=A complete proposal model (logo...) -DocModelCyanDescription=A complete proposal model (logo...) +DocModelAzurDescription=A complete proposal model (old implementation of Cyan template) +DocModelCyanDescription=A complete proposal model DefaultModelPropalCreate=Default model creation DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced) DefaultModelPropalClosed=Default template when closing a business proposal (unbilled)