Fix getMarginePercentuale function
This commit is contained in:
parent
4fb933ade3
commit
1a28f77ded
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue