r2717 - in trunk/lima-main/src/main: java/org/chorem/lima java/org/chorem/lima/ui resources/i18n resources/import
Author: fdesbois Date: 2009-10-14 16:02:42 +0200 (Wed, 14 Oct 2009) New Revision: 2717 Added: trunk/lima-main/src/main/resources/import/default_pcg.xml Modified: trunk/lima-main/src/main/java/org/chorem/lima/Main.java trunk/lima-main/src/main/java/org/chorem/lima/ui/ProgressBarImpl.java trunk/lima-main/src/main/resources/i18n/lima-main-en_GB.properties trunk/lima-main/src/main/resources/i18n/lima-main-fr_FR.properties Log: Resolve #57 : popup on startup when no existing accounts in database (import default_pcg.xml) Modified: trunk/lima-main/src/main/java/org/chorem/lima/Main.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/Main.java 2009-10-14 12:55:29 UTC (rev 2716) +++ trunk/lima-main/src/main/java/org/chorem/lima/Main.java 2009-10-14 14:02:42 UTC (rev 2717) @@ -32,6 +32,7 @@ import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils.Converter; import org.apache.commons.beanutils.converters.DateConverter; +import org.chorem.lima.tree.model.AccountTreeTableModel; import org.chorem.lima.ui.MainViewImpl; import org.nuiton.i18n.I18n; import org.nuiton.util.ConverterUtil; @@ -174,7 +175,9 @@ // Chargement des comptes b.getProgressBar().setString("30% : "+_("lima.progressBar.load.etape2")); b.getProgressBar().setValue(30); - Main.getContext().getDataManager().getAccountModel(); + AccountTreeTableModel accountModel = Main.getContext().getDataManager().getAccountModel(); + b.loadDefaultAccount(accountModel.getData()); + // Chargement des status b.getProgressBar().setString("50% : "+_("lima.progressBar.load.etape3")); b.getProgressBar().setValue(50); Modified: trunk/lima-main/src/main/java/org/chorem/lima/ui/ProgressBarImpl.java =================================================================== --- trunk/lima-main/src/main/java/org/chorem/lima/ui/ProgressBarImpl.java 2009-10-14 12:55:29 UTC (rev 2716) +++ trunk/lima-main/src/main/java/org/chorem/lima/ui/ProgressBarImpl.java 2009-10-14 14:02:42 UTC (rev 2717) @@ -19,8 +19,14 @@ package org.chorem.lima.ui; +import java.net.URL; +import javax.swing.JOptionPane; +import static org.nuiton.i18n.I18n._; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.Main; +import org.chorem.lima.dto.AccountDTO; +import org.chorem.lima.imports.XMLImport; /** * Barre de progression @@ -51,6 +57,27 @@ } + public void loadDefaultAccount(AccountDTO accountRoot) { + if (accountRoot.getChildren().isEmpty()) { + String[] response = {_("lima.response.yes"), _("lima.response.no")}; + int n = JOptionPane.showOptionDialog(this, + _("lima.question.load.accounts"), + _("lima.question"), + JOptionPane.YES_NO_OPTION, + JOptionPane.QUESTION_MESSAGE, + null, //do not use a custom Icon + response, //the titles of buttons + response[1]); //default button title + if (n == JOptionPane.YES_OPTION) { + XMLImport imports = new XMLImport(); + URL urlFile = ProgressBarImpl.class.getResource("/import/default_pcg.xml"); + imports.importAccount(urlFile.getFile()); + } else { + Main.getContext().getDataManager().resetAccountModel(); + } + } + } + } Modified: trunk/lima-main/src/main/resources/i18n/lima-main-en_GB.properties =================================================================== --- trunk/lima-main/src/main/resources/i18n/lima-main-en_GB.properties 2009-10-14 12:55:29 UTC (rev 2716) +++ trunk/lima-main/src/main/resources/i18n/lima-main-en_GB.properties 2009-10-14 14:02:42 UTC (rev 2717) @@ -42,6 +42,7 @@ lima.closure.period.begin=Period lima.closure.period.end= lima.closure.timespan.warning=Warning\: when the period is blocked, it is possible to add, edit and delete entries on the accounting period. +lima.config.locale.description= lima.config.main.configFileName.description=Absolute path to configuration file lima.config.main.copyright.description= lima.config.main.debugMode.description=Flag to have or not debug mode @@ -63,6 +64,7 @@ lima.config.remote.proxyLogin.description=Login of user on proxy server lima.config.remote.proxyPassword.description=Password of user on proxy server lima.config.remote.useProxy.description=Flag to indicate if a proxy is used to acces remote server +lima.config.ui.fullscreen= lima.configuration=Configuration lima.credit=Credit lima.daily=Daily @@ -90,13 +92,21 @@ lima.error.account.not.master=This account has not an account master lima.error.account.with.entries=This account has some entries lima.error.at.least.one.criteria=A criteria must +lima.error.entry.not.exist= +lima.error.entry.not.remove= lima.error.journal.double=A journal exist with this name lima.error.journal.not.exist=This journal doesn't exist lima.error.journal.with.transactions=This journal has some transactions lima.error.login.failed=Login failed +lima.error.period.all.timespan= +lima.error.period.create.timespan= lima.error.period.next.blocked=It exists periods blocked +lima.error.period.next.not.blocked= +lima.error.period.not.exist= lima.error.period.not.selected=Please choose a period lima.error.period.prec.not.blocked=It exists periods not blocked +lima.error.period.timespan.block= +lima.error.period.timespan.not.blocked= lima.error.service.failed=Service failed lima.error.transaction.balance=The transaction is not balanced lima.error.transaction.exist.not.balanced=It exists transactions not balanced @@ -132,6 +142,9 @@ lima.import.journal=Import journal lima.import.success=Your datas had been loaded lima.information=Information +lima.init.closed= +lima.init.context.done= +lima.init.ui.done= lima.journal=Journal lima.language=Language lima.lettered=Lettered @@ -146,6 +159,7 @@ lima.menubar.closure.listperiod=See all periods lima.menubar.closure.period=close a period (annual) lima.menubar.closure.timespan=close a period (monthly) +lima.message.config.loaded= lima.message.error.empty.line=Please choose an account lima.model.account=Account lima.model.balance=Balance @@ -199,6 +213,7 @@ lima.progressBar.load.title=Loading datas lima.question=Question lima.question.close=Do you want to close Lima ? +lima.question.load.accounts=There is no existing accounts in Lima. Do you want to load default accounts ? lima.question.remove.account=Do you want to remove this account ? lima.question.remove.entry=Do you want to remove this entry ? lima.question.remove.journal=Do you want to remove this journal ? @@ -249,3 +264,8 @@ lima.view=View lima.view.flatten=Flatten view lima.voucher=Voucher +lima.warning.nimbus.landf= +lima.warning.no.ui= +observe.action.commandline.disable.main.ui= +observe.action.commandline.help= +observe.config.configFileName.description= Modified: trunk/lima-main/src/main/resources/i18n/lima-main-fr_FR.properties =================================================================== --- trunk/lima-main/src/main/resources/i18n/lima-main-fr_FR.properties 2009-10-14 12:55:29 UTC (rev 2716) +++ trunk/lima-main/src/main/resources/i18n/lima-main-fr_FR.properties 2009-10-14 14:02:42 UTC (rev 2717) @@ -43,6 +43,7 @@ lima.closure.period.begin=P\u00E9riode du lima.closure.period.end= lima.closure.timespan.warning=Attention \: lorsque la p\u00E9riode est bloqu\u00E9e, il n'est plus possible d'ajouter, modifier et supprimer les entr\u00E9es comptables sur cette p\u00E9riode. +lima.config.locale.description= lima.config.main.configFileName.description=Nom du fichier de configuration lima.config.main.copyright.description= lima.config.main.debugMode.description=flag pour activer le mode debug @@ -64,6 +65,7 @@ lima.config.remote.proxyLogin.description=Login du proxy lima.config.remote.proxyPassword.description=Mot de passe du proxy lima.config.remote.useProxy.description=Pour indiquer l'utilisation ou non d'un proxy pour atteindre le serveur distant +lima.config.ui.fullscreen= lima.configuration=Configuration lima.credit=Credit lima.daily=Quotidien @@ -90,14 +92,20 @@ lima.error.account.not.exist=Ce num\u00E9ro de compte n'existe pas lima.error.account.not.master=Ce compte ne poss\u00E8de pas de compte principal lima.error.account.with.entries=Ce compte poss\u00E8de des entr\u00E9es comptables -lima.error.at.least.one.criteria=Au moins un crit\u008Fre doit +lima.error.at.least.one.criteria=Au moins un crit\u00E8re doit lima.error.journal.double=Un journal poss\u00E8de d\u00E9j\u00E0 ce nom lima.error.journal.not.exist=Ce journal n'existe pas lima.error.journal.with.transactions=Ce journal poss\u00E8de des transactions comptables lima.error.login.failed=Echec d'authentification +lima.error.period.all.timespan= +lima.error.period.create.timespan= lima.error.period.next.blocked=Il existe des p\u00E9riodes suivantes bloqu\u00E9es +lima.error.period.next.not.blocked= +lima.error.period.not.exist= lima.error.period.not.selected=La p\u00E9riode doit \u00EAtre selectionn\u00E9e lima.error.period.prec.not.blocked=Il existe des p\u00E9riodes pr\u00E9c\u00E9dentes non bloqu\u00E9es +lima.error.period.timespan.block= +lima.error.period.timespan.not.blocked= lima.error.service.failed=Service failed lima.error.transaction.balance=La transaction n'est pas \u00E9quilibr\u00E9e lima.error.transaction.exist.not.balanced=Il existe des transactions non \u00E9quilibr\u00E9es @@ -133,6 +141,9 @@ lima.import.journal=Importer le journal lima.import.success=Vos donn\u00E9es ont bien \u00E9t\u00E9 charg\u00E9es lima.information=Information +lima.init.closed= +lima.init.context.done= +lima.init.ui.done= lima.journal=Journal lima.language=Langue lima.lettered=Lettr\u00E9 @@ -147,6 +158,7 @@ lima.menubar.closure.listperiod=Voir toutes les cl\u00F4tures lima.menubar.closure.period=Cl\u00F4turer l'exercice lima.menubar.closure.timespan=Cl\u00F4turer une p\u00E9riode +lima.message.config.loaded= lima.message.error.empty.line=Veuillez choisir un compte lima.model.account=Compte lima.model.balance=Balance @@ -200,6 +212,7 @@ lima.progressBar.load.title=Chargement des donn\u00E9es lima.question=Question lima.question.close=Voulez vous quitter Lima? +lima.question.load.accounts=Il n'y a aucun plan comptable existant dans Lima. Voulez-vous en charger un par d\u00E9faut ? lima.question.remove.account=Voulez-vous supprimer ce compte? lima.question.remove.entry=Voulez-vous supprimer cette ligne de transaction? lima.question.remove.journal=Voulez-vous supprimer ce journal? @@ -250,3 +263,8 @@ lima.view=Vue lima.view.flatten=Vue aplatie lima.voucher=Document +lima.warning.nimbus.landf= +lima.warning.no.ui= +observe.action.commandline.disable.main.ui= +observe.action.commandline.help= +observe.config.configFileName.description= Added: trunk/lima-main/src/main/resources/import/default_pcg.xml =================================================================== --- trunk/lima-main/src/main/resources/import/default_pcg.xml (rev 0) +++ trunk/lima-main/src/main/resources/import/default_pcg.xml 2009-10-14 14:02:42 UTC (rev 2717) @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Callao> + <informations date="Fri Aug 07 11:35:27 CEST 2009" user="Name user" company="Name company" /> + <save> + <accounts> + <account id="org.chorem.callao.entity.Account#1249555347959#0.9019304796412684" label="COMPTES D'IMMOBILISATIONS" type="actif" accountNumber="2" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555348338#0.04260276658110562" label="Frais d'établissement" type="Actif" accountNumber="201" masterAccount="2" /> + <account id="org.chorem.callao.entity.Account#1249555348347#0.18726180615226806" label="Droit au bail" type="Actif" accountNumber="206" masterAccount="2" /> + <account id="org.chorem.callao.entity.Account#1249555497020#0.6505535213374983" label="Immobilisations corporelles" type="Actif" accountNumber="21" masterAccount="2" /> + <account id="org.chorem.callao.entity.Account#1249555618637#0.47602527280737383" label="Autres immobilisations corporelles" type="Actif" accountNumber="218" masterAccount="21" /> + <account id="org.chorem.callao.entity.Account#1249555347984#0.4908833205081513" label="COMPTES DE STOCKS ET EN-COURS" type="actif" accountNumber="3" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555347993#0.01567348299581306" label="COMPTES DE TIERS" type="actif" accountNumber="4" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555822435#0.06041671027235429" label="Fournisseurs" type="Passif" accountNumber="401" masterAccount="4" /> + <account id="org.chorem.callao.entity.Account#1249555583700#0.6265947943023162" label="Clients" type="Actif" accountNumber="411" masterAccount="4" /> + <account id="org.chorem.callao.entity.Account#1249555348000#0.6004750737819512" label="COMPTES FINANCIERS" type="actif" accountNumber="5" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555511423#0.011319837765867757" label="Caisse" type="Actif" accountNumber="53" masterAccount="5" /> + <account id="org.chorem.callao.entity.Account#1249555348022#0.930622399756405" label="COMPTES DE CHARGES" type="actif" accountNumber="6" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555348378#0.8374727763221947" label="ACHATS" type="Charge" accountNumber="60" masterAccount="6" /> + <account id="org.chorem.callao.entity.Account#1249555548999#0.018490025064101023" label="Achas de marchandises" type="Charge" accountNumber="607" masterAccount="60" /> + <account id="org.chorem.callao.entity.Account#1249555636400#0.5473094310405552" label="Impôts, taxes et versements assimilés" type="Charge" accountNumber="63" masterAccount="6" /> + <account id="org.chorem.callao.entity.Account#1249555657935#0.35366073929481334" label="Charges de personnel" type="Charge" accountNumber="64" masterAccount="6" /> + <account id="org.chorem.callao.entity.Account#1249555348027#0.6782322672056709" label="COMPTES DE PRODUITS" type="actif" accountNumber="7" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555599917#0.5953808167367928" label="Ventes de marchandises" type="Produit" accountNumber="707" masterAccount="7" /> + <account id="org.chorem.callao.entity.Account#1249555348076#0.6190508684748437" label="COMPTES SPECIAUX" type="actif" accountNumber="8" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555347952#0.9924023380704713" label="COMPTES DE CAPITAUX" type="Passif" accountNumber="1" masterAccount="0" /> + <account id="org.chorem.callao.entity.Account#1249555348157#0.3681372547493901" label="Ecarts de réévaluation" type="Passif" accountNumber="105" masterAccount="1" /> + <account id="org.chorem.callao.entity.Account#1249555348211#0.8970560365362152" label="Ecarts de réévaluation" type="actif" accountNumber="10500000" masterAccount="105" /> + <account id="org.chorem.callao.entity.Account#1249555348169#0.21975217717147555" label="Réserves" type="Passif" accountNumber="106" masterAccount="1" /> + <account id="org.chorem.callao.entity.Account#1249555348221#0.20073728197870266" label="Réserve légale" type="actif" accountNumber="1061" masterAccount="106" /> + <account id="org.chorem.callao.entity.Account#1249555348269#0.3388466646762297" label="Réserve légale" type="actif" accountNumber="10610000" masterAccount="1061" /> + <account id="org.chorem.callao.entity.Account#1249555348301#0.09087057997481063" label="réserve légale" type="actif" accountNumber="10611000" masterAccount="1061" /> + <account id="org.chorem.callao.entity.Account#1249555348230#0.6918799658776698" label="Réserves indisponibles" type="actif" accountNumber="1062" masterAccount="106" /> + <account id="org.chorem.callao.entity.Account#1249555348308#0.6217734109884933" label="Réserves indisponibles" type="actif" accountNumber="10620000" masterAccount="1062" /> + <account id="org.chorem.callao.entity.Account#1249555348244#0.009767392197928992" label="Réserves statutaires ou contractuelles" type="actif" accountNumber="1063" masterAccount="106" /> + <account id="org.chorem.callao.entity.Account#1249555348315#0.8177617600611057" label="Réserves statutaires ou contractuelles" type="actif" accountNumber="10630000" masterAccount="1063" /> + <account id="org.chorem.callao.entity.Account#1249555348253#0.7582011362212686" label="Réserves réglementes" type="actif" accountNumber="1064" masterAccount="106" /> + <account id="org.chorem.callao.entity.Account#1249555348329#0.8489995807518893" label="Réserves réglementes" type="acif" accountNumber="10640000" masterAccount="1064" /> + <account id="org.chorem.callao.entity.Account#1249555348262#0.4019019740691401" label="Autres réserves" type="actif" accountNumber="1068" masterAccount="106" /> + <account id="org.chorem.callao.entity.Account#1249555348140#0.7846696113518526" label="Capital" type="Passif" accountNumber="101" masterAccount="1" /> + <account id="org.chorem.callao.entity.Account#1249555348184#0.7230203499285881" label="Capital" type="actif" accountNumber="10100000" masterAccount="101" /> + <account id="org.chorem.callao.entity.Account#1249555348200#0.3427497656667253" label="Capital non amorti" type="actif" accountNumber="10131000" masterAccount="101" /> + </accounts> + </save> +</Callao> +
participants (1)
-
fdesbois@users.chorem.org