diff --git a/Excel/prod/Ratio_Cuisine.xlsm b/Excel/prod/Ratio_Cuisine.xlsm index 76716f7..38fc260 100644 Binary files a/Excel/prod/Ratio_Cuisine.xlsm and b/Excel/prod/Ratio_Cuisine.xlsm differ diff --git a/Excel/prod/Ratio_Cuisine_VERSION.txt b/Excel/prod/Ratio_Cuisine_VERSION.txt index cf664ad..03a58e9 100644 --- a/Excel/prod/Ratio_Cuisine_VERSION.txt +++ b/Excel/prod/Ratio_Cuisine_VERSION.txt @@ -1,2 +1,2 @@ -4.1.6 -2025-11-23 +4.1.10 +2025-11-26 diff --git a/Excel/prod/Ratio_Restauration.xlsm b/Excel/prod/Ratio_Restauration.xlsm index cd8539b..e028d00 100644 Binary files a/Excel/prod/Ratio_Restauration.xlsm and b/Excel/prod/Ratio_Restauration.xlsm differ diff --git a/Excel/prod/Ratio_Restauration_VERSION.txt b/Excel/prod/Ratio_Restauration_VERSION.txt index 72a427b..63c6878 100644 --- a/Excel/prod/Ratio_Restauration_VERSION.txt +++ b/Excel/prod/Ratio_Restauration_VERSION.txt @@ -1,2 +1,2 @@ -1.0.15 -2025-11-25 +1.0.21 +2025-11-26 diff --git a/Scripts/Maj_prod_Cuisine.bat b/Scripts/Maj_prod_Cuisine.bat index 4865a8e..98969f7 100644 --- a/Scripts/Maj_prod_Cuisine.bat +++ b/Scripts/Maj_prod_Cuisine.bat @@ -1,32 +1,55 @@ @echo off -setlocal +setlocal ENABLEDELAYEDEXPANSION -REM Dossier où se trouve ce .bat (normalement ...\Ratio_Inventaires\Scripts\) -set SCRIPT_DIR=%~dp0 +REM --- Se place dans le dossier du .bat --- +cd /d "%~dp0" -REM Racine du projet = dossier parent de Scripts -cd /d "%SCRIPT_DIR%\.." +REM === 1) MISE À JOUR DE VERSION === +REM Chemin du fichier de version pour la CUISINE +set VERSION_FILE=..\Excel\prod\Ratio_Cuisine_VERSION.txt -echo Répertoire courant : -echo %CD% -echo. - -echo --- Mise en prod Ratio_Cuisine --- - -REM 1) Mise à jour automatique de la version -python "%SCRIPT_DIR%maj_version.py" "Excel\prod\Ratio_Cuisine_VERSION.txt" - -REM 2) Vérifier que le fichier source existe (dev) -if not exist "Excel\dev\Ratio_Cuisine_dev.xlsm" ( - echo ERREUR : fichier source introuvable : Excel\dev\Ratio_Cuisine_dev.xlsm +echo Mise à jour de version... +python "maj_version.py" "%VERSION_FILE%" +REM Si tu utilises plutôt 'py', commente la ligne au-dessus et décommente celle-ci : +REM py "maj_version.py" "%VERSION_FILE%" +if errorlevel 1 ( + echo ERREUR lors de la mise à jour de version. pause - endlocal exit /b 1 ) -REM 3) Copie du fichier Excel vers le dossier prod -copy /Y "Excel\dev\Ratio_Cuisine_dev.xlsm" "Excel\prod\Ratio_Cuisine.xlsm" +REM === 2) CHEMINS DES FICHIERS EXCEL === +set SRC=..\Excel\dev\Ratio_Cuisine_dev.xlsm +set DST_DIR=..\Excel\prod + +REM Vérifications +if not exist "%SRC%" ( + echo ERREUR : fichier source introuvable : + echo %SRC% + pause + exit /b 1 +) + +if not exist "%DST_DIR%" ( + echo ERREUR : dossier de destination introuvable : + echo %DST_DIR% + pause + exit /b 1 +) + +REM === 3) GÉNÉRATION DE LA DATE AU FORMAT AAAAMMJJ (robuste, via PowerShell) === +for /f %%a in ('powershell -NoProfile -Command "Get-Date -Format yyyyMMdd"') do set TODAY=%%a + +set BACKUP=%DST_DIR%\Ratio_Cuisine_%TODAY%.xlsm + +REM === 4) COPIE VERS PROD === +echo Copie vers la version de production... +copy /Y "%SRC%" "%DST_DIR%\Ratio_Cuisine.xlsm" + +REM === 5) SAUVEGARDE DATÉE === +echo Création de la sauvegarde datée... +copy /Y "%SRC%" "%BACKUP%" + +echo Terminé. +exit /b 0 -echo --- Mise en prod terminee --- -endlocal -exit /b 0 \ No newline at end of file diff --git a/Scripts/Maj_prod_Restauration.bat b/Scripts/Maj_prod_Restauration.bat index a3b4941..a517dcb 100644 --- a/Scripts/Maj_prod_Restauration.bat +++ b/Scripts/Maj_prod_Restauration.bat @@ -1,31 +1,56 @@ @echo off -setlocal +setlocal ENABLEDELAYEDEXPANSION -REM Dossier où se trouve ce .bat (normalement ...\Ratio_Inventaires\Scripts\) -set SCRIPT_DIR=%~dp0 - -REM Racine du projet = dossier parent de Scripts -cd /d "%SCRIPT_DIR%\.." - -echo Répertoire courant : -echo %CD% -echo. +REM --- Se place dans le dossier du .bat --- +cd /d "%~dp0" echo --- Mise en prod Ratio_Restauration --- -REM 1) Mise à jour automatique de la version -python "%SCRIPT_DIR%maj_version.py" "Excel\prod\Ratio_Restauration_VERSION.txt" +REM === 1) MISE À JOUR DE VERSION === +REM Fichier de version pour la restauration +set VERSION_FILE=..\Excel\prod\Ratio_Restauration_VERSION.txt -REM 2) Vérifier que le fichier source existe (dev) -if not exist "Excel\dev\Ratio_Restauration_dev.xlsm" ( - echo ERREUR : fichier source introuvable : Excel\dev\Ratio_Restauration_dev.xlsm - pause +echo Mise à jour de version... +python "maj_version.py" "%VERSION_FILE%" +REM Si tu utilises 'py' au lieu de 'python', commente la ligne ci-dessus et décommente celle-ci : +REM py "maj_version.py" "%VERSION_FILE%" +if errorlevel 1 ( + echo ERREUR lors de la mise à jour de version. endlocal exit /b 1 ) -REM 3) Copie du fichier Excel vers le dossier prod -copy /Y "Excel\dev\Ratio_Restauration_dev.xlsm" "Excel\prod\Ratio_Restauration.xlsm" +REM === 2) CHEMINS DES FICHIERS EXCEL === +set SRC=..\Excel\dev\Ratio_Restauration_dev.xlsm +set DST_DIR=..\Excel\prod + +REM Vérifications +if not exist "%SRC%" ( + echo ERREUR : fichier source introuvable : + echo %SRC% + endlocal + exit /b 1 +) + +if not exist "%DST_DIR%" ( + echo ERREUR : dossier de destination introuvable : + echo %DST_DIR% + endlocal + exit /b 1 +) + +REM === 3) GÉNÉRATION DE LA DATE AU FORMAT AAAAMMJJ === +for /f %%a in ('powershell -NoProfile -Command "Get-Date -Format yyyyMMdd"') do set TODAY=%%a + +set BACKUP=%DST_DIR%\Ratio_Restauration_%TODAY%.xlsm + +REM === 4) COPIE VERS PROD === +echo Copie vers la version de production... +copy /Y "%SRC%" "%DST_DIR%\Ratio_Restauration.xlsm" + +REM === 5) SAUVEGARDE DATÉE === +echo Création de la sauvegarde datée... +copy /Y "%SRC%" "%BACKUP%" echo --- Mise en prod terminee --- endlocal diff --git a/Scripts/PROD b/Scripts/PROD deleted file mode 100644 index ee07849..0000000 --- a/Scripts/PROD +++ /dev/null @@ -1 +0,0 @@ -=== [4/4] Copier DEV - ==============================