diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index a3b1c1a26..5d577a0b4 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -118,6 +118,13 @@ class LoadPostalCodesCommand extends Command private function addPostalCode($row, OutputInterface $output) { + if($row[2] == 'FR' && strlen($row[0]) == 4) { + // CP in FRANCE are on 5 digit + // For CP starting with a zero, the starting zero can be remove if stored as number in a csv + // add a zero if CP from FR and on 4 digit + $row[0] = '0'.$row[0]; + } + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { $output->writeln('handling row: ' . $row[0] . ' | ' . $row[1] . ' | ' . $row[2]); }