This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 7b5f4552796c255b900227b679a0ecfd31283931 Author: David Cossé <cosse@codelutin.com> Date: Fri Dec 23 16:03:55 2016 +0100 refs #1377 Ajout d'un nom de fichier par défaut pour les fichiers exportés --- .../org/chorem/lima/ui/importexport/ImportExport.java | 17 +++++++++++++++++ .../src/main/resources/i18n/lima-swing_en_GB.properties | 16 ++++++++++++++-- .../src/main/resources/i18n/lima-swing_fr_FR.properties | 16 ++++++++++++++-- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java index 48a1ff6..da8cbd9 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java @@ -119,6 +119,19 @@ public class ImportExport { public static final String EXPORT_ALL_ZIP_FILE_NAME = "%s/LIMA-BACKUP-%s.zip"; public static final String TEMPORARY_EXTRACT_CSV_FILE_PATH = JAVA_IO_TMPDIR + "%s" + CSV; + private static String getExportDefaultFileName(ImportExportEnum export) { + SimpleDateFormat dateFormat = new SimpleDateFormat(EXPORT_DATE_PATTERN); + return t(ImportExportEnum.class.getName() + "." + export.name()) + "_" + dateFormat.format(new Date()); + } + + private static String getSelectedFileWithExtension(ImportExportEnum export, String filePath) { + filePath = filePath == null ? "" : filePath.trim(); + filePath = filePath.endsWith("/") ? filePath + getExportDefaultFileName(export) : filePath; + String nameLower = (filePath.toLowerCase()); + filePath = nameLower.endsWith(CSV) ? filePath : filePath + CSV; + return filePath; + } + public ImportExport(Component view) { viewComponent = view; @@ -546,11 +559,15 @@ public class ImportExport { } else { approveButtonText = t("lima.importExport.export"); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + chooser.setSelectedFile(new File(getExportDefaultFileName(importExportMethod))); chooser.setDialogTitle(approveButtonText); chooser.setApproveButtonText(approveButtonText); } if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) { filePath = chooser.getSelectedFile().getAbsolutePath(); + if (!importMode) { + filePath = getSelectedFileWithExtension(importExportMethod, filePath); + } } return filePath; diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties index 225ac47..ae85c0b 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties @@ -411,7 +411,9 @@ lima.import.error.extractFile=Invalid file lima.import.error.invalidAccountNumber=None existing account with number '%' lima.import.error.noDataToImport=Any data to import lima.import.line=line -lima.import.report=%d created\n %d ignored\n %d updated +lima.import.report=%d created\n %d ignored\n %d updated\n +lima.import.report.noErrorFound=No error found\n +lima.import.report.someErrorFound=Some error append, please look at log file.\n lima.import.terminated=Import finished lima.import.title=Failed lima.importExport.account=Accounts import completed. @@ -471,7 +473,7 @@ lima.opening.close=Close lima.opening.end=Finish lima.opening.entryBook=<html><center>Select entry books to import, <br/>import defaults ones<br/>import your personal</br>or next to create your own entry books.</center></html> lima.opening.fiscalPeriod=Create fiscal period -lima.opening.import=Import a CSV backup +lima.opening.import=Import a ZIP backup lima.opening.next=Next lima.opening.previous=Previous lima.opening.welcome=<html><center>Welcome to Lima<br/>this assistant help you to start your business accounting in the blink of an eye<br/>OR import instantly your already existing save in CSV format<br/><br/><br/><br/></center></html> @@ -532,3 +534,13 @@ lima.vatStatement.remove.confirm=Do you really want to remove line ? lima.vatStatement.remove.title=Remove line ? lima.vatStatements=VAT statements lima.wait=Work in progress +org.chorem.lima.enums.ImportExportEnum.CSV_ACCOUNTCHARTS_EXPORT=Accounts chart +org.chorem.lima.enums.ImportExportEnum.CSV_ALL_EXPORT=Export all +org.chorem.lima.enums.ImportExportEnum.CSV_ENTRIES_EXPORT=Entries +org.chorem.lima.enums.ImportExportEnum.CSV_ENTRYBOOKS_EXPORT=EntryBooks +org.chorem.lima.enums.ImportExportEnum.CSV_FINANCIALSTATEMENTS_EXPORT=Financial statements +org.chorem.lima.enums.ImportExportEnum.CSV_VAT_EXPORT=VAT statement chart +org.chorem.lima.enums.ImportExportEnum.EBP_ACCOUNTCHARTS_EXPORT=Accounts chart (EBP) +org.chorem.lima.enums.ImportExportEnum.EBP_ENTRIES_EXPORT=Entries (EBP) +org.chorem.lima.enums.ImportExportEnum.EBP_ENTRYBOOKS_EXPORT=EntryBooks (EBP) +org.chorem.lima.enums.ImportExportEnum.PDF_VAT_EXPORT=VAT diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index e85dc99..6cf01e0 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -417,7 +417,9 @@ lima.import.error.extractFile=Le fichier n'est correct lima.import.error.invalidAccountNumber=Le compte '%s' n'existe pas. lima.import.error.noDataToImport=Aucune donnée à importer. lima.import.line=Ligne %d\: -lima.import.report=%d créés\n %d ignorés\n %d mis à jours +lima.import.report=%d créés\n %d ignorés\n %d mis à jours\n +lima.import.report.noErrorFound=Aucune erreur rencontrée\n +lima.import.report.someErrorFound=Des erreurs sont survenues lors de l'import, veuillez regarder le fichier de log pour plus de détails.\n lima.import.terminated=Import terminé lima.import.title=Erreur d'import lima.importExport.account=des comptes terminé. @@ -477,7 +479,7 @@ lima.opening.close=Fermer lima.opening.end=Terminer lima.opening.entryBook=<html><center>Veuillez sélectionner les journaux à importer, <br/>journaux par défaut<br/>journaux personnalisés </br>ou continuer pour créer vos journaux plus ultérieurement.</center></html> lima.opening.fiscalPeriod=Création de l'exercice -lima.opening.import=Importer une sauvegarde CSV +lima.opening.import=Importer une sauvegarde ZIP lima.opening.next=Suivant lima.opening.previous=Retour lima.opening.welcome=<html><center>Bienvenue dans Lima<br/>Laissez vous guider par cet assistant pour démarrer votre comptabilité en quelques instants <br/>Ou bien importer directement une ancienne sauvegarde de LIMA au format CSV<br/><br/><br/><br/></center></html> @@ -536,3 +538,13 @@ lima.vatStatement.remove.confirm=Etes vous sur de vouloir supprimer cette ligne lima.vatStatement.remove.title=supprimer de ligne ? lima.vatStatements=Plan TVA lima.wait=Traitement en cours +org.chorem.lima.enums.ImportExportEnum.CSV_ACCOUNTCHARTS_EXPORT=Plan comptable +org.chorem.lima.enums.ImportExportEnum.CSV_ALL_EXPORT=Export global +org.chorem.lima.enums.ImportExportEnum.CSV_ENTRIES_EXPORT=Écritures +org.chorem.lima.enums.ImportExportEnum.CSV_ENTRYBOOKS_EXPORT=Journaux +org.chorem.lima.enums.ImportExportEnum.CSV_FINANCIALSTATEMENTS_EXPORT=Plan BCR +org.chorem.lima.enums.ImportExportEnum.CSV_VAT_EXPORT=Plan TVA +org.chorem.lima.enums.ImportExportEnum.EBP_ACCOUNTCHARTS_EXPORT=Plan comptable (format EBP) +org.chorem.lima.enums.ImportExportEnum.EBP_ENTRIES_EXPORT=Écritures (format EBP) +org.chorem.lima.enums.ImportExportEnum.EBP_ENTRYBOOKS_EXPORT=Jouranux (format EBP) +org.chorem.lima.enums.ImportExportEnum.PDF_VAT_EXPORT=TVA -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.