Laurent Destailleur 1 år sedan
förälder
incheckning
ccfaaeb03b

+ 1 - 2
htdocs/compta/facture/class/facture-rec.class.php

@@ -496,8 +496,7 @@ class FactureRec extends CommonInvoice
 		$sql .= " localtax1 = ".((float) $this->total_localtax1).",";
 		$sql .= " localtax2 = ".((float) $this->total_localtax2).",";
 		$sql .= " total_ht = ".((float) $this->total_ht).",";
-		$sql .= " total_ttc = ".((float) $this->total_ttc).",";
-		//$sql .= " remise_percent = ".((float) $this->remise_percent);
+		$sql .= " total_ttc = ".((float) $this->total_ttc);
 		// TODO Add missing fields
 		$sql .= " WHERE rowid = ".((int) $this->id);
 

+ 11 - 9
htdocs/fourn/class/fournisseur.facture-rec.class.php

@@ -273,7 +273,8 @@ class FactureFournisseurRec extends CommonInvoice
 		$now = dol_now();
 
 		// Clean parameters
-		$this->titre = empty($this->titre) ? '' : $this->titre;
+		$this->titre = empty($this->titre) ? '' : $this->titre;	// deprecated
+		$this->title = empty($this->title) ? '' : $this->title;
 		$keyforref = $this->table_ref_field;
 		$this->ref = $this->$keyforref;
 		$this->ref_supplier = empty($this->ref_supplier) ? '' : $this->ref_supplier;
@@ -327,7 +328,7 @@ class FactureFournisseurRec extends CommonInvoice
 			$sql .= ', auto_validate';
 			$sql .= ', generate_pdf';
 			$sql .= ') VALUES (';
-			$sql .= "'".$this->db->escape($this->titre)."'";
+			$sql .= "'".$this->db->escape($this->title)."'";
 			$sql .= ", '".$this->db->escape($this->ref_supplier)."'";
 			$sql .= ", ".((int) $conf->entity);
 			$sql .= ", ".((int) $facfourn_src->socid);
@@ -496,7 +497,7 @@ class FactureFournisseurRec extends CommonInvoice
 		$error = 0;
 
 		$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_rec SET";
-		$sql .= " titre = '" . (!empty($this->titre) ? $this->db->escape($this->titre) : "")."'," ;
+		$sql .= " titre = '" . (!empty($this->title) ? $this->db->escape($this->title) : "")."'," ;
 		$sql .= " ref_supplier = '". (!empty($this->ref_supplier) ? $this->db->escape($this->ref_supplier) : "")."',";
 		$sql .= " entity = ". (!empty($this->entity) ? ((int) $this->entity) : 1) . ',';
 		if ($this->fk_soc > 0) $sql .= " fk_soc = ". (int) $this->fk_soc. ',';
@@ -571,7 +572,7 @@ class FactureFournisseurRec extends CommonInvoice
 	 */
 	public function fetch($rowid, $ref = '', $ref_ext = '')
 	{
-		$sql = 'SELECT f.rowid, f.titre, f.ref_supplier, f.entity, f.fk_soc';
+		$sql = 'SELECT f.rowid, f.titre as title, f.ref_supplier, f.entity, f.fk_soc';
 		$sql .= ', f.datec, f.tms, f.suspended';
 		$sql .= ', f.libelle as label';
 		$sql .= ', f.vat_src_code, f.localtax1, f.localtax2';
@@ -605,7 +606,8 @@ class FactureFournisseurRec extends CommonInvoice
 				$keyforref = $this->table_ref_field;
 
 				$this->id                       = $obj->rowid;
-				$this->titre                    = $obj->titre;
+				$this->titre                    = $obj->title;
+				$this->title                    = $obj->title;
 				$this->ref                      = $obj->$keyforref;
 				$this->ref_supplier             = $obj->ref_supplier;
 				$this->entity                   = $obj->entity;
@@ -1375,12 +1377,12 @@ class FactureFournisseurRec extends CommonInvoice
 					$facturerec->date_last_gen = dol_now();
 					$facturerec->date_when= $facturerec->getNextDate();
 					$facturerec->update($user);
-					$this->db->commit('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->titre);
-					dol_syslog('createRecurringInvoices Process invoice template ' .$facturerec->titre. ' is finished with a success generation');
+					$this->db->commit('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->title);
+					dol_syslog('createRecurringInvoices Process invoice template ' .$facturerec->title. ' is finished with a success generation');
 					$nb_create++;
-					$this->output .= $langs->trans('InvoiceGeneratedFromTemplate', $new_fac_fourn->ref, $facturerec->titre)."\n";
+					$this->output .= $langs->trans('InvoiceGeneratedFromTemplate', $new_fac_fourn->ref, $facturerec->title)."\n";
 				} else {
-					$this->db->rollback('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->titre);
+					$this->db->rollback('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->title);
 				}
 
 				$parameters = array(

+ 1 - 1
htdocs/fourn/class/fournisseur.facture.class.php

@@ -451,7 +451,7 @@ class FactureFournisseur extends CommonInvoice
 			}
 			$this->note_public = trim($this->note_public);
 			$this->note_private = trim($this->note_private);
-			$this->note_private = dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->titre));
+			$this->note_private = dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->title));
 
 			$this->array_options = $_facrec->array_options;
 

+ 4 - 4
htdocs/fourn/facture/card-rec.php

@@ -191,7 +191,7 @@ if (empty($reshook)) {
 		if (! $error) {
 			$object->titre = GETPOST('title', 'alphanohtml'); // deprecated
 			$object->title = GETPOST('title', 'alphanohtml');
-			$object->libelle = GETPOST('libelle', 'alpha');
+			$object->libelle = GETPOST('libelle', 'alpha');	// deprecated
 			$object->label = GETPOST('libelle', 'alpha');
 			$object->fk_project = GETPOST('projectid', 'int');
 			$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
@@ -287,7 +287,7 @@ if (empty($reshook)) {
 		$result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user);
 
 		if ($result > 0) {
-			$object->titre = $title;
+			$object->titre = $title;	// deprecated
 			$object->title = $title;
 			$object->ref = $object->title;
 		} else {
@@ -1133,9 +1133,9 @@ if ($action == 'create') {
 
 		$morehtmlref = '';
 		if ($action != 'edittitle') {
-			$morehtmlref .= $form->editfieldkey($object->titre, 'title', $object->titre, $object, $usercancreate, '', '', 0, 2);
+			$morehtmlref .= $form->editfieldkey($object->title, 'title', $object->titre, $object, $usercancreate, '', '', 0, 2);
 		} else {
-			$morehtmlref .= $form->editfieldval('', 'title', $object->titre, $object, $usercancreate, 'string');
+			$morehtmlref .= $form->editfieldval('', 'title', $object->title, $object, $usercancreate, 'string');
 		}
 		$morehtmlref .= '<div class="refidno">';
 		//Ref supplier

+ 1 - 1
htdocs/fourn/facture/card.php

@@ -3263,7 +3263,7 @@ if ($action == 'create') {
 				$result = $tmptemplate->fetch($object->fk_fac_rec_source);
 				if ($result > 0) {
 					print ' <span class="opacitymediumbycolor paddingleft">';
-					$link = '<a href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$tmptemplate->id.'">'.dol_escape_htmltag($tmptemplate->titre).'</a>';
+					$link = '<a href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$tmptemplate->id.'">'.dol_escape_htmltag($tmptemplate->title).'</a>';
 					$s = $langs->transnoentities("GeneratedFromSupplierTemplate", $link);
 
 					print $s;

+ 0 - 2
htdocs/opensurvey/class/opensurveysondage.class.php

@@ -239,8 +239,6 @@ class Opensurveysondage extends CommonObject
 		}
 
 		if (!$error && !$notrigger) {
-			global $langs, $conf;
-
 			// Call trigger
 			$result = $this->call_trigger('OPENSURVEY_CREATE', $user);
 			if ($result < 0) {

+ 2 - 2
htdocs/product/stats/facturerec.php

@@ -156,7 +156,7 @@ if ($id > 0 || !empty($ref)) {
 			print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>';
 		} elseif ($user->hasRight('facture', 'lire')) {
 			$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
-			$sql .= "f.titre, f.datec, f.rowid as facid, f.suspended as suspended,";
+			$sql .= "f.titre as title, f.datec, f.rowid as facid, f.suspended as suspended,";
 			$sql .= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
 			if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
 				$sql .= ", sc.fk_soc, sc.fk_user ";
@@ -266,7 +266,7 @@ if ($id > 0 || !empty($ref)) {
 						$total_qty += $objp->qty;
 
 						$invoicestatic->id = $objp->facid;
-						$invoicestatic->ref = $objp->titre;
+						$invoicestatic->ref = $objp->title;
 						$societestatic->fetch($objp->socid);
 						$paiement = $invoicestatic->getSommePaiement();
 

+ 1 - 1
htdocs/public/opensurvey/index.php

@@ -197,7 +197,7 @@ if (is_array($results)) {
 
 			// Label
 			print $langs->trans("Label").' : ';
-			print '<b>'.dol_escape_htmltag($object->titre).'</b><br>';
+			print '<b>'.dol_escape_htmltag($object->title).'</b><br>';
 
 			// Date
 			print  $langs->trans("DateExpected").' : ';