branch develop updated (f5f01d4 -> 807085c)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository lima. See http://git.chorem.org/lima.git from f5f01d4 Merge branch 'feature/1119' into develop new 565f06b fixes #1208 : ajouter le moi en toutes lettres + afficher la période dans la bar de statut new f60f3ab fixes #1225 : si l'exercice est sur deux années afficher les deux années (ex : "2015 - 2016") new b557829 refs #1208 : correction de la marge a droite de la balance. new 5d95df9 refs #1199 : ajout de l'export du fichier des écritures comptables new 12ce7b8 fixes #1228 : correction import comptes. new 449120d fixes #1119 : changement du layout pour les toolbar possiblement trop large new 1c0d6fb fixes #1208 : ajouter le moi en toutes lettres + afficher la période dans la bar de statut new 99faafa refs #1208 : correction de la marge a droite de la balance. new 807085c Merge branch 'feature/1208' into develop The 9 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 807085c43af02a06613b346d07eccdd914b62bac Merge: f5f01d4 99faafa Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 29 10:34:17 2015 +0200 Merge branch 'feature/1208' into develop commit 99faafa7ad710f469ef614d761c9765d7fc1318f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 29 10:25:42 2015 +0200 refs #1208 : correction de la marge a droite de la balance. commit 1c0d6fbf22ac8f399f631c56a909e4a00022d3ef Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 14:50:48 2015 +0200 fixes #1208 : ajouter le moi en toutes lettres + afficher la période dans la bar de statut commit 449120dc52781ac367bf52613502babc816c4529 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 12:10:59 2015 +0200 fixes #1119 : changement du layout pour les toolbar possiblement trop large commit 12ce7b86f68ee2c2091c3a5c3722e617dd503855 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 10:51:49 2015 +0200 fixes #1228 : correction import comptes. commit 5d95df95d82d7f348074cba7a9237b143aa9d0fb Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 13 16:39:10 2015 +0200 refs #1199 : ajout de l'export du fichier des écritures comptables commit b557829d463d284b729e8d70a4d18f8592e56665 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 29 10:25:42 2015 +0200 refs #1208 : correction de la marge a droite de la balance. commit f60f3ab6f704c290aae3ba34630fd7c9f372e21a Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 16:11:15 2015 +0200 fixes #1225 : si l'exercice est sur deux années afficher les deux années (ex : "2015 - 2016") commit 565f06b1c1d636c2188fdf08e1d390222cc7d089 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 14:50:48 2015 +0200 fixes #1208 : ajouter le moi en toutes lettres + afficher la période dans la bar de statut Summary of changes: .../ui/common/FinancialPeriodListRenderer.java | 14 +++++++++----- .../lima/ui/common/FiscalPeriodListRenderer.java | 21 ++++++++++++++++++--- .../FinancialTransactionView.css | 13 +++++++++---- .../FinancialTransactionView.jaxx | 5 ++--- .../FinancialTransactionViewHandler.java | 22 +++++++++++++++++----- .../resources/i18n/lima-swing_en_GB.properties | 1 + .../resources/i18n/lima-swing_fr_FR.properties | 5 +++-- 7 files changed, 59 insertions(+), 22 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 565f06b1c1d636c2188fdf08e1d390222cc7d089 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 14:50:48 2015 +0200 fixes #1208 : ajouter le moi en toutes lettres + afficher la période dans la bar de statut --- .../ui/common/FinancialPeriodListRenderer.java | 14 +++++++++----- .../FinancialTransactionView.css | 13 +++++++++---- .../FinancialTransactionView.jaxx | 5 ++--- .../FinancialTransactionViewHandler.java | 22 +++++++++++++++++----- .../resources/i18n/lima-swing_en_GB.properties | 1 + .../resources/i18n/lima-swing_fr_FR.properties | 1 + 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java b/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java index e6fcdd2..b973b78 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialPeriodListRenderer.java @@ -24,9 +24,9 @@ package org.chorem.lima.ui.common; import org.chorem.lima.entity.FinancialPeriod; -import javax.swing.*; -import java.awt.*; -import java.text.SimpleDateFormat; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JList; +import java.awt.Component; /** * Financial period list renderer. @@ -42,7 +42,7 @@ public class FinancialPeriodListRenderer extends DefaultListCellRenderer { /** serialVersionUID. */ private static final long serialVersionUID = -9089182547408397051L; - protected SimpleDateFormat df = new SimpleDateFormat("MM"); + // afiche le mois en lettre et le numero de la période, pour eviter les confusions entre deux mois identique pour des exercice de plus de 12 mois @Override public Component getListCellRendererComponent(JList list, Object value, @@ -51,7 +51,11 @@ public class FinancialPeriodListRenderer extends DefaultListCellRenderer { FinancialPeriod financialPeriod = (FinancialPeriod)value; Object newValue = financialPeriod; if (financialPeriod != null) { - newValue = df.format(financialPeriod.getBeginDate()); + // index = -1 pour la valeur sectionné + if (index < 0) { + index = list.getSelectedIndex(); + } + newValue = String.format("%1$tB (%2$d)", financialPeriod.getBeginDate(), index + 1); } return super.getListCellRendererComponent(list, newValue, index, isSelected, cellHasFocus); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css index de16542..ba07282 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css @@ -126,8 +126,13 @@ rowHeight : 22; } -#statusLabel { - text: {getStatusText()}; +#periodStatusLabel { + horizontalTextPosition:{JLabel.LEFT}; + border: {BorderFactory.createEmptyBorder(0, 5, 0, 0)} +} + +#balanceStatusLabel { horizontalTextPosition:{JLabel.RIGHT}; - border: {BorderFactory.createEmptyBorder(0, 20, 0, 0)} -} \ No newline at end of file + border: {BorderFactory.createEmptyBorder(0, 0, 0, 0)} +} + diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx index 67c2962..0d2b9c0 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx @@ -137,10 +137,9 @@ model='{financialTransactionTableModel}'/> </JScrollPane> - <String id="statusText" javaBean=''/> - <JPanel constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}"> - <JLabel id='statusLabel' constraints="BorderLayout.EAST"/> + <JLabel id='periodStatusLabel' constraints="BorderLayout.WEST"/> + <JLabel id='balanceStatusLabel' constraints="BorderLayout.EAST"/> </JPanel> </JPanel> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java index f65d248..98279e9 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java @@ -155,7 +155,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo (e.getColumn() == TableModelEvent.ALL_COLUMNS || e.getColumn() == 4 || e.getColumn() == 5)); if (mustRecompute) { - computeStatusText(); + computeBalanceStatusText(); } } @@ -322,6 +322,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo public void financialPeriodSelected(ItemEvent event) { if ( event.getStateChange() == ItemEvent.SELECTED ) { updateFinancialTransactions(); + computePeriodStatusText(); } } @@ -980,7 +981,18 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo return lastAssignDate; } - protected void computeStatusText() { + protected void computePeriodStatusText() { + + FinancialPeriod period = (FinancialPeriod) view.getFinancialPeriodComboBoxModel().getSelectedItem(); + + String result = t("lima.financialTransaction.statusTextPeriod", period.getBeginDate(), period.getEndDate()); + + view.getPeriodStatusLabel().setText(result); + + } + + + protected void computeBalanceStatusText() { String result; FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); @@ -1001,12 +1013,12 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo balance = totalDebit.subtract(totalCredit); if (balance.compareTo(BigDecimal.ZERO) == 0) { - result = String.format(t("lima.financialTransaction.statusTextDebitCredit"), BigDecimalToString.format(totalDebit), BigDecimalToString.format(totalCredit), BigDecimalToString.format(balance)); + result = t("lima.financialTransaction.statusTextDebitCredit", BigDecimalToString.format(totalDebit), BigDecimalToString.format(totalCredit), BigDecimalToString.format(balance)); } else { - result = String.format(t("lima.financialTransaction.statusTextDebitCreditError"), BigDecimalToString.format(totalDebit), BigDecimalToString.format(totalCredit), BigDecimalToString.format(balance)); + result = t("lima.financialTransaction.statusTextDebitCreditError", BigDecimalToString.format(totalDebit), BigDecimalToString.format(totalCredit), BigDecimalToString.format(balance)); } - view.setStatusText(result); + view.getBalanceStatusLabel().setText(result); } 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 e714505..352e1f2 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 @@ -281,6 +281,7 @@ lima.financialTransaction.previousFinancialPeriod=Previous financial period lima.financialTransaction.remove.confirm=Do you really want to remove this financial transaction? lima.financialTransaction.statusTextDebitCredit=<html>Debit\: <b>%s</b> - Credit\: <b>%s</b> - Balance\: <b>%s</b> lima.financialTransaction.statusTextDebitCreditError=<html>Debit\: <b>%s</b> - Credit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b> +lima.financialTransaction.statusTextPeriod= lima.financialTransaction.update.error.afterLastFiscalPeriod=Update financial transaction failed, financial transaction date is after last fiscal period date lima.financialTransaction.update.error.beforeFirstFiscalPeriod=Update financial transaction failed, financial transaction date is before first fiscal period date lima.financialTransaction.update.error.lockedEntryBook=Update financial transaction failed, locked entry book. 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 1045050..ddb71f5 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 @@ -298,6 +298,7 @@ lima.financialTransaction.previousFinancialPeriod=Période précédente lima.financialTransaction.remove.confirm=Voulez-vous supprimer cette transaction? lima.financialTransaction.statusTextDebitCredit=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b>%s</b> lima.financialTransaction.statusTextDebitCreditError=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b> +lima.financialTransaction.statusTextPeriod=<html>Période du <b>%1$td %1$tB %1$tY</b> au <b>%2$td %2$tB %2$tY</b></html> lima.financialTransaction.update.error.afterLastFiscalPeriod=Impossible de déplacer une transaction après le %1$te %1$tB %1$tY fin du dernier exercice. lima.financialTransaction.update.error.beforeFirstFiscalPeriod=Impossible de déplacer une transaction avant le %1$te %1$tB %1$tY début du premier exercice. lima.financialTransaction.update.error.lockedEntryBook=Impossible de déplacer une transaction car le jounal %2$s (%1$s) est cloturé pour la période du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY. -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit f60f3ab6f704c290aae3ba34630fd7c9f372e21a Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 16:11:15 2015 +0200 fixes #1225 : si l'exercice est sur deux années afficher les deux années (ex : "2015 - 2016") --- .../lima/ui/common/FiscalPeriodListRenderer.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java b/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java index 5e103d1..edc7789 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/common/FiscalPeriodListRenderer.java @@ -24,8 +24,9 @@ package org.chorem.lima.ui.common; import org.chorem.lima.entity.FiscalPeriod; -import javax.swing.*; -import java.awt.*; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JList; +import java.awt.Component; import java.text.SimpleDateFormat; /** @@ -50,9 +51,23 @@ public class FiscalPeriodListRenderer extends DefaultListCellRenderer { FiscalPeriod fiscalPeriod = (FiscalPeriod)value; Object newValue = fiscalPeriod; + if (fiscalPeriod != null) { - newValue = df.format(fiscalPeriod.getBeginDate()); + + String begin = df.format(fiscalPeriod.getBeginDate()); + String end = df.format(fiscalPeriod.getEndDate()); + + if (begin.equals(end)) { + + newValue = begin; + + } else { + + newValue = begin + " - " + end; + + } } + return super.getListCellRendererComponent(list, newValue, index, isSelected, cellHasFocus); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit b557829d463d284b729e8d70a4d18f8592e56665 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 29 10:25:42 2015 +0200 refs #1208 : correction de la marge a droite de la balance. --- .../chorem/lima/ui/financialtransaction/FinancialTransactionView.css | 2 +- lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css index ba07282..97f3fa5 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.css @@ -133,6 +133,6 @@ #balanceStatusLabel { horizontalTextPosition:{JLabel.RIGHT}; - border: {BorderFactory.createEmptyBorder(0, 0, 0, 0)} + border: {BorderFactory.createEmptyBorder(0, 0, 0, 20)} } 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 ddb71f5..005494c 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 @@ -296,8 +296,8 @@ lima.financialTransaction.day=Jour lima.financialTransaction.nextFinancialPeriod=Période suivante lima.financialTransaction.previousFinancialPeriod=Période précédente lima.financialTransaction.remove.confirm=Voulez-vous supprimer cette transaction? -lima.financialTransaction.statusTextDebitCredit=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b>%s</b> -lima.financialTransaction.statusTextDebitCreditError=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b> +lima.financialTransaction.statusTextDebitCredit=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b>%s</b></html> +lima.financialTransaction.statusTextDebitCreditError=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b></html>; lima.financialTransaction.statusTextPeriod=<html>Période du <b>%1$td %1$tB %1$tY</b> au <b>%2$td %2$tB %2$tY</b></html> lima.financialTransaction.update.error.afterLastFiscalPeriod=Impossible de déplacer une transaction après le %1$te %1$tB %1$tY fin du dernier exercice. lima.financialTransaction.update.error.beforeFirstFiscalPeriod=Impossible de déplacer une transaction avant le %1$te %1$tB %1$tY début du premier exercice. -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 5d95df95d82d7f348074cba7a9237b143aa9d0fb Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 13 16:39:10 2015 +0200 refs #1199 : ajout de l'export du fichier des écritures comptables --- .../chorem/lima/business/api/ExportService.java | 9 + .../lima/business/ejb/ExportServiceImpl.java | 46 +++++ .../business/ejb/csv/FiscalControlExportModel.java | 153 +++++++++++++++ .../java/org/chorem/lima/entity/EntryTopiaDao.java | 18 ++ .../src/main/java/org/chorem/lima/ui/MainView.css | 9 +- .../src/main/java/org/chorem/lima/ui/MainView.jaxx | 2 + .../java/org/chorem/lima/ui/MainViewHandler.java | 9 + .../FiscalControlExportView.css | 40 ++++ .../FiscalControlExportView.jaxx | 85 +++++++++ .../FiscalControlExportViewHandler.java | 205 +++++++++++++++++++++ .../resources/i18n/lima-swing_en_GB.properties | 25 +++ .../resources/i18n/lima-swing_fr_FR.properties | 17 ++ .../resources/icons/action-fiscalControlExport.png | Bin 0 -> 1244 bytes lima-swing/src/main/resources/icons/warning.png | Bin 0 -> 965 bytes 14 files changed, 616 insertions(+), 2 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java index 9d2ebef..bebba6c 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java @@ -22,7 +22,10 @@ package org.chorem.lima.business.api; +import org.chorem.lima.business.ExportResult; import org.chorem.lima.business.ImportExportResults; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FiscalPeriod; /** * Import export service. @@ -60,4 +63,10 @@ public interface ExportService { ImportExportResults exportEntriesAsEbp(String charset); ImportExportResults exportEntryBookAsEbp(String charset); + + //########## Fichier des écritures comptable en cas de contrôle fiscal ##################### + + ExportResult exportFiscalControl(FiscalPeriod period, EntryBook entryBookAtNew, String charset); + + String getFiscalControlFileName(FiscalPeriod fiscalPeriod); } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java index 2c9e119..a6e6f69 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java @@ -22,6 +22,8 @@ package org.chorem.lima.business.ejb; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; import org.chorem.lima.business.ExportResult; import org.chorem.lima.business.ImportExportResults; import org.chorem.lima.business.api.AccountService; @@ -38,6 +40,7 @@ import org.chorem.lima.business.ejb.csv.EntryBookModel; import org.chorem.lima.business.ejb.csv.EntryModel; import org.chorem.lima.business.ejb.csv.FinancialStatementModel; import org.chorem.lima.business.ejb.csv.FinancialTransactionModel; +import org.chorem.lima.business.ejb.csv.FiscalControlExportModel; import org.chorem.lima.business.ejb.csv.FiscalPeriodModel; import org.chorem.lima.business.ejb.csv.IdentityModel; import org.chorem.lima.business.ejb.csv.VatStatementModel; @@ -343,4 +346,47 @@ public class ExportServiceImpl extends AbstractLimaService implements ExportServ } return results; } + + @Override + public ExportResult exportFiscalControl(FiscalPeriod period, EntryBook entryBookAtNew, String charset) { + ExportResult exportResult = new ExportResult(Entry.class); + + EntryTopiaDao dao = getDaoHelper().getEntryDao(); + List<Entry> entities = dao.findAllEntryByDate(period.getBeginDate(), period.getEndDate()); + + // on place les écritures de report a nouveau au debut + List<Entry> entriesAtNew = dao.findAllEntryByDateForEntryBook(entryBookAtNew, period.getBeginDate(), period.getBeginDate()); + List<Entry> entries = Lists.newArrayListWithCapacity(entities.size()); + entities.removeAll(entriesAtNew); + entries.addAll(entriesAtNew); + entries.addAll(entities); + + if (!entries.isEmpty()) { + FiscalControlExportModel model = new FiscalControlExportModel(); + try { + exportResult.setExportData(Export.exportToString(model, entries, Charset.forName(charset), true)); + } catch (Exception e) { + exportResult.addException(new ExportException("Could not export entries.", e)); + } + } + + return exportResult; + } + + @Override + public String getFiscalControlFileName(FiscalPeriod fiscalPeriod) { + /* cf : http://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle + ** section IX + */ + + Identity identity = identityService.getIdentity(); + String siret= identity.getBusinessNumber(); + String siren = ""; + if (StringUtils.isNotBlank(siret)) { + siret = siret.replace(" ", ""); + siren = siret.substring(0, 9); + } + + return String.format("%1$sFEC%2$tY%2$tm%2$td", siren, fiscalPeriod.getEndDate()); + } } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FiscalControlExportModel.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FiscalControlExportModel.java new file mode 100644 index 0000000..241cae1 --- /dev/null +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/csv/FiscalControlExportModel.java @@ -0,0 +1,153 @@ +package org.chorem.lima.business.ejb.csv; + +/* + * #%L + * Lima :: business + * %% + * Copyright (C) 2008 - 2014 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.google.common.collect.Maps; +import org.chorem.lima.beans.Account; +import org.chorem.lima.entity.Entry; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FinancialTransaction; +import org.nuiton.csv.ExportModel; +import org.nuiton.csv.ExportableColumn; +import org.nuiton.csv.ModelBuilder; +import org.nuiton.csv.ValueFormatter; +import org.nuiton.csv.ValueGetter; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Map; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + * + * cf : http://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle + */ +public class FiscalControlExportModel implements ExportModel<Entry> { + + protected static String PROPERTY_ENTRY_BOOK_CODE = Entry.PROPERTY_FINANCIAL_TRANSACTION + "." + FinancialTransaction.PROPERTY_ENTRY_BOOK + "." + EntryBook.PROPERTY_CODE; + protected static String PROPERTY_ENTRY_BOOK_LABEL = Entry.PROPERTY_FINANCIAL_TRANSACTION + "." + FinancialTransaction.PROPERTY_ENTRY_BOOK + "." + EntryBook.PROPERTY_LABEL; + protected static String PROPERTY_DATE = Entry.PROPERTY_FINANCIAL_TRANSACTION + "." + FinancialTransaction.PROPERTY_TRANSACTION_DATE; + protected static String PROPERTY_ACCOUNT_NUMBER = Entry.PROPERTY_ACCOUNT + "." + Account.PROPERTY_ACCOUNT_NUMBER; + protected static String PROPERTY_ACCOUNT_LABEL = Entry.PROPERTY_ACCOUNT + "." + Account.PROPERTY_LABEL; + + + protected static ValueGetter<Entry, String> EMPTY_GETTER = new ValueGetter<Entry, String>() { + @Override + public String get(Entry object) throws Exception { + return ""; + } + }; + + protected static final ValueFormatter<Boolean> D_C_FORMATTER = new ValueFormatter<Boolean>() { + @Override + public String format(Boolean value) { + String result = value ? "D" : "C"; + return result; + } + }; + + protected static final ValueFormatter<Date> DATE_FORMATTER = new ValueFormatter<Date>() { + @Override + public String format(Date value) { + String result; + if (value != null) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); + result = simpleDateFormat.format(value); + } else { + result = ""; + } + return result; + } + }; + + protected static ValueGetter<Entry, String> DEBIT_GETTER = new ValueGetter<Entry, String>() { + @Override + public String get(Entry entry) throws Exception { + String result = ""; + if (entry != null && entry.isDebit()) { + result = String.valueOf(entry.getAmount()); + } + return result; + } + }; + + protected static ValueGetter<Entry, String> CREDIT_GETTER = new ValueGetter<Entry, String>() { + @Override + public String get(Entry entry) throws Exception { + String result = ""; + if (entry != null && !entry.isDebit()) { + result = String.valueOf(entry.getAmount()); + } + return result; + } + }; + + + @Override + public char getSeparator() { + return '|'; + } + + @Override + public Iterable<ExportableColumn<Entry, Object>> getColumnsForExport() { + ModelBuilder<Entry> modelBuilder = new ModelBuilder<>(); + modelBuilder.newColumnForExport("JournalCode", PROPERTY_ENTRY_BOOK_CODE); + modelBuilder.newColumnForExport("JournalLib ", PROPERTY_ENTRY_BOOK_LABEL); + modelBuilder.newColumnForExport("EcritureNum ", Entry.PROPERTY_FINANCIAL_TRANSACTION, new FinancialTransactionFormatter()); + modelBuilder.newColumnForExport("EcritureDate ", PROPERTY_DATE, DATE_FORMATTER); + modelBuilder.newColumnForExport("CompteNum", PROPERTY_ACCOUNT_NUMBER); + modelBuilder.newColumnForExport("CompteLib", PROPERTY_ACCOUNT_LABEL); + modelBuilder.newColumnForExport("CompAuxNum", EMPTY_GETTER); + modelBuilder.newColumnForExport("CompAuxLib", EMPTY_GETTER); + modelBuilder.newColumnForExport("PieceRef", Entry.PROPERTY_VOUCHER); + modelBuilder.newColumnForExport("PieceDate", PROPERTY_DATE, DATE_FORMATTER); + modelBuilder.newColumnForExport("EcritureLib", Entry.PROPERTY_DESCRIPTION); + modelBuilder.newColumnForExport("Debit ", DEBIT_GETTER); + modelBuilder.newColumnForExport("Credit ", CREDIT_GETTER); + modelBuilder.newColumnForExport("EcritureLet", Entry.PROPERTY_LETTERING); + modelBuilder.newColumnForExport("DateLet", EMPTY_GETTER); + modelBuilder.newColumnForExport("ValidDate", PROPERTY_DATE, DATE_FORMATTER); + modelBuilder.newColumnForExport("Montantdevise", EMPTY_GETTER); + modelBuilder.newColumnForExport("Idevise", EMPTY_GETTER); + + return (Iterable) modelBuilder.getColumnsForExport(); + } + + + + protected class FinancialTransactionFormatter implements ValueFormatter<FinancialTransaction> { + + Map<FinancialTransaction, Integer> numByTransactions = Maps.newHashMap(); + int nextNum = 0; + + @Override + public String format(FinancialTransaction value) { + Integer num = numByTransactions.get(value); + if (num == null) { + num = nextNum++; + numByTransactions.put(value, num); + } + return Integer.toString(num); + } + } +} diff --git a/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java b/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java index 8dcc557..7369610 100644 --- a/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java +++ b/lima-business/src/main/java/org/chorem/lima/entity/EntryTopiaDao.java @@ -173,12 +173,30 @@ public class EntryTopiaDao extends AbstractEntryTopiaDao<Entry> { builder.addEquals(PROPERTY_ENTRY_BOOK, entryBook); builder.addGreaterOrEquals(PROPERTY_TRANSACTION_DATE, beginDate); builder.addLowerOrEquals(PROPERTY_TRANSACTION_DATE, endDate); + builder.setOrderByArguments(PROPERTY_TRANSACTION_DATE, Entry.PROPERTY_FINANCIAL_TRANSACTION); List<Entry> entries = findAll(builder.getHql(), builder.getHqlParameters()); return entries; } /** + * Retourne les entrees des transaction entre deux dates. + * + * @param beginDate begin date + * @param endDate end date + */ + public List<Entry> findAllEntryByDate(Date beginDate, Date endDate) { + HqlAndParametersBuilder<Entry> builder = newHqlAndParametersBuilder(); + builder.addGreaterOrEquals(PROPERTY_TRANSACTION_DATE, beginDate); + builder.addLowerOrEquals(PROPERTY_TRANSACTION_DATE, endDate); + builder.setOrderByArguments(PROPERTY_TRANSACTION_DATE, Entry.PROPERTY_FINANCIAL_TRANSACTION); + + List<Entry> entries = findAll(builder.getHql(), builder.getHqlParameters()); + return entries; + } + + + /** * Retourne toutes les entrées d'une transaction * pour un compte et la présence d'un lettrage ou (xor) non * @param filter filtre sur les entrees, selon le compte, les dates de debut et de fin, et le lettrage diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css index d08d492..186f683 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.css @@ -104,7 +104,7 @@ #csvExportEntries { text : "lima.entries"; - actionIcon : "entries" + actionIcon : "entries"; } #ebp { @@ -128,7 +128,7 @@ #ebpImportEntries { text : "lima.entries"; - actionIcon : "entries" + actionIcon : "entries"; } #ebpExport { @@ -151,6 +151,11 @@ actionIcon : "entries" } +#fiscalControlExport { + text : "lima.fiscalControlExport"; + actionIcon : "fiscalControlExport"; +} + #documents { text : "lima.documents" } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx index 1a01d00..48f7721 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx @@ -105,6 +105,8 @@ onActionPerformed="getHandler().showImportExportView(this, ImportExportEnum.EBP_ENTRIES_EXPORT)"/> </JMenu> </JMenu> + <JMenuItem id="fiscalControlExport" + onActionPerformed="getHandler().showFiscalControlExport(this)"/> <JSeparator/> <JMenuItem id="documents" onActionPerformed="getHandler().openLimaHttpUi(this)"/> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java index 9211f1f..8b53397 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java @@ -42,6 +42,7 @@ import org.chorem.lima.ui.financialstatementchart.FinancialStatementChartView; import org.chorem.lima.ui.financialtransaction.FinancialTransactionView; import org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchView; import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView; +import org.chorem.lima.ui.fiscalControlExport.FiscalControlExportView; import org.chorem.lima.ui.fiscalperiod.FiscalPeriodView; import org.chorem.lima.ui.home.HomeView; import org.chorem.lima.ui.identity.IdentityForm; @@ -589,6 +590,14 @@ public class MainViewHandler { showTab(ui, name, container, true); } + public void showFiscalControlExport(JAXXContext rootContext) { + MainView mainView = getUI(rootContext); + FiscalControlExportView fiscalControlExportView = new FiscalControlExportView((JAXXContext) mainView); + fiscalControlExportView.setLocationRelativeTo(mainView); + fiscalControlExportView.setVisible(true); + + } + protected static class OnTabChangeListener implements ChangeListener { protected final HomeView homeView; diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportView.css b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportView.css new file mode 100644 index 0000000..f3106ac --- /dev/null +++ b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportView.css @@ -0,0 +1,40 @@ +#fiscalControlExportFormDialog { + title : "lima.fiscalControlExport.form"; + +} + +#fiscalPeriodLabel { + text : "lima.fiscalControlExport.fiscalPeriod"; + labelFor : "{fiscalPeriodComboBox}"; +} + +#fiscalPeriodComboBox { + renderer : "{new org.chorem.lima.ui.common.FiscalPeriodListRenderer()}"; +} + + + +#entryBookAtNewLabel { + text : "lima.fiscalControlExport.entryBookAtNew"; + labelFor : "{entryBookAtNewComboBox}"; +} + +#entryBookAtNewComboBox { + toolTipText : "lima.fiscalControlExport.entryBookAtNew.toolTip"; + renderer : "{new org.chorem.lima.ui.common.EntryBookListRenderer()}"; +} + +#sirenWarnLabel { + icon : "warning.png"; + text : "lima.fiscalControlExport.sirenMissing"; +} + +#cancel { + text : "lima.cancel"; + actionIcon : cancel; +} + +#export { + text : "lima.fiscalControlExport.export"; + actionIcon : export; +} \ No newline at end of file diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportView.jaxx new file mode 100644 index 0000000..c2aefbb --- /dev/null +++ b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportView.jaxx @@ -0,0 +1,85 @@ +<!-- + #%L + Lima :: Swing + %% + Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> +<JDialog id="fiscalControlExportFormDialog" + modal="true" + defaultCloseOperation="{JDialog.DISPOSE_ON_CLOSE}" + layout="{new BorderLayout()}"> + + <import> + java.io.File + java.awt.Dimension + org.chorem.lima.entity.FiscalPeriod + </import> + + <File id="exportFile" javaBean='null'/> + + <FiscalControlExportViewHandler id="handler" constructorParams="this"/> + + <script> + <![CDATA[ + getRootPane().setDefaultButton(export); + + void $afterCompleteSetup() { + handler.init(); + } + ]]> + </script> + + <JPanel constraints="BorderLayout.CENTER" + layout="{new BorderLayout()}"> + + <Table constraints="BorderLayout.CENTER"> + <row> + <cell anchor="east"> + <JLabel id="fiscalPeriodLabel"/> + </cell> + <cell fill="both" anchor="west"> + <org.chorem.lima.ui.common.FiscalPeriodComboBoxModel id="fiscalPeriodComboBoxModel"/> + + <JComboBox id="fiscalPeriodComboBox" + model="{fiscalPeriodComboBoxModel}"/> + </cell> + </row> + <row> + <cell anchor="east"> + <JLabel id="entryBookAtNewLabel"/> + </cell> + <cell fill="both" anchor="west"> + <org.chorem.lima.ui.common.EntryBookComboBoxModel id="entryBookAtNewComboBoxModel"/> + + <JComboBox id="entryBookAtNewComboBox" + model="{entryBookAtNewComboBoxModel}"/> + </cell> + </row> + </Table> + <JLabel id="sirenWarnLabel" + constraints="BorderLayout.SOUTH"/> + </JPanel> + + <JPanel constraints="BorderLayout.SOUTH" + layout='{new GridLayout(1,0)}'> + <JButton id="cancel" + onActionPerformed="dispose()"/> + <JButton id="export" + onActionPerformed="getHandler().export()"/> + </JPanel> +</JDialog> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportViewHandler.java new file mode 100644 index 0000000..2cd6aa9 --- /dev/null +++ b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalControlExport/FiscalControlExportViewHandler.java @@ -0,0 +1,205 @@ +package org.chorem.lima.ui.fiscalControlExport; + +import com.google.common.base.Charsets; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaSwingConfig; +import org.chorem.lima.business.ExportResult; +import org.chorem.lima.business.LimaServiceFactory; +import org.chorem.lima.business.api.EntryBookService; +import org.chorem.lima.business.api.ExportService; +import org.chorem.lima.business.api.FiscalPeriodService; +import org.chorem.lima.business.api.IdentityService; +import org.chorem.lima.entity.EntryBook; +import org.chorem.lima.entity.FiscalPeriod; +import org.chorem.lima.entity.Identity; +import org.chorem.lima.ui.importexport.ImportExportWaitView; +import org.chorem.lima.util.ErrorHelper; +import org.jdesktop.swingx.painter.BusyPainter; + +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.SwingWorker; +import java.awt.Color; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.rmi.server.ExportException; +import java.util.List; + +import static org.nuiton.i18n.I18n.t; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + */ +public class FiscalControlExportViewHandler { + + private static final Log log = LogFactory.getLog(FiscalControlExportViewHandler.class); + + protected FiscalControlExportView view; + + protected FiscalPeriodService fiscalPeriodService; + + protected EntryBookService entryBookService; + + protected IdentityService identityService; + + protected ExportService exportService; + + private ImportExportWaitView waitView; + + + public FiscalControlExportViewHandler(FiscalControlExportView view) { + this.view = view; + fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodService.class); + entryBookService = LimaServiceFactory.getService(EntryBookService.class); + identityService = LimaServiceFactory.getService(IdentityService.class); + exportService = LimaServiceFactory.getService(ExportService.class); + } + + public void init() { + List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllBlockedFiscalPeriods(); + view.getFiscalPeriodComboBoxModel().setObjects(fiscalPeriods); + view.getFiscalPeriodComboBoxModel().setSelectedItem(fiscalPeriods.get(fiscalPeriods.size()-1)); + List<EntryBook> entryBooks = entryBookService.getAllEntryBooks(); + view.getEntryBookAtNewComboBoxModel().setObjects(entryBooks); + Identity identity = identityService.getIdentity(); + view.getSirenWarnLabel().setVisible(StringUtils.isBlank(identity.getBusinessNumber())); + } + + public void export() { + FiscalPeriod fiscalPeriod = (FiscalPeriod) view.getFiscalPeriodComboBoxModel().getSelectedItem(); + EntryBook entryBookAtNew = (EntryBook) view.getEntryBookAtNewComboBoxModel().getSelectedItem(); + if (fiscalPeriod != null && entryBookAtNew != null) { + String fileName = exportService.getFiscalControlFileName(fiscalPeriod); + File homeDirectory = new File(System.getProperty("user.home")); + File exportFile = new File(homeDirectory, fileName); + + JFileChooser chooser = new JFileChooser(); + chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + chooser.setSelectedFile(exportFile); + String approveButtonText = t("lima.importExport.export"); + chooser.setDialogTitle(approveButtonText); + chooser.setApproveButtonText(approveButtonText); + + if (chooser.showOpenDialog(view) == JFileChooser.APPROVE_OPTION) { + exportFile = chooser.getSelectedFile(); + + boolean continueExport = true; + + if (!exportFile.getName().equals(fileName)) { + + String[] options = {t("lima.fiscalControlExport.file.nonConformanceName.continue"), t("lima.fiscalControlExport.file.nonConformanceName.cancel")}; + continueExport = 0 == JOptionPane.showOptionDialog( + view, + t("lima.fiscalControlExport.file.nonConformanceName", exportFile.getName(), fileName), + t("lima.fiscalControlExport.file.nonConformanceName.title"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[0]); + + } + + if (continueExport && exportFile.exists()) { + + String[] options = {t("lima.fiscalControlExport.file.overwrite.continue"), t("lima.fiscalControlExport.file.overwrite.cancel")}; + continueExport = 0 == JOptionPane.showOptionDialog( + view, + t("lima.fiscalControlExport.file.overwrite", exportFile.getName()), + t("lima.fiscalControlExport.file.overwrite.title"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[0]); + } + + if (continueExport) { + + //create the wait dialog panel + waitView = new ImportExportWaitView(); + waitView.setLocationRelativeTo(view); + BusyPainter busyPainter = waitView.getBusylabel().getBusyPainter(); + busyPainter.setHighlightColor(new Color(44, 61, 146).darker()); + busyPainter.setBaseColor(new Color(168, 204, 241).brighter()); + + new ExportWorker(fiscalPeriod, entryBookAtNew, exportFile).execute(); + + waitView.setVisible(true); + view.dispose(); + } + } + } + } + + + protected class ExportWorker extends SwingWorker<ExportResult, Void> { + + protected FiscalPeriod fiscalPeriod; + protected EntryBook entryBookAtNew; + protected File exportFile; + + public ExportWorker(FiscalPeriod fiscalPeriod, EntryBook entryBookAtNew, File exportFile) { + this.fiscalPeriod = fiscalPeriod; + this.entryBookAtNew = entryBookAtNew; + this.exportFile = exportFile; + } + + @Override + protected ExportResult doInBackground() throws Exception { + ExportResult exportResult = exportService.exportFiscalControl(fiscalPeriod, entryBookAtNew, Charsets.UTF_8.toString()); + List<ExportException> exportExceptions = exportResult.getExportExceptions(); + if (exportExceptions == null || exportExceptions.isEmpty()) { + BufferedWriter out = null; + try { + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportFile))); + out.write(exportResult.getExportData()); + out.flush(); + out.close(); + } catch (IOException eee) { + if (log.isErrorEnabled()) { + log.error("Can't write file " + exportFile, eee); + } + } finally { + IOUtils.closeQuietly(out); + } + } else { + throw exportExceptions.get(0); + } + return exportResult; + } + + @Override + protected void done() { + try { + + //hidde wait dialog panel + waitView.setVisible(false); + + // display result dialog + ExportResult exportResult = get(); + JOptionPane.showMessageDialog( + view, + t("lima.fiscalControlExport.success"), + t("lima.fiscalControlExport.success.title"), + JOptionPane.INFORMATION_MESSAGE); + + + } catch (Exception ex) { + if (log.isErrorEnabled()) { + log.error("Can't get result message", ex); + } + ErrorHelper errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); + errorHelper.showErrorDialog(null, ex.getMessage(), ex); + } + } + + } + +} 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 352e1f2..bad056f 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 @@ -151,6 +151,7 @@ lima.entries.copy.transaction=Copy transaction lima.entries.enter=Add entries lima.entries.entryBook=Entry book lima.entries.financialPeriod=Financial period +lima.entries.fiscalPeriod.toolTip= lima.entries.fiscalYear=fiscal year lima.entries.letter.closed.entryBook.error=Entry book close %2$s (%1$s) for period from %3$te %3$tB %3$tY to %4$te %4$tB %4$tY. lima.entries.letter.unbalanced.error= @@ -208,6 +209,11 @@ lima.error.notAllowedLabel= lima.export.exceptions=Export failed. lima.export.failed=Export faild \! lima.export.terminated=Successful export +lima.exportFiscalControl.export= +lima.exportFiscalControl.exportFile= +lima.exportFiscalControl.fileChooser= +lima.exportFiscalControl.fiscalPeriod= +lima.exportFiscalControl.form= lima.file=File lima.filer.condition.sensitive.case=Case sensitive lima.filter=Filter @@ -287,6 +293,25 @@ lima.financialTransaction.update.error.beforeFirstFiscalPeriod=Update financial lima.financialTransaction.update.error.lockedEntryBook=Update financial transaction failed, locked entry book. lima.financialTransaction.update.error.lockedFinancialPeriod=Update financial transaction failed, locked financial period. lima.financialTransaction.voucher=Voucher +lima.fiscalControlExport= +lima.fiscalControlExport.entryBookAtNew= +lima.fiscalControlExport.entryBookAtNew.toolTip= +lima.fiscalControlExport.export= +lima.fiscalControlExport.exportFile= +lima.fiscalControlExport.file.nonConformanceName= +lima.fiscalControlExport.file.nonConformanceName.cancel= +lima.fiscalControlExport.file.nonConformanceName.continue= +lima.fiscalControlExport.file.nonConformanceName.title= +lima.fiscalControlExport.file.overwrite= +lima.fiscalControlExport.file.overwrite.cancel= +lima.fiscalControlExport.file.overwrite.continue= +lima.fiscalControlExport.file.overwrite.title= +lima.fiscalControlExport.fileChooser= +lima.fiscalControlExport.fiscalPeriod= +lima.fiscalControlExport.form= +lima.fiscalControlExport.sirenMissing= +lima.fiscalControlExport.success= +lima.fiscalControlExport.success.title= lima.fiscalPeriod=Fiscal period lima.fiscalPeriod.add=Add fiscal period lima.fiscalPeriod.add.confirm.moreThan12=Fiscal period is not 12 month long, do you really want to continue ? 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 005494c..bff15db 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 @@ -304,6 +304,23 @@ lima.financialTransaction.update.error.beforeFirstFiscalPeriod=Impossible de dé lima.financialTransaction.update.error.lockedEntryBook=Impossible de déplacer une transaction car le jounal %2$s (%1$s) est cloturé pour la période du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY. lima.financialTransaction.update.error.lockedFinancialPeriod=Impossible de deplacer une transaction car la période fiscale du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY est cloturée. lima.financialTransaction.voucher=Pièce comptable +lima.fiscalControlExport=Export FEC +lima.fiscalControlExport.entryBookAtNew=Journal des reports à-nouveaux +lima.fiscalControlExport.entryBookAtNew.toolTip=Indiquez le journal correspondent aux écritures de reprise des soldes de l'exercice antérieur. +lima.fiscalControlExport.export=Exporter +lima.fiscalControlExport.file.nonConformanceName=Le non du fichier "%1$s" n'est pas conforme à celui attendu par l'administration "%2$S". \n Voulez-vous continuer l'export ? +lima.fiscalControlExport.file.nonConformanceName.cancel=Annuler +lima.fiscalControlExport.file.nonConformanceName.continue=Exporter +lima.fiscalControlExport.file.nonConformanceName.title=Nom de fichier non conforme +lima.fiscalControlExport.file.overwrite=Le fichier "%s" existe déjà. Voulez-vous le remplacer ? +lima.fiscalControlExport.file.overwrite.cancel=Annuler +lima.fiscalControlExport.file.overwrite.continue=Remplacer +lima.fiscalControlExport.file.overwrite.title=Fichier existant +lima.fiscalControlExport.fiscalPeriod=Exercice +lima.fiscalControlExport.form=Export du fichier des écritures comptables +lima.fiscalControlExport.sirenMissing=Attention \: Votre numéro de Siret n'est pas renseignié dans la fiche identité.\n +lima.fiscalControlExport.success=Export réalisé avec success +lima.fiscalControlExport.success.title=Export FEC lima.fiscalPeriod=Exercices lima.fiscalPeriod.add=Nouvel exercice (Ctrl+A) lima.fiscalPeriod.add.confirm.moreThan12=La période sélectionnée n'est pas de 12 mois, voulez-vous continuer ? diff --git a/lima-swing/src/main/resources/icons/action-fiscalControlExport.png b/lima-swing/src/main/resources/icons/action-fiscalControlExport.png new file mode 100644 index 0000000..ad87fe1 Binary files /dev/null and b/lima-swing/src/main/resources/icons/action-fiscalControlExport.png differ diff --git a/lima-swing/src/main/resources/icons/warning.png b/lima-swing/src/main/resources/icons/warning.png new file mode 100644 index 0000000..a5452e5 Binary files /dev/null and b/lima-swing/src/main/resources/icons/warning.png differ -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 12ce7b86f68ee2c2091c3a5c3722e617dd503855 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 10:51:49 2015 +0200 fixes #1228 : correction import comptes. --- .../org/chorem/lima/enums/AccountsChartEnum.java | 9 +- .../chorem/lima/ui/account/AccountViewHandler.java | 10 +- .../chorem/lima/ui/importexport/ImportExport.java | 21 +- .../src/main/resources/import/pcg_developed.csv | 831 ++++++++++++++++++++- 4 files changed, 848 insertions(+), 23 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java b/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java index cab2b65..483d6d4 100644 --- a/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java +++ b/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java @@ -33,8 +33,8 @@ public enum AccountsChartEnum implements Labeled { BASE("pcg_base.csv", t("lima.chart.accounts.base")), SHORTENED("pcg_shortened.csv", t("lima.chart.accounts.shortened")), DEVELOPED("pcg_developed.csv", t("lima.chart.accounts.developed")), - IMPORT("", t("lima.chart.accounts.import.csv")), - IMPORT_EBP("", t("lima.chart.accounts.import.ebp")); + IMPORT(null, t("lima.chart.accounts.import.csv")), + IMPORT_EBP(null, t("lima.chart.accounts.import.ebp")); protected String filePath; @@ -46,7 +46,10 @@ public enum AccountsChartEnum implements Labeled { } public URL getDefaultFileURL() { - URL url = ImportExportEnum.getFileURL("/import/" + filePath); + URL url = null; + if (filePath != null) { + url = ImportExportEnum.getFileURL("/import/" + filePath); + } return url; } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java index 3510a61..d4e683f 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java @@ -470,14 +470,20 @@ public class AccountViewHandler implements ServiceListener { //Import accounts chart switch (defaultAccountsChartEnum) { case IMPORT_EBP: - importExport.importExport(ImportExportEnum.EBP_ACCOUNTCHARTS_IMPORT, null, null, false); + importExport.importExport(ImportExportEnum.EBP_ACCOUNTCHARTS_IMPORT, + null, + defaultAccountsChartEnum.getDefaultFileURL(), + false); break; default: importExport.importExport(ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT, - null, null, false); + null, + defaultAccountsChartEnum.getDefaultFileURL(), + false); break; } + loadAllAccounts(); } } 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 164ec2d..1e9faf9 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 @@ -23,7 +23,6 @@ package org.chorem.lima.ui.importexport; import com.google.common.base.Charsets; -import com.google.common.base.Strings; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; @@ -34,6 +33,7 @@ import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.business.ExportResult; import org.chorem.lima.business.ImportExportResults; import org.chorem.lima.business.ImportResult; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.api.ExportService; import org.chorem.lima.business.api.ImportService; import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatementException; @@ -60,12 +60,19 @@ import org.chorem.lima.entity.Identity; import org.chorem.lima.entity.VatStatement; import org.chorem.lima.enums.EncodingEnum; import org.chorem.lima.enums.ImportExportEnum; -import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; import org.jdesktop.swingx.painter.BusyPainter; -import javax.swing.*; -import java.awt.*; +import javax.swing.JComboBox; +import javax.swing.JFileChooser; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; @@ -138,7 +145,7 @@ public class ImportExport { */ public void importExport(final ImportExportEnum importExportChoice, String exportPath, URL importUrl, boolean verbose) { final Charset defaultCharset = Charsets.UTF_8; - if (Strings.isNullOrEmpty(exportPath) && importUrl == null) { + if (StringUtils.isBlank(exportPath) && importUrl == null) { exportPath = chooseFile(importExportChoice.getImportMode(), importExportChoice); if (exportPath != null) { // if null ==> cancel import/export File file = new File(exportPath); @@ -153,7 +160,9 @@ public class ImportExport { } } } - processImportExport(verbose, importExportChoice, defaultCharset, exportPath, importUrl); + if (StringUtils.isNotBlank(exportPath) || importUrl != null) { + processImportExport(verbose, importExportChoice, defaultCharset, exportPath, importUrl); + } } diff --git a/lima-swing/src/main/resources/import/pcg_developed.csv b/lima-swing/src/main/resources/import/pcg_developed.csv index 01fa94c..22bf4d5 100644 --- a/lima-swing/src/main/resources/import/pcg_developed.csv +++ b/lima-swing/src/main/resources/import/pcg_developed.csv @@ -172,15 +172,822 @@ accountNumber;label;thirdParty 2138;Ouvrages d'infrastructure; 21385;Pistes d'aérodromes; 214;Constructions sur sol d'autrui; -21511;"- sur sol propre;"";2151;"" -ACCN;2151;Installations complexes spécialisées;"";215;"" -ACCN;21514;- sur sol d'autrui;"";2151;"" -ACCN;21531;- sur sol propre;"";2153;"" -ACCN;2153;Installations à caractère spécifique;"";215;"" -ACCN;21534;- sur sol d'autrui;"";2153;"" -ACCN;2154;Matériel industriel;"";215;"" -ACCN;2155;Outillage industriel;"";215;"" -ACCN;215;Installations techniques";" matériel et outillage industriels;"";21;"" -ACCN;2157;Agencements et aménagements du matériel et outillages ind.;"";215;"" -ACCN;21;IMMOBlLlSATIONS CORPORELLES;"";2;"" -ACCN;2181;Installations générales" \ No newline at end of file +21511;"- sur sol propre"""; +2151;Installations complexes spécialisées; +21514;- sur sol d'autrui; +21531;- sur sol propre; +2153;Installations à caractère spécifique; +21534;- sur sol d'autrui; +2154;Matériel industriel; +2155;Outillage industriel; +215;"Installations techniques; matériel et outillage industriels"; +2157;Agencements et aménagements du matériel et outillages ind.; +21;IMMOBlLlSATIONS CORPORELLES; +2181;"Installations générales; agencements; aménagements divers"; +2182;Matériel de transport; +2183;Matériel de bureau et matériel informatique; +2184;Mobilier; +2185;Cheptel; +218;Autres immobilisations corporelles; +2186;Emballages récupérables; +22;IMMOBILISATIONS MISES EN CONCESSION; +2312;Terrains; +2313;Constructions; +2315;"Installations techniques; matériel et outillage industriel"; +231;Immobilisations corporelles en cours; +2318;Autres immobilisations corporelles; +232;Immobilisations incorporelles en cours; +237;Avances et acomptes versés sur immobilisations incorporelles; +23;IMMOBILlSATlONS EN COURS; +2382;Terrains; +2383;Constructions; +2385;"Installations techniques; matériel et outillage industriel"; +238;Avances et acomptes versés sur immobilisations corporelles; +2388;Autres immobilisations corporelles; +25;ENTREPRISES LIEES - PARTS ET CREANCES; +2611;Actions; +261;Titres de participation; +2618;Autres titres; +266;Autres formes de participation; +2671;Créances rattachées à des participations (groupe); +2674;Créances rattachées à des participations (hors groupe); +2675;Versements représentatifs d'apports non capitalisés; +2676;Avances consolidables; +2677;Autres créances rattachées à des participations; +267;Créances rattachées à des participations; +2678;Intérêts courus; +2681;Principal; +268;Créances rattachées à des sociétés en participation; +2688;Intérêts courus; +26;PARTICIPATIONS ET CREANCES RATTACHEES A DES PARTICIPATIONS; +269;Versements restant sur titres de participation non libérés; +2711;Actions; +271;Titres immobilisés autres que les titres immobilisés de l'ac; +2718;Autres titres; +2721;Obligations; +272;Titres immobilisés (droit de créance); +2722;Bons; +273;Titres immobilisés de l'activité de portefeuille; +2741;Prêts participatifs; +2742;Prêts aux associés; +2743;Prêts au personnel; +274;Prêts; +2748;Autres prêts; +2751;Dépôts; +275;Dépôts et cautionnements versés; +2755;Cautionnements; +2761;Créances diverses; +276;Autres créances immobilisées; +27682;Sur titres immobilises (droit de créance); +27684;Sur prêts; +27685;Sur dépôts et cautionnements; +2768;Intérêts courus; +27688;Sur créances diverses; +2771;Actions propres ou parts propres; +277;Actions propres ou parts propres; +2772;Actions propres ou parts propres en voie d'annulation; +27;AUTRES IMMOBILISATIONS FINANCIERES; +279;Versements restantsur titres immobilisés non libérés; +2801;Frais d'établissement; +2803;Frais de recherche et de développement; +2805;"Concessions et droits similaires; brevets; licences; logicie"; +2807;Fonds commercial; +280;Amortissements des immobilisations incorporelles; +2808;Autres immobilisations incorporelles; +2811;Terrains de gisement; +2812;"Agencements; aménagements de terrains"; +2813;Constructions; +2814;Constructions sur sol d'autrui; +2815;"Installations techniques; matériel et outillage industriels"; +281;Amortissements des immobilisations corporelles; +2818;Autres immobilisations corporelles; +28;AMORTISSEMENTS DES IMMOBILISATIONS; +282;Amortissements des immobilisations mises en concession; +2;COMPTES D'IMMOBILISATIONS; +2905;"Marques; procédes; droits et valeurs similaires"; +2906;Droit au bail; +2907;Fonds commercial; +290;Provisions pour dépréciation immobilisations incorporelles; +2908;Autres immobilisations incorporelles; +291;Provisions pour dépréciation immobilisations corporelles; +2911;Terrains (autres que terrains de gisement); +292;Provisions pour dépréciation des immos mises en concession; +293;Provisions pour dépréciation des immobilisations en cours; +2931;Immobilisations corporelles en cours; +2961;Titres de participation; +2966;Autres formes de participation; +2967;Créances rattachées à des participations; +296;Provisions pour dépréciation des participations et créances; +2968;Créances rattachées à des sociétés en participation; +29;PROVISIONS POUR DEPRECIATION DES IMMOBILISATIONS; +2971;Titres immobilisés autres que les titres du portefeuille- dr; +2972;Titres immobilisés - droit de créance; +2973;Titres immobilisés de l'activité du portefeuille; +2974;Prêts; +2975;Dépôts et cautionnements versés; +297;Provisions pour dépréciation des immobilisations financières; +2976;Autres créances immobilisées; +310;Stocks d'approvisionnement; +311;Matière (ou groupe) A; +312;Matière (ou groupe) B; +31;MATIERES PREMIERES (et fournitures); +317;"Fournitures A; B; C ..."; +3211;Matière (ou groupe) C; +321;Matières consommables; +3212;Matière (ou groupe) D; +3221;Combustibles; +3222;Produits d'entretien; +3223;Fournitures d'atelier et d'usine; +3224;Fournitures de magasin; +322;Fournitures consommables; +3225;Fournitures de bureau; +32;AUTRES APPROVISIONNEMENTS; +3261;Emballages perdus; +3265;Emballages récupérables non identifiables; +326;Emballages; +3267;Emballages à usage mixte; +3311;Produit en cours P 1; +331;Produits en cours; +3312;Produit en cours P 2; +33;EN-COURS DE PRODUCTION DE BIENS; +3351;Travaux en cours T 1; +335;Travaux en cours; +3352;Travaux en cours T 2; +3411;Etude en cours E 1; +341;Etudes en cours; +3412;Etude en cours E 2; +34;EN-COURS DE PRODUCTION DE SERVICES; +3451;Prestation de services S 1; +345;Prestations de services en cours; +3452;Prestation de services S 2; +3511;Produit intermédiaire (ou groupe ) A; +351;Produits intermédiaires; +3512;Produit intermédiaire (ou groupe) B; +3551;Produit fini (ou groupe) A; +355;Produits finis; +3552;Produit fini (ou groupe) B; +35;STOCKS DE PRODUITS; +3581;Déchets; +3585;Rebuts; +358;Produits résiduels (ou matières de récupérations); +3586;Matières de récupération; +36;STOCKS PROVENANT D'IMMOBILISATIONS; +370;Stocks de marchandises; +371;Marchandise (ou groupe) A; +37;STOCKS DE MARCHANDISES; +372;Marchandise (ou groupe) B; +38;"STOCKS EN VOIE D'ACHEMINEMENT; MIS EN DEPOT OU CONSIGNES"; +3;COMPTES DE STOCKS ET D'EN-COURS; +3911;Matière (ou groupe A); +3912;Matière (ou groupe B); +391;Provisions pour dépréciation des stocks d'approvisionnement; +3917;"Fourniture A; B; C ..."; +3921;Matières consommables (même ventilation que celle du compte; +3922;Fournitures consommables; +392;Provisions pour dépréciation des autres approvisionnements; +3926;Emballages; +3931;Produits en cours; +393;Provisions pour dépréciation en-cours de production de biens; +3935;Travaux en cours; +3941;Etudes en cours; +394;Provisions pour dépréciation en-cours de prod. de services; +3945;Prestations de services en cours; +3951;Produits intermédiaires; +395;Provisions pour dépréciation des stocks de produits; +3955;Produits finis; +39;PROVISIONS POUR DEPRECIATION DES STOCKS ET EN-COURS; +3971;Marchandise (ou groupe) A; +397;Provisions pour dépréciation des stocks de marchandises; +3972;Marchandise (ou groupe) B; +400;Fournisseurs et comptes rattachés; +4011;Fournisseurs - Achats de biens ou de prestations de services; +401;Fournisseurs; +4017;Fournisseurs - Retenue de garantie; +403;Fournisseurs - Effets à payer; +4041;Fournisseurs - Achats d'immobilisations; +404;Fournisseurs d'immobilisations; +4047;Fournisseurs d'immobilisations - Retenues de garantie; +405;Fournisseurs d'immobilisations - Effets a payer; +4081;Fournisseurs; +4084;Fournisseurs d'immobilisations; +408;Fournisseurs - Factures non parvenues; +4088;Fournisseurs - Intérêts courus; +40;FOURNISSEURS ET COMPTES RATTACHES; +4091;Fournisseurs - Avances et acomptes versés sur commandes; +4096;Fournisseurs - Créances pour emballages et matériel à rendre; +40971;Fournisseurs d'exploitation; +4097;Fournisseurs - Autres avoirs; +40974;Fournisseurs d'immobilisations; +409;Fournisseurs débiteurs; +4098;"Rabais; remises; ristournes à obtenir"; +410;Clients et comptes rattachés; +4111;Clients - Ventes de biens ou de prestations de services; +411;Clients; +4117;Clients - Retenues de garanties; +413;Clients - Effets a recevoir; +416;Clients douteux ou litigieux; +417;Créances sur travaux non encore facturables; +4181;Clients - Factures à établir; +418;Clients - Produits non encore facturés; +4188;Clients - Intérêts courus; +41;CLIENTS ET COMPTES RATTACHES; +4191;Clients - Avances et acomptes reçus sur commandes; +4196;Clients - Dettes pour emballages et matériel consignés; +4197;Clients - Autres avoirs; +419;Clients créditeurs; +4198;"Rabais; remises; ristournes à accorder"; +421;Personnel - Rémunérations dues; +422;"Comités d'entreprise; d'établissement"; +4246;Réserve spéciale (art. L442-2 du Code du Travail); +424;Participation des salariés aux fruits de l'expansion; +4248;Comptes courants; +425;Personnel - Avances et acomptes; +426;Personnel - Dépôts; +427;Personnel - Oppositions; +42;PERSONNEL ET COMPTES RATTACHES; +4282;Dettes provisionnées pour congés à payer; +4284;Dettes provisionnées pour participation des salariés aux rés; +4286;Autres charges à payer; +428;Personnel - Charges à payer et produits à recevoir; +4287;Produits à recevoir; +431;Sécurité sociale; +437;Autres organismes sociaux; +43;SECURITE SOCIALE - AUTRES ORGANISMES SOCIAUX; +4382;Charges sociales sur congés à payer; +4386;Autres charges à payer; +438;Organismes sociaux - Charges à payer et produits à recevoir; +4387;Produits à recevoir; +4411;Subventions d'investissement; +4417;Subventions d'exploitation; +4418;Subventions d'équilibre; +441;Etat - Subventions à recevoir; +4419;Avances sur subventions; +4424;Obligataires; +442;Etat - Impôts et taxes recouvrables sur des tiers; +4425;Associés; +443;"Opérations particulières avec l'Etat; les collectivités"; +444;Etat - Impôts sur les bénéfices; +4452;TVA due intracommunautaire; +44551;TVA à décaisser; +4455;Taxes sur le chiffre d'affaires à décaisser; +44558;Taxes assimilées à la TVA; +44562;TVA sur immobilisations; +44563;TVA transférée par d'autres entreprises; +445661;"TVA sur autres biens et services 19;6% débits"; +445662;"TVA sur autres biens et services 5;5% débits"; +445664;"TVA sur autres biens et services 19;6% encaissements"; +44566;TVA sur autres biens et services; +445665;"TVA sur autres biens et services 5;5% encaissements"; +44567;Crédit de TVA à reporter; +4456;Taxes sur le chiffre d'affaires déductible; +44568;Taxes assimilées à la TVA; +445711;"TVA collectée 19;6 % débits"; +445712;"TVA collectée 5;5 % débits"; +445714;"TVA collectée 19;6 % encaissements"; +44571;TVA collectée; +445715;"TVA collectée 5;5 % encaissements"; +4457;Taxes sur le chiffre d'affaires collectées par l'entreprise; +44578;Taxes assimilées à la TVA; +445;Etat - Taxes sur le chiffre d'affaires; +44581;Acomptes - Régime simplifié d'imposition; +44582;Acomptes - Régime du forfait; +44583;Remboursement de taxes sur le chiffre d'affaires demandé; +44584;TVA récupérée d'avance; +44586;Taxes sur le chiffre d'affaires sur factures non parvenues; +4458;Taxes sur le chiffre d'affaires à régulariser ou en attente; +44587;Taxes sur le chiffre d'affaires sur factures à établir; +446;Obligations cautionnées; +447;"Autres impôts; taxes et versements assimilés"; +44;ETAT ET AUTRES COLLECTIVITES PUBLIQUES; +4482;Charges fiscales sur congés à payer; +4486;Autres charges à payer; +448;Etat - Charges à payer et produits à recevoir; +4487;Produits à recevoir; +451;Groupe; +4551;Principal; +455;Associés - Comptes courants; +4558;Intérêts courus; +45611;Apports en nature; +4561;Associés - Comptes d'apport en société; +45615;Apports en numéraire; +45621;"Actionnaires - Capital souscrit et appelé; non versé"; +4562;"Apporteurs - Capital appelé; non versé"; +45625;"Associés - Capital appelé; non versé"; +4563;Associés - Versements reçus sur augmentation de capital; +4564;Associés - Versements anticipés; +4566;Actionnaires défaillants; +456;Associés - Opérations sur le capital; +4567;Associés - Capital à rembourser; +457;Associés - Dividendes à payer; +45;GROUPES ET ASSOCIES; +4581;Opérations courantes; +458;Associés - Opérations faites en commun et en G.I.E.; +4588;Intérêts courus; +462;Créances sur cessions d'immobilisations; +464;Dettes sur acquisition de valeurs mobilières de placement; +465;Créances sur cessions de valeurs mobilières de placement; +467;Autres comptes débiteurs ou créditeurs; +46;DEBITEURS ET CREDITEURS DIVERS; +4686;Charges à payer; +468;Divers - Charges à payer et Produits à recevoir; +4687;Produits à recevoir; +470;Compte d'attente; +471;Compte d'attente; +4761;Diminution des créances; +4762;Augmentation des dettes; +476;Différences de conversion - Actif; +4768;Différences compensées par couverture de change; +4771;Augmentation des créances; +4772;Diminution des dettes; +477;Différences de conversion - Passif; +4778;Différences compensées par couverture de change; +47;COMPTES TRANSITOIRES OU D'ATTENTE; +478;Autres comptes transitoires; +4811;Charges différées; +4812;Frais d'acquisition des immobilisations; +4816;Frais d'émission des emprunts; +481;Charges à repartir sur plusieurs exercices; +4818;Charges à étaler; +486;Charges constatées d'avance; +487;Produits constatés d'avance; +48;COMPTE DE REGULARISATION; +4886;Charges; +488;Comptes de répartition périodique des charges et produits; +4887;Produits; +4;COMPTES DE TIERS; +491;Provisions pour dépréciation des comptes de clients; +4951;Comptes du groupe; +4955;Comptes courants des associés; +495;Provisions pour dépréciation comptes du groupe et associés; +4958;Opérations faites en commun et en G.I.E.; +49;PROVISIONS POUR DEPRECIATION DES COMPTES DE TIERS; +4962;Créances sur cessions d'immobilisations; +4965;Créances sur cessions de valeurs mobilières de placement; +496;Provisions pour dépréciation des comptes de débiteurs divers; +4967;Autres comptes débiteurs; +501;Parts dans des entreprises liées; +502;Actions propres; +5031;Titres cotés; +503;Actions; +5035;Titres non cotés; +504;Autres titres conférant un droit de propriété; +505;Obligations et bons émis par la société et rachetés par elle; +5061;Titres cotés; +506;Obligations; +5065;Titres non cotés; +507;Bons du Trésor et bons de caisse à court terme; +5081;Autres valeurs mobilières; +5082;Bons de souscription; +508;Autres valeurs mobilières de placement et autres créances as; +5088;"Intérêts courus sur obligations; bons et valeurs assimilées"; +50;VALEURS MOBILIERES DE PLACEMENT; +509;Versements restant sur valeurs mobilières de placement; +5111;Espèces; +5112;Chèques; +5113;Cartes bancaires; +511;Valeurs à I'encaissement; +5114;Autres paiements; +5121;Banque principale; +5122;Banque secondaire; +512;Banques; +5124;Comptes en devises; +514;Chèques postaux; +515;Caisses du Trésor et des établissements publics; +516;Sociétés de bourse; +517;Autres organismes financiers; +5186;Intérêts courus à payer; +518;Intérêts courus; +5187;Intérêts courus à recevoir; +51;"BANQUES; ETABLISSEMENTS FINANCIERS ET ASSIMILES"; +5191;Crédit de mobilisation de créances commerciales (CMCC); +5193;Mobilisation de créances nées à l'étranger; +519;Concours bancaires courants; +5198;Intérêts courus sur concours bancaires courants; +52;Instruments de trésorerie; +530;Caisse; +5311;Caisse en monnaie nationale; +531;Caisse siège social; +5314;Caisse en devises; +532;Caisse succursale (ou usine) A; +53;CAISSE; +533;Caisse succursale (ou usine) B; +54;REGIES D'AVANCES ET ACCREDITIFS; +540;Régies d'avances et accréditifs; +58;VIREMENTS INTERNES; +580;Virements internes; +5;COMPTES FINANCIERS; +59;PROVISIONS POUR DEPRECIATION DES COMPTES FINANCIERS; +5903;Actions; +5904;Autres titres conférant un droit de propriété; +5906;Obligations; +590;Provisions pour dépréciation valeurs mobilières de placement; +5908;Autres valeurs mobilières de placement et créances assimilée; +6011;Matière (ou groupe) A; +6012;Matière (ou groupe) B; +601;Achats stockés - Matières premières (et fournitures); +6017;"Fournitures A; B; C ..."; +60211;Matière (ou groupe) C; +6021;Matières consommables; +60212;Matière (ou groupe) D; +60221;Combustibles; +60222;Produits d'entretien; +60223;Fournitures d'atelier et d'usine; +60224;Fournitures de magasin; +6022;Fournitures consommables; +60225;Fournitures de bureau; +602;Achats stockés - Autres approvisionnements; +60261;Emballages perdus; +60265;Emballages récupérables non identifiables; +6026;Emballages; +60267;Emballages à usage mixte; +6031;Variation des stocks de matières premières (et fournitures); +6032;Variation des stocks des autres approvisionnements; +603;Variation des stocks (approvisionnements et marchandises); +6037;Variation des stocks de marchandises; +604;Achats d'études et prestations de service; +605;"Achats de matériel; équipements et travaux"; +6061;"Fournitures non stockables (eau; énergie; ...)"; +6063;Fournitures d'entretien et de petit équipement; +6064;Fournitures administratives; +606;Achats non stockés de matières et fournitures; +6068;Autres matières et fournitures; +6071;Marchandise (ou groupe) A; +607;Achats de marchandises; +6072;Marchandise (ou groupe ) B; +608;Frais accessoires d'achat; +60;ACHATS (sauf 603); +6091;- de matières premières (et fournitures); +6092;- d'autres approvisionnements stockés; +6094;- d'études et prestations de services; +6095;"- de matériel; équipements et travaux"; +6096;- d'approvisionnements non stockés; +609;"Rabais; remises et ristournes obtenus sur achats"; +6097;- de marchandises; +611;Sous-traitance générale; +6122;Crédit-bail mobilier; +612;Redevances de crédit-bail; +6125;Crédit-bail immobilier; +6132;Locations immobilières; +6135;Locations mobilières; +613;Locations; +6136;Malis sur emballages; +614;Charges locatives et de copropriété; +6152;- sur biens immobiliers; +6155;- sur biens mobiliers; +615;Entretien et réparations; +6156;Maintenance; +6161;Multirisques; +6162;Assurance obligatoire dommage - construction; +61636;- sur achats; +61637;- sur ventes; +6163;Assurance - transport; +61638;- sur autres biens; +6164;Risques d'exploitation; +616;Primes d'assurance; +6165;Insolvabilité clients; +617;Etudes et recherches; +6181;Documentation générale; +6183;Documentation technique; +618;Divers; +6185;"Frais de colloques; séminaires; conférences"; +61;SERVICES EXTERIEURS; +619;Rabais remises et ristournes obtenus sur services extérieurs; +6211;Personnel intérimaire; +621;Personnel extérieur à l'entreprise; +6214;Personnel détaché ou prêté à l'entreprise; +6221;Commissions et courtages sur achats; +6222;Commissions et courtages sur ventes; +6224;Rémunérations des transitaires; +6225;Rémunérations d'affacturage; +6226;Honoraires; +6227;Frais d'actes et de contentieux; +622;Rémunérations d'intermédiaires et honoraires; +6228;Divers; +6231;Annonces et insertions; +6232;Echantillons; +6233;Foires et expositions; +6234;Cadeaux à la clientèle; +6235;Primes; +6236;Catalogues et imprimés; +6237;Publications; +623;"Publicité; publications; relations publiques"; +6238;"Divers (pourboires; dons courants; ...)"; +6241;Transports sur achats; +6242;Transports sur ventes; +6243;Transports entre établissements ou chantiers; +6244;Transports administratifs; +6247;Transports collectifs du personnel; +624;Transports de biens et transports collectifs du personnel; +6248;Divers; +6251;Voyages et déplacements; +6255;Frais de déménagement; +6256;Missions; +625;"Déplacements; missions et réceptions"; +6257;Réceptions; +626;Frais postaux et frais de télécommunications; +6271;"Frais sur titres (achat; vente; garde)"; +6272;Commissions et frais sur émission d'emprunts; +6275;"Frais sur effets (commissions d'endos; ...)"; +6276;Location de coffres; +627;Services bancaires et assimiles; +6278;Autres frais et commissions sur prestations de services; +6281;"Concours divers (cotisations; ...)"; +628;Divers; +6284;Frais de recrutement de personnel; +62;AUTRES SERVICES EXTERIEURS; +629;"Rabais; remises et ristournes obtenus sur services ext."; +6311;Taxe sur les salaires; +6312;Taxe d'apprentissage; +6313;Participation des employeurs à la formation professionnelle; +6314;Cotisation pour défaut d'investissement obligatoire; +631;"Impôts; taxes sur rémunérations (administration)"; +6318;Autres; +6331;Versement de transport; +6332;Allocation logement; +6333;Participation des employeurs à la formation professionnelle; +6334;Participation des employeurs à l'effort de construction; +6335;Versements libératoires (exonération taxe apprentissage); +633;"Impôts; taxes et versements sur rémunérations (autres org.)"; +6338;Autres; +63511;Taxe professionnelle; +63512;Taxes foncières; +63513;Autres impôts locaux; +6351;Impôts directs (sauf impôts sur les bénéfices); +63514;Taxes sur les véhicules des sociétés; +6352;Taxes sur le chiffre d'affaires non récupérables; +6353;Impôts indirects; +6354;Droits d'enregistrement et de timbre; +63541;Droits de mutation; +635;"Autres impôts; taxes et versements (administration)"; +6358;Autres droits; +63;"IMPOTS; TAXES ET VERSEMENTS"; +6371;Contribution sociale de solidarité à la charge des sociétés; +6372;Taxes perçues par les organismes publics internationaux; +6374;Impôts et taxes exigibles à l'étranger; +637;Autres impôts et taxes (autres organismes); +6378;Taxes diverses; +6411;Salaires; +6412;Congés payes; +6413;Primes et gratifications; +6414;Indemnités et avantages divers; +641;Rémunérations du personnel; +6415;Supplément familial; +644;Rémunération du travail de l'exploitant; +6451;Cotisations à l'URSSAF; +6452;Cotisations aux mutuelles; +6453;Cotisations aux caisses de retraites; +6454;Cotisations aux ASSEDIC; +645;Charges de sécurité sociale et de prévoyance; +6458;Cotisations aux autres organismes sociaux; +646;Cotisations sociales personnelles de l'exploitant; +6471;Prestations directes; +6472;Versements aux comités d'entreprise et d'établissement; +6473;Versements aux comités d'hygiène et de sécurité; +6474;Versement aux autres oeuvres sociales; +647;Autres charges sociales; +6475;"Médecine du travail; pharmacie"; +64;CHARGES DE PERSONNEL; +648;Autres charges de personnel; +6511;"Redevances pour concessions; brevets; licences; marques; log"; +6516;Droits d'auteur et de reproduction; +651;"Redevances pour concessions; brevets; licences; etc."; +6518;Autres droits et valeurs similaires; +653;Jetons de présence; +6541;Créances de l'exercice; +654;Pertes sur créances irrécouvrables; +6544;Créances des exercices antérieurs; +6551;Quote-part de bénéfice transférée (comptabilité du gérant); +655;Quote-part de résultat sur opérations faites en commun; +6555;Quote-part de perte supportée (comptabilité des associés); +65;AUTRES CHARGES DE GESTION COURANTE; +658;Autres charges de gestion courante; +66116;- des emprunts et dettes assimilées; +6611;Intérêts des emprunts et dettes; +66117;- des dettes rattachées à des participations; +6615;Intérêts des comptes courants et des dépôts créditeurs; +6616;Intérêts bancaires et sur opérations de financement; +6617;Intérêts des obligations cautionnées; +661;Charges d'intérêt; +66181;- dettes commerciales; +6618;Intérêts des autres dettes; +66188;- dettes diverses; +664;Pertes sur créances liées à des participations; +665;Escomptes accordés; +666;Pertes de change; +667;Charges nettes sur cession valeurs mobilières de placement; +66;CHARGES FINANCIERES; +668;Autres charges financières; +6688;Pertes de change ou de conversion; +670;Charges exceptionnelles; +6711;Pénalités sur marchés (et dédits payés sur achats et ventes); +6712;Pénalités et amendes fiscales et pénales; +6713;"Dons; libéralités"; +6714;Créances devenues irrécouvrables dans l'exercice; +6715;Subventions accordées; +6717;Rappels d'impôts (autres impôts sur les bénéfices); +671;Charges exceptionnelles sur opérations de gestion; +6718;Autres charges exceptionnelles sur opérations de gestion; +672;Charges exceptionnelles sur exercices antérieurs; +6751;Immobilisations incorporelles; +6752;Immobilisations corporelles; +6756;Immobilisations financières; +675;Valeurs comptables des éléments d'actif cédés; +6758;Autres éléments d'actif; +67;CHARGES EXCEPTIONNELLES; +6781;Malis provenant de clauses d'indexation; +6782;Lots; +6783;Malis provenant du rachat par l'entreprise d'actions; +678;Autres charges exceptionnelles; +6788;Charges exceptionnelles diverses; +68111;Dotations aux amort. immobilisations incorporelles; +6811;Dotations sur immobilisations; +68112;Dotations aux amort. immobilisations corporelles; +6812;Dotations aux amortissements des charges d'exploitation; +6815;Dotations aux provisions pour risques d'exploitation; +68161;Dotations provisions dépréc. immos incorporelles; +6816;Dotation aux provisions pour dépréciation des immos; +68162;Dotations provisions dépréc. immos corporelles; +681;Dotations aux amortissements - Charges d'exploitation; +68173;Stocks et en-cours; +6817;Dotations aux provisions dépréciation des actifs circulant; +68174;Créances; +6861;Dotations aux amortissements des primes de remboursement; +6865;Dotations aux provisions pour risques et charges financiers; +686;Dotations aux amort. et provisions - Charges financières; +68662;Immobilisations financières; +6866;Dotation pour dépréciation des éléments financiers; +68665;Valeurs mobilières de placement; +68;DOTATIONS AUX AMORTISSEMENTS ET AUX PROVISIONS; +6871;Dotations aux amortissements exceptionnels sur immos; +6872;Dotations aux provisions réglementées (immobilisations); +68725;Dotations provisions réglementées - Amort. dérogatoires; +6873;Dotations aux provisions réglementées (stocks); +6874;Dotations aux autres provisions réglementées; +6875;Dotations aux provisions pour charges exceptionnelles; +687;Dotations aux amort. et provisions - Charges exceptionnelles; +6876;Dotations aux provisions pour dépréciation exceptionnelle; +6;COMPTES DE CHARGES; +691;Participation des salaries aux résultats de lentreprise; +6951;Impôts dus en France; +6952;Contribution additionnelle à l'impôt sur les bénéfices; +695;Impôts sur les bénéfices; +6954;Impôts dus à l'étranger; +696;Suppléments d'impôt sur les sociétés liés aux distributions; +697;Imposition forfaitaire annuelle des sociétés; +698;Contribution additionnelle; +69;PARTICIPATION DES SALARIES - IMPOTS SUR LES BENEFICES; +699;Produits - Reports en arrière des déficits; +7011;Produit fini (ou groupe) A; +701;Ventes de produits finis; +7012;Produit fini (ou groupe) B; +702;Ventes de produits intermédiaires; +703;Ventes de produits résiduels; +7041;Travaux de catégorie (ou activité) A; +704;Travaux; +7042;Travaux de catégorie (ou activité) B; +705;Etudes; +706;Travaux et prestations de services; +7071;Marchandise (ou groupe) A; +707;Ventes de marchandises; +7072;Marchandise (ou groupe) B; +7081;Produits des services exploités dans l'intérêt du personnel; +7082;Commissions et courtages; +7083;Locations diverses; +7084;Mise à disposition de personnel facturée; +7085;Ports et frais accessoires facturés; +7086;Bonis sur reprises d'emballages consignés; +7087;Bonifications obtenues des clients et primes sur ventes; +708;Produits des activités annexes; +7088;Autres produits activités annexes; +70;"VENTES DE PRODUITS; PRESTATIONS DE SERVICES; MARCHANDISES"; +7091;VENTES DE PRODUITS FINIS; +7092;- sur ventes de produits intermédiaires; +7094;- sur travaux; +7095;- sur études; +7096;- sur prestations de services; +7097;- sur ventes de marchandises; +709;"Rabais; remises et ristournes accordées par l'entreprise"; +7098;- sur produits des activités annexes; +71;PRODUCTION STOCKEE (ou déstockage); +71331;Produits en cours; +7133;Variation des en-cours de production de biens; +71335;Travaux en cours; +71341;Etudes en cours; +7134;Variation des en-cours de production de services; +71345;Prestations des services en cours; +713;"VARIATION DES STOCKS (en-cours de production; produits)"; +71351;Produits intermédiaires; +71355;Produits finis; +7135;Variation des stocks de produits; +71358;Produits résiduels; +721;Immobilisations incorporelles; +72;PRODUCTION IMMOBILISEE; +722;Immobilisations corporelles; +731;Produits nets partiels sur opérations en cours; +73;PRODUITS NETS PARTIELS SUR OPERATIONS A LONG TERME; +739;Produits nets partiels sur opérations terminées; +74;SUBVENTlONS D'EXPLOITATION; +740;Subventions d'exploitation; +7511;"Redevances pour concessions; brevets; licences; marques; log"; +7516;Droits d'auteur et de reproduction; +751;"Redevances pour concessions; brevets; licences; marques; log"; +7518;Autres droits et valeurs similaires; +752;Revenus des immeubles non affectes aux activités prof.; +753;Jetons de présence et rémunérations d'administrateurs; +754;Ristournes perçues des coopératives; +7551;Quote-part de perte transférée (comptabilité du gérant); +755;Quotes-parts de résultat sur opérations faites en commun; +7555;Quote-part de bénéfice attribué (comptabilité des associés); +75;AUTRES PRODUITS DE GESTION COURANTE; +758;Produits divers de gestion courante; +7611;Revenus des titres de participation; +7616;Revenus sur autres formes de participation; +761;Produits de participations; +7617;Revenus des créances rattachées à des participations; +7621;Revenus des titres immobilisés; +7624;Revenus des prêts; +762;Produits des autres immobilisations financières; +7627;Revenus des créances immobilisées; +7631;Revenus sur créances commerciales; +763;Revenus des autres créances; +7638;Revenus sur créances diverses; +764;Revenus des valeurs mobilières de placement; +765;Escomptes obtenus; +766;Gains de change; +767;Produits nets sur cession de valeurs mobilières de placement; +76;PRODUITS FINANCIERS; +768;Autres produits financiers; +7688;Gains de change ou de conversion; +770;Produits exceptionnels; +7711;Dédits et pénalités perçus sur achats et sur ventes; +7713;Libéralités reçues; +7714;Rentrées sur créances amorties; +7715;Subventions d'équilibre; +7717;Dégrèvements impôts (autres impôts sur les bénéfices); +771;Produits exceptionnels sur opérations de gestion; +7718;Autres produits exceptionnels sur opérations de gestion; +772;Produits exceptionnels sur exercices antérieurs; +7751;Immobilisations incorporelles; +7752;Immobilisations corporelles; +7756;Immobilisations financières; +775;Produits des cessions d'éléments d'actif; +7758;Autres éléments d'actif; +777;Quote-part des subventions d'invest. virée au résultat; +77;PRODUITS EXCEPTIONNELS; +7781;Bonis provenant de clauses d'indexation; +7782;Lots; +7783;Bonis provenant du rachat par l'entreprise d'actions; +778;Autres produits exceptionnels; +7788;Produits exceptionnels divers; +78111;Immobilisations incorporelles; +7811;Reprises sur amortissements des immobilisations; +78112;Immobilisations corporelles; +7815;Reprises sur provisions pour charges d'exploitation; +78161;Reprises prov. dépréc. immos incorporelles; +7816;Reprises sur provisions pour dépréciation des immos; +78162;Reprises prov. dépréc. immos corporelles; +781;Reprises sur amortissements et provisions; +78173;Stocks et en-cours; +7817;Reprises pour dépréciation des actifs circulant; +78174;Créances; +7865;Reprises sur provisions pour risques et charges financiers; +786;Reprises sur provisions pour risques; +78662;Immobilisations financières; +7866;Reprises pour dépréciation des éléments financiers; +78665;Valeurs mobilières de placement; +78;REPRISES SUR AMORTISSEMENTS ET PROVISIONS; +78725;Reprises sur provisions - Amort. dérogatoires; +78726;Provision spéciale de réévaluation; +7872;Reprises sur provisions réglementées (immobilisations); +78727;Plus-values réinvesties; +7873;Reprises sur provisions réglementées (stock); +7874;Reprises sur autres provisions réglementées; +7875;Reprises sur provisions pour charges exceptionnelles; +787;Reprises sur provisions; +7876;Reprises sur provisions pour dépréciation exceptionnelle; +7;COMPTES DE PRODUITS; +791;Transfert de charges d'exploitation; +796;Transfert de charges financières; +79;TRANSFERTS DE CHARGES; +797;Transferts de charges exceptionnelles; +8011;"Avals; cautions; garanties"; +8014;Effets circulant sous l'endos de l'entreprise; +80161;Crédit-bail mobilier; +8016;Redevances crédit-bail restant à courir; +80165;Crédit-bail immobilier; +801;Engagements donnés par l'entreprise; +8018;Autres engagements donnés; +8021;"Avals; cautions; garanties"; +8024;Créances escomptées non échues; +80261;Crédit-bail mobilier; +8026;Engagements reçus pour utilisation en crédit-bail; +80265;Crédit-bail immobilier; +802;Engagements reçus par l'entreprise; +8028;Autres engagements reçus; +80;ENGAGEMENTS; +8091;Contrepartie 801; +809;Contrepartie des engagements; +8092;Contrepartie 802; +88;RESULTAT EN INSTANCE D'AFFECTATION; +8;COMPTES SPECIAUX; +89;BILAN; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 449120dc52781ac367bf52613502babc816c4529 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 12:10:59 2015 +0200 fixes #1119 : changement du layout pour les toolbar possiblement trop large --- .../chorem/lima/ui/lettering/LetteringView.jaxx | 4 +- .../org/chorem/lima/util/WrapToolBarLayout.java | 107 +++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx index 7b7d935..6fdd8f1 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx @@ -21,6 +21,7 @@ <JPanel layout="{new BorderLayout()}"> <import> + org.chorem.lima.util.WrapToolBarLayout org.chorem.lima.ui.common.AccountComboBoxModel org.chorem.lima.ui.common.FinancialPeriodComboBoxModel org.chorem.lima.util.BigDecimalToString @@ -44,7 +45,8 @@ </script> <JToolBar styleClass="toolbar" - constraints="BorderLayout.PAGE_START"> + constraints="BorderLayout.PAGE_START" + layout="{new WrapToolBarLayout()}"> <JButton id="lettered" onActionPerformed="handler.addLetter()"/> diff --git a/lima-swing/src/main/java/org/chorem/lima/util/WrapToolBarLayout.java b/lima-swing/src/main/java/org/chorem/lima/util/WrapToolBarLayout.java new file mode 100644 index 0000000..9da6e7b --- /dev/null +++ b/lima-swing/src/main/java/org/chorem/lima/util/WrapToolBarLayout.java @@ -0,0 +1,107 @@ +package org.chorem.lima.util; + +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Insets; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + * Ce layout permet de scinder en deux ligne les elements d'une toolbar pour que tousz les élément soit visible + * Code recupéré a partir de : + * http://stackoverflow.com/questions/3679886/how-can-i-let-jtoolbars-wrap-to-t... + * + */ +public class WrapToolBarLayout extends FlowLayout { + + public WrapToolBarLayout() { + super(FlowLayout.LEFT, 0, 0); + } + + public Dimension minimumLayoutSize(Container target) { + // Size of largest component, so we can resize it in + // either direction with something like a split-pane. + return computeMinSize(target); + } + + public Dimension preferredLayoutSize(Container target) { + return computeSize(target); + } + + private Dimension computeSize(Container target) { + synchronized (target.getTreeLock()) { + int hgap = getHgap(); + int vgap = getVgap(); + int w = target.getWidth(); + + // Let this behave like a regular FlowLayout (single row) + // if the container hasn't been assigned any size yet + if (w == 0) { + w = Integer.MAX_VALUE; + } + + Insets insets = target.getInsets(); + if (insets == null){ + insets = new Insets(0, 0, 0, 0); + } + int reqdWidth = 0; + + int maxwidth = w - (insets.left + insets.right + hgap * 2); + int n = target.getComponentCount(); + int x = 0; + int y = insets.top + vgap; // FlowLayout starts by adding vgap, so do that here too. + int rowHeight = 0; + + for (int i = 0; i < n; i++) { + Component c = target.getComponent(i); + if (c.isVisible()) { + Dimension d = c.getPreferredSize(); + if ((x == 0) || ((x + d.width) <= maxwidth)) { + // fits in current row. + if (x > 0) { + x += hgap; + } + x += d.width; + rowHeight = Math.max(rowHeight, d.height); + } + else { + // Start of new row + x = d.width; + y += vgap + rowHeight; + rowHeight = d.height; + } + reqdWidth = Math.max(reqdWidth, x); + } + } + y += rowHeight; + y += insets.bottom; + return new Dimension(reqdWidth+insets.left+insets.right, y); + } + } + + private Dimension computeMinSize(Container target) { + synchronized (target.getTreeLock()) { + int minx = Integer.MAX_VALUE; + int miny = Integer.MIN_VALUE; + boolean found_one = false; + int n = target.getComponentCount(); + + for (int i = 0; i < n; i++) { + Component c = target.getComponent(i); + if (c.isVisible()) { + found_one = true; + Dimension d = c.getPreferredSize(); + minx = Math.min(minx, d.width); + miny = Math.min(miny, d.height); + } + } + if (found_one) { + return new Dimension(minx, miny); + } + return new Dimension(0, 0); + } + } + + +} -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 1c0d6fbf22ac8f399f631c56a909e4a00022d3ef Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 15 14:50:48 2015 +0200 fixes #1208 : ajouter le moi en toutes lettres + afficher la période dans la bar de statut --- lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bff15db..0182fb2 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 @@ -297,7 +297,7 @@ lima.financialTransaction.nextFinancialPeriod=Période suivante lima.financialTransaction.previousFinancialPeriod=Période précédente lima.financialTransaction.remove.confirm=Voulez-vous supprimer cette transaction? lima.financialTransaction.statusTextDebitCredit=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b>%s</b></html> -lima.financialTransaction.statusTextDebitCreditError=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b></html>; +lima.financialTransaction.statusTextDebitCreditError=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b></html> lima.financialTransaction.statusTextPeriod=<html>Période du <b>%1$td %1$tB %1$tY</b> au <b>%2$td %2$tB %2$tY</b></html> lima.financialTransaction.update.error.afterLastFiscalPeriod=Impossible de déplacer une transaction après le %1$te %1$tB %1$tY fin du dernier exercice. lima.financialTransaction.update.error.beforeFirstFiscalPeriod=Impossible de déplacer une transaction avant le %1$te %1$tB %1$tY début du premier exercice. -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 99faafa7ad710f469ef614d761c9765d7fc1318f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 29 10:25:42 2015 +0200 refs #1208 : correction de la marge a droite de la balance. --- lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0182fb2..bff15db 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 @@ -297,7 +297,7 @@ lima.financialTransaction.nextFinancialPeriod=Période suivante lima.financialTransaction.previousFinancialPeriod=Période précédente lima.financialTransaction.remove.confirm=Voulez-vous supprimer cette transaction? lima.financialTransaction.statusTextDebitCredit=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b>%s</b></html> -lima.financialTransaction.statusTextDebitCreditError=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b></html> +lima.financialTransaction.statusTextDebitCreditError=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Balance\: <b><font color\=\#ff4000>%s</font></b></html>; lima.financialTransaction.statusTextPeriod=<html>Période du <b>%1$td %1$tB %1$tY</b> au <b>%2$td %2$tB %2$tY</b></html> lima.financialTransaction.update.error.afterLastFiscalPeriod=Impossible de déplacer une transaction après le %1$te %1$tB %1$tY fin du dernier exercice. lima.financialTransaction.update.error.beforeFirstFiscalPeriod=Impossible de déplacer une transaction avant le %1$te %1$tB %1$tY début du premier exercice. -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 807085c43af02a06613b346d07eccdd914b62bac Merge: f5f01d4 99faafa Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 29 10:34:17 2015 +0200 Merge branch 'feature/1208' into develop .../ui/common/FinancialPeriodListRenderer.java | 14 +++++++++----- .../lima/ui/common/FiscalPeriodListRenderer.java | 21 ++++++++++++++++++--- .../FinancialTransactionView.css | 13 +++++++++---- .../FinancialTransactionView.jaxx | 5 ++--- .../FinancialTransactionViewHandler.java | 22 +++++++++++++++++----- .../resources/i18n/lima-swing_en_GB.properties | 1 + .../resources/i18n/lima-swing_fr_FR.properties | 5 +++-- 7 files changed, 59 insertions(+), 22 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm