Fixes issue 15932. Fixes issue 15933. Fixes issue 15934. Fixes issue 15840.Several changes done to Report General Ledger Journal:
authorDavid Alsasua <david.alsasua@openbravo.com>
Fri, 04 Mar 2011 12:17:03 +0100
changeset 11020 c849db4f722d
parent 11019 8a8749019b3d
child 11021 9feb1b7a90b0
Fixes issue 15932. Fixes issue 15933. Fixes issue 15934. Fixes issue 15840.Several changes done to Report General Ledger Journal:
- Show Regularization / Opening / Closing checks now works in this way: if, and only if, the check is active, the corresponding entry type will be shown.
- Show Regular Entries check is added. This way, user can choose what entry types to include (checkbox active) or exclude (not-active checkbox) in the report output. By default, all the types will be shown
- ONLY WHEN PRINTING TO PDF, an initial entry number can be set. This way, entries will be numbered starting with the provided number.
- ONLY WHEN PRINTING TO PDF, the accumulated amounts for debit and credit is calculated and shown.
- ONLY WHEN PRINTING TO PDF, an initial debit and credit amount can be provided, and will be used as initial value of debit and credit accumulated amounts.
- ONLY WHEN PRINTING TO PDF, user can choose whether to show the subaccount description in each entry line (as of now), or the entry line description. PLEASE NOTICE THAT USER WILL SET THE DESIRED SQL DESCRIPTION IN THE CORRESPONDING TABLES, UNDER ACCOUNTING SCHEMA TAB, IN ORDER TO AVOID DUPLICATED LINES IN THE ENTRIES.
- Trial Balance Report is modified in order to make coherent both terms for corry forward amounts
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Fri Mar 04 09:45:50 2011 +0100
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Fri Mar 04 12:17:03 2011 +0100
@@ -21762,6 +21762,193 @@
 <!--9C3EDA8B819431A5E040A8C021013F8D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9C3EDA8B819431A5E040A8C021013F8D--></AD_TEXTINTERFACES>
 
+<!--9DA67547DD4F2BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD4F2BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <TEXT><![CDATA[Accounting Schema]]></TEXT>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD4F2BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD4F2BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD512BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD512BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD512BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD512BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD512BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD512BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD512BAAE040007F01002B99-->  <TEXT><![CDATA[Show Regular Entries]]></TEXT>
+<!--9DA67547DD512BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD512BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD512BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD512BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD532BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD532BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD532BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD532BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD532BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD532BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD532BAAE040007F01002B99-->  <TEXT><![CDATA[Show Regularization]]></TEXT>
+<!--9DA67547DD532BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD532BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD532BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD532BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD552BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD552BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD552BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD552BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD552BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD552BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD552BAAE040007F01002B99-->  <TEXT><![CDATA[Show Opening]]></TEXT>
+<!--9DA67547DD552BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD552BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD552BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD552BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD572BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD572BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD572BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD572BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD572BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD572BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD572BAAE040007F01002B99-->  <TEXT><![CDATA[Show Closing]]></TEXT>
+<!--9DA67547DD572BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD572BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD572BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD572BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD592BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD592BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD592BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD592BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD592BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD592BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD592BAAE040007F01002B99-->  <TEXT><![CDATA[Printing]]></TEXT>
+<!--9DA67547DD592BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD592BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD592BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD592BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD5B2BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD5B2BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <TEXT><![CDATA[Initial Page Number]]></TEXT>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD5B2BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD5B2BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD5D2BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD5D2BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <TEXT><![CDATA[Initial Entry Number]]></TEXT>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD5D2BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD5D2BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD5F2BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD5F2BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <TEXT><![CDATA[Initial Balance]]></TEXT>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD5F2BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD5F2BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD612BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD612BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD612BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD612BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD612BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD612BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD612BAAE040007F01002B99-->  <TEXT><![CDATA[Show Entry Description]]></TEXT>
+<!--9DA67547DD612BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD612BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD612BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD612BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD632BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD632BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD632BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD632BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD632BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD632BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD632BAAE040007F01002B99-->  <TEXT><![CDATA[Journal Entry ]]></TEXT>
+<!--9DA67547DD632BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD632BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD632BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD632BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD652BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD652BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD652BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD652BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD652BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD652BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD652BAAE040007F01002B99-->  <TEXT><![CDATA[Accounting Schema ]]></TEXT>
+<!--9DA67547DD652BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--9DA67547DD652BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD652BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD652BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA67547DD672BAAE040007F01002B99--><AD_TEXTINTERFACES>
+<!--9DA67547DD672BAAE040007F01002B99-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA67547DD672BAAE040007F01002B99]]></AD_TEXTINTERFACES_ID>
+<!--9DA67547DD672BAAE040007F01002B99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA67547DD672BAAE040007F01002B99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA67547DD672BAAE040007F01002B99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA67547DD672BAAE040007F01002B99-->  <TEXT><![CDATA[CARRY FORWARD...]]></TEXT>
+<!--9DA67547DD672BAAE040007F01002B99-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html]]></FILENAME>
+<!--9DA67547DD672BAAE040007F01002B99-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA67547DD672BAAE040007F01002B99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA67547DD672BAAE040007F01002B99--></AD_TEXTINTERFACES>
+
+<!--9DA678E2E4F1F213E040007F01002C4C--><AD_TEXTINTERFACES>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA678E2E4F1F213E040007F01002C4C]]></AD_TEXTINTERFACES_ID>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <TEXT><![CDATA[... continued]]></TEXT>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.jrxml]]></FILENAME>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA678E2E4F1F213E040007F01002C4C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA678E2E4F1F213E040007F01002C4C--></AD_TEXTINTERFACES>
+
+<!--9DA678E2E4F3F213E040007F01002C4C--><AD_TEXTINTERFACES>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA678E2E4F3F213E040007F01002C4C]]></AD_TEXTINTERFACES_ID>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <TEXT><![CDATA[Carry-Over:]]></TEXT>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.jrxml]]></FILENAME>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA678E2E4F3F213E040007F01002C4C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA678E2E4F3F213E040007F01002C4C--></AD_TEXTINTERFACES>
+
+<!--9DA678E2E4F5F213E040007F01002C4C--><AD_TEXTINTERFACES>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA678E2E4F5F213E040007F01002C4C]]></AD_TEXTINTERFACES_ID>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <TEXT><![CDATA[Carry Forward:]]></TEXT>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.jrxml]]></FILENAME>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA678E2E4F5F213E040007F01002C4C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA678E2E4F5F213E040007F01002C4C--></AD_TEXTINTERFACES>
+
+<!--9DA678E2E4F7F213E040007F01002C4C--><AD_TEXTINTERFACES>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <AD_TEXTINTERFACES_ID><![CDATA[9DA678E2E4F7F213E040007F01002C4C]]></AD_TEXTINTERFACES_ID>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <TEXT><![CDATA[continue ...]]></TEXT>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.jrxml]]></FILENAME>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--9DA678E2E4F7F213E040007F01002C4C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9DA678E2E4F7F213E040007F01002C4C--></AD_TEXTINTERFACES>
+
 <!--9F0C2175AC6145B49570E24110762368--><AD_TEXTINTERFACES>
 <!--9F0C2175AC6145B49570E24110762368-->  <AD_TEXTINTERFACES_ID><![CDATA[9F0C2175AC6145B49570E24110762368]]></AD_TEXTINTERFACES_ID>
 <!--9F0C2175AC6145B49570E24110762368-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html	Fri Mar 04 09:45:50 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html	Fri Mar 04 12:17:03 2011 +0100
@@ -13,7 +13,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2010 Openbravo SLU
+ * All portions are Copyright (C) 2001-2011 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -302,28 +302,80 @@
                 </select></td>
             </tr>
             <tr>
-              <td class="TitleCell"> <span class="LabelText">Accounting schema</span></td>
+              <td class="TitleCell"> <span class="LabelText">Accounting Schema</span></td>
               <td class="Combo_ContentCell" colspan="2"> <select  name="inpcAcctSchemaId" id="inpcAcctSchemaId" class="Combo Combo_TwoCells_width">
                   <option value=""> <div id="reportC_ACCTSCHEMA_ID"></div></option>
                 </select></td>
             </tr>
             <tr>
-              <td class="TitleCell"><span class="LabelText">Initial page number</span></td>
+              <td colspan="6">
+                <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
+                <tbody>
+                  <tr class="FieldGroup_TopMargin"/>
+                  <tr>
+                    <td class="FieldGroupTitle_Left"><img class="FieldGroupTitle_Left_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
+                    <td class="FieldGroupTitle">Type</td>
+                    <td class="FieldGroupTitle_Right"><img class="FieldGroupTitle_Right_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
+                    <td class="FieldGroupContent"/>
+                  </tr>
+                  <tr class="FieldGroup_BottomMargin"/>
+                </tbody>
+                </table>
+              </td>
+            </tr>
+        <tr>
+          <td class="TitleCell"><span class="LabelText">Show Regular Entries</span></td>
+          <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowRegular" name="inpShowRegular" value="Y"/></td>
+          <td class="ContentCell"></td>
+          <td class="TitleCell"><span class="LabelText">Show Regularization</span></td>
+          <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowReg" name="inpShowReg" value="Y"/></td>
+        </tr>
+        <tr>
+          <td class="TitleCell"><span class="LabelText">Show Opening</span></td>
+          <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowOpening" name="inpShowOpening" value="Y"/></td>
+          <td class="ContentCell"></td>
+          <td class="TitleCell"><span class="LabelText">Show Closing</span></td>
+          <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowClosing" name="inpShowClosing" value="Y"/></td>
+	    </tr>
+            <tr>
+              <td colspan="6">
+                <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
+                <tbody>
+                  <tr class="FieldGroup_TopMargin"/>
+                  <tr>
+                    <td class="FieldGroupTitle_Left"><img class="FieldGroupTitle_Left_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
+                    <td class="FieldGroupTitle">Printing</td>
+                    <td class="FieldGroupTitle_Right"><img class="FieldGroupTitle_Right_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
+                    <td class="FieldGroupContent"/>
+                  </tr>
+                  <tr class="FieldGroup_BottomMargin"/>
+                </tbody>
+                </table>
+              </td>
+            </tr>
+            <tr>
+              <td class="TitleCell"><span class="LabelText">Initial Page Number</span></td>
               <td class="TextBox_ContentCell"> <input dojoType="openbravo:Textbox"  class="dojoValidateValid TextBox_OneCell_width" type="text" name="inpPageNo" id="paramPageNo" size="10" maxlength="10" value=""></input><script>djConfig.searchIds.push("paramPageNo");</script>
-              </td>              
+              </td>
+              <td class="ContentCell"></td>
+              <td class="TitleCell"><span class="LabelText">Initial Entry Number</span></td>
+              <td class="TextBox_ContentCell">
+                <input dojoType="openbravo:Textbox" class="dojoValidateValid TextBox_OneCell_width" type="text" name="inpEntryNo"
+                       id="paramEntryNo" size="10" maxlength="10" value=""></input>
+                <script>djConfig.searchIds.push("paramEntryNo");</script>
+              </td>
             </tr>
-	    <tr>
-	      <td class="TitleCell"><span class="LabelText">Show closing</span></td>
-              <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowClosing" name="inpShowClosing" value="0"/></td>
-	    </tr>
-	    <tr>
-	      <td class="TitleCell"><span class="LabelText">Show regularization</span></td>
-              <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowReg" name="inpShowReg" value="0"/></td>
-	    </tr>
-	    <tr>
-	      <td class="TitleCell"><span class="LabelText">Show opening</span></td>
-              <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowOpening" name="inpShowOpening" value="0"/></td>
-	    </tr>
+            <tr>
+              <td class="TitleCell"><span class="LabelText">Initial Balance</span></td>
+              <td class="TextBox_ContentCell">
+                <input dojoType="openbravo:RealNumberTextbox" class="TextBox_OneCell_width" type="text" name="inpInitialBalance"
+                       id="paramInitialBalance" size="10" maxlength="10" value="" outputformat="euroEdition"></input>
+                <script>djConfig.searchIds.push("paramInitialBalance");</script>
+              </td>
+              <td class="ContentCell"></td>
+              <td class="TitleCell"><span class="LabelText">Show Entry Description</span></td>
+              <td class="Radio_Check_ContentCell"><input TYPE="checkbox" id="paramShowDescription" name="inpShowDescription" value="Y"/></td>
+            </tr>
             <tr>
               <td colspan="6">
                 <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
@@ -385,10 +437,10 @@
                     <table cellspacing="0" cellpadding="0" width="100%" class="DataGrid_Header_Table DataGrid_Body_Table" style="table-layout: auto;">
                       <tr class="DataGrid_Body_Row">
                         <th class="DataGrid_Header_Cell"> <a href="#" onclick="submitPage('DEFAULT', document.frmSecondary, 'xx', 'yy', 'zz');return false;" onmouseover="window.status='General Ledger Journal';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldId"> 
-                          Journal entry&nbsp;<span id="functionCalculateOrderJournal">xx123</span></a> 
+                          Journal Entry&nbsp;<span id="functionCalculateOrderJournal">xx123</span><!--span id="functionCalculateOrderJournalWithInitial">xx123</span--></a>
                           <input type="hidden" name="inpordenJournal" id="functionOrderJournal" value=""></input>
                         </th>
-						<th width="57%" class="DataGrid_Header_Cell">Accounting schema&nbsp;<span id="fieldSchemaName">xxSchema Name</span></th>
+						<th width="57%" class="DataGrid_Header_Cell">Accounting Schema&nbsp;<span id="fieldSchemaName">xxSchema Name</span></th>
                         <th width="14%" class="DataGrid_Header_Cell">Date&nbsp;<span id="fieldDateacct">xx12/12/2003</span></th>
                         <th width="8%" class="DataGrid_Header_Cell"> <a href="#" onclick="submitCommandFormParameter('DIRECT', document.frmMain.inpFactAcctGroupId, 'yy/xx', false, document.frmMain, 'ReportGeneralLedgerJournalDetail.html', null, false, true);return false;" onmouseover="window.status='General Ledger Journal';return true;" onmouseout="window.status='';return true;" class="LabelLink" id="fieldIdentifier"> 
                           Detail</a></th>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java	Fri Mar 04 09:45:50 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java	Fri Mar 04 12:17:03 2011 +0100
@@ -4,14 +4,14 @@
  * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
  * Version 1.1  with a permitted attribution clause; you may not  use this
  * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
+ * the License at http://www.openbravo.com/legal/license.html
  * Software distributed under the License  is  distributed  on  an "AS IS"
  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  * License for the specific  language  governing  rights  and  limitations
- * under the License. 
- * The Original Code is Openbravo ERP. 
- * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2010 Openbravo SLU 
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2001-2011 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,6 +20,7 @@
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.math.BigDecimal;
 import java.util.HashMap;
 
 import javax.servlet.ServletException;
@@ -74,16 +75,17 @@
           "ReportGeneralLedgerJournal|DateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportGeneralLedgerJournal|DateTo",
           "");
-      String strPageNo = vars.getGlobalVariable("inpPageNo", "ReportGeneralLedgerJournal|PageNo", "1");
       String strDocument = vars.getGlobalVariable("inpDocument",
           "ReportGeneralLedgerJournal|Document", "");
       String strOrg = vars.getGlobalVariable("inpOrg", "ReportGeneralLedgerJournal|Org", "0");
       String strShowClosing = vars.getGlobalVariable("inpShowClosing",
-          "ReportGeneralLedgerJournal|ShowClosing", "");
+          "ReportGeneralLedgerJournal|ShowClosing", "Y");
       String strShowReg = vars.getGlobalVariable("inpShowReg",
-          "ReportGeneralLedgerJournal|ShowReg", "");
+          "ReportGeneralLedgerJournal|ShowReg", "Y");
       String strShowOpening = vars.getGlobalVariable("inpShowOpening",
-          "ReportGeneralLedgerJournal|ShowOpening", "");
+          "ReportGeneralLedgerJournal|ShowOpening", "Y");
+      String strShowRegular = vars.getGlobalVariable("inpShowRegular",
+          "ReportGeneralLedgerJournal|ShowRegular", "Y");
       String strRecord = vars.getGlobalVariable("inpRecord", "ReportGeneralLedgerJournal|Record",
           "");
       String strTable = vars.getGlobalVariable("inpTable", "ReportGeneralLedgerJournal|Table", "");
@@ -101,20 +103,31 @@
         vars.setSessionValue(PREVIOUS_ACCTENTRIES, vars.getSessionValue(PREVIOUS_ACCTENTRIES_OLD));
         vars.setSessionValue(PREVIOUS_RANGE, vars.getSessionValue(PREVIOUS_RANGE_OLD));
       }
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strPageNo, strDocument, strOrg, strTable,
-          strRecord, "", strcAcctSchemaId, strShowClosing, strShowReg, strShowOpening);
+      String strPageNo = vars.getGlobalVariable("inpPageNo", "ReportGeneralLedgerJournal|PageNo",
+          "1");
+      String strEntryNo = vars.getGlobalVariable("inpEntryNo",
+          "ReportGeneralLedgerJournal|EntryNo", "1");
+      String strInitialBalance = vars.getGlobalVariable("inpInitialBalance",
+          "ReportGeneralLedgerJournal|InitialBalance", "0");
+      String strShowDescription = vars.getGlobalVariable("inpShowDescription",
+          "ReportGeneralLedgerJournal|ShowDescription", "");
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strDocument, strOrg, strTable,
+          strRecord, "", strcAcctSchemaId, strShowClosing, strShowReg, strShowOpening, strPageNo,
+          strEntryNo, strInitialBalance, strShowDescription, strShowRegular);
     } else if (vars.commandIn("DIRECT")) {
       String strTable = vars.getGlobalVariable("inpTable", "ReportGeneralLedgerJournal|Table");
       String strRecord = vars.getGlobalVariable("inpRecord", "ReportGeneralLedgerJournal|Record");
       setHistoryCommand(request, "DIRECT");
       vars.setSessionValue("ReportGeneralLedgerJournal.initRecordNumber", "0");
-      printPageDataSheet(response, vars, "", "", "1", "", "", strTable, strRecord, "", "", "", "", "");
+      printPageDataSheet(response, vars, "", "", "", "", strTable, strRecord, "", "", "", "", "",
+          "1", "1", "0", "", "Y");
     } else if (vars.commandIn("DIRECT2")) {
       String strFactAcctGroupId = vars.getGlobalVariable("inpFactAcctGroupId",
           "ReportGeneralLedgerJournal|FactAcctGroupId");
       setHistoryCommand(request, "DIRECT2");
       vars.setSessionValue("ReportGeneralLedgerJournal.initRecordNumber", "0");
-      printPageDataSheet(response, vars, "", "", "1", "", "", "", "", strFactAcctGroupId, "", "", "", "");
+      printPageDataSheet(response, vars, "", "", "", "", "", "", strFactAcctGroupId, "", "", "",
+          "", "1", "1", "0", "", "Y");
     } else if (vars.commandIn("FIND")) {
       String strcAcctSchemaId = vars.getRequestGlobalVariable("inpcAcctSchemaId",
           "ReportGeneralLedger|cAcctSchemaId");
@@ -122,16 +135,30 @@
           "ReportGeneralLedgerJournal|DateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo",
           "ReportGeneralLedgerJournal|DateTo");
-      String strPageNo = vars.getRequestGlobalVariable("inpPageNo", "ReportGeneralLedgerJournal|PageNo");
       String strDocument = vars.getRequestGlobalVariable("inpDocument",
           "ReportGeneralLedgerJournal|Document");
       String strOrg = vars.getGlobalVariable("inpOrg", "ReportGeneralLedgerJournal|Org", "0");
       String strShowClosing = vars.getRequestGlobalVariable("inpShowClosing",
           "ReportGeneralLedgerJournal|ShowClosing");
+      if (strShowClosing == null || "".equals(strShowClosing))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowClosing", "N");
+      String strShowRegular = vars.getRequestGlobalVariable("inpShowRegular",
+          "ReportGeneralLedgerJournal|ShowRegular");
+      if (strShowRegular == null || "".equals(strShowRegular))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowRegular", "N");
       String strShowReg = vars.getRequestGlobalVariable("inpShowReg",
           "ReportGeneralLedgerJournal|ShowReg");
+      if (strShowReg == null || "".equals(strShowReg))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowReg", "N");
       String strShowOpening = vars.getRequestGlobalVariable("inpShowOpening",
           "ReportGeneralLedgerJournal|ShowOpening");
+      if (strShowOpening == null || "".equals(strShowOpening))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowOpening", "N");
+      if (!("Y".equals(strShowOpening)) && !("Y".equals(strShowReg))
+          && !("Y".equals(strShowRegular)) && !("Y".equals(strShowClosing))) {
+        strShowRegular = "Y";
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowRegular", "Y");
+      }
       String strShowClosing1 = vars.getStringParameter("inpShowClosing");
       String strShowReg1 = vars.getStringParameter("inpShowReg");
       String strShowOpening1 = vars.getStringParameter("inpShowOpening");
@@ -145,8 +172,19 @@
       vars.setSessionValue(PREVIOUS_ACCTENTRIES, "0");
       vars.setSessionValue(PREVIOUS_RANGE, "");
       setHistoryCommand(request, "DEFAULT");
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strPageNo, strDocument, strOrg, "", "", "",
-          strcAcctSchemaId, strShowClosing, strShowReg, strShowOpening);
+      String strPageNo = vars.getRequestGlobalVariable("inpPageNo",
+          "ReportGeneralLedgerJournal|PageNo");
+      String strEntryNo = vars.getRequestGlobalVariable("inpEntryNo",
+          "ReportGeneralLedgerJournal|EntryNo");
+      String strInitialBalance = vars.getRequestGlobalVariable("inpInitialBalance",
+          "ReportGeneralLedgerJournal|InitialBalance");
+      String strShowDescription = vars.getRequestGlobalVariable("inpShowDescription",
+          "ReportGeneralLedgerJournal|ShowDescription");
+      if (strShowDescription == null || "".equals(strShowDescription))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowDescription", "N");
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strDocument, strOrg, "", "", "",
+          strcAcctSchemaId, strShowClosing, strShowReg, strShowOpening, strPageNo, strEntryNo,
+          strInitialBalance, strShowDescription, strShowRegular);
     } else if (vars.commandIn("PDF", "XLS")) {
       if (log4j.isDebugEnabled())
         log4j.debug("PDF");
@@ -161,10 +199,27 @@
       String strOrg = vars.getGlobalVariable("inpOrg", "ReportGeneralLedgerJournal|Org", "0");
       String strShowClosing = vars.getRequestGlobalVariable("inpShowClosing",
           "ReportGeneralLedgerJournal|ShowClosing");
+      if (strShowClosing == null || "".equals(strShowClosing))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowClosing", "N");
+      String strShowRegular = vars.getRequestGlobalVariable("inpShowRegular",
+          "ReportGeneralLedgerJournal|ShowRegular");
+      if (strShowRegular == null || "".equals(strShowRegular))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowRegular", "N");
       String strShowReg = vars.getRequestGlobalVariable("inpShowReg",
           "ReportGeneralLedgerJournal|ShowReg");
+      if (strShowReg == null || "".equals(strShowReg))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowReg", "N");
       String strShowOpening = vars.getRequestGlobalVariable("inpShowOpening",
           "ReportGeneralLedgerJournal|ShowOpening");
+      if (strShowOpening == null || "".equals(strShowOpening))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowOpening", "N");
+      // In case all flags "Type" are deactivated, the "Regular" one is activated by default
+      if (!("Y".equals(strShowOpening)) && !("Y".equals(strShowReg))
+          && !("Y".equals(strShowRegular)) && !("Y".equals(strShowClosing))) {
+        strShowRegular = "Y";
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowRegular", "Y");
+      }
+
       // String strRecord = vars.getGlobalVariable("inpRecord",
       // "ReportGeneralLedgerJournal|Record");
       // String strTable = vars.getGlobalVariable("inpTable",
@@ -173,6 +228,14 @@
       String strRecord = vars.getStringParameter("inpRecord");
       String strPageNo = vars.getGlobalVariable("inpPageNo", "ReportGeneralLedgerJournal|PageNo",
           "1");
+      String strEntryNo = vars.getGlobalVariable("inpEntryNo",
+          "ReportGeneralLedgerJournal|EntryNo", "1");
+      String strInitialBalance = vars.getGlobalVariable("inpInitialBalance",
+          "ReportGeneralLedgerJournal|InitialBalance", "0");
+      String strShowDescription = vars.getGlobalVariable("inpShowDescription",
+          "ReportGeneralLedgerJournal|ShowDescription", "N");
+      if (strShowDescription == null || "".equals(strShowDescription))
+        vars.setSessionValue("ReportGeneralLedgerJournal|ShowDescription", "N");
       /*
        * Scenario 1: We will have FactAcctGroupId while the request redirect from
        * ReportGeneralLedger Report. Otherwise we don't need to use FactAcctGroupId for PDF or Excel
@@ -200,7 +263,8 @@
       setHistoryCommand(request, "DEFAULT");
       printPagePDF(response, vars, strDateFrom, strDateTo, strDocument, strOrg, strTable,
           strRecord, strFactAcctGroupId, strcAcctSchemaId, strShowClosing, strShowReg,
-          strShowOpening, strPageNo);
+          strShowOpening, strPageNo, strEntryNo, strInitialBalance,
+          "Y".equals(strShowDescription) ? "Y" : "", strShowRegular);
     } else if (vars.commandIn("PREVIOUS_RELATION")) {
       String strInitRecord = vars.getSessionValue("ReportGeneralLedgerJournal.initRecordNumber");
       String strPreviousRecordRange = vars.getSessionValue(PREVIOUS_RANGE);
@@ -247,9 +311,11 @@
   }
 
   private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
-      String strDateFrom, String strDateTo, String strPageNo, String strDocument, String strOrg, String strTable,
+      String strDateFrom, String strDateTo, String strDocument, String strOrg, String strTable,
       String strRecord, String strFactAcctGroupId, String strcAcctSchemaId, String strShowClosing,
-      String strShowReg, String strShowOpening) throws IOException, ServletException {
+      String strShowReg, String strShowOpening, String strPageNo, String strEntryNo,
+      String strInitialBalance, String strShowDescription, String strShowRegular)
+      throws IOException, ServletException {
     String strRecordRange = Utility.getContext(this, vars, "#RecordRange",
         "ReportGeneralLedgerJournal");
     int intRecordRangePredefined = (strRecordRange.equals("") ? 0 : Integer
@@ -273,7 +339,7 @@
         || vars.commandIn("DEFAULT")
         && (!vars.getSessionValue("ReportGeneralLedgerJournal.initRecordNumber").equals("0") || "0"
             .equals(vars.getSessionValue("ReportGeneralLedgerJournal.initRecordNumberOld", "")))) {
-      String strCheck = buildCheck(strShowClosing, strShowReg, strShowOpening);
+      String strCheck = buildCheck(strShowClosing, strShowReg, strShowOpening, strShowRegular);
       String strTreeOrg = TreeData.getTreeOrg(this, vars.getClient());
       String strOrgFamily = getFamily(strTreeOrg, strOrg);
       if (strRecord.equals("")) {
@@ -333,9 +399,8 @@
         vars.setSessionValue(PREVIOUS_RANGE_OLD, vars.getSessionValue(PREVIOUS_RANGE));
         vars.setSessionValue(PREVIOUS_RANGE, String.valueOf(intRecordRangeUsed) + ","
             + vars.getSessionValue(PREVIOUS_RANGE));
-
-        data = ReportGeneralLedgerJournalData.select(this, Utility.getContext(this, vars,
-            "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
+        data = ReportGeneralLedgerJournalData.select(this, "ACCTDESCRIPTION", Utility.getContext(
+            this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
             "#AccessibleOrgTree", "ReportGeneralLedger"), strDateFrom, DateTimeData.nDaysAfter(
             this, strDateTo, "1"), strDocument, strcAcctSchemaId, strOrgFamily, strCheck,
             initRecordNumber, intRecordRangeUsed);
@@ -346,10 +411,10 @@
               this, strDateTo, "1"), strDocument, strcAcctSchemaId, strOrgFamily, strCheck,
               data[0].dateacct, data[0].identifier);
       } else {
-        data = ReportGeneralLedgerJournalData.selectDirect(this, Utility.getContext(this, vars,
-            "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
-            "#AccessibleOrgTree", "ReportGeneralLedger"), strTable, strRecord, initRecordNumber,
-            intRecordRangePredefined);
+        data = ReportGeneralLedgerJournalData.selectDirect(this, "ACCTDESCRIPTION", Utility
+            .getContext(this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(
+            this, vars, "#AccessibleOrgTree", "ReportGeneralLedger"), strTable, strRecord,
+            initRecordNumber, intRecordRangePredefined);
         if (data != null && data.length > 0)
           strPosition = ReportGeneralLedgerJournalData.selectCountDirect(this, Utility.getContext(
               this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
@@ -357,18 +422,18 @@
               data[0].identifier);
       }
     } else if (vars.commandIn("DIRECT")) {
-      data = ReportGeneralLedgerJournalData.selectDirect(this, Utility.getContext(this, vars,
-          "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
-          "#AccessibleOrgTree", "ReportGeneralLedger"), strTable, strRecord);
+      data = ReportGeneralLedgerJournalData.selectDirect(this, "ACCTDESCRIPTION", Utility
+          .getContext(this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this,
+          vars, "#AccessibleOrgTree", "ReportGeneralLedger"), strTable, strRecord);
       if (data != null && data.length > 0)
         strPosition = ReportGeneralLedgerJournalData.selectCountDirect(this, Utility.getContext(
             this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
             "#AccessibleOrgTree", "ReportGeneralLedger"), strTable, strRecord, data[0].dateacct,
             data[0].identifier);
     } else if (vars.commandIn("DIRECT2")) {
-      data = ReportGeneralLedgerJournalData.selectDirect2(this, Utility.getContext(this, vars,
-          "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
-          "#AccessibleOrgTree", "ReportGeneralLedger"), strFactAcctGroupId);
+      data = ReportGeneralLedgerJournalData.selectDirect2(this, "ACCTDESCRIPTION", Utility
+          .getContext(this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this,
+          vars, "#AccessibleOrgTree", "ReportGeneralLedger"), strFactAcctGroupId);
       if (data != null && data.length > 0)
         strPosition = ReportGeneralLedgerJournalData.selectCountDirect2(this, Utility.getContext(
             this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
@@ -466,7 +531,6 @@
     xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("dateTo", strDateTo);
-    xmlDocument.setParameter("PageNo", strPageNo);
     xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("adOrgId", strOrg);
@@ -475,9 +539,16 @@
     xmlDocument.setParameter("paramTable", strTable);
     vars.setSessionValue("ReportGeneralLedgerJournal|Record", strRecord);
     vars.setSessionValue("ReportGeneralLedgerJournal|Table", strTable);
-    xmlDocument.setParameter("showClosing", strShowClosing.equals("") ? "0" : "1");
-    xmlDocument.setParameter("showReg", strShowReg.equals("") ? "0" : "1");
-    xmlDocument.setParameter("showOpening", strShowOpening.equals("") ? "0" : "1");
+    xmlDocument.setParameter("inpPageNo", strPageNo);
+    xmlDocument.setParameter("inpEntryNo", strEntryNo);
+    xmlDocument.setParameter("inpInitialBalance", strInitialBalance);
+    // If none of the "show" flags is active, then regular is checked
+    xmlDocument.setParameter("showRegular", ("".equals(strShowRegular)) ? "N" : strShowRegular);
+    xmlDocument.setParameter("showClosing", ("".equals(strShowClosing)) ? "N" : strShowClosing);
+    xmlDocument.setParameter("showReg", ("".equals(strShowReg)) ? "N" : strShowReg);
+    xmlDocument.setParameter("showOpening", ("".equals(strShowOpening)) ? "N" : strShowOpening);
+    xmlDocument.setParameter("showDescription", ("".equals(strShowDescription)) ? "N"
+        : strShowDescription);
     xmlDocument.setData("structure1", data);
     out.println(xmlDocument.print());
     out.close();
@@ -486,28 +557,32 @@
   private void printPagePDF(HttpServletResponse response, VariablesSecureApp vars,
       String strDateFrom, String strDateTo, String strDocument, String strOrg, String strTable,
       String strRecord, String strFactAcctGroupId, String strcAcctSchemaId, String strShowClosing,
-      String strShowReg, String strShowOpening, String strPageNo) throws IOException,
-      ServletException {
+      String strShowReg, String strShowOpening, String strPageNo, String strEntryNo,
+      String strInitialBalance, String strShowDescription, String strShowRegular)
+      throws IOException, ServletException {
 
     ReportGeneralLedgerJournalData[] data = null;
 
     String strTreeOrg = TreeData.getTreeOrg(this, vars.getClient());
     String strOrgFamily = getFamily(strTreeOrg, strOrg);
     if (!strFactAcctGroupId.equals("")) {
-      data = ReportGeneralLedgerJournalData.selectDirect2(this, Utility.getContext(this, vars,
-          "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
-          "#AccessibleOrgTree", "ReportGeneralLedger"), strFactAcctGroupId);
+      data = ReportGeneralLedgerJournalData.selectDirect2(this,
+          ("".equals(strShowDescription)) ? "ACCTDESCRIPTION" : "DESCRIPTION", Utility.getContext(
+              this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
+              "#AccessibleOrgTree", "ReportGeneralLedger"), strFactAcctGroupId);
 
     } else if (strRecord.equals("")) {
-      String strCheck = buildCheck(strShowClosing, strShowReg, strShowOpening);
-      data = ReportGeneralLedgerJournalData.select(this, Utility.getContext(this, vars,
-          "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
-          "#AccessibleOrgTree", "ReportGeneralLedger"), strDateFrom, DateTimeData.nDaysAfter(this,
-          strDateTo, "1"), strDocument, strcAcctSchemaId, strOrgFamily, strCheck);
+      String strCheck = buildCheck(strShowClosing, strShowReg, strShowOpening, strShowRegular);
+      data = ReportGeneralLedgerJournalData.select(this,
+          ("".equals(strShowDescription)) ? "ACCTDESCRIPTION" : "DESCRIPTION", Utility.getContext(
+              this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
+              "#AccessibleOrgTree", "ReportGeneralLedger"), strDateFrom, DateTimeData.nDaysAfter(
+              this, strDateTo, "1"), strDocument, strcAcctSchemaId, strOrgFamily, strCheck);
     } else
-      data = ReportGeneralLedgerJournalData.selectDirect(this, Utility.getContext(this, vars,
-          "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
-          "#AccessibleOrgTree", "ReportGeneralLedger"), strTable, strRecord);
+      data = ReportGeneralLedgerJournalData.selectDirect(this,
+          ("".equals(strShowDescription)) ? "ACCTDESCRIPTION" : "DESCRIPTION", Utility.getContext(
+              this, vars, "#User_Client", "ReportGeneralLedger"), Utility.getContext(this, vars,
+              "#AccessibleOrgTree", "ReportGeneralLedger"), strTable, strRecord);
 
     String strSubtitle = Utility.messageBD(this, "CompanyName", vars.getLanguage()) + ": "
         + ReportGeneralLedgerJournalData.selectCompany(this, vars.getClient());
@@ -522,6 +597,9 @@
     HashMap<String, Object> parameters = new HashMap<String, Object>();
     parameters.put("Subtitle", strSubtitle);
     parameters.put("PageNo", strPageNo);
+    parameters.put("InitialBalance", new BigDecimal(strInitialBalance));
+    parameters.put("InitialEntryNumber", strEntryNo);
+    parameters.put("TaxID", ReportGeneralLedgerJournalData.selectOrgTaxID(this, strOrg));
     renderJR(vars, response, strReportName, strOutput, parameters, data, null);
   }
 
@@ -536,11 +614,11 @@
      */
   }
 
-  private String buildCheck(String strShowClosing, String strShowReg, String strShowOpening) {
-    if (strShowClosing.equals("") && strShowReg.equals("") && strShowOpening.equals(""))
-      return "'C','N','O','R'";
-    String[] strElements = { strShowClosing.equals("") ? "" : "'C'",
-        strShowReg.equals("") ? "" : "'R'", strShowOpening.equals("") ? "" : "'O'" };
+  private String buildCheck(String strShowClosing, String strShowReg, String strShowOpening,
+      String strShowRegular) {
+    String[] strElements = { strShowClosing.equals("Y") ? "'C'" : "",
+        strShowReg.equals("Y") ? "'R'" : "", strShowOpening.equals("Y") ? "'O'" : "",
+        strShowRegular.equals("Y") ? "'N'" : "" };
     int no = 0;
     String strCheck = "";
     for (int i = 0; i < strElements.length; i++) {
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.jrxml	Fri Mar 04 09:45:50 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.jrxml	Fri Mar 04 12:17:03 2011 +0100
@@ -182,26 +182,36 @@
 	</style>
 
 	<parameter name="Subtitle" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
+	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat">
+		<defaultValueExpression ><![CDATA[new DecimalFormat("#,##0.00",new DecimalFormatSymbols(Locale.US))]]></defaultValueExpression>
+	</parameter>
 	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
-	<parameter name="PageNo" isForPrompting="false" class="java.lang.String"/>
-	<queryString><![CDATA[SELECT IDENTIFIER, DATEACCT, VALUE, NAME, ID, AD_TABLE_ID, DOCBASETYPE, '' AS TOTAL, '' AS DESCRIPTION,
-(CASE AMTACCTDR WHEN 0 THEN NULL ELSE AMTACCTDR END) AS AMTACCTDR, (CASE AMTACCTCR WHEN 0 THEN NULL ELSE AMTACCTCR END) AS AMTACCTCR
-FROM 
-(SELECT F.FACT_ACCT_GROUP_ID AS IDENTIFIER, F.DATEACCT,
-F.ACCTVALUE AS VALUE, F.ACCTDESCRIPTION AS NAME,F.RECORD_ID AS ID, F.AD_TABLE_ID, F.DOCBASETYPE,
-sum(F.AMTACCTDR) AS AMTACCTDR, sum(F.AMTACCTCR) AS AMTACCTCR
-FROM FACT_ACCT F 
-WHERE F.AD_CLIENT_ID IN (1000000)
-  AND F.AD_ORG_ID IN(0,1000000,1000001)
-  AND 1=1
-  AND f.dateacct >= TO_DATE('01/01/2007', 'DD/MM/YYYY')
-  AND f.dateacct < TO_DATE('01/01/2008', 'DD/MM/YYYY')
-GROUP BY F.AD_TABLE_ID, F.DATEACCT, F.ACCTDESCRIPTION, F.ACCTVALUE, F.DOCBASETYPE, F.RECORD_ID, 
-  F.FACT_ACCT_GROUP_ID, F.ACCOUNT_ID,
-  (CASE F.AMTACCTDR WHEN 0 THEN (CASE SIGN(F.AMTACCTCR) WHEN -1 THEN 1 ELSE 2 END) ELSE (CASE SIGN(F.AMTACCTDR) WHEN -1 THEN 3 ELSE 4 END) END)) AA
-ORDER BY DATEACCT, IDENTIFIER]]></queryString>
+	<parameter name="PageNo" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["1"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="InitialBalance" isForPrompting="false" class="java.math.BigDecimal">
+		<defaultValueExpression ><![CDATA[BigDecimal.ZERO]]></defaultValueExpression>
+	</parameter>
+	<parameter name="InitialEntryNumber" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["1"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="TaxID" isForPrompting="false" class="java.lang.String"/>
+	<queryString><![CDATA[SELECT SCHEMA_ID, SCHEMA_NAME, IDENTIFIER, DATEACCT, VALUE, NAME, ID, AD_TABLE_ID, DOCBASETYPE, SEQNO, '' AS TOTAL, '' AS DESCRIPTION,
+      (CASE FACTACCTTYPE WHEN 'O' THEN 1 WHEN 'N' THEN 2 WHEN 'R' THEN 3 ELSE 4 END) AS FACTACCTTYPE2,
+      (CASE AMTACCTDR WHEN 0 THEN NULL ELSE AMTACCTDR END) AS AMTACCTDR, (CASE AMTACCTCR WHEN 0 THEN NULL ELSE AMTACCTCR END) AS AMTACCTCR
+      FROM
+      (SELECT F.C_ACCTSCHEMA_ID AS SCHEMA_ID, SC.NAME AS SCHEMA_NAME, F.FACT_ACCT_GROUP_ID AS IDENTIFIER, F.DATEACCT,
+      F.ACCTVALUE AS VALUE, F.ACCTDESCRIPTION || F.DESCRIPTION AS NAME,F.RECORD_ID AS ID, F.AD_TABLE_ID, F.DOCBASETYPE,
+      sum(F.AMTACCTDR) AS AMTACCTDR, sum(F.AMTACCTCR) AS AMTACCTCR, MIN(SEQNO) AS SEQNO, F.FACTACCTTYPE AS FACTACCTTYPE
+      FROM FACT_ACCT F, C_ACCTSCHEMA SC
+      WHERE f.C_ACCTSCHEMA_ID = SC.C_ACCTSCHEMA_ID
+      GROUP BY f.C_ACCTSCHEMA_ID, SC.NAME, F.AD_TABLE_ID, F.DATEACCT, F.ACCTDESCRIPTION || F.DESCRIPTION, F.ACCTVALUE, F.DOCBASETYPE, F.RECORD_ID, 
+      F.FACT_ACCT_GROUP_ID, F.ACCOUNT_ID,F.FACTACCTTYPE,
+      (CASE F.AMTACCTDR WHEN 0 THEN (CASE SIGN(F.AMTACCTCR) WHEN -1 THEN 1 ELSE 2 END) ELSE (CASE SIGN(F.AMTACCTDR) WHEN -1 THEN 3 ELSE 4 END) END)) AA
+      ORDER BY SCHEMA_NAME, DATEACCT, FACTACCTTYPE2, IDENTIFIER, SEQNO]]></queryString>
 
+	<field name="SCHEMA_ID" class="java.lang.String"/>
+	<field name="SCHEMA_NAME" class="java.lang.String"/>
 	<field name="IDENTIFIER" class="java.lang.String"/>
 	<field name="DATEACCT" class="java.util.Date"/>
 	<field name="VALUE" class="java.lang.String"/>
@@ -209,14 +219,26 @@
 	<field name="ID" class="java.lang.String"/>
 	<field name="AD_TABLE_ID" class="java.lang.String"/>
 	<field name="DOCBASETYPE" class="java.lang.String"/>
+	<field name="SEQNO" class="java.math.BigDecimal"/>
 	<field name="TOTAL" class="java.lang.String"/>
 	<field name="DESCRIPTION" class="java.lang.String"/>
+	<field name="FACTACCTTYPE2" class="java.math.BigDecimal"/>
 	<field name="AMTACCTDR" class="java.math.BigDecimal"/>
 	<field name="AMTACCTCR" class="java.math.BigDecimal"/>
 
 	<variable name="entry" class="java.math.BigDecimal" resetType="Report" calculation="DistinctCount">
 		<variableExpression><![CDATA[$F{IDENTIFIER}]]></variableExpression>
-		<initialValueExpression><![CDATA[new BigDecimal(0)]]></initialValueExpression>
+		<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
+	</variable>
+	<variable name="AcumDebit" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
+		<variableExpression><![CDATA[$F{AMTACCTDR}]]></variableExpression>
+		<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
+	</variable>
+	<variable name="AcumCredit" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
+		<variableExpression><![CDATA[$F{AMTACCTCR}]]></variableExpression>
+		<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
+	</variable>
+	<variable name="NumPage" class="java.lang.Integer" resetType="None" incrementType="Page" calculation="Count">
 	</variable>
 
 		<group  name="JournalEntry" >
@@ -342,7 +364,7 @@
 					<textElement>
 						<font/>
 					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[($V{entry}.add(new BigDecimal(1))!=null)?$V{entry}.add(new BigDecimal(1)): new BigDecimal("0")]]></textFieldExpression>
+				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[($V{entry}!=null)?$V{entry}.add(new BigDecimal($P{InitialEntryNumber})): new BigDecimal("1")]]></textFieldExpression>
 				</textField>
 				<staticText>
 					<reportElement
@@ -393,7 +415,7 @@
 			</band>
 		</background>
 		<title>
-			<band height="48"  isSplitAllowed="true" >
+			<band height="66"  isSplitAllowed="true" >
 				<line direction="TopDown">
 					<reportElement
 						x="0"
@@ -408,7 +430,7 @@
 						style="Report_Subtitle"
 						x="0"
 						y="28"
-						width="535"
+						width="534"
 						height="20"
 						key="textField-4"/>
 					<box leftPadding="5">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -439,6 +461,37 @@
 					</textElement>
 				<text><![CDATA[General Ledger Journal]]></text>
 				</staticText>
+				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Report_Subtitle"
+						x="58"
+						y="48"
+						width="141"
+						height="18"
+						key="textField-20"/>
+					<box leftPadding="5">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Left">
+						<font size="12"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$P{TaxID}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="0"
+						y="48"
+						width="56"
+						height="18"
+						key="textField-21"/>
+					<box></box>
+					<textElement textAlignment="Left">
+						<font size="12"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($P{TaxID}==null||"".equals($P{TaxID}))?"":"Tax ID:"]]></textFieldExpression>
+				</textField>
 			</band>
 		</title>
 		<pageHeader>
@@ -448,7 +501,7 @@
 						style="Report_Footer"
 						x="0"
 						y="0"
-						width="200"
+						width="160"
 						height="16"
 						key="staticText-13">
 							<printWhenExpression><![CDATA[new Boolean($V{JournalEntry_COUNT}.intValue()!=0)]]></printWhenExpression>
@@ -461,8 +514,58 @@
 					<textElement textAlignment="Left">
 						<font/>
 					</textElement>
-				<text><![CDATA[continued...]]></text>
+				<text><![CDATA[... continued]]></text>
 				</staticText>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Band" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="334"
+						y="0"
+						width="100"
+						height="15"
+						key="textField-6"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($V{AcumDebit}!=null)?$P{NUMBERFORMAT}.format($V{AcumDebit}.add($P{InitialBalance})):new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Band" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="434"
+						y="0"
+						width="100"
+						height="15"
+						key="textField-7"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($V{AcumCredit}!=null)?$P{NUMBERFORMAT}.format($V{AcumCredit}.add($P{InitialBalance})):new String(" ")]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement
+						style="Report_Footer"
+						x="209"
+						y="0"
+						width="121"
+						height="14"
+						key="staticText-15"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Carry-Over:]]></text>
+				</staticText>
+				<line direction="TopDown">
+					<reportElement
+						style="Report_Footer"
+						x="2"
+						y="14"
+						width="530"
+						height="0"
+						key="line-2"/>
+					<graphicElement stretchType="NoStretch"/>
+				</line>
 			</band>
 		</pageHeader>
 		<columnHeader>
@@ -488,7 +591,7 @@
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression>
 				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						x="335"
 						y="0"
@@ -546,51 +649,13 @@
 			</band>
 		</columnFooter>
 		<pageFooter>
-			<band height="20"  isSplitAllowed="true" >
-				<staticText>
-					<reportElement
-						style="Report_Footer"
-						x="200"
-						y="0"
-						width="200"
-						height="16"
-						key="staticText-12">
-							<printWhenExpression><![CDATA[new Boolean($V{JournalEntry_COUNT}.intValue()==0)]]></printWhenExpression>
-						</reportElement>
-					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[please turn over]]></text>
-				</staticText>
-				<staticText>
-					<reportElement
-						style="Report_Footer"
-						x="419"
-						y="0"
-						width="57"
-						height="16"
-						key="staticText-14"/>
-					<box leftPadding="5" topPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Bottom">
-						<font fontName="Bitstream Vera Sans" size="10"/>
-					</textElement>
-				<text><![CDATA[Page]]></text>
-				</staticText>
+			<band height="33"  isSplitAllowed="true" >
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="476"
-						y="0"
-						width="58"
+						x="393"
+						y="17"
+						width="141"
 						height="16"
 						key="textField-5"/>
 					<box leftPadding="5" topPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -601,10 +666,145 @@
 					<textElement textAlignment="Right" verticalAlignment="Bottom">
 						<font fontName="Bitstream Vera Sans" size="10"/>
 					</textElement>
-				<textFieldExpression   class="java.lang.Integer"><![CDATA[new java.lang.Integer(($V{PAGE_NUMBER}.intValue()) +(Integer.parseInt($P{PageNo}))-(1) )]]></textFieldExpression>
+				<textFieldExpression   class="java.lang.String"><![CDATA["Page "+new java.lang.Integer(($V{PAGE_NUMBER}.intValue()) +(Integer.parseInt($P{PageNo}))-(1)).toString()+"."]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Page" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="334"
+						y="2"
+						width="100"
+						height="15"
+						key="textField"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($V{AcumDebit}!=null)?$P{NUMBERFORMAT}.format($V{AcumDebit}.add($P{InitialBalance})):new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Page" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="434"
+						y="2"
+						width="100"
+						height="15"
+						key="textField-8"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($V{AcumCredit}!=null)?$P{NUMBERFORMAT}.format($V{AcumCredit}.add($P{InitialBalance})):new String(" ")]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement
+						style="Report_Footer"
+						x="213"
+						y="2"
+						width="121"
+						height="14"
+						key="staticText-16"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Carry Forward:]]></text>
+				</staticText>
+				<line direction="TopDown">
+					<reportElement
+						style="Report_Footer"
+						x="2"
+						y="1"
+						width="530"
+						height="0"
+						key="line-3"/>
+					<graphicElement stretchType="NoStretch"/>
+				</line>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Group" evaluationGroup="JournalEntry"  hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="160"
+						y="17"
+						width="216"
+						height="15"
+						key="textField-16"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($V{JournalEntry_COUNT}.compareTo($V{COLUMN_COUNT})>=0)?"continue ...":""]]></textFieldExpression>
 				</textField>
 			</band>
 		</pageFooter>
+		<lastPageFooter>
+			<band height="33"  isSplitAllowed="true" >
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Report_Footer"
+						x="393"
+						y="17"
+						width="140"
+						height="16"
+						key="textField-17"/>
+					<box leftPadding="5" topPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Bottom">
+						<font fontName="Bitstream Vera Sans" size="10"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA["Page "+new java.lang.Integer(($V{PAGE_NUMBER}.intValue()) +(Integer.parseInt($P{PageNo}))-(1)).toString()+"."]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Page" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="333"
+						y="2"
+						width="100"
+						height="15"
+						key="textField-18"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($V{AcumDebit}!=null)?$P{NUMBERFORMAT}.format($V{AcumDebit}.add($P{InitialBalance})):new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Page" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						x="433"
+						y="2"
+						width="100"
+						height="15"
+						key="textField-19"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($V{AcumCredit}!=null)?$P{NUMBERFORMAT}.format($V{AcumCredit}.add($P{InitialBalance})):new String(" ")]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement
+						style="Report_Footer"
+						x="212"
+						y="2"
+						width="121"
+						height="14"
+						key="staticText-17"/>
+					<box></box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Carry Forward:]]></text>
+				</staticText>
+				<line direction="TopDown">
+					<reportElement
+						style="Report_Footer"
+						x="1"
+						y="1"
+						width="530"
+						height="0"
+						key="line-4"/>
+					<graphicElement stretchType="NoStretch"/>
+				</line>
+			</band>
+		</lastPageFooter>
 		<summary>
 			<band height="0"  isSplitAllowed="true" >
 			</band>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml	Fri Mar 04 09:45:50 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml	Fri Mar 04 12:17:03 2011 +0100
@@ -5,15 +5,15 @@
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
 * Version 1.1  with a permitted attribution clause; you may not  use this
 * file except in compliance with the License. You  may  obtain  a copy of
-* the License at http://www.openbravo.com/legal/license.html 
+* the License at http://www.openbravo.com/legal/license.html
 * Software distributed under the License  is  distributed  on  an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific  language  governing  rights  and  limitations
-* under the License. 
-* The Original Code is Openbravo ERP. 
-* The Initial Developer of the Original Code is Openbravo SLU 
-* All portions are Copyright (C) 2001-2006 Openbravo SLU 
-* All Rights Reserved. 
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SLU
+* All portions are Copyright (C) 2001-2011 Openbravo SLU
+* All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************
 -->
@@ -44,14 +44,16 @@
   <PARAMETER id="inpRecord" name="paramRecord" attribute="value" default=""/>
   <PARAMETER id="inpTable" name="paramTable" attribute="value" default=""/>
   <PARAMETER id="paramC_ACCTSCHEMA_ID" name="cAcctschemaId"/>
-  <PARAMETER id="paramPageNo" name="PageNo" attribute="value"/>
+  <PARAMETER id="paramPageNo" name="inpPageNo" attribute="value" default="1"/>
+  <PARAMETER id="paramEntryNo" name="inpEntryNo" attribute="value" default="1"/>
+  <PARAMETER id="paramInitialBalance" name="inpInitialBalance" attribute="value" default="0"/>
 
-  <PARAMETER id="parameterShowClosing" name="constantShowClosing" default="1"/>
-  <PARAMETER id="paramShowClosing" name="showClosing" boolean="checked" withId="parameterShowClosing" default="0"/>
-  <PARAMETER id="parameterShowReg" name="constantShowReg" default="1"/>
-  <PARAMETER id="paramShowReg" name="showReg" boolean="checked" withId="parameterShowReg" default="0"/>
-  <PARAMETER id="parameterShowOpening" name="constantShowOpening" default="1"/>
-  <PARAMETER id="paramShowOpening" name="showOpening" boolean="checked" withId="parameterShowOpening" default="0"/>
+  <PARAMETER id="fieldCheck" name="check" default="Y"/>
+  <PARAMETER id="paramShowRegular" name="showRegular" boolean="checked" withId="fieldCheck"/>
+  <PARAMETER id="paramShowClosing" name="showClosing" boolean="checked" withId="fieldCheck"/>
+  <PARAMETER id="paramShowReg" name="showReg" boolean="checked" withId="fieldCheck"/>
+  <PARAMETER id="paramShowOpening" name="showOpening" boolean="checked" withId="fieldCheck"/>
+  <PARAMETER id="paramShowDescription" name="showDescription" boolean="checked" withId="fieldCheck"/>
 
   <PARAMETER id="jsDisablePreviousNext" name="jsDisablePreviousNext" default=""/>
 
@@ -85,6 +87,7 @@
     <FIELD id="fieldId" attribute="onclick" replace="zz">docbasetype</FIELD>
     <FUNCTION id="functionOrderJournal" name="ORDER" attribute="value">identifier</FUNCTION>
     <FUNCTION id="functionCalculateOrderJournal" name="ADD" arg1="functionOrderJournal" arg2="paramGroupId" format="integerInform"/>
+    <FUNCTION id="functionCalculateOrderJournalWithInitial" name="ADD" arg1="functionCalculateOrderJournal" arg2="paramEntryNo" format="integerInform"/>
     <SECTION id="sectionSchema" field="schemaName"/>    	
     <SECTION id="sectionDateAcct" field="dateacct"/>
     <SECTION id="sectionJournal" field="identifier"/>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql	Fri Mar 04 09:45:50 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql	Fri Mar 04 12:17:03 2011 +0100
@@ -5,15 +5,15 @@
  * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
  * Version 1.1  with a permitted attribution clause; you may not  use this
  * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
+ * the License at http://www.openbravo.com/legal/license.html
  * Software distributed under the License  is  distributed  on  an "AS IS"
  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  * License for the specific  language  governing  rights  and  limitations
- * under the License. 
- * The Original Code is Openbravo ERP. 
- * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2009 Openbravo SLU 
- * All Rights Reserved. 
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2001-2011 Openbravo SLU
+ * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
 -->
@@ -31,7 +31,7 @@
       SELECT SCHEMA_ID, SCHEMA_NAME, IDENTIFIER, DATEACCT, VALUE, NAME, ID, AD_TABLE_ID, DOCBASETYPE, SEQNO, '' AS TOTAL, '' AS DESCRIPTION,
       (CASE FACTACCTTYPE WHEN 'O' THEN 1 WHEN 'N' THEN 2 WHEN 'R' THEN 3 ELSE 4 END) AS FACTACCTTYPE2,
       (CASE AMTACCTDR WHEN 0 THEN NULL ELSE AMTACCTDR END) AS AMTACCTDR, (CASE AMTACCTCR WHEN 0 THEN NULL ELSE AMTACCTCR END) AS AMTACCTCR, 
-      '' AS GROUPEDLINES
+      '' AS GROUPEDLINES, '' AS TAXID
       FROM 
       (SELECT F.C_ACCTSCHEMA_ID AS SCHEMA_ID, SC.NAME AS SCHEMA_NAME, F.FACT_ACCT_GROUP_ID AS IDENTIFIER, F.DATEACCT,
       F.ACCTVALUE AS VALUE, F.ACCTDESCRIPTION AS NAME,F.RECORD_ID AS ID, F.AD_TABLE_ID, F.DOCBASETYPE,
@@ -49,6 +49,7 @@
       ORDER BY SCHEMA_NAME, DATEACCT, FACTACCTTYPE2, IDENTIFIER, SEQNO
       ]]></Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="descriptionType" type="replace" optional="true" after="F.ACCTVALUE AS VALUE, F." text="ACCTDESCRIPTION"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="WHERE F.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="adUserOrg" type="replace" optional="true" after="AND F.AD_ORG_ID IN(" text="'1'"/>
     <Parameter name="parDateFrom" optional="true" after="AND 1=1"><![CDATA[ AND f.dateacct >= TO_DATE(?)]]></Parameter>
@@ -57,6 +58,7 @@
     <Parameter name="acctschema" optional="true" after="AND 1=1"><![CDATA[ AND f.C_ACCTSCHEMA_ID = ?]]></Parameter>
     <Parameter name="orgFamily" type="replace" optional="true" after="AND f.AD_ORG_ID IN(" text="'2'"/>
     <Parameter name="checks" type="replace" optional="true" after="AND F.FactAcctType IN (" text="'C','N','O','R'"/>
+    <Parameter name="descriptionType" type="replace" optional="true" after="GROUP BY f.C_ACCTSCHEMA_ID, SC.NAME, F.AD_TABLE_ID, F.DATEACCT, F." text="ACCTDESCRIPTION"/>
     <!--Parameter name="closing" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'C'"/>
     <Parameter name="regularization" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'R'"/>
     <Parameter name="opening" optional="true" type="none" after="2=2" text=" AND F.FactAcctType = 'O'"/-->
@@ -166,12 +168,14 @@
       ORDER BY SCHEMA_NAME, DATEACCT, FACTACCTTYPE2, IDENTIFIER, SEQNO
       ]]></Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="descriptionType" type="replace" optional="true" after="F.ACCTVALUE AS VALUE, F." text="ACCTDESCRIPTION"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="WHERE F.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="adUserOrg" type="replace" optional="true" after="AND F.AD_ORG_ID IN(" text="'1'"/>
     <Parameter name="table" optional="true" after="AND 1=1"><![CDATA[ AND f.ad_table_Id = ?]]></Parameter>
     <Parameter name="record" optional="true" after="AND 1=1"><![CDATA[ AND f.record_Id = ?]]></Parameter>   
     <Parameter name="table" optional="true" after="AND 1=1"><![CDATA[ AND f.ad_table_ID = ?]]></Parameter>
     <Parameter name="record" optional="true" after="AND 1=1"><![CDATA[ AND f.record_ID = ?]]></Parameter>
+    <Parameter name="descriptionType" type="replace" optional="true" after="GROUP BY f.C_ACCTSCHEMA_ID, SC.NAME, F.AD_TABLE_ID, F.DATEACCT, F." text="ACCTDESCRIPTION"/>
   </SqlMethod>
   <SqlMethod name="selectCountDirect" type="preparedStatement" return="string" default="0">
     <SqlMethodComment></SqlMethodComment>
@@ -223,9 +227,11 @@
       ORDER BY SCHEMA_NAME, DATEACCT, FACTACCTTYPE2, IDENTIFIER, SEQNO
       ]]></Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="descriptionType" type="replace" optional="true" after="F.ACCTVALUE AS VALUE, F." text="ACCTDESCRIPTION"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="WHERE F.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="adUserOrg" type="replace" optional="true" after="AND F.AD_ORG_ID IN(" text="'1'"/>
     <Parameter name="factAcctGroupId"/>
+    <Parameter name="descriptionType" type="replace" optional="true" after="GROUP BY f.C_ACCTSCHEMA_ID, SC.NAME, F.AD_TABLE_ID, F.DATEACCT, F." text="ACCTDESCRIPTION"/>
   </SqlMethod>
   <SqlMethod name="selectCountDirect2" type="preparedStatement" return="string" default="0">
     <SqlMethodComment></SqlMethodComment>
@@ -265,4 +271,14 @@
       ]]></Sql>
     <Parameter name="client"/>
   </SqlMethod>
+  <SqlMethod name="selectOrgTaxID" type="preparedStatement" return="string">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+    <![CDATA[
+        SELECT MIN(I.TAXID)
+        FROM AD_ORGINFO I
+        WHERE I.AD_ORG_ID = ?
+      ]]></Sql>
+    <Parameter name="org"/>
+  </SqlMethod>
 </SqlClass>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html	Fri Mar 04 09:45:50 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.html	Fri Mar 04 12:17:03 2011 +0100
@@ -943,7 +943,7 @@
                       </tr>
                     </div>
                     <tr class="DataGrid_Body_Row"> 
-                      <th colspan="2" class="DataGrid_Header_Cell">ADD AND KEEP GOING...</th>
+                      <th colspan="2" class="DataGrid_Header_Cell">CARRY FORWARD...</th>
                       <th width="105" id="fieldTotalSaldoInicial" class="DataGrid_Header_Cell_Amount">xx14500.34</th>
                       <th width="105" id="fieldTotalAmtacctdr"  class="DataGrid_Header_Cell_Amount">xx14500.34</th>
                       <th width="105" id="fieldTotalAmtacctcr"  class="DataGrid_Header_Cell_Amount">xx14500.34</th>