1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 16:23:19 +01:00

Fix problema divisione per 0 nel calcolo margine

This commit is contained in:
loviuz 2022-01-10 13:09:50 +01:00
parent 079f83acbb
commit 9f908971ea

View File

@ -226,7 +226,7 @@ abstract class Document extends Model implements ReferenceInterface, DocumentInt
*/
public function getMarginePercentualeAttribute()
{
return $this->imponibile ? (($this->totale_imponibile / $this->spesa) - 1) * 100 : 100;
return ($this->imponibile && $this->spesa) ? (($this->totale_imponibile / $this->spesa) - 1) * 100 : 100;
}
public function delete()