r3462 - in trunk: lima-business/src/main/java/org/chorem/lima/business/accountingrules lima-callao/src/main/java/org/chorem/lima/entity lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod
Author: mallon Date: 2012-06-20 16:20:05 +0200 (Wed, 20 Jun 2012) New Revision: 3462 Url: http://chorem.org/repositories/revision/lima/3462 Log: Si deux exercices sont ouverts, la r?\195?\168gle indiquant que le dernier ne doit pas ?\195?\170tre cl?\195?\180t avant le pr?\195?\169c?\195?\169dent est maintenant respect?\195?\169e. Removed: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.out.xml Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2012-06-20 12:43:59 UTC (rev 3461) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2012-06-20 14:20:05 UTC (rev 3462) @@ -176,7 +176,7 @@ /** * Règles de vérification de fermeture d'un exercice, appliquées à la comptabilité française. * - * On ne peut pas clore la dernière period comptable ouverte. + * On ne peut pas clore la dernière period comptable ouverte, si la précédente ne l'est pas. */ @Override public void blockFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws LimaException { @@ -187,7 +187,7 @@ fiscalPeriodDAO.getLastUnlockedFiscalPeriod(); //Check if the fiscal period to block is the oldest - if (!oldestUnBlockedFiscalPeriod.equals(fiscalPeriod)) { + if (oldestUnBlockedFiscalPeriod.equals(fiscalPeriod)) { throw new LimaBusinessException(_("lima-business.franceaccountingrules.antefiscalperiodnotblocked")); } } catch (TopiaException ex) { Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java 2012-06-20 12:43:59 UTC (rev 3461) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FiscalPeriodDAOImpl.java 2012-06-20 14:20:05 UTC (rev 3462) @@ -103,7 +103,7 @@ public FiscalPeriod getLastUnlockedFiscalPeriod() throws TopiaException { String query = "FROM " + FiscalPeriod.class.getName() + " WHERE locked = false" + - " ORDER BY endDate"; + " ORDER BY endDate desc"; List<FiscalPeriod> fiscalPeriods = context.find(query); FiscalPeriod result = null; Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodView.out.xml =================================================================== Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-06-20 12:43:59 UTC (rev 3461) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2012-06-20 14:20:05 UTC (rev 3462) @@ -202,9 +202,10 @@ * Block selected fiscal period after user confirmation. */ public void blockFiscalPeriod() { - JXTable fiscalPeriodeTable = view.getFiscalPeriodTable(); + JXTable fiscalPeriodeTable = view.getFiscalPeriodTable(); + FiscalPeriodTableModel model = (FiscalPeriodTableModel) view.getFiscalPeriodTable().getModel(); + int selectedRow = fiscalPeriodeTable.getSelectedRow(); - FiscalPeriodTableModel model = view.getFiscalPeriodTableModel(); FiscalPeriod selectedFiscalPeriod = model.getFiscalPeriodAt(selectedRow); //check if the user want to block the fiscal year @@ -212,6 +213,7 @@ _("lima.ui.fiscalperiod.block.confirmation"), _("lima.ui.fiscalperiod.block.title"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); + if (response == JOptionPane.YES_OPTION) { //use to tell if the user wants to create a new fiscal year boolean newyear = false;
participants (1)
-
mallon@users.chorem.org