1
0
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:
MatteoPistorello 2022-08-01 17:48:12 +02:00
parent 4fb933ade3
commit 1a28f77ded

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;
}
/**