diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 8717ecd010a..25fa2b6a257 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/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";
diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php
index a9446083faf..c258485760b 100644
--- a/htdocs/adherents/subscription/card.php
+++ b/htdocs/adherents/subscription/card.php
@@ -358,7 +358,7 @@ if ($rowid && $action != 'edit') {
print '
';
if ($user->hasRight('adherent', 'cotisation', 'creer')) {
- if (!empty($bankline->rappro) || empty($bankline)) {
+ if (empty($bankline->rappro) || empty($bankline)) {
print '
";
} else {
print '
";
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 6a089f7a87d..a6fa25cfd13 100644
--- a/htdocs/compta/facture/list.php
+++ b/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') && (
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index cd9f44130b9..e262eb163c9 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/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 .= '
'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : ''));
}
$this->error .= '';
diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
index f18526a9d19..0afe5a7150b 100644
--- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
+++ b/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)) {
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index c9e5e8f4fee..2c1e723df00 100644
--- a/htdocs/fourn/commande/card.php
+++ b/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) {
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index 4ca3768fa11..b924b9c442c 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -1045,8 +1045,9 @@ if ($resql) {
// Expected quantity = Quantity in stock when we start inventory
print '
';
$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 {
|