Update company.lib.php

This commit is contained in:
Laurent Destailleur 2020-02-05 12:49:56 +01:00 committed by GitHub
parent 94fd2b40c7
commit f8daed7f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,8 +208,12 @@ function societe_prepare_head(Societe $object)
$sql = "SELECT COUNT(n.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n";
$sql .= " WHERE n.fk_soc = ".$object->id;
if (!empty($conf->stripe->enabled)) $sql .= " AND n.status = ".$servicestatus;
if (empty($conf->stripe->enabled)) {
$sql .= " AND n.stripe_card_ref IS NULL";
} else {
$sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".$servicestatus."))";
}
$resql = $db->query($sql);
if ($resql)
{