Creato funzione di filtraggio e assegnazione categoria in importazione in base alle regole di assegnazione
This commit is contained in:
@@ -44,7 +44,15 @@ class ImportRuleController extends Controller
|
||||
'is_active' => 'boolean',
|
||||
'created_by' => 'nullable|string|max:255',
|
||||
]);
|
||||
ImportRule::create($request->all());
|
||||
ImportRule::create(
|
||||
[
|
||||
'category_id'=>$request->category_id,
|
||||
'pattern'=>$request->pattern,
|
||||
'description'=>$request->description,
|
||||
'is_active'=>1,
|
||||
]
|
||||
|
||||
);
|
||||
return redirect()->route('import_rules.index'); // Redirect to the index after storing the rule
|
||||
}
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ class MovimentiController extends Controller
|
||||
'mov_descrizione' => $line[$this->map['mov_descrizione']],
|
||||
'mov_importo_dare' => $line[$this->map['mov_importo_dare']],
|
||||
'mov_importo_avere' => $line[$this->map['mov_importo_avere']],
|
||||
'mov_fk_categoria' => '1',
|
||||
'mov_fk_categoria' => Movimenti::setCategoriesFromCsv($line[$this->map['mov_descrizione']]),
|
||||
'mov_fk_tags' => 1,
|
||||
'mov_inserito_da' => Auth::id(),
|
||||
'conto_id_da' => 1
|
||||
|
||||
Reference in New Issue
Block a user