Correctif: isDeletable renvoyait TRUE si le client n'était *PAS* supprimable, inversion du sens
This commit is contained in:
parent
0ef04439f1
commit
2d4052e984
|
@ -117,15 +117,15 @@ class Client
|
||||||
return $db->update('plugin_facturation_clients', $data, $db->where('id', (int)$id));
|
return $db->update('plugin_facturation_clients', $data, $db->where('id', (int)$id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isDeletable($id)
|
public function isDeletable($id): bool
|
||||||
{
|
{
|
||||||
$f = new Facture;
|
$f = new Facture;
|
||||||
return $f->hasDocs(0, $id);
|
return !$f->hasDocs(0, $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
if($this->isDeletable($id))
|
if(!$this->isDeletable($id))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue