|
@@ -273,6 +273,9 @@ class RecordINOUT extends Component
|
|
|
}
|
|
}
|
|
|
$records = $recordsQuery->get();
|
|
$records = $recordsQuery->get();
|
|
|
|
|
|
|
|
|
|
+ $ccc = 0;
|
|
|
|
|
+ $ids = '';
|
|
|
|
|
+
|
|
|
foreach($records as $record)
|
|
foreach($records as $record)
|
|
|
{
|
|
{
|
|
|
$amount = $record->amount;
|
|
$amount = $record->amount;
|
|
@@ -288,9 +291,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')
|
|
@@ -373,6 +387,8 @@ class RecordINOUT extends Component
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //print $ccc."-";
|
|
|
|
|
+ //print $ids;
|
|
|
//$this->showData = true;
|
|
//$this->showData = true;
|
|
|
$this->emit('load-table');
|
|
$this->emit('load-table');
|
|
|
|
|
|
|
@@ -634,7 +650,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]))
|
|
@@ -643,6 +659,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')
|
|
@@ -677,6 +696,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();
|
|
|
|
|
|