mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +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()
|
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…
x
Reference in New Issue
Block a user