diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index 365969436dd..68b924e2e4d 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -1325,7 +1325,6 @@ class BonPrelevement extends CommonObject
$result .= $this->ref;
}
$result .= $linkend;
- //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
global $action, $hookmanager;
$hookmanager->initHooks(array('banktransferdao'));
@@ -1902,7 +1901,7 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .= ' '.$CrLf;
$XML_DEBITOR .= ' '.$CrLf;
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
- $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
+ $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
$XML_DEBITOR .= ' '.$CrLf;
$XML_DEBITOR .= ' '.round($row_somme, 2).''.$CrLf;
$XML_DEBITOR .= ' '.$CrLf;
@@ -1924,10 +1923,10 @@ class BonPrelevement extends CommonObject
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => ""));
if (trim($addressline1)) {
- $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', true)).''.$CrLf;
+ $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', 1)).''.$CrLf;
}
if (trim($addressline2)) {
- $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', true)).''.$CrLf;
+ $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', 1)).''.$CrLf;
}
$XML_DEBITOR .= ' '.$CrLf;
$XML_DEBITOR .= ' '.$CrLf;
@@ -1938,7 +1937,7 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .= ' '.$CrLf;
$XML_DEBITOR .= ' '.$CrLf;
// A string with some information on payment - 140 max
- $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135)).''.$CrLf; // 140 max
+ $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // 140 max
$XML_DEBITOR .= ' '.$CrLf;
$XML_DEBITOR .= ' '.$CrLf;
return $XML_DEBITOR;
@@ -1948,7 +1947,7 @@ class BonPrelevement extends CommonObject
$XML_CREDITOR .= ' '.$CrLf;
$XML_CREDITOR .= ' '.$CrLf;
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
- $XML_CREDITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
+ $XML_CREDITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
$XML_CREDITOR .= ' '.$CrLf;
$XML_CREDITOR .= ' '.$CrLf;
$XML_CREDITOR .= ' '.round($row_somme, 2).''.$CrLf;
@@ -1975,10 +1974,10 @@ class BonPrelevement extends CommonObject
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => ""));
if (trim($addressline1)) {
- $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', true)).''.$CrLf;
+ $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc($addressline1, 70, 'right', 'UTF-8', 1)).''.$CrLf;
}
if (trim($addressline2)) {
- $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', true)).''.$CrLf;
+ $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc($addressline2, 70, 'right', 'UTF-8', 1)).''.$CrLf;
}
$XML_CREDITOR .= ' '.$CrLf;
$XML_CREDITOR .= ' '.$CrLf;
@@ -1989,7 +1988,7 @@ class BonPrelevement extends CommonObject
$XML_CREDITOR .= ' '.$CrLf;
$XML_CREDITOR .= ' '.$CrLf;
// A string with some information on payment - 140 max
- $XML_CREDITOR .= ' '.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135)).''.$CrLf; // 140 max
+ $XML_CREDITOR .= ' '.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // 140 max
$XML_CREDITOR .= ' '.$CrLf;
$XML_CREDITOR .= ' '.$CrLf;
return $XML_CREDITOR;
diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php
index fbfde88198b..dc6e6d8c6cd 100644
--- a/htdocs/core/class/html.formaccounting.class.php
+++ b/htdocs/core/class/html.formaccounting.class.php
@@ -456,7 +456,7 @@ class FormAccounting extends Form
$sql = "SELECT code_compta, code_compta_fournisseur, nom as name";
$sql .= " FROM ".MAIN_DB_PREFIX."societe";
$sql .= " WHERE entity IN (".getEntity('societe').")";
- $sql .= " AND client IN (1,3) OR fournisseur = 1";
+ $sql .= " AND (client IN (1,3) OR fournisseur = 1)";
$resql = $this->db->query($sql);
if ($resql) {
diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index 0ab22571c03..d7ebdc74a46 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -1180,7 +1180,8 @@ if ($ok && GETPOST('clean_perm_table', 'alpha')) {
foreach ($conf->modules as $key => $val) {
$listofmods .= ($listofmods ? ',' : '')."'".$db->escape($val)."'";
}
- $sql = 'SELECT id, libelle as label, module from '.MAIN_DB_PREFIX.'rights_def WHERE module NOT IN ('.$db->sanitize($listofmods, 1).') AND id > 100000';
+
+ $sql = "SELECT id, libelle as label, module from ".MAIN_DB_PREFIX."rights_def WHERE module NOT IN (".$db->sanitize($listofmods, 1).") AND id > 100000";
$resql = $db->query($sql);
if ($resql) {
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index ed7b5f1980e..695e4356582 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -530,11 +530,6 @@ if ($includeproductswithoutdesiredqty == 'on') {
$includeproductswithoutdesiredqtychecked = 'checked';
}
-// Add where from hooks
-$parameters = array();
-$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
-$sql .= $hookmanager->resPrint;
-
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$result = $db->query($sql);