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 6edeb52faca651e06e013b3b9f2da3c51cdb41cf Author: David Cossé <cosse@codelutin.com> Date: Fri Sep 23 16:14:17 2016 +0200 refs #1369 Ajout de la possibilité d'importer des journaux CSV et EBP --- .../org/chorem/lima/enums/EntryBooksChartEnum.java | 25 +++++++++++-- .../lima/ui/entrybook/EntryBookImportForm.css | 22 +++++++---- .../lima/ui/entrybook/EntryBookImportForm.jaxx | 14 ++++++- .../lima/ui/entrybook/EntryBookViewHandler.java | 19 ++++++++-- .../lima/ui/opening/CreateEntryBookPanel.css | 16 +++++++- .../lima/ui/opening/CreateEntryBookPanel.jaxx | 20 +++++++++- .../chorem/lima/ui/opening/OpeningViewHandler.java | 41 ++++++++++++++++----- .../resources/i18n/lima-swing_en_GB.properties | 5 +++ .../resources/i18n/lima-swing_fr_FR.properties | 5 +++ src/site/resources/screens/lima_open_entrybook.png | Bin 21208 -> 26349 bytes src/site/rst/assistant.rst | 3 +- src/site/rst/importexport.rst | 20 ++++++++-- 12 files changed, 156 insertions(+), 34 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java b/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java index 3a03314..78654b1 100644 --- a/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java +++ b/lima-swing/src/main/java/org/chorem/lima/enums/EntryBooksChartEnum.java @@ -22,20 +22,37 @@ package org.chorem.lima.enums; +import org.chorem.lima.beans.Labeled; + import java.net.URL; -public enum EntryBooksChartEnum { +import static org.nuiton.i18n.I18n.t; + +public enum EntryBooksChartEnum implements Labeled { + + IMPORT_DEFAULT("eb_default.csv", t("lima.chart.entryBook.import.default")),//"eb_default.csv" + IMPORT_CSV(null, t("lima.chart.entryBook.import.csv")), + IMPORT_EBP(null, t("lima.chart.entryBook.import.ebp")); - IMPORT(""), DEFAULT("eb_default.csv"); + private String label; private final String filePath; - EntryBooksChartEnum(String filePath) { + EntryBooksChartEnum(String filePath, String label) { + this.filePath = filePath; + this.label = label; } public URL getDefaultFileURL() { - URL url = ImportExportEnum.getFileURL("/import/" + filePath); + URL url = null; + if (filePath != null) { + url = ImportExportEnum.getFileURL("/import/" + filePath); + } return url; } + + public String getLabel() { + return label; + } } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css index 3d8265b..5fde1ba 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css @@ -23,17 +23,23 @@ title : "lima.entryBook.import.form"; } -#entryBooksDefault { - text : "lima.entryBook.default"; - value : "{EntryBooksChartEnum.DEFAULT}"; - buttonGroup : "{buttonGroup}"; +#importDefault { + text : "lima.importExport.entryBooks.default"; + value : "{EntryBooksChartEnum.IMPORT_DEFAULT}"; selected : true; + buttonGroup : buttonGroup; } -#entryBooksImport { - text : "lima.entryBook.import"; - value : "{EntryBooksChartEnum.IMPORT}"; - buttonGroup : "{buttonGroup}"; +#importcsv { + text : "lima.importExport.entryBooks.csv"; + value : "{EntryBooksChartEnum.IMPORT_CSV}"; + buttonGroup : buttonGroup; +} + +#importebp { + text : "lima.importExport.entryBooks.ebp"; + value : "{EntryBooksChartEnum.IMPORT_EBP}"; + buttonGroup : buttonGroup; } #cancel { diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx index 939e70e..a760f8f 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx @@ -45,12 +45,22 @@ <Table constraints="BorderLayout.CENTER"> <row> <cell> - <JRadioButton id="entryBooksDefault"/> + <JLabel id="entryBookLabel" /> </cell> </row> <row> <cell> - <JRadioButton id="entryBooksImport"/> + <JRadioButton id="importDefault"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importcsv"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importebp"/> </cell> </row> </Table> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java index ef3db65..dc6a452 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java @@ -291,10 +291,23 @@ public class EntryBookViewHandler implements ServiceListener { EntryBooksChartEnum entryBooksChartEnum = (EntryBooksChartEnum) value; // if action confirmed if (entryBooksChartEnum != null) { - ImportExport importExport = new ImportExport(view); - importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, - null, entryBooksChartEnum.getDefaultFileURL(), true); + switch (entryBooksChartEnum) { + case IMPORT_CSV: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_CSV.getDefaultFileURL(), true); + break; + case IMPORT_EBP: + importExport.importExport(ImportExportEnum.EBP_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_EBP.getDefaultFileURL(), true); + break; + + default: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, entryBooksChartEnum.getDefaultFileURL(), true); + break; + } + loadAllEntryBooks(); } } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css index ee620d9..78da71f 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.css @@ -23,7 +23,21 @@ text : "lima.opening.entryBook"; } -#importEntryBook { +#importDefault { text : "lima.importExport.entryBooks.default"; + value : "{EntryBooksChartEnum.IMPORT_DEFAULT}"; selected : true; + buttonGroup : buttonGroup; +} + +#importcsv { + text : "lima.importExport.entryBooks.csv"; + value : "{EntryBooksChartEnum.IMPORT_CSV}"; + buttonGroup : buttonGroup; +} + +#importebp { + text : "lima.importExport.entryBooks.ebp"; + value : "{EntryBooksChartEnum.IMPORT_EBP}"; + buttonGroup : buttonGroup; } \ No newline at end of file diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx index afed9d1..d109fce 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateEntryBookPanel.jaxx @@ -20,15 +20,31 @@ #L% --> <JPanel> + <import> + org.chorem.lima.enums.EntryBooksChartEnum + </import> + + <javax.swing.ButtonGroup id="buttonGroup"/> + <Table> <row> <cell> - <JLabel id="entryBookLabel"/> + <JLabel id="entryBookLabel" /> </cell> </row> <row> <cell> - <JCheckBox id='importEntryBook'/> + <JRadioButton id="importDefault"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importcsv"/> + </cell> + </row> + <row> + <cell> + <JRadioButton id="importebp"/> </cell> </row> </Table> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java index 5f634e5..c827846 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java @@ -36,11 +36,10 @@ import org.chorem.lima.enums.ImportExportEnum; import org.chorem.lima.enums.VatStatementsChartEnum; import org.chorem.lima.ui.importexport.ImportExport; -import javax.swing.BorderFactory; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; -import java.awt.Color; +import java.awt.*; import static org.nuiton.i18n.I18n.t; @@ -178,12 +177,8 @@ public class OpeningViewHandler { break; case 4: - if (ebPanel.getImportEntryBook().isSelected()) { - importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, - null, EntryBooksChartEnum.DEFAULT.getDefaultFileURL(), false); - } else { - importExport.resetInitialImportedEntryBook(); - } + importEntryBookLayouts(importExport); + view.getEntrybooksIcon().setBorder(noBorder); view.getFiscalperiodsIcon().setBorder(BorderFactory.createLineBorder(green, 2)); panel.add(fsPanel); @@ -212,6 +207,34 @@ public class OpeningViewHandler { } } + private void importEntryBookLayouts(ImportExport importExport) { + + Object value = ebPanel.getButtonGroup().getSelectedValue(); + // if action confirmed + if (value != null) { + // reset previous imported values + importExport.resetInitialImportedEntryBook(); + + EntryBooksChartEnum entryBooksChartEnum = (EntryBooksChartEnum) value; + + switch (entryBooksChartEnum) { + case IMPORT_CSV: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_CSV.getDefaultFileURL(), false); + break; + case IMPORT_EBP: + importExport.importExport(ImportExportEnum.EBP_ENTRYBOOKS_IMPORT, + null, EntryBooksChartEnum.IMPORT_EBP.getDefaultFileURL(), false); + break; + + default: + importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, + null, entryBooksChartEnum.getDefaultFileURL(), false); + break; + } + } + } + protected void importAccountabilityLayouts(ImportExport importExport) { Object value = caPanel.getButtonGroup().getSelectedValue(); // if action confirmed 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 a643208..218ae28 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 @@ -30,6 +30,9 @@ lima.chart.accounts.developed=Developed account chart lima.chart.accounts.import.csv=CSV customized accounting plan lima.chart.accounts.import.ebp=EBP customized accounting plan lima.chart.accounts.shortened=Shortened account chart +lima.chart.entryBook.import.csv=eb_ebp_default.csv +lima.chart.entryBook.import.default=eb_default.csv +lima.chart.entryBook.import.ebp=eb_csv_default.csv lima.close=Close lima.closed=Closed lima.code=Code @@ -418,7 +421,9 @@ lima.importExport.ebp=Import/Export EBP lima.importExport.encoding.choice= lima.importExport.entry=Entries import completed. lima.importExport.entryBook=entry book completed. +lima.importExport.entryBooks.csv=CSV import lima.importExport.entryBooks.default=Default entry book +lima.importExport.entryBooks.ebp=EBP import lima.importExport.export=Export lima.importExport.financialStatement=Financial transactions import completed. lima.importExport.financialTransaction=financial transaction completed. 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 9bbc6eb..efea358 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 @@ -30,6 +30,9 @@ lima.chart.accounts.developed=Développé lima.chart.accounts.import.csv=Personnalisé au format CSV lima.chart.accounts.import.ebp=Personnalisé au format EBP lima.chart.accounts.shortened=Abrégé +lima.chart.entryBook.import.csv=import CSV +lima.chart.entryBook.import.default=import par défaut +lima.chart.entryBook.import.ebp=import EBP lima.close=Fermer lima.config.category.directories=Répertoires lima.config.category.directories.description=Répertoires utilisés par Lima @@ -424,7 +427,9 @@ lima.importExport.ebp=Import/Export EBP lima.importExport.encoding.choice=Choix de l'encodage lima.importExport.entry=des écritures terminé. lima.importExport.entryBook=des journaux terminé. +lima.importExport.entryBooks.csv=Import CSV lima.importExport.entryBooks.default=Journaux par défaut +lima.importExport.entryBooks.ebp=Import EBP lima.importExport.export=Exporter lima.importExport.financialStatement=des déclaration financière terminé. lima.importExport.financialTransaction=des transaction financière terminé. diff --git a/src/site/resources/screens/lima_open_entrybook.png b/src/site/resources/screens/lima_open_entrybook.png index 6ca91a3..eae0072 100644 Binary files a/src/site/resources/screens/lima_open_entrybook.png and b/src/site/resources/screens/lima_open_entrybook.png differ diff --git a/src/site/rst/assistant.rst b/src/site/rst/assistant.rst index cf03e39..97966f1 100644 --- a/src/site/rst/assistant.rst +++ b/src/site/rst/assistant.rst @@ -78,8 +78,7 @@ Par défaut les quatres journaux les plus courants sont proposés au chargement - Caisse ; - Trésorerie. -Il est possible d'ajouter, modifier et supprimer des journaux en fonction de votre activité. -Menu Structure -> Journaux +Il est possible d'importer des jouranux depuis un fichier csv ou bien encore duis un fichier d'export généré par EBP. .. image:: screens/lima_open_entrybook.png diff --git a/src/site/rst/importexport.rst b/src/site/rst/importexport.rst index dab0de9..3eadd61 100644 --- a/src/site/rst/importexport.rst +++ b/src/site/rst/importexport.rst @@ -24,10 +24,23 @@ Import / Export =============== -Lima supporte actuellement deux formats d'import export : +Lima supporte actuellement deux formats d'import: -- Le CSV avec un modèle de donnée spécifique à Lima ; -- et le format EBP. +- le format CSV avec un modèle de donnée spécifique à Lima ; +- le format EBP, + +et 3 formats d'export: + +- FEC, +- CSV, +- EBP. + + +Format FEC (Fichier des écritures comptables) +--------------------------------------------- + +Le FEC est recquis par l’administration fiscale Française pour certains contrôles. +Tous les contribuables Français qui tiennent leur comptabilité au moyen de système informatisés doivent pouvoir remettre une copie du fichier des écritures comptables (FEC). Format CSV @@ -114,3 +127,4 @@ L'export est effectué ! .. _`disponible au téléchargement`: http://chorem.org/projects/lima/files + -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.