From bab32d5affe594935d624b7b93ee741db3f2f5c0 Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Thu, 3 Mar 2022 16:44:02 +0100 Subject: [PATCH] hotfix changement intempestif de format de date --- app/Console/Commands/ImportMoba.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Console/Commands/ImportMoba.php b/app/Console/Commands/ImportMoba.php index 390c6de..46d0141 100644 --- a/app/Console/Commands/ImportMoba.php +++ b/app/Console/Commands/ImportMoba.php @@ -65,25 +65,23 @@ class ImportMoba extends Command } $code_boite = $data[0]; $code_ede = $data[1]; + //format dans le fichier Y-m-d $date_ponte = $data[2]; - list($d, $m, $y) = explode('/', $date_ponte); - $datePonte = $y . '-' . $m . '-' . $d; $code_produit = $data[3]; $libelle_produit = $data[4]; $lot_externe = $data[5]; + //format dans le fichier Y-m-d $dcr = $data[6]; $ean = $data[7]; - list($d_dcr, $m_dcr, $y_dcr) = explode('/', $dcr); - $dateDcr = $y_dcr . '-' . $m_dcr . '-' . $d_dcr; $moba = new Moba(); $moba->code_boite = $code_boite; $moba->code_ede = $code_ede; - $moba->date_ponte = $datePonte; + $moba->date_ponte = $date_ponte; $moba->code_produit = $code_produit; $moba->libelle_produit = $libelle_produit; $moba->lot_externe = $lot_externe; - $moba->dcr = $dateDcr; + $moba->dcr = $dcr; $moba->date_emballage = $date_emballage; $moba->ean13 = $ean; $moba->save(); @@ -96,7 +94,8 @@ class ImportMoba extends Command fwrite($logs, $logtxt); //scopy($file, 'archives/'.$file); unlink($file); - unlink($file . '.ok'); + //il n'y a plus de fichier .ok apparement + @unlink($file . '.ok'); } fclose($logs);