Pārlūkot izejas kodu

prima nota - tolti record annullati dai totali

ferrari 3 nedēļas atpakaļ
vecāks
revīzija
6e6336d325
1 mainītis faili ar 11 papildinājumiem un 8 dzēšanām
  1. 11 8
      app/Http/Livewire/Record.php

+ 11 - 8
app/Http/Livewire/Record.php

@@ -731,10 +731,11 @@ class Record extends Component
                 $data->causal_name = $causal->getTree();
                 $ret[] = $data;
 
-                if ($data->type == 'IN')
-                    $this->total_in += $data->amount;
-                if ($data->type == 'OUT')
-                    $this->total_out += $data->amount;
+                if ($data->deleted != true)
+                    if ($data->type == 'IN')
+                        $this->total_in += $data->amount;
+                    if ($data->type == 'OUT')
+                        $this->total_out += $data->amount;
 
             }
         }
@@ -753,8 +754,9 @@ class Record extends Component
                 'deleted' => $m->deleted,
             ];
 
-            $this->total_out += $m->amount;
-
+            if (!$m->deleted)
+                $this->total_out += $m->amount;
+            
             // ENTRATA
             $ret[] = (object) [
                 'id' => 'fm_in_' . $m->id,
@@ -767,8 +769,9 @@ class Record extends Component
                 'destination' => $m->destination,
                 'deleted' => $m->deleted,
             ];
-
-            $this->total_in += $m->amount;
+            
+            if (!$m->deleted)
+                $this->total_in += $m->amount;
         }
 
         usort($ret, function ($a, $b) {