Selaa lähdekoodia

Merge branch '19.0-mmi' of gogs.iprospective.fr:iProspective/Dolibarr into 19.0-mmi

Mathieu Moulin 1 vuosi sitten
vanhempi
commit
6a4c0fcbf4

+ 2 - 2
.gitmodules

@@ -65,7 +65,7 @@
 [submodule "htdocs/custom/mmiproject"]
 	path = htdocs/custom/mmiproject
 	url = git@gogs.iprospective.fr:iProspective/dolibarr-module-mmiproject.git
-	branch = 18.0
+	branch = 19.0
 [submodule "htdocs/custom/mmistats"]
 	path = htdocs/custom/mmistats
 	url = git@gogs.iprospective.fr:iProspective/dolibarr-module-mmistats.git
@@ -81,7 +81,7 @@
 [submodule "htdocs/custom/mmishipping"]
 	path = htdocs/custom/mmishipping
 	url = git@gogs.iprospective.fr:iProspective/dolibarr-module-mmishipping.git
-	branch = 16.0
+	branch = 19.0
 [submodule "htdocs/custom/abricot"]
 	path = htdocs/custom/abricot
 	url = git@gogs.iprospective.fr:iProspective/dolibarr-module-abricot.git

+ 4 - 3
htdocs/core/lib/pdf.lib.php

@@ -1508,7 +1508,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
 
 	$idprod = (!empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false);
 	// MMI Hack : Trim & Strip tags to be sure
-	$label = (!empty(trim(strip_tags($object->lines[$i]->label))) ? '<b>'.$object->lines[$i]->label.'</b>' : (!empty($object->lines[$i]->product_label) ? '<b>'.$object->lines[$i]->product_label.'</b>' : ''));
+	$label = (!empty(trim(strip_tags($object->lines[$i]->label))) ? $object->lines[$i]->label : (!empty($object->lines[$i]->product_label) ? $object->lines[$i]->product_label : ''));
 	$product_barcode = (!empty($object->lines[$i]->product_barcode) ? $object->lines[$i]->product_barcode : "");
 	$desc = (!empty($object->lines[$i]->desc) ? $object->lines[$i]->desc : (!empty($object->lines[$i]->description) ? $object->lines[$i]->description : ''));
 	$ref_supplier = (!empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '')); // TODO Not yet saved for supplier invoices, only supplier orders
@@ -2480,11 +2480,12 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
 					$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
 					$progress = ($object->lines[$i]->situation_percent - $prev_progress) / 100;
 				}
-				$result .= price($sign * ($total_ht / ($object->lines[$i]->situation_percent / 100)) * $progress, 0, $outputlangs);
+				$result .= price($sign * ($total_ht / ($object->lines[$i]->situation_percent / 100)) * $progress, 0, $outputlangs, 1, -1, 'MT');
 			} else {
-				$result .= price($sign * $total_ht, 0, $outputlangs);
+				$result .= price($sign * $total_ht, 0, $outputlangs, 1, -1, 'MT');
 			}
 		}
+		//var_dump($result); echo '<br />';
 	}
 	return $result;
 }

+ 35 - 2
htdocs/core/modules/reception/doc/pdf_squille.modules.php

@@ -1000,7 +1000,40 @@ class pdf_squille extends ModelePdfReception
 				$carac_emetteur .= "\n";
 			}
 
-			$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
+			// MMI Hack adresse réception
+			// Entrepôt réception
+			//var_dump($object->array_options);
+			if (getDolGlobalInt('MMI_RECEPTION_SENDER_ADDRESS') && !empty($object->array_options['options_fk_entrepot'])) {
+				require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
+
+				$entrepot = new Entrepot($this->db);
+				$entrepot->fetch($object->array_options['options_fk_entrepot']);
+				
+				$nom_emetteur = $entrepot->lieu;
+				$carac_emetteur .= $entrepot->address."\r\n";
+				$carac_emetteur .= $entrepot->zip.' '.$entrepot->town."\r\n";
+				$carac_emetteur .= $entrepot->country;
+			}
+			// Adresse client réception (direct fournisseur)
+			elseif (getDolGlobalInt('MMI_RECEPTION_SENDER_ADDRESS') && !empty($object->array_options['options_fk_adresse'])) {
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+
+				$contact = new Contact($this->db);
+				$contact->fetch($object->array_options['options_fk_adresse']);
+
+				$nom_emetteur = $contact->lastname.' '.$contact->firstname;
+				$carac_emetteur .= $contact->address."\r\n";
+				$carac_emetteur .= $contact->zip.' '.$contact->town."\r\n";
+				$carac_emetteur .= $contact->country;
+			}
+			// 
+			else {
+				$nom_emetteur = $this->emetteur->name;
+				$carac_emetteur .= getDolGlobalString('MAIN_INFO_SOCIETE_ADDRESS');
+			}
+
+			// le thitrdparty n'a rien à faire ici, c'est plutôt le user !
+			//$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
 
 			// Show sender
 			$posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
@@ -1078,7 +1111,7 @@ class pdf_squille extends ModelePdfReception
 			// Show sender name
 			$pdf->SetXY($posx + 2, $posy + 3);
 			$pdf->SetFont('', 'B', $default_font_size);
-			$pdf->MultiCell($widthrecbox, 2, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
+			$pdf->MultiCell($widthrecbox, 2, $outputlangs->convToOutputCharset($nom_emetteur), 0, 'L');
 			$posy = $pdf->getY();
 
 			// Show sender information

+ 1 - 1
htdocs/custom/mmiproduct

@@ -1 +1 @@
-Subproject commit 7531b8f1acfaab9686893c447ce7c1f242e51ad7
+Subproject commit da6dafd321bdb7cef7fd4790817a08eac03ab5ae

+ 1 - 1
htdocs/custom/mmiproject

@@ -1 +1 @@
-Subproject commit 63a1c52897122f9c9006637080bb0b2ef975e14f
+Subproject commit 81fa6c709c5eeab107eba9d3cf75f7cbb23b7325

+ 1 - 1
htdocs/custom/mmishipping

@@ -1 +1 @@
-Subproject commit 11acc8c2eeecb8754d3c156ec867c34b8db0c7ef
+Subproject commit 8d7d3811545c29244903a725ead95aa42eaf236d

+ 1 - 1
htdocs/custom/subtotal

@@ -1 +1 @@
-Subproject commit 46b6d35a8b434efc46aec9065788fca89b6ca34c
+Subproject commit 5a501003cbe1d8e5fe92e1d38a7ede54e2d4818b