Merge pull request #18422 from aspangaro/14p13

FIX Accountancy - SQL error on select journal on journal
This commit is contained in:
Laurent Destailleur 2021-08-17 02:41:56 +02:00 committed by GitHub
commit cfbe2bf995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1027,6 +1027,12 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} elseif ($key == 't.code_journal' && !empty($value)) {
if (is_array($value)) {
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
} else {
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
}
} else {
$sqlwhere[] = natural_search($key, $value, 0, 1);
}