浏览代码

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

Laurent Destailleur 1 年之前
父节点
当前提交
7964f831e9

+ 1 - 0
htdocs/adherents/class/adherent.class.php

@@ -3102,6 +3102,7 @@ class Adherent extends CommonObject
 
 			$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent';
 			$sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity('adherent').")" here, we want the batch to be on its entity only;
+			$sql .= " AND statut = 1";
 			$sql .= " AND datefin = '".$this->db->idate($datetosearchfor)."'";
 			//$sql .= " LIMIT 10000";
 

+ 1 - 1
htdocs/adherents/subscription/card.php

@@ -358,7 +358,7 @@ if ($rowid && $action != 'edit') {
 	print '<div class="tabsAction">';
 
 	if ($user->hasRight('adherent', 'cotisation', 'creer')) {
-		if (!empty($bankline->rappro) || empty($bankline)) {
+		if (empty($bankline->rappro) || empty($bankline)) {
 			print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify")."</a></div>";
 		} else {
 			print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.$langs->trans("BankLineConciliated").'" href="#">'.$langs->trans("Modify")."</a></div>";

+ 3 - 0
htdocs/compta/facture/list.php

@@ -1821,6 +1821,9 @@ if ($resql) {
 		$totalarray['val']['f.total_tva'] = 0;
 		$totalarray['val']['f.total_ht'] = 0;
 		$totalarray['val']['f.total_ttc'] = 0;
+		$totalarray['val']['totalam'] = 0;
+		$totalarray['val']['rtp'] = 0;
+
 
 		$with_margin_info = false;
 		if (isModEnabled('margin') && (

+ 1 - 1
htdocs/core/class/html.form.class.php

@@ -6348,7 +6348,7 @@ class Form
 				if (!empty($user) && $user->admin && preg_match('/\'(..)\'/', $country_code, $reg)) {
 					$langs->load("errors");
 					$new_country_code = $reg[1];
-					$country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_pays', 'code', 'rowid');
+					$country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_country', 'code', 'rowid');
 					$this->error .= '<br>'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : ''));
 				}
 				$this->error .= '</span>';

+ 3 - 1
htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php

@@ -246,13 +246,15 @@ class InterfaceTicketEmail extends DolibarrTriggers
 					$linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal'));
 					if (empty($linked_contacts) && !empty($conf->global->TICKET_NOTIFY_AT_CLOSING) && !empty($object->fk_soc)) {
 						$object->fetch_thirdparty();
-						$linked_contacts[] = $object->thirdparty->email;
+						$linked_contacts[]['email'] = $object->thirdparty->email;
 					}
 
 					$contactid = GETPOST('contactid', 'int');
 					$res = 0;
 
 					if ($contactid > 0) {
+						// TODO This security test has no sens. We must check that $contactid is inside $linked_contacts[]['id'] when $linked_contacts[]['source'] = 'external' or 'thirdparty'
+						// Refuse email if not
 						$contact = new Contact($this->db);
 						$res = $contact->fetch($contactid);
 						if (! in_array($contact, $linked_contacts)) {

+ 3 - 3
htdocs/fourn/commande/card.php

@@ -1350,8 +1350,6 @@ if (empty($reshook)) {
 									$tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id);
 								}
 
-								$object->special_code = $lines[$i]->special_code;
-
 								$result = $object->addline(
 									$desc,
 									$lines[$i]->subprice,
@@ -1374,7 +1372,9 @@ if (empty($reshook)) {
 									$lines[$i]->fk_unit,
 									0,
 									$element,
-									!empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid
+									!empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid,
+									-1,
+									$lines[$i]->special_code
 								);
 
 								if ($result < 0) {

+ 2 - 1
htdocs/product/inventory/inventory.php

@@ -1045,8 +1045,9 @@ if ($resql) {
 		// Expected quantity = Quantity in stock when we start inventory
 		print '<td class="right expectedqty" id="id_'.$obj->rowid.'" title="Stock viewed at last update: '.$obj->qty_stock.'">';
 		$valuetoshow = $obj->qty_stock;
+
 		// For inventory not yet close, we overwrite with the real value in stock now
-		if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
+		if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && !getDolGlobalString('DISABLE_QTY_OVERWRITE')) {
 			if (isModEnabled('productbatch') && $product_static->hasbatch()) {
 				$valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty;
 			} else {