Browse Source

Fix scrutinizer

Laurent Destailleur 3 years ago
parent
commit
308e7a3d9b
55 changed files with 112 additions and 99 deletions
  1. 1 0
      htdocs/accountancy/class/accountingaccount.class.php
  2. 2 0
      htdocs/accountancy/class/lettering.class.php
  3. 4 3
      htdocs/compta/facture/class/facture.class.php
  4. 20 0
      htdocs/core/class/commondocgenerator.class.php
  5. 16 15
      htdocs/core/class/html.form.class.php
  6. 19 9
      htdocs/core/class/html.formticket.class.php
  7. 8 0
      htdocs/core/modules/action/rapport.pdf.php
  8. 0 1
      htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php
  9. 0 1
      htdocs/core/modules/bank/doc/pdf_ban.modules.php
  10. 0 1
      htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
  11. 0 1
      htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
  12. 0 1
      htdocs/core/modules/commande/doc/pdf_einstein.modules.php
  13. 0 1
      htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
  14. 0 1
      htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
  15. 0 1
      htdocs/core/modules/contract/doc/pdf_strato.modules.php
  16. 0 1
      htdocs/core/modules/delivery/doc/pdf_storm.modules.php
  17. 0 1
      htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
  18. 0 1
      htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
  19. 8 1
      htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
  20. 0 1
      htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
  21. 0 1
      htdocs/core/modules/facture/doc/pdf_crabe.modules.php
  22. 0 1
      htdocs/core/modules/facture/doc/pdf_sponge.modules.php
  23. 0 1
      htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
  24. 0 1
      htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
  25. 13 18
      htdocs/core/modules/movement/doc/pdf_standard.modules.php
  26. 2 0
      htdocs/core/modules/movement/modules_movement.php
  27. 0 1
      htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
  28. 0 1
      htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
  29. 0 1
      htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
  30. 0 1
      htdocs/core/modules/product/doc/pdf_standard.modules.php
  31. 0 1
      htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
  32. 0 1
      htdocs/core/modules/project/doc/pdf_baleine.modules.php
  33. 0 1
      htdocs/core/modules/project/doc/pdf_beluga.modules.php
  34. 0 1
      htdocs/core/modules/project/doc/pdf_timespent.modules.php
  35. 0 1
      htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
  36. 0 1
      htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
  37. 0 1
      htdocs/core/modules/propale/doc/pdf_azur.modules.php
  38. 0 1
      htdocs/core/modules/propale/doc/pdf_cyan.modules.php
  39. 0 1
      htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
  40. 0 1
      htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
  41. 0 1
      htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
  42. 0 2
      htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
  43. 0 1
      htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
  44. 0 1
      htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
  45. 8 0
      htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
  46. 0 1
      htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
  47. 0 1
      htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
  48. 0 1
      htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
  49. 0 1
      htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
  50. 0 1
      htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php
  51. 8 8
      htdocs/product/class/product.class.php
  52. 1 1
      htdocs/public/recruitment/view.php
  53. 2 2
      htdocs/public/ticket/list.php
  54. 0 1
      htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
  55. 0 1
      htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php

+ 1 - 0
htdocs/accountancy/class/accountingaccount.class.php

@@ -748,6 +748,7 @@ class AccountingAccount extends CommonObject
 		$reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
 
 		if (empty($reshook)) {
+			$const_name = '';
 			if ($type == 'customer') {
 				$const_name = "SOLD";
 			} elseif ($type == 'supplier') {

+ 2 - 0
htdocs/accountancy/class/lettering.class.php

@@ -699,6 +699,8 @@ class Lettering extends BookKeeping
 			return $grouped_payments;
 		}
 
+		$save_payment_by_element = null;
+		$save_element_by_payment = null;
 		if ($element_id == 0) {
 			// Save list when is the begin of recursive function
 			$save_payment_by_element = $payment_by_element;

+ 4 - 3
htdocs/compta/facture/class/facture.class.php

@@ -1652,13 +1652,13 @@ class Facture extends CommonInvoice
 				0, // date_start
 				0, // date_end
 				0,
-				$lines[$i]->info_bits, // info_bits
+				0, // info_bits
 				0,
 				'HT',
 				0,
 				0, // product_type
 				1,
-				$lines[$i]->special_code,
+				0, // special_code
 				$deposit->origin,
 				0,
 				0,
@@ -5503,6 +5503,7 @@ class Facture extends CommonInvoice
 						$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
 
 						// Recipient
+						$to = '';
 						$res = $tmpinvoice->fetch_thirdparty();
 						$recipient = $tmpinvoice->thirdparty;
 						if ($res > 0) {
@@ -5524,7 +5525,7 @@ class Facture extends CommonInvoice
 							$error++;
 						}
 
-						if (!$error) {
+						if (!$error && $to) {
 							// Errors Recipient
 							$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;
 

+ 20 - 0
htdocs/core/class/commondocgenerator.class.php

@@ -65,6 +65,26 @@ abstract class CommonDocGenerator
 	 */
 	public $scandir;
 
+	public $page_hauteur;
+	public $page_largeur;
+	public $marge_gauche;
+	public $marge_droite;
+	public $marge_haute;
+	public $marge_basse;
+
+	public $option_logo;
+	public $option_tva;
+	public $option_multilang;
+	public $option_freetext;
+	public $option_draft_watermark;
+
+	public $option_modereg;
+	public $option_condreg;
+	public $option_escompte;
+	public $option_credit_note;
+
+	public $emetteur;
+
 
 	/**
 	 *	Constructor

+ 16 - 15
htdocs/core/class/html.form.class.php

@@ -466,6 +466,8 @@ class Form
 			$ext_element	= false;
 			$button_only	= false;
 			$inputOption = '';
+			$rows = '';
+			$cols = '';
 
 			if (is_object($object)) {
 				$element = $object->element;
@@ -1001,9 +1003,10 @@ class Form
 	 *  @param  string	$htmloption     		Options html on select object
 	 * 	@param	int		$forcecombo				Force to load all values and output a standard combobox (with no beautification)
 	 *  @param	array	$events					Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
+	 *  @param	array	$disableautocomplete	Disable autocomplete
 	 *  @return string           				HTML string with select and input
 	 */
-	public function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array())
+	public function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array(), $disableautocomplete = 0)
 	{
 		// phpcs:enable
 		global $conf, $langs;
@@ -1038,8 +1041,6 @@ class Form
 			$num = $this->db->num_rows($resql);
 			$i = 0;
 			if ($num) {
-				$foundselected = false;
-
 				while ($i < $num) {
 					$obj = $this->db->fetch_object($resql);
 					$incotermArray[$i]['rowid'] = $obj->rowid;
@@ -1901,6 +1902,7 @@ class Form
 	{
 		// phpcs:enable
 		global $conf, $user, $langs, $hookmanager;
+		global $action;
 
 		// If no preselected user defined, we take current user
 		if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) {
@@ -2414,6 +2416,7 @@ class Form
 
 		if (!$forcecombo) {
 			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
+			$events = array();
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
 		}
 
@@ -4192,6 +4195,7 @@ class Form
 				}
 			}
 			$out .= '>';
+			$value = '';
 			if ($format == 0) {
 				$value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
 			} elseif ($format == 1) {
@@ -6333,6 +6337,9 @@ class Form
 
 		// Analysis of the pre-selection date
 		$reg = array();
+		$shour = '';
+		$smin = '';
+		$ssec = '';
 		if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) {	// deprecated usage
 			// Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'
 			$syear	= (!empty($reg[1]) ? $reg[1] : '');
@@ -6349,10 +6356,6 @@ class Form
 				$shour = dol_print_date($set_time, "%H", $gm);
 				$smin = dol_print_date($set_time, "%M", $gm);
 				$ssec = dol_print_date($set_time, "%S", $gm);
-			} else {
-				$shour = '';
-				$smin = '';
-				$ssec = '';
 			}
 		} else {
 			// Date est '' ou vaut -1
@@ -6878,6 +6881,7 @@ class Form
 				unset($tickettmpselect);
 			}
 
+			$urloption = '';
 			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
 
 			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
@@ -7020,16 +7024,11 @@ class Form
 	protected function constructTicketListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '')
 	{
 		$outkey = '';
-		$outval = '';
 		$outref = '';
-		$outlabel = '';
 		$outtype = '';
 
-		$label = $objp->label;
-
 		$outkey = $objp->rowid;
 		$outref = $objp->ref;
-		$outlabel = $objp->label;
 		$outtype = $objp->fk_product_type;
 
 		$opt = '<option value="'.$objp->rowid.'"';
@@ -7038,10 +7037,9 @@ class Form
 		$opt .= $objp->ref;
 		$objRef = $objp->ref;
 		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
-		$outval .= $objRef;
 
 		$opt .= "</option>\n";
-		$optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem);
+		$optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtype);
 	}
 
 	/**
@@ -7648,6 +7646,7 @@ class Form
 
 		$out = '';
 		$outarray = array();
+		$tmparray = array();
 
 		$num = 0;
 
@@ -9353,10 +9352,12 @@ class Form
 		global $conf, $user, $langs;
 
 		// Permettre l'exclusion de groupes
+		$excludeGroups = null;
 		if (is_array($exclude)) {
 			$excludeGroups = implode(",", $exclude);
 		}
 		// Permettre l'inclusion de groupes
+		$includeGroups = null;
 		if (is_array($include)) {
 			$includeGroups = implode(",", $include);
 		}
@@ -9920,7 +9921,7 @@ class Form
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
 						$out .= '>' . $labeltoshow . '</option>';
 					} else {
-						if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
+						if ($disabled && ($selected != $obj->rowid)) {
 							$resultat = '';
 						} else {
 							$resultat = '<option value="' . $obj->rowid . '"';

+ 19 - 9
htdocs/core/class/html.formticket.class.php

@@ -73,6 +73,7 @@ class FormTicket
 	public $ispublic; // To show information or not into public form
 
 	public $withtitletopic;
+	public $withtopicreadonly;
 	public $withcompany; // affiche liste déroulante company
 	public $withfromsocid;
 	public $withfromcontactid;
@@ -84,6 +85,11 @@ class FormTicket
 
 	public $withcancel;
 
+	public $type_code;
+	public $category_code;
+	public $severity_code;
+
+
 	/**
 	 *
 	 * @var array $substit Substitutions
@@ -113,7 +119,7 @@ class FormTicket
 		$this->withcompany = $conf->societe->enabled ? 1 : 0;
 		$this->withfromsocid = 0;
 		$this->withfromcontactid = 0;
-		//$this->withthreadid=0;
+		//$this->withreadid=0;
 		//$this->withtitletopic='';
 		$this->withnotifytiersatcreate = 0;
 		$this->withusercreate = 1;
@@ -280,6 +286,7 @@ class FormTicket
 		}
 
 		// If ticket created from another object
+		$subelement = '';
 		if (isset($this->param['origin']) && $this->param['originid'] > 0) {
 			// Parse element/subelement (ex: project_task)
 			$element = $subelement = $this->param['origin'];
@@ -331,8 +338,8 @@ class FormTicket
 				print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title;
 				print '</td></tr>';
 			} else {
-				if ($this->withthreadid > 0) {
-					$subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withthreadid.' : '.$this->topic_title.'';
+				if ($this->withreadid > 0) {
+					$subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.'';
 				}
 				print '<input class="text minwidth500" id="subject" name="subject" value="'.(GETPOST('subject', 'alpha') ? GETPOST('subject', 'alpha') : $subject).'" autofocus />';
 				print '</td></tr>';
@@ -628,11 +635,11 @@ class FormTicket
 
 		print '<br>';
 
-		print $form->buttonsSaveCancel((($this->withthreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));
+		print $form->buttonsSaveCancel((($this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));
 
 		/*
 		print '<div class="center">';
-		print '<input type="submit" class="button" name="add" value="'.$langs->trans(($this->withthreadid > 0 ? "SendResponse" : "CreateTicket")).'" />';
+		print '<input type="submit" class="button" name="add" value="'.$langs->trans(($this->withreadid > 0 ? "SendResponse" : "CreateTicket")).'" />';
 		if ($this->withcancel) {
 			print " &nbsp; &nbsp; &nbsp;";
 			print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
@@ -1365,6 +1372,9 @@ class FormTicket
 
 		// External users can't send message email
 		if ($user->rights->ticket->write && !$user->socid) {
+			$ticketstat = new Ticket($this->db);
+			$res = $ticketstat->fetch('', '', $this->track_id);
+
 			print '<tr><td></td><td>';
 			$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':''));
 			print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
@@ -1395,18 +1405,18 @@ class FormTicket
 
 			// Subject
 			print '<tr class="email_line"><td>'.$langs->trans('Subject').'</td>';
-			print '<td><input type="text" class="text minwidth500" name="subject" value="['.$conf->global->MAIN_INFO_SOCIETE_NOM.' - '.$langs->trans("Ticket").' '.$this->ref.'] '.$langs->trans('TicketNewMessage').'" />';
+			print '<td><input type="text" class="text minwidth500" name="subject" value="['.$conf->global->MAIN_INFO_SOCIETE_NOM.' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$langs->trans('TicketNewMessage').'" />';
 			print '</td></tr>';
 
 			// Destinataires
 			print '<tr class="email_line"><td>'.$langs->trans('MailRecipients').'</td><td>';
-			$ticketstat = new Ticket($this->db);
-			$res = $ticketstat->fetch('', '', $this->track_id);
 			if ($res) {
 				// Retrieve email of all contacts (internal and external)
 				$contacts = $ticketstat->getInfosTicketInternalContact();
 				$contacts = array_merge($contacts, $ticketstat->getInfosTicketExternalContact());
 
+				$sendto = array();
+
 				// Build array to display recipient list
 				if (is_array($contacts) && count($contacts) > 0) {
 					foreach ($contacts as $key => $info_sendto) {
@@ -1416,7 +1426,7 @@ class FormTicket
 					}
 				}
 
-				if ($ticketstat->origin_email && !in_array($this->dao->origin_email, $sendto)) {
+				if ($ticketstat->origin_email && !in_array($ticketstat->origin_email, $sendto)) {
 					$sendto[] = dol_escape_htmltag($ticketstat->origin_email).' <small class="opacitymedium">('.$langs->trans("TicketEmailOriginIssuer").")</small>";
 				}
 

+ 8 - 0
htdocs/core/modules/action/rapport.pdf.php

@@ -63,6 +63,14 @@ class CommActionRapport
 
 	public $marge_basse;
 
+	public $format;
+
+	public $type;
+
+	public $page_hauteur;
+
+	public $page_largeur;
+
 
 	/**
 	 * Constructor

+ 0 - 1
htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php

@@ -89,7 +89,6 @@ class doc_generic_asset_odt extends ModelePDFAsset
 		$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/bank/doc/pdf_ban.modules.php

@@ -74,7 +74,6 @@ class pdf_ban extends ModeleBankAccountDoc
 
 		$this->option_logo = 1; // Display logo FAC_PDF_LOGO
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
-		$this->option_codeproduitservice = 1; // Display product-service code
 
 		// Retrieves transmitter
 		$this->emetteur = $mysoc;

+ 0 - 1
htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php

@@ -79,7 +79,6 @@ class pdf_sepamandate extends ModeleBankAccountDoc
 
 		$this->option_logo = 1; // Display logo FAC_PDF_LOGO
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
-		$this->option_codeproduitservice = 1; //Display product-service code
 
 		// Retrieves transmitter
 		$this->emetteur = $mysoc;

+ 0 - 1
htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php

@@ -90,7 +90,6 @@ class doc_generic_order_odt extends ModelePDFCommandes
 		$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/commande/doc/pdf_einstein.modules.php

@@ -158,7 +158,6 @@ class pdf_einstein extends ModelePDFCommandes
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php

@@ -163,7 +163,6 @@ class pdf_eratosthene extends ModelePDFCommandes
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php

@@ -88,7 +88,6 @@ class doc_generic_contract_odt extends ModelePDFContract
 		$this->option_tva = 0; // Manage the vat CONTRACT_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/contract/doc/pdf_strato.modules.php

@@ -154,7 +154,6 @@ class pdf_strato extends ModelePDFContract
 		$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 0; // Available in several languages
 		$this->option_draft_watermark = 1; // Support add of a watermark on drafts
 

+ 0 - 1
htdocs/core/modules/delivery/doc/pdf_storm.modules.php

@@ -147,7 +147,6 @@ class pdf_storm extends ModelePDFDeliveryOrder
 
 		$this->option_logo = 1; // Display logo FAC_PDF_LOGO
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
-		$this->option_codeproduitservice = 1; // Display product-service code
 
 		// Get source company
 		$this->emetteur = $mysoc;

+ 0 - 1
htdocs/core/modules/delivery/doc/pdf_typhon.modules.php

@@ -146,7 +146,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
 
 		$this->option_logo = 1; // Display logo FAC_PDF_LOGO
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
-		$this->option_codeproduitservice = 1; // Display product-service code
 
 		// Get source company
 		$this->emetteur = $mysoc;

+ 0 - 1
htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php

@@ -90,7 +90,6 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
 		$this->option_tva = 0; // Manage the vat option EXPEDITION_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 8 - 1
htdocs/core/modules/expensereport/doc/pdf_standard.modules.php

@@ -122,6 +122,14 @@ class pdf_standard extends ModeleExpenseReport
 	 */
 	public $emetteur;
 
+	public $posxpiece;
+	public $posxcomment;
+	public $posxtva;
+	public $posxup;
+	public $posxqty;
+	public $postotalht;
+	public $postotalttc;
+
 
 	/**
 	 *  Constructor
@@ -155,7 +163,6 @@ class pdf_standard extends ModeleExpenseReport
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php

@@ -89,7 +89,6 @@ class doc_generic_invoice_odt extends ModelePDFFactures
 		$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/facture/doc/pdf_crabe.modules.php

@@ -164,7 +164,6 @@ class pdf_crabe extends ModelePDFFactures
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 1; // Displays if there has been a discount
 		$this->option_credit_note = 1; // Support credit notes

+ 0 - 1
htdocs/core/modules/facture/doc/pdf_sponge.modules.php

@@ -165,7 +165,6 @@ class pdf_sponge extends ModelePDFFactures
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 1; // Displays if there has been a discount
 		$this->option_credit_note = 1; // Support credit notes

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

@@ -146,7 +146,6 @@ class pdf_soleil extends ModelePDFFicheinter
 		$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_draft_watermark = 1; // Support add of a watermark on drafts
 

+ 0 - 1
htdocs/core/modules/member/doc/doc_generic_member_odt.class.php

@@ -85,7 +85,6 @@ class doc_generic_member_odt extends ModelePDFMember
 		$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 13 - 18
htdocs/core/modules/movement/doc/pdf_standard.modules.php

@@ -110,6 +110,19 @@ class pdf_standard extends ModelePDFMovement
 	public $emetteur;
 
 
+	public $wref;
+	public $posxidref;
+	public $posxdatemouv;
+	public $posxdesc;
+	public $posxlabel;
+	public $posxtva;
+	public $posxqty;
+	public $posxup;
+	public $posxunit;
+	public $posxdiscount;
+	public $postotalht;
+
+
 	/**
 	 *	Constructor
 	 *
@@ -174,11 +187,6 @@ class pdf_standard extends ModelePDFMovement
 			$this->posxdiscount -= 20;
 			$this->postotalht -= 20;
 		}
-		$this->tva = array();
-		$this->localtax1 = array();
-		$this->localtax2 = array();
-		$this->atleastoneratenotnull = 0;
-		$this->atleastonediscount = 0;
 	}
 
 
@@ -395,19 +403,6 @@ class pdf_standard extends ModelePDFMovement
 				}
 
 				$num = $this->db->num_rows($resql);
-
-				$arrayofselected = is_array($toselect) ? $toselect : array();
-
-				$i = 0;
-				$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
-				if ($msid) {
-					$texte = $langs->trans('StockMovementForId', $msid);
-				} else {
-					$texte = $langs->trans("ListOfStockMovements");
-					if ($id) {
-						$texte .= ' ('.$langs->trans("ForThisWarehouse").')';
-					}
-				}
 			}
 
 			// Definition of $dir and $file

+ 2 - 0
htdocs/core/modules/movement/modules_movement.php

@@ -35,6 +35,8 @@ abstract class ModelePDFMovement extends CommonDocGenerator
 	 */
 	public $error = '';
 
+	public $option_codestockservice;
+
 
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
 	/**

+ 0 - 1
htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php

@@ -89,7 +89,6 @@ class doc_generic_mo_odt extends ModelePDFMo
 		$this->option_tva = 0; // Manage the vat option
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/mrp/doc/pdf_vinci.modules.php

@@ -150,7 +150,6 @@ class pdf_vinci extends ModelePDFMo
 		$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
 
 		$this->option_logo = 1; // Display logo
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; //Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php

@@ -87,7 +87,6 @@ class doc_generic_product_odt extends ModelePDFProduct
 		$this->option_tva = 0; // Manage the vat option PRODUCT_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/product/doc/pdf_standard.modules.php

@@ -138,7 +138,6 @@ class pdf_standard extends ModelePDFProduct
 		$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
 
 		$this->option_logo = 1; // Display logo
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_freetext = 0; // Support add of a personalised text
 

+ 0 - 1
htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php

@@ -124,7 +124,6 @@ class doc_generic_project_odt extends ModelePDFProjects
 		$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/project/doc/pdf_baleine.modules.php

@@ -146,7 +146,6 @@ class pdf_baleine extends ModelePDFProjects
 
 		$this->option_logo = 1; // Display logo FAC_PDF_LOGO
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
-		$this->option_codeproduitservice = 1; // Display product-service code
 
 		// Get source company
 		$this->emetteur = $mysoc;

+ 0 - 1
htdocs/core/modules/project/doc/pdf_beluga.modules.php

@@ -174,7 +174,6 @@ class pdf_beluga extends ModelePDFProjects
 
 		$this->option_logo = 1; // Display logo FAC_PDF_LOGO
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
-		$this->option_codeproduitservice = 1; // Display product-service code
 
 		// Get source company
 		$this->emetteur = $mysoc;

+ 0 - 1
htdocs/core/modules/project/doc/pdf_timespent.modules.php

@@ -145,7 +145,6 @@ class pdf_timespent extends ModelePDFProjects
 
 		$this->option_logo = 1; // Display logo FAC_PDF_LOGO
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
-		$this->option_codeproduitservice = 1; // Display product-service code
 
 		// Get source company
 		$this->emetteur = $mysoc;

+ 0 - 1
htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php

@@ -125,7 +125,6 @@ class doc_generic_task_odt extends ModelePDFTask
 		$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 0; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php

@@ -87,7 +87,6 @@ class doc_generic_proposal_odt extends ModelePDFPropales
 		$this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/propale/doc/pdf_azur.modules.php

@@ -154,7 +154,6 @@ class pdf_azur extends ModelePDFPropales
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/propale/doc/pdf_cyan.modules.php

@@ -157,7 +157,6 @@ class pdf_cyan extends ModelePDFPropales
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php

@@ -83,7 +83,6 @@ class doc_generic_reception_odt extends ModelePdfReception
 		$this->option_tva = 0; // Manage the vat option RECEPTION_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php

@@ -86,7 +86,6 @@ class doc_generic_stock_odt extends ModelePDFStock
 		$this->option_tva = 0; // Manage the vat option STOCK_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php

@@ -150,7 +150,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 
 		// Define column position

+ 0 - 2
htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php

@@ -90,8 +90,6 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
 		$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
-		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes
 		$this->option_freetext = 1; // Support add of a personalised text

+ 0 - 1
htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php

@@ -152,7 +152,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; //Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php

@@ -152,7 +152,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 8 - 0
htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php

@@ -117,6 +117,14 @@ class pdf_standard extends ModelePDFSuppliersPayments
 	 */
 	public $emetteur;
 
+	public $posxdate;
+	public $posxreffacturefourn;
+	public $posxreffacture;
+	public $posxtype;
+	public $posxtotalht;
+	public $posxtva;
+	public $posxtotalttc;
+
 
 	/**
 	 *	Constructor

+ 0 - 1
htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php

@@ -88,7 +88,6 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
 		$this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php

@@ -149,7 +149,6 @@ class pdf_aurore extends ModelePDFSupplierProposal
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 1; // Displays if there has been a discount
 		$this->option_credit_note = 1; // Support credit notes

+ 0 - 1
htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php

@@ -85,7 +85,6 @@ class doc_generic_user_odt extends ModelePDFUser
 		$this->option_tva = 0; // Manage the vat option USER_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php

@@ -88,7 +88,6 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
 		$this->option_tva = 0; // Manage the vat option USERGROUP_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php

@@ -89,7 +89,6 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
 		$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 8 - 8
htdocs/product/class/product.class.php

@@ -2303,6 +2303,7 @@ class Product extends CommonObject
 		//PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
 		$separatedEntityPMP = false;	// Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
 		$separatedStock = false;		// Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
+		$visibleWarehousesEntities = $conf->entity;
 		if (!empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED)) {
 			if (!empty($conf->global->MULTICOMPANY_PMP_PER_ENTITY_ENABLED)) {
 				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
@@ -2312,7 +2313,6 @@ class Product extends CommonObject
 			}
 			global $mc;
 			$separatedStock = true;
-			$visibleWarehousesEntities = $conf->entity;
 			if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) {
 				$visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']);
 			}
@@ -2746,7 +2746,7 @@ class Product extends CommonObject
 	public function load_stats_bom($socid = 0)
 	{
 		// phpcs:enable
-		global $user, $hookmanager;
+		global $user, $hookmanager, $action;
 
 		$error = 0;
 
@@ -2815,7 +2815,7 @@ class Product extends CommonObject
 	public function load_stats_propale($socid = 0)
 	{
 		// phpcs:enable
-		global $conf, $user, $hookmanager;
+		global $conf, $user, $hookmanager, $action;
 
 		$sql = "SELECT COUNT(DISTINCT p.fk_soc) as nb_customers, COUNT(DISTINCT p.rowid) as nb,";
 		$sql .= " COUNT(pd.rowid) as nb_rows, SUM(pd.qty) as qty";
@@ -2946,7 +2946,7 @@ class Product extends CommonObject
 	public function load_stats_commande($socid = 0, $filtrestatut = '', $forVirtualStock = 0)
 	{
 		// phpcs:enable
-		global $conf, $user, $hookmanager;
+		global $conf, $user, $hookmanager, $action;
 
 		$sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,";
 		$sql .= " COUNT(cd.rowid) as nb_rows, SUM(cd.qty) as qty";
@@ -3106,7 +3106,7 @@ class Product extends CommonObject
 	public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $filterShipmentStatus = '')
 	{
 		// phpcs:enable
-		global $conf, $user, $hookmanager;
+		global $conf, $user, $hookmanager, $action;
 
 		$sql = "SELECT COUNT(DISTINCT e.fk_soc) as nb_customers, COUNT(DISTINCT e.rowid) as nb,";
 		$sql .= " COUNT(ed.rowid) as nb_rows, SUM(ed.qty) as qty";
@@ -3248,7 +3248,7 @@ class Product extends CommonObject
 	public function load_stats_inproduction($socid = 0, $filtrestatut = '', $forVirtualStock = 0)
 	{
 		// phpcs:enable
-		global $conf, $user, $hookmanager;
+		global $conf, $user, $hookmanager, $action;
 
 		$sql = "SELECT COUNT(DISTINCT m.fk_soc) as nb_customers, COUNT(DISTINCT m.rowid) as nb,";
 		$sql .= " COUNT(mp.rowid) as nb_rows, SUM(mp.qty) as qty, role";
@@ -3341,7 +3341,7 @@ class Product extends CommonObject
 	public function load_stats_contrat($socid = 0)
 	{
 		// phpcs:enable
-		global $conf, $user, $hookmanager;
+		global $conf, $user, $hookmanager, $action;
 
 		$sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,";
 		$sql .= " COUNT(cd.rowid) as nb_rows, SUM(cd.qty) as qty";
@@ -3415,7 +3415,7 @@ class Product extends CommonObject
 	public function load_stats_facture($socid = 0)
 	{
 		// phpcs:enable
-		global $db, $conf, $user, $hookmanager;
+		global $db, $conf, $user, $hookmanager, $action;
 
 		$sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,";
 		$sql .= " COUNT(fd.rowid) as nb_rows, SUM(".$this->db->ifsql('f.type != 2', 'fd.qty', 'fd.qty * -1').") as qty";

+ 1 - 1
htdocs/public/recruitment/view.php

@@ -121,7 +121,7 @@ if ($action == "view" || $action == "presend" || $action == "close" || $action =
 	if (!$error && $action == "add_message" && $display_ticket && GETPOSTISSET('btn_add_message'))
 	{
 		// TODO Add message...
-		$ret = $object->dao->newMessage($user, $action, 0, 1);
+		$ret = $object->newMessage($user, $action, 0, 1);
 
 
 

+ 2 - 2
htdocs/public/ticket/list.php

@@ -362,7 +362,7 @@ if ($action == "view_ticketlist") {
 		}
 		$sql .= " WHERE t.entity IN (".getEntity('ticket').")";
 		$sql .= " AND ((tc.source = 'external'";
-		$sql .= " AND tc.element='".$db->escape($object->dao->element)."'";
+		$sql .= " AND tc.element='".$db->escape($object->element)."'";
 		$sql .= " AND tc.active=1)";
 		$sql .= " OR (sp.email='".$db->escape($_SESSION['email_customer'])."'";
 		$sql .= " OR s.email='".$db->escape($_SESSION['email_customer'])."'";
@@ -706,7 +706,7 @@ if ($action == "view_ticketlist") {
 			}
 		}
 	} else {
-		print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.'">'.$langs->trans('Back').'</a></div>';
+		print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'">'.$langs->trans('Back').'</a></div>';
 	}
 } else {
 	print '<p class="center">'.$langs->trans("TicketPublicMsgViewLogIn").'</p>';

+ 0 - 1
htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php

@@ -89,7 +89,6 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
 		$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
 		$this->option_modereg = 0; // Display payment mode
 		$this->option_condreg = 0; // Display payment terms
-		$this->option_codeproduitservice = 0; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 0; // Displays if there has been a discount
 		$this->option_credit_note = 0; // Support credit notes

+ 0 - 1
htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php

@@ -165,7 +165,6 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
 		$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
 		$this->option_modereg = 1; // Display payment mode
 		$this->option_condreg = 1; // Display payment terms
-		$this->option_codeproduitservice = 1; // Display product-service code
 		$this->option_multilang = 1; // Available in several languages
 		$this->option_escompte = 1; // Displays if there has been a discount
 		$this->option_credit_note = 1; // Support credit notes