Browse Source

Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/class/html.form.class.php
Laurent Destailleur 3 years ago
parent
commit
bb6f73136a

+ 2 - 2
htdocs/categories/viewcat.php

@@ -734,9 +734,9 @@ if ($type == Categorie::TYPE_MEMBER) {
 			print '<input type="hidden" name="action" value="addintocategory">';
 			print '<table class="noborder centpercent">';
 			print '<tr class="liste_titre"><td>';
-			print $langs->trans("AddMemberIntoCategory").' &nbsp;';
+			print $langs->trans("AssignCategoryTo").' &nbsp;';
 			print $form->selectMembers('', 'elemid');
-			print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
+			print '<input type="submit" class="button buttongen" value="'.$langs->trans("Save").'"></td>';
 			print '</tr>';
 			print '</table>';
 			print '</form>';

+ 26 - 22
htdocs/core/class/html.form.class.php

@@ -7226,6 +7226,8 @@ class Form
 				unset($adherenttmpselect);
 			}
 
+			$urloption = '';
+
 			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
 
 			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
@@ -7240,7 +7242,9 @@ class Form
 				$out .= img_picto($langs->trans("Search"), 'search');
 			}
 		} else {
-			$out .= $this->selectMembersList($selected, $htmlname, $filtertype, $limit, $status, 0, $socid, $showempty, $forcecombo, $morecss);
+			$filterkey = '';
+
+			$out .= $this->selectMembersList($selected, $htmlname, $filtertype, $limit, $filterkey, $status, 0, $showempty, $forcecombo, $morecss);
 		}
 
 		if (empty($nooutput)) print $out;
@@ -7255,8 +7259,8 @@ class Form
 	 *	@param      string	$htmlname           Name of select html
 	 *  @param		string	$filtertype         Filter on adherent type
 	 *	@param      int		$limit              Limit on number of returned lines
-	 * 	@param      string	$filterkey          Filter on adherent ref or subject
-	 *	@param		int		$status             Ticket status
+	 * 	@param      string	$filterkey          Filter on member status
+	 *	@param		int		$status             Member status
 	 *  @param      int		$outputmode         0=HTML select string, 1=Array
 	 *  @param		string	$showempty		    '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
 	 * 	@param		int		$forcecombo		    Force to use combo box
@@ -7270,7 +7274,7 @@ class Form
 		$out = '';
 		$outarray = array();
 
-		$selectFields = " p.rowid, p.ref";
+		$selectFields = " p.rowid, p.ref, p.firstname, p.lastname";
 
 		$sql = "SELECT ";
 		$sql .= $selectFields;
@@ -7280,21 +7284,23 @@ class Form
 		// Add criteria on ref/label
 		if ($filterkey != '') {
 			$sql .= ' AND (';
-			$prefix = empty($conf->global->TICKET_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
+			$prefix = empty($conf->global->MEMBER_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
 			// For natural search
 			$scrit = explode(' ', $filterkey);
 			$i = 0;
 			if (count($scrit) > 1) $sql .= "(";
 			foreach ($scrit as $crit) {
 				if ($i > 0) $sql .= " AND ";
-				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
-				$sql .= "";
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
 				$i++;
 			}
 			if (count($scrit) > 1) $sql .= ")";
 			$sql .= ')';
 		}
-
+		if ($status != -1) {
+			$sql .= ' AND statut = '.((int) $status);
+		}
 		$sql .= $this->db->plimit($limit, 0);
 
 		// Build output string
@@ -7324,7 +7330,9 @@ class Form
 			} else {
 				if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
 			}
-			if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>';
+			if ($showempty) {
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
+			}
 
 			$i = 0;
 			while ($num && $i < $num) {
@@ -7333,6 +7341,7 @@ class Form
 				$objp = $this->db->fetch_object($result);
 
 				$this->constructMemberListOption($objp, $opt, $optJson, $selected, $filterkey);
+
 				// Add new entry
 				// "key" value of json key array is used by jQuery automatically as selected value
 				// "label" value of json key array is used by jQuery automatically as text for combo box
@@ -7367,28 +7376,23 @@ class Form
 	protected function constructMemberListOption(&$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;
+		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
+		$outtype = $objp->fk_adherent_type;
 
 		$opt = '<option value="'.$objp->rowid.'"';
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
 		$opt .= '>';
-		$opt .= $objp->ref;
-		$objRef = $objp->ref;
-		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
-		$outval .= $objRef;
-
+		if (!empty($filterkey) && $filterkey != '') {
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
+		}
+		$opt .= $outlabel;
 		$opt .= "</option>\n";
-		$optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtype);
+
+		$optJson = array('key'=>$outkey, 'value'=>$outlabel, 'type'=>$outtype);
 	}
 
 	/**

+ 1 - 1
htdocs/eventorganization/class/conferenceorbooth.class.php

@@ -105,7 +105,7 @@ class ConferenceOrBooth extends ActionComm
 	public $fields = array(
 		'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
 		'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
-		'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',),
+		'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"Help text", 'showoncombobox'=>'1',),
 		'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
 		'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
 		'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1),

+ 3 - 2
htdocs/eventorganization/conferenceorbooth_list.php

@@ -705,15 +705,16 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
 // --------------------------------------------------------------------
 print '<tr class="liste_titre">';
 foreach ($object->fields as $key => $val) {
-	$cssforfield = (empty($val['css']) ? '' : $val['css']);
 	$searchkey = (empty($search[$key]) ? '' : $search[$key]);
+
+	$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
 	if ($key == 'status') {
 		$cssforfield .= ($cssforfield ? ' ' : '').'center';
 	} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
 		$cssforfield .= ($cssforfield ? ' ' : '').'center';
 	} elseif (in_array($val['type'], array('timestamp'))) {
 		$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
-	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref')) && $val['label'] != 'TechnicalID') {
+	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
 	}
 	if (!empty($arrayfields['t.'.$key]['checked'])) {

+ 12 - 0
htdocs/install/mysql/migration/14.0.0-15.0.0.sql

@@ -538,6 +538,18 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154,
 -- VMYSQL4.3 ALTER TABLE llx_user MODIFY COLUMN fk_soc integer NULL;
 -- VPGSQL8.2 ALTER TABLE llx_user ALTER COLUMN fk_soc DROP NOT NULL;
 
+CREATE TABLE llx_element_tag
+(
+    rowid integer AUTO_INCREMENT PRIMARY KEY,
+    fk_categorie  integer NOT NULL,
+    fk_element  integer NOT NULL,
+    import_key    varchar(14)
+)ENGINE=innodb;
+
+ALTER TABLE llx_element_tag ADD UNIQUE INDEX idx_element_tag_uk (fk_categorie, fk_element);
+
+ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
+
 -- Add column to help to fix a very critical bug when transferring into accounting bank record of a bank account into another currency.
 -- Idea is to update this column manually in v15 with value in currency of company for bank that are not into the main currency and the transfer
 -- into accounting will use it in priority if value is not null. The script repair.sql contains the sequence to fix datas in llx_bank.

+ 2 - 2
htdocs/install/mysql/tables/llx_product.sql

@@ -40,8 +40,8 @@ create table llx_product
   customcode                    varchar(32),                        -- Optionnal custom code
   fk_country                    integer DEFAULT NULL,               -- Optionnal id of original country
   fk_state                      integer DEFAULT NULL,               -- Optionnal id of original state/province
-  price                         double(24,8) DEFAULT 0,
-  price_ttc                     double(24,8) DEFAULT 0,
+  price                         double(24,8) DEFAULT 0,				-- price without tax
+  price_ttc                     double(24,8) DEFAULT 0,				-- price inc vat (but not localtax1 nor localtax2)
   price_min                     double(24,8) DEFAULT 0,
   price_min_ttc                 double(24,8) DEFAULT 0,
   price_base_type               varchar(3)   DEFAULT 'HT',

+ 2 - 2
htdocs/install/mysql/tables/llx_product_price.sql

@@ -29,8 +29,8 @@ create table llx_product_price
   fk_product		integer NOT NULL,
   date_price		datetime NOT NULL,
   price_level		smallint NULL DEFAULT 1,
-  price				double(24,8) DEFAULT NULL,
-  price_ttc			double(24,8) DEFAULT NULL,
+  price				double(24,8) DEFAULT NULL,		-- price without tax
+  price_ttc			double(24,8) DEFAULT NULL,		-- price inc vat (but not localtax1 nor localtax2)
   price_min			double(24,8) default NULL,
   price_min_ttc		double(24,8) default NULL,
   price_base_type	varchar(3) DEFAULT 'HT',

+ 0 - 9
htdocs/install/mysql/tables/llx_societe.sql

@@ -52,15 +52,6 @@ create table llx_societe
   email                    varchar(128),                        		--
 
   socialnetworks           text DEFAULT NULL,                           -- json with socialnetworks
-  --skype                    varchar(255),                        		-- deprecated
-  --twitter                  varchar(255),                        		-- deprecated
-  --facebook                 varchar(255),                        		-- deprecated
-  --linkedin                 varchar(255),                        		-- deprecated
-  --instagram                varchar(255),                        		-- deprecated
-  --snapchat                 varchar(255),                        		-- deprecated
-  --googleplus               varchar(255),                        		-- deprecated
-  --youtube                  varchar(255),                        		-- deprecated
-  --whatsapp                 varchar(255),                        		-- deprecated
 
   fk_effectif              integer        DEFAULT 0,            		--
   fk_typent                integer        DEFAULT NULL,                 -- type ent

+ 1 - 0
htdocs/langs/en_US/categories.lang

@@ -90,6 +90,7 @@ CategorieRecursivHelp=If option is on, when you add a product into a subcategory
 AddProductServiceIntoCategory=Add the following product/service
 AddCustomerIntoCategory=Assign category to customer
 AddSupplierIntoCategory=Assign category to supplier
+AssignCategoryTo=Assign category to
 ShowCategory=Show tag/category
 ByDefaultInList=By default in list
 ChooseCategory=Choose category

+ 1 - 1
htdocs/langs/fr_FR/main.lang

@@ -418,7 +418,7 @@ TotalLT2IN=Total SGST
 HT=HT
 TTC=TTC
 INCVATONLY=TVA incluse
-INCT=TTC
+INCT=TVA+Taxes locales incluses
 VAT=TVA
 VATIN=IGST
 VATs=TVA

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

@@ -2065,7 +2065,7 @@ class Product extends CommonObject
 
 
 	/**
-	 * Modify customer price of a product/Service
+	 * Modify customer price of a product/Service for a given level
 	 *
 	 * @param  double $newprice          New price
 	 * @param  string $newpricebase      HT or TTC

+ 95 - 30
htdocs/product/price.php

@@ -192,15 +192,50 @@ if (empty($reshook)) {
 		}
 
 		if (!$error) {
-			// Force the update of the price of the product to 0 if error
+			if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
+				for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
+					// Force the update of the price of the product using the new VAT
+					if ($object->multiprices_base_type[$i] == 'HT') {
+						$oldprice = $object->multiprices[$i];
+						$oldminprice = $object->multiprices_min[$i];
+					} else {
+						$oldprice = $object->multiprices_ttc[$i];
+						$oldminprice = $object->multiprices_min_ttc[$i];
+					}
+					$oldpricebasetype = $object->multiprices_base_type[$i];
+					$oldnpr = $object->multiprices_recuperableonly[$i];
 
-			//$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2);
-			$localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them.
-			$ret = $object->updatePrice(0, $object->price_base_type, $user, $tva_tx, '', 0, $npr, 0, 0, $localtaxarray, $vatratecode);
+					//$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2);
+					$localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them.
+					$level = $i;
+					$ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode);
 
-			if ($ret < 0) {
-				$error++;
-				setEventMessages($object->error, $object->errors, 'errors');
+					if ($ret < 0) {
+						$error++;
+						setEventMessages($object->error, $object->errors, 'errors');
+					}
+				}
+			} else {
+				// Force the update of the price of the product using the new VAT
+				if ($object->price_base_type == 'HT') {
+					$oldprice = $object->price;
+					$oldminprice = $object->price_min;
+				} else {
+					$oldprice = $object->price_ttc;
+					$oldminprice = $object->price_min_ttc;
+				}
+				$oldpricebasetype = $object->price_base_type;
+				$oldnpr = $object->tva_npr;
+
+				//$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2);
+				$localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them.
+				$level = 0;
+				$ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode);
+
+				if ($ret < 0) {
+					$error++;
+					setEventMessages($object->error, $object->errors, 'errors');
+				}
 			}
 		}
 
@@ -1602,6 +1637,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
 	}
 	$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
 	// $sql .= $db->plimit();
+	//print $sql;
 
 	$result = $db->query($sql);
 	if ($result) {
@@ -1640,8 +1676,9 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
 				print_barre_liste($langs->trans("PriceByCustomerLog"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $num, 'title_accountancy.png');
 			}
 
-			print '<div class="div-table-responsive">';
-			print '<table class="liste centpercent">';
+			print '<!-- List of log prices -->'."\n";
+			print '<div class="div-table-responsive">'."\n";
+			print '<table class="liste centpercent">'."\n";
 
 			print '<tr class="liste_titre">';
 			print '<td>'.$langs->trans("AppliedPricesFrom").'</td>';
@@ -1659,6 +1696,9 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
 			}
 			print '<td class="right">'.$langs->trans("HT").'</td>';
 			print '<td class="right">'.$langs->trans("TTC").'</td>';
+			if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
+				print '<td class="right">'.$langs->trans("INCT").'</td>';
+			}
 			if (!empty($conf->dynamicprices->enabled)) {
 				print '<td class="right">'.$langs->trans("PriceExpressionSelected").'</td>';
 			}
@@ -1725,6 +1765,24 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
 					print "</td>";
 				}
 
+				// Line for default price
+				if ($objp->price_base_type == 'HT') {
+					$pu = $objp->price;
+				} else {
+					$pu = $objp->price_ttc;
+				}
+
+				// Local tax was not saved into table llx_product on old version. So we will use value linked to VAT code.
+				$localtaxarray = getLocalTaxesFromRate($objp->tva_tx.($object->default_vat_code ? ' ('.$object->default_vat_code.')' : ''), 0, $mysoc, $mysoc);
+				// Define part of HT, VAT, TTC
+				$resultarray = calcul_price_total(1, $pu, 0, $objp->tva_tx, 1, 1, 0, $objp->price_base_type, $objp->recuperableonly, $object->type, $mysoc, $localtaxarray);
+				// Calcul du total ht sans remise
+				$total_ht = $resultarray[0];
+				$total_vat = $resultarray[1];
+				$total_localtax1 = $resultarray[9];
+				$total_localtax2 = $resultarray[10];
+				$total_ttc = $resultarray[2];
+
 				// Price
 				if (!empty($objp->fk_price_expression) && !empty($conf->dynamicprices->enabled)) {
 					$price_expression = new PriceExpression($db);
@@ -1732,32 +1790,46 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
 					$title = $price_expression->title;
 					print '<td class="right"></td>';
 					print '<td class="right"></td>';
+					if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
+						print '<td class="right"></td>';
+					}
 					print '<td class="right">'.$title."</td>";
 				} else {
+					// Price HT
 					print '<td class="right">';
 					if (empty($objp->price_by_qty)) {
 						print price($objp->price);
 					}
 					print "</td>";
+					// Price TTC
 					print '<td class="right">';
 					if (empty($objp->price_by_qty)) {
-						print price($objp->price_ttc);
+						$price_ttc = $objp->price_ttc;
+						print price($price_ttc);
 					}
 					print "</td>";
+					if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
+						print '<td class="right">';
+						print $resultarray[2];
+						print '</td>';
+					}
 					if (!empty($conf->dynamicprices->enabled)) { //Only if module is enabled
 						print '<td class="right"></td>';
 					}
 				}
 
+				// Price min
 				print '<td class="right">';
 				if (empty($objp->price_by_qty)) {
 					print price($objp->price_min);
 				}
 				print '</td>';
 
+				// Price min inc tax
 				print '<td class="right">';
 				if (empty($objp->price_by_qty)) {
-					print price($objp->price_min_ttc);
+					$price_min_ttc = $objp->price_min_ttc;
+					print price($price_min_ttc);
 				}
 				print '</td>';
 
@@ -2042,11 +2114,9 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 			print '<td class="center">'.$langs->trans("PriceBase").'</td>';
 			print '<td class="right">'.$langs->trans("DefaultTaxRate").'</td>';
 			print '<td class="right">'.$langs->trans("HT").'</td>';
+			print '<td class="right">'.$langs->trans("TTC").'</td>';
 			if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
-				//print '<td class="right">' . $langs->trans("INCVATONLY") . '</td>';
 				print '<td class="right">'.$langs->trans("INCT").'</td>';
-			} else {
-				print '<td class="right">'.$langs->trans("TTC").'</td>';
 			}
 			print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</td>';
 			print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("TTC").'</td>';
@@ -2107,11 +2177,9 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 				print "</td>";
 				print '<td class="right">'.price($line->price)."</td>";
 
+				print '<td class="right">'.price($line->price_ttc)."</td>";
 				if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
-					//print '<td class="right">' . price($line->price_ttc) . "</td>";
 					print '<td class="right">'.price($resultarray[2]).'</td>';
-				} else {
-					print '<td class="right">'.price($line->price_ttc)."</td>";
 				}
 
 				print '<td class="right">'.price($line->price_min).'</td>';
@@ -2154,12 +2222,15 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 		print '<input type="hidden" name="token" value="'.newToken().'">';
 		print '<input type="hidden" name="id" value="'.$object->id.'">';
 
-		print '<div class="div-table-responsive-no-min">';
-		print '<table class="liste centpercent">';
+		print '<!-- List of prices per customer -->'."\n";
+		print '<div class="div-table-responsive-no-min">'."\n";
+		print '<table class="liste centpercent">'."\n";
 
 		if (count($prodcustprice->lines) > 0 || $search_soc) {
 			$colspan = 9;
-			//if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++;
+			if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
+				$colspan++;
+			}
 
 			print '<tr class="liste_titre">';
 			print '<td class="liste_titre"><input type="text" class="flat" name="search_soc" value="'.$search_soc.'" size="20"></td>';
@@ -2179,13 +2250,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 		print '<td class="center">'.$langs->trans("PriceBase").'</td>';
 		print '<td class="right">'.$langs->trans("DefaultTaxRate").'</td>';
 		print '<td class="right">'.$langs->trans("HT").'</td>';
+		print '<td class="right">'.$langs->trans("TTC").'</td>';
 		if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
-			//print '<td class="right">' . $langs->trans("INCVATONLY") . '</td>';
 			print '<td class="right">'.$langs->trans("INCT").'</td>';
-		} else {
-			print '<td class="right">'.$langs->trans("TTC").'</td>';
 		}
-
 		print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</td>';
 		print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("TTC").'</td>';
 		print '<td class="right">'.$langs->trans("ChangedBy").'</td>';
@@ -2199,7 +2267,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 			$pu = $object->price_ttc;
 		}
 
-		// Local tax is not saved into table of product. We use value linked to VAT code.
+		// Local tax was not saved into table llx_product on old version. So we will use value linked to VAT code.
 		$localtaxarray = getLocalTaxesFromRate($object->tva_tx.($object->default_vat_code ? ' ('.$object->default_vat_code.')' : ''), 0, $mysoc, $mysoc);
 		// Define part of HT, VAT, TTC
 		$resultarray = calcul_price_total(1, $pu, 0, $object->tva_tx, 1, 1, 0, $object->price_base_type, $object->recuperableonly, $object->type, $mysoc, $localtaxarray);
@@ -2237,14 +2305,12 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 
 		print '<td class="right">'.price($object->price)."</td>";
 
+		print '<td class="right">'.price($object->price_ttc)."</td>";
 		if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
 			//print '<td class="right">' . price($object->price_ttc) . "</td>";
 			print '<td class="right">'.price($resultarray[2]).'</td>';
-		} else {
-			print '<td class="right">'.price($object->price_ttc)."</td>";
 		}
 
-
 		print '<td class="right">'.price($object->price_min).'</td>';
 		print '<td class="right">'.price($object->price_min_ttc).'</td>';
 		print '<td class="right">';
@@ -2315,11 +2381,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
 				print "</td>";
 				print '<td class="right">'.price($line->price)."</td>";
 
+				print '<td class="right">'.price($line->price_ttc)."</td>";
 				if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
 					//print '<td class="right">' . price($line->price_ttc) . "</td>";
 					print '<td class="right">'.price($resultarray[2]).'</td>';
-				} else {
-					print '<td class="right">'.price($line->price_ttc)."</td>";
 				}
 
 				print '<td class="right">'.price($line->price_min).'</td>';

+ 1 - 0
htdocs/projet/class/task.class.php

@@ -920,6 +920,7 @@ class Task extends CommonObjectLine
 		// Add where from extra fields
 		$extrafieldsobjectkey = 'projet_task';
 		$extrafieldsobjectprefix = 'efpt.';
+		global $db; // needed for extrafields_list_search_sql.tpl
 		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
 		// Add where from hooks
 		$parameters = array();

+ 2 - 1
htdocs/public/eventorganization/attendee_new.php

@@ -262,6 +262,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
 			$confattendee->fk_project = $project->id;
 			$confattendee->fk_actioncomm = $id;
 			$confattendee->note_public = $note_public;
+
 			$resultconfattendee = $confattendee->create($user);
 			if ($resultconfattendee < 0) {
 				$error++;
@@ -277,7 +278,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
 			$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'master');
 			$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
 
-			$mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorder", $email);
+			$mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorded", $email);
 			setEventMessages($mesg, null, 'mesgs');
 
 			$db->commit();

+ 18 - 3
htdocs/public/payment/paymentok.php

@@ -1267,7 +1267,7 @@ if ($ispaymentok) {
 							$outputlangs = new Translate('', $conf);
 							$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
 							// Load traductions files required by page
-							$outputlangs->loadLangs(array("main", "members"));
+							$outputlangs->loadLangs(array("main", "members", "eventorganization"));
 							// Get email content from template
 							$arraydefaultmessage = null;
 
@@ -1298,7 +1298,22 @@ if ($ispaymentok) {
 
 							$ishtml = dol_textishtml($texttosend); // May contain urls
 
-							$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
+							// Attach a file ?
+							$file = '';
+							$listofpaths = array();
+							$listofnames = array();
+							$listofmimes = array();
+							if (is_object($object)) {
+								$invoicediroutput = $conf->facture->dir_output;
+								$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->ref, preg_quote($object->ref, '/').'[^\-]+');
+								$file = $fileparams['fullname'];
+
+								$listofpaths = array($file);
+								$listofnames = array(basename($file));
+								$listofmimes = array(dol_mimetype($file));
+							}
+
+							$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, $ishtml);
 
 							$result = $mailfile->sendfile();
 							if ($result) {
@@ -1456,7 +1471,7 @@ if ($ispaymentok) {
 										$outputlangs = new Translate('', $conf);
 										$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
 										// Load traductions files required by page
-										$outputlangs->loadLangs(array("main", "members"));
+										$outputlangs->loadLangs(array("main", "members", "eventorganization"));
 										// Get email content from template
 										$arraydefaultmessage = null;
 

+ 1 - 1
htdocs/salaries/card.php

@@ -554,7 +554,7 @@ if ($action == 'create') {
 	print '<tr><td>';
 	print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).'</td><td>';
 	print '<input name="amount" id="amount" class="minwidth75 maxwidth100" value="'.GETPOST("amount").'">&nbsp;';
-	print '<button class="dpInvisibleButtons" id="updateAmountWithLastSalary" name="_useless" type="button">'.$langs->trans('UpdateAmountWithLastSalary').'</a>';
+	print '<button class="dpInvisibleButtons datenow" id="updateAmountWithLastSalary" name="_useless" type="button">'.$langs->trans('UpdateAmountWithLastSalary').'</a>';
 	print '</td>';
 	print '</tr>';