Correctif: isDeletable renvoyait TRUE si le client n'était *PAS* supprimable, inversion du sens

This commit is contained in:
bohwaz 2021-12-17 12:38:25 +01:00
parent 0ef04439f1
commit 2d4052e984

View File

@ -117,15 +117,15 @@ class Client
return $db->update('plugin_facturation_clients', $data, $db->where('id', (int)$id));
}
public function isDeletable($id)
public function isDeletable($id): bool
{
$f = new Facture;
return $f->hasDocs(0, $id);
return !$f->hasDocs(0, $id);
}
public function delete($id)
{
if($this->isDeletable($id))
if(!$this->isDeletable($id))
{
return false;
}