sistemato import file csv per ING Direct

This commit is contained in:
2024-05-07 18:26:29 +02:00
parent fc675ce07b
commit 0330c1d0da
6 changed files with 1358 additions and 690 deletions

View File

@@ -154,11 +154,13 @@ class Movimenti extends Model
$outputPath='/var/www/html/bubofamily/public/'.$filename;
rename($inputPath,$outputPath);
$collection = (new FastExcel)->import($filename, function ($line){
$collection = (new FastExcel)->import($outputPath, function ($line){
if($line['Data valuta'])
{
list($giorno,$mese,$anno) = explode('/',$line['Data valuta']);
$data="$anno-$mese-$giorno";
self::insEntrata([
'mov_data'=>$line['Data valuta'],
'mov_data'=>$data,
'mov_fk_categoria'=>1,
'mov_descrizione'=>$line['Descrizione operazione'],
'mov_importo'=>trim(str_replace(',','.',(str_replace('.','',str_replace('€', '', $line['Importo']))))),