mirror of
https://github.com/devcode-it/openstamanager.git
synced 2024-12-27 16:23:19 +01:00
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
Block a user