This is an automated email from the git hooks/post-receive script. New commit to branch feature/1197-modularisation in repository lima. See http://git.chorem.org/lima.git commit 5d551a0dd3e9395932512633a0a53df2cebe5ef3 Author: Arnaud Thimel <thimel@codelutin.com> Date: Thu Mar 19 23:56:06 2015 +0100 Refactor lima-report and lima-server's HttpServerServlet --- .../lima/report/service/DocumentService.java | 266 +++++---- .../lima/report/service/GeneratedReport.java | 41 ++ .../JasperReports.java} | 45 +- .../java/org.chorem.lima/server}/FormatsEnum.java | 5 +- .../org.chorem.lima/server/HttpServerService.java | 362 ++++++------ .../org.chorem.lima/server/LimaServerConfig.java | 12 +- .../chorem/lima/ui/account/AccountViewHandler.java | 8 +- .../java/org/chorem/lima/ui/AbstractLimaTest.java | 653 --------------------- .../java/org/chorem/lima/ui/LimaTestsConfig.java | 71 --- .../lima/ui/account/AccountViewHandlerTest.java | 5 +- 10 files changed, 402 insertions(+), 1066 deletions(-) diff --git a/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java b/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java index 1fc3395..2fe3fce 100644 --- a/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java +++ b/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java @@ -22,8 +22,17 @@ package org.chorem.lima.report.service; -import com.google.common.collect.Lists; -import net.sf.jasperreports.engine.JasperReport; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.net.URL; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -33,9 +42,6 @@ import org.chorem.lima.beans.FinancialStatementAmounts; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.api.AccountService; -import org.chorem.lima.business.api.ClosedPeriodicEntryBookService; -import org.chorem.lima.business.api.EntryService; -import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialStatementService; import org.chorem.lima.business.api.IdentityService; import org.chorem.lima.business.api.OptionsService; @@ -50,17 +56,12 @@ import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.Identity; import org.chorem.lima.report.DocumentsEnum; import org.chorem.lima.report.LimaReportConfig; -import org.chorem.lima.report.action.ReportBuilder; +import org.nuiton.util.FileUtil; -import java.io.File; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; -import javax.swing.*; +import net.sf.jasperreports.engine.JasperReport; import static org.nuiton.i18n.I18n.t; @@ -83,32 +84,19 @@ public class DocumentService { protected LedgerReportService ledgerReportService; - protected ClosedPeriodicEntryBookService closedPeriodicEntryBookService; - - protected FinancialPeriodService financialPeriodService; - - protected EntryService entryService; - - protected ReportBuilder reportBuilder; - protected AccountService accountService; - protected String path = LimaReportConfig.getInstance().getReportsModelDir().getAbsolutePath(); - - protected final String BALANCE_FILE_PATH = path + File.separator + DocumentsEnum.BALANCE.getFileName() + ".pdf"; - protected final String GENERAL_ENTRY_BOOK_REPORT_PDF_FILE_PATH = path + File.separator + DocumentsEnum.GENERAL_ENTRY_BOOK.getFileName() + ".pdf"; - protected final String ENTRY_BOOKS_REPORT_PDF_FILE_PATH = path + File.separator + DocumentsEnum.ENTRY_BOOKS.getFileName() + ".pdf"; - protected final String LEDGER_REPORT_PDF_FILE_PATH = path + File.separator + DocumentsEnum.LEDGER.getFileName() + ".pdf"; + protected JasperReports jasperReports; - protected DecimalFormat decimalFormat; + protected String balanceFilePath; + protected String generalEntryBookReportPdfFilePath; + protected String entryBooksReportPdfFilePath; + protected String ledgerReportPdfFilePath; public DocumentService() { identityService = LimaServiceFactory.getService(IdentityService.class); financialStatementService = LimaServiceFactory.getService(FinancialStatementService.class); reportService = LimaServiceFactory.getService(ReportService.class); - closedPeriodicEntryBookService = LimaServiceFactory.getService(ClosedPeriodicEntryBookService.class); - financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class); - entryService = LimaServiceFactory.getService(EntryService.class); accountService = LimaServiceFactory.getService(AccountService.class); balanceReportService = LimaServiceFactory.getService(BalanceReportService.class); @@ -116,34 +104,44 @@ public class DocumentService { entryBookReportService = LimaServiceFactory.getService(ProvisionalEntryBookReportService.class); ledgerReportService = LimaServiceFactory.getService(LedgerReportService.class); - reportBuilder = new ReportBuilder(); + jasperReports = new JasperReports(); + + File reportDir = LimaReportConfig.getInstance().getReportsModelDir(); + + try { + FileUtil.createDirectoryIfNecessary(reportDir); + } catch (IOException ioe) { + if (log.isErrorEnabled()) { + log.error("Cannot create report dir", ioe); + } + } + + String reportDirPath = reportDir.getAbsolutePath(); + + balanceFilePath = reportDirPath + File.separator + DocumentsEnum.BALANCE.getFileName() + ".pdf"; + generalEntryBookReportPdfFilePath = reportDirPath + File.separator + DocumentsEnum.GENERAL_ENTRY_BOOK.getFileName() + ".pdf"; + entryBooksReportPdfFilePath = reportDirPath + File.separator + DocumentsEnum.ENTRY_BOOKS.getFileName() + ".pdf"; + ledgerReportPdfFilePath = reportDirPath + File.separator + DocumentsEnum.LEDGER.getFileName() + ".pdf"; if (log.isDebugEnabled()) { - log.debug("Path : " + path); + log.debug("Path : " + reportDirPath); } } - /** - * General Leger - * @param beginDate - * @param endDate - * @return - */ public String createFinancialStatementsDocuments(Date beginDate, Date endDate) { List<FinancialStatementAmounts> financialStatementAmounts = financialStatementService.financialStatementReport(beginDate, endDate); - String financialReport = ""; + String financialReport; try { financialReport = constructHtmlHeader(""); //Split list by financialstatement type - List<List<FinancialStatementAmounts>> listList = - new ArrayList<List<FinancialStatementAmounts>>(); + List<List<FinancialStatementAmounts>> listList = new ArrayList<List<FinancialStatementAmounts>>(); Boolean first = true; int min = 0; int size = financialStatementAmounts.size(); @@ -164,11 +162,11 @@ public class DocumentService { //create pages for (List<FinancialStatementAmounts> list : listList) { - if (!list.isEmpty()){ + if (!list.isEmpty()) { String title = list.get(0).getLabel(); int i = 0; int n = list.size(); - printedType ++; + printedType++; while (i < n) { financialReport += constructHeaderTitle(title, beginDate, endDate); @@ -179,11 +177,11 @@ public class DocumentService { "<tr align=\"center\">\n"; if (printedType == 0) { - String[] columnHeaderTable = {boldBegin+t("lima-business.document.label")+boldEnd, boldBegin+t("lima-business.document.grossamount")+boldEnd, - boldBegin+t("lima-business.document.provisiondeprecationamount")+boldEnd, boldBegin+t("lima-business.document.netamount")+boldEnd}; + String[] columnHeaderTable = {boldBegin + t("lima-business.document.label") + boldEnd, boldBegin + t("lima-business.document.grossamount") + boldEnd, + boldBegin + t("lima-business.document.provisiondeprecationamount") + boldEnd, boldBegin + t("lima-business.document.netamount") + boldEnd}; financialReport += constructTableLine(columnHeaderTable); } else { - String[] columnHeaderTable = {boldBegin+t("lima-business.document.label")+boldEnd, boldBegin+t("lima-business.document.amount")+boldEnd}; + String[] columnHeaderTable = {boldBegin + t("lima-business.document.label") + boldEnd, boldBegin + t("lima-business.document.amount") + boldEnd}; financialReport += constructTableLine(columnHeaderTable); } @@ -199,15 +197,15 @@ public class DocumentService { BigDecimal provisionDeprecationAmount = financialStatementAmount.getProvisionDeprecationAmount(); if (provisionDeprecationAmount == null) { - provisionDeprecationAmount =BigDecimal.ZERO; + provisionDeprecationAmount = BigDecimal.ZERO; } if (label == null) { if (printedType == 0) { - String [] emptyColumn = {"","","",""}; + String[] emptyColumn = {"", "", "", ""}; financialReport += constructTableLine(emptyColumn); } else { - String [] emptyColumn = {"", ""}; + String[] emptyColumn = {"", ""}; financialReport += constructTableLine(emptyColumn); } } else { @@ -217,7 +215,7 @@ public class DocumentService { tab.append("\t"); } //Phrase phrase; - String tabLabel = ""; + String tabLabel; if (financialStatementAmount.isHeader()) { tabLabel = boldBegin + tab + label + boldEnd; } else { @@ -244,10 +242,10 @@ public class DocumentService { } if (printedType == 0) { - String [] columns = {tabLabel, grossAmountStr, provisionDeprecationAmountStr, soldeStr}; + String[] columns = {tabLabel, grossAmountStr, provisionDeprecationAmountStr, soldeStr}; financialReport += constructTableLine(columns); } else /*if (printedType == 1)*/ { - String [] columns = {tabLabel, soldeStr}; + String[] columns = {tabLabel, soldeStr}; financialReport += constructTableLine(columns); } } @@ -344,7 +342,7 @@ public class DocumentService { public String createAccountDocument(Date beginDate, Date endDate, String account) { - String accountReport = null; + String accountReport; try { @@ -357,7 +355,7 @@ public class DocumentService { if (beginDate != null && endDate != null && accountFormat != null) { - String subTitleFirstpart = t("lima.fiscalperiod.fiscalperiod") + " : " + simpleDateFormat.format(beginDate) + " - " + simpleDateFormat.format(endDate); + String subTitleFirstpart = t("lima.fiscalperiod.fiscalperiod") + " : " + simpleDateFormat.format(beginDate) + " - " + simpleDateFormat.format(endDate); String subTitleSecPart = t("lima.financialtransaction.account") + " : " + accountFormat.getAccountNumber() + " - " + accountFormat.getLabel(); accountReport += constructSubTitleHtml(subTitleFirstpart, subTitleSecPart); @@ -375,7 +373,7 @@ public class DocumentService { accountReport += "\t\t<tbody>\n"; boolean even = true; - for(Entry entry : entries) { + for (Entry entry : entries) { String accountNumber = entry.getAccount().getAccountNumber(); String transactionDate = simpleDateFormat.format(entry.getFinancialTransaction().getTransactionDate()); @@ -388,9 +386,9 @@ public class DocumentService { String lettering = entry.getLettering(); - String[] columnData = {(StringUtils.isBlank(accountNumber)?"":accountNumber), (StringUtils.isBlank(transactionDate)?"":transactionDate), - (StringUtils.isBlank(code)?"":code), (StringUtils.isBlank(voucher)?"":voucher), - (StringUtils.isBlank(description)?"":description), (StringUtils.isBlank(lettering)?"":lettering), + String[] columnData = {(StringUtils.isBlank(accountNumber) ? "" : accountNumber), (StringUtils.isBlank(transactionDate) ? "" : transactionDate), + (StringUtils.isBlank(code) ? "" : code), (StringUtils.isBlank(voucher) ? "" : voucher), + (StringUtils.isBlank(description) ? "" : description), (StringUtils.isBlank(lettering) ? "" : lettering), (entry.isDebit() ? entry.getAmount() : BigDecimal.ZERO).toString(), (entry.isDebit() ? BigDecimal.ZERO : entry.getAmount()).toString()}; @@ -402,13 +400,14 @@ public class DocumentService { "</body>\n"; } else { - JOptionPane.showMessageDialog(null, t("lima.reports.account.noAccount"), t("lima.reports.account.noAccountTitle"), JOptionPane.INFORMATION_MESSAGE); + if (log.isWarnEnabled()) { + log.warn("No account present"); + } } accountReport += "</html>"; - } - catch (Exception e) { + } catch (Exception e) { throw new LimaTechnicalException("Can't create document", e); } @@ -444,7 +443,7 @@ public class DocumentService { protected String constructTableHeader(String[] columnsNames) { String header = "\t\t<thead>\n\t\t\t<tr>\n"; for (String name : columnsNames) { - header += "\t\t\t\t<th>" + name + "</th>\n"; + header += "\t\t\t\t<th>" + name + "</th>\n"; } header += "\t\t\t</tr>\t\t\n</thead>\n"; return header; @@ -487,50 +486,50 @@ public class DocumentService { String boldItalicEnd = "</i>" + "</b>"; if (identity != null) { - String [] columnsNameSociety = {boldItalicBegin + t("lima-business.document.society") + boldItalicEnd, - "<i>" + (StringUtils.isNotEmpty(identity.getName()) ? identity.getName() : " - ") + "</i>", }; + String[] columnsNameSociety = {boldItalicBegin + t("lima-business.document.society") + boldItalicEnd, + "<i>" + (StringUtils.isNotEmpty(identity.getName()) ? identity.getName() : " - ") + "</i>",}; headerTitle += constructTableLine(columnsNameSociety); - String [] columnsDescription = {boldItalicBegin + t("lima-business.document.description") + boldItalicEnd, - "<i>" + (StringUtils.isNotEmpty(identity.getDescription()) ? identity.getDescription() : " - ") + "</i>", }; + String[] columnsDescription = {boldItalicBegin + t("lima-business.document.description") + boldItalicEnd, + "<i>" + (StringUtils.isNotEmpty(identity.getDescription()) ? identity.getDescription() : " - ") + "</i>",}; headerTitle += constructTableLine(columnsDescription); - String [] columnsAdressOne = {boldItalicBegin + t("lima-business.document.address") + boldItalicEnd, - "<i>" + (StringUtils.isNotEmpty(identity.getAddress()) ? identity.getAddress() : " - ") + "</i>", }; + String[] columnsAdressOne = {boldItalicBegin + t("lima-business.document.address") + boldItalicEnd, + "<i>" + (StringUtils.isNotEmpty(identity.getAddress()) ? identity.getAddress() : " - ") + "</i>",}; headerTitle += constructTableLine(columnsAdressOne); - String [] columnsAdressTwo = {boldItalicBegin + t("lima-business.document.addressMore") + boldItalicEnd, - "<i>" + (StringUtils.isNotEmpty(identity.getAddress2()) ? identity.getAddress2() : " - ") + "</i>", }; + String[] columnsAdressTwo = {boldItalicBegin + t("lima-business.document.addressMore") + boldItalicEnd, + "<i>" + (StringUtils.isNotEmpty(identity.getAddress2()) ? identity.getAddress2() : " - ") + "</i>",}; headerTitle += constructTableLine(columnsAdressTwo); - String [] columnsZipCode = {boldItalicBegin + t("lima-business.document.zipcode") + boldItalicEnd, - "<i>" + (StringUtils.isNotEmpty(identity.getZipCode()) ? identity.getZipCode() : " - ") + "</i>", }; + String[] columnsZipCode = {boldItalicBegin + t("lima-business.document.zipcode") + boldItalicEnd, + "<i>" + (StringUtils.isNotEmpty(identity.getZipCode()) ? identity.getZipCode() : " - ") + "</i>",}; headerTitle += constructTableLine(columnsZipCode); - String [] columnsCity = {boldItalicBegin + t("lima-business.document.city") + boldItalicEnd, - "<i>" + (StringUtils.isNotEmpty(identity.getCity()) ? identity.getCity() : " - ") + "</i>", }; + String[] columnsCity = {boldItalicBegin + t("lima-business.document.city") + boldItalicEnd, + "<i>" + (StringUtils.isNotEmpty(identity.getCity()) ? identity.getCity() : " - ") + "</i>",}; headerTitle += constructTableLine(columnsCity); - String [] columnsBusinessNumber = {boldItalicBegin + t("lima-business.document.businessnumber") + + String[] columnsBusinessNumber = {boldItalicBegin + t("lima-business.document.businessnumber") + boldItalicEnd, "<i>" + (StringUtils.isNotEmpty(identity.getBusinessNumber()) ? identity.getBusinessNumber() : " - ") + "</i>"}; headerTitle += constructTableLine(columnsBusinessNumber); - String [] columnsClassifCode = {boldItalicBegin + t("lima-business.document.classificationcode") + + String[] columnsClassifCode = {boldItalicBegin + t("lima-business.document.classificationcode") + boldItalicEnd, "<i>" + (StringUtils.isNotEmpty(identity.getClassificationCode()) ? identity.getClassificationCode() : " - ") + "</i>"}; headerTitle += constructTableLine(columnsClassifCode); - String [] columnsVatNumber = {boldItalicBegin + t("lima-business.document.vatnumber") + boldItalicEnd, - "<i>" + (StringUtils.isNotEmpty(identity.getVatNumber()) ? identity.getVatNumber() : " - ") + "</i>", }; + String[] columnsVatNumber = {boldItalicBegin + t("lima-business.document.vatnumber") + boldItalicEnd, + "<i>" + (StringUtils.isNotEmpty(identity.getVatNumber()) ? identity.getVatNumber() : " - ") + "</i>",}; headerTitle += constructTableLine(columnsVatNumber); } - String [] columnsPeriodOne = {boldItalicBegin + t("lima-business.document.period1") + boldItalicEnd, "<i>" - + t("lima-business.document.period1format", beginDate)+ "</i>"}; + String[] columnsPeriodOne = {boldItalicBegin + t("lima-business.document.period1") + boldItalicEnd, "<i>" + + t("lima-business.document.period1format", beginDate) + "</i>"}; headerTitle += constructTableLine(columnsPeriodOne); headerTitle += "<tr>\n"; - String [] columnsPeriodTwo = {boldItalicBegin + t("lima-business.document.period2") + boldItalicEnd, "<i>" - + t("lima-business.document.period2format", endDate)+ "</i>"}; + String[] columnsPeriodTwo = {boldItalicBegin + t("lima-business.document.period2") + boldItalicEnd, "<i>" + + t("lima-business.document.period2format", endDate) + "</i>"}; headerTitle += constructTableLine(columnsPeriodTwo); headerTitle += "</table>" + @@ -541,43 +540,98 @@ public class DocumentService { } protected DecimalFormat getDecimalFormat() { - if (decimalFormat == null) { - OptionsService optionsService = LimaServiceFactory.getService(OptionsService.class); - decimalFormat = BigDecimalToString.newDecimalFormat(optionsService); - } - return decimalFormat; + OptionsService optionsService = LimaServiceFactory.getService(OptionsService.class); + DecimalFormat result = BigDecimalToString.newDecimalFormat(optionsService); + return result; } //############## balance ############## public void createBalanceDocuments(Date beginDate, Date endDate, String fromToAccount) { - JasperReport balanceMainAccountsReport = reportBuilder.getBalanceManAccountsReport(); - JasperReport balanceSubAccountsReport = reportBuilder.getBalanceSubAccountsReport(); - DocumentReport report = balanceReportService.getBalanceDocumentReport(beginDate, endDate, fromToAccount, getDecimalFormat(), balanceMainAccountsReport, balanceSubAccountsReport); - reportBuilder.generatePDFReport(DocumentsEnum.BALANCE, BALANCE_FILE_PATH, Lists.newArrayList(report)); + JasperReport balanceMainAccountsReport = jasperReports.getBalanceManAccountsReport(); + JasperReport balanceSubAccountsReport = jasperReports.getBalanceSubAccountsReport(); + DocumentReport report = balanceReportService.getBalanceDocumentReport(beginDate, endDate, fromToAccount, + getDecimalFormat(), balanceMainAccountsReport, balanceSubAccountsReport); + jasperReports.generatePDFReport(DocumentsEnum.BALANCE, balanceFilePath, Lists.newArrayList(report)); } //############## EntryBook ############# public void createEntryBooksDocuments(Date beginDate, Date endDate, List<String> entryBookCodes) { - JasperReport entryBookEntryBooksReport = reportBuilder.getEntryBookEntryBooksReport(); - JasperReport entryBookFinancialPeriodsReport = reportBuilder.getEntryBookFinancialPeriodsReport(); - JasperReport entryBookTransactionsReport = reportBuilder.getEntryBookTransactionsReport(); - DocumentReport report = entryBookReportService.getEntryBookDocumentReport(beginDate, endDate, entryBookCodes, getDecimalFormat(), entryBookEntryBooksReport, entryBookFinancialPeriodsReport, entryBookTransactionsReport); - reportBuilder.generatePDFReport(DocumentsEnum.ENTRY_BOOKS, ENTRY_BOOKS_REPORT_PDF_FILE_PATH, Lists.newArrayList(report)); + JasperReport entryBookEntryBooksReport = jasperReports.getEntryBookEntryBooksReport(); + JasperReport entryBookFinancialPeriodsReport = jasperReports.getEntryBookFinancialPeriodsReport(); + JasperReport entryBookTransactionsReport = jasperReports.getEntryBookTransactionsReport(); + DocumentReport report = entryBookReportService.getEntryBookDocumentReport(beginDate, endDate, entryBookCodes, + getDecimalFormat(), entryBookEntryBooksReport, entryBookFinancialPeriodsReport, entryBookTransactionsReport); + jasperReports.generatePDFReport(DocumentsEnum.ENTRY_BOOKS, entryBooksReportPdfFilePath, Lists.newArrayList(report)); } //############## General EntryBook ############# public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate) { - JasperReport generalEntryBookGeneralEntryBooksReport = reportBuilder.getGeneralEntryBookGeneralEntryBooksReport(); - JasperReport generalEntryBookEntriesReport = reportBuilder.getGeneralEntryBookEntriesReport(); - DocumentReport report = generalEntryBookReportService.getGeneralEntryBookDocumentReport(beginDate, endDate, getDecimalFormat(), generalEntryBookGeneralEntryBooksReport, generalEntryBookEntriesReport); - reportBuilder.generatePDFReport(DocumentsEnum.GENERAL_ENTRY_BOOK, GENERAL_ENTRY_BOOK_REPORT_PDF_FILE_PATH, Lists.newArrayList(report)); + JasperReport generalEntryBookGeneralEntryBooksReport = jasperReports.getGeneralEntryBookGeneralEntryBooksReport(); + JasperReport generalEntryBookEntriesReport = jasperReports.getGeneralEntryBookEntriesReport(); + DocumentReport report = generalEntryBookReportService.getGeneralEntryBookDocumentReport(beginDate, endDate, + getDecimalFormat(), generalEntryBookGeneralEntryBooksReport, generalEntryBookEntriesReport); + jasperReports.generatePDFReport(DocumentsEnum.GENERAL_ENTRY_BOOK, generalEntryBookReportPdfFilePath, Lists.newArrayList(report)); } //############## Ledger ############# public void createLedgerDocuments(Date beginDate, Date endDate) { - JasperReport generalLedgerGeneralLedgersReport = reportBuilder.getGeneralLedgerGeneralLedgersReport(); - JasperReport generalLedgerEntriesReport = reportBuilder.getGeneralLedgerEntriesReport(); - DocumentReport report = ledgerReportService.getLedgerDocumentReport(beginDate, endDate, getDecimalFormat(), generalLedgerGeneralLedgersReport, generalLedgerEntriesReport); - reportBuilder.generatePDFReport(DocumentsEnum.LEDGER, LEDGER_REPORT_PDF_FILE_PATH, Lists.newArrayList(report)); + JasperReport generalLedgerGeneralLedgersReport = jasperReports.getGeneralLedgerGeneralLedgersReport(); + JasperReport generalLedgerEntriesReport = jasperReports.getGeneralLedgerEntriesReport(); + DocumentReport report = ledgerReportService.getLedgerDocumentReport(beginDate, endDate, getDecimalFormat(), + generalLedgerGeneralLedgersReport, generalLedgerEntriesReport); + jasperReports.generatePDFReport(DocumentsEnum.LEDGER, ledgerReportPdfFilePath, Lists.newArrayList(report)); } + + protected InputStream getReportAsPdfStream(String model) throws IOException { + + File reportDir = LimaReportConfig.getInstance().getReportsModelDir(); + String path = reportDir.getAbsolutePath(); + URL doc = new URL("file:" + path + File.separator + model + ".pdf"); + if (log.isDebugEnabled()) { + log.debug("file:" + path + File.separator + model + ".pdf"); + } + InputStream inputStream = doc.openStream(); + return inputStream; + } + + public GeneratedReport createReport(Date beginDate, Date endDate, String model, String account) throws IOException { + String stringResult = null; + + //create docs + switch (DocumentsEnum.valueOfLink(model)) { + case BALANCE: + createBalanceDocuments(beginDate, endDate, null); + break; + case ACCOUNT: + stringResult = createAccountDocument(beginDate, endDate, account); + break; + case ENTRY_BOOKS: + createEntryBooksDocuments(beginDate, endDate, null); + break; + case GENERAL_ENTRY_BOOK: + createGeneralEntryBooksDocuments(beginDate, endDate); + break; + case FINANCIAL_STATEMENT: + stringResult = createFinancialStatementsDocuments(beginDate, endDate); + break; + case LEDGER: + createLedgerDocuments(beginDate, endDate); + break; + default: + throw new UnsupportedOperationException("Unknown document type: " + model); + } + + if (Strings.isNullOrEmpty(stringResult)) { + InputStream pdfStream = getReportAsPdfStream(model); + return GeneratedReport.pdf(pdfStream); + } else { + return GeneratedReport.html(stringResult); + } + } + + public List<Account> getAllAccounts() { + // delegate to accountService + return accountService.getAllAccounts(); + } + } diff --git a/lima-report/src/main/java/org/chorem/lima/report/service/GeneratedReport.java b/lima-report/src/main/java/org/chorem/lima/report/service/GeneratedReport.java new file mode 100644 index 0000000..7ae468c --- /dev/null +++ b/lima-report/src/main/java/org/chorem/lima/report/service/GeneratedReport.java @@ -0,0 +1,41 @@ +package org.chorem.lima.report.service; + +import java.io.InputStream; + +/** + * @author Arnaud Thimel (Code Lutin) + */ +public class GeneratedReport { + + protected String htmlContent; + protected InputStream pdfStream; + + public static GeneratedReport html(String htmlContent) { + GeneratedReport result = new GeneratedReport(); + result.setHtmlContent(htmlContent); + return result; + } + + public static GeneratedReport pdf(InputStream pdfStream) { + GeneratedReport result = new GeneratedReport(); + result.setPdfStream(pdfStream); + return result; + } + + public String getHtmlContent() { + return htmlContent; + } + + public void setHtmlContent(String htmlContent) { + this.htmlContent = htmlContent; + } + + public InputStream getPdfStream() { + return pdfStream; + } + + public void setPdfStream(InputStream pdfStream) { + this.pdfStream = pdfStream; + } + +} diff --git a/lima-report/src/main/java/org/chorem/lima/report/action/ReportBuilder.java b/lima-report/src/main/java/org/chorem/lima/report/service/JasperReports.java similarity index 71% rename from lima-report/src/main/java/org/chorem/lima/report/action/ReportBuilder.java rename to lima-report/src/main/java/org/chorem/lima/report/service/JasperReports.java index 96e17eb..7674e09 100644 --- a/lima-report/src/main/java/org/chorem/lima/report/action/ReportBuilder.java +++ b/lima-report/src/main/java/org/chorem/lima/report/service/JasperReports.java @@ -1,4 +1,4 @@ -package org.chorem.lima.report.action; +package org.chorem.lima.report.service; /* * #%L @@ -46,15 +46,11 @@ import java.util.List; import java.util.Map; /** - * Created by davidcosse on 02/10/14. - */ - -/** * Class that contains all JasperReport */ -public class ReportBuilder { +public class JasperReports { - private static final Log log = LogFactory.getLog(ReportBuilder.class); + private static final Log log = LogFactory.getLog(JasperReports.class); protected JasperReport balanceDocumentReport; protected JasperReport balanceManAccountsReport; @@ -78,27 +74,27 @@ public class ReportBuilder { /** * Compile all report */ - public ReportBuilder() { + public JasperReports() { LimaReportConfig config = LimaReportConfig.getInstance(); // compile phase - balanceDocumentReport = createReport(config.getReportModelUrl(DocumentReportTypes.BALANCE)); - balanceManAccountsReport = createReport(config.getReportModelUrl(DocumentReportTypes.BALANCE_MAIN_ACCOUNTS)); - balanceSubAccountsReport = createReport(config.getReportModelUrl(DocumentReportTypes.BALANCE_SUB_ACCOUNTS)); + balanceDocumentReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.BALANCE)); + balanceManAccountsReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.BALANCE_MAIN_ACCOUNTS)); + balanceSubAccountsReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.BALANCE_SUB_ACCOUNTS)); - entryBookDocumentReport = createReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS)); - entryBookEntryBooksReport = createReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS_ENTRY_BOOKS)); - entryBookFinancialPeriodsReport = createReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS_FINANCIAL_PERIODS)); - entryBookTransactionsReport = createReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS_TRANSACTION)); + entryBookDocumentReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS)); + entryBookEntryBooksReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS_ENTRY_BOOKS)); + entryBookFinancialPeriodsReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS_FINANCIAL_PERIODS)); + entryBookTransactionsReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.ENTRY_BOOKS_TRANSACTION)); - generalEntryBookDocumentReport = createReport(config.getReportModelUrl(DocumentReportTypes.GENERAL_ENTRY_BOOK)); - generalEntryBookGeneralEntryBooksReport = createReport(config.getReportModelUrl(DocumentReportTypes.GENERAL_ENTRY_BOOK_GENERAL_ENTRY_BOOKS)); - generalEntryBookEntriesReport = createReport(config.getReportModelUrl(DocumentReportTypes.GENERAL_ENTRY_BOOK_ENTRIES)); + generalEntryBookDocumentReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.GENERAL_ENTRY_BOOK)); + generalEntryBookGeneralEntryBooksReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.GENERAL_ENTRY_BOOK_GENERAL_ENTRY_BOOKS)); + generalEntryBookEntriesReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.GENERAL_ENTRY_BOOK_ENTRIES)); - generalLedgerDocumentReport = createReport(config.getReportModelUrl(DocumentReportTypes.LEDGER)); - generalLedgerGeneralLedgersReport = createReport(config.getReportModelUrl(DocumentReportTypes.LEDGER_GENERAL_LEDGERS)); - generalLedgerEntriesReport = createReport(config.getReportModelUrl(DocumentReportTypes.LEDGER_ENTRIES)); + generalLedgerDocumentReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.LEDGER)); + generalLedgerGeneralLedgersReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.LEDGER_GENERAL_LEDGERS)); + generalLedgerEntriesReport = prepareJasperReport(config.getReportModelUrl(DocumentReportTypes.LEDGER_ENTRIES)); reportsByDocumentType = Maps.newHashMap(); reportsByDocumentType.put(DocumentsEnum.BALANCE, balanceDocumentReport); @@ -108,7 +104,7 @@ public class ReportBuilder { } - protected JasperReport createReport(URL url) { + protected JasperReport prepareJasperReport(URL url) { JasperReport jasperReport; try (InputStream inputStream = url.openStream()) { jasperReport = JasperCompileManager.compileReport(inputStream); @@ -126,7 +122,9 @@ public class ReportBuilder { try { JasperReport report = reportsByDocumentType.get(reportType); if (report != null) { - JasperPrint jasperPrint = JasperFillManager.fillReport(report, new HashMap(), new JRBeanCollectionDataSource(reports)); + Map<String, Object> parameters = new HashMap<String, Object>(); + JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(reports); + JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, dataSource); JasperExportManager.exportReportToPdfFile(jasperPrint, path); if (log.isInfoEnabled()) { log.info("Rapport généré:" + path); @@ -181,4 +179,5 @@ public class ReportBuilder { public Map<DocumentsEnum, JasperReport> getReportsByDocumentType() { return reportsByDocumentType; } + } diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java b/lima-server/src/main/java/org.chorem.lima/server/FormatsEnum.java similarity index 93% rename from lima-business-api/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java rename to lima-server/src/main/java/org.chorem.lima/server/FormatsEnum.java index af22d24..16b834f 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java +++ b/lima-server/src/main/java/org.chorem.lima/server/FormatsEnum.java @@ -20,12 +20,13 @@ * #L% */ -package org.chorem.lima.business.utils; +package org.chorem.lima.server; public enum FormatsEnum { HTML(".html", "text/html", "Page Html"), - PDF(".pdf", "application/pdf", "Document PDF"); + PDF(".pdf", "application/pdf", "Document PDF"), + PNG(".png", "image/png", "Image PNG"); private final String extension; diff --git a/lima-server/src/main/java/org.chorem.lima/server/HttpServerService.java b/lima-server/src/main/java/org.chorem.lima/server/HttpServerService.java index dfdc55d..aac5a73 100644 --- a/lima-server/src/main/java/org.chorem.lima/server/HttpServerService.java +++ b/lima-server/src/main/java/org.chorem.lima/server/HttpServerService.java @@ -28,26 +28,24 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.api.AccountService; +import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.business.api.OptionsService; import org.chorem.lima.report.DocumentsEnum; -import org.chorem.lima.business.utils.FormatsEnum; import org.chorem.lima.entity.Account; -import org.chorem.lima.report.action.ReportBuilder; +import org.chorem.lima.report.service.GeneratedReport; import org.chorem.lima.report.service.DocumentService; import org.chorem.lima.business.LimaServiceFactory; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.hibernate.exception.GenericJDBCException; -import org.nuiton.util.FileUtil; import org.nuiton.util.Resource; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.File; + import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -59,44 +57,31 @@ import java.util.Calendar; import java.util.Date; import java.util.List; +import com.google.common.base.Strings; + import static org.nuiton.i18n.I18n.t; public class HttpServerService { protected static final Log log = LogFactory.getLog(HttpServerService.class); - private DocumentService documentService; + protected static final String DATE_FORMAT = "yyyy-MM-dd"; - private AccountService accountService; + protected DocumentService documentService; protected Server server; - //protected String path; - protected String limaHttpHost; protected int limaHttpPort; - protected ReportBuilder reportBuilder; - public HttpServerService() { - - OptionsService optionsService = LimaServiceFactory.getService(OptionsService.class); - accountService = LimaServiceFactory.getService(AccountService.class); - - limaHttpHost = optionsService.getLimaHttpHost(); - limaHttpPort = optionsService.getLimaHttpPort(); - documentService = new DocumentService(); - reportBuilder = new ReportBuilder(); + init(); } /** start the server */ public void start() { if (server == null) { try { - File reportDir = LimaServerConfig.getInstance().getReportsModelDir(); - - FileUtil.createDirectoryIfNecessary(reportDir); - server = new Server(limaHttpPort); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); @@ -115,20 +100,29 @@ public class HttpServerService { } } - public int getHttpPort() { - return limaHttpPort; + protected void init() { + + OptionsService optionsService = LimaServiceFactory.getService(OptionsService.class); + + limaHttpHost = optionsService.getLimaHttpHost(); + limaHttpPort = optionsService.getLimaHttpPort(); + documentService = new DocumentService(); } - /** + /** * This servlet send a static html page. */ public class MainServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + doGet(req, resp); + } + + @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); try { if (log.isDebugEnabled()) { @@ -142,182 +136,162 @@ public class HttpServerService { String endDate = req.getParameter("endDate"); String account = (StringUtils.isBlank(req.getParameter("account")) ? null : URLDecoder.decode(req.getParameter("account"), "UTF-8")); - //if image if (imageParam != null) { - URL image = Resource.getURLOrNull("images/" + imageParam); - if (image != null) { - resp.setContentType("image/png"); - InputStream in = image.openStream(); - OutputStream out = resp.getOutputStream(); - IOUtils.copy(in, out); - } - } - else if (model != null && beginDate != null && endDate != null) { - String accountReport = null; - String financialReport = null; - - //create docs - try { - Date beginDateFormat = sdf.parse(beginDate); - Date endDateFormat = sdf.parse(endDate); - - switch (DocumentsEnum.valueOfLink(model)) { - case BALANCE: - documentService.createBalanceDocuments(beginDateFormat, endDateFormat, null); - break; - case ACCOUNT: - accountReport = documentService.createAccountDocument( - beginDateFormat, endDateFormat, account); - break; - case ENTRY_BOOKS: - documentService.createEntryBooksDocuments(beginDateFormat, endDateFormat, null); - break; - case GENERAL_ENTRY_BOOK: - documentService.createGeneralEntryBooksDocuments(beginDateFormat, endDateFormat); - break; - case FINANCIAL_STATEMENT: - financialReport = documentService.createFinancialStatementsDocuments( - beginDateFormat, endDateFormat); - break; - case LEDGER: - documentService.createLedgerDocuments(beginDateFormat, endDateFormat); - break; - } - } catch (ParseException eeePE) { - log.error("Can't parse date", eeePE); - } - - if ( (accountReport != null || financialReport != null)) { - String report; - resp.setContentType(".html"); - OutputStream out = resp.getOutputStream(); - if (accountReport != null) { - report = accountReport; - } else { - report = financialReport; - } - IOUtils.write(report, out, Charsets.UTF_8); - } else { - File reportDir = LimaServerConfig.getInstance().getReportsModelDir(); - String path = reportDir.getAbsolutePath(); - URL doc = new URL("file:" + path + File.separator + model + ".pdf"); - if (log.isDebugEnabled()) { - log.debug("file:" + path + File.separator + model + ".pdf"); - } - resp.setContentType(".pdf"); - OutputStream out = resp.getOutputStream(); - InputStream in = doc.openStream(); - IOUtils.copy(in, out); - } + // render image + doImage(resp, imageParam); + } else if (model != null && beginDate != null && endDate != null) { + // generate and render report + doCreateReport(resp, model, beginDate, endDate, account); + } else { + // render home HTML + doHomeHtml(req, resp); } - // else return home html - else { - if (log.isDebugEnabled()) { - log.debug("Home html"); - } + } catch (GenericJDBCException eee) { + log.error("Can't read db", eee); + } + } - resp.setContentType(FormatsEnum.HTML.getMimeType()); - StringBuilder pageContent = new StringBuilder(); - String serverAddress = "http://"; - - log.info("Page load"); - - /** create server Address : static config if exist or dynamical adress */ - if (limaHttpHost.equals("")) { - serverAddress += req.getServerName() + ":" + req.getServerPort(); - } else { - serverAddress += limaHttpHost + ":" + getHttpPort(); - } - - Calendar calendar = Calendar.getInstance(); - Date endDatePicker = calendar.getTime(); - Date beginDatePicker = calendar.getTime(); - beginDatePicker = - DateUtils.truncate(beginDatePicker, Calendar.YEAR); - - pageContent.append("<!DOCTYPE html>\n" + "<html lang=\"fr\">\n" - + "<head>\n" - + "<script type=\"text/javascript\">" + - " function showAccountInput(){" + - " var request = document.getElementById('model');" + - " var requestValue = request == null ? '': request.value;" + - " var isDocumentAccount = requestValue === 'lima_account'; " + - " if (document.getElementById('accountField') != null) {" + - " if (isDocumentAccount) {" + - " document.getElementById('accountField').style.display = 'block';" + - " } else {" + - " document.getElementById('accountField').style.display = 'none';" + - " }" + - " }" + - " }" + - " showAccountInput();" + - " </script>" - + "<title>LIMA Documents Report</title>\n" + "<style type=\"text/css\">" + "body { font: 14px sans-serif; }" + "h1 { font: 20px sans-serif; text-align: center; }" + "table.padding td {padding-right:20px;}" + ".tdright {text-align: right;}" + "</style>" - + "</head>\n" - + "<body>\n" + "<table class=\"padding\">\n" + "<tr><td><img src=\"?img=puzzle_icon_mini.png\"/></td>\n" + "<td><h1>LIMA Documents Report</h1></td></tr>\n" + "<tr><td class=\"tdright\"><img src=\"?img=identity.png\"/></td>\n" - + "<td rowspan=3><form method=GET action=") - .append(serverAddress).append(">\n") - .append(t("lima-business.document.date.begin")) - .append("<input value=\"") - .append(sdf.format(beginDatePicker)) - .append("\" type=\"date\" name=\"beginDate\">\n") - .append(t("lima-business.document.date.end")) - .append("<input value=\"") - .append(sdf.format(endDatePicker)) - .append("\" type=\"date\" name=\"endDate\">\n<br/><br/>"); - //+ "Format : <select name=\"format\">"); - - - pageContent.append(/*"</select>\n" - + */"Documents : <select id=\"model\" name=\"model\" onchange='showAccountInput()'>"); - - for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { - pageContent.append("<option value=\"") - .append(documentsEnum.getFileName()) - .append("\">") - .append(documentsEnum.getDescription()) - .append("</option>\n"); - } - - List<Account> accounts = accountService.getAllAccounts(); - - StringBuilder optionAccounts = new StringBuilder(); - for (Account account1:accounts) { - optionAccounts.append("<option value=\"" + account1.getTopiaId() + "\">"); - optionAccounts.append(account1.getAccountNumber() + " - " + account1.getLabel()); - optionAccounts.append("</option>\n"); - } - - pageContent.append("</select>" - + "<div id='accountField'>Compte : <select id=\"account\" name=\"account\">" - + optionAccounts.toString() - + "</select></div>" - + "<input type=\"submit\">\n" - + "</form></td>" - + "<tr><td class=\"tdright\"><img src=\"?img=entries.png\"/></td></tr>\n" - + "<tr><td class=\"tdright\"><img src=\"?img=accounts.png\"/></td></tr>\n" - + "<tr><td class=\"tdright\"><img src=\"?img=entrybooks.png\"/></td>\n" - + "<tr><td class=\"tdright\"><img src=\"?img=fiscalperiods.png\"/></td></tr>\n" - + "</table>\n" - + "<script type=\"text/javascript\">" - + " showAccountInput();" - + "</script>" - + "</body>\n" - + "</html>"); - - resp.getWriter().write(pageContent.toString()); + protected void doImage(HttpServletResponse resp, String imageParam) throws IOException { + URL image = Resource.getURLOrNull("images/" + imageParam); + if (image != null) { + resp.setContentType(FormatsEnum.PNG.getMimeType()); + InputStream in = image.openStream(); + OutputStream out = resp.getOutputStream(); + IOUtils.copy(in, out); + } + } + + protected void doCreateReport(HttpServletResponse resp, String model, String beginDate, String endDate, + String account) throws IOException { + + + SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); + + try { + Date beginDateFormat = sdf.parse(beginDate); + Date endDateFormat = sdf.parse(endDate); + GeneratedReport generatedReport = + documentService.createReport(beginDateFormat, endDateFormat, model, account); + + if (Strings.isNullOrEmpty(generatedReport.getHtmlContent())) { + InputStream in = generatedReport.getPdfStream(); + + resp.setContentType(FormatsEnum.PDF.getMimeType()); + OutputStream out = resp.getOutputStream(); + IOUtils.copy(in, out); + } else { + String report = generatedReport.getHtmlContent(); + + resp.setContentType(FormatsEnum.HTML.getMimeType()); + OutputStream out = resp.getOutputStream(); + IOUtils.write(report, out, Charsets.UTF_8); } - } catch (GenericJDBCException eee) { - log.error("Can't read db", eee); + + } catch (ParseException pe) { + throw new LimaTechnicalException("Cannot parse dates", pe); } } - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - doGet(req, resp); + protected void doHomeHtml(HttpServletRequest req, HttpServletResponse resp) throws IOException { + SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); + if (log.isDebugEnabled()) { + log.debug("Home html"); + } + + resp.setContentType(FormatsEnum.HTML.getMimeType()); + StringBuilder pageContent = new StringBuilder(); + + log.info("Page load"); + + /** create server Address using static config if exist or dynamical address */ + String urlFormat = "http://%s:%d"; + String serverAddress; + if (limaHttpHost.equals("")) { + serverAddress = String.format(urlFormat, req.getServerName(), req.getServerPort()); + } else { + serverAddress = String.format(urlFormat, limaHttpHost, limaHttpPort); + } + + Calendar calendar = Calendar.getInstance(); + Date endDatePicker = calendar.getTime(); + Date beginDatePicker = calendar.getTime(); + beginDatePicker = + DateUtils.truncate(beginDatePicker, Calendar.YEAR); + + pageContent.append("<!DOCTYPE html>\n" + "<html lang=\"fr\">\n" + + "<head>\n" + + "<script type=\"text/javascript\">" + + " function showAccountInput(){" + + " var request = document.getElementById('model');" + + " var requestValue = request == null ? '': request.value;" + + " var isDocumentAccount = requestValue === 'lima_account'; " + + " if (document.getElementById('accountField') != null) {" + + " if (isDocumentAccount) {" + + " document.getElementById('accountField').style.display = 'block';" + + " } else {" + + " document.getElementById('accountField').style.display = 'none';" + + " }" + + " }" + + " }" + + " showAccountInput();" + + " </script>" + + "<title>LIMA Documents Report</title>\n" + "<style type=\"text/css\">" + "body { font: 14px sans-serif; }" + "h1 { font: 20px sans-serif; text-align: center; }" + "table.padding td {padding-right:20px;}" + ".tdright {text-align: right;}" + "</style>" + + "</head>\n" + + "<body>\n" + "<table class=\"padding\">\n" + "<tr><td><img src=\"?img=puzzle_icon_mini.png\"/></td>\n" + "<td><h1>LIMA Documents Report</h1></td></tr>\n" + "<tr><td class=\"tdright\"><img src=\"?img=identity.png\"/></td>\n" + + "<td rowspan=3><form method=GET action=") + .append(serverAddress).append(">\n") + .append(t("lima-business.document.date.begin")) + .append("<input value=\"") + .append(sdf.format(beginDatePicker)) + .append("\" type=\"date\" name=\"beginDate\">\n") + .append(t("lima-business.document.date.end")) + .append("<input value=\"") + .append(sdf.format(endDatePicker)) + .append("\" type=\"date\" name=\"endDate\">\n<br/><br/>"); + //+ "Format : <select name=\"format\">"); + + + pageContent.append(/*"</select>\n" + + */"Documents : <select id=\"model\" name=\"model\" onchange='showAccountInput()'>"); + + for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { + pageContent.append("<option value=\"") + .append(documentsEnum.getFileName()) + .append("\">") + .append(documentsEnum.getDescription()) + .append("</option>\n"); + } + + List<Account> accounts = documentService.getAllAccounts(); + + StringBuilder optionAccounts = new StringBuilder(); + for (Account account1:accounts) { + optionAccounts.append("<option value=\"" + account1.getTopiaId() + "\">"); + optionAccounts.append(account1.getAccountNumber() + " - " + account1.getLabel()); + optionAccounts.append("</option>\n"); + } + + pageContent.append("</select>" + + "<div id='accountField'>Compte : <select id=\"account\" name=\"account\">" + + optionAccounts.toString() + + "</select></div>" + + "<input type=\"submit\">\n" + + "</form></td>" + + "<tr><td class=\"tdright\"><img src=\"?img=entries.png\"/></td></tr>\n" + + "<tr><td class=\"tdright\"><img src=\"?img=accounts.png\"/></td></tr>\n" + + "<tr><td class=\"tdright\"><img src=\"?img=entrybooks.png\"/></td>\n" + + "<tr><td class=\"tdright\"><img src=\"?img=fiscalperiods.png\"/></td></tr>\n" + + "</table>\n" + + "<script type=\"text/javascript\">" + + " showAccountInput();" + + "</script>" + + "</body>\n" + + "</html>"); + + resp.getWriter().write(pageContent.toString()); } + } } diff --git a/lima-server/src/main/java/org.chorem.lima/server/LimaServerConfig.java b/lima-server/src/main/java/org.chorem.lima/server/LimaServerConfig.java index 7d1936c..3ac87f5 100644 --- a/lima-server/src/main/java/org.chorem.lima/server/LimaServerConfig.java +++ b/lima-server/src/main/java/org.chorem.lima/server/LimaServerConfig.java @@ -11,10 +11,8 @@ import org.nuiton.config.ConfigOptionDef; import javax.naming.Context; -import java.io.File; import java.util.Properties; -import static org.nuiton.i18n.I18n.n; import static org.nuiton.i18n.I18n.t; /** @@ -103,21 +101,13 @@ public class LimaServerConfig { return config.getFlatOptions(); } - public File getReportsModelDir() { - return config.getOptionAsFile(ServerConfigOption.REPORTS_MODEL_DIR.getKey()); - } - public enum ServerConfigOption implements ConfigOptionDef { EJB_INITIAL_CONTEXT_FACTORY(Context.INITIAL_CONTEXT_FACTORY, "", LocalInitialContextFactory.class.getName(), String.class, false, true), EJB_REMOTABLE("openejb.embedded.remotable", "", "true", Boolean.class, false, true), EJB_PORT("ejbd.port", "", "4202", Integer.class, false, false), - EJB_BIND("ejbd.bind", "", "0.0.0.0", String.class, false, false), - - DATA_DIR("lima.data.dir", n("lima.config.data.dir.description"), "${user.home}/.lima", File.class, false, false), - - REPORTS_MODEL_DIR("lima.reports.dir",n("lima.config.reports.dir.description"),"${lima.data.dir}/reports", File.class, false, false); + EJB_BIND("ejbd.bind", "", "0.0.0.0", String.class, false, false); private final String key; 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 0eb1f29..2ccad1a 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 @@ -87,7 +87,7 @@ public class AccountViewHandler implements ServiceListener { /** * Sort account with label length. */ - protected static Comparator<Account> accountLengthComparator = new Comparator<Account>() { + protected static final Comparator<Account> ACCOUNT_LENGTH_COMPARATOR = new Comparator<Account>() { @Override public int compare(Account o1, Account o2) { int result = o1.getAccountNumber().length() - o2.getAccountNumber().length(); @@ -101,7 +101,7 @@ public class AccountViewHandler implements ServiceListener { /** * Sort Account number by lenght in reverse order. */ - protected static Comparator<String> reverseAccountLengthComparator = new Comparator<String>() { + protected static final Comparator<String> REVERSE_ACCOUNT_LENGTH_COMPARATOR = new Comparator<String>() { @Override public int compare(String o1, String o2) { int result = o2.length() - o1.length(); @@ -195,13 +195,13 @@ public class AccountViewHandler implements ServiceListener { protected void loadAllAccounts() { // default data load List<Account> accounts = accountService.getAllAccounts(); - Collections.sort(accounts, accountLengthComparator); + Collections.sort(accounts, ACCOUNT_LENGTH_COMPARATOR); if (log.isDebugEnabled()) { log.debug(String.format("Loaded %d accounts from service", accounts.size())); } // render in tree node hierarchy for DefaultTreeTableModel - SortedMap<String, DefaultMutableTreeTableNode> nodeCache = new TreeMap<String, DefaultMutableTreeTableNode>(reverseAccountLengthComparator); + SortedMap<String, DefaultMutableTreeTableNode> nodeCache = new TreeMap<String, DefaultMutableTreeTableNode>(REVERSE_ACCOUNT_LENGTH_COMPARATOR); DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode(null); for (Account account : accounts) { // find parent diff --git a/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java b/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java deleted file mode 100644 index ac2e0e7..0000000 --- a/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java +++ /dev/null @@ -1,653 +0,0 @@ -/* - * #%L - * $Id: AbstractLimaTest.java 3929 2014-09-29 16:26:31Z dcosse $ - * %% - * Copyright (C) 2011 - 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% - */ - -package org.chorem.lima.ui; - -import com.google.common.base.Function; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.LimaBusinessConfig; -import org.chorem.lima.business.api.AccountService; -import org.chorem.lima.business.api.EntryBookService; -import org.chorem.lima.business.api.EntryService; -import org.chorem.lima.business.api.ExportService; -import org.chorem.lima.business.api.FinancialPeriodService; -import org.chorem.lima.business.api.FinancialStatementService; -import org.chorem.lima.business.api.FinancialTransactionService; -import org.chorem.lima.business.api.FiscalPeriodService; -import org.chorem.lima.business.api.IdentityService; -import org.chorem.lima.business.api.ImportService; -import org.chorem.lima.business.api.ReportService; -import org.chorem.lima.business.api.VatStatementService; -import org.chorem.lima.entity.Account; -import org.chorem.lima.entity.AccountTopiaDao; -import org.chorem.lima.entity.LimaCallaoEntityEnum; -import org.chorem.lima.entity.LimaCallaoTopiaApplicationContext; -import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext; -import org.chorem.lima.server.LimaServerConfig; -import org.chorem.lima.business.LimaServiceFactory; -import org.hibernate.cfg.Environment; -import org.junit.Before; -import org.nuiton.i18n.I18n; -import org.nuiton.i18n.init.ClassPathI18nInitializer; -import org.nuiton.topia.persistence.TopiaApplicationContextCache; - -import java.io.File; -import java.io.IOException; -import java.text.DateFormat; -import java.util.Locale; -import java.util.Properties; -import java.util.UUID; - -/** - * Common initialization code for all lima tests. - * - * @author chatellier - * @version $Revision: 3929 $ - * <p/> - * Last update : $Date: 2014-09-29 18:26:31 +0200 (lun. 29 sept. 2014) $ - * By : $Author: dcosse $ - */ -public abstract class AbstractLimaTest { - - protected static final Log log = LogFactory.getLog(AbstractLimaTest.class); - protected static final Function<Properties, LimaCallaoTopiaApplicationContext> CREATE_CONTEXT_FUNCTION = new Function<Properties, LimaCallaoTopiaApplicationContext>() { - @Override - public LimaCallaoTopiaApplicationContext apply(Properties input) { - return new LimaCallaoTopiaApplicationContext(input); - } - }; - - protected static DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.ENGLISH); - protected static final String LIMA_TEST_DEFAULT_CONF_FILENAME = "lima-test.properties"; - - protected AccountService accountService; - protected EntryBookService entryBookService; - protected FinancialPeriodService financialPeriodService; - protected FinancialTransactionService financialTransactionService; - protected FiscalPeriodService fiscalPeriodService; - protected ReportService reportService; - protected EntryService entryService; - protected ImportService importService; - protected ExportService exportService; - protected FinancialStatementService financialStatementService; - protected VatStatementService vatStatementService; - protected IdentityService identityService; - - protected LimaCallaoTopiaApplicationContext context; - - /** - * This is a before class method, but junit will fail to run inherited - * BeforeClass methods if there is one. - * - * @throws Exception - */ - @Before - public void initAbstractTest() throws Exception { - setUpLocale(); - Properties options = getTestConfiguration(); - new LimaTestsConfig(LIMA_TEST_DEFAULT_CONF_FILENAME, options); - initServices(); - context = createNewTestApplicationContext(); - } - - protected void setUpLocale() throws Exception { - I18n.init(new ClassPathI18nInitializer(), Locale.UK); - } - - /** - * Init services after i18n#init(). - * @throws java.io.IOException - */ - protected void initServices() throws IOException { - if(accountService == null) { - LimaServiceFactory.initFactory(LimaBusinessConfig.getInstance().getConfig()); - accountService = LimaServiceFactory.getService(AccountService.class); - entryBookService = LimaServiceFactory.getService(EntryBookService.class); - financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class); - financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class); - fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodService.class); - reportService = LimaServiceFactory.getService(ReportService.class); - entryService = LimaServiceFactory.getService(EntryService.class); - financialStatementService = LimaServiceFactory.getService(FinancialStatementService.class); - vatStatementService = LimaServiceFactory.getService(VatStatementService.class); - - importService = LimaServiceFactory.getService(ImportService.class); - exportService = LimaServiceFactory.getService(ExportService.class); - identityService = LimaServiceFactory.getService(IdentityService.class); - } - } - - /** - * Return a new instance of configuration defined on a new database at - * each call. - * - * @return single test config - */ - protected Properties getTestConfiguration() { - - // do not call parse() method (don't read /etc...) - // load file manually (lima-business.config) - Properties testProperties = new Properties(); - // override somes - String testDir = System.getProperty("java.io.tmpdir") + File.separator + "lima-business-" + UUID.randomUUID().toString(); - testProperties.setProperty(LimaServerConfig.ServerConfigOption.DATA_DIR.getKey(), testDir); - testProperties.setProperty(Environment.URL, "jdbc:h2:file:" + testDir + File.separator + "data"); - testProperties.setProperty(Environment.CURRENT_SESSION_CONTEXT_CLASS, "thread"); - testProperties.setProperty("topia.persistence.classes", LimaCallaoEntityEnum.getImplementationClassesAsString()); - return testProperties; - } - - /** - * Method to use only for class that need a context to be tester. - * Only for DOA for now. - * - * @return a topia context - */ - protected LimaCallaoTopiaApplicationContext getTestApplicationContext(Properties options) { - log.info("Opening context to database : " + options.getProperty("hibernate.connection.url")); - - LimaCallaoTopiaApplicationContext result = TopiaApplicationContextCache.getContext(options, CREATE_CONTEXT_FUNCTION); - return result; - } - - protected LimaCallaoTopiaApplicationContext createNewTestApplicationContext() { - Properties options = LimaBusinessConfig.getInstance().getFlatOptions(); - LimaCallaoTopiaApplicationContext result = getTestApplicationContext(options); - return result; - } - - /** - * Create a basic account plan. - * - * @throws org.chorem.lima.business.exceptions.LimaException - * @throws java.text.ParseException - */ - protected void initTestDefaultAccounts() throws Exception { - LimaCallaoTopiaPersistenceContext tcontext = context.newPersistenceContext(); - AccountTopiaDao accountTopiaDao = tcontext.getAccountDao(); - - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1", Account.PROPERTY_LABEL, "COMPTES DE CAPITAUX"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2", Account.PROPERTY_LABEL, "COMPTES D'IMMOBILISATIONS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "3", Account.PROPERTY_LABEL, "COMPTES DE STOCKS ET D'EN-COURS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4", Account.PROPERTY_LABEL, "COMPTES DE TIERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5", Account.PROPERTY_LABEL, "COMPTES FINANCIERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6", Account.PROPERTY_LABEL, "COMPTES DE CHARGES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7", Account.PROPERTY_LABEL, "COMPTES DE PRODUITS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "8", Account.PROPERTY_LABEL, "COMPTES SPECIAUX"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "10", Account.PROPERTY_LABEL, "REPORT A NOUVEAU (solde créditeur ou débiteur)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "11", Account.PROPERTY_LABEL, "RESULTAT NET DE L'EXERCICE (bénéfice ou perte)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "12", Account.PROPERTY_LABEL, "PROVISIONS REGLEMENTEES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "13", Account.PROPERTY_LABEL, "PROVlSlONS POUR RISQUES ET CHARGES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "14", Account.PROPERTY_LABEL, "EMPRUNTS ET DETTES ASSIMILEES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "15", Account.PROPERTY_LABEL, "IMMOBlLlSATIONS CORPORELLES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "16", Account.PROPERTY_LABEL, "IMMOBILlSATlONS EN COURS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "17", Account.PROPERTY_LABEL, "AUTRES IMMOBILISATIONS FINANCIERES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "20", Account.PROPERTY_LABEL, "MATIERES PREMIERES (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "21", Account.PROPERTY_LABEL, "AUTRES APPROVISIONNEMENTS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "23", Account.PROPERTY_LABEL, "EN-COURS DE PRODUCTION DE BIENS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "26", Account.PROPERTY_LABEL, "EN-COURS DE PRODUCTION DE SERVICES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27", Account.PROPERTY_LABEL, "STOCKS DE PRODUITS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "28", Account.PROPERTY_LABEL, "STOCKS DE MARCHANDISES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "29", Account.PROPERTY_LABEL, "SECURITE SOCIALE ET AUTRES ORGANISMES SOCIAUX"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "31", Account.PROPERTY_LABEL, "DEBITEURS ET CREDITEURS DIVERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "32", Account.PROPERTY_LABEL, "COMPTES TRANSITOIRES OU D'ATTENTE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "33", Account.PROPERTY_LABEL, "VALEURS MOBILIERES DE PLACEMENT"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "34", Account.PROPERTY_LABEL, "BANQUES; ETABLISSEMENTS FINANCIERS ET ASSIMILES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "35", Account.PROPERTY_LABEL, "CAISSE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "37", Account.PROPERTY_LABEL, "REGIES D'AVANCES ET ACCREDITIFS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "39", Account.PROPERTY_LABEL, "VIREMENTS INTERNES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "40", Account.PROPERTY_LABEL, "ACHATS (sauf 603)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "41", Account.PROPERTY_LABEL, "Services extérieurs"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "42", Account.PROPERTY_LABEL, "Autres services extérieurs"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "43", Account.PROPERTY_LABEL, "IMPOTS; TAXES ET VERSEMENTS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44", Account.PROPERTY_LABEL, "AUTRES CHARGES DE GESTION COURANTE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "45", Account.PROPERTY_LABEL, "CHARGES FINANCIERES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "46", Account.PROPERTY_LABEL, "CHARGES EXCEPTIONNELLES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "47", Account.PROPERTY_LABEL, "PRODUCTION IMMOBILISEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "48", Account.PROPERTY_LABEL, "SUBVENTlONS D'EXPLOITATION"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "49", Account.PROPERTY_LABEL, "AUTRES PRODUITS DE GESTION COURANTE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "50", Account.PROPERTY_LABEL, "PRODUITS FINANCIERS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "51", Account.PROPERTY_LABEL, "PRODUITS EXCEPTIONNELS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "52", Account.PROPERTY_LABEL, "REPRISES SUR AMORTISSEMENTS ET PROVISIONS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "53", Account.PROPERTY_LABEL, "TRANSFERTS DE CHARGES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "54", Account.PROPERTY_LABEL, "ENGAGEMENTS HORS BILAN"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "58", Account.PROPERTY_LABEL, "RESULTAT EN INSTANCE D'AFFECTATION"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "59", Account.PROPERTY_LABEL, "BILAN"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "60", Account.PROPERTY_LABEL, "Capital"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "61", Account.PROPERTY_LABEL, "Ecarts de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "62", Account.PROPERTY_LABEL, "Compte de l'exploitant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "63", Account.PROPERTY_LABEL, "Résultat de l'exercice (bénéfice)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "64", Account.PROPERTY_LABEL, "Résultat de l'exercice (perte)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "65", Account.PROPERTY_LABEL, "Amortissements dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "66", Account.PROPERTY_LABEL, "Provision spéciale de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "67", Account.PROPERTY_LABEL, "Plus-values réinvesties"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68", Account.PROPERTY_LABEL, "Autres provisions réglementées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "69", Account.PROPERTY_LABEL, "Provisions pour risques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "70", Account.PROPERTY_LABEL, "Autres emprunts obligataires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "71", Account.PROPERTY_LABEL, "Emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "72", Account.PROPERTY_LABEL, "Primes de remboursement des obligations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "74", Account.PROPERTY_LABEL, "Dettes rattachées a des participations (groupe)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "75", Account.PROPERTY_LABEL, "Frais détablissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "76", Account.PROPERTY_LABEL, "Frais de recherche et de développement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "77", Account.PROPERTY_LABEL, "Concessions et droits similaires; brevets; licences; marques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78", Account.PROPERTY_LABEL, "Droit au bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "79", Account.PROPERTY_LABEL, "Fonds commercial"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "80", Account.PROPERTY_LABEL, "Autres immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "88", Account.PROPERTY_LABEL, "Dépôts et cautionnements versés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "89", Account.PROPERTY_LABEL, "Amortissements des immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "101", Account.PROPERTY_LABEL, "Amortissements des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "104", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations incorporell"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "105", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "106", Account.PROPERTY_LABEL, "Provisions pour dépréciation des participations et créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "107", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres immobilisations fina"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "108", Account.PROPERTY_LABEL, "Provisions pour dépréciation des matières premières (et four"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "109", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres approvisionnements"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "110", Account.PROPERTY_LABEL, "Provisions pour dépréciation des encours de production de bi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "119", Account.PROPERTY_LABEL, "Provisions pour dépréciation des en-cours de production de s"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "120", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de produits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "129", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "131", Account.PROPERTY_LABEL, "Personnel - Rémunérations dues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "138", Account.PROPERTY_LABEL, "Personnel - Charges à payer et produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "139", Account.PROPERTY_LABEL, "Sécurité sociale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "142", Account.PROPERTY_LABEL, "Autres organismes sociaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "143", Account.PROPERTY_LABEL, "Etat - Impôts sur les bénéfices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "144", Account.PROPERTY_LABEL, "Etat - Taxes sur le chiffre d'affaires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "145", Account.PROPERTY_LABEL, "Obligations cautionnées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "146", Account.PROPERTY_LABEL, "Autres impôts; taxes et versements assimilés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "147", Account.PROPERTY_LABEL, "Associés - Comptes courants"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "148", Account.PROPERTY_LABEL, "Créances sur cessions d'immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "151", Account.PROPERTY_LABEL, "Compte d'attente"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "153", Account.PROPERTY_LABEL, "Charges à repartir sur plusieurs exercices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "154", Account.PROPERTY_LABEL, "Charges constatées d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "155", Account.PROPERTY_LABEL, "Produits constatés d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "156", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de clients"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "157", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de débiteurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "158", Account.PROPERTY_LABEL, "Valeurs à I'encaissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "161", Account.PROPERTY_LABEL, "Banques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "163", Account.PROPERTY_LABEL, "Autres organismes financiers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "164", Account.PROPERTY_LABEL, "Concours bancaires courant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "165", Account.PROPERTY_LABEL, "Caisse siège social"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "166", Account.PROPERTY_LABEL, "Virements internes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "167", Account.PROPERTY_LABEL, "Provisions pour dépréciation des valeurs mobilières de place"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "168", Account.PROPERTY_LABEL, "Achats stockés - Matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "169", Account.PROPERTY_LABEL, "VARIATION DES STOCKS (approvisionnements et marchandises)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "171", Account.PROPERTY_LABEL, "Achat de materiel; equipement et travaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "174", Account.PROPERTY_LABEL, "Achats non stockes de matières et fournitures"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "178", Account.PROPERTY_LABEL, "Achats de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "201", Account.PROPERTY_LABEL, "Frais accessoires d'achat"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "203", Account.PROPERTY_LABEL, "Rabais; remises et ristournes obtenus sur achats"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "205", Account.PROPERTY_LABEL, "Sous-traitance générale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "206", Account.PROPERTY_LABEL, "Redevances de crédit-bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "207", Account.PROPERTY_LABEL, "Locations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "208", Account.PROPERTY_LABEL, "Charges locatives et de copropriété"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "211", Account.PROPERTY_LABEL, "Entretien et réparations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "212", Account.PROPERTY_LABEL, "Primes d'assurance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "213", Account.PROPERTY_LABEL, "Personnel extérieur à l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "214", Account.PROPERTY_LABEL, "Rémunérations intermédiaires et honoraires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "215", Account.PROPERTY_LABEL, "Publicité; publications; relations publiques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "218", Account.PROPERTY_LABEL, "Transports de biens et transports collectifs du personnel"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "231", Account.PROPERTY_LABEL, "Déplacements; missions et réceptions"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "232", Account.PROPERTY_LABEL, "Frais postaux et frais de télécommunications"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "237", Account.PROPERTY_LABEL, "Services bancaires et assimiles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "238", Account.PROPERTY_LABEL, "Impôts; taxes et versements assimiles sur rémunérations (aut"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "261", Account.PROPERTY_LABEL, "Autres impôts taxes et versements assimiles (administration"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "266", Account.PROPERTY_LABEL, "Rémunération du travail de l'exploitant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "267", Account.PROPERTY_LABEL, "Charges de sécurité sociale et de prévoyance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "268", Account.PROPERTY_LABEL, "Redevances pour concessions; brevets; licences; marques; pro"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "269", Account.PROPERTY_LABEL, "Pertes sur créances irrécouvrables"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "271", Account.PROPERTY_LABEL, "Quote-part de résultat sur opérations faites en commun"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "272", Account.PROPERTY_LABEL, "Escomptes accordés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "273", Account.PROPERTY_LABEL, "Valeurs comptables des éléments d'actif cédés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "274", Account.PROPERTY_LABEL, "Dotations aux amort. - Charges d'exploitation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "275", Account.PROPERTY_LABEL, "Dotations aux amortissements et aux provisions - Charges fin"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "276", Account.PROPERTY_LABEL, "Dotations aux amortissements et aux provisions - Charges exc"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "279", Account.PROPERTY_LABEL, "Participation des salaries aux fruits de l'expansion"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "280", Account.PROPERTY_LABEL, "Impôts sur les bénéfices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "281", Account.PROPERTY_LABEL, "Imposition forfaitaire annuelle des sociétés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "290", Account.PROPERTY_LABEL, "Produits - Reports en arrière des déficits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "291", Account.PROPERTY_LABEL, "Ventes de produits finis"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "293", Account.PROPERTY_LABEL, "Prestations de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "296", Account.PROPERTY_LABEL, "Ventes de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "297", Account.PROPERTY_LABEL, "Produits des activités annexes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "311", Account.PROPERTY_LABEL, "Rabais; remises et ristournes accordées par l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "312", Account.PROPERTY_LABEL, "VARIATION DES STOCKS (en-cours de production; produits)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "317", Account.PROPERTY_LABEL, "Immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "321", Account.PROPERTY_LABEL, "Produits divers de gestion courante"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "322", Account.PROPERTY_LABEL, "Escomptes obtenus"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "326", Account.PROPERTY_LABEL, "Produits des cessions éléments d'actif"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "331", Account.PROPERTY_LABEL, "Reprises sur amortissements et provisions (à inscrire dans l"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "335", Account.PROPERTY_LABEL, "Reprises sur provisions a inscrire dans les produits financi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "341", Account.PROPERTY_LABEL, "Reprises sur provisions (à inscrire dans les produits except"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "345", Account.PROPERTY_LABEL, "Transfert de charges d'exploitation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "351", Account.PROPERTY_LABEL, "Engagements donnés par l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "355", Account.PROPERTY_LABEL, "Engagements reçus par l'entreprise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "358", Account.PROPERTY_LABEL, "Contrepartie des engagements"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "371", Account.PROPERTY_LABEL, "Réserve légale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "372", Account.PROPERTY_LABEL, "Réserves indisponibles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "391", Account.PROPERTY_LABEL, "Réserves statutaires ou contractuelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "392", Account.PROPERTY_LABEL, "Réserves réglementes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "393", Account.PROPERTY_LABEL, "Autres réserves"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "394", Account.PROPERTY_LABEL, "Provisions pour charges sociales et fiscales sur congés à pa"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "395", Account.PROPERTY_LABEL, "Matériel industriel (1)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "397", Account.PROPERTY_LABEL, "Matériel de transport"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "400", Account.PROPERTY_LABEL, "Matériel de bureau et matériel informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "401", Account.PROPERTY_LABEL, "Frais établissement (même ventilation que celle du compte 20"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "403", Account.PROPERTY_LABEL, "Constructions même ventilation que celle du compte 213)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "404", Account.PROPERTY_LABEL, "Installations techniques; matériel et outillage industriels"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "405", Account.PROPERTY_LABEL, "Dettes provisionnées pour congés à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "408", Account.PROPERTY_LABEL, "Autres charges à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "409", Account.PROPERTY_LABEL, "Obligataires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "410", Account.PROPERTY_LABEL, "tva cee"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "411", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires déductibles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "413", Account.PROPERTY_LABEL, "Produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "416", Account.PROPERTY_LABEL, "Reglement par chèques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "417", Account.PROPERTY_LABEL, "Réglement par CB"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "418", Account.PROPERTY_LABEL, "Réglement par LCR"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "419", Account.PROPERTY_LABEL, "Réglement en especes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "421", Account.PROPERTY_LABEL, "Intérêts courus à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "422", Account.PROPERTY_LABEL, "Crédit de mobilisation de créances commerciales (CMCC)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "424", Account.PROPERTY_LABEL, "Mobilisation de créances nées à létranger"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "425", Account.PROPERTY_LABEL, "Fournitures consommables"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "426", Account.PROPERTY_LABEL, "Variation des stocks de matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "427", Account.PROPERTY_LABEL, "Variation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "428", Account.PROPERTY_LABEL, "Achat marchandise CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "431", Account.PROPERTY_LABEL, "Achats en francise"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "437", Account.PROPERTY_LABEL, "Malis sur emballages"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "438", Account.PROPERTY_LABEL, "Honoraires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "441", Account.PROPERTY_LABEL, "Commissions et frais sur émission d'emprunts"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "442", Account.PROPERTY_LABEL, "Frais sur effets (commissions d'endos...)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "443", Account.PROPERTY_LABEL, "Participation des employeurs à l'effort de construction"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "444", Account.PROPERTY_LABEL, "Contribution sociale de solidarité à la charge des sociétés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445", Account.PROPERTY_LABEL, "Congés payes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "446", Account.PROPERTY_LABEL, "Indemnités et avantages divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "447", Account.PROPERTY_LABEL, "Cotisations à l'URSSAF"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "451", Account.PROPERTY_LABEL, "Cotisations aux caisses de retraites"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "455", Account.PROPERTY_LABEL, "Cotisations aux ASSEDIC"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "456", Account.PROPERTY_LABEL, "Intérêts des emprunts et dettes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "457", Account.PROPERTY_LABEL, "Intérêts des comptes courants et des dépôts créditeurs"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "458", Account.PROPERTY_LABEL, "Intérêts bancaires et sur opérations de financement (escompt"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "462", Account.PROPERTY_LABEL, "Intérêts des obligations cautionnées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "464", Account.PROPERTY_LABEL, "Pertes de change ou de conversion"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "465", Account.PROPERTY_LABEL, "Dotations aux amortissements sur immobilisations incorporell"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "467", Account.PROPERTY_LABEL, "Dotations aux amortissements des charges d'exploitation à ré"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "468", Account.PROPERTY_LABEL, "Dotations aux provisions pour risques et charges d'exploitat"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "470", Account.PROPERTY_LABEL, "Dotations aux amortissements des primes de remboursement des"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "476", Account.PROPERTY_LABEL, "Dotation aux provisions pour dépréciation des éléments finan"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "477", Account.PROPERTY_LABEL, "Dotations aux amortissements exceptionnels sur immobilisatio"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "478", Account.PROPERTY_LABEL, "Ports et frais accessoires factures"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "481", Account.PROPERTY_LABEL, "Bonis sur reprises d'emballages consignes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "486", Account.PROPERTY_LABEL, "Autres produits activités annexes (cessions d'approvisionnem"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "487", Account.PROPERTY_LABEL, "Variation des en-cours de production de biens"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "488", Account.PROPERTY_LABEL, "Variation des en-cours de production de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "491", Account.PROPERTY_LABEL, "Variation des stocks de produits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "495", Account.PROPERTY_LABEL, "Gains de change ou de conversion"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "496", Account.PROPERTY_LABEL, "Reprises sur provisions pour dépréciation des éléments finan"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "501", Account.PROPERTY_LABEL, "Sur emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "502", Account.PROPERTY_LABEL, "TVA à décaisser"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "503", Account.PROPERTY_LABEL, "TVA sur immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "504", Account.PROPERTY_LABEL, "TVA sur autres bien et services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "505", Account.PROPERTY_LABEL, "Crédit de TVA à reporter"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "506", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "507", Account.PROPERTY_LABEL, "TVA collectée"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "508", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "509", Account.PROPERTY_LABEL, "Remboursement de taxes sur le chiffre d'affaires demandé"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "511", Account.PROPERTY_LABEL, "TVA récupérée d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "512", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires sur factures non parvenues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "514", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires sur factures à établir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "515", Account.PROPERTY_LABEL, "Achats stockés - Matières premières France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "516", Account.PROPERTY_LABEL, "Achats stockés - Matières premières CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "517", Account.PROPERTY_LABEL, "Frais accessoires d'achat France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "518", Account.PROPERTY_LABEL, "Frais accessoires d'achat CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "519", Account.PROPERTY_LABEL, "Dotations aux amort. immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "530", Account.PROPERTY_LABEL, "Dotations provisions dépréc. immos incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "540", Account.PROPERTY_LABEL, "Dotations provisions dépréc. immos corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "580", Account.PROPERTY_LABEL, "Stocks et en-cours"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "590", Account.PROPERTY_LABEL, "Créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "601", Account.PROPERTY_LABEL, "Amortissements dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "602", Account.PROPERTY_LABEL, "Ventes de produits finis France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "603", Account.PROPERTY_LABEL, "Ventes de produits finis CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "604", Account.PROPERTY_LABEL, "Prestations de services France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "605", Account.PROPERTY_LABEL, "Prestations de services CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "606", Account.PROPERTY_LABEL, "Ventes de marchandises France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "607", Account.PROPERTY_LABEL, "Ventes de marchandises CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "608", Account.PROPERTY_LABEL, "Compte créé pendant import"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "609", Account.PROPERTY_LABEL, "Reprises prov. dépréc. immos incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "611", Account.PROPERTY_LABEL, "Reprises prov. dépréc. immos corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "612", Account.PROPERTY_LABEL, "Stocks et en-cours"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "613", Account.PROPERTY_LABEL, "Créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "614", Account.PROPERTY_LABEL, "Reprises sur provisions - Amort. dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "615", Account.PROPERTY_LABEL, "achat cee"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "616", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "617", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "618", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "619", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "621", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "622", Account.PROPERTY_LABEL, "TVA sur autres bien et services 19.6 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "623", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "624", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "625", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "626", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "627", Account.PROPERTY_LABEL, "TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "628", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "629", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Débit CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "631", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "633", Account.PROPERTY_LABEL, "TVA Collectée 19.6 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "635", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Encais. France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "637", Account.PROPERTY_LABEL, "TVA Collectée 5.5 Encais. CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "641", Account.PROPERTY_LABEL, "Capital"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "644", Account.PROPERTY_LABEL, "Capital non amorti"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "645", Account.PROPERTY_LABEL, "Ecarts de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "646", Account.PROPERTY_LABEL, "Réserve légale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "647", Account.PROPERTY_LABEL, "réserve légale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "648", Account.PROPERTY_LABEL, "Réserves indisponibles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "651", Account.PROPERTY_LABEL, "Réserves statutaires ou contractuelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "653", Account.PROPERTY_LABEL, "Réserves réglementes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "654", Account.PROPERTY_LABEL, "Autres réserves"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "655", Account.PROPERTY_LABEL, "Compte de l'exploitant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "658", Account.PROPERTY_LABEL, "report a nouveau"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "661", Account.PROPERTY_LABEL, "Résultat de l'exercice (bénéfice)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "664", Account.PROPERTY_LABEL, "Résultat de l'exercice (perte)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "665", Account.PROPERTY_LABEL, "Amortissements dérogatoires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "667", Account.PROPERTY_LABEL, "Provision spéciale de réévaluation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "668", Account.PROPERTY_LABEL, "Plus-values réinvesties"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "671", Account.PROPERTY_LABEL, "Autres provisions réglementées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "672", Account.PROPERTY_LABEL, "Provisions pour risques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "675", Account.PROPERTY_LABEL, "Provision pour litige"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "678", Account.PROPERTY_LABEL, "Provisions pour charges sociales et fiscales sur congés à pa"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "681", Account.PROPERTY_LABEL, "Autres emprunts obligataires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "686", Account.PROPERTY_LABEL, "Emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "687", Account.PROPERTY_LABEL, "Sur emprunts auprès des établissements de crédit"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "691", Account.PROPERTY_LABEL, "Primes de remboursement des obligations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "695", Account.PROPERTY_LABEL, "Dettes rattachées a des participations (groupe)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "696", Account.PROPERTY_LABEL, "Frais détablissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "697", Account.PROPERTY_LABEL, "Frais de recherche et de développement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "698", Account.PROPERTY_LABEL, "Concessions et droits similaires; brevets; licences; marques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "699", Account.PROPERTY_LABEL, "Droit au bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "701", Account.PROPERTY_LABEL, "Fonds commercial"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "702", Account.PROPERTY_LABEL, "Autres immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "703", Account.PROPERTY_LABEL, "Matériel industriel (1)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "704", Account.PROPERTY_LABEL, "Matériel de transport"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "705", Account.PROPERTY_LABEL, "Matériel de bureau et matériel informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "706", Account.PROPERTY_LABEL, "MATERIEL INFORMATIQUE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "707", Account.PROPERTY_LABEL, "Autres titres"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "708", Account.PROPERTY_LABEL, "PRET AUX SALARIES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "709", Account.PROPERTY_LABEL, "Dépôts et cautionnements versés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "713", Account.PROPERTY_LABEL, "Créances sur Titres Immo."); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "721", Account.PROPERTY_LABEL, "Amortissements des immobilisations incorporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "722", Account.PROPERTY_LABEL, "Frais établissement (même ventilation que celle du compte 20"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "740", Account.PROPERTY_LABEL, "Amortissements des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "751", Account.PROPERTY_LABEL, "Constructions même ventilation que celle du compte 213)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "752", Account.PROPERTY_LABEL, "Installations techniques; matériel et outillage industriels"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "753", Account.PROPERTY_LABEL, "AMORTISSEMENT MATERIEL"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "754", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations incorporell"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "755", Account.PROPERTY_LABEL, "Provisions pour dépréciation des immobilisations corporelles"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "758", Account.PROPERTY_LABEL, "Provisions pour dépréciation des participations et créances"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "761", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres immobilisations fina"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "762", Account.PROPERTY_LABEL, "Provisions pour dépréciation des matières premières (et four"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "763", Account.PROPERTY_LABEL, "Provisions pour dépréciation des autres approvisionnements"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "764", Account.PROPERTY_LABEL, "Provisions pour dépréciation des encours de production de bi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "765", Account.PROPERTY_LABEL, "Provisions pour dépréciation des en-cours de production de s"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "766", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de produits"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "767", Account.PROPERTY_LABEL, "Provisions pour dépréciation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "768", Account.PROPERTY_LABEL, "Fournisseurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "771", Account.PROPERTY_LABEL, "NF Poussin Benjamin"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "772", Account.PROPERTY_LABEL, "NF Thimel Arnaud"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "775", Account.PROPERTY_LABEL, "NF Ruchaud Julien"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "777", Account.PROPERTY_LABEL, "Mutuelle du Mans"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "778", Account.PROPERTY_LABEL, "SFR"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "781", Account.PROPERTY_LABEL, "Free Telecom"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "786", Account.PROPERTY_LABEL, "April"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "787", Account.PROPERTY_LABEL, "CM-CIC Epargne Salariale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "791", Account.PROPERTY_LABEL, "ECAC -Troadec"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "796", Account.PROPERTY_LABEL, "Fournisseurs facture à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "801", Account.PROPERTY_LABEL, "Facture à Emettre"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "802", Account.PROPERTY_LABEL, "Personnel - Rémunérations dues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "809", Account.PROPERTY_LABEL, "Regul Mutuelle à recupérer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "890", Account.PROPERTY_LABEL, "Personnel - Charges à payer et produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "891", Account.PROPERTY_LABEL, "Dettes provisionnées pour congés à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1061", Account.PROPERTY_LABEL, "Intéressement à verser aux salariés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1062", Account.PROPERTY_LABEL, "Personnel -autres charges a payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1063", Account.PROPERTY_LABEL, "Urssaf"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1064", Account.PROPERTY_LABEL, "Urssaf-csg-crds-forfait social"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1068", Account.PROPERTY_LABEL, "retraite"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1391", Account.PROPERTY_LABEL, "Pôle Emploi"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1398", Account.PROPERTY_LABEL, "Retraite ARRCO"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1671", Account.PROPERTY_LABEL, "Retraite Cadre AGIRC"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1674", Account.PROPERTY_LABEL, "Mutuelle"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "1675", Account.PROPERTY_LABEL, "Prévoyance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2761", Account.PROPERTY_LABEL, "charges sociales sur congés à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2768", Account.PROPERTY_LABEL, "Autres charges à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2801", Account.PROPERTY_LABEL, "URSSAF à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2803", Account.PROPERTY_LABEL, "Subventions d'expoitation"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2805", Account.PROPERTY_LABEL, "Etat - Impôts sur les bénéfices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2807", Account.PROPERTY_LABEL, "Crédit Impot Recherche à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2808", Account.PROPERTY_LABEL, "IS à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2811", Account.PROPERTY_LABEL, "Crédit Impot Recherche à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2812", Account.PROPERTY_LABEL, "Crédit Impot Intéressement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2813", Account.PROPERTY_LABEL, "Etat - Taxes sur le chiffre d'affaires"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2814", Account.PROPERTY_LABEL, "TVA à décaisser"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2815", Account.PROPERTY_LABEL, "TVA à décaisser 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2818", Account.PROPERTY_LABEL, "TVA sur immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2905", Account.PROPERTY_LABEL, "TVA sur immobilisations 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2906", Account.PROPERTY_LABEL, "TVA sur autres bien et services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2907", Account.PROPERTY_LABEL, "TVA/ABS 2;1%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2908", Account.PROPERTY_LABEL, "TVA sur autres bien et services 5.5 Débit France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2911", Account.PROPERTY_LABEL, "TVA sur autres biens et services 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2931", Account.PROPERTY_LABEL, "Crédit de TVA à reporter"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2932", Account.PROPERTY_LABEL, "Crédit de TVA à reporter 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2961", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2966", Account.PROPERTY_LABEL, "TVA collectée"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2967", Account.PROPERTY_LABEL, "TVA Collectée 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2968", Account.PROPERTY_LABEL, "TVA encaissée"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2971", Account.PROPERTY_LABEL, "TVA encaissée 20%"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2972", Account.PROPERTY_LABEL, "Taxes assimilées à la TVA"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2973", Account.PROPERTY_LABEL, "TVA A REGUL"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2974", Account.PROPERTY_LABEL, "Remboursement de taxes sur le chiffre d'affaires demandé"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2975", Account.PROPERTY_LABEL, "TVA récupérée d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "2976", Account.PROPERTY_LABEL, "Taxes sur le chif d'af sur factures non parvenues"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4081", Account.PROPERTY_LABEL, "Taxes sur le chiffre d'affaires sur factures à établir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4084", Account.PROPERTY_LABEL, "Obligations cautionnées"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4088", Account.PROPERTY_LABEL, "Autres TVA à déduire"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4091", Account.PROPERTY_LABEL, "Autres impôts; taxes et versements assimilés"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4096", Account.PROPERTY_LABEL, "ETAT CHARGES A PAYER"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4097", Account.PROPERTY_LABEL, "Etat charges a payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4098", Account.PROPERTY_LABEL, "TAXE PRO"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4191", Account.PROPERTY_LABEL, "Etat charges à payer formation prof"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4196", Account.PROPERTY_LABEL, "Impôt dégrevements à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4197", Account.PROPERTY_LABEL, "Associés - Comptes courants"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4198", Account.PROPERTY_LABEL, "compte REGNIER"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4282", Account.PROPERTY_LABEL, "compte POUSSIN"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4284", Account.PROPERTY_LABEL, "compte PINEAU"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4286", Account.PROPERTY_LABEL, "Créances sur cessions d'immobilisations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4287", Account.PROPERTY_LABEL, "Subvention Oseo à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4452", Account.PROPERTY_LABEL, "Débiteurs et crediteurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4455", Account.PROPERTY_LABEL, "Produits à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4456", Account.PROPERTY_LABEL, "Compte d'attente"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4457", Account.PROPERTY_LABEL, "Compte d'attente"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4458", Account.PROPERTY_LABEL, "Charges à repartir sur plusieurs exercices"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4686", Account.PROPERTY_LABEL, "Charges constatées d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "4687", Account.PROPERTY_LABEL, "Produits constatés d'avance"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5111", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de clients"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5112", Account.PROPERTY_LABEL, "Provisions pour dépréciation des comptes de débiteurs divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5113", Account.PROPERTY_LABEL, "VMP - Actions"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5114", Account.PROPERTY_LABEL, "CAT Tonic 60"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5121", Account.PROPERTY_LABEL, "Valeurs à I'encaissement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "5122", Account.PROPERTY_LABEL, "Banques"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6022", Account.PROPERTY_LABEL, "CAT TONIC 60"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6026", Account.PROPERTY_LABEL, "Autres organismes financiers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6031", Account.PROPERTY_LABEL, "Intérêts courus à payer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6032", Account.PROPERTY_LABEL, "Concours bancaires courant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6091", Account.PROPERTY_LABEL, "Crédit de mobilisation de créances commerciales (CMCC)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6092", Account.PROPERTY_LABEL, "Mobilisation de créances nées à létranger"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6094", Account.PROPERTY_LABEL, "TONIC 60- Intérets courus à recevoir"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6095", Account.PROPERTY_LABEL, "Caisse siège social"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6096", Account.PROPERTY_LABEL, "Virements internes"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6097", Account.PROPERTY_LABEL, "Provisions pour dépréciation des valeurs mobilières de place"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6098", Account.PROPERTY_LABEL, "Achats stockés - Matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6371", Account.PROPERTY_LABEL, "ACHATS MATERIELS INFORMATIQUES"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6411", Account.PROPERTY_LABEL, "Achats stockés - Matières premières France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6412", Account.PROPERTY_LABEL, "Achats stockés - Matières premières CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6413", Account.PROPERTY_LABEL, "Fournitures consommables"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6414", Account.PROPERTY_LABEL, "achat carburant"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6451", Account.PROPERTY_LABEL, "Fourniture de magasin"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6452", Account.PROPERTY_LABEL, "Fourniture de bureau"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6453", Account.PROPERTY_LABEL, "Frais postaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6454", Account.PROPERTY_LABEL, "Emballages"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "6688", Account.PROPERTY_LABEL, "VARIATION DES STOCKS (approvisionnements et marchandises)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7133", Account.PROPERTY_LABEL, "Variation des stocks de matières premières (et fournitures)"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7134", Account.PROPERTY_LABEL, "Variation des stocks de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7135", Account.PROPERTY_LABEL, "Prestations de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "7688", Account.PROPERTY_LABEL, "achat matériel informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27682", Account.PROPERTY_LABEL, "Achats non stockes de matières et fournitures"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27684", Account.PROPERTY_LABEL, "éléctricité"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27685", Account.PROPERTY_LABEL, "gaz"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "27688", Account.PROPERTY_LABEL, "Repas"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44551", Account.PROPERTY_LABEL, "Petit équipement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44562", Account.PROPERTY_LABEL, "frais d'aménagement"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44566", Account.PROPERTY_LABEL, "Fournitures de bureau"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44567", Account.PROPERTY_LABEL, "CARBURANTS"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44571", Account.PROPERTY_LABEL, "Achats de marchandises"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44583", Account.PROPERTY_LABEL, "achats divers"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44584", Account.PROPERTY_LABEL, "Achats de marchandises France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44586", Account.PROPERTY_LABEL, "Achats de marchandises CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "44587", Account.PROPERTY_LABEL, "Frais accessoires d'achat"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68111", Account.PROPERTY_LABEL, "Frais accessoires d'achat France"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68112", Account.PROPERTY_LABEL, "Frais accessoires d'achat CEE"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68161", Account.PROPERTY_LABEL, "Rabais; remises et ristournes obtenus sur achats"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68162", Account.PROPERTY_LABEL, "RRR sur prestations de services"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "68725", Account.PROPERTY_LABEL, "Sous-traitance générale"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78161", Account.PROPERTY_LABEL, "Redevances de crédit-bail"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78162", Account.PROPERTY_LABEL, "Locations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "78725", Account.PROPERTY_LABEL, "loyer"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445661", Account.PROPERTY_LABEL, "Location informatique"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445662", Account.PROPERTY_LABEL, "location mobilière"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445664", Account.PROPERTY_LABEL, "Malis sur emballages"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445665", Account.PROPERTY_LABEL, "Charges locatives et de copropriété"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445711", Account.PROPERTY_LABEL, "Entretien et réparations"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445712", Account.PROPERTY_LABEL, "Entretien et réparations sur biens immo"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445714", Account.PROPERTY_LABEL, "entretien locaux"); - accountTopiaDao.create(Account.PROPERTY_ACCOUNT_NUMBER, "445715", Account.PROPERTY_LABEL, "Primes d'assurance"); - tcontext.commit(); - } - -} diff --git a/lima-swing/src/test/java/org/chorem/lima/ui/LimaTestsConfig.java b/lima-swing/src/test/java/org/chorem/lima/ui/LimaTestsConfig.java deleted file mode 100644 index 2f6ab45..0000000 --- a/lima-swing/src/test/java/org/chorem/lima/ui/LimaTestsConfig.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.chorem.lima.ui; - -/* - * #%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.business.LimaBusinessConfig; -import org.chorem.lima.entity.LimaCallaoEntityEnum; -import org.nuiton.config.ApplicationConfig; -import org.nuiton.topia.flyway.TopiaFlywayService; -import org.nuiton.topia.flyway.TopiaFlywayServiceImpl; -import org.nuiton.topia.persistence.TopiaConfigurationConstants; - -import java.util.Map; -import java.util.Properties; - -/** - * Created by davidcosse on 11/06/14. - */ -public class LimaTestsConfig { - - public LimaTestsConfig(String configFileName, Properties limaTestConfig) { - LimaBusinessConfig instance = LimaBusinessConfig.getInstance(configFileName); - Properties standardLimaConfig = instance.getConfig().getFlatOptions(); - - for (Map.Entry<Object, Object> entry : limaTestConfig.entrySet()) { - standardLimaConfig.setProperty((String)entry.getKey(),(String)entry.getValue()); - } - ApplicationConfig testConfig = new ApplicationConfig(standardLimaConfig); - instance.setConfig(testConfig); - setRootContextProperties(instance); - } - - protected void setRootContextProperties(LimaBusinessConfig instance) { - Properties result = instance.getFlatOptions(); - // add persistence classes from generated code - result.setProperty(TopiaConfigurationConstants.CONFIG_PERSISTENCE_CLASSES, LimaCallaoEntityEnum.getImplementationClassesAsString()); - - Map<String, String> toAddIfNotPresent = Maps.newLinkedHashMap(); - toAddIfNotPresent.put("topia.service.migration", TopiaFlywayServiceImpl.class.getName()); - toAddIfNotPresent.put("topia.service.migration." + TopiaFlywayService.USE_MODEL_VERSION, "true"); - toAddIfNotPresent.put(TopiaConfigurationConstants.CONFIG_PERSISTENCE_INIT_SCHEMA, "true"); - - for (Map.Entry<String, String> entry : toAddIfNotPresent.entrySet()) { - if (!result.containsKey(entry.getKey())) { - result.setProperty(entry.getKey(), entry.getValue()); - } - } - instance.setRootContextProperties(result); - } - -} diff --git a/lima-swing/src/test/java/org/chorem/lima/ui/account/AccountViewHandlerTest.java b/lima-swing/src/test/java/org/chorem/lima/ui/account/AccountViewHandlerTest.java index 16aed1b..e37c7ed 100644 --- a/lima-swing/src/test/java/org/chorem/lima/ui/account/AccountViewHandlerTest.java +++ b/lima-swing/src/test/java/org/chorem/lima/ui/account/AccountViewHandlerTest.java @@ -35,6 +35,7 @@ import java.util.List; * @author David Cossé */ public class AccountViewHandlerTest { + @Test public void testAccountLengthComparator() throws Exception { @@ -55,9 +56,9 @@ public class AccountViewHandlerTest { } try { - Collections.sort(accounts, AccountViewHandler.accountLengthComparator); + Collections.sort(accounts, AccountViewHandler.ACCOUNT_LENGTH_COMPARATOR); } catch (Exception e) { - Assert.fail(); + Assert.fail("Unexpected exception: " + e.getMessage()); } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.