Fix: Does not filter correctly by project contacts (#31340)

* Fix: Grand total correction

* Fix: Does not filter correctly by project contacts
This commit is contained in:
Ferran Marcet 2024-10-13 20:31:23 +02:00 committed by GitHub
parent 822e3cacd8
commit b2c59aa934
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -1026,7 +1026,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
$sql .= " WHERE sc.fk_soc = ".((int) $object->id);
$sql .= " AND p.entity IN (".getEntity('project').")";
$sql .= " AND tc.element = 'project'";
$sql .= " AND tc.element = 'project' AND tc.source = 'external'";
$sql .= " ORDER BY p.dateo DESC";
$result = $db->query($sql);