From a7a8eb3648b2d0a634d76583c24249ee19924900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9onard?= Date: Sat, 4 May 2019 06:33:23 +0200 Subject: [PATCH 1/2] Add customer code in customer orders documents --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9d73384cf3a..0aada45f7f0 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1320,6 +1320,14 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date, "%d %b %Y", false, $outputlangs, true), '', 'R'); + if ($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)) { From 7ffcd3603b68331a2b5aea9e5023716433d966ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jun 2019 13:33:24 +0200 Subject: [PATCH 2/2] Add option DOC_SHOW_CUSTOMER_CODE Because we have a lot of information and the REF is better to retrieve/search an order and know the customer code, i added a hidden option to show this field. --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 0aada45f7f0..176675415c2 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1320,7 +1320,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date, "%d %b %Y", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && ! empty($object->thirdparty->code_client)) { $posy+=4; $pdf->SetXY($posx, $posy);