Browse Source

Fix bold expe use option

Mathieu Moulin 2 months ago
parent
commit
dc43d8a613
3 changed files with 9 additions and 5 deletions
  1. 1 0
      admin/setup.php
  2. 7 5
      class/actions_mmiworkflow.class.php
  3. 1 0
      langs/fr_FR/mmiworkflow.lang

+ 1 - 0
admin/setup.php

@@ -46,6 +46,7 @@ $arrayofparameters = array(
 	'SHIPPING_PDF_ANTIGASPI'=>array('type'=>'yesno','enabled'=>1), // MMI Hack
 	'MAIN_GENERATE_SHIPMENT_WITH_PICTURE'=>array('type'=>'yesno','enabled'=>1),
 	'MMI_SHIPPING_PDF_MESSAGE'=>array('type'=>'html','enabled'=>1),
+	'MMI_SHIPPING_PDF_LABEL_BOLD'=>array('type'=>'yesno','enabled'=>1),
 	'MMI_ORDER_SET_EXPE_OK'=>array('type'=>'yesno','enabled'=>1),
 
 	'MMI_INVOICE_DRAFTIFY'=>array('type'=>'yesno', 'enabled'=>1),

+ 7 - 5
class/actions_mmiworkflow.class.php

@@ -324,13 +324,15 @@ class ActionsMMIWorkflow extends MMI_Actions_1_0
 
 		$object_type = get_class($object);
 		//var_dump($object_type); die();
-
-		if ($this->in_context($parameters, 'pdfgeneration') && $object_type=='Expedition') {
+		if (!empty($conf->global->MMI_SHIPPING_PDF_LABEL_BOLD) && $this->in_context($parameters, 'pdfgeneration') && $object_type=='Expedition') {
 			$i = $parameters['i'];
 			//$object = $parameters['object'];
-			$object->lines[$i]->ref = '<b>'.$object->lines[$i]->ref.'</b>';
-			$object->lines[$i]->product_ref = '<b>'.$object->lines[$i]->product_ref.'</b>';
-			$object->lines[$i]->label = '<b>'.$object->lines[$i]->label.'</b>';
+			if ($object->lines[$i]->ref)
+				$object->lines[$i]->ref = '<b>'.$object->lines[$i]->ref.'</b>';
+			if ($object->lines[$i]->product_ref)
+				$object->lines[$i]->product_ref = '<b>'.$object->lines[$i]->product_ref.'</b>';
+			if ($object->lines[$i]->label)
+				$object->lines[$i]->label = '<b>'.$object->lines[$i]->label.'</b>';
 			//var_dump($object->lines[$i]->label); die();
 			//var_dump($object->lines[$i]); die();
 			//var_dump('yo'); die();

+ 1 - 0
langs/fr_FR/mmiworkflow.lang

@@ -53,6 +53,7 @@ MMI_VAT_TX_FIX = Bouton pour corriger les erreurs de synchro de TVA
 SFY_ALERT_ORDER_NOT_SHIPPED = Activer une alerte sur la liste des expeditions si il existe des commandes validées
 MMI_MOVEMENT_LIST_ENHANCE = AJouter des informations (client, commande...) dans le liste des mouvements de stock
 SFYCUSTOM_LOCK = Bloquer la validation des commandes si lignes libres
+MMI_SHIPPING_PDF_LABEL_BOLD = Libellés des expéditions en gras
 
 #
 # Extrafields