Fixes Issue 24665 24252. Add option to show Vendor data in
authorDavid Miguelez <david.miguelez@openbravo.com>
Fri, 31 Jan 2014 14:17:23 +0100
changeset 21901 94196ffda584
parent 21900 31e52bc42383
child 21902 dd19b027b406
Fixes Issue 24665 24252. Add option to show Vendor data in
Cusotmer Statement Report.
src-db/database/sourcedata/AD_PROCESS_PARA.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src/org/openbravo/erpCommon/ReportsUtility.java
src/org/openbravo/erpCommon/ad_reports/CustomerStatement.jrxml
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Fri Jan 31 13:43:17 2014 +0100
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Fri Jan 31 14:17:23 2014 +0100
@@ -4052,7 +4052,7 @@
 <!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <NAME><![CDATA[Output type]]></NAME>
 <!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <HELP><![CDATA[Defines the output format type from the available list.]]></HELP>
 <!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
-<!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <SEQNO><![CDATA[70]]></SEQNO>
 <!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
 <!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <AD_REFERENCE_VALUE_ID><![CDATA[800104]]></AD_REFERENCE_VALUE_ID>
 <!--28C2574FC1AD4980810D4F07FDC7FCD4-->  <COLUMNNAME><![CDATA[outputType]]></COLUMNNAME>
@@ -4161,6 +4161,27 @@
 <!--3AC22B0F80264CF09D52044F198C75BD-->  <AD_ELEMENT_ID><![CDATA[193]]></AD_ELEMENT_ID>
 <!--3AC22B0F80264CF09D52044F198C75BD--></AD_PROCESS_PARA>
 
+<!--58D427D8194C41E29F6B377B115537D7--><AD_PROCESS_PARA>
+<!--58D427D8194C41E29F6B377B115537D7-->  <AD_PROCESS_PARA_ID><![CDATA[58D427D8194C41E29F6B377B115537D7]]></AD_PROCESS_PARA_ID>
+<!--58D427D8194C41E29F6B377B115537D7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--58D427D8194C41E29F6B377B115537D7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--58D427D8194C41E29F6B377B115537D7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--58D427D8194C41E29F6B377B115537D7-->  <NAME><![CDATA[Report Type]]></NAME>
+<!--58D427D8194C41E29F6B377B115537D7-->  <DESCRIPTION><![CDATA[Indicates whether the report is "Point in time" (needs to calculate an opening balance if it does not exist) or a "Periodic" report (in this case that calculation is not needed)]]></DESCRIPTION>
+<!--58D427D8194C41E29F6B377B115537D7-->  <HELP><![CDATA[Indicates whether the report is a "Point in Time" or a "Periodic" report.<br>A Point in Time report is obtained as of a given date, taking into account the whole historical financial movements; an example of point in time report is the Balance Sheet.<br>A periodic report is executed for a date range and it does not carry forward the balance of accounting movements previous to the range; an example of periodic report is the Income Statement.]]></HELP>
+<!--58D427D8194C41E29F6B377B115537D7-->  <AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
+<!--58D427D8194C41E29F6B377B115537D7-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--58D427D8194C41E29F6B377B115537D7-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--58D427D8194C41E29F6B377B115537D7-->  <AD_REFERENCE_VALUE_ID><![CDATA[B82C3C28E51F4AA6B87D98E7ABBF92F0]]></AD_REFERENCE_VALUE_ID>
+<!--58D427D8194C41E29F6B377B115537D7-->  <COLUMNNAME><![CDATA[reportType]]></COLUMNNAME>
+<!--58D427D8194C41E29F6B377B115537D7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--58D427D8194C41E29F6B377B115537D7-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--58D427D8194C41E29F6B377B115537D7-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--58D427D8194C41E29F6B377B115537D7-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--58D427D8194C41E29F6B377B115537D7-->  <DEFAULTVALUE><![CDATA[cus]]></DEFAULTVALUE>
+<!--58D427D8194C41E29F6B377B115537D7-->  <AD_ELEMENT_ID><![CDATA[6BDD5E11747C51DAE040007F01013550]]></AD_ELEMENT_ID>
+<!--58D427D8194C41E29F6B377B115537D7--></AD_PROCESS_PARA>
+
 <!--5DB8F1E894624135AA82694065D5B8FE--><AD_PROCESS_PARA>
 <!--5DB8F1E894624135AA82694065D5B8FE-->  <AD_PROCESS_PARA_ID><![CDATA[5DB8F1E894624135AA82694065D5B8FE]]></AD_PROCESS_PARA_ID>
 <!--5DB8F1E894624135AA82694065D5B8FE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -4210,7 +4231,7 @@
 <!--6928C4E56A7F4760839813474B8B3451-->  <DESCRIPTION><![CDATA[A parameter stating the starting time range related to a specified request.]]></DESCRIPTION>
 <!--6928C4E56A7F4760839813474B8B3451-->  <HELP><![CDATA[The Date From indicates the starting date of a range.]]></HELP>
 <!--6928C4E56A7F4760839813474B8B3451-->  <AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
-<!--6928C4E56A7F4760839813474B8B3451-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--6928C4E56A7F4760839813474B8B3451-->  <SEQNO><![CDATA[50]]></SEQNO>
 <!--6928C4E56A7F4760839813474B8B3451-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
 <!--6928C4E56A7F4760839813474B8B3451-->  <COLUMNNAME><![CDATA[DateFrom]]></COLUMNNAME>
 <!--6928C4E56A7F4760839813474B8B3451-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
@@ -4327,7 +4348,7 @@
 <!--7CD372E32A3840FDBF8B9023A944ACB3-->  <DESCRIPTION><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></DESCRIPTION>
 <!--7CD372E32A3840FDBF8B9023A944ACB3-->  <HELP><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></HELP>
 <!--7CD372E32A3840FDBF8B9023A944ACB3-->  <AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
-<!--7CD372E32A3840FDBF8B9023A944ACB3-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--7CD372E32A3840FDBF8B9023A944ACB3-->  <SEQNO><![CDATA[30]]></SEQNO>
 <!--7CD372E32A3840FDBF8B9023A944ACB3-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
 <!--7CD372E32A3840FDBF8B9023A944ACB3-->  <COLUMNNAME><![CDATA[C_AcctSchema_ID]]></COLUMNNAME>
 <!--7CD372E32A3840FDBF8B9023A944ACB3-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
@@ -4347,7 +4368,7 @@
 <!--7DB2B69C38D34885B71030245668674E-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
 <!--7DB2B69C38D34885B71030245668674E-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
 <!--7DB2B69C38D34885B71030245668674E-->  <AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
-<!--7DB2B69C38D34885B71030245668674E-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--7DB2B69C38D34885B71030245668674E-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--7DB2B69C38D34885B71030245668674E-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
 <!--7DB2B69C38D34885B71030245668674E-->  <AD_VAL_RULE_ID><![CDATA[0C754881EAD94243A161111916E9B9C6]]></AD_VAL_RULE_ID>
 <!--7DB2B69C38D34885B71030245668674E-->  <COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
@@ -4368,8 +4389,9 @@
 <!--7F06BC5C7987471FB57499C3CF647788-->  <DESCRIPTION><![CDATA[Anyone who takes part in daily business operations by acting as a customer, employee, etc.]]></DESCRIPTION>
 <!--7F06BC5C7987471FB57499C3CF647788-->  <HELP><![CDATA[A Business Partner is anyone with whom you transact.  This can include a customer, vendor, employee or any combination of these.]]></HELP>
 <!--7F06BC5C7987471FB57499C3CF647788-->  <AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
-<!--7F06BC5C7987471FB57499C3CF647788-->  <SEQNO><![CDATA[30]]></SEQNO>
-<!--7F06BC5C7987471FB57499C3CF647788-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--7F06BC5C7987471FB57499C3CF647788-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--7F06BC5C7987471FB57499C3CF647788-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--7F06BC5C7987471FB57499C3CF647788-->  <AD_REFERENCE_VALUE_ID><![CDATA[800057]]></AD_REFERENCE_VALUE_ID>
 <!--7F06BC5C7987471FB57499C3CF647788-->  <AD_VAL_RULE_ID><![CDATA[95548E7077124EB7A83F85A000CB2350]]></AD_VAL_RULE_ID>
 <!--7F06BC5C7987471FB57499C3CF647788-->  <COLUMNNAME><![CDATA[C_BPartner_ID]]></COLUMNNAME>
 <!--7F06BC5C7987471FB57499C3CF647788-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
@@ -4429,7 +4451,7 @@
 <!--8EB04CCC31FE41A3898688438944CBEE-->  <DESCRIPTION><![CDATA[A parameter stating the ending time range related for a specified request, query, etc.]]></DESCRIPTION>
 <!--8EB04CCC31FE41A3898688438944CBEE-->  <HELP><![CDATA[The Date To indicates the end date of a range (inclusive)]]></HELP>
 <!--8EB04CCC31FE41A3898688438944CBEE-->  <AD_PROCESS_ID><![CDATA[D234AE084F7040DCB66E281A4237FF99]]></AD_PROCESS_ID>
-<!--8EB04CCC31FE41A3898688438944CBEE-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--8EB04CCC31FE41A3898688438944CBEE-->  <SEQNO><![CDATA[60]]></SEQNO>
 <!--8EB04CCC31FE41A3898688438944CBEE-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
 <!--8EB04CCC31FE41A3898688438944CBEE-->  <COLUMNNAME><![CDATA[DateTo]]></COLUMNNAME>
 <!--8EB04CCC31FE41A3898688438944CBEE-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Fri Jan 31 13:43:17 2014 +0100
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Fri Jan 31 14:17:23 2014 +0100
@@ -5738,6 +5738,18 @@
 <!--B7E66794F4BA46C3ADB2CBD013252AA6-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--B7E66794F4BA46C3ADB2CBD013252AA6--></AD_REFERENCE>
 
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0--><AD_REFERENCE>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <AD_REFERENCE_ID><![CDATA[B82C3C28E51F4AA6B87D98E7ABBF92F0]]></AD_REFERENCE_ID>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <NAME><![CDATA[Customer Statement Report Type]]></NAME>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--B82C3C28E51F4AA6B87D98E7ABBF92F0--></AD_REFERENCE>
+
 <!--B88DB8C2B8C441DF8DCF3CF3C8565201--><AD_REFERENCE>
 <!--B88DB8C2B8C441DF8DCF3CF3C8565201-->  <AD_REFERENCE_ID><![CDATA[B88DB8C2B8C441DF8DCF3CF3C8565201]]></AD_REFERENCE_ID>
 <!--B88DB8C2B8C441DF8DCF3CF3C8565201-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Fri Jan 31 13:43:17 2014 +0100
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Fri Jan 31 14:17:23 2014 +0100
@@ -8334,6 +8334,17 @@
 <!--19CE2DD159684FCF84E1B1963AF59A14-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--19CE2DD159684FCF84E1B1963AF59A14--></AD_REF_LIST>
 
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27--><AD_REF_LIST>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <AD_REF_LIST_ID><![CDATA[19F02DDB8CBF468FA129CA1DCEDFFE27]]></AD_REF_LIST_ID>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <VALUE><![CDATA[ven]]></VALUE>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <NAME><![CDATA[Vendor]]></NAME>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <AD_REFERENCE_ID><![CDATA[B82C3C28E51F4AA6B87D98E7ABBF92F0]]></AD_REFERENCE_ID>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--19F02DDB8CBF468FA129CA1DCEDFFE27--></AD_REF_LIST>
+
 <!--1A22A021C5A54D36BC909FFF02CBB00F--><AD_REF_LIST>
 <!--1A22A021C5A54D36BC909FFF02CBB00F-->  <AD_REF_LIST_ID><![CDATA[1A22A021C5A54D36BC909FFF02CBB00F]]></AD_REF_LIST_ID>
 <!--1A22A021C5A54D36BC909FFF02CBB00F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -8783,6 +8794,17 @@
 <!--3ABF54A29AF94B35AB205894C5ED319C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3ABF54A29AF94B35AB205894C5ED319C--></AD_REF_LIST>
 
+<!--3AC2F274B0E343F4A8DCDB73F4D64850--><AD_REF_LIST>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <AD_REF_LIST_ID><![CDATA[3AC2F274B0E343F4A8DCDB73F4D64850]]></AD_REF_LIST_ID>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <VALUE><![CDATA[cus]]></VALUE>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <NAME><![CDATA[Customer]]></NAME>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <AD_REFERENCE_ID><![CDATA[B82C3C28E51F4AA6B87D98E7ABBF92F0]]></AD_REFERENCE_ID>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3AC2F274B0E343F4A8DCDB73F4D64850--></AD_REF_LIST>
+
 <!--3AF602382D5B4AE398974B7149962AC0--><AD_REF_LIST>
 <!--3AF602382D5B4AE398974B7149962AC0-->  <AD_REF_LIST_ID><![CDATA[3AF602382D5B4AE398974B7149962AC0]]></AD_REF_LIST_ID>
 <!--3AF602382D5B4AE398974B7149962AC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -11000,6 +11022,17 @@
 <!--B1612F3E1B95457C9910C20BDF3AB835-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--B1612F3E1B95457C9910C20BDF3AB835--></AD_REF_LIST>
 
+<!--B1ACC00A1A7541038B56B16A566C8448--><AD_REF_LIST>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <AD_REF_LIST_ID><![CDATA[B1ACC00A1A7541038B56B16A566C8448]]></AD_REF_LIST_ID>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <VALUE><![CDATA[both]]></VALUE>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <NAME><![CDATA[Customer/Vendor]]></NAME>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <AD_REFERENCE_ID><![CDATA[B82C3C28E51F4AA6B87D98E7ABBF92F0]]></AD_REFERENCE_ID>
+<!--B1ACC00A1A7541038B56B16A566C8448-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B1ACC00A1A7541038B56B16A566C8448--></AD_REF_LIST>
+
 <!--B2B38218AB484E3D99FB07A7AC71F894--><AD_REF_LIST>
 <!--B2B38218AB484E3D99FB07A7AC71F894-->  <AD_REF_LIST_ID><![CDATA[B2B38218AB484E3D99FB07A7AC71F894]]></AD_REF_LIST_ID>
 <!--B2B38218AB484E3D99FB07A7AC71F894-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Fri Jan 31 13:43:17 2014 +0100
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Fri Jan 31 14:17:23 2014 +0100
@@ -12769,6 +12769,17 @@
 <!--06E61B009FC911DDB11B0FCE2FEEA29F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--06E61B009FC911DDB11B0FCE2FEEA29F--></AD_TEXTINTERFACES>
 
+<!--076247A1AD11457A8C4755CC2BE04D6F--><AD_TEXTINTERFACES>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <AD_TEXTINTERFACES_ID><![CDATA[076247A1AD11457A8C4755CC2BE04D6F]]></AD_TEXTINTERFACES_ID>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <TEXT><![CDATA[Business Partner Balance :]]></TEXT>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/CustomerStatement.jrxml]]></FILENAME>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--076247A1AD11457A8C4755CC2BE04D6F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--076247A1AD11457A8C4755CC2BE04D6F--></AD_TEXTINTERFACES>
+
 <!--076A33F965BE426DB4304151ACE806A5--><AD_TEXTINTERFACES>
 <!--076A33F965BE426DB4304151ACE806A5-->  <AD_TEXTINTERFACES_ID><![CDATA[076A33F965BE426DB4304151ACE806A5]]></AD_TEXTINTERFACES_ID>
 <!--076A33F965BE426DB4304151ACE806A5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -12780,6 +12791,17 @@
 <!--076A33F965BE426DB4304151ACE806A5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--076A33F965BE426DB4304151ACE806A5--></AD_TEXTINTERFACES>
 
+<!--0798EE6D8AAA4E4FB04326ED022547DE--><AD_TEXTINTERFACES>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <AD_TEXTINTERFACES_ID><![CDATA[0798EE6D8AAA4E4FB04326ED022547DE]]></AD_TEXTINTERFACES_ID>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <TEXT><![CDATA[Business Partner Initial Balance :]]></TEXT>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/CustomerStatement.jrxml]]></FILENAME>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--0798EE6D8AAA4E4FB04326ED022547DE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0798EE6D8AAA4E4FB04326ED022547DE--></AD_TEXTINTERFACES>
+
 <!--0809C264871442C18AD9A3C4E744AC9B--><AD_TEXTINTERFACES>
 <!--0809C264871442C18AD9A3C4E744AC9B-->  <AD_TEXTINTERFACES_ID><![CDATA[0809C264871442C18AD9A3C4E744AC9B]]></AD_TEXTINTERFACES_ID>
 <!--0809C264871442C18AD9A3C4E744AC9B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -13879,6 +13901,17 @@
 <!--43BECCD4373E45D5863610BAB294486E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--43BECCD4373E45D5863610BAB294486E--></AD_TEXTINTERFACES>
 
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF--><AD_TEXTINTERFACES>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <AD_TEXTINTERFACES_ID><![CDATA[43EFC522A0CF4BAE8FD411F31DE21FEF]]></AD_TEXTINTERFACES_ID>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <TEXT><![CDATA[Vendor Statement]]></TEXT>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/CustomerStatement.jrxml]]></FILENAME>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--43EFC522A0CF4BAE8FD411F31DE21FEF--></AD_TEXTINTERFACES>
+
 <!--443A11FCA2AF4096AB2DF283C91A4EB4--><AD_TEXTINTERFACES>
 <!--443A11FCA2AF4096AB2DF283C91A4EB4-->  <AD_TEXTINTERFACES_ID><![CDATA[443A11FCA2AF4096AB2DF283C91A4EB4]]></AD_TEXTINTERFACES_ID>
 <!--443A11FCA2AF4096AB2DF283C91A4EB4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/ReportsUtility.java	Fri Jan 31 13:43:17 2014 +0100
+++ b/src/org/openbravo/erpCommon/ReportsUtility.java	Fri Jan 31 14:17:23 2014 +0100
@@ -33,6 +33,7 @@
 import org.openbravo.erpCommon.utility.OBDateUtils;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.businesspartner.CustomerAccounts;
+import org.openbravo.model.common.businesspartner.VendorAccounts;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.financialmgmt.accounting.AccountingFact;
 import org.openbravo.model.financialmgmt.accounting.coa.AcctSchema;
@@ -42,6 +43,11 @@
 
   public static BigDecimal getBeginningBalance(String orgId, String acctSchemaId,
       String bpartnerId, String dateFrom) {
+    return getBeginningBalance(orgId, acctSchemaId, bpartnerId, dateFrom, true);
+  }
+
+  public static BigDecimal getBeginningBalance(String orgId, String acctSchemaId,
+      String bpartnerId, String dateFrom, boolean isCustomer) {
     if (dateFrom == null || "".equals(dateFrom)) {
       return BigDecimal.ZERO;
     }
@@ -56,8 +62,13 @@
     } catch (ParseException pe) {
       // do nothing
     }
-    obc.add(Restrictions.in(AccountingFact.PROPERTY_ACCOUNT,
-        getValidAccountsList(acctSchemaId, bpartnerId)));
+    if (isCustomer) {
+      obc.add(Restrictions.in(AccountingFact.PROPERTY_ACCOUNT,
+          getValidAccountsList(acctSchemaId, bpartnerId)));
+    } else {
+      obc.add(Restrictions.in(AccountingFact.PROPERTY_ACCOUNT,
+          getValidAccountsListVendor(acctSchemaId, bpartnerId)));
+    }
     obc.setFilterOnReadableOrganization(false);
 
     ProjectionList projections = Projections.projectionList();
@@ -97,6 +108,27 @@
     return result;
   }
 
+  private static List<ElementValue> getValidAccountsListVendor(String acctSchemaId,
+      String bpartnerId) {
+    List<ElementValue> result = new ArrayList<ElementValue>();
+    OBCriteria<VendorAccounts> obc = OBDal.getInstance().createCriteria(VendorAccounts.class);
+    obc.add(Restrictions.eq(VendorAccounts.PROPERTY_BUSINESSPARTNER,
+        OBDal.getInstance().get(BusinessPartner.class, bpartnerId)));
+    obc.add(Restrictions.eq(VendorAccounts.PROPERTY_ACCOUNTINGSCHEMA,
+        OBDal.getInstance().get(AcctSchema.class, acctSchemaId)));
+    obc.setFilterOnReadableOrganization(false);
+    obc.setFilterOnActive(false);
+    for (VendorAccounts va : obc.list()) {
+      if (va.getVendorLiability() != null) {
+        result.add(va.getVendorLiability().getAccount());
+      }
+      if (va.getVendorPrepayment() != null) {
+        result.add(va.getVendorPrepayment().getAccount());
+      }
+    }
+    return result;
+  }
+
   private static List<Organization> getOrgList(String orgId) {
     List<Organization> orgList = new ArrayList<Organization>();
     for (String org : new OrganizationStructureProvider().getChildTree(orgId, true)) {
--- a/src/org/openbravo/erpCommon/ad_reports/CustomerStatement.jrxml	Fri Jan 31 13:43:17 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/CustomerStatement.jrxml	Fri Jan 31 14:17:23 2014 +0100
@@ -67,6 +67,7 @@
 	<parameter name="DATEFORMAT" class="java.text.DateFormat">
 		<defaultValueExpression><![CDATA[$P{REPORT_FORMAT_FACTORY}.createDateFormat("", $P{REPORT_LOCALE}, $P{REPORT_TIME_ZONE})]]></defaultValueExpression>
 	</parameter>
+	<parameter name="reportType" class="java.lang.String"/>
 	<queryString>
 		<![CDATA[SELECT trunc(f.dateacct) as dateacct,
         CASE WHEN f.c_doctype_id IS NOT NULL THEN (SELECT MIN(name)
@@ -86,13 +87,20 @@
     loc.city || ', ' || ad_column_identifier('C_Region', loc.c_region_id, 'en_US') || ' ' || loc.postal
     || ' ' || ad_column_identifier('C_Country', loc.c_country_id, 'en_US') AS org_postal,
     (SELECT MAX(email) FROM ad_user WHERE ad_user_id=oinfo.ad_user_id) as email,
-    (SELECT MAX(phone) FROM ad_user WHERE ad_user_id=oinfo.ad_user_id) as phone
+    (SELECT MAX(phone) FROM ad_user WHERE ad_user_id=oinfo.ad_user_id) as phone,
+    issotrx.issotrx
 FROM fact_acct f
     LEFT JOIN c_acctschema acct ON (f.c_acctschema_id=acct.c_acctschema_id)
-    LEFT JOIN c_bpartner bp ON (f.c_bpartner_id=bp.c_bpartner_id), ad_org o
+    LEFT JOIN c_bpartner bp ON (f.c_bpartner_id=bp.c_bpartner_id)
+    JOIN (SELECT ad_org_id
+          FROM ad_org
+          WHERE ad_isorgincluded(ad_org_id, $P{AD_Org_ID}, ad_client_id) <> -1) org ON (f.ad_org_id=org.ad_org_id), ad_org o
     LEFT JOIN ad_orginfo oinfo ON (o.ad_org_id=oinfo.ad_org_id)
-    LEFT JOIN c_location loc ON (oinfo.c_location_id=loc.c_location_id)
+    LEFT JOIN c_location loc ON (oinfo.c_location_id=loc.c_location_id), (SELECT CASE WHEN value=1 THEN 'Y' ELSE 'N' END AS issotrx
+                                                                          FROM ad_integer
+                                                                          WHERE value < 3) issotrx
 WHERE o.ad_org_id=$P{AD_Org_ID}
+    AND (($P{reportType} IN ('cus','both')
     AND account_id IN
         (SELECT account_id
          FROM c_validcombination
@@ -107,6 +115,23 @@
                  FROM c_bp_customer_acct
                  WHERE c_bpartner_id = $P{C_BPartner_ID}
                  AND c_acctschema_id = $P{C_AcctSchema_ID})))
+    AND issotrx.issotrx='Y')
+   OR ($P{reportType} IN ('ven','both')
+   AND account_id IN
+        (SELECT account_id
+         FROM c_validcombination
+         WHERE c_acctschema_id = $P{C_AcctSchema_ID}
+             AND (c_validcombination_id IN
+                (SELECT v_liability_acct
+                 FROM c_bp_vendor_acct
+                 WHERE c_bpartner_id = $P{C_BPartner_ID}
+                 AND c_acctschema_id = $P{C_AcctSchema_ID})
+             OR c_validcombination_id IN
+                (SELECT v_prepayment_acct
+                 FROM c_bp_vendor_acct
+                 WHERE c_bpartner_id = $P{C_BPartner_ID}
+                 AND c_acctschema_id = $P{C_AcctSchema_ID})))
+    AND issotrx.issotrx='N'))
     AND f.c_bpartner_id =  $P{C_BPartner_ID}
     AND f.c_acctschema_id = $P{C_AcctSchema_ID}
     AND trunc(f.dateacct) >= (CASE WHEN ($P{DateFrom} IS NULL OR $P{DateFrom}='') THEN TO_DATE('01-01-0001')
@@ -128,7 +153,8 @@
 	<field name="debit" class="java.math.BigDecimal"/>
 	<field name="credit" class="java.math.BigDecimal"/>
 	<field name="net" class="java.math.BigDecimal"/>
-	<variable name="SUM" class="java.math.BigDecimal" calculation="Sum">
+	<field name="issotrx" class="java.lang.String"/>
+	<variable name="SUM" class="java.math.BigDecimal" resetType="Group" resetGroup="Customer" calculation="Sum">
 		<variableExpression><![CDATA[$F{net}]]></variableExpression>
 	</variable>
 	<variable name="DateFrom" class="java.util.Date" calculation="Lowest">
@@ -137,11 +163,26 @@
 	<variable name="DateTo" class="java.util.Date" calculation="Highest">
 		<variableExpression><![CDATA[$F{dateacct}]]></variableExpression>
 	</variable>
-	<variable name="initialBalance" class="java.math.BigDecimal">
-		<variableExpression><![CDATA[ReportsUtility.getBeginningBalance($P{AD_Org_ID}, $P{C_AcctSchema_ID}, $P{C_BPartner_ID}, $P{DateFrom})]]></variableExpression>
+	<variable name="customerInitialBalance" class="java.math.BigDecimal">
+		<variableExpression><![CDATA[ReportsUtility.getBeginningBalance($P{AD_Org_ID}, $P{C_AcctSchema_ID}, $P{C_BPartner_ID}, $P{DateFrom}, true)]]></variableExpression>
 	</variable>
-	<variable name="balance" class="java.math.BigDecimal">
-		<variableExpression><![CDATA[$V{initialBalance}.add($V{SUM})]]></variableExpression>
+	<variable name="customerBalance" class="java.math.BigDecimal" resetType="Group" resetGroup="Customer">
+		<variableExpression><![CDATA[$V{customerInitialBalance}.add($V{SUM})]]></variableExpression>
+	</variable>
+	<variable name="vendorInitialBalance" class="java.math.BigDecimal">
+		<variableExpression><![CDATA[ReportsUtility.getBeginningBalance($P{AD_Org_ID}, $P{C_AcctSchema_ID}, $P{C_BPartner_ID}, $P{DateFrom}, false)]]></variableExpression>
+	</variable>
+	<variable name="vendorBalance" class="java.math.BigDecimal" resetType="Group" resetGroup="Customer">
+		<variableExpression><![CDATA[$V{vendorInitialBalance}.add($V{SUM})]]></variableExpression>
+	</variable>
+	<variable name="TOTALSUM" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{net}]]></variableExpression>
+	</variable>
+	<variable name="totalBalance" class="java.math.BigDecimal">
+		<variableExpression><![CDATA[$V{TOTALSUM}.add($V{customerInitialBalance}).add($V{vendorInitialBalance})]]></variableExpression>
+	</variable>
+	<variable name="totalInitialBalance" class="java.math.BigDecimal">
+		<variableExpression><![CDATA[$V{vendorInitialBalance}.add($V{customerInitialBalance})]]></variableExpression>
 	</variable>
 	<group name="PrintLarge" isReprintHeaderOnEachPage="true">
 		<groupExpression><![CDATA[]]></groupExpression>
@@ -149,6 +190,141 @@
 	<group name="PrintMedium" isReprintHeaderOnEachPage="true">
 		<groupExpression><![CDATA[]]></groupExpression>
 	</group>
+	<group name="Customer" isReprintHeaderOnEachPage="true">
+		<groupExpression><![CDATA[$F{issotrx}]]></groupExpression>
+		<groupHeader>
+			<band height="78">
+				<textField isStretchWithOverflow="true" evaluationTime="Report" pattern="" isBlankWhenNull="true">
+					<reportElement style="Detail_Line" stretchType="RelativeToTallestObject" mode="Transparent" x="446" y="56" width="110" height="14" forecolor="#000000" backcolor="#FFFFFF">
+						<printWhenExpression><![CDATA[($P{reportType}.equals("cus")) || ($P{reportType}.equals("both") && $F{issotrx}.equals("Y"))]]></printWhenExpression>
+					</reportElement>
+					<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
+						<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+					</textElement>
+					<textFieldExpression class="java.lang.String"><![CDATA[$V{customerInitialBalance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{customerInitialBalance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{customerInitialBalance})]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement x="331" y="56" width="115" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement textAlignment="Right" verticalAlignment="Top">
+						<font fontName="DejaVu Sans" size="10" isBold="true"/>
+					</textElement>
+					<text><![CDATA[Initial Balance :]]></text>
+				</staticText>
+				<line>
+					<reportElement x="331" y="70" width="225" height="1"/>
+				</line>
+				<staticText>
+					<reportElement x="0" y="7" width="178" height="20" forecolor="#595959">
+						<printWhenExpression><![CDATA[$P{reportType}.equals("both") && $F{issotrx}.equals("Y")]]></printWhenExpression>
+					</reportElement>
+					<textElement>
+						<font fontName="DejaVu Sans" size="16"/>
+					</textElement>
+					<text><![CDATA[Customer Statement]]></text>
+				</staticText>
+				<staticText>
+					<reportElement x="128" y="36" width="202" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement textAlignment="Left" verticalAlignment="Top">
+						<font fontName="DejaVu Sans" size="8" isBold="true"/>
+					</textElement>
+					<text><![CDATA[Description]]></text>
+				</staticText>
+				<staticText>
+					<reportElement x="0" y="36" width="47" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement verticalAlignment="Top">
+						<font fontName="DejaVu Sans" size="8" isBold="true"/>
+					</textElement>
+					<text><![CDATA[Date]]></text>
+				</staticText>
+				<staticText>
+					<reportElement x="47" y="36" width="81" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement textAlignment="Left" verticalAlignment="Top">
+						<font fontName="DejaVu Sans" size="8" isBold="true"/>
+					</textElement>
+					<text><![CDATA[Document Type]]></text>
+				</staticText>
+				<staticText>
+					<reportElement x="330" y="36" width="75" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement textAlignment="Right" verticalAlignment="Top">
+						<font fontName="DejaVu Sans" size="8" isBold="true"/>
+					</textElement>
+					<text><![CDATA[Debit]]></text>
+				</staticText>
+				<staticText>
+					<reportElement x="405" y="36" width="75" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement textAlignment="Right" verticalAlignment="Top">
+						<font fontName="DejaVu Sans" size="8" isBold="true"/>
+					</textElement>
+					<text><![CDATA[Credit]]></text>
+				</staticText>
+				<staticText>
+					<reportElement x="480" y="36" width="75" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement textAlignment="Right" verticalAlignment="Top">
+						<font fontName="DejaVu Sans" size="8" isBold="true"/>
+					</textElement>
+					<text><![CDATA[Net]]></text>
+				</staticText>
+				<line>
+					<reportElement x="0" y="49" width="555" height="1"/>
+				</line>
+				<staticText>
+					<reportElement x="0" y="7" width="178" height="20" forecolor="#595959">
+						<printWhenExpression><![CDATA[$P{reportType}.equals("both") && $F{issotrx}.equals("N")]]></printWhenExpression>
+					</reportElement>
+					<textElement>
+						<font fontName="DejaVu Sans" size="16"/>
+					</textElement>
+					<text><![CDATA[Vendor Statement]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="true" evaluationTime="Report" pattern="" isBlankWhenNull="true">
+					<reportElement style="Detail_Line" stretchType="RelativeToTallestObject" mode="Transparent" x="446" y="56" width="110" height="14" forecolor="#000000" backcolor="#FFFFFF">
+						<printWhenExpression><![CDATA[($P{reportType}.equals("ven")) || ($P{reportType}.equals("both") && $F{issotrx}.equals("N"))]]></printWhenExpression>
+					</reportElement>
+					<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
+						<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+					</textElement>
+					<textFieldExpression class="java.lang.String"><![CDATA[$V{vendorInitialBalance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{vendorInitialBalance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{vendorInitialBalance})]]></textFieldExpression>
+				</textField>
+			</band>
+		</groupHeader>
+		<groupFooter>
+			<band height="44">
+				<textField evaluationTime="Group" evaluationGroup="Customer" pattern="" isBlankWhenNull="true">
+					<reportElement positionType="Float" mode="Transparent" x="445" y="12" width="110" height="15" forecolor="#000000" backcolor="#FFFFFF">
+						<printWhenExpression><![CDATA[($P{reportType}.equals("cus")) || ($P{reportType}.equals("both") && $F{issotrx}.equals("Y"))]]></printWhenExpression>
+					</reportElement>
+					<box rightPadding="5"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
+						<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+					</textElement>
+					<textFieldExpression class="java.lang.String"><![CDATA[$V{customerBalance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{customerBalance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{customerBalance})]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement positionType="Float" mode="Opaque" x="330" y="12" width="115" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
+						<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+					</textElement>
+					<text><![CDATA[Balance :]]></text>
+				</staticText>
+				<line>
+					<reportElement x="330" y="27" width="225" height="1"/>
+				</line>
+				<line>
+					<reportElement x="330" y="29" width="225" height="1"/>
+				</line>
+				<textField evaluationTime="Group" evaluationGroup="Customer" pattern="" isBlankWhenNull="true">
+					<reportElement positionType="Float" mode="Transparent" x="445" y="12" width="110" height="15" forecolor="#000000" backcolor="#FFFFFF">
+						<printWhenExpression><![CDATA[($P{reportType}.equals("ven")) || ($P{reportType}.equals("both") && $F{issotrx}.equals("N"))]]></printWhenExpression>
+					</reportElement>
+					<box rightPadding="5"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
+						<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+					</textElement>
+					<textFieldExpression class="java.lang.String"><![CDATA[$V{vendorBalance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{vendorBalance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{vendorBalance})]]></textFieldExpression>
+				</textField>
+			</band>
+		</groupFooter>
+	</group>
 	<background>
 		<band splitType="Stretch"/>
 	</background>
@@ -156,7 +332,7 @@
 		<band splitType="Stretch"/>
 	</title>
 	<pageHeader>
-		<band height="193" splitType="Stretch">
+		<band height="146" splitType="Stretch">
 			<rectangle>
 				<reportElement x="0" y="0" width="559" height="77" forecolor="#FFFFFF" backcolor="#FFFFFF"/>
 			</rectangle>
@@ -187,7 +363,9 @@
 				<textFieldExpression class="java.lang.String"><![CDATA[$F{org_address} + " " + $F{org_postal}]]></textFieldExpression>
 			</textField>
 			<staticText>
-				<reportElement x="371" y="4" width="178" height="20" forecolor="#595959"/>
+				<reportElement x="371" y="4" width="178" height="20" forecolor="#595959">
+					<printWhenExpression><![CDATA[$P{reportType}.equals("cus") && $F{issotrx}.equals("Y")]]></printWhenExpression>
+				</reportElement>
 				<textElement textAlignment="Right">
 					<font fontName="DejaVu Sans" size="16"/>
 				</textElement>
@@ -229,48 +407,6 @@
 				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
 			</textField>
 			<staticText>
-				<reportElement x="128" y="148" width="202" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Left" verticalAlignment="Top">
-					<font fontName="DejaVu Sans" size="8" isBold="true"/>
-				</textElement>
-				<text><![CDATA[Description]]></text>
-			</staticText>
-			<staticText>
-				<reportElement x="-1" y="148" width="48" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement verticalAlignment="Top">
-					<font fontName="DejaVu Sans" size="8" isBold="true"/>
-				</textElement>
-				<text><![CDATA[Date]]></text>
-			</staticText>
-			<staticText>
-				<reportElement x="47" y="148" width="81" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Left" verticalAlignment="Top">
-					<font fontName="DejaVu Sans" size="8" isBold="true"/>
-				</textElement>
-				<text><![CDATA[Document Type]]></text>
-			</staticText>
-			<staticText>
-				<reportElement x="330" y="148" width="75" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Right" verticalAlignment="Top">
-					<font fontName="DejaVu Sans" size="8" isBold="true"/>
-				</textElement>
-				<text><![CDATA[Debit]]></text>
-			</staticText>
-			<staticText>
-				<reportElement x="405" y="148" width="75" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Right" verticalAlignment="Top">
-					<font fontName="DejaVu Sans" size="8" isBold="true"/>
-				</textElement>
-				<text><![CDATA[Credit]]></text>
-			</staticText>
-			<staticText>
-				<reportElement x="480" y="148" width="75" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Right" verticalAlignment="Top">
-					<font fontName="DejaVu Sans" size="8" isBold="true"/>
-				</textElement>
-				<text><![CDATA[Net]]></text>
-			</staticText>
-			<staticText>
 				<reportElement x="0" y="124" width="32" height="12"/>
 				<textElement verticalAlignment="Bottom">
 					<font fontName="DejaVu Sans" size="10" isBold="false"/>
@@ -298,26 +434,15 @@
 				</textElement>
 				<text><![CDATA[to]]></text>
 			</staticText>
-			<textField isStretchWithOverflow="true" evaluationTime="Report" pattern="" isBlankWhenNull="true">
-				<reportElement style="Detail_Line" stretchType="RelativeToTallestObject" mode="Transparent" x="445" y="170" width="110" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
-					<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+			<staticText>
+				<reportElement x="371" y="4" width="178" height="20" forecolor="#595959">
+					<printWhenExpression><![CDATA[$P{reportType}.equals("ven") && $F{issotrx}.equals("N")]]></printWhenExpression>
+				</reportElement>
+				<textElement textAlignment="Right">
+					<font fontName="DejaVu Sans" size="16"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA[$V{initialBalance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{initialBalance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{initialBalance})]]></textFieldExpression>
-			</textField>
-			<staticText>
-				<reportElement x="330" y="170" width="115" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Right" verticalAlignment="Top">
-					<font fontName="DejaVu Sans" size="10" isBold="true"/>
-				</textElement>
-				<text><![CDATA[Initial Balance :]]></text>
+				<text><![CDATA[Vendor Statement]]></text>
 			</staticText>
-			<line>
-				<reportElement x="0" y="161" width="555" height="1"/>
-			</line>
-			<line>
-				<reportElement x="330" y="184" width="225" height="1"/>
-			</line>
 		</band>
 	</pageHeader>
 	<detail>
@@ -371,26 +496,44 @@
 	</detail>
 	<summary>
 		<band height="66" splitType="Stretch">
+			<printWhenExpression><![CDATA[$P{reportType}.equals("both")]]></printWhenExpression>
+			<textField isStretchWithOverflow="true" evaluationTime="Report" pattern="" isBlankWhenNull="true">
+				<reportElement style="Detail_Line" stretchType="RelativeToTallestObject" mode="Transparent" x="445" y="13" width="110" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
+				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
+					<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression class="java.lang.String"><![CDATA[$V{totalInitialBalance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{totalInitialBalance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{totalInitialBalance})]]></textFieldExpression>
+			</textField>
+			<staticText>
+				<reportElement x="235" y="13" width="210" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
+				<textElement textAlignment="Right" verticalAlignment="Top">
+					<font fontName="DejaVu Sans" size="10" isBold="true"/>
+				</textElement>
+				<text><![CDATA[Business Partner Initial Balance :]]></text>
+			</staticText>
+			<line>
+				<reportElement x="235" y="27" width="320" height="1"/>
+			</line>
+			<staticText>
+				<reportElement positionType="Float" mode="Opaque" x="235" y="42" width="210" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
+				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
+					<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
+				</textElement>
+				<text><![CDATA[Business Partner Balance :]]></text>
+			</staticText>
+			<line>
+				<reportElement x="235" y="55" width="320" height="3"/>
+			</line>
 			<textField evaluationTime="Report" pattern="" isBlankWhenNull="true">
-				<reportElement positionType="Float" mode="Transparent" x="445" y="19" width="110" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
+				<reportElement positionType="Float" mode="Transparent" x="445" y="42" width="110" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
 				<box rightPadding="5"/>
 				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
 					<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA[$V{balance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{balance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{balance})]]></textFieldExpression>
+				<textFieldExpression class="java.lang.String"><![CDATA[$V{totalBalance}.compareTo(BigDecimal.ZERO) < 0 ? "(" + $P{NUMBERFORMAT}.format($V{totalBalance}.abs()) + ")" : $P{NUMBERFORMAT}.format($V{totalBalance})]]></textFieldExpression>
 			</textField>
-			<staticText>
-				<reportElement positionType="Float" mode="Opaque" x="330" y="19" width="115" height="15" forecolor="#000000" backcolor="#FFFFFF"/>
-				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none">
-					<font fontName="DejaVu Sans" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
-				</textElement>
-				<text><![CDATA[Balance :]]></text>
-			</staticText>
 			<line>
-				<reportElement x="330" y="34" width="225" height="1"/>
-			</line>
-			<line>
-				<reportElement x="330" y="36" width="225" height="1"/>
+				<reportElement x="235" y="57" width="320" height="3"/>
 			</line>
 		</band>
 	</summary>