Fix getMarginePercentuale function

This commit is contained in:
MatteoPistorello 2022-08-01 17:48:12 +02:00
parent 4fb933ade3
commit 1a28f77ded
1 changed files with 1 additions and 1 deletions

View File

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