Browse Source

add Ref client in PDF and send to propal on create

Florian HENRY 3 years ago
parent
commit
8af848c539

+ 1 - 1
htdocs/comm/propal/card.php

@@ -1644,7 +1644,7 @@ if ($action == 'create') {
 
 	// Ref customer
 	print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
-	print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
+	print '<input type="text" name="ref_client" value="'.(!empty($ref_client)?$ref_client:GETPOST('ref_client')).'"></td>';
 	print '</tr>';
 
 	// Third party

+ 8 - 0
htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php

@@ -612,6 +612,14 @@ class pdf_soleil extends ModelePDFFicheinter
 		$pdf->SetTextColor(0, 0, 60);
 		$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->datec, "day", false, $outputlangs, true), '', 'R');
 
+		if (!empty($object->ref_client)) {
+			$posy += 4;
+			$pdf->SetXY($posx, $posy);
+			$pdf->SetTextColor(0, 0, 60);
+			$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer") . " : " . dol_trunc($outputlangs->convToOutputCharset($object->ref_client), 65), '', 'R');
+		}
+
+
 		if (empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) {
 			$posy += 4;
 			$pdf->SetXY($posx, $posy);