branch feature/1241-account-report updated (395e868 -> f050c53)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1241-account-report in repository lima. See http://git.chorem.org/lima.git from 395e868 refs #1241 progression sur internationalisation des rapports, ajout de l'entête avec l'identité sur tous les rapports new fba47bc refs #1241mise à jour du plan de tva new 4f2401d refs #1241 minor new ebb41e3 refs #1241 internationalisation sur le rapport de compte new 020a06a refs #1241 internationalisation sur le rapport de compte new 8bbd193 refs #1241 ajout possibilité de créer des rapports de balance globale ou générale (le dernier par défaut centralise les comptes 401 avec ses sous comptes idem pour 411) new f050c53 refs #1241 monté de version je Jasper report The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit f050c539a8e77d9028a2984a7a71ddd97d7ef94a Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:27:50 2015 +0200 refs #1241 monté de version je Jasper report commit 8bbd1932e0ec8836c66abac64eb073ec63154d36 Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:27:30 2015 +0200 refs #1241 ajout possibilité de créer des rapports de balance globale ou générale (le dernier par défaut centralise les comptes 401 avec ses sous comptes idem pour 411) commit 020a06a01dfe809490af2930a4c7b43969c94f21 Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:25:41 2015 +0200 refs #1241 internationalisation sur le rapport de compte commit ebb41e3fcdfe1771a28d6aef88df386cece9ad29 Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:25:14 2015 +0200 refs #1241 internationalisation sur le rapport de compte commit 4f2401d88d44303ed67689f2ad436b7cd9ede128 Author: dcosse <cosse@codelutin.com> Date: Wed Sep 2 15:14:52 2015 +0200 refs #1241 minor commit fba47bc371955d3f4ab11148c244f595ca4892d9 Author: dcosse <cosse@codelutin.com> Date: Wed Sep 2 15:13:36 2015 +0200 refs #1241mise à jour du plan de tva Summary of changes: .../chorem/lima/business/api/OptionsService.java | 3 + .../business/api/report/BalanceReportService.java | 3 +- .../chorem/lima/business/LimaBusinessConfig.java | 11 ++- .../lima/business/ejb/OptionsServiceImpl.java | 6 ++ .../ejb/report/AccountReportServiceImpl.java | 7 +- .../ejb/report/BalanceReportServiceImpl.java | 110 ++++++++++++++++++--- .../resources/i18n/lima-business_en_GB.properties | 12 ++- .../resources/i18n/lima-business_fr_FR.properties | 12 ++- .../org/chorem/lima/beans/BalanceAccountImpl.java | 23 +++-- lima-callao/src/main/xmi/lima-callao-model.zargo | Bin 61424 -> 61665 bytes .../lima/report/service/DocumentService.java | 8 +- .../jasperreports/account/AccountEntry.jrxml | 3 +- .../balance/BalanceSubAccountsReport.jrxml | 14 +-- .../jasperreports/balance/DocumentReport.jrxml | 81 +++++++++++++++ .../org/chorem/lima/report/action/ReportTest.java | 2 +- .../org/chorem/lima/server/HttpServerService.java | 40 +++++--- .../main/java/org/chorem/lima/LimaSwingConfig.java | 1 + .../chorem/lima/ui/identity/IdentityHandler.java | 1 - lima-swing/src/main/resources/import/vat_base.csv | 35 ++++--- pom.xml | 2 +- 20 files changed, 296 insertions(+), 78 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1241-account-report in repository lima. See http://git.chorem.org/lima.git commit fba47bc371955d3f4ab11148c244f595ca4892d9 Author: dcosse <cosse@codelutin.com> Date: Wed Sep 2 15:13:36 2015 +0200 refs #1241mise à jour du plan de tva --- lima-swing/src/main/resources/import/vat_base.csv | 35 ++++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/lima-swing/src/main/resources/import/vat_base.csv b/lima-swing/src/main/resources/import/vat_base.csv index 48bb9ee..0037341 100644 --- a/lima-swing/src/main/resources/import/vat_base.csv +++ b/lima-swing/src/main/resources/import/vat_base.csv @@ -1,14 +1,13 @@ label;header;accounts;boxName;masterVATStatement A. MONTANT DES OPERATIONS REALISEES;O;;; OPERATIONS IMPOSABLES (H.T.);O;;;A. MONTANT DES OPERATIONS REALISEES -Ventes, prestations de services;N;;b1;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) +Ventes, prestations de services;N;701, 702, 703, 704, 705, 706, 707, 708, 7091, 7092, 7094, 7095, 7096, 7097, 7098;b1;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) Autres opérations imposables;N;;b2;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) -Achats de prestations de services intracommunautaires;N;;b3;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) Importations (entreprises ayant opté pour le dispositif d’autoliquidation de la TVA à l’importation);N;;b4;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) -Acquisitions intracommunautaires;N;;b5;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) -Livraisons d’électricité, de gaz naturel, de chaleur ou de froid imposables en France;N;;b6;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) Achats de biens ou de prestations de services réalisées auprès d'un assujetti non établi en France;N;;b7;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) Régularisations (imposables);N;;b8;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) +Achats de prestations de services intracommunautaires;N;410;b3;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) +Livraisons d’électricité, de gaz naturel, de chaleur ou de froid imposables en France;N;;b5;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS IMPOSABLES (H.T.) OPERATIONS NON IMPOSABLES;O;;;A. MONTANT DES OPERATIONS REALISEES Exportations hors CE;N;;b9;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES Autres opérations non imposables;N;;b10;A. MONTANT DES OPERATIONS REALISEES/OPERATIONS NON IMPOSABLES @@ -20,10 +19,12 @@ Régularisations (non imposables);N;;b15;A. MONTANT DES OPERATIONS REALISEES/OPE B. DECOMPTE DE LA TVA A PAYER;O;;; TVA BRUTE;O;;;B. DECOMPTE DE LA TVA A PAYER Opérations réalisées en France métropolitaine;O;;;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE -Taux normal 20% (Base hors taxe);N;;b16;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine -Taux normal 20% (Taxe due);N;;b17;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine +Taux réduit 5,5% (Taxe due);N;;b19;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine +Taux réduit 10% (Base hors taxe);N;;b20;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine +Taux réduit 10% (Taxe due);N;;b21;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine Taux réduit 5,5% (Base hors taxe);N;;b18;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine -Taux réduit 5,5% (Taxe due);N;;b18;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine +Taux normal 20% (Base hors taxe);N;701, 702, 703, 704, 705, 706, 707, 708, 7091, 7092, 7094, 7095, 7096, 7097, 7098;b16;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine +Taux normal 20% (Taxe due);N;44571;b17;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées en France métropolitaine Opérations réalisées dans les DOM;O;;;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE Taux normal 8,5% (Base hors taxe);N;;b22;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM Taux normal 8,5% (Taxe due);N;;b23;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations réalisées dans les DOM @@ -40,20 +41,26 @@ Total de le TVA brute due (lignes 08 à 5B);N;;b34;B. DECOMPTE DE LA TVA A PAYER Dont TVA sur importations bénéficiant du dispositif d’autoliquidation;N;;b35;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM) Dont TVA sur acquisitions intracommunautaires;N;;b36;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM) Dont TVA sur opérations à destination de Monaco;N;;b37;B. DECOMPTE DE LA TVA A PAYER/TVA BRUTE/Opérations imposables à un autre taux (France métropolitaine ou DOM) -TVA DEDUCTIBLE;O;;;B. DECOMPTE DE LA TVA A PAYER -Biens constituant des immobilisations;N;;b38;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE -Autres biens et services;N;;b39;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE -Autre TVA à déduire;N;;b40;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE -Report du crédit apparaissant ligne 27 de la précédente déclaration;N;;b41;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE -Total TVA déductible;N;;total1;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE -Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM;N;;b43;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE CREDIT;O;;;B. DECOMPTE DE LA TVA A PAYER +Autres opérations imposables;N;;;B. DECOMPTE DE LA TVA A PAYER/CREDIT +CREDIT;N;;;B. DECOMPTE DE LA TVA A PAYER/CREDIT/Autres opérations imposables Crédit de TVA (ligne 23 – ligne 16).;N;;b44;B. DECOMPTE DE LA TVA A PAYER/CREDIT/Autres opérations imposables/CREDIT Remboursement de crédit demandé sur formulaire n°3519 joint;N;;b45;B. DECOMPTE DE LA TVA A PAYER/CREDIT/Autres opérations imposables/CREDIT Crédit de TVA transféré à la société tête de groupe sur la déclaration récapitulative 3310-CA3G;N;;b46;B. DECOMPTE DE LA TVA A PAYER/CREDIT/Autres opérations imposables/CREDIT Crédit à reporter ( ligne 25 – ligne 26 – ligne AA );N;;b47;B. DECOMPTE DE LA TVA A PAYER/CREDIT/Autres opérations imposables/CREDIT TAXE A PAYER;O;;;B. DECOMPTE DE LA TVA A PAYER +Achats de prestations de services intracommunautaires;N;;;B. DECOMPTE DE LA TVA A PAYER/TAXE A PAYER +TAXE A PAYER;N;;;B. DECOMPTE DE LA TVA A PAYER/TAXE A PAYER/Achats de prestations de services intracommunautaires TVA nette due (ligne 16 – ligne 23);N;;b48;B. DECOMPTE DE LA TVA A PAYER/TAXE A PAYER/Achats de prestations de services intracommunautaires/TAXE A PAYER Taxes assimilées calculées sur annexe n°3310 A;N;;b49;B. DECOMPTE DE LA TVA A PAYER/TAXE A PAYER/Achats de prestations de services intracommunautaires/TAXE A PAYER Total à payer acquitté par la société tête de groupe sur la déclaration récapitulative 3310-CA3G;N;;b50;B. DECOMPTE DE LA TVA A PAYER/TAXE A PAYER/Achats de prestations de services intracommunautaires/TAXE A PAYER Total à payer (lignes 28 + 29 – AB);N;;total2;B. DECOMPTE DE LA TVA A PAYER/TAXE A PAYER +TVA DEDUCTIBLE;O;;;B. DECOMPTE DE LA TVA A PAYER +Autre TVA à déduire;N;;b40;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE +Sommes à imputer, y compris acompte congés (exprimées en euro);N;;b42;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE +Indiquer ici le coefficient de taxation forfaitaire;N;;taux;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE +Total TVA déductible;N;;total1;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE +Dont TVA non perçue récupérable par les assujettis disposant d'un établissement stable dans les DOM;N;;b43;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE +Biens constituant des immobilisations;N;44562;b38;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE +Autres biens et services;N;44566;b39;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE +Report du crédit apparaissant ligne 27 de la précédente déclaration;N;44567;b41;B. DECOMPTE DE LA TVA A PAYER/TVA DEDUCTIBLE -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1241-account-report in repository lima. See http://git.chorem.org/lima.git commit 4f2401d88d44303ed67689f2ad436b7cd9ede128 Author: dcosse <cosse@codelutin.com> Date: Wed Sep 2 15:14:52 2015 +0200 refs #1241 minor --- .../src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java index 3771ca7..3263ebb 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/identity/IdentityHandler.java @@ -76,7 +76,6 @@ public class IdentityHandler { identity.setPhoneNumber(view.getPhoneNumberTextField().getText()); identity.setEmail(view.getEmailTextField().getText()); identity.setVatNumber(view.getVatNumberTextField().getText()); - identityService.updateIdentity(identity); Treasury treasury = treasuryService.getTreasury(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1241-account-report in repository lima. See http://git.chorem.org/lima.git commit ebb41e3fcdfe1771a28d6aef88df386cece9ad29 Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:25:14 2015 +0200 refs #1241 internationalisation sur le rapport de compte --- .../lima/business/ejb/report/AccountReportServiceImpl.java | 7 ++++--- .../src/main/resources/i18n/lima-business_en_GB.properties | 12 ++++++++++-- .../src/main/resources/i18n/lima-business_fr_FR.properties | 12 ++++++++++-- .../main/resources/jasperreports/account/AccountEntry.jrxml | 3 ++- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/AccountReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/AccountReportServiceImpl.java index 1879a4b..94c74ff 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/AccountReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/AccountReportServiceImpl.java @@ -82,6 +82,7 @@ public class AccountReportServiceImpl extends AbstractLimaService implements Acc accountEntry.setCredit(entry.isDebit() ? BigDecimal.ZERO : entry.getAmount()); accountEntry.setFormatter(bigDecimalFormat); accountEntry.setDateFormat(LimaBusinessConfig.getInstance().getDateFormat()); + accountEntry.setSubTotalForLabel(t("lima-business.document.subTotal")); accountEntries.add(accountEntry); } } @@ -89,11 +90,11 @@ public class AccountReportServiceImpl extends AbstractLimaService implements Acc documentReport.addAllAccounts(accountEntries); if (CollectionUtils.isEmpty(accountEntries)) { - selectedAccounts += ", aucune entrée trouvée sur ce compte"; + selectedAccounts += t("lima-business.document.selectedAccountNoEntryFound"); } else if (accountEntries.size() == 1){ - selectedAccounts += ", et son compte fils"; + selectedAccounts += t("lima-business.document.selectedAccountAndSubAccount"); } else { - selectedAccounts += ", et ses comptes fils"; + selectedAccounts += t("lima-business.document.selectedAccountAndSubAccounts"); } documentReport.setHeaderSelectedAccounts(selectedAccounts); diff --git a/lima-business/src/main/resources/i18n/lima-business_en_GB.properties b/lima-business/src/main/resources/i18n/lima-business_en_GB.properties index f809c87..1c64e65 100644 --- a/lima-business/src/main/resources/i18n/lima-business_en_GB.properties +++ b/lima-business/src/main/resources/i18n/lima-business_en_GB.properties @@ -12,6 +12,9 @@ lima-business.document.amounts=Amounts lima-business.document.amountsperiod=Amounts %1$tB %1$tY lima-business.document.assets=Assets lima-business.document.balance=Balance +lima-business.document.balance.globalClient=CENTRALISATION CLIENTS +lima-business.document.balance.globalSupplier=CENTRALISATION SUPPLIERS +lima-business.document.balance.lastPageColumnDescription=Global total lima-business.document.balanceForEntryBook=Total for entry book %s until %s lima-business.document.balanceReport.title=BALANCE lima-business.document.balanceSheet=Balance @@ -66,6 +69,9 @@ lima-business.document.period2=to lima-business.document.period2format=%1$tm/%1$te/%1$tY lima-business.document.provisionalEntryBookReport.title=PROVISIONAL ENTRY BOOK lima-business.document.provisiondeprecationamount=Provision Deprecation Amount +lima-business.document.selectedAccountAndSubAccount=, and it sub account +lima-business.document.selectedAccountAndSubAccounts=, and it sub accounts +lima-business.document.selectedAccountNoEntryFound=, no entry found lima-business.document.setColumnDateTitle=Date lima-business.document.setColumnEntryBookTitle=Entry book lima-business.document.society=Society @@ -74,12 +80,12 @@ lima-business.document.soldecredit=Credit solde lima-business.document.soldedebit=Debit solde lima-business.document.subTotal=Sub total lima-business.document.subTotalFor=Sub total for %s -lima-business.document.subTotalForMonthText= +lima-business.document.subTotalForMonthText=Sub total for % lima-business.document.titleCompanyPhoneLabel=Phone\: lima-business.document.titleCompanySiretLabel=Business N°\: lima-business.document.titleCurrentDate=Printed on %s at %s lima-business.document.titleFromToDate=From %s to %s -lima-business.document.totalFor=total for\: +lima-business.document.totalFor=Total for %s lima-business.document.totalForAccount=Total for account %s lima-business.document.vat=VAT form lima-business.document.vatnumber=VAT N° @@ -115,6 +121,8 @@ lima.config.documentReport.generalLedger.generalLedgerEntryModelPath.description lima.config.documentReport.generalLedger.generalLedgerModelPath.description= lima.config.host.address.description= lima.config.httpport.description=HTTP Port +lima.config.local.description= +lima.config.local.label= lima.config.reports.dir.description= lima.config.reportvatpdfurl.description= lima.config.rulesnationality.description=Rules Nationality diff --git a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties index bfabd31..49dd9cb 100644 --- a/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties +++ b/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties @@ -10,6 +10,9 @@ lima-business.document.amounts=Totaux lima-business.document.amountsperiod=Totaux %1$tB %1$tY lima-business.document.assets=avoirs lima-business.document.balance=Balance +lima-business.document.balance.globalClient=CENTRALISATION CLIENTS +lima-business.document.balance.globalSupplier=CENTRALISATION FOURNISSEURS +lima-business.document.balance.lastPageColumnDescription=Total général lima-business.document.balanceForEntryBook=Solde pour le journal %s jusqu'à fin %s lima-business.document.balanceReport.title=BALANCE lima-business.document.balanceSheet=Balance @@ -64,6 +67,9 @@ lima-business.document.period2=au lima-business.document.period2format=%1$te/%1$tm/%1$tY lima-business.document.provisionalEntryBookReport.title=JOURNAL PROVISOIRE lima-business.document.provisiondeprecationamount=Amortissements et provisions +lima-business.document.selectedAccountAndSubAccount=, et son compte fils +lima-business.document.selectedAccountAndSubAccounts=, et ses comptes fils +lima-business.document.selectedAccountNoEntryFound=, aucune entrée trouvée sur ce compte lima-business.document.setColumnDateTitle=Date lima-business.document.setColumnEntryBookTitle=Journal lima-business.document.society=Nom @@ -71,13 +77,13 @@ lima-business.document.solde=Solde lima-business.document.soldecredit=Solde Créditeur lima-business.document.soldedebit=Solde Débiteur lima-business.document.subTotal=Sous total -lima-business.document.subTotalFor=Sous total pour %s +lima-business.document.subTotalFor=Sous-total pour %s lima-business.document.subTotalForMonthText=Sous-total pour le mois de %s lima-business.document.titleCompanyPhoneLabel=Téléphone\: lima-business.document.titleCompanySiretLabel=SIRET\: lima-business.document.titleCurrentDate=Édition du %s à %s lima-business.document.titleFromToDate=Du %s au %s -lima-business.document.totalFor=total pour\: +lima-business.document.totalFor=Total pour %s lima-business.document.totalForAccount=Total pour le compte %s lima-business.document.treasuryPeriod=%1$te%1$tm%1$tY lima-business.document.vat=Déclaration de TVA @@ -119,6 +125,8 @@ lima.config.documentReport.generalLedger.generalLedgerEntryModelPath.description lima.config.documentReport.generalLedger.generalLedgerModelPath.description=fichier source (.jrxml) généré par Jasper Report gérant les beans 'generalLedger' lima.config.host.address.description=Adresse du serveur LIMA lima.config.host.http.port.description=Port HTTP +lima.config.local.description= +lima.config.local.label= lima.config.reports.dir.description=Dossier des rapports lima.config.reportvatpdfurl.description=Chemin du raport lima.config.rulesnationality.description=Règles nationales diff --git a/lima-report/src/main/resources/jasperreports/account/AccountEntry.jrxml b/lima-report/src/main/resources/jasperreports/account/AccountEntry.jrxml index f800454..15b1213 100644 --- a/lima-report/src/main/resources/jasperreports/account/AccountEntry.jrxml +++ b/lima-report/src/main/resources/jasperreports/account/AccountEntry.jrxml @@ -27,6 +27,7 @@ <field name="lettering" class="java.lang.String"/> <field name="debit" class="java.math.BigDecimal"/> <field name="credit" class="java.math.BigDecimal"/> + <field name="subTotalForLabel" class="java.lang.String"/> <variable name="subTotalDebit" class="java.math.BigDecimal" calculation="Sum"> <variableExpression><![CDATA[$F{debit}]]></variableExpression> @@ -213,7 +214,7 @@ <textElement> <font size="8"/> </textElement> - <textFieldExpression><![CDATA["Sous total"]]></textFieldExpression> + <textFieldExpression><![CDATA[$F{subTotalForLabel}]]></textFieldExpression> </textField> <textField> <reportElement x="506" y="0" width="72" height="10" forecolor="#736343" uuid="0311393c-8196-477b-b00b-e76e767855ee"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1241-account-report in repository lima. See http://git.chorem.org/lima.git commit 020a06a01dfe809490af2930a4c7b43969c94f21 Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:25:41 2015 +0200 refs #1241 internationalisation sur le rapport de compte --- lima-callao/src/main/xmi/lima-callao-model.zargo | Bin 61424 -> 61665 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/lima-callao/src/main/xmi/lima-callao-model.zargo b/lima-callao/src/main/xmi/lima-callao-model.zargo index 790db87..85b1c37 100644 Binary files a/lima-callao/src/main/xmi/lima-callao-model.zargo and b/lima-callao/src/main/xmi/lima-callao-model.zargo differ -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1241-account-report in repository lima. See http://git.chorem.org/lima.git commit 8bbd1932e0ec8836c66abac64eb073ec63154d36 Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:27:30 2015 +0200 refs #1241 ajout possibilité de créer des rapports de balance globale ou générale (le dernier par défaut centralise les comptes 401 avec ses sous comptes idem pour 411) --- .../chorem/lima/business/api/OptionsService.java | 3 + .../business/api/report/BalanceReportService.java | 3 +- .../chorem/lima/business/LimaBusinessConfig.java | 11 ++- .../lima/business/ejb/OptionsServiceImpl.java | 6 ++ .../ejb/report/BalanceReportServiceImpl.java | 110 ++++++++++++++++++--- .../org/chorem/lima/beans/BalanceAccountImpl.java | 23 +++-- .../lima/report/service/DocumentService.java | 8 +- .../balance/BalanceSubAccountsReport.jrxml | 14 +-- .../jasperreports/balance/DocumentReport.jrxml | 81 +++++++++++++++ .../org/chorem/lima/report/action/ReportTest.java | 2 +- .../org/chorem/lima/server/HttpServerService.java | 40 +++++--- .../main/java/org/chorem/lima/LimaSwingConfig.java | 1 + 12 files changed, 248 insertions(+), 54 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java index 6598454..44ce1e2 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/OptionsService.java @@ -24,6 +24,8 @@ package org.chorem.lima.business.api; import org.chorem.lima.business.config.LimaConfigOptionDef; import org.chorem.lima.business.utils.BigDecimalToString; +import java.util.Locale; + /** * Service de report des certaines configurations du swing dans business * <p/> @@ -57,4 +59,5 @@ public interface OptionsService extends BigDecimalToString.Config { int getLimaHttpPort(); + void setLocal(Locale newLocale); } diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/report/BalanceReportService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/report/BalanceReportService.java index 016e01c..b284fb4 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/report/BalanceReportService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/report/BalanceReportService.java @@ -39,10 +39,11 @@ public interface BalanceReportService { * @param from from date * @param to to date * @param selectedAccounts if null all accounts will be selected + * @Param isBalanceGeneral true if general Balance is requested * @param bigDecimalFormat format used for amount representation * @param mainAccountsJasperReport Jasper sub report for balance's main accounts representation * @param subAccountsJasperReport Jasper sub account report for balance sub account representation * @return model for balance report */ - DocumentReport getBalanceDocumentReport(Date from, Date to, String selectedAccounts, DecimalFormat bigDecimalFormat, JasperReport mainAccountsJasperReport, JasperReport subAccountsJasperReport); + DocumentReport getBalanceDocumentReport(Date from, Date to, String selectedAccounts, String isBalanceGeneral, DecimalFormat bigDecimalFormat, JasperReport mainAccountsJasperReport, JasperReport subAccountsJasperReport); } diff --git a/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessConfig.java b/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessConfig.java index c7beb4f..c3ecca2 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessConfig.java +++ b/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessConfig.java @@ -37,6 +37,7 @@ import org.nuiton.topia.flyway.TopiaFlywayService; import org.nuiton.topia.persistence.TopiaConfigurationConstants; import java.io.File; +import java.util.Locale; import java.util.Map; import java.util.Properties; @@ -225,7 +226,14 @@ public class LimaBusinessConfig { loadAccountingRules(); } + public Locale getLocal() { + return config.getOptionAsLocale(BusinessConfigOption.LOCAL.key); + } + public void setLocal(Locale local) { + config.setOption(BusinessConfigOption.LOCAL.key, local.toString()); + saveConfig(); + } public int getScale() { return config.getOptionAsInt(BusinessConfigOption.SCALE.key); @@ -343,9 +351,10 @@ public class LimaBusinessConfig { HOST_EJB_BIND("lima.host.ejb.bind", "", "0.0.0.0", String.class, false, false), HOST_EJB_PORT("lima.host.ejb.port", n("lima.host.ejb.port.description"), "4202", Integer.class, false, false), - HOST_HTTP_ADDRESS("lima.host.http.address", n("lima.host.http.address.description"), "localhost", Integer.class, false, false), + HOST_HTTP_ADDRESS("lima.host.http.address", n("lima.host.http.address.description"), "localhost", String.class, false, false), HOST_HTTP_PORT("lima.host.http.port", n("lima.host.http.port.description"), "5462", Integer.class, false, false), + LOCAL("lima.config.local", t("lima.config.local.label"), n("lima.config.local.description"), Locale.FRANCE.toString() , Locale.class, false, false), SCALE("lima.data.bigDecimal.scale", t("lima.config.scale.label"), n("lima.config.scale.description"), "2", String.class, false, false), CURRENCY("lima.config.currency", t("lima.config.currency.label"), n("lima.config.currency.description"), "false", Boolean.class, false, false), DATE_FORMAT("lima.config.dateFormat", t("lima.config.dateFormat.label"), n("lima.config.dateFormat.description"), "DD/MM/YYYY", Boolean.class, false, false), diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java index 8cbfae8..e4fec31 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java @@ -27,6 +27,7 @@ import org.chorem.lima.business.config.LimaConfigOptionDef; import javax.ejb.Remote; import javax.ejb.Stateless; +import java.util.Locale; @Stateless @Remote(OptionsService.class) @@ -102,4 +103,9 @@ public class OptionsServiceImpl extends AbstractLimaService implements OptionsSe return LimaBusinessConfig.getInstance().getHostHttpPort(); } + @Override + public void setLocal(Locale local) { + LimaBusinessConfig.getInstance().setLocal(local); + } + } diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java index ff5af26..a9da2e0 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/report/BalanceReportServiceImpl.java @@ -76,6 +76,8 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal protected IdentityService identityService; protected static final Integer ACCOUNT_NUMBER_SIZE = 6; + protected static final String GROUP_401 = "401"; + protected static final String GROUP_411 = "411"; protected static final Predicate<BalanceAccount> HAS_NO_ENTRY = new Predicate<BalanceAccount>() { @@ -90,7 +92,7 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal }; @Override - public DocumentReport getBalanceDocumentReport(Date from, Date to, String selectedAccounts, DecimalFormat bigDecimalFormat, JasperReport mainAccountsJasperReport, JasperReport subAccountsJasperReport) { + public DocumentReport getBalanceDocumentReport(Date from, Date to, String selectedAccounts, String isBalanceGeneralSt, DecimalFormat bigDecimalFormat, JasperReport mainAccountsJasperReport, JasperReport subAccountsJasperReport) { String reportName = t("lima-business.document.balanceReport.title"); DocumentReport documentReport = CommonsDocumentReport.getDocumentReport(reportName, from, to, mainAccountsJasperReport, bigDecimalFormat, identityService); @@ -103,6 +105,15 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal documentReport.setColumnTotalForPeriodTitle(t("lima-business.document.columnTotalForPeriodTitle")); documentReport.setColumnVoucherTitle(t("lima-business.document.columnVoucherTitle")); + documentReport.setLastPageColumnDescription(t("lima-business.document.balance.lastPageColumnDescription")); + + boolean isBalanceGeneral = StringUtils.isBlank(isBalanceGeneralSt) || Boolean.valueOf(isBalanceGeneralSt); + + BigDecimal globalDebit = BigDecimal.ZERO; + BigDecimal globalCredit = BigDecimal.ZERO; + BigDecimal globalDebitBalance = BigDecimal.ZERO; + BigDecimal globalCreditBalance = BigDecimal.ZERO; + BalanceTrial balanceTrial = new BalanceTrialImpl(); balanceTrial.setReportsDatas(new ArrayList<ReportsDatas>()); @@ -128,30 +139,103 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal setDocumentReportHeaderSelectedAccounts(documentReport, accounts); HashMap<String, BalanceAccountImpl> accountsByClasses = new HashMap<>(); + + BalanceAccount sold401 = null; + BalanceAccount sold411 = null; + for (Account account : accounts) { String accountClass = String.valueOf(account.getAccountNumber().charAt(0)); - BalanceAccountImpl accountSubAccounts = accountsByClasses.get(accountClass); - if (accountSubAccounts == null) { - accountSubAccounts = new BalanceAccountImpl(); - accountSubAccounts.setFormatter(bigDecimalFormat); - accountSubAccounts.setSubReport(subAccountsJasperReport); - accountSubAccounts.setSubAccounts(new ArrayList<BalanceAccount>()); - accountsByClasses.put(accountClass, accountSubAccounts); - returnedAccounts.add(accountSubAccounts); - } + // all results for a account classes + BalanceAccountImpl accountSubAccounts = getBalanceAccountForAccountClass(bigDecimalFormat, subAccountsJasperReport, returnedAccounts, accountsByClasses, accountClass); + + // compute balance for the account classes BalanceAccount subClassAccount = computeSubAccountBalance(accountClass, account, from, to, bigDecimalFormat); + + // only add it if there are results if (subClassAccount != null) { - accountSubAccounts.addSubAccount(subClassAccount); + // we group Account 401 and 411 with there sub accounts + String accountNb = account.getAccountNumber(); + + if (isBalanceGeneral && ((accountNb.startsWith(GROUP_401)) || (accountNb.startsWith(GROUP_411)))){ + BalanceAccount balanceAccount = null; + if ((accountNb.startsWith(GROUP_401))){ + if (sold401 == null) { + sold401 = new BalanceAccountImpl(); + sold401.setLabel(t("lima-business.document.balance.globalSupplier")); + sold401.setFormatter(bigDecimalFormat); + sold401.setAccountNumber("4010000"); + accountSubAccounts.addSubAccount(sold401); + } + balanceAccount = sold401; + } else if((accountNb.startsWith(GROUP_411))) { + if (sold411 == null) { + sold411 = new BalanceAccountImpl(); + sold411.setLabel(t("lima-business.document.balance.globalClient")); + sold411.setFormatter(bigDecimalFormat); + sold411.setAccountNumber("4110000"); + accountSubAccounts.addSubAccount(sold411); + } + balanceAccount = sold411; + } + + if (balanceAccount != null) { + // add amounts to global 4 account + addInWith(accountSubAccounts, subClassAccount); + + // add amounts to 401 or 411 global amount + addInWith(balanceAccount, subClassAccount); + + // add amounts to global result + globalDebit = globalDebit.add(subClassAccount.getAmountDebit()); + globalCredit = globalCredit.add(subClassAccount.getAmountCredit()); + globalDebitBalance = globalDebitBalance.add(subClassAccount.getDebitBalance()); + globalCreditBalance = globalCreditBalance.add(subClassAccount.getCreditBalance()); + } + + } else { + accountSubAccounts.addSubAccount(subClassAccount); + + globalDebit = globalDebit.add(subClassAccount.getAmountDebit()); + globalCredit = globalCredit.add(subClassAccount.getAmountCredit()); + globalDebitBalance = globalDebitBalance.add(subClassAccount.getDebitBalance()); + globalCreditBalance = globalCreditBalance.add(subClassAccount.getCreditBalance()); + } } } } Iterables.removeIf(returnedAccounts, HAS_NO_ENTRY); documentReport.addAllMainAccounts(returnedAccounts); + + documentReport.setTotalDebit(globalDebit); + documentReport.setTotalCredit(globalCredit); + documentReport.setDebitBalance(globalDebitBalance); + documentReport.setCreditBalance(globalCreditBalance); + return documentReport; } + protected void addInWith(BalanceAccount target, BalanceAccount toBeAdded) { + target.setAmountDebit(target.getAmountDebit().add(toBeAdded.getAmountDebit())); + target.setAmountCredit(target.getAmountCredit().add(toBeAdded.getAmountCredit())); + target.setDebitBalance(target.getDebitBalance().add(toBeAdded.getDebitBalance())); + target.setCreditBalance(target.getCreditBalance().add(toBeAdded.getCreditBalance())); + } + + protected BalanceAccountImpl getBalanceAccountForAccountClass(DecimalFormat bigDecimalFormat, JasperReport subAccountsJasperReport, Collection<BalanceAccount> returnedAccounts, HashMap<String, BalanceAccountImpl> accountsByClasses, String accountClass) { + BalanceAccountImpl accountSubAccounts = accountsByClasses.get(accountClass); + if (accountSubAccounts == null) { + accountSubAccounts = new BalanceAccountImpl(); + accountSubAccounts.setFormatter(bigDecimalFormat); + accountSubAccounts.setSubReport(subAccountsJasperReport); + accountSubAccounts.setSubAccounts(new ArrayList<BalanceAccount>()); + accountsByClasses.put(accountClass, accountSubAccounts); + returnedAccounts.add(accountSubAccounts); + } + return accountSubAccounts; + } + protected void setDocumentReportHeaderSelectedAccounts(DocumentReport documentReport, List<Account> accounts) { Account fromAccount = accounts.get(0); Account toAccount = accounts.get(accounts.size()-1); @@ -196,7 +280,6 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal BalanceAccount balanceAccount = addSubAccountReport(mainAccountLabel, account, bigDecimalFormat, credit, debit, balance); - return balanceAccount; } @@ -216,10 +299,8 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal if (balance.compareTo(BigDecimal.ZERO) == 1) { balanceAccount.setDebitBalance(balance.abs()); - balanceAccount.setCreditBalance(BigDecimal.ZERO); } else { balanceAccount.setCreditBalance(balance.abs()); - balanceAccount.setDebitBalance(BigDecimal.ZERO); } balanceAccount.setAmountCredit(credit); @@ -227,4 +308,5 @@ public class BalanceReportServiceImpl extends AbstractLimaService implements Bal } return balanceAccount; } + } diff --git a/lima-callao/src/main/java/org/chorem/lima/beans/BalanceAccountImpl.java b/lima-callao/src/main/java/org/chorem/lima/beans/BalanceAccountImpl.java index de819dc..2e1bdde 100644 --- a/lima-callao/src/main/java/org/chorem/lima/beans/BalanceAccountImpl.java +++ b/lima-callao/src/main/java/org/chorem/lima/beans/BalanceAccountImpl.java @@ -29,24 +29,23 @@ public class BalanceAccountImpl extends BalanceAccount { private static final long serialVersionUID = 1L; + public BalanceAccountImpl() { + this.amountDebit = BigDecimal.ZERO; + this.amountCredit = BigDecimal.ZERO; + this.debitBalance = BigDecimal.ZERO; + this.creditBalance = BigDecimal.ZERO; + } + public void addSubAccount(BalanceAccount subAccount) { // we only add account that have values if (subAccount.getAmountDebit() != null && subAccount.getAmountCredit() != null) { getSubAccounts().add(subAccount); - BigDecimal newAmountDebit = this.amountDebit == null ? BigDecimal.ZERO : this.amountDebit; - BigDecimal newAmountCredit = this.amountCredit == null ? BigDecimal.ZERO : this.amountCredit; - BigDecimal newSoldeDebit = this.debitBalance == null ? BigDecimal.ZERO : this.debitBalance; - BigDecimal newSoldeCredit = this.creditBalance == null ? BigDecimal.ZERO : this.creditBalance; - - this.amountDebit = subAccount.getAmountDebit().add(newAmountDebit); - - this.amountCredit = subAccount.getAmountCredit().add(newAmountCredit); - - this.debitBalance = subAccount.getDebitBalance().add(newSoldeDebit); - - this.creditBalance = subAccount.getCreditBalance().add(newSoldeCredit); + this.amountDebit = this.amountDebit.add(subAccount.getAmountDebit()); + this.amountCredit = this.amountCredit.add(subAccount.getAmountCredit()); + this.debitBalance = this.debitBalance.add(subAccount.getDebitBalance()); + this.creditBalance = this.creditBalance.add(subAccount.getCreditBalance()); } // firePropertyChange(PROPERTY_SUB_ACCOUNTS, null, subAccount); 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 40ef663..37206ec 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 @@ -472,10 +472,10 @@ public class DocumentService { //############## balance ############## - public void createBalanceDocuments(Date beginDate, Date endDate, String fromToAccount) { + public void createBalanceDocuments(Date beginDate, Date endDate, String isBalanceGeneral, String fromToAccount) { JasperReport balanceMainAccountsReport = jasperReports.getBalanceManAccountsReport(); JasperReport balanceSubAccountsReport = jasperReports.getBalanceSubAccountsReport(); - DocumentReport report = balanceReportService.getBalanceDocumentReport(beginDate, endDate, fromToAccount, + DocumentReport report = balanceReportService.getBalanceDocumentReport(beginDate, endDate, fromToAccount, isBalanceGeneral, getDecimalFormat(), balanceMainAccountsReport, balanceSubAccountsReport); jasperReports.generatePDFReport(DocumentsEnum.BALANCE, balanceFilePath, Lists.newArrayList(report)); } @@ -520,13 +520,13 @@ public class DocumentService { return inputStream; } - public GeneratedReport createReport(Date beginDate, Date endDate, String model, String account, String autocomplete) throws IOException { + public GeneratedReport createReport(Date beginDate, Date endDate, String model, String account, String isBalanceGeneral, String autocomplete) throws IOException { String stringResult = null; //create docs switch (DocumentsEnum.valueOfLink(model)) { case BALANCE: - createBalanceDocuments(beginDate, endDate, null); + createBalanceDocuments(beginDate, endDate, isBalanceGeneral, null); break; case ACCOUNT: createAccountDocument(account, beginDate, endDate); diff --git a/lima-report/src/main/resources/jasperreports/balance/BalanceSubAccountsReport.jrxml b/lima-report/src/main/resources/jasperreports/balance/BalanceSubAccountsReport.jrxml index 4f8896d..3b7611c 100644 --- a/lima-report/src/main/resources/jasperreports/balance/BalanceSubAccountsReport.jrxml +++ b/lima-report/src/main/resources/jasperreports/balance/BalanceSubAccountsReport.jrxml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.1.0.final using JasperReports Library version 6.1.0 --> -<!-- 2015-07-02T18:03:10 --> +<!-- 2015-09-07T13:45:22 --> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="BalanceClassesReport" pageWidth="578" pageHeight="20" columnWidth="578" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="75ff86c6-c370-4f0b-a2d3-e17324a465bb"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> @@ -11,7 +11,6 @@ <![CDATA[]]> </queryString> <field name="formatter" class="java.text.DecimalFormat"/> - <field name="accountNumber" class="java.lang.String"/> <field name="label" class="java.lang.String"/> <field name="amountDebit" class="java.math.BigDecimal"/> @@ -21,7 +20,6 @@ <field name="mainAccountLabel" class="java.lang.String"/> <field name="totalForLabel" class="java.lang.String"/> <field name="subTotalForLabel" class="java.lang.String"/> - <variable name="amountBalanceDebit" class="java.math.BigDecimal" calculation="Sum"> <variableExpression><![CDATA[$F{amountDebit}]]></variableExpression> <initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression> @@ -162,7 +160,7 @@ <font size="8" isBold="true"/> <paragraph leftIndent="80"/> </textElement> - <textFieldExpression><![CDATA[$F{subTotalForLabel} + $F{mainAccountLabel}]]></textFieldExpression> + <textFieldExpression><![CDATA[String.format($F{subTotalForLabel}, $F{mainAccountLabel})]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="true"> <reportElement key="" x="434" y="0" width="72" height="10" forecolor="#736343" uuid="9c59df76-21ef-428f-8266-0da4cade0a20"> @@ -172,7 +170,6 @@ <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="local_mesure_unitheight" value="pixel"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> - <printWhenExpression><![CDATA[new Boolean($V{sumBalanceDebit}.compareTo(BigDecimal.ZERO) != 0)]]></printWhenExpression> </reportElement> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> @@ -208,7 +205,7 @@ <textFieldExpression><![CDATA[new Boolean($V{sumBalanceCredit}.compareTo(BigDecimal.ZERO) != 0) ? $F{formatter}.format($V{sumBalanceCredit}) : ""]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="true"> - <reportElement key="" x="290" y="0" width="72" height="10" forecolor="#736343" uuid="7f9a6117-e3b4-492f-ba5a-b4f913516294"> + <reportElement key="" isPrintRepeatedValues="false" x="290" y="0" width="72" height="10" forecolor="#736343" uuid="7f9a6117-e3b4-492f-ba5a-b4f913516294"> <property name="local_mesure_unitx" value="pixel"/> <property name="com.jaspersoft.studio.unit.x" value="px"/> <property name="local_mesure_unitwidth" value="pixel"/> @@ -217,7 +214,6 @@ <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="local_mesure_unity" value="pixel"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> - <printWhenExpression><![CDATA[new Boolean($V{sumBalanceDebit}.compareTo(BigDecimal.ZERO) != 0)]]></printWhenExpression> </reportElement> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> @@ -289,7 +285,7 @@ <font size="8" isBold="true"/> <paragraph leftIndent="80"/> </textElement> - <textFieldExpression><![CDATA[$F{totalForLabel} + $F{mainAccountLabel}]]></textFieldExpression> + <textFieldExpression><![CDATA[String.format($F{totalForLabel}, $F{mainAccountLabel})]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="true"> <reportElement key="" x="434" y="0" width="72" height="10" forecolor="#736343" uuid="6edd1323-c09c-45f8-ac94-be4753616581"> @@ -299,7 +295,6 @@ <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="local_mesure_unitheight" value="pixel"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> - <printWhenExpression><![CDATA[new Boolean($V{sumBalanceDebit}.compareTo(BigDecimal.ZERO) != 0)]]></printWhenExpression> </reportElement> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> @@ -344,7 +339,6 @@ <property name="com.jaspersoft.studio.unit.height" value="px"/> <property name="local_mesure_unity" value="pixel"/> <property name="com.jaspersoft.studio.unit.y" value="px"/> - <printWhenExpression><![CDATA[new Boolean($V{sumBalanceDebit}.compareTo(BigDecimal.ZERO) != 0)]]></printWhenExpression> </reportElement> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> diff --git a/lima-report/src/main/resources/jasperreports/balance/DocumentReport.jrxml b/lima-report/src/main/resources/jasperreports/balance/DocumentReport.jrxml index bc37ab4..9cb88c4 100644 --- a/lima-report/src/main/resources/jasperreports/balance/DocumentReport.jrxml +++ b/lima-report/src/main/resources/jasperreports/balance/DocumentReport.jrxml @@ -14,10 +14,22 @@ <rightPen lineWidth="0.6" lineColor="#804000"/> </box> </style> + + <style name="FooterHeader" mode="Opaque" forecolor="#D0B48E" backcolor="#FDCA97" fontName="DejaVu Sans"/> + <style name="FooterColumn" forecolor="#804000" fontName="DejaVu Sans" fontSize="8" isBold="true"> + <box> + <topPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <leftPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <bottomPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + <rightPen lineWidth="0.6" lineStyle="Solid" lineColor="#804000"/> + </box> + </style> + <style name="Oblique" fontName="DejaVu Sans Mono" fontSize="8" isItalic="true"/> <queryString> <![CDATA[]]> </queryString> + <field name="formatter" class="java.text.DecimalFormat"/> <field name="subReport" class="net.sf.jasperreports.engine.JasperReport"/> <field name="mainAccounts" class="java.util.List"/> @@ -44,6 +56,14 @@ <field name="columnDebitTitle" class="java.lang.String"/> <field name="columnDescriptionTitle" class="java.lang.String"/> <field name="columnTotalForPeriodTitle" class="java.lang.String"/> + + <field name="lastPageColumnDescription" class="java.lang.String"/> + + <field name="totalDebit" class="java.math.BigDecimal"/> + <field name="totalCredit" class="java.math.BigDecimal"/> + <field name="debitBalance" class="java.math.BigDecimal"/> + <field name="creditBalance" class="java.math.BigDecimal"/> + <variable name="mainAccounts" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"> <variableExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource((java.util.List)$F{mainAccounts})]]></variableExpression> </variable> @@ -260,4 +280,65 @@ </textField> </band> </pageFooter> + <lastPageFooter> + <band height="30"> + <frame> + <reportElement style="FooterHeader" stretchType="RelativeToBandHeight" x="0" y="0" width="578" height="20" isRemoveLineWhenBlank="true"/> + <textField isBlankWhenNull="true"> + <reportElement style="FooterColumn" x="0" y="0" width="434" height="20"/> + <textElement textAlignment="Left" verticalAlignment="Middle"> + <font size="12" isBold="true" isItalic="true"/> + <paragraph lineSpacingSize="0.0" leftIndent="40"/> + </textElement> + <textFieldExpression><![CDATA[$F{lastPageColumnDescription}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="FooterColumn" x="290" y="0" width="72" height="20"/> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="DejaVu Sans Mono" size="8" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[new Boolean($F{totalDebit}.compareTo(BigDecimal.ZERO) != 0) ? $F{formatter}.format($F{totalDebit}) : ""]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="FooterColumn" x="362" y="0" width="72" height="20"/> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="DejaVu Sans Mono" size="8" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[new Boolean($F{totalCredit}.compareTo(BigDecimal.ZERO) != 0) ? $F{formatter}.format($F{totalCredit}) : ""]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="FooterColumn" x="434" y="0" width="72" height="20"/> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="DejaVu Sans Mono" size="8" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[new Boolean($F{debitBalance}.compareTo(BigDecimal.ZERO) != 0) ? $F{formatter}.format($F{debitBalance}) : ""]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement style="FooterColumn" x="506" y="0" width="72" height="20"/> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font fontName="DejaVu Sans Mono" size="8" isBold="true"/> + <paragraph lineSpacingSize="0.0" rightIndent="2"/> + </textElement> + <textFieldExpression><![CDATA[new Boolean($F{creditBalance}.compareTo(BigDecimal.ZERO) != 0) ? $F{formatter}.format($F{creditBalance}) : ""]]></textFieldExpression> + </textField> + </frame> + <textField isBlankWhenNull="false"> + <reportElement x="0" y="20" width="288" height="10"/> + <textElement textAlignment="Right"> + <paragraph lineSpacingSize="0.0"/> + </textElement> + <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + <textField evaluationTime="Report"> + <reportElement x="288" y="20" width="287" height="10"/> + <textElement textAlignment="Left"> + <paragraph lineSpacingSize="0.0"/> + </textElement> + <textFieldExpression><![CDATA[" / " + $V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + </band> + </lastPageFooter> </jasperReport> diff --git a/lima-report/src/test/java/org/chorem/lima/report/action/ReportTest.java b/lima-report/src/test/java/org/chorem/lima/report/action/ReportTest.java index 5826982..a8d1f56 100644 --- a/lima-report/src/test/java/org/chorem/lima/report/action/ReportTest.java +++ b/lima-report/src/test/java/org/chorem/lima/report/action/ReportTest.java @@ -55,6 +55,6 @@ public class ReportTest { Date beginDateFormat = df.parse("01/01/2013"); Date endDateFormat = df.parse("31/12/2014"); DocumentService documentService = new DocumentService(); - documentService.createBalanceDocuments(beginDateFormat, endDateFormat, null); + documentService.createBalanceDocuments(beginDateFormat, endDateFormat, null, null); } } 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 127a6b5..eaa9a13 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 @@ -30,6 +30,7 @@ import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaTechnicalException; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.api.OptionsService; import org.chorem.lima.entity.Account; @@ -58,6 +59,7 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; +import java.util.Locale; import static org.nuiton.i18n.I18n.t; @@ -140,13 +142,13 @@ public class HttpServerService { String endDate = req.getParameter("endDate"); String account = (StringUtils.isBlank(req.getParameter("account")) ? null : URLDecoder.decode(req.getParameter("account"), "UTF-8")); String autocomplete = req.getParameter("autocomplete") == null ? "true" : req.getParameter("autocomplete"); - + String isGeneral = req.getParameter("isGeneral") == null ? "true" : req.getParameter("isGeneral"); if (imageParam != null) { // render image doImage(resp, imageParam); } else if (model != null && beginDate != null && endDate != null) { // generate and render report - doCreateReport(resp, model, beginDate, endDate, account, autocomplete); + doCreateReport(resp, model, beginDate, endDate, account, isGeneral, autocomplete); } else { // render home HTML doHomeHtml(req, resp); @@ -168,7 +170,7 @@ public class HttpServerService { } protected void doCreateReport(HttpServletResponse resp, String model, String beginDate, String endDate, - String account, String autocomplete) throws IOException { + String account, String isGeneral, String autocomplete) throws IOException { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); @@ -178,7 +180,7 @@ public class HttpServerService { Date endDateFormat = sdf.parse(endDate); GeneratedReport generatedReport = - documentService.createReport(beginDateFormat, endDateFormat, model, account, autocomplete); + documentService.createReport(beginDateFormat, endDateFormat, model, account, isGeneral, autocomplete); if (Strings.isNullOrEmpty(generatedReport.getHtmlContent())) { InputStream in = generatedReport.getPdfStream(); @@ -225,7 +227,11 @@ public class HttpServerService { beginDatePicker = DateUtils.truncate(beginDatePicker, Calendar.YEAR); - pageContent.append("<!DOCTYPE html>\n" + "<html lang=\"fr\">\n" + Locale locale = LimaBusinessConfig.getInstance().getLocal(); + + pageContent.append("<!DOCTYPE html>\n" + "<html lang=\""); + pageContent.append(locale.getLanguage()); + pageContent.append("\">\n" + "<head>\n" + "<script type=\"text/javascript\">" + " function showAccountInput(){" + @@ -239,8 +245,18 @@ public class HttpServerService { " document.getElementById('accountField').style.display = 'none';" + " }" + " }" + + " var request = document.getElementById('model');" + + " var requestValue = request == null ? '': request.value;" + + " var isDocumentBalance = requestValue === 'lima_balance'; " + + " if (document.getElementById('balanceType') != null) {" + + " if (isDocumentBalance) {" + + " document.getElementById('balanceType').style.display = 'block';" + + " } else {" + + " document.getElementById('balanceType').style.display = 'none';" + + " }" + + " }" + " }" + - " showAccountInput();" + + " 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" @@ -255,11 +271,8 @@ public class HttpServerService { .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()'>"); + pageContent.append("Documents : <select id=\"model\" name=\"model\" onchange='showAccountInput()'>"); for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { pageContent.append("<option value=\"") @@ -278,10 +291,15 @@ public class HttpServerService { optionAccounts.append("</option>\n"); } - pageContent.append("</select>" + pageContent.append( "</select>" + "<div id='accountField'>Compte : <select id=\"account\" name=\"account\">" + optionAccounts.toString() + "</select></div>" + + "<div id='balanceType'>" + + " <input type=\"radio\" name=\"isGeneral\" value=\"true\" checked>Balance Générale\n" + + " <br>\n" + + " <input type=\"radio\" name=\"isGeneral\" value=\"false\">Balance Globale" + + "</div>" + "<input type=\"submit\">\n" + "</form></td>" + "<tr><td class=\"tdright\"><img src=\"?img=entries.png\"/></td></tr>\n" diff --git a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java index 740f3ae..f1af0d0 100644 --- a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java +++ b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java @@ -172,6 +172,7 @@ public class LimaSwingConfig extends ApplicationConfig implements BigDecimalToSt */ public void setLocale(Locale newLocale) { setOption(Option.LOCALE.key, newLocale.toString()); + optionsService.setLocal(newLocale); saveForUser(); firePropertyChange("locale", null, newLocale); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1241-account-report in repository lima. See http://git.chorem.org/lima.git commit f050c539a8e77d9028a2984a7a71ddd97d7ef94a Author: dcosse <cosse@codelutin.com> Date: Mon Sep 7 14:27:50 2015 +0200 refs #1241 monté de version je Jasper report --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 716e93a..b0e7bda 100644 --- a/pom.xml +++ b/pom.xml @@ -198,7 +198,7 @@ <h2Version>1.3.176</h2Version> <hibernateVersion>4.3.7.Final</hibernateVersion> <itextVersion>4.2.1</itextVersion> - <jasperreportsVersion>6.0.3</jasperreportsVersion> + <jasperreportsVersion>6.1.1</jasperreportsVersion> <javaxServletVersion>3.1.0</javaxServletVersion> <jaxxVersion>2.24</jaxxVersion> <jbossTransactionVersion>1.0.0.Final</jbossTransactionVersion> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm