|
@@ -223,6 +223,9 @@ class RecordINOUT extends Component
|
|
|
->get();
|
|
->get();
|
|
|
//$records = $records->orderBy('date', 'DESC')->get();
|
|
//$records = $records->orderBy('date', 'DESC')->get();
|
|
|
|
|
|
|
|
|
|
+ $ccc = 0;
|
|
|
|
|
+ $ids = '';
|
|
|
|
|
+
|
|
|
foreach($records as $record)
|
|
foreach($records as $record)
|
|
|
{
|
|
{
|
|
|
$amount = $record->amount;
|
|
$amount = $record->amount;
|
|
@@ -238,9 +241,20 @@ class RecordINOUT extends Component
|
|
|
$this->records_in[$filter][$record->causal_id] += $amount;
|
|
$this->records_in[$filter][$record->causal_id] += $amount;
|
|
|
else
|
|
else
|
|
|
$this->records_in[$filter][$record->causal_id] = $amount;
|
|
$this->records_in[$filter][$record->causal_id] = $amount;
|
|
|
|
|
+
|
|
|
|
|
+ //if ($record->causal_id == 158)
|
|
|
|
|
+ // print "ID = " . $record->id . "<br>";
|
|
|
|
|
+
|
|
|
// Aggiorno i dati del padre
|
|
// Aggiorno i dati del padre
|
|
|
$this->updateParent("IN", $record->causal_id, $amount, $filter);
|
|
$this->updateParent("IN", $record->causal_id, $amount, $filter);
|
|
|
|
|
+
|
|
|
|
|
+ if ($record->causal_id == 159 && $filter == '11-2025')
|
|
|
|
|
+ {
|
|
|
|
|
+ $ccc += 1;
|
|
|
|
|
+ $ids .= $record->id . ",";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ //die;
|
|
|
|
|
|
|
|
$records = \App\Models\Record::where('type', 'OUT')
|
|
$records = \App\Models\Record::where('type', 'OUT')
|
|
|
->join('records_rows', 'records.id', '=', 'records_rows.record_id')
|
|
->join('records_rows', 'records.id', '=', 'records_rows.record_id')
|
|
@@ -276,6 +290,8 @@ class RecordINOUT extends Component
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //print $ccc."-";
|
|
|
|
|
+ //print $ids;
|
|
|
//$this->showData = true;
|
|
//$this->showData = true;
|
|
|
$this->emit('load-table');
|
|
$this->emit('load-table');
|
|
|
|
|
|
|
@@ -516,7 +532,7 @@ class RecordINOUT extends Component
|
|
|
if ($when > 1)
|
|
if ($when > 1)
|
|
|
{
|
|
{
|
|
|
$amount = $amount / $when;
|
|
$amount = $amount / $when;
|
|
|
- $record->amount = $amount;
|
|
|
|
|
|
|
+ //$record->amount = $amount;
|
|
|
}
|
|
}
|
|
|
// Aggiungo/aggiorno i dati
|
|
// Aggiungo/aggiorno i dati
|
|
|
if (isset($records_in[$filter][$record->causal_id]))
|
|
if (isset($records_in[$filter][$record->causal_id]))
|
|
@@ -525,6 +541,9 @@ class RecordINOUT extends Component
|
|
|
$records_in[$filter][$record->causal_id] = $amount;
|
|
$records_in[$filter][$record->causal_id] = $amount;
|
|
|
// Aggiorno i dati del padre
|
|
// Aggiorno i dati del padre
|
|
|
$this->updateParentYear("IN", $record->causal_id, $amount, $filter, $records_in, $records_out);
|
|
$this->updateParentYear("IN", $record->causal_id, $amount, $filter, $records_in, $records_out);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$records = \App\Models\Record::where('type', 'OUT')
|
|
$records = \App\Models\Record::where('type', 'OUT')
|
|
@@ -559,6 +578,8 @@ class RecordINOUT extends Component
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
$path = $this->generateExcel($columns, $this->rows_in, $records_in, $this->rows_out, $records_out, true);
|
|
$path = $this->generateExcel($columns, $this->rows_in, $records_in, $this->rows_out, $records_out, true);
|
|
|
return response()->download($path)->deleteFileAfterSend();
|
|
return response()->download($path)->deleteFileAfterSend();
|
|
|
|
|
|