From 0529aaaf0d17813b1163d6f32a66ed76d6d06a8f Mon Sep 17 00:00:00 2001 From: loviuz Date: Tue, 24 Dec 2019 12:36:47 +0100 Subject: [PATCH] Fix calcolo margine con imponibile scontato --- include/src/Components/Row.php | 2 +- include/src/Document.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/src/Components/Row.php b/include/src/Components/Row.php index 263d90877..bac75696d 100644 --- a/include/src/Components/Row.php +++ b/include/src/Components/Row.php @@ -73,7 +73,7 @@ abstract class Row extends Description */ public function getMargineAttribute() { - return $this->imponibile - $this->spesa; + return $this->totale_imponibile - $this->spesa; } /** diff --git a/include/src/Document.php b/include/src/Document.php index f93a57808..b54e92c0e 100644 --- a/include/src/Document.php +++ b/include/src/Document.php @@ -129,7 +129,7 @@ abstract class Document extends Model */ public function getMarginePercentualeAttribute() { - return (1 - ($this->spesa / $this->imponibile)) * 100; + return (1 - ($this->spesa / ($this->totale_imponibile))) * 100; } public function delete()