Fix: exclude closed third parties from contacts selection
This commit is contained in:
parent
2d0c554011
commit
dd7a76b1b5
2 changed files with 4 additions and 2 deletions
|
|
@ -747,7 +747,8 @@ class FormCompany extends Form
|
|||
if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
|
||||
$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
|
||||
}
|
||||
$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
|
||||
// Filter on active third parties only (status = 1) Closed third parties must not be selectable
|
||||
$sql .= " WHERE s.entity IN (" . getEntity('societe') . ") AND s.status = 1";
|
||||
// For ajax search we limit here. For combo list, we limit later
|
||||
if (is_array($limitto) && count($limitto)) {
|
||||
$sql .= " AND s.rowid IN (" . $this->db->sanitize(implode(',', $limitto)) . ")";
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
|||
if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays";
|
||||
}
|
||||
$sql .= " WHERE s.entity IN (".getEntity('societe').")";
|
||||
// Filter on active third parties only (status = 1) Closed third parties must not be selectable
|
||||
$sql .= " WHERE s.entity IN (".getEntity('societe').") AND s.status = 1";
|
||||
if ($socid) {
|
||||
$sql .= " AND (";
|
||||
// Add criteria on name/code
|
||||
|
|
|
|||
Loading…
Reference in a new issue