CI: promote changesets from pi to main
authorRM packaging bot <staff.rm@openbravo.com>
Mon, 25 Jun 2012 19:58:29 +0200
changeset 16873 ce4a3232d144
parent 16749 b5f3ca9f5a59 (current diff)
parent 16872 1ef76e8531af (diff)
child 16938 5803f45fd0b7
CI: promote changesets from pi to main
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml
modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
src-db/database/model/functions/C_INVOICE_POST.xml
src-db/database/sourcedata/AD_MODULE.xml
src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
--- a/CONTRIBUTORS	Thu Jun 21 04:45:38 2012 +0000
+++ b/CONTRIBUTORS	Mon Jun 25 19:58:29 2012 +0200
@@ -15,3 +15,4 @@
 Shankar Balachandran <shaanjus4u@gmail.com> - Bug fixing
 Francois Le Roux - <lerfrancois@gmail.com> - Bug fixing and documentation
 Shawn Laubach SAIC <shawn.m.laubach@saic.com> - Development
+Cheli Pineda <cheli@aradaen.com> - Bug fixing
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -10363,6 +10363,118 @@
 <!--C12ED5C93034481EAA90C46C242EE15A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--C12ED5C93034481EAA90C46C242EE15A--></AD_FIELD>
 
+<!--C1DE5081483C5DA7E040007F01000CB2--><AD_FIELD>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <AD_FIELD_ID><![CDATA[C1DE5081483C5DA7E040007F01000CB2]]></AD_FIELD_ID>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <NAME><![CDATA[Status]]></NAME>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <AD_TAB_ID><![CDATA[6707D7449A8D45DB851F608BA88329C8]]></AD_TAB_ID>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <AD_COLUMN_ID><![CDATA[C1DE4479A025001AE040007F01000C7E]]></AD_COLUMN_ID>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <SEQNO><![CDATA[220]]></SEQNO>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C1DE5081483C5DA7E040007F01000CB2-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C1DE5081483C5DA7E040007F01000CB2--></AD_FIELD>
+
+<!--C1DE508148455DA7E040007F01000CB2--><AD_FIELD>
+<!--C1DE508148455DA7E040007F01000CB2-->  <AD_FIELD_ID><![CDATA[C1DE508148455DA7E040007F01000CB2]]></AD_FIELD_ID>
+<!--C1DE508148455DA7E040007F01000CB2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1DE508148455DA7E040007F01000CB2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1DE508148455DA7E040007F01000CB2-->  <NAME><![CDATA[Status]]></NAME>
+<!--C1DE508148455DA7E040007F01000CB2-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--C1DE508148455DA7E040007F01000CB2-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C1DE508148455DA7E040007F01000CB2-->  <AD_TAB_ID><![CDATA[FD40D9C2F1F14943933DEFEF4A8458E4]]></AD_TAB_ID>
+<!--C1DE508148455DA7E040007F01000CB2-->  <AD_COLUMN_ID><![CDATA[C1DE4479A025001AE040007F01000C7E]]></AD_COLUMN_ID>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C1DE508148455DA7E040007F01000CB2-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C1DE508148455DA7E040007F01000CB2-->  <SEQNO><![CDATA[200]]></SEQNO>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C1DE508148455DA7E040007F01000CB2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C1DE508148455DA7E040007F01000CB2-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C1DE508148455DA7E040007F01000CB2-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--C1DE508148455DA7E040007F01000CB2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C1DE508148455DA7E040007F01000CB2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C1DE508148455DA7E040007F01000CB2-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C1DE508148455DA7E040007F01000CB2-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C1DE508148455DA7E040007F01000CB2--></AD_FIELD>
+
+<!--C1DE5396D867B815E040007F01000CBC--><AD_FIELD>
+<!--C1DE5396D867B815E040007F01000CBC-->  <AD_FIELD_ID><![CDATA[C1DE5396D867B815E040007F01000CBC]]></AD_FIELD_ID>
+<!--C1DE5396D867B815E040007F01000CBC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1DE5396D867B815E040007F01000CBC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1DE5396D867B815E040007F01000CBC-->  <NAME><![CDATA[Status]]></NAME>
+<!--C1DE5396D867B815E040007F01000CBC-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--C1DE5396D867B815E040007F01000CBC-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C1DE5396D867B815E040007F01000CBC-->  <AD_TAB_ID><![CDATA[F9751D712A804D57B97A36803843F2D7]]></AD_TAB_ID>
+<!--C1DE5396D867B815E040007F01000CBC-->  <AD_COLUMN_ID><![CDATA[C1DE4479A025001AE040007F01000C7E]]></AD_COLUMN_ID>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C1DE5396D867B815E040007F01000CBC-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C1DE5396D867B815E040007F01000CBC-->  <SEQNO><![CDATA[200]]></SEQNO>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C1DE5396D867B815E040007F01000CBC-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C1DE5396D867B815E040007F01000CBC-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C1DE5396D867B815E040007F01000CBC-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--C1DE5396D867B815E040007F01000CBC-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C1DE5396D867B815E040007F01000CBC-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C1DE5396D867B815E040007F01000CBC-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C1DE5396D867B815E040007F01000CBC-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C1DE5396D867B815E040007F01000CBC--></AD_FIELD>
+
+<!--C1DE5396D890B815E040007F01000CBC--><AD_FIELD>
+<!--C1DE5396D890B815E040007F01000CBC-->  <AD_FIELD_ID><![CDATA[C1DE5396D890B815E040007F01000CBC]]></AD_FIELD_ID>
+<!--C1DE5396D890B815E040007F01000CBC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1DE5396D890B815E040007F01000CBC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1DE5396D890B815E040007F01000CBC-->  <NAME><![CDATA[Status]]></NAME>
+<!--C1DE5396D890B815E040007F01000CBC-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--C1DE5396D890B815E040007F01000CBC-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C1DE5396D890B815E040007F01000CBC-->  <AD_TAB_ID><![CDATA[B82C02920AA84E8DB57D553185BD2F06]]></AD_TAB_ID>
+<!--C1DE5396D890B815E040007F01000CBC-->  <AD_COLUMN_ID><![CDATA[C1DE4479A025001AE040007F01000C7E]]></AD_COLUMN_ID>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C1DE5396D890B815E040007F01000CBC-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C1DE5396D890B815E040007F01000CBC-->  <SEQNO><![CDATA[220]]></SEQNO>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C1DE5396D890B815E040007F01000CBC-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C1DE5396D890B815E040007F01000CBC-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C1DE5396D890B815E040007F01000CBC-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--C1DE5396D890B815E040007F01000CBC-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C1DE5396D890B815E040007F01000CBC-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C1DE5396D890B815E040007F01000CBC-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C1DE5396D890B815E040007F01000CBC-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C1DE5396D890B815E040007F01000CBC--></AD_FIELD>
+
 <!--C1F04275942B462999C4C827187816CC--><AD_FIELD>
 <!--C1F04275942B462999C4C827187816CC-->  <AD_FIELD_ID><![CDATA[C1F04275942B462999C4C827187816CC]]></AD_FIELD_ID>
 <!--C1F04275942B462999C4C827187816CC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -760,6 +760,17 @@
 <!--C5133F7FD55D4AF6B8B7FB527BFB9920-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--C5133F7FD55D4AF6B8B7FB527BFB9920--></AD_MESSAGE>
 
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D--><AD_MESSAGE>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <AD_MESSAGE_ID><![CDATA[CCA38D3048F04C1FA6F05AD56CF81B5D]]></AD_MESSAGE_ID>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <VALUE><![CDATA[APRM_NoFinancialAccountDefined]]></VALUE>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <MSGTEXT><![CDATA[It does not exist any Financial Account defined for this payment method and currency]]></MSGTEXT>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--CCA38D3048F04C1FA6F05AD56CF81B5D--></AD_MESSAGE>
+
 <!--D304C035EC724B6A874E574BE59BC7BF--><AD_MESSAGE>
 <!--D304C035EC724B6A874E574BE59BC7BF-->  <AD_MESSAGE_ID><![CDATA[D304C035EC724B6A874E574BE59BC7BF]]></AD_MESSAGE_ID>
 <!--D304C035EC724B6A874E574BE59BC7BF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></NAME>
-<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.16746]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.16854]]></VERSION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <DESCRIPTION><![CDATA[Managing your finances with an ERP does not have to be difficult. Enjoy a radically improved user experience that combines the power of an enterprise grade financial application with the simplicity and ease of a web 2.0 personal accounting service.]]></DESCRIPTION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <HELP><![CDATA[Advanced Payables and Receivables Management simplifies and automates the business processes around the management of financial accounts, from the receipt and issue of payment, to the reconciliation of those events with bank statements.
 If you would like to help shape this module you are welcome to take part in the forum discussions or register feature requests or issues in the corresponding (Forum and Bug Tracking) sections in the Advanced Payables and Receivable project in the OB Forge.]]></HELP>
@@ -25,7 +25,7 @@
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <UPDATEINFO><![CDATA[Fixed issue with document sequence numbers reset in case of applying dataset second time.
 Fixed issue 15305.]]></UPDATEINFO>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <REFERENCEDATAINFO><![CDATA[Document types and default algorithm for bank statement auto matching]]></REFERENCEDATAINFO>
-<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--A918E3331C404B889D69AA9BFAFB23AC--></AD_MODULE>
 
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--B97FC854C6DD41E692161585645A900F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--B97FC854C6DD41E692161585645A900F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--B97FC854C6DD41E692161585645A900F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--B97FC854C6DD41E692161585645A900F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--B97FC854C6DD41E692161585645A900F-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--B97FC854C6DD41E692161585645A900F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_VAL_RULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_VAL_RULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -29,7 +29,7 @@
 <!--575E470ABADB4C278132C957A78C47E3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--575E470ABADB4C278132C957A78C47E3-->  <NAME><![CDATA[Process Payment valid actions]]></NAME>
 <!--575E470ABADB4C278132C957A78C47E3-->  <TYPE><![CDATA[S]]></TYPE>
-<!--575E470ABADB4C278132C957A78C47E3-->  <CODE><![CDATA[((@EM_APRM_Process_Payment@ = 'P' AND AD_Ref_List.value='P') OR (@EM_APRM_Process_Payment@ = 'R' AND AD_Ref_List.value IN ('R', 'V')) OR (@EM_APRM_Process_Payment@ is null))]]></CODE>
+<!--575E470ABADB4C278132C957A78C47E3-->  <CODE><![CDATA[((@EM_APRM_Process_Payment@ = 'P' AND AD_Ref_List.value='P') OR (@EM_APRM_Process_Payment@ = 'R' AND AD_Ref_List.value IN ('RE')) OR (@EM_APRM_Process_Payment@ = 'R' AND AD_Ref_List.value IN ('V') AND @Status@='RPAE') OR (@EM_APRM_Process_Payment@ is null))]]></CODE>
 <!--575E470ABADB4C278132C957A78C47E3-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--575E470ABADB4C278132C957A78C47E3--></AD_VAL_RULE>
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.html	Mon Jun 25 19:58:29 2012 +0200
@@ -146,6 +146,29 @@
       cellCount, row, cellGLItemDesc, cellGLITemReceivedInAmt, cellGLITemPaidOutAmt, cellRemoveButton, i, textNode, glAcctDimsDesc, acctDim, cellGLItemDim, cellText;
 
   setTextContent(table,'');
+  if (!OB.APRM.HasGLItems) {
+      var glItems = eval(document.getElementById('paramGLItems').value);
+      if (glItems && glItems.length>0){
+          OB.APRM.APFT_GLItems = glItems;
+          OB.APRM.HasGLItems = true;
+          var amountSelected = 0;
+          for (i=0;i<glItems.length;i++){
+            if (isTrue('isReceipt')) {
+              amountSelected = add(amountSelected,glItems[i].glitemReceivedInAmt);
+              amountSelected = subtract(amountSelected,glItems[i].glitemPaidOutAmt);
+            } else {
+              amountSelected = subtract(amountSelected,glItems[i].glitemReceivedInAmt);
+              amountSelected = add(amountSelected,glItems[i].glitemPaidOutAmt);
+            }
+          }
+          document.getElementById('paramGLItems').value = '';
+          glitemCount = OB.APRM.APFT_GLItems.length;
+          OB.APRM.APFT_GLItemsId = glitemCount; 
+          frm.inpGLSumAmount.value = amountSelected;
+          document.getElementById('paramGLItemsAmt').innerHTML = document.frmMain.inpGLSumAmount.value;
+          updateTotal();
+      }
+  }
   if (glitemCount === 0) {
     OB.APRM.HasGLItems = false;
     frm.inpGLSumAmount.value = '0';
@@ -260,6 +283,7 @@
     }
     document.frmMain.inpActualPayment.value = amount;
   }
+
   OB.APRM.APFT_GLItemsId++;
   OB.APRM.APFT_GLItems.push({
     id: OB.APRM.APFT_GLItemsId,
@@ -492,7 +516,6 @@
     }
   } else {
     document.getElementById('paramGLItemsAmt').innerHTML = document.frmMain.inpGLSumAmount.value;
-    document.frmMain.isFirstLoad.value = 'true';
     if (isTrue('isInGLItemMode')) {
       document.frmMain.isInGLItemMode.value='N';
       setGLItemMode(false);
@@ -557,6 +580,7 @@
 
   //numberInputEvent('onchange', document.frmMain.inpGLItemAmount);
   loadGridList();
+  loadGLItemList();
   resizeAreaCreateFrom();
 
   //avoid horizontal scrolling when business partner column is displayed in the grid
@@ -616,7 +640,7 @@
   <input type="hidden" name="inpissotrx" value="" id="fieldIsSoTrx"/>
   <input type="hidden" name="isFirstLoad" value="true"/>
   <input type="hidden" name="isInGLItemMode" value="N"/>
-  <input type="hidden" name="inpGLItems" value=""/>
+  <input type="hidden" name="inpGLItems" id="paramGLItems"  value=""/>
   <input type="hidden" name="inpDeleteGLItem" value=""/>
   <input type="hidden" id="paramGeneratedCredit" name="inpGeneratedCredit" value="0"/>
   <input type="hidden" name="strElement_BP" id="paramStrElement_BP" value=""/>
@@ -1160,14 +1184,14 @@
               <td colspan="6">
                 <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
                 <tbody>
-                  <tr class="FieldGroup_TopMargin"/>
+                  <tr class="FieldGroup_TopMargin"></tr>
                   <tr>
                     <td class="FieldGroupTitle_Left"><img class="FieldGroupTitle_Left_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
                     <td class="FieldGroupTitle">Accounting Dimensions</td>
                     <td class="FieldGroupTitle_Right"><img class="FieldGroupTitle_Right_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
-                    <td class="FieldGroupContent"/>
+                    <td class="FieldGroupContent"></td>
                   </tr>
-                  <tr class="FieldGroup_BottomMargin"/>
+                  <tr class="FieldGroup_BottomMargin"></tr>
                 </tbody>
                 </table>
               </td>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java	Mon Jun 25 19:58:29 2012 +0200
@@ -23,6 +23,7 @@
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
@@ -58,7 +59,9 @@
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.plm.Product;
 import org.openbravo.model.financialmgmt.gl.GLItem;
+import org.openbravo.model.financialmgmt.payment.FIN_OrigPaymentScheduleDetail;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentDetail;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
 import org.openbravo.model.marketing.Campaign;
 import org.openbravo.model.materialmgmt.cost.ABCActivity;
@@ -150,11 +153,16 @@
             vars, strSelectedScheduledPaymentDetailIds);
 
         FIN_Payment payment = dao.getObject(FIN_Payment.class, strPaymentId);
+        // Remove edited lines which are not in final selection and adjust outstanding amount for
+        // documents
+        removeNonSelectedDetails(payment, selectedPaymentDetails);
         BigDecimal newPaymentAmount = new BigDecimal(strPaymentAmount);
         if (newPaymentAmount.compareTo(payment.getAmount()) != 0) {
           payment.setAmount(newPaymentAmount);
+          OBDal.getInstance().save(payment);
         }
-
+        // load object in memory
+        payment.getFINPaymentDetailList();
         if (addedGLITemsArray != null) {
           for (int i = 0; i < addedGLITemsArray.length(); i++) {
             JSONObject glItem = addedGLITemsArray.getJSONObject(i);
@@ -168,7 +176,6 @@
             }
             final String strGLItemId = glItem.getString("glitemId");
             checkID(strGLItemId);
-
             // Accounting Dimensions
             final String strElement_BP = glItem.getString("cBpartnerDim");
             checkID(strElement_BP);
@@ -201,16 +208,21 @@
         }
         FIN_AddPayment.setFinancialTransactionAmountAndRate(payment, exchangeRate, convertedAmount);
         payment = FIN_AddPayment.savePayment(payment, isReceipt, null, null, null, null, null,
-            null, null, null, null, selectedPaymentDetails, selectedPaymentDetailAmounts,
-            strDifferenceAction.equals("writeoff"), strDifferenceAction.equals("refund"),
-            dao.getObject(Currency.class, paymentCurrencyId), exchangeRate, convertedAmount);
+            strPaymentAmount, null, null, null, selectedPaymentDetails,
+            selectedPaymentDetailAmounts, strDifferenceAction.equals("writeoff"),
+            strDifferenceAction.equals("refund"), dao.getObject(Currency.class, paymentCurrencyId),
+            exchangeRate, convertedAmount);
 
         if (strAction.equals("PRP") || strAction.equals("PPP") || strAction.equals("PRD")
             || strAction.equals("PPW")) {
           try {
-            // If Action PRP o PPW, Process payment but as well create a financial transaction
-            message = FIN_AddPayment.processPayment(vars, this,
-                (strAction.equals("PRP") || strAction.equals("PPP")) ? "P" : "D", payment);
+            // Process just in case there are lines, empty Refund payment does not need to call
+            // process
+            if (payment.getFINPaymentDetailList().size() > 0) {
+              // If Action PRP o PPW, Process payment but as well create a financial transaction
+              message = FIN_AddPayment.processPayment(vars, this,
+                  (strAction.equals("PRP") || strAction.equals("PPP")) ? "P" : "D", payment);
+            }
             if (strDifferenceAction.equals("refund")) {
               Boolean newPayment = !payment.getFINPaymentDetailList().isEmpty();
               FIN_Payment refundPayment = FIN_AddPayment.createRefundPayment(this, vars, payment,
@@ -249,6 +261,7 @@
         }
         bdErrorGeneralPopUp(request, response, "Error", strMessage);
         OBDal.getInstance().rollbackAndClose();
+        log4j.error("AddOrderOrInvoice - SAVE AND PROCESS", ex);
         return;
 
       } finally {
@@ -261,6 +274,74 @@
 
   }
 
+  /*
+   * Removes lines and schedule details which are not included in the given selected list
+   */
+  private void removeNonSelectedDetails(FIN_Payment payment,
+      List<FIN_PaymentScheduleDetail> selectedPaymentDetails) {
+    Set<String> toRemovePDs = new HashSet<String>();
+    for (FIN_PaymentDetail pd : payment.getFINPaymentDetailList()) {
+      for (FIN_PaymentScheduleDetail psd : pd.getFINPaymentScheduleDetailList()) {
+        if (!selectedPaymentDetails.contains(psd)) {
+          if (pd.getGLItem() != null) {
+            toRemovePDs.add(pd.getId());
+            continue;
+          }
+          // update outstanding amount
+          List<FIN_PaymentScheduleDetail> outStandingPSDs = FIN_AddPayment.getOutstandingPSDs(psd);
+          if (outStandingPSDs.size() == 0) {
+            psd.setPaymentDetails(null);
+            psd.setFINOrigPaymentScheduleDetailList(null);
+            OBDal.getInstance().save(psd);
+            toRemovePDs.add(pd.getId());
+          } else {
+            // First make sure outstanding amount is not equal zero
+            if (outStandingPSDs.get(0).getAmount().add(psd.getAmount()).signum() == 0) {
+              OBDal.getInstance().remove(outStandingPSDs.get(0));
+            } else {
+              // update existing PD with difference
+              outStandingPSDs.get(0).setAmount(
+                  outStandingPSDs.get(0).getAmount().add(psd.getAmount()));
+              OBDal.getInstance().save(outStandingPSDs.get(0));
+            }
+            toRemovePDs.add(pd.getId());
+          }
+        }
+      }
+    }
+    for (String pdID : toRemovePDs) {
+      FIN_PaymentDetail pd = OBDal.getInstance().get(FIN_PaymentDetail.class, pdID);
+      boolean hasPSD = pd.getFINPaymentScheduleDetailList().size() > 0;
+      if (hasPSD) {
+        FIN_PaymentScheduleDetail psd = OBDal.getInstance().get(FIN_PaymentScheduleDetail.class,
+            pd.getFINPaymentScheduleDetailList().get(0).getId());
+        pd.getFINPaymentScheduleDetailList().remove(psd);
+        OBDal.getInstance().save(pd);
+        psd.setFINOrigPaymentScheduleDetailList(null);
+        OBDal.getInstance().save(psd);
+        ArrayList<String> opsdToRemove = new ArrayList<String>();
+        OBCriteria<FIN_OrigPaymentScheduleDetail> opsds = OBDal.getInstance().createCriteria(
+            FIN_OrigPaymentScheduleDetail.class);
+        opsds.add(Restrictions
+            .eq(FIN_OrigPaymentScheduleDetail.PROPERTY_PAYMENTSCHEDULEDETAIL, psd));
+        for (FIN_OrigPaymentScheduleDetail opsd : opsds.list()) {
+          opsdToRemove.add(opsd.getId());
+        }
+        for (String id : opsdToRemove) {
+          FIN_OrigPaymentScheduleDetail opsd = OBDal.getInstance().get(
+              FIN_OrigPaymentScheduleDetail.class, id);
+          OBDal.getInstance().remove(opsd);
+        }
+        OBDal.getInstance().remove(psd);
+      }
+      payment.getFINPaymentDetailList().remove(pd);
+      OBDal.getInstance().save(payment);
+      OBDal.getInstance().remove(pd);
+      OBDal.getInstance().flush();
+      OBDal.getInstance().refresh(payment);
+    }
+  }
+
   private void checkID(final String id) throws ServletException {
     if (!IsIDFilter.instance.accept(id)) {
       log4j.error("Input: " + id + " not accepted by filter: IsIDFilter");
@@ -385,6 +466,70 @@
     xmlDocument.setParameter("strElement_SR", strElement_SR);
     xmlDocument.setParameter("strElement_MC", strElement_MC);
 
+    // Add GL Items
+    JSONArray addedGLITemsArray = new JSONArray();
+    List<FIN_PaymentScheduleDetail> gLItemScheduleDetailLines = FIN_AddPayment
+        .getGLItemScheduleDetails(payment);
+    for (FIN_PaymentScheduleDetail psdGLItem : gLItemScheduleDetailLines) {
+      try {
+        JSONObject glItem = new JSONObject();
+        glItem.put("glitemId", psdGLItem.getPaymentDetails().getGLItem().getId());
+        glItem.put("glitemDesc", psdGLItem.getPaymentDetails().getGLItem().getIdentifier());
+        glItem.put("finPaymentScheduleDetailId", psdGLItem.getId());
+        // Amounts
+        if (payment.isReceipt()) {
+          glItem.put("glitemPaidOutAmt", psdGLItem.getAmount().signum() < 0 ? psdGLItem.getAmount()
+              : BigDecimal.ZERO);
+          glItem.put("glitemReceivedInAmt",
+              psdGLItem.getAmount().signum() > 0 ? psdGLItem.getAmount() : BigDecimal.ZERO);
+        } else {
+          glItem.put("glitemReceivedInAmt",
+              psdGLItem.getAmount().signum() < 0 ? psdGLItem.getAmount() : BigDecimal.ZERO);
+          glItem.put("glitemPaidOutAmt", psdGLItem.getAmount().signum() > 0 ? psdGLItem.getAmount()
+              : BigDecimal.ZERO);
+        }
+        // Accounting Dimensions
+        glItem.put("cBpartnerDim", psdGLItem.getBusinessPartner() != null ? psdGLItem
+            .getBusinessPartner().getId() : "");
+        glItem.put("cBpartnerDimDesc", psdGLItem.getBusinessPartner() != null ? psdGLItem
+            .getBusinessPartner().getIdentifier() : "");
+        glItem.put("mProductDim", psdGLItem.getProduct() != null ? psdGLItem.getProduct().getId()
+            : "");
+        glItem.put("mProductDimDesc", psdGLItem.getProduct() != null ? psdGLItem.getProduct()
+            .getIdentifier() : "");
+        glItem.put("cProjectDim", psdGLItem.getProject() != null ? psdGLItem.getProject().getId()
+            : "");
+        glItem.put("cProjectDimDesc", psdGLItem.getProject() != null ? psdGLItem.getProject()
+            .getIdentifier() : "");
+        glItem.put("cActivityDim", psdGLItem.getActivity() != null ? psdGLItem.getActivity()
+            .getId() : "");
+        glItem.put("cActivityDimDesc", psdGLItem.getActivity() != null ? psdGLItem.getActivity()
+            .getIdentifier() : "");
+        glItem.put("cSalesregionDim", psdGLItem.getSalesRegion() != null ? psdGLItem
+            .getSalesRegion().getId() : "");
+        glItem.put("cSalesregionDimDesc", psdGLItem.getSalesRegion() != null ? psdGLItem
+            .getSalesRegion().getIdentifier() : "");
+        glItem.put("cCampaignDim", psdGLItem.getSalesCampaign() != null ? psdGLItem
+            .getSalesCampaign().getId() : "");
+        glItem.put("cCampaignDimDesc", psdGLItem.getSalesCampaign() != null ? psdGLItem
+            .getSalesCampaign().getIdentifier() : "");
+        // DisplayLogics
+        glItem.put("cBpartnerDimDisplayed", strElement_BP);
+        glItem.put("mProductDimDisplayed", strElement_PR);
+        glItem.put("cProjectDimDisplayed", strElement_PJ);
+        glItem.put("cActivityDimDisplayed", strElement_AY);
+        glItem.put("cSalesregionDimDisplayed", strElement_SR);
+        glItem.put("cCampaignDimDisplayed", strElement_MC);
+        addedGLITemsArray.put(glItem);
+      } catch (JSONException e) {
+        log4j.error(e);
+      }
+    }
+    xmlDocument.setParameter("glItems",
+        addedGLITemsArray.toString().replace("'", "").replaceAll("\"", "'"));
+    // If UsedCredit is not equal zero, check Use available credit
+    xmlDocument.setParameter("useCredit", payment.getUsedCredit().signum() != 0 ? "Y" : "N");
+
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
     out.println(xmlDocument.print());
@@ -406,12 +551,32 @@
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
         "org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentGrid", discard).createXmlDocument();
 
+    FIN_Payment payment = dao.getObject(FIN_Payment.class, strPaymentId);
+
+    List<FIN_PaymentScheduleDetail> storedScheduledPaymentDetails = new ArrayList<FIN_PaymentScheduleDetail>();
+    // This is to identify first load of the grid
+    String strFirstLoad = vars.getStringParameter("isFirstLoad");
+    if (payment.getFINPaymentDetailList().size() > 0) {
+      // Add payment schedule details related to orders or invoices to storedSchedulePaymentDetails
+      OBContext.setAdminMode();
+      try {
+        OBCriteria<FIN_PaymentScheduleDetail> obc = OBDal.getInstance().createCriteria(
+            FIN_PaymentScheduleDetail.class);
+        obc.add(Restrictions.in(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS,
+            payment.getFINPaymentDetailList()));
+        obc.add(Restrictions.or(
+            Restrictions.isNotNull(FIN_PaymentScheduleDetail.PROPERTY_INVOICEPAYMENTSCHEDULE),
+            Restrictions.isNotNull(FIN_PaymentScheduleDetail.PROPERTY_ORDERPAYMENTSCHEDULE)));
+        storedScheduledPaymentDetails = obc.list();
+      } finally {
+        OBContext.restorePreviousMode();
+      }
+    }
     // Pending Payments from invoice
     final List<FIN_PaymentScheduleDetail> selectedScheduledPaymentDetails = FIN_AddPayment
-        .getSelectedPaymentDetails(null, strSelectedPaymentDetails);
-
-    FIN_Payment payment = dao.getObject(FIN_Payment.class, strPaymentId);
-
+        .getSelectedPaymentDetails(
+            "true".equals(strFirstLoad) ? new ArrayList<FIN_PaymentScheduleDetail>(
+                storedScheduledPaymentDetails) : null, strSelectedPaymentDetails);
     // filtered scheduled payments list
     final List<FIN_PaymentScheduleDetail> filteredScheduledPaymentDetails = dao
         .getFilteredScheduledPaymentDetails(dao.getObject(Organization.class, strOrgId),
@@ -420,9 +585,43 @@
             FIN_Utility.getDate(DateTimeData.nDaysAfter(this, strDueDateTo, "1")), strDocumentType,
             showAlternativePM ? null : payment.getPaymentMethod(), selectedScheduledPaymentDetails,
             isReceipt);
+    // Remove related outstanding schedule details related to those ones being edited as amount will
+    // be later added to storedScheduledPaymentDetails
+    for (FIN_PaymentScheduleDetail psd : storedScheduledPaymentDetails) {
+      filteredScheduledPaymentDetails.removeAll(FIN_AddPayment.getOutstandingPSDs(psd));
+    }
+    // Get stored not selected PSDs
+    List<FIN_PaymentScheduleDetail> storedNotSelectedPSDs = new ArrayList<FIN_PaymentScheduleDetail>(
+        storedScheduledPaymentDetails);
+    storedNotSelectedPSDs.removeAll(selectedScheduledPaymentDetails);
+    // Add stored but not selected details which maps documenttype
+    filteredScheduledPaymentDetails.addAll(filterDocumenttype(storedNotSelectedPSDs,
+        strDocumentType));
 
     FieldProvider[] data = FIN_AddPayment.getShownScheduledPaymentDetails(vars,
-        selectedScheduledPaymentDetails, filteredScheduledPaymentDetails, false, null);
+        selectedScheduledPaymentDetails, filteredScheduledPaymentDetails, false, null,
+        strSelectedPaymentDetails);
+    for (FIN_PaymentScheduleDetail psd : storedScheduledPaymentDetails) {
+      // Calculate pending amount
+      BigDecimal outstandingAmount = BigDecimal.ZERO;
+      List<FIN_PaymentScheduleDetail> outStandingPSDs = FIN_AddPayment.getOutstandingPSDs(psd);
+      if (outStandingPSDs.size() != 0) {
+        for (FIN_PaymentScheduleDetail outPSD : outStandingPSDs) {
+          outstandingAmount = outstandingAmount.add(outPSD.getAmount());
+        }
+      }
+      for (int i = 0; i < data.length; i++) {
+        if (data[i].getField("finScheduledPaymentDetailId").equals(psd.getId())) {
+          FieldProviderFactory.setField(data[i], "outstandingAmount",
+              psd.getAmount().add(outstandingAmount).toPlainString());
+          if ("true".equals(strFirstLoad)) {
+            FieldProviderFactory.setField(data[i], "difference", outstandingAmount.toPlainString());
+            FieldProviderFactory
+                .setField(data[i], "paymentAmount", psd.getAmount().toPlainString());
+          }
+        }
+      }
+    }
     data = groupPerDocumentType(data, strDocumentType);
     xmlDocument.setData("structure", (data == null) ? set() : data);
 
@@ -571,8 +770,22 @@
     HashMap<String, BigDecimal> recordsAmounts = new HashMap<String, BigDecimal>();
     // PSD needs to be properly ordered to ensure negative amounts are processed first
     List<FIN_PaymentScheduleDetail> psds = getOrderedPaymentScheduleDetails(psdSet);
+    BigDecimal outstandingAmount = BigDecimal.ZERO;
     for (FIN_PaymentScheduleDetail paymentScheduleDetail : psds) {
-      BigDecimal outstandingAmount = paymentScheduleDetail.getAmount();
+      if (paymentScheduleDetail.getPaymentDetails() != null) {
+        // This schedule detail comes from an edited payment so outstanding amount needs to be
+        // properly calculated
+        List<FIN_PaymentScheduleDetail> outStandingPSDs = FIN_AddPayment
+            .getOutstandingPSDs(paymentScheduleDetail);
+        if (outStandingPSDs.size() > 0) {
+          outstandingAmount = paymentScheduleDetail.getAmount().add(
+              outStandingPSDs.get(0).getAmount());
+        } else {
+          outstandingAmount = paymentScheduleDetail.getAmount();
+        }
+      } else {
+        outstandingAmount = paymentScheduleDetail.getAmount();
+      }
       // Manage negative amounts
       if ((remainingAmount.compareTo(BigDecimal.ZERO) > 0 && remainingAmount
           .compareTo(outstandingAmount) >= 0)
@@ -597,6 +810,21 @@
     return orderedPSDs.list();
   }
 
+  private List<FIN_PaymentScheduleDetail> filterDocumenttype(
+      List<FIN_PaymentScheduleDetail> storedNotSelectedPSDs, String strDocumentType) {
+    List<FIN_PaymentScheduleDetail> listIterator = new ArrayList<FIN_PaymentScheduleDetail>(
+        storedNotSelectedPSDs);
+    for (FIN_PaymentScheduleDetail paymentScheduleDetail : listIterator) {
+      if (paymentScheduleDetail.getInvoicePaymentSchedule() != null && "O".equals(strDocumentType)) {
+        storedNotSelectedPSDs.remove(paymentScheduleDetail);
+      } else if (paymentScheduleDetail.getOrderPaymentSchedule() != null
+          && "I".equals(strDocumentType)) {
+        storedNotSelectedPSDs.remove(paymentScheduleDetail);
+      }
+    }
+    return storedNotSelectedPSDs;
+  }
+
   public String getServletInfo() {
     return "Servlet that presents the payment proposal";
     // end of getServletInfo() method
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -68,5 +68,10 @@
     <PARAMETER id="paramStrElement_SR" name="strElement_SR" attribute="value"/>
     <PARAMETER id="paramStrElement_MC" name="strElement_MC" attribute="value"/>   
 
+    <PARAMETER id="paramGLItems" name="glItems" attribute="value" default=""/>
+    
+    <PARAMETER id="paramUseCreditChecked" name="check" default="Y"/>
+    <PARAMETER id="paramUseCredit" name="useCredit" boolean="checked" withId="paramUseCreditChecked"/>
+
     <DISCARD id="discard"/>
 </REPORT>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java	Mon Jun 25 19:58:29 2012 +0200
@@ -342,6 +342,14 @@
     List<FIN_FinancialAccount> financialAccounts = dao.getFilteredFinancialAccounts(
         strPaymentMethodId, strOrgId, strCurrencyId,
         isReceipt ? AdvPaymentMngtDao.PaymentDirection.IN : AdvPaymentMngtDao.PaymentDirection.OUT);
+
+    if (financialAccounts.size() == 0) {
+      final OBError myMessage = Utility.translateError(this, vars, vars.getLanguage(),
+          Utility.messageBD(this, "APRM_NoFinancialAccountDefined", vars.getLanguage()));
+      vars.setMessage(strTabId, myMessage);
+      printPageClosePopUp(response, vars);
+    }
+
     String finAccountComboHtml = FIN_Utility.getOptionsList(financialAccounts,
         strFinancialAccountId, true);
     if (financialAccounts.size() > 0 && account == null) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.html	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.html	Mon Jun 25 19:58:29 2012 +0200
@@ -126,6 +126,10 @@
   return true;
 }
 
+function disableButtonProcess(){
+    document.getElementById('buttonProcess').disabled='disabled';
+}
+
 function showHideLayers() {
   var opt = document.frmMain.inpTransactionType.value;
   if (opt == 'P') {
@@ -511,14 +515,14 @@
               <td colspan="6">
                 <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
                 <tbody>
-                  <tr class="FieldGroup_TopMargin"/>
+                  <tr class="FieldGroup_TopMargin"></tr>
                   <tr>
                     <td class="FieldGroupTitle_Left"><img class="FieldGroupTitle_Left_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
                     <td class="FieldGroupTitle">Primary Filter</td>
                     <td class="FieldGroupTitle_Right"><img class="FieldGroupTitle_Right_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
-                    <td class="FieldGroupContent"/>
+                    <td class="FieldGroupContent"></td>
                   </tr>
-                  <tr class="FieldGroup_BottomMargin"/>
+                  <tr class="FieldGroup_BottomMargin"></td>
                 </tbody>
                 </table>
               </td>
@@ -587,14 +591,14 @@
               <td colspan="6">
                 <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
                 <tbody>
-                  <tr class="FieldGroup_TopMargin"/>
+                  <tr class="FieldGroup_TopMargin"></tr>
                   <tr>
                     <td class="FieldGroupTitle_Left"><img class="FieldGroupTitle_Left_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
                     <td class="FieldGroupTitle">Details</td>
                     <td class="FieldGroupTitle_Right"><img class="FieldGroupTitle_Right_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
-                    <td class="FieldGroupContent"/>
+                    <td class="FieldGroupContent"></td>
                   </tr>
-                  <tr class="FieldGroup_BottomMargin"/>
+                  <tr class="FieldGroup_BottomMargin"></tr>
                 </tbody>
                 </table>
               </td>
@@ -851,14 +855,14 @@
               <td colspan="6">
                 <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
                 <tbody>
-                  <tr class="FieldGroup_TopMargin"/>
+                  <tr class="FieldGroup_TopMargin"></tr>
                   <tr>
                     <td class="FieldGroupTitle_Left"><img class="FieldGroupTitle_Left_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
                     <td class="FieldGroupTitle">Accounting Dimensions</td>
                     <td class="FieldGroupTitle_Right"><img class="FieldGroupTitle_Right_bg" border="0" src="../../../../../web/images/blank.gif"/></td>
-                    <td class="FieldGroupContent"/>
+                    <td class="FieldGroupContent"></td>
                   </tr>
-                  <tr class="FieldGroup_BottomMargin"/>
+                  <tr class="FieldGroup_BottomMargin"></tr>
                 </tbody>
                 </table>
               </td>
@@ -1127,7 +1131,7 @@
                   <button type="button" 
                     id="buttonProcess"
                     class="ButtonLink" 
-                    onclick="submitThisPage('SAVE');return false;"
+                    onclick="submitThisPage('SAVE'); disableButtonProcess();return false;"
                     onfocus="buttonEvent('onfocus', this); window.status='Create'; return true;"
                     onblur="buttonEvent('onblur', this);"
                     onkeyup="buttonEvent('onkeyup', this);"
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Mon Jun 25 19:58:29 2012 +0200
@@ -468,6 +468,11 @@
     FieldProvider[] data = FieldProviderFactory.getFieldProviderArray(bankLines);
 
     OBContext.setAdminMode();
+    final String MATCHED_AGAINST_TRANSACTION = FIN_Utility.messageBD("APRM_Transaction");
+    final String MATCHED_AGAINST_PAYMENT = FIN_Utility.messageBD("APRM_Payment");
+    final String MATCHED_AGAINST_INVOICE = FIN_Utility.messageBD("APRM_Invoice");
+    final String MATCHED_AGAINST_ORDER = FIN_Utility.messageBD("APRM_Order");
+    final String MATCHED_AGAINST_CREDIT = FIN_Utility.messageBD("APRM_Credit");
     try {
       List<FIN_FinaccTransaction> excluded = new ArrayList<FIN_FinaccTransaction>();
       for (int i = 0; i < data.length; i++) {
@@ -547,11 +552,6 @@
         FieldProviderFactory.setField(data[i], "matchingType", matchingType);
 
         if (transaction != null) {
-          final String MATCHED_AGAINST_TRANSACTION = FIN_Utility.messageBD("APRM_Transaction");
-          final String MATCHED_AGAINST_PAYMENT = FIN_Utility.messageBD("APRM_Payment");
-          final String MATCHED_AGAINST_INVOICE = FIN_Utility.messageBD("APRM_Invoice");
-          final String MATCHED_AGAINST_ORDER = FIN_Utility.messageBD("APRM_Order");
-          final String MATCHED_AGAINST_CREDIT = FIN_Utility.messageBD("APRM_Credit");
           FieldProviderFactory.setField(data[i], "disabled", "N");
           // Auto Matching or already matched
           FieldProviderFactory.setField(data[i], "checked",
@@ -654,8 +654,9 @@
           .getFINReconciliationLineTempList();
       for (FIN_ReconciliationLineTemp oldtempLine : oldTempLines) {
         OBDal.getInstance().remove(oldtempLine);
-        OBDal.getInstance().flush();
       }
+      oldTempLines.clear();
+      OBDal.getInstance().flush();
       // Now copy info taken from the reconciliation when first opened
       List<FIN_ReconciliationLine_v> reconciledlines = reconciliation
           .getFINReconciliationLineVList();
@@ -700,8 +701,9 @@
             .setMatched(reconciledLine.getBankStatementLine().getFinancialAccountTransaction() != null);
         lineTemp.setMatchlevel(reconciledLine.getBankStatementLine().getMatchingtype());
         OBDal.getInstance().save(lineTemp);
-        OBDal.getInstance().flush();
       }
+      OBDal.getInstance().flush();
+      OBDal.getInstance().getSession().clear();
     } finally {
       OBContext.restorePreviousMode();
     }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Mon Jun 25 19:58:29 2012 +0200
@@ -407,14 +407,15 @@
       projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_DRAMOUNT));
       obcBsl.setProjection(projections);
 
-      if (obcBsl.list() != null && obcBsl.list().size() > 0) {
-        @SuppressWarnings("rawtypes")
-        List o = obcBsl.list();
+      @SuppressWarnings("rawtypes")
+      List o = obcBsl.list();
+      if (o != null && o.size() > 0) {
         Object[] resultSet = (Object[]) o.get(0);
         BigDecimal credit = (resultSet[0] != null) ? (BigDecimal) resultSet[0] : BigDecimal.ZERO;
         BigDecimal debit = (resultSet[1] != null) ? (BigDecimal) resultSet[1] : BigDecimal.ZERO;
         total = credit.subtract(debit);
       }
+      o.clear();
 
     } finally {
       OBContext.restorePreviousMode();
@@ -459,14 +460,15 @@
       projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_DRAMOUNT));
       obcBsl.setProjection(projections);
 
-      if (obcBsl.list() != null && obcBsl.list().size() > 0) {
-        @SuppressWarnings("rawtypes")
-        List o = obcBsl.list();
+      @SuppressWarnings("rawtypes")
+      List o = obcBsl.list();
+      if (o != null && o.size() > 0) {
         Object[] resultSet = (Object[]) o.get(0);
         BigDecimal credit = (resultSet[0] != null) ? (BigDecimal) resultSet[0] : BigDecimal.ZERO;
         BigDecimal debit = (resultSet[1] != null) ? (BigDecimal) resultSet[1] : BigDecimal.ZERO;
         total = credit.subtract(debit);
       }
+      o.clear();
 
     } finally {
       OBContext.restorePreviousMode();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java	Mon Jun 25 19:58:29 2012 +0200
@@ -33,6 +33,7 @@
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -136,22 +137,18 @@
   }
 
   public static Long getTransactionMaxLineNo(FIN_FinancialAccount financialAccount) {
-    OBContext.setAdminMode();
-    Long maxLine = 0l;
-    try {
-      final OBCriteria<FIN_FinaccTransaction> obc = OBDal.getInstance().createCriteria(
-          FIN_FinaccTransaction.class);
-      obc.add(Restrictions.eq(FIN_FinaccTransaction.PROPERTY_ACCOUNT, financialAccount));
-      obc.addOrderBy(FIN_FinaccTransaction.PROPERTY_LINENO, false);
-      obc.setMaxResults(1);
-      final List<FIN_FinaccTransaction> fat = obc.list();
-      if (fat.size() == 0)
-        return 0l;
-      maxLine = fat.get(0).getLineNo();
-    } finally {
-      OBContext.restorePreviousMode();
+    Query query = OBDal
+        .getInstance()
+        .getSession()
+        .createQuery(
+            "select max(f.lineNo) as maxLineno from FIN_Finacc_Transaction as f where account.id=?");
+    query.setString(0, (String) DalUtil.getId(financialAccount));
+    for (Object obj : query.list()) {
+      if (obj != null) {
+        return (Long) obj;
+      }
     }
-    return maxLine;
+    return 0l;
   }
 
   @Deprecated
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Mon Jun 25 19:58:29 2012 +0200
@@ -25,7 +25,10 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
 
 import javax.servlet.ServletException;
 
@@ -135,9 +138,9 @@
 
     BigDecimal assignedAmount = BigDecimal.ZERO;
     final FIN_Payment payment;
-    if (_payment != null)
+    if (_payment != null) {
       payment = _payment;
-    else {
+    } else {
       payment = dao.getNewPayment(isReceipt, organization, docType, strPaymentDocumentNo,
           businessPartner, paymentMethod, finAccount, strPaymentAmount, paymentDate, referenceNo,
           paymentCurrency, finTxnConvertRate, finTxnAmount);
@@ -148,8 +151,9 @@
       }
     }
 
-    for (FIN_PaymentDetail paymentDetail : payment.getFINPaymentDetailList())
+    for (FIN_PaymentDetail paymentDetail : payment.getFINPaymentDetailList()) {
       assignedAmount = assignedAmount.add(paymentDetail.getAmount());
+    }
     // FIXME: added to access the FIN_PaymentSchedule and FIN_PaymentScheduleDetail tables to be
     // removed when new security implementation is done
     OBContext.setAdminMode();
@@ -157,36 +161,108 @@
       for (FIN_PaymentScheduleDetail paymentScheduleDetail : selectedPaymentScheduleDetails) {
         // Payment Schedule Detail already linked to a payment detail.
         OBDal.getInstance().refresh(paymentScheduleDetail);
-        if (paymentScheduleDetail.getPaymentDetails() != null) {
+        if (paymentScheduleDetail.getPaymentDetails() != null
+            && !paymentScheduleDetail.getPaymentDetails().getFinPayment().getId()
+                .equals(payment.getId())) {
+          // If payment schedule detail belongs to a different payment
           throw new OBException(String.format(FIN_Utility.messageBD("APRM_PsdInSeveralPayments"),
               paymentScheduleDetail.getIdentifier()));
+        } else if (paymentScheduleDetail.getPaymentDetails() != null
+            && paymentScheduleDetail.getPaymentDetails().getFinPayment().getId()
+                .equals(payment.getId())) {
+          // Detail for this payment already exists. Payment being edited
+          BigDecimal paymentDetailAmount = selectedPaymentScheduleDetailsAmounts
+              .get(paymentScheduleDetail.getId());
+          // If amount has changed payment schedule details needs to be updated. Aggregate amount
+          // coming from unpaid schedule detail which remains unpaid
+          if (paymentScheduleDetail.getAmount().compareTo(paymentDetailAmount) != 0) {
+            // update Amounts as they have changed
+            assignedAmount = assignedAmount.subtract(paymentScheduleDetail.getPaymentDetails()
+                .getAmount());
+            assignedAmount = assignedAmount.add(paymentDetailAmount);
+            // update detail with the new value
+            List<FIN_PaymentScheduleDetail> outStandingPSDs = getOutstandingPSDs(paymentScheduleDetail);
+            BigDecimal difference = paymentScheduleDetail.getAmount().subtract(paymentDetailAmount);
+            if (outStandingPSDs.size() == 0) {
+              if (!isWriteoff) {
+                // No outstanding PSD exists so one needs to be created for the difference
+                FIN_PaymentScheduleDetail outstandingPSD = (FIN_PaymentScheduleDetail) DalUtil
+                    .copy(paymentScheduleDetail, false);
+                outstandingPSD.setAmount(difference);
+                outstandingPSD.setPaymentDetails(null);
+                OBDal.getInstance().save(outstandingPSD);
+              } else {
+                // Set difference as writeoff
+                paymentScheduleDetail.setWriteoffAmount(difference);
+                OBDal.getInstance().save(paymentScheduleDetail);
+                paymentScheduleDetail.getPaymentDetails().setWriteoffAmount(difference);
+                OBDal.getInstance().save(paymentScheduleDetail.getPaymentDetails());
+              }
+            } else {
+              if (!isWriteoff) {
+                // First make sure outstanding amount is not equal zero
+                if (outStandingPSDs.get(0).getAmount().add(difference).signum() == 0) {
+                  OBDal.getInstance().remove(outStandingPSDs.get(0));
+                } else {
+                  // update existing PD with difference
+                  outStandingPSDs.get(0).setAmount(
+                      outStandingPSDs.get(0).getAmount().add(difference));
+                  OBDal.getInstance().save(outStandingPSDs.get(0));
+                }
+              } else {
+                paymentScheduleDetail.setWriteoffAmount(difference.add(outStandingPSDs.get(0)
+                    .getAmount()));
+                OBDal.getInstance().save(paymentScheduleDetail);
+                paymentScheduleDetail.getPaymentDetails().setWriteoffAmount(
+                    difference.add(outStandingPSDs.get(0).getAmount()));
+                OBDal.getInstance().save(paymentScheduleDetail.getPaymentDetails());
+                OBDal.getInstance().remove(outStandingPSDs.get(0));
+              }
+            }
+            paymentScheduleDetail.setAmount(paymentDetailAmount);
+            OBDal.getInstance().save(paymentScheduleDetail);
+            paymentScheduleDetail.getPaymentDetails().setAmount(paymentDetailAmount);
+            OBDal.getInstance().save(paymentScheduleDetail.getPaymentDetails());
+          } else if (isWriteoff) {
+            List<FIN_PaymentScheduleDetail> outStandingPSDs = getOutstandingPSDs(paymentScheduleDetail);
+            if (outStandingPSDs.size() > 0) {
+              paymentScheduleDetail.setWriteoffAmount(outStandingPSDs.get(0).getAmount());
+              OBDal.getInstance().save(paymentScheduleDetail);
+              paymentScheduleDetail.getPaymentDetails().setWriteoffAmount(
+                  outStandingPSDs.get(0).getAmount());
+              OBDal.getInstance().save(paymentScheduleDetail.getPaymentDetails());
+              OBDal.getInstance().remove(outStandingPSDs.get(0));
+            }
+          }
+        } else {
+          BigDecimal paymentDetailAmount = selectedPaymentScheduleDetailsAmounts
+              .get(paymentScheduleDetail.getId());
+          // If detail to be added is zero amount, skip it
+          if (paymentDetailAmount.signum() == 0
+              && paymentScheduleDetail.getWriteoffAmount().signum() == 0) {
+            continue;
+          }
+          BigDecimal amountDifference = paymentScheduleDetail.getAmount().subtract(
+              paymentDetailAmount);
+          if (amountDifference.compareTo(BigDecimal.ZERO) != 0) {
+            if (!isWriteoff) {
+              dao.duplicateScheduleDetail(paymentScheduleDetail, amountDifference);
+              amountDifference = BigDecimal.ZERO;
+            } else
+              paymentScheduleDetail.setWriteoffAmount(amountDifference);
+            paymentScheduleDetail.setAmount(paymentDetailAmount);
+          }
+          assignedAmount = assignedAmount.add(paymentDetailAmount);
+          dao.getNewPaymentDetail(payment, paymentScheduleDetail, paymentDetailAmount,
+              amountDifference, false, null);
         }
-        BigDecimal paymentDetailAmount = selectedPaymentScheduleDetailsAmounts
-            .get(paymentScheduleDetail.getId());
-        // If detail to be added is zero amount, skip it
-        if (paymentDetailAmount.signum() == 0
-            && paymentScheduleDetail.getWriteoffAmount().signum() == 0) {
-          continue;
-        }
-        BigDecimal amountDifference = paymentScheduleDetail.getAmount().subtract(
-            paymentDetailAmount);
-        if (amountDifference.compareTo(BigDecimal.ZERO) != 0) {
-          if (!isWriteoff) {
-            dao.duplicateScheduleDetail(paymentScheduleDetail, amountDifference);
-            amountDifference = BigDecimal.ZERO;
-          } else
-            paymentScheduleDetail.setWriteoffAmount(amountDifference);
-          paymentScheduleDetail.setAmount(paymentDetailAmount);
-        }
-        assignedAmount = assignedAmount.add(paymentDetailAmount);
-        dao.getNewPaymentDetail(payment, paymentScheduleDetail, paymentDetailAmount,
-            amountDifference, false, null);
       }
+      // TODO: Review this condition !=0??
       if (assignedAmount.compareTo(payment.getAmount()) == -1) {
-        FIN_PaymentScheduleDetail refundScheduleDetail = dao.getNewPaymentScheduleDetail(payment
-            .getOrganization(), payment.getAmount().subtract(assignedAmount));
-        dao.getNewPaymentDetail(payment, refundScheduleDetail, payment.getAmount().subtract(
-            assignedAmount), BigDecimal.ZERO, false, null);
+        FIN_PaymentScheduleDetail refundScheduleDetail = dao.getNewPaymentScheduleDetail(
+            payment.getOrganization(), payment.getAmount().subtract(assignedAmount));
+        dao.getNewPaymentDetail(payment, refundScheduleDetail,
+            payment.getAmount().subtract(assignedAmount), BigDecimal.ZERO, false, null);
       }
     } catch (final Exception e) {
       e.printStackTrace(System.err);
@@ -255,8 +331,8 @@
       refundPayment = payment;
     else {
       refundPayment = (FIN_Payment) DalUtil.copy(payment, false);
-      String strDescription = Utility.messageBD(conProvider, "APRM_RefundPayment", vars
-          .getLanguage());
+      String strDescription = Utility.messageBD(conProvider, "APRM_RefundPayment",
+          vars.getLanguage());
       strDescription += ": " + payment.getDocumentNo();
       refundPayment.setDescription(strDescription);
       refundPayment.setGeneratedCredit(BigDecimal.ZERO);
@@ -273,8 +349,8 @@
 
     setFinancialTransactionAmountAndRate(refundPayment, conversionRate, null);
 
-    FIN_PaymentScheduleDetail refundScheduleDetail = dao.getNewPaymentScheduleDetail(payment
-        .getOrganization(), refundAmount);
+    FIN_PaymentScheduleDetail refundScheduleDetail = dao.getNewPaymentScheduleDetail(
+        payment.getOrganization(), refundAmount);
     dao.getNewPaymentDetail(refundPayment, refundScheduleDetail, refundAmount, BigDecimal.ZERO,
         true, null);
 
@@ -320,8 +396,9 @@
             selectedPaymentScheduleDetailAmounts.get(paymentScheduleDetail.getId()));
 
       dao.getNewPaymentProposalDetail(paymentProposal.getOrganization(), paymentProposal,
-          paymentScheduleDetail, selectedPaymentScheduleDetailAmounts.get(paymentScheduleDetail
-              .getId()), detailWriteOffAmt, null);
+          paymentScheduleDetail,
+          selectedPaymentScheduleDetailAmounts.get(paymentScheduleDetail.getId()),
+          detailWriteOffAmt, null);
     }
   }
 
@@ -509,6 +586,40 @@
     return selectedBaseOBObjectAmounts;
   }
 
+  private static List<FIN_PaymentScheduleDetail> getOrderedPaymentScheduleDetails(Set<String> psdSet) {
+    OBCriteria<FIN_PaymentScheduleDetail> orderedPSDs = OBDal.getInstance().createCriteria(
+        FIN_PaymentScheduleDetail.class);
+    orderedPSDs.add(Restrictions.in(FIN_PaymentScheduleDetail.PROPERTY_ID, psdSet));
+    orderedPSDs.addOrderBy(FIN_PaymentScheduleDetail.PROPERTY_AMOUNT, true);
+    return orderedPSDs.list();
+  }
+
+  private static HashMap<String, BigDecimal> calculateAmounts(BigDecimal recordAmount,
+      Set<String> psdSet) {
+    BigDecimal remainingAmount = recordAmount;
+    HashMap<String, BigDecimal> recordsAmounts = new HashMap<String, BigDecimal>();
+    // PSD needs to be properly ordered to ensure negative amounts are processed first
+    List<FIN_PaymentScheduleDetail> psds = getOrderedPaymentScheduleDetails(psdSet);
+    for (FIN_PaymentScheduleDetail paymentScheduleDetail : psds) {
+      BigDecimal outstandingAmount = paymentScheduleDetail.getAmount();
+      // Manage negative amounts
+      if ((remainingAmount.compareTo(BigDecimal.ZERO) > 0 && remainingAmount
+          .compareTo(outstandingAmount) >= 0)
+          || ((remainingAmount.compareTo(BigDecimal.ZERO) == -1 && outstandingAmount
+              .compareTo(BigDecimal.ZERO) == -1) && (remainingAmount.compareTo(outstandingAmount) <= 0))) {
+        recordsAmounts.put(paymentScheduleDetail.getId(), outstandingAmount);
+        remainingAmount = remainingAmount.subtract(outstandingAmount);
+      } else {
+        recordsAmounts.put(paymentScheduleDetail.getId(), remainingAmount);
+        if (psdSet.size() > 0) {
+          remainingAmount = BigDecimal.ZERO;
+        }
+      }
+
+    }
+    return recordsAmounts;
+  }
+
   /**
    * Builds a FieldProvider with a set of Payment Schedule Details based on the
    * selectedScheduledPaymentDetails and filteredScheduledPaymentDetails Lists. When the firstLoad
@@ -532,6 +643,22 @@
       List<FIN_PaymentScheduleDetail> selectedScheduledPaymentDetails,
       List<FIN_PaymentScheduleDetail> filteredScheduledPaymentDetails, boolean firstLoad,
       FIN_PaymentProposal paymentProposal) throws ServletException {
+    return getShownScheduledPaymentDetails(vars, selectedScheduledPaymentDetails,
+        filteredScheduledPaymentDetails, firstLoad, paymentProposal, null);
+  }
+
+  public static FieldProvider[] getShownScheduledPaymentDetails(VariablesSecureApp vars,
+      List<FIN_PaymentScheduleDetail> selectedScheduledPaymentDetails,
+      List<FIN_PaymentScheduleDetail> filteredScheduledPaymentDetails, boolean firstLoad,
+      FIN_PaymentProposal paymentProposal, String strSelectedPaymentDetails)
+      throws ServletException {
+
+    String strSelectedRecords = "";
+    if (!"".equals(strSelectedPaymentDetails) && strSelectedPaymentDetails != null) {
+      strSelectedRecords = strSelectedPaymentDetails;
+      strSelectedRecords = strSelectedRecords.replace("(", "");
+      strSelectedRecords = strSelectedRecords.replace(")", "");
+    }
     dao = new AdvPaymentMngtDao();
     final List<FIN_PaymentScheduleDetail> shownScheduledPaymentDetails = new ArrayList<FIN_PaymentScheduleDetail>();
     shownScheduledPaymentDetails.addAll(selectedScheduledPaymentDetails);
@@ -539,15 +666,50 @@
     FIN_PaymentScheduleDetail[] FIN_PaymentScheduleDetails = new FIN_PaymentScheduleDetail[0];
     FIN_PaymentScheduleDetails = shownScheduledPaymentDetails.toArray(FIN_PaymentScheduleDetails);
     FieldProvider[] data = FieldProviderFactory.getFieldProviderArray(shownScheduledPaymentDetails);
-    String dateFormat = OBPropertiesProvider.getInstance().getOpenbravoProperties().getProperty(
-        "dateFormat.java");
+    String dateFormat = OBPropertiesProvider.getInstance().getOpenbravoProperties()
+        .getProperty("dateFormat.java");
     SimpleDateFormat dateFormater = new SimpleDateFormat(dateFormat);
     // FIXME: added to access the FIN_PaymentSchedule and FIN_PaymentScheduleDetail tables to be
     // removed when new security implementation is done
     OBContext.setAdminMode();
     try {
+      for (int i = 0; i < data.length; i++) {
+        String selectedId = (selectedScheduledPaymentDetails
+            .contains(FIN_PaymentScheduleDetails[i])) ? FIN_PaymentScheduleDetails[i].getId() : "";
+        // If selectedId belongs to a grouping selection calculate whether it should be selected or
+        // not
+        if (!"".equals(selectedId) && !"".equals(strSelectedPaymentDetails)
+            && strSelectedPaymentDetails != null) {
+          StringTokenizer records = new StringTokenizer(strSelectedRecords, "'");
+          Set<String> recordSet = new LinkedHashSet<String>();
+          while (records.hasMoreTokens()) {
+            recordSet.add(records.nextToken());
+          }
+          if (recordSet.contains(selectedId)) {
+            FieldProviderFactory.setField(data[i], "finSelectedPaymentDetailId", selectedId);
+          } else {
+            String selectedRecord = FIN_PaymentScheduleDetails[i].getId();
+            // Find record which contains psdId
+            Set<String> psdIdSet = new LinkedHashSet<String>();
+            for (String record : recordSet) {
+              if (record.contains(selectedId)) {
+                selectedRecord = record;
+                StringTokenizer st = new StringTokenizer(record, ",");
+                while (st.hasMoreTokens()) {
+                  psdIdSet.add(st.nextToken());
+                }
+              }
+            }
+            String psdAmount = vars.getNumericParameter("inpPaymentAmount" + selectedRecord, "");
 
-      for (int i = 0; i < data.length; i++) {
+            HashMap<String, BigDecimal> idsAmounts = calculateAmounts(new BigDecimal(psdAmount),
+                psdIdSet);
+            FieldProviderFactory.setField(data[i], "finSelectedPaymentDetailId", selectedId);
+            FieldProviderFactory.setField(data[i], "paymentAmount", idsAmounts.get(selectedId)
+                .toString());
+          }
+        }
+
         FieldProviderFactory
             .setField(data[i], "finSelectedPaymentDetailId", (selectedScheduledPaymentDetails
                 .contains(FIN_PaymentScheduleDetails[i])) ? FIN_PaymentScheduleDetails[i].getId()
@@ -623,11 +785,18 @@
                 .getInvoicePaymentSchedule().getFINPaymentPriority().getColor());
           }
         } else {
-          FieldProviderFactory.setField(data[i], "dueDate", dateFormater.format(
-              FIN_PaymentScheduleDetails[i].getOrderPaymentSchedule().getDueDate()).toString());
-          FieldProviderFactory.setField(data[i], "transactionDate", dateFormater.format(
-              FIN_PaymentScheduleDetails[i].getOrderPaymentSchedule().getOrder().getOrderDate())
-              .toString());
+          FieldProviderFactory.setField(
+              data[i],
+              "dueDate",
+              dateFormater.format(
+                  FIN_PaymentScheduleDetails[i].getOrderPaymentSchedule().getDueDate()).toString());
+          FieldProviderFactory.setField(
+              data[i],
+              "transactionDate",
+              dateFormater
+                  .format(
+                      FIN_PaymentScheduleDetails[i].getOrderPaymentSchedule().getOrder()
+                          .getOrderDate()).toString());
           FieldProviderFactory.setField(data[i], "invoicedAmount", "");
           FieldProviderFactory.setField(data[i], "expectedAmount", FIN_PaymentScheduleDetails[i]
               .getOrderPaymentSchedule().getAmount().toString());
@@ -676,7 +845,10 @@
           strDifference = FIN_PaymentScheduleDetails[i].getAmount()
               .subtract(new BigDecimal(strPaymentAmt)).toString();
         }
-        FieldProviderFactory.setField(data[i], "paymentAmount", strPaymentAmt);
+        if (data[i].getField("paymentAmount") == null
+            || "".equals(data[i].getField("paymentAmount"))) {
+          FieldProviderFactory.setField(data[i], "paymentAmount", strPaymentAmt);
+        }
         FieldProviderFactory.setField(data[i], "difference", strDifference);
         FieldProviderFactory.setField(data[i], "rownum", String.valueOf(i));
 
@@ -718,14 +890,14 @@
       OBCriteria<FIN_PaymentScheduleDetail> psdFilter = OBDal.getInstance().createCriteria(
           FIN_PaymentScheduleDetail.class);
       psdFilter.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_CLIENT, psd.getClient()));
-      psdFilter.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_ORGANIZATION, psd
-          .getOrganization()));
+      psdFilter.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_ORGANIZATION,
+          psd.getOrganization()));
       psdFilter.add(Restrictions.isNull(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS));
       if (psd.getOrderPaymentSchedule() == null)
         psdFilter.add(Restrictions.isNull(FIN_PaymentScheduleDetail.PROPERTY_ORDERPAYMENTSCHEDULE));
       else
-        psdFilter.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_ORDERPAYMENTSCHEDULE, psd
-            .getOrderPaymentSchedule()));
+        psdFilter.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_ORDERPAYMENTSCHEDULE,
+            psd.getOrderPaymentSchedule()));
       if (psd.getInvoicePaymentSchedule() == null)
         psdFilter.add(Restrictions
             .isNull(FIN_PaymentScheduleDetail.PROPERTY_INVOICEPAYMENTSCHEDULE));
@@ -849,8 +1021,8 @@
     OBCriteria<FinAccPaymentMethod> psdFilter = OBDal.getInstance().createCriteria(
         FinAccPaymentMethod.class);
     psdFilter.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_ACCOUNT, payment.getAccount()));
-    psdFilter.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD, payment
-        .getPaymentMethod()));
+    psdFilter.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD,
+        payment.getPaymentMethod()));
     for (FinAccPaymentMethod paymentMethod : psdFilter.list()) {
       return payment.isReceipt() ? paymentMethod.isAutomaticDeposit() : paymentMethod
           .isAutomaticWithdrawn();
@@ -972,4 +1144,44 @@
     myMessage = (OBError) pb.getResult();
     return myMessage;
   }
+
+  public static List<FIN_PaymentScheduleDetail> getOutstandingPSDs(
+      FIN_PaymentScheduleDetail paymentScheduleDetail) {
+    OBContext.setAdminMode();
+    try {
+      OBCriteria<FIN_PaymentScheduleDetail> obc = OBDal.getInstance().createCriteria(
+          FIN_PaymentScheduleDetail.class);
+      obc.add(Restrictions.isNull(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS));
+      if (paymentScheduleDetail.getInvoicePaymentSchedule() != null) {
+        obc.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_INVOICEPAYMENTSCHEDULE,
+            paymentScheduleDetail.getInvoicePaymentSchedule()));
+      }
+      if (paymentScheduleDetail.getOrderPaymentSchedule() != null) {
+        obc.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_ORDERPAYMENTSCHEDULE,
+            paymentScheduleDetail.getOrderPaymentSchedule()));
+      }
+      return obc.list();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  public static List<FIN_PaymentScheduleDetail> getGLItemScheduleDetails(FIN_Payment payment) {
+    if (payment.getFINPaymentDetailList().size() > 0) {
+      OBContext.setAdminMode();
+      try {
+        OBCriteria<FIN_PaymentScheduleDetail> selectedGLItems = OBDal.getInstance().createCriteria(
+            FIN_PaymentScheduleDetail.class);
+        selectedGLItems.createAlias(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS, "pd");
+        selectedGLItems.add(Restrictions.in(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS,
+            payment.getFINPaymentDetailList()));
+        selectedGLItems.add(Restrictions.isNotNull("pd." + FIN_PaymentDetail.PROPERTY_GLITEM));
+        return selectedGLItems.list();
+      } finally {
+        OBContext.restorePreviousMode();
+      }
+    } else {
+      return new ArrayList<FIN_PaymentScheduleDetail>();
+    }
+  }
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Mon Jun 25 19:58:29 2012 +0200
@@ -83,13 +83,24 @@
       final ConnectionProvider conProvider = bundle.getConnection();
       final boolean isReceipt = payment.isReceipt();
 
-      payment.setProcessNow(true);
-      OBDal.getInstance().save(payment);
+      // payment.setProcessNow(true);
+      // OBDal.getInstance().save(payment);
       OBDal.getInstance().flush();
       if (strAction.equals("P") || strAction.equals("D")) {
+        // Guess if this is a refund payment
+        boolean isRefund = false;
+        if (payment.getFINPaymentDetailList().size() > 0
+            && payment.getFINPaymentDetailList().get(0).isRefund()) {
+          isRefund = true;
+        }
+        if (!isRefund) {
+          // Undo Used credit as it will be calculated again
+          payment.setUsedCredit(BigDecimal.ZERO);
+          OBDal.getInstance().save(payment);
+        }
         // Set APRM_Ready preference
-        if (!dao.existsAPRMReadyPreference()
-            && vars.getSessionValue("APRMT_MigrationToolRunning", "N").equals("Y")) {
+        if (vars.getSessionValue("APRMT_MigrationToolRunning", "N").equals("Y")
+            && !dao.existsAPRMReadyPreference()) {
           dao.createAPRMReadyPreference();
         }
 
@@ -163,33 +174,37 @@
               glitems.add(paymentDetail.getGLItem().getName());
           }
           // Set description
-          StringBuffer description = new StringBuffer();
-          if (payment.getDescription() != null && !payment.getDescription().equals(""))
-            description.append(payment.getDescription()).append("\n");
-          if (!invoiceDocNos.isEmpty()) {
-            description.append(Utility.messageBD(conProvider, "InvoiceDocumentno", language));
-            description.append(": ").append(
-                invoiceDocNos.toString().substring(1, invoiceDocNos.toString().length() - 1));
-            description.append("\n");
+          if (bundle.getParams().get("isPOSOrder") == null
+              || !bundle.getParams().get("isPOSOrder").equals("Y")) {
+            StringBuffer description = new StringBuffer();
+
+            if (payment.getDescription() != null && !payment.getDescription().equals(""))
+              description.append(payment.getDescription()).append("\n");
+            if (!invoiceDocNos.isEmpty()) {
+              description.append(Utility.messageBD(conProvider, "InvoiceDocumentno", language));
+              description.append(": ").append(
+                  invoiceDocNos.toString().substring(1, invoiceDocNos.toString().length() - 1));
+              description.append("\n");
+            }
+            if (!orderDocNos.isEmpty()) {
+              description.append(Utility.messageBD(conProvider, "OrderDocumentno", language));
+              description.append(": ").append(
+                  orderDocNos.toString().substring(1, orderDocNos.toString().length() - 1));
+              description.append("\n");
+            }
+            if (!glitems.isEmpty()) {
+              description.append(Utility.messageBD(conProvider, "APRM_GLItem", language));
+              description.append(": ").append(
+                  glitems.toString().substring(1, glitems.toString().length() - 1));
+              description.append("\n");
+            }
+            if (!"".equals(strRefundCredit))
+              description.append(strRefundCredit).append("\n");
+
+            String truncateDescription = (description.length() > 255) ? description
+                .substring(0, 252).concat("...").toString() : description.toString();
+            payment.setDescription(truncateDescription);
           }
-          if (!orderDocNos.isEmpty()) {
-            description.append(Utility.messageBD(conProvider, "OrderDocumentno", language));
-            description.append(": ").append(
-                orderDocNos.toString().substring(1, orderDocNos.toString().length() - 1));
-            description.append("\n");
-          }
-          if (!glitems.isEmpty()) {
-            description.append(Utility.messageBD(conProvider, "APRM_GLItem", language));
-            description.append(": ").append(
-                glitems.toString().substring(1, glitems.toString().length() - 1));
-            description.append("\n");
-          }
-          if (!"".equals(strRefundCredit))
-            description.append(strRefundCredit).append("\n");
-
-          String truncateDescription = (description.length() > 255) ? description.substring(0, 252)
-              .concat("...").toString() : description.toString();
-          payment.setDescription(truncateDescription);
 
           if (paymentAmount.compareTo(payment.getAmount()) != 0) {
             payment.setUsedCredit(paymentAmount.subtract(payment.getAmount()));
@@ -237,9 +252,9 @@
               payment.isReceipt())) {
             try {
               payment.setStatus("RPAE");
-              payment.setProcessNow(false);
-              OBDal.getInstance().save(payment);
-              OBDal.getInstance().flush();
+              // payment.setProcessNow(false);
+              // OBDal.getInstance().save(payment);
+              // OBDal.getInstance().flush();
 
               if (dao.hasNotDeferredExecutionProcess(payment.getAccount(),
                   payment.getPaymentMethod(), payment.isReceipt())) {
@@ -338,7 +353,7 @@
               }
             }
             payment.setStatus(isReceipt ? "RPR" : "PPM");
-            if ((FIN_Utility.isAutomaticDepositWithdrawn(payment) || strAction.equals("D"))
+            if ((strAction.equals("D") || FIN_Utility.isAutomaticDepositWithdrawn(payment))
                 && payment.getAmount().compareTo(BigDecimal.ZERO) != 0)
               triggerAutomaticFinancialAccountTransaction(vars, conProvider, payment);
           }
@@ -523,7 +538,7 @@
         // ***********************
         // Reactivate Payment
         // ***********************
-      } else if (strAction.equals("R")) {
+      } else if (strAction.equals("R") || strAction.equals("RE")) {
         // Already Posted Document
         if ("Y".equals(payment.getPosted())) {
           msg.setType("Error");
@@ -573,8 +588,6 @@
         OBDal.getInstance().save(payment);
         OBDal.getInstance().flush();
         payment.setWriteoffAmount(BigDecimal.ZERO);
-        payment.setAmount(BigDecimal.ZERO);
-        payment.setFinancialTransactionAmount(BigDecimal.ZERO);
 
         payment.setDescription("");
 
@@ -615,21 +628,45 @@
           for (FIN_PaymentDetail paymentDetail : paymentDetails) {
             // If an original payment plan is defined, all the details are removed, before removing
             // the payment schedule details associated lines
-            OBCriteria<FIN_OrigPaymentScheduleDetail> origPaymSchedDetails = OBDal.getInstance()
-                .createCriteria(FIN_OrigPaymentScheduleDetail.class);
-            origPaymSchedDetails.add(Restrictions.in(
-                FIN_OrigPaymentScheduleDetail.PROPERTY_PAYMENTSCHEDULEDETAIL,
-                paymentDetail.getFINPaymentScheduleDetailList()));
-            for (FIN_OrigPaymentScheduleDetail origPaymSchedDetail : origPaymSchedDetails.list()) {
-              OBDal.getInstance().remove(
-                  OBDal.getInstance().get(FIN_OrigPaymentScheduleDetail.class,
-                      origPaymSchedDetail.getId()));
+            if (paymentDetail.getFINPaymentScheduleDetailList().size() > 0) {
+              OBCriteria<FIN_OrigPaymentScheduleDetail> origPaymSchedDetails = OBDal.getInstance()
+                  .createCriteria(FIN_OrigPaymentScheduleDetail.class);
+              origPaymSchedDetails.add(Restrictions.in(
+                  FIN_OrigPaymentScheduleDetail.PROPERTY_PAYMENTSCHEDULEDETAIL,
+                  paymentDetail.getFINPaymentScheduleDetailList()));
+              for (FIN_OrigPaymentScheduleDetail origPaymSchedDetail : origPaymSchedDetails.list()) {
+                OBDal.getInstance().remove(
+                    OBDal.getInstance().get(FIN_OrigPaymentScheduleDetail.class,
+                        origPaymSchedDetail.getId()));
+              }
             }
             removedPDS = new ArrayList<FIN_PaymentScheduleDetail>();
             for (FIN_PaymentScheduleDetail paymentScheduleDetail : paymentDetail
                 .getFINPaymentScheduleDetailList()) {
-              BigDecimal amount = paymentScheduleDetail.getAmount().add(
-                  paymentScheduleDetail.getWriteoffAmount());
+              BigDecimal psdWriteoffAmount = paymentScheduleDetail.getWriteoffAmount();
+              BigDecimal psdAmount = paymentScheduleDetail.getAmount();
+              BigDecimal amount = psdAmount.add(psdWriteoffAmount);
+              if (psdWriteoffAmount.signum() != 0 && strAction.equals("RE")) {
+                // Restore write off
+                List<FIN_PaymentScheduleDetail> outstandingPDSs = FIN_AddPayment
+                    .getOutstandingPSDs(paymentScheduleDetail);
+                if (outstandingPDSs.size() > 0) {
+                  outstandingPDSs.get(0).setAmount(
+                      outstandingPDSs.get(0).getAmount().add(psdWriteoffAmount));
+                  OBDal.getInstance().save(outstandingPDSs.get(0));
+                } else {
+                  FIN_PaymentScheduleDetail outstandingPSD = (FIN_PaymentScheduleDetail) DalUtil
+                      .copy(paymentScheduleDetail, false);
+                  outstandingPSD.setAmount(psdWriteoffAmount);
+                  outstandingPSD.setWriteoffAmount(BigDecimal.ZERO);
+                  outstandingPSD.setPaymentDetails(null);
+                  OBDal.getInstance().save(outstandingPSD);
+                }
+                paymentScheduleDetail.setWriteoffAmount(BigDecimal.ZERO);
+                paymentScheduleDetail.getPaymentDetails().setWriteoffAmount(BigDecimal.ZERO);
+                OBDal.getInstance().save(paymentScheduleDetail.getPaymentDetails());
+                OBDal.getInstance().save(paymentScheduleDetail);
+              }
               if (paymentScheduleDetail.getInvoicePaymentSchedule() != null) {
                 // Remove invoice description related to the credit payments
                 final Invoice invoice = paymentScheduleDetail.getInvoicePaymentSchedule()
@@ -652,9 +689,9 @@
                   }
                 }
                 if (restorePaidAmounts) {
-                  FIN_AddPayment.updatePaymentScheduleAmounts(paymentScheduleDetail
-                      .getInvoicePaymentSchedule(), paymentScheduleDetail.getAmount().negate(),
-                      paymentScheduleDetail.getWriteoffAmount().negate());
+                  FIN_AddPayment.updatePaymentScheduleAmounts(
+                      paymentScheduleDetail.getInvoicePaymentSchedule(), psdAmount.negate(),
+                      psdWriteoffAmount.negate());
                   // BP SO_CreditUsed
                   businessPartner = paymentScheduleDetail.getInvoicePaymentSchedule().getInvoice()
                       .getBusinessPartner();
@@ -666,9 +703,9 @@
                 }
               }
               if (paymentScheduleDetail.getOrderPaymentSchedule() != null && restorePaidAmounts) {
-                FIN_AddPayment.updatePaymentScheduleAmounts(paymentScheduleDetail
-                    .getOrderPaymentSchedule(), paymentScheduleDetail.getAmount().negate(),
-                    paymentScheduleDetail.getWriteoffAmount().negate());
+                FIN_AddPayment.updatePaymentScheduleAmounts(
+                    paymentScheduleDetail.getOrderPaymentSchedule(), psdAmount.negate(),
+                    psdWriteoffAmount.negate());
               }
               // when generating credit for a BP SO_CreditUsed is also updated
               if (paymentScheduleDetail.getInvoicePaymentSchedule() == null
@@ -682,11 +719,16 @@
                   decreaseCustomerCredit(businessPartner, amount);
                 }
               }
-              removedPDS.add(paymentScheduleDetail);
-              FIN_AddPayment.mergePaymentScheduleDetails(paymentScheduleDetail);
+              if (strAction.equals("R")
+                  || (strAction.equals("RE")
+                      && paymentScheduleDetail.getInvoicePaymentSchedule() == null
+                      && paymentScheduleDetail.getOrderPaymentSchedule() == null && paymentScheduleDetail
+                      .getPaymentDetails().getGLItem() == null)) {
+                removedPDS.add(paymentScheduleDetail);
+                FIN_AddPayment.mergePaymentScheduleDetails(paymentScheduleDetail);
+              }
             }
             paymentDetail.getFINPaymentScheduleDetailList().removeAll(removedPDS);
-            OBDal.getInstance().getSession().refresh(paymentDetail);
             // If there is any schedule detail with amount zero, those are deleted
             for (FIN_PaymentScheduleDetail psd : removedPDS) {
               if (BigDecimal.ZERO.compareTo(psd.getAmount()) == 0
@@ -706,8 +748,10 @@
             OBDal.getInstance().remove(OBDal.getInstance().get(FIN_PaymentDetail.class, pdToRm));
           }
           payment.getFINPaymentDetailList().removeAll(removedPD);
-          payment.getCurrencyConversionRateDocList().removeAll(conversionRates);
-          payment.setFinancialTransactionConvertRate(BigDecimal.ZERO);
+          if (strAction.equals("R")) {
+            payment.getCurrencyConversionRateDocList().removeAll(conversionRates);
+            payment.setFinancialTransactionConvertRate(BigDecimal.ZERO);
+          }
           OBDal.getInstance().save(payment);
 
           if (payment.getGeneratedCredit().compareTo(BigDecimal.ZERO) == 0
@@ -750,7 +794,9 @@
           }
           payment.getFINPaymentCreditList().clear();
           payment.setGeneratedCredit(BigDecimal.ZERO);
-          payment.setUsedCredit(BigDecimal.ZERO);
+          if (strAction.equals("R")) {
+            payment.setUsedCredit(BigDecimal.ZERO);
+          }
 
         } finally {
           OBDal.getInstance().flush();
@@ -897,20 +943,23 @@
         }
       }
 
-      payment.setProcessNow(false);
-      OBDal.getInstance().save(payment);
-      OBDal.getInstance().flush();
+      // payment.setProcessNow(false);
+      // OBDal.getInstance().save(payment);
+      // OBDal.getInstance().flush();
 
       // When payment is reversed, original payment plan is updated to reverse a particular original
       // payment plan details (the ones related with payment which is reverted) so this step can be
       // skipped
-      if (!"Y".equals(isReversedPayment) && !updateOriginalPaymentPlanInformation(payment)) {
-        msg.setType("Error");
-        msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
-            "@CouldNotUpdateOriginalPaymentPlan@"));
-        bundle.setResult(msg);
-        OBDal.getInstance().rollbackAndClose();
-        return;
+      if (bundle.getParams().get("isPOSOrder") == null
+          || !bundle.getParams().get("isPOSOrder").equals("Y")) {
+        if (!"Y".equals(isReversedPayment) && !updateOriginalPaymentPlanInformation(payment)) {
+          msg.setType("Error");
+          msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
+              "@CouldNotUpdateOriginalPaymentPlan@"));
+          bundle.setResult(msg);
+          OBDal.getInstance().rollbackAndClose();
+          return;
+        }
       }
 
       bundle.setResult(msg);
@@ -966,6 +1015,7 @@
    */
   private void removeExistingOrigDetails(FIN_Payment payment) {
     if (payment.getFINPaymentDetailList().size() > 0) {
+
       ArrayList<String> opsdToRemove = new ArrayList<String>();
       OBCriteria<FIN_PaymentScheduleDetail> criOpsd = OBDal.getInstance().createCriteria(
           FIN_PaymentScheduleDetail.class);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Mon Jun 25 19:58:29 2012 +0200
@@ -62,9 +62,9 @@
 
       OBContext.setAdminMode();
       try {
-        transaction.setProcessNow(true);
-        OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
+        // transaction.setProcessNow(true);
+        // OBDal.getInstance().save(transaction);
+        // OBDal.getInstance().flush();
         if (strAction.equals("P")) {
           // ***********************
           // Process Transaction
@@ -146,9 +146,9 @@
           OBDal.getInstance().flush();
           bundle.setResult(msg);
         }
-        transaction.setProcessNow(false);
-        OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
+        // transaction.setProcessNow(false);
+        // OBDal.getInstance().save(transaction);
+        // OBDal.getInstance().flush();
       } finally {
         OBContext.restorePreviousMode();
       }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Mon Jun 25 19:58:29 2012 +0200
@@ -44,6 +44,7 @@
 import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.client.kernel.reference.UIDefinitionController;
+import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.security.OrganizationStructureProvider;
 import org.openbravo.dal.service.OBCriteria;
@@ -59,6 +60,7 @@
 import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.DocumentType;
 import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.model.common.enterprise.OrganizationInformation;
 import org.openbravo.model.common.invoice.Invoice;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
@@ -925,7 +927,8 @@
       // By default take the invoice document number
       invoiceDocNo = invoice.getDocumentNo();
 
-      final String paymentDescription = organization.getOrganizationInformationList().get(0)
+      final String paymentDescription = OBDal.getInstance()
+          .get(OrganizationInformation.class, ((String) DalUtil.getId(organization)))
           .getAPRMPaymentDescription();
       // In case of a purchase invoice and the Supplier Reference is selected use Reference
       if (paymentDescription.equals("Supplier Reference") && !invoice.isSalesTransaction()) {
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js	Mon Jun 25 19:58:29 2012 +0200
@@ -283,7 +283,9 @@
   if (actualConverted && expectedConverted && exchangeRate) {
     if (recalcExchangeRate) {
       if (actualConverted.value && actualPayment.value) {
-        exchangeRate.value = formattedNumberOpTemp(actualConverted.value, '/', actualPayment.value, roundedMask, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+        if (compare(actualPayment.value, '!=', 0)) {
+          exchangeRate.value = formattedNumberOpTemp(actualConverted.value, '/', actualPayment.value, roundedMask, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+        }
       } else {
         exchangeRate.value = '';
       }
@@ -484,6 +486,8 @@
 
 function distributeAmount(_amount) {
   var amount = applyFormat(_amount);
+  var distributedAmount = 0;
+  var keepSelection = false;
   var chk = frm.inpScheduledPaymentDetailId;
   var scheduledPaymentDetailId, outstandingAmount, j, i;
   if (isGLItemEnabled) {
@@ -496,21 +500,45 @@
   } else if (!chk.length) {
     scheduledPaymentDetailId = frm.inpRecordId0.value;
     outstandingAmount = frm.elements["inpRecordAmt" + scheduledPaymentDetailId].value;
-    if (compare(outstandingAmount, '>', amount)) {
-      outstandingAmount = amount;
+    if (compare(outstandingAmount, '<', 0) && compare(amount, '<', 0)) {
+      if (compare(abs(outstandingAmount), '>', abs(amount))) {
+        outstandingAmount = amount;
+      }
+    } else {
+      if (compare(outstandingAmount, '>', amount)) {
+        outstandingAmount = amount;
+      }
     }
     frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value = outstandingAmount;
-    if (!chk.checked) {
+    if (!chk.checked && compare(outstandingAmount, '!=', 0)) {
       chk.checked = true;
       updateData(chk.value, chk.checked);
     }
   } else {
     var total = chk.length;
     for (i = 0; i < total; i++) {
+      if (chk[i].checked) {
+        distributedAmount = add(distributedAmount, frm.elements["inpPaymentAmount" + chk[i].value].value);
+      }
+    }
+    if (compare(amount, '>', distributedAmount) || compare(amount, '==', distributedAmount)) {
+      amount = subtract(amount, distributedAmount);
+      keepSelection = true;
+    }
+    for (i = 0; i < total; i++) {
+      if (chk[i].checked && keepSelection) {
+        continue;
+      }
       scheduledPaymentDetailId = frm.elements["inpRecordId" + i].value;
       outstandingAmount = frm.elements["inpRecordAmt" + scheduledPaymentDetailId].value;
-      if (compare(outstandingAmount, '>', amount)) {
-        outstandingAmount = amount;
+      if (compare(outstandingAmount, '<', 0) && compare(amount, '<', 0)) {
+        if (compare(abs(outstandingAmount), '>', abs(amount))) {
+          outstandingAmount = amount;
+        }
+      } else {
+        if (compare(outstandingAmount, '>', amount)) {
+          outstandingAmount = amount;
+        }
       }
       if (compare(amount, '==', 0)) {
         frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value = "";
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <NAME><![CDATA[JBoss Weld]]></NAME>
-<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.16746]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.16854]]></VERSION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <DESCRIPTION><![CDATA[JBoss Weld]]></DESCRIPTION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <HELP><![CDATA[Provides the JBoss Weld framework: Java Contexts and Dependency Injection for the Java EE platform (CDI). For more information see http://seamframework.org/Weld]]></HELP>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <URL><![CDATA[http://forge.openbravo.com/projects/weld]]></URL>
@@ -22,7 +22,7 @@
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <UPDATEINFO><![CDATA[Bug fixing.]]></UPDATEINFO>
-<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--C70732EA90A14EC0916078B85CC33D2D--></AD_MODULE>
 
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <AD_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_MODULE_ID>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <NAME><![CDATA[User Interface Application]]></NAME>
-<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.16746]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.16854]]></VERSION>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <DESCRIPTION><![CDATA[Provides the main application components for the openbravo user interface]]></DESCRIPTION>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <HELP><![CDATA[Provides the main application components for the openbravo user interface. The main layout incorporates a navigation bar and a main view area.]]></HELP>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <URL><![CDATA[http://forge.openbravo.com/projects/clientapplication]]></URL>
@@ -22,7 +22,7 @@
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <UPDATEINFO><![CDATA[Styling bugfixing]]></UPDATEINFO>
-<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--9BA0836A3CD74EE4AB48753A47211BCC--></AD_MODULE>
 
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--60A170212F36499D83B8AD38D01F46B3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--60A170212F36499D83B8AD38D01F46B3-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--824D60CB352E4099B1D8C903CA139DAE-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.16746]]></STARTVERSION>
+<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.16854]]></STARTVERSION>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java	Mon Jun 25 19:58:29 2012 +0200
@@ -80,6 +80,7 @@
   @Override
   public List<ComponentResource> getGlobalComponentResources() {
     final List<ComponentResource> globalResources = new ArrayList<ComponentResource>();
+
     globalResources.add(createStaticResource(
         "web/org.openbravo.client.application/js/utilities/ob-utilities.js", true));
     globalResources.add(createStaticResource(
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ParameterUtils.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ParameterUtils.java	Mon Jun 25 19:58:29 2012 +0200
@@ -19,7 +19,6 @@
 package org.openbravo.client.application;
 
 import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Map;
 
@@ -64,12 +63,12 @@
 
   private static void setValue(ParameterValue parameterValue, String stringValue) {
     DomainType domainType = getParameterDomainType(parameterValue.getParameter());
-    final SimpleDateFormat xmlDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
     try {
       if (domainType.getClass().equals(StringDomainType.class)) {
         parameterValue.setValueString(stringValue);
       } else if (domainType.getClass().equals(DateDomainType.class)) {
-        Date date = xmlDateFormat.parse(stringValue);
+        DateDomainType dateDomainType = (DateDomainType) domainType;
+        Date date = (Date) dateDomainType.createFromString(stringValue);
         parameterValue.setValueDate(date);
       } else if (domainType.getClass().getSuperclass().equals(BigDecimalDomainType.class)
           || domainType.getClass().equals(LongDomainType.class)) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java	Mon Jun 25 19:58:29 2012 +0200
@@ -79,7 +79,10 @@
         objCloneOrdLine.setReservedQuantity(new BigDecimal("0"));
         objCloneOrdLine.setDeliveredQuantity(new BigDecimal("0"));
         objCloneOrdLine.setInvoicedQuantity(new BigDecimal("0"));
-        objCloneOrdLine.setListPrice(bdPriceList);
+        if (!"".equals(bdPriceList) || bdPriceList != null
+            || !bdPriceList.equals(BigDecimal.ZERO.setScale(bdPriceList.scale()))) {
+          objCloneOrdLine.setListPrice(bdPriceList);
+        }
         objCloneOrder.getOrderLineList().add(objCloneOrdLine);
         objCloneOrdLine.setSalesOrder(objCloneOrder);
       }
@@ -98,7 +101,7 @@
 
   private String getPriceListVersion(String priceList, String clientId) {
     try {
-      String whereClause = " as plv , PricingPriceList pl where pl.id=plv.id and plv.active='Y' and "
+      String whereClause = " as plv left outer join plv.priceList pl where plv.active='Y' and plv.active='Y' and "
           + " pl.id = :priceList and plv.client.id = :clientId order by plv.validFromDate desc";
 
       OBQuery<PriceListVersion> ppriceListVersion = OBDal.getInstance().createQuery(
@@ -135,7 +138,7 @@
   public static BigDecimal getLineNetAmt(String strOrderId) {
 
     BigDecimal bdLineNetAmt = new BigDecimal("0");
-    final String readLineNetAmtHql = " select (ol.lineNetAmount + ol.freightAmount + ol.chargeAmount) as LineNetAmt from OrderLine ol where ol.salesOrder.id=?";
+    final String readLineNetAmtHql = " select (coalesce(ol.lineNetAmount,0) + coalesce(ol.freightAmount,0) + coalesce(ol.chargeAmount,0)) as LineNetAmt from OrderLine ol where ol.salesOrder.id=?";
     final Query readLineNetAmtQry = OBDal.getInstance().getSession().createQuery(readLineNetAmtHql);
     readLineNetAmtQry.setString(0, strOrderId);
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Mon Jun 25 19:58:29 2012 +0200
@@ -90,6 +90,7 @@
     }
     Table table = OBDal.getInstance().get(Table.class, tableId);
     Hibernate.initialize(table);
+    Hibernate.initialize(table.getADColumnList());
     tableMap.put(tableId, table);
     return table;
   }
@@ -148,9 +149,11 @@
   }
 
   private void initializeReference(Reference reference) {
+    Hibernate.initialize(reference.getADReferencedTableList());
     for (ReferencedTable t : reference.getADReferencedTableList()) {
       Hibernate.initialize(t);
     }
+    Hibernate.initialize(reference.getOBUISELSelectorList());
     for (Selector s : reference.getOBUISELSelectorList()) {
       Hibernate.initialize(s);
       SelectorField displayField = s.getDisplayfield();
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Mon Jun 25 19:58:29 2012 +0200
@@ -59,6 +59,27 @@
     if (isc.isA.String(value) && (value.contains('+') || value.contains('-'))) {
       value = isc.Time.parseInput(value, null, null, true);
     }
+	if (value && isc.isA.String(value)) {
+	  value = isc.Time.parseInput(value);
+	}
+	if (value && isc.isA.Date(value)) {
+	  this.setTodaysDate(value);	
+	} 
     return this.Super('setValue', arguments);
-  }
+  },
+  
+  getValue: function () {
+	var value = this.Super('getValue', arguments);
+	if (value && isc.isA.Date(value)) {
+		  this.setTodaysDate(value);	
+		} 
+	return value;
+  },
+  
+  setTodaysDate: function(date) {
+	  var today = new Date();
+	  date.setYear(today.getFullYear());
+	  date.setMonth(today.getMonth());
+	  date.setDate(today.getDate());
+  }  
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-yesno.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-yesno.js	Mon Jun 25 19:58:29 2012 +0200
@@ -55,15 +55,15 @@
   },
   formatPickListValue: function (value, record, field, rowNum, colNum) {
     return OB.Utilities.getYesNoDisplayValue(value);
-  }, 
-  
-  getCriterion: function() {
-	  var criterion = this.Super('getCriterion', arguments);
-	  if (criterion && criterion.value && criterion.value === OB.I18N.labels.OBUIAPP_Yes) {
-		  criterion.value = true;
-	  } else if (criterion && criterion.value && criterion.value === OB.I18N.labels.OBUIAPP_No) {
-		  criterion.value = false;
-	  }
-	  return criterion;
+  },
+
+  getCriterion: function () {
+    var criterion = this.Super('getCriterion', arguments);
+    if (criterion && criterion.value && criterion.value === OB.I18N.labels.OBUIAPP_Yes) {
+      criterion.value = true;
+    } else if (criterion && criterion.value && criterion.value === OB.I18N.labels.OBUIAPP_No) {
+      criterion.value = false;
+    }
+    return criterion;
   }
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Jun 25 19:58:29 2012 +0200
@@ -182,10 +182,19 @@
     }
   },
 
-  editRecord: function (record, preventFocus, hasChanges, focusFieldName) {
+  editRecord: function (record, preventFocus, hasChanges, focusFieldName, isLocalTime) {
+    var timeFields, ret;
     this.clearValues();
+    // if editRecord is called from OBStandardView.editRecord, then the time fields have already
+    //   be converted from UTC to local time
+    // if editRecord is called from fetchDataReply (ActionMethod.js) then the record comes directly  
+    //   from the datasource, so it has to be converted from UTC to local time
+    // see issue https://issues.openbravo.com/view.php?id=20684
+    if (!isLocalTime) {
+      OB.Utilities.Date.convertUTCTimeToLocalTime([record], this.fields);
+    }
 
-    var ret = this.Super('editRecord', arguments);
+    ret = this.Super('editRecord', arguments);
 
     // used when clicking on a cell in a grid
     if (!preventFocus && focusFieldName) {
@@ -909,7 +918,7 @@
     var typeInstance;
     var assignValue;
     var assignClassicValue;
-    var isDate, i, valueMap = {},
+    var isDate, isDateTime, i, valueMap = {},
         oldValue, field = this.getFieldFromColumnName(columnName),
         entries = columnValue.entries;
     // not a field on the form, probably a datasource field
@@ -962,9 +971,12 @@
       // note: do not use clearvalue as this removes the value from the form
       this.setValue(field.name, null);
     } else if (columnValue.value || columnValue.value === 0 || columnValue.value === false) {
-      isDate = field.type && (isc.SimpleType.getType(field.type).inheritsFrom === 'date' || isc.SimpleType.getType(field.type).inheritsFrom === 'datetime' || isc.SimpleType.getType(field.type).inheritsFrom === 'time');
+      isDate = field.type && (isc.SimpleType.getType(field.type).inheritsFrom === 'date' || isc.SimpleType.getType(field.type).inheritsFrom === 'time');
+      isDateTime = field.type && isc.SimpleType.getType(field.type).inheritsFrom === 'datetime';
       if (isDate) {
         this.setItemValue(field.name, isc.Date.parseSchemaDate(columnValue.value));
+      } else if (isDateTime) {
+        this.setItemValue(field.name, isc.Date.parseStandardDate(columnValue.value));
       } else if (columnValue.hasDateDefault) {
         this.setItemValue(field.name, columnValue.classicValue);
       } else {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Jun 25 19:58:29 2012 +0200
@@ -198,10 +198,16 @@
     },
 
     transformData: function (newData, dsResponse) {
-      var i, length;
-
+      var i, length, timeFields;
+
+      // when the data is received from the datasource, time fields are formatted in UTC time. They have to be converted to local time
+      if (dsResponse && dsResponse.context && (dsResponse.context.operationType === 'fetch' || dsResponse.context.operationType === 'update' || dsResponse.context.operationType === 'add')) {
+        if (this.grid) {
+          OB.Utilities.Date.convertUTCTimeToLocalTime(newData, this.grid.completeFields);
+        }
+      }
       // only do this stuff for fetch operations, in other cases strange things
-      // happen as update/delete operations do not return the totalRows parameter
+      // happen as update/delete operations do not return the totalRows parameter      
       if (dsResponse && dsResponse.context && dsResponse.context.operationType !== 'fetch') {
         return;
       }
@@ -1096,7 +1102,8 @@
   },
 
   convertCriteria: function (criteria) {
-    var selectedValues, prop, fld, value, i, criterion, fldName, length;
+    var selectedValues, prop, fld, value, i, j, k, criterion, fldName, length, today = new Date(),
+        currentTimeZoneOffsetInMinutes = -today.getTimezoneOffset();
 
     if (!criteria) {
       criteria = {};
@@ -1180,7 +1187,9 @@
       }
     }
 
-    // get rid of some unneeded stuff in the criteria
+    // Iterates all the criterias
+    // -If they are not needed, they are removed
+    // -Otherwise, if it is a datetime criteria, the UTC offset in minutes is added
     if (criteria && criteria.criteria) {
       var internalCriteria = criteria.criteria;
       for (i = (internalCriteria.length - 1); i >= 0; i--) {
@@ -1194,6 +1203,27 @@
         }
         if (shouldRemove) {
           internalCriteria.removeAt(i);
+        } else {
+          var fieldName;
+          //The first name a date time field is filtered, the fieldName is stored in criteria.criteria[i].criteria[0].fieldName
+          if (criteria.criteria[i].criteria && criteria.criteria[i].criteria[0]) {
+            fieldName = criteria.criteria[i].criteria[0].fieldName;
+          } else { //After the first time, the fieldName is stored in criteria.criteria[i].fieldName
+            fieldName = criteria.criteria[i].fieldName;
+          }
+
+          for (j = 0; j < this.fields.length; j++) {
+            if (this.fields[j].name === fieldName && isc.SimpleType.getType(this.fields[j].type).inheritsFrom === "datetime") {
+              if (criteria.criteria[i].criteria) {
+                for (k = 0; k < criteria.criteria[i].criteria.length; k++) {
+                  criteria.criteria[i].criteria[k].minutesTimezoneOffset = currentTimeZoneOffsetInMinutes;
+                }
+              } else {
+                criteria.criteria[i].minutesTimezoneOffset = currentTimeZoneOffsetInMinutes;
+              }
+              break;
+            }
+          }
         }
       }
     }
@@ -2216,6 +2246,9 @@
       editForm.clearValues();
       // clear the errors so that they don't show up at the next row
       editForm.clearErrors();
+      // do not save the focus item to prevent wrong validations when creating a new row
+      // see issue 20537 (https://issues.openbravo.com/view.php?id=20537)
+      editForm.setFocusItem(null);
     }
 
     delete this._hidingInlineEditor;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Mon Jun 25 19:58:29 2012 +0200
@@ -1017,7 +1017,9 @@
   // Opens the edit form and selects the record in the grid, will refresh
   // child views also
   editRecord: function (record, preventFocus, focusFieldName) {
-
+    var rowNum,
+    // at this point the time fields of the record are formatted in local time
+    localTime = true;
     this.messageBar.hide();
 
     if (!this.isShowingForm) {
@@ -1033,8 +1035,8 @@
 
       // also handle the case that there are unsaved values in the grid
       // show them in the form
-      var rowNum = this.viewGrid.getRecordIndex(record);
-      this.viewForm.editRecord(this.viewGrid.getEditedRecord(rowNum), preventFocus, this.viewGrid.recordHasChanges(rowNum), focusFieldName);
+      rowNum = this.viewGrid.getRecordIndex(record);
+      this.viewForm.editRecord(this.viewGrid.getEditedRecord(rowNum), preventFocus, this.viewGrid.recordHasChanges(rowNum), focusFieldName, localTime);
     }
   },
 
@@ -1892,13 +1894,30 @@
   },
 
   convertContextValue: function (value, type) {
-    var isTime = isc.isA.Date(value) && type && isc.SimpleType.getType(type).inheritsFrom === 'time';
+    var isTime;
+    // if a string is received, it is converted to a date so that the function
+    //   is able to return its UTC time in the HH:mm:ss format
+    if (isc.isA.String(value) && value.length > 0 && type && isc.SimpleType.getType(type).inheritsFrom === 'time') {
+      value = this.convertToDate(value);
+    }
+    isTime = isc.isA.Date(value) && type && isc.SimpleType.getType(type).inheritsFrom === 'time';
     if (isTime) {
       return value.getUTCHours() + ':' + value.getUTCMinutes() + ':' + value.getUTCSeconds();
     }
     return value;
   },
 
+  convertToDate: function (stringValue) {
+    var today = new Date(),
+        dateValue = isc.Time.parseInput(stringValue);
+    // Only the time is relevant. In order to be able to convert it from UTC to local time
+    //   properly the date value should be today's date
+    dateValue.setYear(today.getFullYear());
+    dateValue.setMonth(today.getMonth());
+    dateValue.setDate(today.getDate());
+    return dateValue;
+  },
+
   getPropertyDefinition: function (property) {
     var properties = this.propertyToColumns,
         i, length = properties.length;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalization-treegrid.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalization-treegrid.js	Mon Jun 25 19:58:29 2012 +0200
@@ -47,7 +47,7 @@
   closedIconSuffix: 'closed',
   openIconSuffix: 'open',
   selectionType: 'single',
-  
+
   fields: [{
     name: 'title',
     canHover: true,
@@ -255,7 +255,7 @@
     this.deselectAllRecords();
     this.selectRecord(record);
   },
-  
+
   // overridden to create context menu items specific 
   // for the clicked record
   cellContextClick: function (record, rowNum, colNum) {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js	Mon Jun 25 19:58:29 2012 +0200
@@ -524,7 +524,7 @@
       prompt: OB.I18N.getLabel('OBUIAPP_Personalization_Toolbar_Delete'),
       updateState: function () {
         // never allow delete when opened from the maintenance window
-        this.setDisabled(this.openedFromMaintenanceWindow || !this.view.form.view.getFormPersonalization(false) || !this.view.form.view.getFormPersonalization(false).canDelete);
+        this.setDisabled(this.view.openedFromMaintenanceWindow || (this.view.form && (!this.view.form.view.getFormPersonalization(false) || !this.view.form.view.getFormPersonalization(false).canDelete)));
       },
       keyboardShortcutId: 'ToolBar_Eliminate'
     };
@@ -589,7 +589,7 @@
   // save the new form layout to the server and updates the preview form
   save: function (callback) {
     var params, me = this,
-        newDataFields, formPers = this.form.view.getFormPersonalization();
+        newDataFields, formPers = (this.openedFromMaintenanceWindow ? this.personalizationData : this.form.view.getFormPersonalization());
 
     // if there is a personalization id then use that
     // this ensures that a specific record will be updated
@@ -644,7 +644,10 @@
       // overwrite what we have
       me.personalizationData.form = newDataFields;
 
-      me.form.view.standardWindow.updateFormPersonalization(me.form.view, me.personalizationData);
+      if (!me.openedFromMaintenanceWindow) {
+        // called from normal window
+        me.form.view.standardWindow.updateFormPersonalization(me.form.view, me.personalizationData);
+      }
 
       me.initializing = true;
       me.isNew = false;
@@ -698,6 +701,9 @@
 
       personalization = me.getStandardWindow().getClass().personalization;
       personalization[me.tabId] = null;
+      if (me.getStandardWindow().getClass().personalization.forms) {
+        me.getStandardWindow().getClass().personalization.forms[me.tabId] = null;
+      }
     });
   },
 
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js	Mon Jun 25 19:58:29 2012 +0200
@@ -174,6 +174,7 @@
     })];
 
     this.Super('initWidget', arguments);
+    OB.TestRegistry.register('org.openbravo.client.application.process.pickandexecute.popup', this);
 
     if (this.viewGrid.saveLocally) {
       // Using "disconnected" data to avoid update/remove/add operations to the back-end
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js	Mon Jun 25 19:58:29 2012 +0200
@@ -23,6 +23,9 @@
  * Check that entered return quantity is less than original inout qty.
  */
 OB.RM.RMOrderQtyValidate = function (item, validator, value, record) {
+  if (!isc.isA.Number(value)){
+    return false;
+  }
   // Check if record has related shipment to skip check.
   if (record.goodsShipmentLine === null || record.goodsShipmentLine === '') {
     return value !== null && value > 0;
@@ -137,4 +140,4 @@
       record.movementQuantity = availableQty.toString();
     }
   }
-};
\ No newline at end of file
+};
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js	Mon Jun 25 19:58:29 2012 +0200
@@ -222,4 +222,51 @@
   OBDate = OBDate.replace('%S', seconds);
 
   return OBDate;
+};
+
+//** {{{ OB.Utilities.Date.getTimeFields }}} **
+//
+// Returns an array with the names of the time fields.
+//
+// Parameters:
+// * {{{allFields}}}: complete list of fields
+// Return:
+// * an array with the names of the time fields contained in allFields.
+OB.Utilities.Date.getTimeFields = function (allFields) {
+  var i, field, timeFields = [],
+      length = allFields.length;
+  for (i = 0; i < length; i++) {
+    field = allFields[i];
+    if (field.type === '_id_24') {
+      timeFields.push(field.name);
+    }
+  }
+  return timeFields;
+};
+
+//** {{{ OB.Utilities.Date.convertUTCTimeToLocalTime }}} **
+//
+// Converts the value of time fields from UTC to local time
+//
+// Parameters:
+// * {{{newData}}}: records to be converted
+// * {{{allFields}}}: array with the fields of the records
+// Return:
+// * Nothing. newData is modified, its time fields are converted from UTC to local time
+OB.Utilities.Date.convertUTCTimeToLocalTime = function (newData, allFields) {
+  var textField, fieldToDate, i, j, newDataLength = newData.length,
+      UTCHourOffset = isc.Time.getUTCHoursDisplayOffset(new Date()),
+      UTCMinuteOffset = isc.Time.getUTCMinutesDisplayOffset(new Date()),
+      timeFields = OB.Utilities.Date.getTimeFields(allFields),
+      timeFieldsLength = timeFields.length;
+  for (i = 0; i < timeFieldsLength; i++) {
+    for (j = 0; j < newDataLength; j++) {
+      textField = newData[j][timeFields[i]];
+      if (textField && textField.length > 0) {
+        fieldToDate = isc.Time.parseInput(textField);
+        fieldToDate.setTime(fieldToDate.getTime() + (UTCHourOffset * 60 * 60 * 1000) + (UTCMinuteOffset * 60 * 1000));
+        newData[j][timeFields[i]] = fieldToDate.getHours() + ':' + fieldToDate.getMinutes() + ':' + fieldToDate.getSeconds();
+      }
+    }
+  }
 };
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-form-styles.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-form-styles.js	Mon Jun 25 19:58:29 2012 +0200
@@ -129,7 +129,7 @@
   // is 20
   pickListCellHeight: 22,
 
-  quickRunWidth: 210,
+  quickRunWidth: 267,
   // fixes issue https://issues.openbravo.com/view.php?id=15105
   quickRunPickListCellHeight: 22,
   pickListHeight: 200,
--- a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.js	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.js	Mon Jun 25 19:58:29 2012 +0200
@@ -63,7 +63,7 @@
   layoutLeftMargin: 7,
   defaultLayoutAlign: 'center',
   align: 'left',
-  overflow: 'visible'
+  overflow: 'hidden'
 });
 
 isc.OBStatusBarTextLabel.addProperties({
@@ -79,7 +79,8 @@
   width: 130,
   align: 'right',
   overflow: 'visible',
-  membersMargin: 4
+  membersMargin: 4,
+  layoutLeftMargin: 3
 });
 
 isc.OBStatusBarIconButton.addProperties({
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <NAME><![CDATA[HTML Widget]]></NAME>
-<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.16746]]></VERSION>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.16854]]></VERSION>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <DESCRIPTION><![CDATA[Provides the HTML Widget superclass that allows to create widget classes that embed the html code.]]></DESCRIPTION>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <HELP><![CDATA[With this module you can define your own widget classes just setting up your own html code or the html code provided by third parties.]]></HELP>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <URL><![CDATA[http://forge.openbravo.com/projects/htmlwidget]]></URL>
@@ -21,7 +21,7 @@
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--D393BE6F22BB44B7B728259B34FC795A-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--D393BE6F22BB44B7B728259B34FC795A--></AD_MODULE>
 
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <AD_MODULE_ID><![CDATA[D393BE6F22BB44B7B728259B34FC795A]]></AD_MODULE_ID>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--DCE798FBC5B648F7A3C81A6941720A57-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--4B828F4D03264080AA1D2057B13F613C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <NAME><![CDATA[User Interface Client Kernel]]></NAME>
-<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.16746]]></VERSION>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.16854]]></VERSION>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <DESCRIPTION><![CDATA[Provides framework functionality for the Openbravo User Interface]]></DESCRIPTION>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <HELP><![CDATA[The user interface client kernel is a generation framework for generating client (browser) components used in Openbravo. Its components are mainly used by other modules to provide customizable and extendable user interfaces.]]></HELP>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <URL><![CDATA[http://forge.openbravo.com/projects/openbravoclientkernel]]></URL>
@@ -22,7 +22,7 @@
 <!--4B828F4D03264080AA1D2057B13F613C-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <UPDATEINFO><![CDATA[Bug fix for issue 15289]]></UPDATEINFO>
-<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--4B828F4D03264080AA1D2057B13F613C-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--4B828F4D03264080AA1D2057B13F613C--></AD_MODULE>
 
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <AD_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_MODULE_ID>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--26B041893E844A53AFA58BC326C4F0D7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <AD_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_MODULE_ID>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.16746]]></STARTVERSION>
+<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.16854]]></STARTVERSION>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <AD_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_MODULE_ID>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <AD_DEPENDENT_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_DEPENDENT_MODULE_ID>
-<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.16746]]></STARTVERSION>
+<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.16854]]></STARTVERSION>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java	Mon Jun 25 19:58:29 2012 +0200
@@ -32,6 +32,7 @@
 import org.apache.log4j.Logger;
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
+import org.openbravo.client.kernel.BaseComponentProvider.ComponentResource;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -285,4 +286,30 @@
   public boolean isInDevelopment() {
     return getModule().isInDevelopment();
   }
+
+  protected String getApplicationName() {
+
+    final String appName = getParameter(KernelConstants.APP_NAME_PARAMETER);
+
+    if (!appName.equals("")) {
+      return appName;
+    }
+
+    final String appMode = getParameter(KernelConstants.MODE_PARAMETER);
+
+    if (appMode.equals("") || appMode.equals(KernelConstants.MODE_PARAMETER_CLASSIC)) {
+      return ComponentResource.APP_CLASSIC;
+    }
+
+    if (appMode.equals(KernelConstants.MODE_PARAMETER_300)) {
+      return ComponentResource.APP_OB3;
+    }
+
+    log4j.error("Couldn't detect the application name in StaticResource call");
+    return "";
+  }
+
+  protected boolean isClassicMode() {
+    return getApplicationName().equals(ComponentResource.APP_CLASSIC);
+  }
 }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java	Mon Jun 25 19:58:29 2012 +0200
@@ -19,6 +19,7 @@
 package org.openbravo.client.kernel;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -97,31 +98,75 @@
     return null;
   }
 
+  protected ComponentResource createComponentResource(ComponentResourceType type, String path) {
+    final ComponentResource resource = new ComponentResource();
+    resource.setType(type);
+    resource.setPath(path);
+    return resource;
+  }
+
+  protected ComponentResource createComponentResource(ComponentResourceType type, String path,
+      String validForApp) {
+    final ComponentResource resource = new ComponentResource();
+    resource.setType(type);
+    resource.setPath(path);
+    resource.addValidForApp(validForApp);
+    return resource;
+  }
+
+  protected ComponentResource createComponentResource(ComponentResourceType type, String path,
+      List<String> validForAppList) {
+    final ComponentResource resource = new ComponentResource();
+    resource.setType(type);
+    resource.setPath(path);
+    resource.setValidForAppList(validForAppList);
+    return resource;
+  }
+
   protected ComponentResource createStaticResource(String path, boolean includeAlsoInClassicMode,
       boolean includeInNewUIMode) {
-    final ComponentResource componentResource = new ComponentResource();
-    componentResource.setType(ComponentResourceType.Static);
-    componentResource.setPath(path);
-    componentResource.setIncludeAlsoInClassicMode(includeAlsoInClassicMode);
-    componentResource.setIncludeInNewUIMode(includeInNewUIMode);
+
+    final ComponentResource componentResource = createComponentResource(
+        ComponentResourceType.Static, path);
+
+    if (includeAlsoInClassicMode) {
+      componentResource.addValidForApp(ComponentResource.APP_CLASSIC);
+    }
+
+    if (includeInNewUIMode) {
+      componentResource.addValidForApp(ComponentResource.APP_OB3);
+    }
+
     return componentResource;
   }
 
   protected ComponentResource createStaticResource(String path, boolean includeAlsoInClassicMode) {
-    final ComponentResource componentResource = new ComponentResource();
-    componentResource.setType(ComponentResourceType.Static);
-    componentResource.setPath(path);
-    componentResource.setIncludeAlsoInClassicMode(includeAlsoInClassicMode);
+    final ComponentResource componentResource = createComponentResource(
+        ComponentResourceType.Static, path);
+
+    // mimic old behavior *always* include for OB3
+    componentResource.addValidForApp(ComponentResource.APP_OB3);
+
+    if (includeAlsoInClassicMode) {
+      componentResource.addValidForApp(ComponentResource.APP_CLASSIC);
+    }
+
     return componentResource;
   }
 
   protected ComponentResource createStyleSheetResource(String path,
       boolean includeAlsoInClassicMode, boolean includeInNewUIMode) {
-    final ComponentResource componentResource = new ComponentResource();
-    componentResource.setType(ComponentResourceType.Stylesheet);
-    componentResource.setPath(path);
-    componentResource.setIncludeAlsoInClassicMode(includeAlsoInClassicMode);
-    componentResource.setIncludeInNewUIMode(includeInNewUIMode);
+    final ComponentResource componentResource = createComponentResource(
+        ComponentResourceType.Stylesheet, path);
+
+    if (includeAlsoInClassicMode) {
+      componentResource.addValidForApp(ComponentResource.APP_CLASSIC);
+    }
+
+    if (includeInNewUIMode) {
+      componentResource.addValidForApp(ComponentResource.APP_OB3);
+    }
+
     return componentResource;
   }
 
@@ -129,15 +174,20 @@
     final ComponentResource componentResource = new ComponentResource();
     componentResource.setType(ComponentResourceType.Stylesheet);
     componentResource.setPath(path);
-    componentResource.setIncludeAlsoInClassicMode(includeAlsoInClassicMode);
+
+    // mimic old behavior *always* include for OB3
+    componentResource.addValidForApp(ComponentResource.APP_OB3);
+
+    if (includeAlsoInClassicMode) {
+      componentResource.addValidForApp(ComponentResource.APP_CLASSIC);
+    }
+
     return componentResource;
   }
 
   protected ComponentResource createDynamicResource(String path) {
-    final ComponentResource componentResource = new ComponentResource();
-    componentResource.setType(ComponentResourceType.Dynamic);
-    componentResource.setPath(path);
-    componentResource.setIncludeAlsoInClassicMode(false);
+    final ComponentResource componentResource = createComponentResource(
+        ComponentResourceType.Dynamic, path, ComponentResource.APP_OB3);
     return componentResource;
   }
 
@@ -165,11 +215,22 @@
       Static, Dynamic, Stylesheet
     }
 
+    public static final String APP_OB3 = "OB3";
+    public static final String APP_CLASSIC = "CLASSIC";
+    public static final List<String> ALL_CORE_APPS = Arrays.asList(new String[] { APP_OB3,
+        APP_CLASSIC });
+
     private ComponentResourceType type;
     private String path;
+
+    @Deprecated
     private boolean includeAlsoInClassicMode = false;
+
+    @Deprecated
     private boolean includeInNewUIMode = true;
 
+    private List<String> validForAppList = new ArrayList<String>();
+
     public ComponentResourceType getType() {
       return type;
     }
@@ -190,21 +251,41 @@
       return type + " " + path;
     }
 
+    @Deprecated
     public boolean isIncludeAlsoInClassicMode() {
       return includeAlsoInClassicMode;
     }
 
+    @Deprecated
     public void setIncludeAlsoInClassicMode(boolean includeAlsoInClassicMode) {
       this.includeAlsoInClassicMode = includeAlsoInClassicMode;
     }
 
+    @Deprecated
     public boolean isIncludeInNewUIMode() {
       return includeInNewUIMode;
     }
 
+    @Deprecated
     public void setIncludeInNewUIMode(boolean includeInNewUIMode) {
       this.includeInNewUIMode = includeInNewUIMode;
     }
 
+    public List<String> getValidForAppList() {
+      return validForAppList;
+    }
+
+    public void setValidForAppList(List<String> validForAppList) {
+      this.validForAppList = validForAppList;
+    }
+
+    public void addValidForApp(String app) {
+      this.validForAppList.add(app);
+    }
+
+    public boolean isValidForApp(String app) {
+      return this.validForAppList.contains(app);
+    }
+
   }
 }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelConstants.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelConstants.java	Mon Jun 25 19:58:29 2012 +0200
@@ -68,6 +68,8 @@
   public static final String MODE_PARAMETER_300 = "3.00";
   public static final String MODE_PARAMETER_CLASSIC = "classic";
 
+  public static final String APP_NAME_PARAMETER = "_appName";
+
   public static final String STYLE_SHEET_COMPONENT_ID = "StyleSheetResources";
   public static final String RESOURCE_COMPONENT_ID = "StaticResources";
   public static final String TEST_COMPONENT_ID = "TestResources";
@@ -130,4 +132,11 @@
    * Name of dateFormat.sql property in Openbravo.properties.
    */
   public static final String DATETIME_SQL_FORMAT_PROPERTY = "dateTimeFormat.sql";
+
+  /**
+   * Function name used in index.jsp as window.onerror handler. This function needs to be removed at
+   * the end of StaticResources process
+   */
+  public static final String BOOTSTRAP_ERROR_HANDLER_NAME = "indexErrorHandler";
+
 }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java	Mon Jun 25 19:58:29 2012 +0200
@@ -95,11 +95,7 @@
       // directly and not the document.write, see here:
       // http://www.codehouse.com/javascript/articles/external/
 
-      final boolean classicMode = !getParameters().containsKey(KernelConstants.MODE_PARAMETER)
-          || !getParameters().get(KernelConstants.MODE_PARAMETER).equals(
-              KernelConstants.MODE_PARAMETER_300);
-
-      if (!classicMode) {
+      if (isClassicMode()) {
         // set in the session that we are looking at the new ui
         // note injecting the HttpSession through Weld does not work
         // as it will instantiate one of the subclasses of HttpSession
@@ -113,7 +109,7 @@
       final String scriptPath = getContextUrl() + GEN_TARGET_LOCATION + "/"
           + getStaticResourceFileName() + ".js";
 
-      if (classicMode) {
+      if (isClassicMode()) {
         result.append("document.write(\"<LINK rel='stylesheet' type='text/css' href='"
             + getContextUrl()
             + "org.openbravo.client.kernel/OBCLKER_Kernel/StyleSheetResources?_skinVersion="
@@ -156,10 +152,6 @@
         KernelConstants.SERVLET_CONTEXT);
     final StringBuffer sb = new StringBuffer();
 
-    final boolean classicMode = !getParameters().containsKey(KernelConstants.MODE_PARAMETER)
-        || !getParameters().get(KernelConstants.MODE_PARAMETER).equals(
-            KernelConstants.MODE_PARAMETER_300);
-
     final String skinParam;
     if (getParameters().containsKey(KernelConstants.SKIN_PARAMETER)) {
       skinParam = (String) getParameters().get(KernelConstants.SKIN_PARAMETER);
@@ -168,6 +160,7 @@
     }
 
     int cntDynamicScripts = 0;
+    final String appName = getApplicationName();
 
     for (Module module : modules) {
       for (ComponentProvider provider : componentProviders) {
@@ -178,10 +171,8 @@
 
         if (provider.getModule().getId().equals(module.getId())) {
           for (ComponentResource resource : resources) {
-            if (classicMode && !resource.isIncludeAlsoInClassicMode()) {
-              continue;
-            }
-            if (!classicMode && !resource.isIncludeInNewUIMode()) {
+
+            if (!resource.isValidForApp(appName)) {
               continue;
             }
 
@@ -232,13 +223,17 @@
       }
     }
 
-    sb.append("if (typeof(OBStartApplication) !== 'undefined' && isc.isA.Function(OBStartApplication)) { OBStartApplication(); }");
+    if (!"".equals(sb.toString())) {
+      sb.append("if (window.onerror && window.onerror.name === '"
+          + KernelConstants.BOOTSTRAP_ERROR_HANDLER_NAME + "') { window.onerror = null; }");
+      sb.append("if (typeof OBStartApplication !== 'undefined' && Object.prototype.toString.call(OBStartApplication) === '[object Function]') { OBStartApplication(); }");
+    }
 
     for (int i = 0; i < cntDynamicScripts; i++) {
       // add extra exception handling code otherwise exceptions occuring in
       // the Labs wait function are not visible.
       sb.append("\n} catch (_exception) {");
-      sb.append("isc.warn(_exception + ' ' + _exception.message + ' ' + _exception.stack);");
+      sb.append("if (isc) { isc.Log.logError(_exception + ' ' + _exception.message + ' ' + _exception.stack); }");
       sb.append("if (console && console.trace) { console.trace();}");
       sb.append("}\n});");
     }
@@ -247,7 +242,7 @@
     // when changing development status, system needs to be restarted.
     final String output;
     // in classicmode the isc combined is included, compressing that gives errors
-    if (!isInDevelopment() && !classicMode) {
+    if (!isInDevelopment() && !isClassicMode()) {
       output = JSCompressor.getInstance().compress(sb.toString());
     } else {
       output = sb.toString();
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java	Mon Jun 25 19:58:29 2012 +0200
@@ -108,9 +108,7 @@
         KernelConstants.SERVLET_CONTEXT);
     final StringBuffer sb = new StringBuffer();
 
-    final boolean classicMode = !getParameters().containsKey(KernelConstants.MODE_PARAMETER)
-        || !getParameters().get(KernelConstants.MODE_PARAMETER).equals(
-            KernelConstants.MODE_PARAMETER_300);
+    final String appName = getApplicationName();
 
     final boolean makeCssDataUri = getParameters().get("_cssDataUri") != null
         && getParameters().get("_cssDataUri").equals("true");
@@ -131,12 +129,9 @@
 
         if (provider.getModule().getId().equals(module.getId())) {
           for (ComponentResource resource : resources) {
-            if (classicMode && !resource.isIncludeAlsoInClassicMode()) {
-              continue;
-            }
-            if (!classicMode && !resource.isIncludeInNewUIMode()) {
-              continue;
-            }
+
+            resource.isValidForApp(appName);
+
             log.debug("Processing resource: " + resource);
             if (resource.getType() == ComponentResourceType.Stylesheet) {
               String resourcePath = resource.getPath();
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateTimeUIDefinition.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateTimeUIDefinition.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,17 +11,19 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2010-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
 package org.openbravo.client.kernel.reference;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
 
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.domaintype.PrimitiveDomainType;
+import org.openbravo.client.kernel.RequestContext;
 
 /**
  * Implementation of the date time ui definition.
@@ -29,6 +31,8 @@
  * @author mtaal
  */
 public class DateTimeUIDefinition extends DateUIDefinition {
+  private String lastUsedPattern = null;
+  private SimpleDateFormat dateFormat = null;
 
   @Override
   public String getParentType() {
@@ -45,6 +49,17 @@
   }
 
   @Override
+  protected SimpleDateFormat getClassicFormat() {
+    String pattern = RequestContext.get().getSessionAttribute("#AD_JavaDateTimeFormat").toString();
+    if (dateFormat == null || !pattern.equals(lastUsedPattern)) {
+      dateFormat = new SimpleDateFormat(pattern);
+      lastUsedPattern = pattern;
+      dateFormat.setLenient(true);
+    }
+    return dateFormat;
+  }
+
+  @Override
   public synchronized Object createFromClassicString(String value) {
     try {
       if (value == null || value.length() == 0 || value.equals("null")) {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/NumberUIDefinition.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/NumberUIDefinition.java	Mon Jun 25 19:58:29 2012 +0200
@@ -162,7 +162,12 @@
     valueStr = valueStr.replace(
         variables.getSessionValue("#GroupSeparator|" + getFormat()).substring(0, 1), "").replace(
         variables.getSessionValue("#DecimalSeparator|" + getFormat()).substring(0, 1), ".");
-    return new BigDecimal(valueStr);
+    try {
+      return new BigDecimal(valueStr);
+    } catch (Exception e) {
+      return null;
+    }
+
   }
 
   @Override
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TimeUIDefinition.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TimeUIDefinition.java	Mon Jun 25 19:58:29 2012 +0200
@@ -18,10 +18,19 @@
  */
 package org.openbravo.client.kernel.reference;
 
+import java.text.FieldPosition;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
 
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.client.kernel.RequestContext;
+import org.openbravo.data.Sqlc;
+import org.openbravo.model.ad.ui.Field;
 import org.openbravo.service.json.JsonUtils;
 
 /**
@@ -66,16 +75,73 @@
     return classicFormat;
   }
 
+  // getFieldProperties has to be overridden because depending on the value of getValueFromSession,
+  // time fields have to be converted from localTime to UTC before sending the to the client
   @Override
+  public String getFieldProperties(Field field, boolean getValueFromSession) {
+    String result = super.getFieldProperties(field, getValueFromSession);
+    try {
+      JSONObject jsnobject = new JSONObject(result);
+      if (getValueFromSession) {
+        RequestContext rq = RequestContext.get();
+        String columnValue = rq.getRequestParameter("inp"
+            + Sqlc.TransformaNombreColumna(field.getColumn().getDBColumnName()));
+        if (columnValue.isEmpty()) {
+          // If the date is empty, it does not have to be converted
+          return result;
+        }
+        // createFromClassicString has been called with an UTC date, it expects a date in local
+        // time,
+        // so the time is going to be converted to local time, and going to be passed to
+        // createFromClassicString
+        Date UTCDate = getClassicFormat().parse(columnValue);
+        Calendar now = Calendar.getInstance();
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(UTCDate);
+        calendar.set(Calendar.DATE, now.get(Calendar.DATE));
+        calendar.set(Calendar.MONTH, now.get(Calendar.MONTH));
+        calendar.set(Calendar.YEAR, now.get(Calendar.YEAR));
+
+        int gmtMillisecondOffset = (now.get(Calendar.ZONE_OFFSET) + now.get(Calendar.DST_OFFSET));
+        calendar.add(Calendar.MILLISECOND, gmtMillisecondOffset);
+        StringBuffer localTimeColumnValue = getClassicFormat().format(calendar.getTime(),
+            new StringBuffer(), new FieldPosition(0));
+        jsnobject.put("value", createFromClassicString(localTimeColumnValue.toString()));
+        jsnobject.put("classicValue", localTimeColumnValue.toString());
+        return jsnobject.toString();
+      }
+    } catch (JSONException e) {
+      throw new OBException("Exception when parsing date ", e);
+    } catch (ParseException e) {
+      throw new OBException("Exception when parsing date ", e);
+    }
+    return result;
+  }
+
+  @Override
+  // Value is a date in local time format
   public synchronized Object createFromClassicString(String value) {
     try {
       if (value == null || value.length() == 0 || value.equals("null")) {
         return null;
       }
 
-      final java.util.Date date = getClassicFormat().parse(value);
+      final Date localDate = getClassicFormat().parse(value);
+      // If a date is not specified, 01-01-1970 will be set by default
+      // Today's date should be returned
+      Calendar now = Calendar.getInstance();
+      Calendar calendar = Calendar.getInstance();
+      calendar.setTime(localDate);
+      calendar.set(Calendar.DATE, now.get(Calendar.DATE));
+      calendar.set(Calendar.MONTH, now.get(Calendar.MONTH));
+      calendar.set(Calendar.YEAR, now.get(Calendar.YEAR));
 
-      return xmlTimeFormat.format(date);
+      // Applies the zone offset and the dst offset to convert the time from local to UTC
+      int gmtMillisecondOffset = (now.get(Calendar.ZONE_OFFSET) + now.get(Calendar.DST_OFFSET));
+      calendar.add(Calendar.MILLISECOND, -gmtMillisecondOffset);
+
+      return xmlTimeFormat.format(calendar.getTime());
     } catch (Exception e) {
       throw new OBException("Exception when handling value " + value, e);
     }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/templates/i18n.ftl	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/templates/i18n.ftl	Mon Jun 25 19:58:29 2012 +0200
@@ -12,7 +12,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) 2010-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,6 +20,9 @@
 -->
 // jslint
 
+OB = window.OB || {};
+OB.I18N = window.OB.I18N || {};
+
 OB.I18N.labels = {
 <#list data.labels as label>
 '${label.key?js_string}':  '${label.value?js_string}'<#if label_has_next>,</#if>
@@ -49,7 +52,7 @@
         }
     }
     if (object && property) {
-      if (isc.isA.Function(object[property])) {
+      if (Object.prototype.toString.call(object[property]) === '[object Function]') {
         object[property](label);
       } else {
         object[property] = label;
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <NAME><![CDATA[Workspace & Widgets]]></NAME>
-<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.16746]]></VERSION>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.16854]]></VERSION>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <DESCRIPTION><![CDATA[Workspace & Widgets]]></DESCRIPTION>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <HELP><![CDATA[Provides the infrastructure of workspace tab (formerly My Openbravo)]]></HELP>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <URL><![CDATA[http://forge.openbravo.com/projects/myopenbravo]]></URL>
@@ -23,7 +23,7 @@
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <UPDATEINFO><![CDATA[Styling bugfixing]]></UPDATEINFO>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <REFERENCEDATAINFO><![CDATA[Provides the infrastructure of workspace tab]]></REFERENCEDATAINFO>
-<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--2758CD25B2704AF6BBAD10365FC82C06-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--2758CD25B2704AF6BBAD10365FC82C06--></AD_MODULE>
 
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--15F51F03882F444CAB6593B4566DC929-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--15F51F03882F444CAB6593B4566DC929-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
 <!--15F51F03882F444CAB6593B4566DC929-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--15F51F03882F444CAB6593B4566DC929-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--15F51F03882F444CAB6593B4566DC929-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--15F51F03882F444CAB6593B4566DC929-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--E71B28FC949D481D9F59C17D01E46EF9-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <NAME><![CDATA[Query/List Widget]]></NAME>
-<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.16746]]></VERSION>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.16854]]></VERSION>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <DESCRIPTION><![CDATA[Provides the Query/List superclass widget that allows to create widget classes that prints a grid of data based on a query.]]></DESCRIPTION>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <HELP><![CDATA[With this module you can define your own widget classes that just with simple Application Dictionary shows a grid of data based on a HQL Query.]]></HELP>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <URL><![CDATA[http://forge.openbravo.com/projects/querylistwidget]]></URL>
@@ -21,7 +21,7 @@
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--0A060B2AF1974E8EAA8DB61388E9AECC--></AD_MODULE>
 
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--26558497C31140BFAB067BA4BC47D799-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--26558497C31140BFAB067BA4BC47D799-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
 <!--26558497C31140BFAB067BA4BC47D799-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--26558497C31140BFAB067BA4BC47D799-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--26558497C31140BFAB067BA4BC47D799-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--26558497C31140BFAB067BA4BC47D799-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java	Mon Jun 25 19:58:29 2012 +0200
@@ -145,6 +145,9 @@
               widgetQuery.setParameterList(namedParam, (Collection<?>) value);
             } else if (value instanceof Object[]) {
               widgetQuery.setParameterList(namedParam, (Object[]) value);
+            } else if (value instanceof String
+                && isDate(namedParam, widgetClass.getOBUIAPPParameterEMObkmoWidgetClassIDList())) {
+              widgetQuery.setParameter(namedParam, convertToDate((String) value));
             } else {
               widgetQuery.setParameter(namedParam, value);
             }
@@ -199,6 +202,34 @@
     }
   }
 
+  // Converts and object from String to Date
+  private Date convertToDate(String value) {
+    DateDomainType domainType = new DateDomainType();
+    return (Date) domainType.createFromString(value);
+  }
+
+  // Check if the reference of a parameter is a Date
+  private boolean isDate(String paramName, List<Parameter> parameterList) {
+    Parameter parameterToCheck = null;
+    for (Parameter p : parameterList) {
+      if (p.getDBColumnName().equals(paramName)) {
+        parameterToCheck = p;
+        break;
+      }
+    }
+    if (parameterToCheck == null) {
+      return false;
+    } else {
+      DomainType domainType = ModelProvider.getInstance()
+          .getReference(parameterToCheck.getReference().getId()).getDomainType();
+      if (domainType.getClass().equals(DateDomainType.class)) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+  }
+
   /**
    * Returns a HashMap with the values of the parameters included on the given widget instance.
    * 
--- a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--FF8080812D842086012D844F3CC0003E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--FF8080812D842086012D844F3CC0003E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080812D842086012D844F3CC0003E-->  <NAME><![CDATA[Widgets Collection]]></NAME>
-<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.16746]]></VERSION>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.16854]]></VERSION>
 <!--FF8080812D842086012D844F3CC0003E-->  <DESCRIPTION><![CDATA[Collection of Workspace Widgets]]></DESCRIPTION>
 <!--FF8080812D842086012D844F3CC0003E-->  <HELP><![CDATA[Collection of Workspace Widgets]]></HELP>
 <!--FF8080812D842086012D844F3CC0003E-->  <URL><![CDATA[http://forge.openbravo.com/projects/widgetscollection]]></URL>
@@ -22,7 +22,7 @@
 <!--FF8080812D842086012D844F3CC0003E-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--FF8080812D842086012D844F3CC0003E-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--FF8080812D842086012D844F3CC0003E-->  <UPDATEINFO><![CDATA[Added Currency Converter. Added Google Docs]]></UPDATEINFO>
-<!--FF8080812D842086012D844F3CC0003E-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--FF8080812D842086012D844F3CC0003E-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--FF8080812D842086012D844F3CC0003E--></AD_MODULE>
 
--- a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--FF8080812D842086012D845002070046-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080812D842086012D845002070046-->  <AD_MODULE_ID><![CDATA[FF8080812D842086012D844F3CC0003E]]></AD_MODULE_ID>
 <!--FF8080812D842086012D845002070046-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--FF8080812D842086012D845002070046-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080812D842086012D845002070046-->  <DEPENDANT_MODULE_NAME><![CDATA[Workspace & Widgets]]></DEPENDANT_MODULE_NAME>
 <!--FF8080812D842086012D845002070046-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <NAME><![CDATA[Payment Report]]></NAME>
-<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.16746]]></VERSION>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.16854]]></VERSION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <DESCRIPTION><![CDATA[Payment Report]]></DESCRIPTION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <URL><![CDATA[http://forge.openbravo.com/projects/paymentreport]]></URL>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <TYPE><![CDATA[M]]></TYPE>
@@ -22,7 +22,7 @@
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--2A5EE903D7974AC298C0504FBC4501A7--></AD_MODULE>
 
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <AD_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_MODULE_ID>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--A3B449C4D5FE4D688CC58236FE33B802-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--3A3A943684D64DEF9EC39F588A656848-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <NAME><![CDATA[Orders Awaiting Delivery]]></NAME>
-<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.16746]]></VERSION>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.16854]]></VERSION>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <DESCRIPTION><![CDATA[Report displaying sales orders not shipped.]]></DESCRIPTION>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <URL><![CDATA[http://forge.openbravo.com/projects/ordersawaitingdlivery]]></URL>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <TYPE><![CDATA[M]]></TYPE>
@@ -19,7 +19,7 @@
 <!--3A3A943684D64DEF9EC39F588A656848-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--3A3A943684D64DEF9EC39F588A656848-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--3A3A943684D64DEF9EC39F588A656848--></AD_MODULE>
 
--- a/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <AD_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_MODULE_ID>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <NAME><![CDATA[JSON Datasource]]></NAME>
-<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.16746]]></VERSION>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.16854]]></VERSION>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <DESCRIPTION><![CDATA[Provides data source CRUD functionality using JSON as the data format]]></DESCRIPTION>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <HELP><![CDATA[This module implements the datasource concept. Datasources play a central role in Smartclient applications. The datasource module automatically creates a datasource for each Openbravo entity. In addition custom data source implementations can be defined.]]></HELP>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <URL><![CDATA[http://forge.openbravo.com/projects/datasourceservice]]></URL>
@@ -22,7 +22,7 @@
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0]]></UPDATEINFO>
-<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4--></AD_MODULE>
 
--- a/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.16746]]></STARTVERSION>
+<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.16854]]></STARTVERSION>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <AD_DEPENDENT_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_DEPENDENT_MODULE_ID>
-<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.16746]]></STARTVERSION>
+<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.16854]]></STARTVERSION>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--4FCE95802A854F7E8623AFF7C33D13EE-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--54AF8B39C55E4E7496902893ECD82786-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--54AF8B39C55E4E7496902893ECD82786-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <AD_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_MODULE_ID>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.16746]]></STARTVERSION>
+<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.16854]]></STARTVERSION>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--D03C56D8A4E14F45A5466350E05C631F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--FF8080813129ADA401312CA1222A0005-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--FF8080813129ADA401312CA1222A0005-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813129ADA401312CA1222A0005-->  <NAME><![CDATA[Integration with Google APIs]]></NAME>
-<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.16746]]></VERSION>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.16854]]></VERSION>
 <!--FF8080813129ADA401312CA1222A0005-->  <DESCRIPTION><![CDATA[Integration with Google APIs]]></DESCRIPTION>
 <!--FF8080813129ADA401312CA1222A0005-->  <TYPE><![CDATA[M]]></TYPE>
 <!--FF8080813129ADA401312CA1222A0005-->  <LICENSE><![CDATA[Licensed under the Openbravo Public License Version 1.1.
@@ -18,7 +18,7 @@
 <!--FF8080813129ADA401312CA1222A0005-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--FF8080813129ADA401312CA1222A0005-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--FF8080813129ADA401312CA1222A0005-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--FF8080813129ADA401312CA1222A0005-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--FF8080813129ADA401312CA1222A0005-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--FF8080813129ADA401312CA1222A0005--></AD_MODULE>
 
--- a/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--FF8080813141B198013141BA0F7D0012-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813141B198013141BA0F7D0012-->  <AD_MODULE_ID><![CDATA[FF8080813129ADA401312CA1222A0005]]></AD_MODULE_ID>
 <!--FF8080813141B198013141BA0F7D0012-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813141B198013141B86DD70003]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.16746]]></STARTVERSION>
+<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.16854]]></STARTVERSION>
 <!--FF8080813141B198013141BA0F7D0012-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080813141B198013141BA0F7D0012-->  <DEPENDANT_MODULE_NAME><![CDATA[OpenID Service Integration]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813141B198013141BA0F7D0012-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--FF8080813151AEE1013151C4ACE6001B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <AD_MODULE_ID><![CDATA[FF8080813129ADA401312CA1222A0005]]></AD_MODULE_ID>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <AD_DEPENDENT_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813151AEE1013151C4ACE6001B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--FF8080813141B198013141B86DD70003-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--FF8080813141B198013141B86DD70003-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813141B198013141B86DD70003-->  <NAME><![CDATA[OpenID Service Integration]]></NAME>
-<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.16746]]></VERSION>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.16854]]></VERSION>
 <!--FF8080813141B198013141B86DD70003-->  <DESCRIPTION><![CDATA[OpenID Service Integration]]></DESCRIPTION>
 <!--FF8080813141B198013141B86DD70003-->  <TYPE><![CDATA[M]]></TYPE>
 <!--FF8080813141B198013141B86DD70003-->  <LICENSE><![CDATA[Licensed under the Openbravo Public License Version 1.1.
@@ -19,7 +19,7 @@
 <!--FF8080813141B198013141B86DD70003-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--FF8080813141B198013141B86DD70003-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--FF8080813141B198013141B86DD70003-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--FF8080813141B198013141B86DD70003-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--FF8080813141B198013141B86DD70003-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--FF8080813141B198013141B86DD70003--></AD_MODULE>
 
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--FF8080813141B198013141B8B21B0006-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813141B198013141B8B21B0006-->  <AD_MODULE_ID><![CDATA[FF8080813141B198013141B86DD70003]]></AD_MODULE_ID>
 <!--FF8080813141B198013141B8B21B0006-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--FF8080813141B198013141B8B21B0006-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--FF8080813141B198013141B8B21B0006-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813141B198013141B8B21B0006-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <NAME><![CDATA[JSON REST Webservice]]></NAME>
-<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.16746]]></VERSION>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.16854]]></VERSION>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <DESCRIPTION><![CDATA[Provides a JSON REST webservice for CRUD service requests]]></DESCRIPTION>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <HELP><![CDATA[Provides a JSON REST webservice for CRUD service requests. Both the servlet implementation (receiving HTTP REST requests in JSON) as the backend processing are provided.]]></HELP>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <URL><![CDATA[http://forge.openbravo.com/projects/openbravojsonrest]]></URL>
@@ -22,7 +22,7 @@
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0]]></UPDATEINFO>
-<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--F8D1B3ECB3474E8DA5C216473C840DF1--></AD_MODULE>
 
--- a/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--9E3E7B42DB16405FB794496D309D7044-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <AD_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_MODULE_ID>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--9E3E7B42DB16405FB794496D309D7044-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Mon Jun 25 19:58:29 2012 +0200
@@ -45,6 +45,7 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.ad.datamodel.Column;
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.domain.Reference;
 import org.openbravo.model.ad.domain.ReferencedTable;
@@ -128,6 +129,8 @@
   // keeps track if during parsing the criteria one or more or's are encountered.
   private int orNesting = 0;
 
+  private int minutesTimeZoneDiff = 0;
+
   private SimpleDateFormat simpleDateFormat = JsonUtils.createDateFormat();
 
   public Entity getEntity() {
@@ -291,6 +294,17 @@
 
     String fieldName = jsonCriteria.getString("fieldName");
     Object value = jsonCriteria.has("value") ? jsonCriteria.get("value") : null;
+    // Retrieves the UTC time zone offset of the client
+    if (jsonCriteria.has("minutesTimezoneOffset")) {
+      int clientMinutesTimezoneOffset = Integer.parseInt(jsonCriteria.get("minutesTimezoneOffset")
+          .toString());
+      Calendar now = Calendar.getInstance();
+      // Obtains the UTC time zone offset of the server
+      int serverMinutesTimezoneOffset = (now.get(Calendar.ZONE_OFFSET) + now
+          .get(Calendar.DST_OFFSET)) / (1000 * 60);
+      // Obtains the time zone offset between the server and the client
+      minutesTimeZoneDiff = serverMinutesTimezoneOffset - clientMinutesTimezoneOffset;
+    }
 
     if (operator.equals(OPERATOR_ISNULL) || operator.equals(OPERATOR_NOTNULL)) {
       value = null;
@@ -490,11 +504,24 @@
       throws JSONException {
     Object localValue = value;
 
-    // if the value consists of multiple parts then filtering won't work
-    // only search on the first part then, is pragmatic but very workable
-    if (localValue != null && localValue.toString().contains(IdentifierProvider.SEPARATOR)) {
-      final int separatorIndex = localValue.toString().indexOf(IdentifierProvider.SEPARATOR);
-      localValue = localValue.toString().substring(0, separatorIndex);
+    // Related to issue 20643: Because multi-identifiers are a concatenation of
+    // values separated by ' - '
+    // With this fix hyphens are supported in the filter when
+    // property is not part of the identifier. Also hyphen is accepted if
+    // the property is the unique property of the identifier
+    if (property.isIdentifier()) {
+      // column associated with the property
+      final Column relatedColumn = OBDal.getInstance().get(Column.class, property.getColumnId());
+      final Table relatedTable = relatedColumn.getTable();
+
+      if (isTableWithMultipleIdentifierColumns(relatedTable)) {
+        // if the value consists of multiple parts then filtering won't work
+        // only search on the first part then, is pragmatic but very workable
+        if (localValue != null && localValue.toString().contains(IdentifierProvider.SEPARATOR)) {
+          final int separatorIndex = localValue.toString().indexOf(IdentifierProvider.SEPARATOR);
+          localValue = localValue.toString().substring(0, separatorIndex);
+        }
+      }
     }
 
     if (ignoreCase(property, operator)) {
@@ -533,6 +560,22 @@
     return clause;
   }
 
+  /* Return true if the identifier of the table is composed of more than one column */
+  private Boolean isTableWithMultipleIdentifierColumns(Table relatedTable) {
+    int identifierCounter = 0;
+    for (Column curColumn : relatedTable.getADColumnList()) {
+      if (curColumn.isIdentifier()) {
+        identifierCounter += 1;
+        if (identifierCounter > 1) {
+          // if there are more than one identifier return true
+          return true;
+        }
+      }
+    }
+    // only one identifier. Is not multiple
+    return false;
+  }
+
   private Object getTypeSafeValue(String operator, Property property, Object value)
       throws JSONException {
     if (value == null) {
@@ -590,27 +633,24 @@
     } else if (Date.class.isAssignableFrom(property.getPrimitiveObjectType())) {
       try {
         final Date date = simpleDateFormat.parse(value.toString());
+        final Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
         // move the date to the beginning of the day
         if (isGreaterOperator(operator)) {
-          final Calendar calendar = Calendar.getInstance();
-          calendar.setTime(date);
           calendar.set(Calendar.HOUR, 0);
           calendar.set(Calendar.MINUTE, 0);
           calendar.set(Calendar.SECOND, 0);
           calendar.set(Calendar.MILLISECOND, 0);
-          return calendar.getTime();
         } else if (isLesserOperator(operator)) {
           // move the data to the end of the day
-          final Calendar calendar = Calendar.getInstance();
-          calendar.setTime(date);
           calendar.set(Calendar.HOUR, 23);
           calendar.set(Calendar.MINUTE, 59);
           calendar.set(Calendar.SECOND, 59);
           calendar.set(Calendar.MILLISECOND, 999);
-          return calendar.getTime();
-        } else {
-          return date;
         }
+        // Applies the time zone offset difference between the client and the server
+        calendar.add(Calendar.MINUTE, minutesTimeZoneDiff);
+        return calendar.getTime();
       } catch (Exception e) {
         throw new IllegalArgumentException(e);
       }
@@ -623,7 +663,7 @@
         && (operator.equals(OPERATOR_GREATERTHAN) || operator.equals(OPERATOR_GREATEROREQUAL)
             || operator.equals(OPERATOR_IGREATERTHAN) || operator.equals(OPERATOR_IGREATEROREQUAL)
             || operator.equals(OPERATOR_GREATERTHANFIElD) || operator
-            .equals(OPERATOR_GREATEROREQUALFIELD));
+              .equals(OPERATOR_GREATEROREQUALFIELD));
   }
 
   private boolean isLesserOperator(String operator) {
@@ -631,7 +671,7 @@
         && (operator.equals(OPERATOR_LESSTHAN) || operator.equals(OPERATOR_LESSOREQUAL)
             || operator.equals(OPERATOR_ILESSTHAN) || operator.equals(OPERATOR_ILESSOREQUAL)
             || operator.equals(OPERATOR_LESSTHANFIELD) || operator
-            .equals(OPERATOR_LESSOREQUALFIElD));
+              .equals(OPERATOR_LESSOREQUALFIElD));
   }
 
   private String computeLeftWhereClauseForIdentifier(Property property, String key,
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Mon Jun 25 19:58:29 2012 +0200
@@ -22,6 +22,7 @@
 import java.sql.Timestamp;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -63,6 +64,8 @@
   private final SimpleDateFormat xmlDateFormat = JsonUtils.createDateFormat();
   private final SimpleDateFormat xmlDateTimeFormat = JsonUtils.createDateTimeFormat();
   private final static SimpleDateFormat xmlTimeFormat = JsonUtils.createTimeFormat();
+  private final static SimpleDateFormat xmlTimeFormatWithoutMTOffset = JsonUtils
+      .createTimeFormatWithoutGMTOffset();
 
   // additional properties to return as a flat list
   private List<String> additionalProperties = new ArrayList<String>();
@@ -269,8 +272,11 @@
     final Class<?> clz = property.getPrimitiveObjectType();
     if (Date.class.isAssignableFrom(clz)) {
       if (property.getDomainType() instanceof TimestampDomainType) {
-        final String formattedValue = xmlTimeFormat.format(value);
-        return JsonUtils.convertToCorrectXSDFormat(formattedValue);
+
+        Timestamp localTime = (Timestamp) value;
+        Date UTCTime = convertToUTC(localTime);
+
+        return xmlTimeFormatWithoutMTOffset.format(UTCTime.getTime());
       } else if (property.isDatetime() || Timestamp.class.isAssignableFrom(clz)) {
         final String formattedValue = xmlDateTimeFormat.format(value);
         return JsonUtils.convertToCorrectXSDFormat(formattedValue);
@@ -287,6 +293,20 @@
     return value;
   }
 
+  private static Date convertToUTC(Date localTime) {
+    Calendar now = Calendar.getInstance();
+    Calendar calendar = Calendar.getInstance();
+    calendar.setTime(localTime);
+    calendar.set(Calendar.DATE, now.get(Calendar.DATE));
+    calendar.set(Calendar.MONTH, now.get(Calendar.MONTH));
+    calendar.set(Calendar.YEAR, now.get(Calendar.YEAR));
+
+    int gmtMillisecondOffset = (now.get(Calendar.ZONE_OFFSET) + now.get(Calendar.DST_OFFSET));
+    calendar.add(Calendar.MILLISECOND, -gmtMillisecondOffset);
+
+    return calendar.getTime();
+  }
+
   protected Object convertPrimitiveValue(Object value) {
     if (value == null) {
       return null;
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Mon Jun 25 19:58:29 2012 +0200
@@ -178,6 +178,7 @@
   }
 
   public void fetch(Map<String, String> parameters, QueryResultWriter writer) {
+    long t = System.currentTimeMillis();
     final String entityName = parameters.get(JsonConstants.ENTITYNAME);
     final DataEntityQueryService queryService = createSetQueryService(parameters);
     queryService.setEntityName(entityName);
@@ -187,13 +188,20 @@
     toJsonConverter.setAdditionalProperties(JsonUtils.getAdditionalProperties(parameters));
 
     final ScrollableResults scrollableResults = queryService.scroll();
+    int i = 0;
     while (scrollableResults.next()) {
       final Object result = scrollableResults.get()[0];
       final JSONObject json = toJsonConverter.toJsonObject((BaseOBObject) result,
           DataResolvingMode.FULL);
       writer.write(json);
-      OBDal.getInstance().getSession().evict(result);
+      i++;
+      // Clear session every 1000 records to prevent huge memory consumption in case of big loops
+      if (i % 1000 == 0) {
+        OBDal.getInstance().getSession().clear();
+        log.debug("clearing in record " + i + " elapsed time " + (System.currentTimeMillis() - t));
+      }
     }
+    log.debug("Fetch took " + (System.currentTimeMillis() - t) + " ms");
   }
 
   private DataEntityQueryService createSetQueryService(Map<String, String> parameters) {
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Mon Jun 25 19:58:29 2012 +0200
@@ -126,6 +126,7 @@
   private final static SimpleDateFormat xmlDateFormat = JsonUtils.createDateFormat();
   private final static SimpleDateFormat xmlDateTimeFormat = JsonUtils.createDateTimeFormat();
   private final static SimpleDateFormat xmlTimeFormat = JsonUtils.createTimeFormat();
+  private final static SimpleDateFormat jsTimeFormat = JsonUtils.createJSTimeFormat();
 
   private final List<JsonConversionError> errors = new ArrayList<JsonConversionError>();
 
@@ -161,7 +162,13 @@
               strValue = JsonUtils.convertFromXSDToJavaFormat(strValue);
             }
 
-            return new Timestamp(xmlTimeFormat.parse(strValue).getTime());
+            Calendar now = Calendar.getInstance();
+            strValue = xmlDateFormat.format(now.getTime()) + "T" + strValue;
+            Date UTCTime = new Timestamp(jsTimeFormat.parse(strValue).getTime());
+
+            Date localTime = convertToLocalTime(UTCTime);
+
+            return new Timestamp(localTime.getTime());
           } else if (property.isDatetime() || Timestamp.class.isAssignableFrom(clz)) {
             final String repairedString = JsonUtils.convertFromXSDToJavaFormat((String) value);
             return new Timestamp(xmlDateTimeFormat.parse(repairedString).getTime());
@@ -218,6 +225,17 @@
     }
   }
 
+  private static Date convertToLocalTime(Date UTCTime) {
+    Calendar localTime = Calendar.getInstance();
+    localTime.setTime(UTCTime);
+
+    int gmtMillisecondOffset = (localTime.get(Calendar.ZONE_OFFSET) + localTime
+        .get(Calendar.DST_OFFSET));
+    localTime.add(Calendar.MILLISECOND, gmtMillisecondOffset);
+
+    return localTime.getTime();
+  }
+
   private static boolean isEmptyOrNull(Object value) {
     if (JSONObject.NULL.equals(value)) { // note JSONObject.NULL.equals(null) == true
       return true;
@@ -556,7 +574,9 @@
       if (keyToObject.get(key) != null) {
         value = keyToObject.get(key);
       } else {
-        if (property.getReferencedProperty() != null) {
+        // if an id we should use the get method as it loads from the first level
+        // cache
+        if (property.getReferencedProperty() != null && !property.getReferencedProperty().isId()) {
           final OBQuery<BaseOBObject> qry = OBDal.getInstance().createQuery(entity.getName(),
               property.getReferencedProperty().getName() + "=:reference");
           qry.setNamedParameter("reference", referencedId);
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonUtils.java	Mon Jun 25 19:58:29 2012 +0200
@@ -71,6 +71,16 @@
   }
 
   /**
+   * @return a new instance of the {@link SimpleDateFormat} using a format of HH:MM:SS. The date
+   *         format has lenient set to true.
+   */
+  public static SimpleDateFormat createTimeFormatWithoutGMTOffset() {
+    final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
+    dateFormat.setLenient(true);
+    return dateFormat;
+  }
+
+  /**
    * @return a new instance of the {@link SimpleDateFormat} using a format of yyyy-MM-dd'T'HH:mm:ss
    *         (see http://www.w3.org/TR/xmlschema-2/#dateTime). The date format has lenient set to
    *         true.
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_FIELD.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_FIELD.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -12,6 +12,7 @@
 <!--025D79E533C74B0BBAEFDC7F9E0DFC79-->  <AD_TAB_ID><![CDATA[75FEAE3FF26F49E394BDF833B1B97647]]></AD_TAB_ID>
 <!--025D79E533C74B0BBAEFDC7F9E0DFC79-->  <AD_COLUMN_ID><![CDATA[EE3A2B331B0F4991A91CFE1524E7C7D9]]></AD_COLUMN_ID>
 <!--025D79E533C74B0BBAEFDC7F9E0DFC79-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--025D79E533C74B0BBAEFDC7F9E0DFC79-->  <DISPLAYLOGIC><![CDATA[@AD_Table_ID@!''&@custom_query@='N']]></DISPLAYLOGIC>
 <!--025D79E533C74B0BBAEFDC7F9E0DFC79-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--025D79E533C74B0BBAEFDC7F9E0DFC79-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--025D79E533C74B0BBAEFDC7F9E0DFC79-->  <SEQNO><![CDATA[120]]></SEQNO>
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <NAME><![CDATA[User Interface Selector]]></NAME>
-<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.16746]]></VERSION>
+<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION><![CDATA[2.1.16854]]></VERSION>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <DESCRIPTION><![CDATA[Provides a selector with a suggestion box and popup grid window]]></DESCRIPTION>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <HELP><![CDATA[The Openbravo selector provides new selector functionality which is used inside of existing Openbravo forms. The selector is mainly used for supporting foreign key references in the user interface. The selector combines both suggestion box behavior with a popup grid.]]></HELP>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <URL><![CDATA[http://forge.openbravo.com/projects/selector]]></URL>
@@ -22,7 +22,7 @@
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0]]></UPDATEINFO>
-<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--5EB4F15C80684ACA904756BDC12ADBE5-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--5EB4F15C80684ACA904756BDC12ADBE5-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--5EB4F15C80684ACA904756BDC12ADBE5--></AD_MODULE>
 
--- a/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.16746]]></STARTVERSION>
+<!--38825CAED43941D38CA0C78DB04FCFA0-->  <STARTVERSION><![CDATA[8.1.16854]]></STARTVERSION>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--38825CAED43941D38CA0C78DB04FCFA0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--6DDE7B1A70174242AF82B5022FB89279-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--6DDE7B1A70174242AF82B5022FB89279-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--94F9CD2CB5EF4467A67475C786C984A7-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--94F9CD2CB5EF4467A67475C786C984A7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.16746]]></STARTVERSION>
+<!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <STARTVERSION><![CDATA[1.1.16854]]></STARTVERSION>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--BCCB5A08EC0446DE8BCE191C6BC607A4-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--C8DAC574B88649D08C9468521B343F12-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C8DAC574B88649D08C9468521B343F12-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--C8DAC574B88649D08C9468521B343F12-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--C8DAC574B88649D08C9468521B343F12-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--C8DAC574B88649D08C9468521B343F12-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--C8DAC574B88649D08C9468521B343F12-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--C8DAC574B88649D08C9468521B343F12-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <AD_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_MODULE_ID>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--F14EB17946BE4724A46F80CB1A47EC70-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--F14EB17946BE4724A46F80CB1A47EC70-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorComponent.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorComponent.java	Mon Jun 25 19:58:29 2012 +0200
@@ -29,6 +29,7 @@
 
 import javax.inject.Inject;
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.log4j.Logger;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -919,7 +920,7 @@
       }
 
       public void setStringValue(String value) {
-        this.value = "'" + value + "'";
+        this.value = "'" + StringEscapeUtils.escapeJavaScript(value) + "'";
       }
 
       public void setValue(String value) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorFieldHandler.java	Mon Jun 25 19:58:29 2012 +0200
@@ -0,0 +1,71 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * 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 
+ * 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) 2012 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.userinterface.selector;
+
+import javax.enterprise.event.Observes;
+
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.client.kernel.event.EntityNewEvent;
+import org.openbravo.client.kernel.event.EntityPersistenceEvent;
+import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
+import org.openbravo.client.kernel.event.EntityUpdateEvent;
+
+/**
+ * Observes Select Field entity modifications to ensure it is not set as centrally maintained if its
+ * parent Selector is Custom Query.
+ * 
+ * @author alostale
+ * 
+ */
+public class SelectorFieldHandler extends EntityPersistenceEventObserver {
+  private static final String SELECTOR_FIELD_TABLE_ID = "A2F880F9981349E2A6A57BD58267EBCE";
+  private static Entity[] entities = { ModelProvider.getInstance().getEntityByTableId(
+      SELECTOR_FIELD_TABLE_ID) };
+
+  public void onUpdate(@Observes EntityUpdateEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+    checkCentralMaintenance(event);
+  }
+
+  public void onNew(@Observes EntityNewEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+    checkCentralMaintenance(event);
+  }
+
+  private void checkCentralMaintenance(EntityPersistenceEvent event) {
+    Selector sel = (Selector) event.getCurrentState(entities[0]
+        .getPropertyByColumnName("Obuisel_Selector_ID"));
+
+    if (sel.isCustomQuery()) {
+      event.setCurrentState(entities[0].getPropertyByColumnName("Iscentrallymaintained"), false);
+    }
+  }
+
+  @Override
+  protected Entity[] getObservedEntities() {
+    return entities;
+  }
+
+}
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <NAME><![CDATA[2.50 to 3.00 Compatibility Skin]]></NAME>
-<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.16746]]></VERSION>
+<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION><![CDATA[2.0.16854]]></VERSION>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <DESCRIPTION><![CDATA[Skin module to proper visualization of classic windows inside the MDI interface]]></DESCRIPTION>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <HELP><![CDATA[With this skin module the classic windows styles will display in a way more coherent with the new 3.00 styles]]></HELP>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <URL><![CDATA[www.openbravo.com]]></URL>
@@ -23,7 +23,7 @@
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--96998CBC42744B3DBEE28AC8095C9335-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--96998CBC42744B3DBEE28AC8095C9335-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--96998CBC42744B3DBEE28AC8095C9335--></AD_MODULE>
 
--- a/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <AD_MODULE_ID><![CDATA[96998CBC42744B3DBEE28AC8095C9335]]></AD_MODULE_ID>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--39BF75AD9AB3453698BF5DE29E727AA9-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--39BF75AD9AB3453698BF5DE29E727AA9-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <NAME><![CDATA[Smartclient]]></NAME>
-<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.16746]]></VERSION>
+<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION><![CDATA[8.1.16854]]></VERSION>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <DESCRIPTION><![CDATA[SmartClient libraries for use within Openbravo]]></DESCRIPTION>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <HELP><![CDATA[This module contains the SmartClient libraries for usage by other modules. It also contains some simple test pages to validate that SmartClient is working correctly. Also contains generic Openbravo SmartClient components]]></HELP>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <URL><![CDATA[http://forge.openbravo.com/projects/obsmartclient]]></URL>
@@ -23,7 +23,7 @@
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <UPDATEINFO><![CDATA[Bug fixing & new development for 3.0
 Updated to new SmartClient 8.3d 26-May-2012]]></UPDATEINFO>
-<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--EC356CEE3D46416CA1EBEEB9AB82EDB9--></AD_MODULE>
 
--- a/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--086331E18477496B8AC74D2CFEBD1307-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--086331E18477496B8AC74D2CFEBD1307-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--086331E18477496B8AC74D2CFEBD1307-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--DC5D4EF450244482BD2B458DAA496333-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--DC5D4EF450244482BD2B458DAA496333-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--DC5D4EF450244482BD2B458DAA496333-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <AD_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_MODULE_ID>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.16746]]></STARTVERSION>
+<!--F2AF15C0AF5540E393D96BE506E20648-->  <STARTVERSION><![CDATA[1.1.16854]]></STARTVERSION>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--F2AF15C0AF5540E393D96BE506E20648-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <NAME><![CDATA[Standard Roles]]></NAME>
-<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.16746]]></VERSION>
+<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION><![CDATA[3.0.16854]]></VERSION>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <DESCRIPTION><![CDATA[Pre-configured collection of standard ERP roles]]></DESCRIPTION>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <HELP><![CDATA[This dataset contains the following roles with their access to corresponding Openbravo entities - windows, reports, actions.
 * Employee - Any person of the enterprise
@@ -28,7 +28,7 @@
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <REFERENCEDATAINFO><![CDATA[Pre-configured collection of standard ERP roles]]></REFERENCEDATAINFO>
-<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--883B5872CA0548F9AF2BBBE7D2DDFA61--></AD_MODULE>
 
--- a/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--148A000EE9A04A3CA653B1296A00B8E6-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--148A000EE9A04A3CA653B1296A00B8E6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--30F966407A6F4E15965821BAEE34D25B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--30F966407A6F4E15965821BAEE34D25B-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--30F966407A6F4E15965821BAEE34D25B-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--F93CE30003B24F8F8886510B0065EECC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <AD_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_MODULE_ID>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <AD_DEPENDENT_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_DEPENDENT_MODULE_ID>
-<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.16746]]></STARTVERSION>
+<!--F93CE30003B24F8F8886510B0065EECC-->  <STARTVERSION><![CDATA[1.1.16854]]></STARTVERSION>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <DEPENDANT_MODULE_NAME><![CDATA[Orders Awaiting Delivery]]></DEPENDANT_MODULE_NAME>
 <!--F93CE30003B24F8F8886510B0065EECC-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <NAME><![CDATA[Openbravo 3.0 Framework]]></NAME>
-<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.16746]]></VERSION>
+<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION><![CDATA[2.1.16854]]></VERSION>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <DESCRIPTION><![CDATA[Openbravo 3.0 Framework]]></DESCRIPTION>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <HELP><![CDATA[Contains all the components required to run the Openbravo 3.0 framework]]></HELP>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <URL><![CDATA[http://forge.openbravo.com/projects/openbravov30framework]]></URL>
@@ -24,7 +24,7 @@
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <UPDATEINFO><![CDATA[minor bugfix release to include latest client.application 2.0.1, client.myob 2.0.2 and client.kernel 2.0.1]]></UPDATEINFO>
-<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--7E48CDD73B7E493A8BED4F7253E7C989-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--7E48CDD73B7E493A8BED4F7253E7C989-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--7E48CDD73B7E493A8BED4F7253E7C989--></AD_MODULE>
 
--- a/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_DEPENDENT_MODULE_ID>
-<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--01E1BCCEC9114DE0960538DF34E30E6F-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <DEPENDANT_MODULE_NAME><![CDATA[My Openbravo Tab]]></DEPENDANT_MODULE_NAME>
 <!--01E1BCCEC9114DE0960538DF34E30E6F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--025B181F63CA47B48A920F6983242390-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--025B181F63CA47B48A920F6983242390-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--025B181F63CA47B48A920F6983242390-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--025B181F63CA47B48A920F6983242390-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--025B181F63CA47B48A920F6983242390-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--025B181F63CA47B48A920F6983242390-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--025B181F63CA47B48A920F6983242390-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_DEPENDENT_MODULE_ID>
-<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--054B4FEAF919478AA3FF27098A46D1D6-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Application]]></DEPENDANT_MODULE_NAME>
 <!--054B4FEAF919478AA3FF27098A46D1D6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_DEPENDENT_MODULE_ID>
-<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.16746]]></STARTVERSION>
+<!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <STARTVERSION><![CDATA[1.0.16854]]></STARTVERSION>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <DEPENDANT_MODULE_NAME><![CDATA[Query/List Widget]]></DEPENDANT_MODULE_NAME>
 <!--1FA6BAA6DC3A4434A6E62A0D1319A9D7-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--224754C3EF674C93B0D468F47BAAB824-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--224754C3EF674C93B0D468F47BAAB824-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--224754C3EF674C93B0D468F47BAAB824-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--5B72D24032DD4879A950194139D961B6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--5B72D24032DD4879A950194139D961B6-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--5B72D24032DD4879A950194139D961B6-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--5B72D24032DD4879A950194139D961B6-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--5B72D24032DD4879A950194139D961B6-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--5B72D24032DD4879A950194139D961B6-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME>
 <!--5B72D24032DD4879A950194139D961B6-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -91,7 +91,7 @@
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <AD_DEPENDENT_MODULE_ID><![CDATA[D393BE6F22BB44B7B728259B34FC795A]]></AD_DEPENDENT_MODULE_ID>
-<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.16746]]></STARTVERSION>
+<!--8730CA6A4224439D82E0DD31B3806E36-->  <STARTVERSION><![CDATA[1.0.16854]]></STARTVERSION>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <DEPENDANT_MODULE_NAME><![CDATA[HTML Widget]]></DEPENDANT_MODULE_NAME>
 <!--8730CA6A4224439D82E0DD31B3806E36-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -105,7 +105,7 @@
 <!--98C47FF058F8413B8A2B26036061446E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--98C47FF058F8413B8A2B26036061446E-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--98C47FF058F8413B8A2B26036061446E-->  <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID>
-<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.16746]]></STARTVERSION>
+<!--98C47FF058F8413B8A2B26036061446E-->  <STARTVERSION><![CDATA[8.1.16854]]></STARTVERSION>
 <!--98C47FF058F8413B8A2B26036061446E-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--98C47FF058F8413B8A2B26036061446E-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--98C47FF058F8413B8A2B26036061446E-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -119,7 +119,7 @@
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <AD_DEPENDENT_MODULE_ID><![CDATA[96998CBC42744B3DBEE28AC8095C9335]]></AD_DEPENDENT_MODULE_ID>
-<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.16746]]></STARTVERSION>
+<!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <STARTVERSION><![CDATA[2.0.16854]]></STARTVERSION>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <DEPENDANT_MODULE_NAME><![CDATA[2.50 to 3.00 Compatibility Skin]]></DEPENDANT_MODULE_NAME>
 <!--A6D7BA917B3B4DEABD7CA1BA00B01E8A-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -133,7 +133,7 @@
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID>
-<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--A9CB99330AF34944877F889DD8A0AB3C-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME>
 <!--A9CB99330AF34944877F889DD8A0AB3C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -147,7 +147,7 @@
 <!--E72A053A403C4A98A189C105B850ADB0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_DEPENDENT_MODULE_ID>
-<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.16746]]></STARTVERSION>
+<!--E72A053A403C4A98A189C105B850ADB0-->  <STARTVERSION><![CDATA[1.1.16854]]></STARTVERSION>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <DEPENDANT_MODULE_NAME><![CDATA[JBoss Weld]]></DEPENDANT_MODULE_NAME>
 <!--E72A053A403C4A98A189C105B850ADB0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -161,7 +161,7 @@
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <AD_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_MODULE_ID>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <AD_DEPENDENT_MODULE_ID><![CDATA[F8D1B3ECB3474E8DA5C216473C840DF1]]></AD_DEPENDENT_MODULE_ID>
-<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.16746]]></STARTVERSION>
+<!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <STARTVERSION><![CDATA[2.0.16854]]></STARTVERSION>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON REST Webservice]]></DEPENDANT_MODULE_NAME>
 <!--F62443FC17DA4C0E84FBCA9F2E5B68C0-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <NAME><![CDATA[Openbravo 3.0]]></NAME>
-<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.16746]]></VERSION>
+<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION><![CDATA[3.0.16854]]></VERSION>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <DESCRIPTION><![CDATA[Openbravo 3.0 distribution template]]></DESCRIPTION>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <HELP><![CDATA[Openbravo 3.0 is a collection (distribution) of modules. This template is a container of all the modules and configuration changes that compose Openbravo 3.0.]]></HELP>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <URL><![CDATA[http://forge.openbravo.com/projects/vthree]]></URL>
@@ -20,7 +20,7 @@
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
-<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--0138E7A89B5E4DC3932462252801FFBC-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--0138E7A89B5E4DC3932462252801FFBC-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--0138E7A89B5E4DC3932462252801FFBC--></AD_MODULE>
 
--- a/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -7,7 +7,7 @@
 <!--4D11E3A70650475381139522373CD191-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4D11E3A70650475381139522373CD191-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--4D11E3A70650475381139522373CD191-->  <AD_DEPENDENT_MODULE_ID><![CDATA[7E48CDD73B7E493A8BED4F7253E7C989]]></AD_DEPENDENT_MODULE_ID>
-<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.16746]]></STARTVERSION>
+<!--4D11E3A70650475381139522373CD191-->  <STARTVERSION><![CDATA[2.1.16854]]></STARTVERSION>
 <!--4D11E3A70650475381139522373CD191-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--4D11E3A70650475381139522373CD191-->  <DEPENDANT_MODULE_NAME><![CDATA[Openbravo 3.0 Framework]]></DEPENDANT_MODULE_NAME>
 <!--4D11E3A70650475381139522373CD191-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[2A5EE903D7974AC298C0504FBC4501A7]]></AD_DEPENDENT_MODULE_ID>
-<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--52CE523C40634C47A99C6EBBD9C3125C-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDANT_MODULE_NAME><![CDATA[Payment Report]]></DEPENDANT_MODULE_NAME>
 <!--52CE523C40634C47A99C6EBBD9C3125C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -35,7 +35,7 @@
 <!--60834727BB114764ACEF019F40A34562-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--60834727BB114764ACEF019F40A34562-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--60834727BB114764ACEF019F40A34562-->  <AD_DEPENDENT_MODULE_ID><![CDATA[3A3A943684D64DEF9EC39F588A656848]]></AD_DEPENDENT_MODULE_ID>
-<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.16746]]></STARTVERSION>
+<!--60834727BB114764ACEF019F40A34562-->  <STARTVERSION><![CDATA[1.1.16854]]></STARTVERSION>
 <!--60834727BB114764ACEF019F40A34562-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDANT_MODULE_NAME><![CDATA[Orders Awaiting Delivery]]></DEPENDANT_MODULE_NAME>
 <!--60834727BB114764ACEF019F40A34562-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -49,7 +49,7 @@
 <!--8418885E97D643138B6D907671351E3D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8418885E97D643138B6D907671351E3D-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--8418885E97D643138B6D907671351E3D-->  <AD_DEPENDENT_MODULE_ID><![CDATA[883B5872CA0548F9AF2BBBE7D2DDFA61]]></AD_DEPENDENT_MODULE_ID>
-<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--8418885E97D643138B6D907671351E3D-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--8418885E97D643138B6D907671351E3D-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDANT_MODULE_NAME><![CDATA[Standard Roles]]></DEPENDANT_MODULE_NAME>
 <!--8418885E97D643138B6D907671351E3D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -63,7 +63,7 @@
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--A32F3279B3374FC0A6CFEA2368BB7053-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--A32F3279B3374FC0A6CFEA2368BB7053-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MINOR]]></DEPENDENCY_ENFORCEMENT>
@@ -77,7 +77,7 @@
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <AD_DEPENDENT_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_DEPENDENT_MODULE_ID>
-<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.16746]]></STARTVERSION>
+<!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <STARTVERSION><![CDATA[3.0.16854]]></STARTVERSION>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <DEPENDANT_MODULE_NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></DEPENDANT_MODULE_NAME>
 <!--ED06CE9F2AFD4092871D9E9494AF42DD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -91,7 +91,7 @@
 <!--FF8080813189932B013189B45B59003A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813189932B013189B45B59003A-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8080813189932B013189B45B59003A-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813141B198013141B86DD70003]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.16746]]></STARTVERSION>
+<!--FF8080813189932B013189B45B59003A-->  <STARTVERSION><![CDATA[0.1.16854]]></STARTVERSION>
 <!--FF8080813189932B013189B45B59003A-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDANT_MODULE_NAME><![CDATA[OpenID Service Integration]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813189932B013189B45B59003A-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -105,7 +105,7 @@
 <!--FF8080813189932B013189B4C00F003D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080813189932B013189B4C00F003D-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8080813189932B013189B4C00F003D-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080813129ADA401312CA1222A0005]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.16746]]></STARTVERSION>
+<!--FF8080813189932B013189B4C00F003D-->  <STARTVERSION><![CDATA[0.1.16854]]></STARTVERSION>
 <!--FF8080813189932B013189B4C00F003D-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8080813189932B013189B4C00F003D-->  <DEPENDANT_MODULE_NAME><![CDATA[Integration with Google APIs]]></DEPENDANT_MODULE_NAME>
 <!--FF8080813189932B013189B4C00F003D-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -119,7 +119,7 @@
 <!--FF8081812E2F6F3C012E2F750109001C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <AD_MODULE_ID><![CDATA[0138E7A89B5E4DC3932462252801FFBC]]></AD_MODULE_ID>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <AD_DEPENDENT_MODULE_ID><![CDATA[FF8080812D842086012D844F3CC0003E]]></AD_DEPENDENT_MODULE_ID>
-<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.16746]]></STARTVERSION>
+<!--FF8081812E2F6F3C012E2F750109001C-->  <STARTVERSION><![CDATA[0.0.16854]]></STARTVERSION>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <ISINCLUDED><![CDATA[Y]]></ISINCLUDED>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDANT_MODULE_NAME><![CDATA[Widgets Collection]]></DEPENDANT_MODULE_NAME>
 <!--FF8081812E2F6F3C012E2F750109001C-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/src-core/src/org/openbravo/xmlEngine/XmlDocument.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-core/src/org/openbravo/xmlEngine/XmlDocument.java	Mon Jun 25 19:58:29 2012 +0200
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2011 Openbravo S.L.U.
+ * Copyright (C) 2001-2012 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -273,6 +273,16 @@
           xmlVectorValue.handler = handler;
       } else {
         log4jXmlDocument.debug("print(String strBlank) - properties file not found");
+        try {
+          handler.setLanguage(xmlTemplate.xmlEngine.sessionLanguage);
+          handler.generateTranslations();
+          if (!ignoreTranslation && handler.getFormLabels() != null
+              && !handler.getFormLabels().isEmpty()) {
+            xmlVectorValue.setTextMap(handler.getFormLabels());
+          }
+        } catch (Exception e) {
+          log4jXmlDocument.error("Error translating", e);
+        }
       }
     } else {
       log4jXmlDocument.debug("print(String strBlank) - hasParameterValue is null");
--- a/src-db/database/model/functions/AD_ISJAVAWORD.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/AD_ISJAVAWORD.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -16,13 +16,13 @@
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2009-2010 Openbravo SLU
+* All portions are Copyright (C) 2009-2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
 BEGIN
   --Prevents column names to generate conflicts with DAL's getters and setters
-  RETURN case when lower(WORD) in ('class')
+  RETURN case when lower(WORD) in ('class', 'length')
     THEN 'Y' ELSE 'N' END;
 END AD_ISJAVAWORD
 ]]></body>
--- a/src-db/database/model/functions/C_GETTAX.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/C_GETTAX.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -171,13 +171,13 @@
           (SELECT t.C_Tax_ID, '' AS billToC_Location_ID, '' AS IsTaxExempt
           FROM  (SELECT C_Tax_ID, C_Country_ID, C_Region_ID, To_Country_Id,
                    To_Region_ID, ValidFrom, C_TaxCategory_ID,
-                   Parent_Tax_ID, C_BP_TaxCategory_ID, SoPoType, c_Tax.ad_org_id,c_Tax.ad_client_id
+                   Parent_Tax_ID, C_BP_TaxCategory_ID, SoPoType, c_Tax.ad_org_id,c_Tax.ad_client_id,IsDefault
                  FROM c_Tax
                 WHERE c_Tax.isActive = 'Y'
                  UNION
                  SELECT tz.C_Tax_ID, tz.From_Country_ID, tz.From_Region_ID, tz.To_Country_ID,
                    tz.To_Region_ID, ValidFrom, C_TaxCategory_ID,
-                   Parent_Tax_Id, C_BP_TaxCategory_ID, ct.SoPoType, ct.ad_org_id,ct.ad_client_id
+                   Parent_Tax_Id, C_BP_TaxCategory_ID, ct.SoPoType, ct.ad_org_id,ct.ad_client_id,ct.IsDefault
                  FROM c_Tax_Zone tz,
                       c_Tax ct
                  WHERE tz.C_Tax_ID = ct.C_Tax_ID
@@ -198,7 +198,7 @@
          --   AND ((t.C_BP_TaxCategory_ID = v_BPTaxCategory) OR (v_BPTaxCategory IS NULL))
             AND ((t.C_BP_TaxCategory_ID IS NOT NULL AND t.C_BP_TaxCategory_ID = v_BPTaxCategory) OR (t.C_BP_TaxCategory_ID IS NULL))
             AND (SoPoType = 'B' OR (SoPoType =(case when p_IsSOTrx='Y' then 'S' else 'P' end)))
-          ORDER BY ad_isorgincluded(p_org_id, t.ad_org_id,t.ad_client_id),t.C_BP_TaxCategory_ID, t.C_Country_ID, t.To_Country_ID, t.C_Region_ID, t.To_Region_ID, t.ValidFrom DESC
+          ORDER BY ad_isorgincluded(p_org_id, t.ad_org_id,t.ad_client_id),t.C_BP_TaxCategory_ID, t.IsDefault DESC,t.C_Country_ID, t.To_Country_ID, t.C_Region_ID, t.To_Region_ID, t.ValidFrom DESC
           )
         LOOP
           v_TaxID := SEL1.C_Tax_ID;
@@ -210,13 +210,13 @@
             FROM
               (SELECT C_Tax_ID, C_Country_ID, C_Region_ID, To_Country_Id,
                 To_Region_ID, ValidFrom, C_TaxCategory_ID,
-                Parent_Tax_ID, C_BP_TaxCategory_ID, SoPoType, c_Tax.ad_org_id,c_Tax.ad_client_id
+                Parent_Tax_ID, C_BP_TaxCategory_ID, SoPoType, c_Tax.ad_org_id,c_Tax.ad_client_id,IsDefault
               FROM c_Tax
               WHERE c_Tax.isActive = 'Y'
               UNION
               SELECT tz.C_Tax_ID, tz.From_Country_ID, tz.From_Region_ID, tz.To_Country_ID,
                 tz.To_Region_ID, ValidFrom, C_TaxCategory_ID,
-                Parent_Tax_Id, C_BP_TaxCategory_ID, SoPoType, ct.ad_org_id, ct.ad_client_id
+                Parent_Tax_Id, C_BP_TaxCategory_ID, SoPoType, ct.ad_org_id, ct.ad_client_id,ct.IsDefault
               FROM c_Tax_Zone tz,
                 c_Tax ct
               WHERE tz.C_Tax_ID = ct.C_Tax_ID
@@ -238,7 +238,7 @@
               --AND ((t.C_BP_TaxCategory_ID = v_BPTaxCategory) OR (v_BPTaxCategory IS NULL))
               AND ((t.C_BP_TaxCategory_ID IS NOT NULL AND t.C_BP_TaxCategory_ID = v_BPTaxCategory) OR (t.C_BP_TaxCategory_ID IS NULL))
               AND (SoPoType = 'B' OR (SoPoType =(case when p_IsSOTrx='Y' then 'S' else 'P' end)))
-            ORDER BY ad_isorgincluded(p_org_id, t.ad_org_id,t.ad_client_id),t.C_BP_TaxCategory_ID,t.C_Country_ID, t.C_Region_ID, t.ValidFrom DESC
+            ORDER BY ad_isorgincluded(p_org_id, t.ad_org_id,t.ad_client_id),t.C_BP_TaxCategory_ID,t.IsDefault DESC,t.C_Country_ID, t.C_Region_ID, t.ValidFrom DESC
             )
           LOOP
             v_TaxID := SEL2.C_Tax_ID;
@@ -259,7 +259,7 @@
               AND (SoPoType = 'B' OR (SoPoType =(case when p_IsSOTrx='Y' then 'S' else 'P' end)))
               AND t.isActive = 'Y'
               AND ad_isorgincluded(p_org_id, t.ad_org_id,t.ad_client_id) <> -1
-            ORDER BY ad_isorgincluded(p_org_id, t.ad_org_id,t.ad_client_id),t.C_BP_TaxCategory_ID, t.ValidFrom DESC
+            ORDER BY ad_isorgincluded(p_org_id, t.ad_org_id,t.ad_client_id),t.C_BP_TaxCategory_ID, t.IsDefault DESC,t.ValidFrom DESC
             )
           LOOP
             v_TaxID := SEL3.C_Tax_ID;
--- a/src-db/database/model/functions/C_INVOICE_POST.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/C_INVOICE_POST.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -577,7 +577,7 @@
               Description, M_Product_ID, QtyInvoiced, PriceList,
               PriceActual, LineNetAmt, C_Charge_ID, ChargeAmt,
               C_UOM_ID, C_Tax_ID, PriceStd, 
-              Financial_Invoice_Line, Account_ID)
+              Financial_Invoice_Line, Account_ID,Taxbaseamt)
             VALUES
             (
               v_NextNo, Cur_InvoiceLine.AD_Client_ID, Cur_InvoiceLine.AD_Org_ID, 'Y',
@@ -586,7 +586,7 @@
                '*R*: ' || Cur_InvoiceLine.Description, Cur_InvoiceLine.M_Product_ID, Cur_InvoiceLine.QtyInvoiced * -1, Cur_InvoiceLine.PriceList,
               Cur_InvoiceLine.PriceActual, Cur_InvoiceLine.LineNetAmt * -1, Cur_InvoiceLine.C_Charge_ID, Cur_InvoiceLine.ChargeAmt * -1,
               Cur_InvoiceLine.C_UOM_ID, Cur_InvoiceLine.C_Tax_ID, Cur_InvoiceLine.PriceStd, 
-              Cur_InvoiceLine.Financial_Invoice_Line, Cur_InvoiceLine.Account_ID
+              Cur_InvoiceLine.Financial_Invoice_Line, Cur_InvoiceLine.Account_ID,Cur_InvoiceLine.Taxbaseamt * -1
             );
           INSERT INTO M_MATCHINV
             (M_MATCHINV_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY,
@@ -1066,6 +1066,7 @@
              FROM M_PRODUCT_BOM b, M_PRODUCT p
              WHERE b.M_Product_ID=CUR_BOM_Line.M_Product_ID
                AND b.M_ProductBOM_ID=p.M_Product_ID
+               AND b.isactive = 'Y'
              ORDER BY Line
             )
           LOOP
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -814,6 +814,7 @@
                 FROM M_PRODUCT_BOM b
                       INNER JOIN M_PRODUCT p ON (b.M_ProductBOM_ID=p.M_Product_ID)
                 WHERE b.M_Product_ID=CUR_BOM_Line.M_Product_ID
+                AND b.isactive='Y'
                 ORDER BY Line
                )
             LOOP
--- a/src-db/database/model/functions/GL_JOURNAL_POST.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/GL_JOURNAL_POST.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -22,7 +22,7 @@
   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
   * All Rights Reserved.
   * Contributor(s): Openbravo SLU
-  * Contributions are Copyright (C) 2001-2011 Openbravo, S.L.U.
+  * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
   *
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
@@ -58,11 +58,13 @@
     v_ControlAmt GL_Journal.ControlAmt%TYPE;
     FINISH_PROCESS BOOLEAN:=false;
     v_is_included NUMBER:=0;
+    v_has_lines NUMBER:=-1;
     v_available_period NUMBER:=0;
     v_is_ready AD_Org.IsReady%TYPE;
     v_is_tr_allow AD_OrgType.IsTransactionsAllowed%TYPE;
     v_isacctle AD_OrgType.IsAcctLegalEntity%TYPE;
     v_org_bule_id AD_Org.AD_Org_ID%TYPE;
+    v_documentNo GL_Journal.DocumentNo%TYPE;
     
   BEGIN
     --  Update AD_PInstance
@@ -203,6 +205,18 @@
       IF (v_is_tr_allow='N') THEN
         RAISE_APPLICATION_ERROR(-20000, '@OrgHeaderNotTransAllowed@');
       END IF;
+
+      -- Check if the gl journal has lines.
+     
+      SELECT 1, documentNo INTO v_has_lines, v_documentNo
+      FROM GL_Journal
+      WHERE EXISTS (SELECT 1
+                    FROM GL_JournalLine
+                    WHERE GL_JournalLine.GL_Journal_ID = GL_Journal.GL_Journal_ID
+                    AND GL_JournalLine.GL_Journal_ID = v_Record_ID);
+      IF (v_has_lines=-1) THEN
+        RAISE_APPLICATION_ERROR(-20000, '@GLJournalHasNoLines@' || ' ' || v_DocumentNo);
+      END IF;
       
       SELECT AD_ORG_CHK_DOCUMENTS('GL_JOURNAL', 'GL_JOURNALLINE', v_Record_ID, 'GL_JOURNAL_ID', 'GL_JOURNAL_ID') INTO v_is_included FROM dual;
       IF (v_is_included=-1) THEN
--- a/src-db/database/model/functions/MRP_PURCHASEPLAN.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/MRP_PURCHASEPLAN.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -85,6 +85,7 @@
               FROM M_PRODUCT_PO
               WHERE ISCURRENTVENDOR = 'Y'
                 AND (p_Vendor_ID IS NULL OR M_PRODUCT_PO.C_BPARTNER_ID = p_Vendor_ID)
+                AND M_PRODUCT_PO.DISCONTINUED = 'N'
               GROUP BY M_PRODUCT_ID) PRODUCT_PO --CASE WITH MORE THAN ONE DEFAULT VENDOR
         WHERE MRP_RUN_PURCHASE_ID = p_Run_ID
           AND M_PRODUCT.M_PRODUCT_ID = M_PRODUCT_PO.M_PRODUCT_ID
--- a/src-db/database/model/functions/MRP_RUN_INITIALIZE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/MRP_RUN_INITIALIZE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -99,6 +99,7 @@
                                             AND M_PRODUCT_PO.C_BPARTNER_ID = p_Vendor_ID
                                             AND M_PRODUCT_PO.ISCURRENTVENDOR = 'Y'
                                             AND M_PRODUCT_PO.ISACTIVE = 'Y'
+                                            AND M_PRODUCT_PO.DISCONTINUED = 'N'
                                           )))
                           AND (p_BPartner_ID IS NULL
                                OR EXISTS (SELECT 1
--- a/src-db/database/model/functions/M_BOM_PRICELIMIT.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_BOM_PRICELIMIT.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -19,7 +19,7 @@
 * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
 * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
 * Contributor(s): Openbravo SLU
-* Contributions are Copyright (C) 2001-2006 Openbravo S.L.U.
+* Contributions are Copyright (C) 2001-2012 Openbravo S.L.U.
 ******************************************************************************/
   v_Price        NUMBER;
   v_ProductPrice NUMBER;
@@ -52,6 +52,7 @@
           M_Product p
         WHERE b.M_ProductBOM_ID = p.M_Product_ID
           AND b.M_Product_ID = p_Product_ID
+          AND b.isactive='Y'
         )
       LOOP
         v_ProductPrice := M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, p_PriceList_Version_ID) ;
--- a/src-db/database/model/functions/M_BOM_PRICELIST.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_BOM_PRICELIST.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -19,7 +19,7 @@
 * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
 * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
 * Contributor(s): Openbravo SLU
-* Contributions are Copyright (C) 2001-2006 Openbravo S.L.U.
+* Contributions are Copyright (C) 2001-2012 Openbravo S.L.U.
 ******************************************************************************/
   v_Price        NUMBER;
   v_ProductPrice NUMBER;
@@ -52,6 +52,7 @@
           M_Product p
         WHERE b.M_ProductBOM_ID=p.M_Product_ID
           AND b.M_Product_ID=Product_ID
+          AND b.isactive='Y'
         )
       LOOP
         v_ProductPrice:=M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, PriceList_Version_ID) ;
--- a/src-db/database/model/functions/M_BOM_PRICESTD.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_BOM_PRICESTD.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -19,7 +19,7 @@
 * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
 * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
 * Contributor(s): Openbravo SLU
-* Contributions are Copyright (C) 2001-2006 Openbravo S.L.U.
+* Contributions are Copyright (C) 2001-2012 Openbravo S.L.U.
 ******************************************************************************/
   v_Price        NUMBER;
   v_ProductPrice NUMBER;
@@ -52,6 +52,7 @@
           M_Product p
         WHERE b.M_ProductBOM_ID=p.M_Product_ID
           AND b.M_Product_ID=Product_ID
+          AND b.isactive='Y'
         )
       LOOP
         v_ProductPrice:=M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, PriceList_Version_ID) ;
--- a/src-db/database/model/functions/M_BOM_QTY_ONHAND.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_BOM_QTY_ONHAND.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -25,7 +25,7 @@
 * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
 * All Rights Reserved.
 * Contributor(s): Openbravo SLU
-* Contributions are Copyright (C) 2001-2009 Openbravo, S.L.U.
+* Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
 *
 * Specifically, this derivative work is based upon the following Compiere
 * file and version.
@@ -95,7 +95,8 @@
   FOR CUR_BOM IN
     (SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
     FROM M_PRODUCT_BOM b, M_PRODUCT p
-    WHERE b.M_ProductBOM_ID=p.M_Product_ID  AND b.M_Product_ID=p_Product_ID
+    WHERE b.M_ProductBOM_ID=p.M_Product_ID AND b.isactive='Y' 
+    AND b.M_Product_ID=p_Product_ID
     )
   LOOP
     -- Stocked Items "leaf node"
--- a/src-db/database/model/functions/M_BOM_QTY_ORDERED.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_BOM_QTY_ORDERED.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -25,7 +25,7 @@
 * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
 * All Rights Reserved.
 * Contributor(s): Openbravo SLU
-* Contributions are Copyright (C) 2001-2009 Openbravo, S.L.U.
+* Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
 *
 * Specifically, this derivative work is based upon the following Compiere
 * file and version.
@@ -100,6 +100,7 @@
     FROM M_Product_BOM b,
       M_Product p
     WHERE b.M_ProductBOM_ID = p.M_Product_ID
+      AND b.isactive='Y'
       AND b.M_Product_ID = p_Product_ID
     )
   LOOP
--- a/src-db/database/model/functions/M_BOM_QTY_RESERVED.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_BOM_QTY_RESERVED.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -25,7 +25,7 @@
 * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
 * All Rights Reserved.
 * Contributor(s): Openbravo SLU
-* Contributions are Copyright (C) 2001-2009 Openbravo, S.L.U.
+* Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
 *
 * Specifically, this derivative work is based upon the following Compiere
 * file and version.
@@ -100,6 +100,7 @@
     FROM M_Product_BOM b,
       M_Product p
     WHERE b.M_ProductBOM_ID=p.M_Product_ID
+      AND b.isactive='Y'
       AND b.M_Product_ID=p_Product_ID
     )
   LOOP
--- a/src-db/database/model/functions/M_PRODUCTION_RUN.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_PRODUCTION_RUN.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -284,6 +284,7 @@
               WHERE pb.M_ProductBOM_ID=p.M_Product_ID
                 AND pb.M_Product_ID=pp.M_PRODUCT_ID
                 AND pp.M_PRODUCTION_ID=v_Record_ID
+                AND pb.isactive='Y'
               ORDER BY pb.M_PRODUCTBOM_ID,
                 pb.Line
               )
@@ -388,6 +389,11 @@
                 ROLLBACK;
                 RAISE_APPLICATION_ERROR(-20000, v_Message);
               END IF;
+              IF (CUR_BOM.ProductionQty <= 0) THEN
+                v_Message := '@NegativeBOMProductionQty@';
+                ROLLBACK;
+                RAISE_APPLICATION_ERROR(-20000, v_Message);
+              END IF;
             END LOOP;
             IF(CUR_STOCK_ISOPEN) THEN
               CLOSE CUR_STOCK;
@@ -446,6 +452,7 @@
                   M_PRODUCT p
                 WHERE pb.M_ProductBOM_ID=p.M_Product_ID
                   AND pb.M_Product_ID=CUR_PLineBOM.M_Product_ID
+                  AND pb.isactive='Y'
                 ORDER BY pb.M_PRODUCTBOM_ID,
                   pb.Line
                 )
--- a/src-db/database/model/functions/M_PRODUCT_BOM_CHECK.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/functions/M_PRODUCT_BOM_CHECK.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -19,7 +19,7 @@
   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
   * All Rights Reserved.
   * Contributor(s): Openbravo SLU
-  * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U.
+  * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
   *
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
@@ -107,6 +107,7 @@
             (SELECT *
             FROM M_Product_BOM b
             WHERE p.M_Product_ID=b.M_ProductBOM_ID
+              AND b.isactive='Y'
               AND b.M_Product_ID IN
               (SELECT C_TEMP_Selection_ID FROM C_TEMP_Selection)
             )
@@ -132,6 +133,7 @@
           (SELECT *
           FROM M_Product_BOM b
           WHERE p.M_Product_ID=b.M_ProductBOM_ID
+            AND b.isactive='Y'
             AND b.M_Product_ID IN
             (SELECT C_TEMP_Selection_ID FROM C_TEMP_Selection)
           )
--- a/src-db/database/model/postscript-Oracle.sql	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/postscript-Oracle.sql	Mon Jun 25 19:58:29 2012 +0200
@@ -621,29 +621,6 @@
   WHERE a.value <= 1024
 /-- END
 
-create or replace FUNCTION AD_GET_RDBMS RETURN VARCHAR2
-AS
-/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* 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
-* 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) 2009 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.
-************************************************************************/
-BEGIN
- return 'ORACLE';
-END AD_GET_RDBMS;
-/-- END
- 
 --Inserts an alert recipient for available updates
 --See issue:  https://issues.openbravo.com/view.php?id=11743
 BEGIN
@@ -700,7 +677,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) 2009-2010 Openbravo SLU
+* All portions are Copyright (C) 2009-2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -799,6 +776,8 @@
   V_NEW_NUMBER NUMBER := NULL;
   V_OLD_DATE DATE := NULL;
   V_NEW_DATE DATE := NULL;
+  V_OLD_TEXT CLOB := NULL;
+  V_NEW_TEXT CLOB := NULL;
   V_TIME DATE;
   V_ORG VARCHAR2(32);
   V_CLIENT VARCHAR2(32);
@@ -875,7 +854,7 @@
                         and upper(c.columnname) not in ('CREATED','CREATEDBY','UPDATED', 'UPDATEDBY')
 			and c.isexcludeaudit='N'
                         order by c.position) loop
-      if (cur_cols.data_type in ('VARCHAR2', 'CHAR', 'CLOB')) then
+      if (cur_cols.data_type in ('VARCHAR2', 'CHAR')) then
         datatype := 'CHAR';
         code := code || 'IF (UPDATING AND ((COALESCE(:NEW.'||cur_cols.COLUMN_NAME||',''.'') != COALESCE(:OLD.'||cur_cols.COLUMN_NAME||',''.'')) OR ((:NEW.'||cur_cols.COLUMN_NAME||' IS NULL) AND :OLD.'||cur_cols.COLUMN_NAME||'=''.'') OR ((:OLD.'||cur_cols.COLUMN_NAME||' IS NULL) AND :NEW.'||cur_cols.COLUMN_NAME||'=''.'')))';
       elsif (cur_cols.data_type in ('NVARCHAR2', 'NCHAR')) then
@@ -884,6 +863,9 @@
       elsif (cur_cols.data_type in ('DATE')) then
         datatype := 'DATE';
         code := code || 'IF (UPDATING AND COALESCE(:NEW.'||cur_cols.COLUMN_NAME||', now()) != COALESCE(:OLD.'||cur_cols.COLUMN_NAME||', now()))';
+      elsif (cur_cols.data_type in ('CLOB')) then
+        datatype := 'TEXT';
+        code := code || 'IF (UPDATING AND ((COALESCE(:NEW.'||cur_cols.COLUMN_NAME||',''.'') != COALESCE(:OLD.'||cur_cols.COLUMN_NAME||',''.'')) OR ((:NEW.'||cur_cols.COLUMN_NAME||' IS NULL) AND :OLD.'||cur_cols.COLUMN_NAME||'=''.'') OR ((:OLD.'||cur_cols.COLUMN_NAME||' IS NULL) AND :NEW.'||cur_cols.COLUMN_NAME||'=''.'')))';
       else
         datatype := 'NUMBER';
         code := code || 'IF (UPDATING AND COALESCE(:NEW.'||cur_cols.COLUMN_NAME||', -1) != COALESCE(:OLD.'||cur_cols.COLUMN_NAME||', -1))';
--- a/src-db/database/model/postscript-PostgreSql.sql	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/postscript-PostgreSql.sql	Mon Jun 25 19:58:29 2012 +0200
@@ -357,31 +357,6 @@
   LANGUAGE 'plpgsql' VOLATILE
 /-- END
 
-CREATE OR REPLACE FUNCTION AD_GET_RDBMS()
-  RETURNS varchar AS
-$BODY$ DECLARE
-/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* 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
-* 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) 2009 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.
-************************************************************************/
-BEGIN
-  return 'POSTGRE';
-END;   $BODY$
-  LANGUAGE 'plpgsql' VOLATILE
-/-- END
-
 CREATE OR REPLACE VIEW AD_INTEGER AS
 SELECT a.value::numeric AS value
    FROM generate_series(1, 1024) a(value);
@@ -490,7 +465,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) 2009-2010 Openbravo SLU
+* All portions are Copyright (C) 2009-2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -569,6 +544,8 @@
   V_NEW_NUMBER NUMERIC := NULL;
   V_OLD_DATE TIMESTAMP := NULL;
   V_NEW_DATE TIMESTAMP := NULL;
+  V_OLD_TEXT TEXT := NULL;
+  V_NEW_TEXT TEXT := NULL;
   V_TIME TIMESTAMP;
   V_ORG VARCHAR(32); 
   V_CLIENT VARCHAR(32); 
@@ -648,7 +625,7 @@
                         order by c.position) loop
       code := code || '
     V_Change := false;';
-      if (cur_cols.data_type in ('VARCHAR', 'BPCHAR', 'TEXT')) then
+      if (cur_cols.data_type in ('VARCHAR', 'BPCHAR')) then
         datatype := 'CHAR';
         code := code || '
    IF TG_OP = ''UPDATE'' THEN
@@ -660,6 +637,12 @@
    IF TG_OP = ''UPDATE'' THEN
      V_CHANGE = COALESCE(new.'||cur_cols.COLUMN_NAME||', now()) != COALESCE(old.'||cur_cols.COLUMN_NAME||', now());
    END IF;';
+      elsif (cur_cols.data_type in ('TEXT')) then
+        datatype := 'TEXT';
+        code := code || '
+   IF TG_OP = ''UPDATE'' THEN
+     V_CHANGE = (COALESCE(new.'||cur_cols.COLUMN_NAME||',''.'') != COALESCE(old.'||cur_cols.COLUMN_NAME||',''.'') OR (new.'||cur_cols.COLUMN_NAME||' IS NULL AND old.'||cur_cols.COLUMN_NAME||'=''.'') OR (old.'||cur_cols.COLUMN_NAME||' IS NULL AND new.'||cur_cols.COLUMN_NAME||'=''.'') );
+   END IF;';
       else
         datatype := 'NUMBER';
         code := code || '
--- a/src-db/database/model/prescript-Oracle.sql	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/prescript-Oracle.sql	Mon Jun 25 19:58:29 2012 +0200
@@ -178,3 +178,26 @@
 EXCEPTION WHEN OTHERS THEN NULL;
 END;
 /-- END
+  
+create or replace FUNCTION AD_GET_RDBMS RETURN VARCHAR2 DETERMINISTIC
+AS
+/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* 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
+* 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) 2009-2012 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+BEGIN
+ return 'ORACLE';
+END AD_GET_RDBMS;
+/-- END 
--- a/src-db/database/model/prescript-PostgreSql.sql	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/prescript-PostgreSql.sql	Mon Jun 25 19:58:29 2012 +0200
@@ -1616,4 +1616,29 @@
 
 DROP FUNCTION drop_acctschema_default ()
 /-- END
+ 
+CREATE OR REPLACE FUNCTION AD_GET_RDBMS()
+  RETURNS varchar AS
+$BODY$ DECLARE
+/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* 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
+* 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) 2009-2012 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+BEGIN
+  return 'POSTGRE';
+END;   $BODY$
+  LANGUAGE 'plpgsql' IMMUTABLE
+/-- END
 
--- a/src-db/database/model/tables/AD_AUDIT_TRAIL.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/tables/AD_AUDIT_TRAIL.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -101,6 +101,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="OLD_TEXT" primaryKey="false" required="false" type="CLOB" size="4000" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="NEW_TEXT" primaryKey="false" required="false" type="CLOB" size="4000" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <index name="AD_AUDIT_TRAIL_INSERT_IDX" unique="false">
         <index-column name="AD_TABLE_ID"/>
         <index-column name="RECORD_ID"/>
--- a/src-db/database/model/tables/AD_USER.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/tables/AD_USER.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -149,6 +149,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault/>
       </column>
+      <column name="AD_IMAGE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_USER_AD_ORGTRX">
         <reference local="AD_ORGTRX_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
@@ -179,6 +183,9 @@
       <foreign-key foreignTable="M_WAREHOUSE" name="AD_USER_DEFAULT_M_WAREHOUSE">
         <reference local="DEFAULT_M_WAREHOUSE_ID" foreign="M_WAREHOUSE_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="AD_IMAGE" name="AD_USER_IMAGE_KEY">
+        <reference local="AD_IMAGE_ID" foreign="AD_IMAGE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_ORG" name="AD_USER_ORG">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/FIN_FINACC_TRANSACTION.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/tables/FIN_FINACC_TRANSACTION.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -187,6 +187,15 @@
       <foreign-key foreignTable="FIN_PAYMENT" name="FIN_PAYMENT_TRANSACTION">
         <reference local="FIN_PAYMENT_ID" foreign="FIN_PAYMENT_ID"/>
       </foreign-key>
+      <index name="FIN_FINACC_TR_ACCOUNT_LINE" unique="false">
+        <index-column name="FIN_FINANCIAL_ACCOUNT_ID"/>
+        <index-column name="LINE"/>
+      </index>
+      <index name="FIN_FINACC_TRANSACTION_DAO" unique="false">
+        <index-column name="FIN_FINANCIAL_ACCOUNT_ID"/>
+        <index-column name="FIN_RECONCILIATION_ID"/>
+        <index-column name="STATUS"/>
+      </index>
       <unique name="FIN_FINACC_TRANSACTION_UN">
         <unique-column name="FIN_PAYMENT_ID"/>
       </unique>
--- a/src-db/database/model/tables/FIN_PAYMENT_RUN_PARA.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/tables/FIN_PAYMENT_RUN_PARA.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -62,6 +62,5 @@
         <reference local="FIN_PAY_EXEC_PROCESS_PARA_ID" foreign="FIN_PAY_EXEC_PROCESS_PARA_ID"/>
       </foreign-key>
       <check name="FIN_PAYMENTRUNPARA_ACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
-      <check name="FIN_PAYMENTRUNPARA_VALCHK_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/model/tables/FIN_PAYMENT_SCHEDULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/tables/FIN_PAYMENT_SCHEDULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -97,6 +97,9 @@
       <index name="FIN_PAYM_SCH_INV_IDX" unique="false">
         <index-column name="C_INVOICE_ID"/>
       </index>
+      <index name="FIN_PAYMENT_SCHEDULE_OUTAMT" unique="false">
+        <index-column name="OUTSTANDINGAMT"/>
+      </index>
       <check name="FIN_PAYSCHED_UPP_CHK"><![CDATA[UPDATE_PAYMENT_PLAN IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/model/triggers/AD_COLUMN_TRG2.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/triggers/AD_COLUMN_TRG2.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -14,7 +14,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) 2008-2009 Openbravo SLU
+* All portions are Copyright (C) 2008-2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -57,6 +57,9 @@
   IF AD_IsJavaWord(:new.Name)='Y' THEN
     RAISE_APPLICATION_ERROR(-20000, '@NotAllowedColumnName@ "'||:new.name||'" @ReservedJavaWord@') ;
   END IF;
+  IF AD_IsJavaWord(:new.ColumnName)='Y' THEN
+    RAISE_APPLICATION_ERROR(-20000, '@NotAllowedDBColumnName@ "'||:new.ColumnName||'" @ReservedJavaWord@') ;
+  END IF;
   
   /**
   * Create Sequence for DocumentNo and Value columns
--- a/src-db/database/model/triggers/AD_ELEMENT_TRG.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/triggers/AD_ELEMENT_TRG.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -17,7 +17,7 @@
     * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
     * All Rights Reserved.
     * Contributor(s): Openbravo SLU
-    * Contributions are Copyright (C) 2001-2009 Openbravo, S.L.U.
+    * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
     *
     * Specifically, this derivative work is based upon the following Compiere
     * file and version.
@@ -35,6 +35,13 @@
     IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
+    IF AD_IsJavaWord(:new.Name)='Y' THEN
+    RAISE_APPLICATION_ERROR(-20000, '@NotAllowedElementName@ "'||:new.Name||'" @ReservedJavaWord@') ;
+    END IF;
+    IF AD_IsJavaWord(:new.ColumnName)='Y' THEN
+    RAISE_APPLICATION_ERROR(-20000, '@NotAllowedDBColumnName@ "'||:new.ColumnName||'" @ReservedJavaWord@') ;
+    END IF;
+
 
     -- Insert AD_Element Trigger
     IF INSERTING
--- a/src-db/database/model/triggers/AD_FIELD_TRG.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/triggers/AD_FIELD_TRG.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -17,7 +17,7 @@
     * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
     * All Rights Reserved.
     * Contributor(s): Openbravo SLU
-    * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U.
+    * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
     *
     * Specifically, this derivative work is based upon the following Compiere
     * file and version.
@@ -31,6 +31,10 @@
     IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
+    IF AD_IsJavaWord(:new.Name)='Y' THEN
+    RAISE_APPLICATION_ERROR(-20000, '@NotAllowedFieldName@ "'||:new.Name||'" @ReservedJavaWord@') ;
+    END IF;
+
   IF INSERTING
     THEN
       INSERT
--- a/src-db/database/model/triggers/C_ORDERLINE2_TRG.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/triggers/C_ORDERLINE2_TRG.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
   <database name="TRIGGER C_ORDERLINE2_TRG">
-    <trigger name="C_ORDERLINE2_TRG" table="C_ORDERLINE" fires="before" insert="false" update="true" delete="false" foreach="row">
+    <trigger name="C_ORDERLINE2_TRG" table="C_ORDERLINE" fires="before" insert="true" update="true" delete="true" foreach="row">
       <body><![CDATA[
 
 
@@ -18,15 +18,20 @@
 * 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 portions are Copyright (C) 2001-2012 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-  v_ID VARCHAR2(32);
-  v_QtyReserved      NUMBER;
-  v_QtyOrderReserved NUMBER;
-  V_STOCKED          NUMBER;
-    
+  v_ID VARCHAR2(32);   
+  v_QtyReserved        NUMBER;
+  v_QtyOrderReserved   NUMBER;
+  V_STOCKED            NUMBER;
+  v_DocStatus          VARCHAR(60);
+  v_DocAction          VARCHAR(60);
+  v_isSOTrx            CHAR(1);
+  v_QtyReservedPO      NUMBER;
+  v_QtyOrderReservedPO NUMBER;
+
 BEGIN
     
     IF AD_isTriggerEnabled()='N' THEN RETURN;
@@ -56,6 +61,51 @@
       END IF;
     END IF;
   END IF;
+
+  IF(UPDATING OR DELETING) THEN
+    v_ID:=:old.C_Order_ID;
+    SELECT DocStatus, DocAction, isSOTrx
+    INTO v_DocStatus, v_DocAction, v_isSOTrx
+    FROM c_Order
+    WHERE c_order_id = v_ID;
+    IF(v_DocStatus = 'IP') THEN
+      IF(v_isSOTrx = 'Y') THEN
+        v_QtyReserved := -:old.qtyordered;
+        v_QtyOrderReserved := -:old.quantityorder;
+        v_QtyReservedPO := 0;
+        v_QtyOrderReservedPO := null;
+      ELSE
+        v_QtyReserved := 0;
+        v_QtyOrderReserved := null;
+        v_QtyReservedPO := -:old.qtyordered;
+        v_QtyOrderReservedPO := -:old.quantityorder;
+      END IF;
+      M_UPDATE_STORAGE_PENDING(:old.AD_Client_ID, :old.AD_Org_ID, :old.UpdatedBy, :old.M_Product_ID, :old.M_Warehouse_ID, :old.M_AttributeSetInstance_ID, :old.C_UOM_ID, :old.M_Product_UOM_ID, v_QtyReserved, v_QtyOrderReserved, v_QtyReservedPO, v_QtyOrderReservedPO);
+    END IF;
+  END IF;
+
+  IF(INSERTING OR UPDATING) THEN
+    v_ID:=:new.C_Order_ID;
+    SELECT DocStatus, DocAction, isSOTrx
+    INTO v_DocStatus, v_DocAction, v_isSOTrx
+    FROM c_Order
+    WHERE c_order_id = v_ID;
+    IF(v_DocStatus = 'IP') THEN
+      IF(v_isSOTrx = 'Y') THEN
+        v_QtyReserved := :new.qtyordered;
+        v_QtyOrderReserved := :new.quantityorder;
+        v_QtyReservedPO := 0;
+        v_QtyOrderReservedPO := null;
+      ELSE
+        v_QtyReserved := 0;
+        v_QtyOrderReserved := null;
+        v_QtyReservedPO := :new.qtyordered;
+        v_QtyOrderReservedPO := :new.quantityorder;
+      END IF;
+      M_UPDATE_STORAGE_PENDING(:new.AD_Client_ID, :new.AD_Org_ID, :new.UpdatedBy, :new.M_Product_ID, :new.M_Warehouse_ID, :new.M_AttributeSetInstance_ID, :new.C_UOM_ID, :new.M_Product_UOM_ID, v_QtyReserved, v_QtyOrderReserved, v_QtyReservedPO, v_QtyOrderReservedPO);
+    END IF;
+  END IF;
+
 END C_ORDERLINE2_TRG
 ]]></body>
     </trigger>
--- a/src-db/database/model/views/AD_AUDIT_TRAIL_V.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/views/AD_AUDIT_TRAIL_V.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW AD_AUDIT_TRAIL_V">
-    <view name="AD_AUDIT_TRAIL_V"><![CDATA[SELECT at.ad_audit_trail_id, at.ad_client_id, at.ad_org_id, at.isactive, at.created, at.createdby, at.updated, at.updatedby, at.ad_table_id, at.record_id, at.record_revision, at.ad_user_id, at.event_time, at.processtype, at.process_id, at.action, at.ad_column_id, at.old_char, at.new_char, at.old_nchar, at.new_nchar, at.old_number, at.new_number, at.old_date, at.new_date, 
+    <view name="AD_AUDIT_TRAIL_V"><![CDATA[SELECT at.ad_audit_trail_id, at.ad_client_id, at.ad_org_id, at.isactive, at.created, at.createdby, at.updated, at.updatedby, at.ad_table_id, at.record_id, at.record_revision, at.ad_user_id, at.event_time, at.processtype, at.process_id, at.action, at.ad_column_id, at.old_char, at.new_char, at.old_nchar, at.new_nchar, at.old_number, at.new_number, at.old_date, at.new_date, at.old_text, at.new_text, 
 CASE
 WHEN at.processtype = 'P' THEN (SELECT to_char(p.name) AS to_char
 FROM ad_process p
@@ -12,6 +12,22 @@
 FROM ad_form f
 WHERE f.ad_form_id = at.process_id)
 ELSE ''
-END AS process_desc, COALESCE(at.old_char, to_char(at.old_nchar), to_char(at.old_date), to_char(at.old_number)) AS old_value, COALESCE(at.new_char, to_char(at.new_nchar), to_char(at.new_date), to_char(at.new_number)) AS new_value
+END AS process_desc, COALESCE(at.old_char, to_char(at.old_nchar), to_char(at.old_date), to_char(at.old_number), 
+CASE
+WHEN ad_get_rdbms() = 'ORACLE' THEN 
+CASE
+WHEN length(at.old_text) > 3996 THEN (to_char(substr(at.old_text, 1, 3996)) || '...')
+ELSE to_char(at.old_text)
+END
+ELSE to_char(at.old_text)
+END) AS old_value, COALESCE(at.new_char, to_char(at.new_nchar), to_char(at.new_date), to_char(at.new_number), 
+CASE
+WHEN ad_get_rdbms() = 'ORACLE' THEN 
+CASE
+WHEN length(at.new_text) > 3996 THEN (to_char(substr(at.new_text, 1, 3996)) || '...')
+ELSE to_char(at.new_text)
+END
+ELSE to_char(at.new_text)
+END) AS new_value
 FROM ad_audit_trail at]]></view>
   </database>
--- a/src-db/database/model/views/FIN_PAYMENT_DETAIL_V.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/model/views/FIN_PAYMENT_DETAIL_V.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
   <database name="VIEW FIN_PAYMENT_DETAIL_V">
-    <view name="FIN_PAYMENT_DETAIL_V"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS fin_payment_detail_v_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.createdby, psd.updated, psd.updatedby, psi.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS paidamt, p.c_bpartner_id, p.fin_paymentmethod_id, p.fin_financial_account_id, p.c_currency_id, p.paymentdate, gli.name AS glitemname, pd.writeoffamt, fa.c_currency_id AS finacc_currency_id, p.finacc_txn_convert_rate, psd.amount * p.finacc_txn_convert_rate AS paidconverted, COALESCE(psi.amount, pso.amount) * p.finacc_txn_convert_rate AS expectedconverted, psd.iscanceled, psd.c_bpartner_id AS c_bpartner_id_dim, psd.c_activity_id, psd.m_product_id, psd.c_campaign_id, psd.c_project_id, psd.c_salesregion_id
+    <view name="FIN_PAYMENT_DETAIL_V"><![CDATA[SELECT psd.fin_payment_scheduledetail_id AS fin_payment_detail_v_id, psd.ad_client_id, psd.ad_org_id, psd.isactive, psd.created, psd.createdby, psd.updated, psd.updatedby, psi.fin_payment_schedule_id AS fin_payment_sched_inv_v_id, pso.fin_payment_schedule_id AS fin_payment_sched_ord_v_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.amount, pso.amount) AS expected, psd.amount AS paidamt, p.c_bpartner_id, p.fin_paymentmethod_id, p.fin_financial_account_id, p.c_currency_id, p.paymentdate, gli.name AS glitemname, pd.writeoffamt, fa.c_currency_id AS finacc_currency_id, p.finacc_txn_convert_rate, psd.amount * p.finacc_txn_convert_rate AS paidconverted, COALESCE(psi.amount, pso.amount) * p.finacc_txn_convert_rate AS expectedconverted, psd.iscanceled, psd.c_bpartner_id AS c_bpartner_id_dim, psd.c_activity_id, psd.m_product_id, psd.c_campaign_id, psd.c_project_id, psd.c_salesregion_id, p.status
 FROM fin_payment p
 LEFT JOIN fin_financial_account fa ON p.fin_financial_account_id = fa.fin_financial_account_id, fin_payment_detail pd
 JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -39849,7 +39849,7 @@
 <!--2712-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
 <!--2712-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--2712-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
-<!--2712-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--2712-->  <DEVELOPMENTSTATUS><![CDATA[NI]]></DEVELOPMENTSTATUS>
 <!--2712-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--2712-->  <POSITION><![CDATA[23]]></POSITION>
 <!--2712-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
@@ -222465,7 +222465,7 @@
 <!--1C30BBC88DEA4E40831C616E1D34973B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--1C30BBC88DEA4E40831C616E1D34973B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--1C30BBC88DEA4E40831C616E1D34973B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--1C30BBC88DEA4E40831C616E1D34973B-->  <POSITION><![CDATA[35]]></POSITION>
+<!--1C30BBC88DEA4E40831C616E1D34973B-->  <POSITION><![CDATA[36]]></POSITION>
 <!--1C30BBC88DEA4E40831C616E1D34973B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--1C30BBC88DEA4E40831C616E1D34973B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--1C30BBC88DEA4E40831C616E1D34973B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -223318,7 +223318,7 @@
 <!--20217D869BFD41938E250F7F7528E06F-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--20217D869BFD41938E250F7F7528E06F-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--20217D869BFD41938E250F7F7528E06F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--20217D869BFD41938E250F7F7528E06F-->  <POSITION><![CDATA[31]]></POSITION>
+<!--20217D869BFD41938E250F7F7528E06F-->  <POSITION><![CDATA[32]]></POSITION>
 <!--20217D869BFD41938E250F7F7528E06F-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--20217D869BFD41938E250F7F7528E06F-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--20217D869BFD41938E250F7F7528E06F-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -223395,6 +223395,40 @@
 <!--209C6CD23241412F80A346497E8544E0-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--209C6CD23241412F80A346497E8544E0--></AD_COLUMN>
 
+<!--20A0358265C94676A1762AA284590490--><AD_COLUMN>
+<!--20A0358265C94676A1762AA284590490-->  <AD_COLUMN_ID><![CDATA[20A0358265C94676A1762AA284590490]]></AD_COLUMN_ID>
+<!--20A0358265C94676A1762AA284590490-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--20A0358265C94676A1762AA284590490-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--20A0358265C94676A1762AA284590490-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--20A0358265C94676A1762AA284590490-->  <NAME><![CDATA[Old Text]]></NAME>
+<!--20A0358265C94676A1762AA284590490-->  <DESCRIPTION><![CDATA[Old Text value]]></DESCRIPTION>
+<!--20A0358265C94676A1762AA284590490-->  <COLUMNNAME><![CDATA[OLD_Text]]></COLUMNNAME>
+<!--20A0358265C94676A1762AA284590490-->  <AD_TABLE_ID><![CDATA[D728885674EB49DA9595AD66A26B2D28]]></AD_TABLE_ID>
+<!--20A0358265C94676A1762AA284590490-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
+<!--20A0358265C94676A1762AA284590490-->  <FIELDLENGTH><![CDATA[3000000]]></FIELDLENGTH>
+<!--20A0358265C94676A1762AA284590490-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--20A0358265C94676A1762AA284590490-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--20A0358265C94676A1762AA284590490-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--20A0358265C94676A1762AA284590490-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--20A0358265C94676A1762AA284590490-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--20A0358265C94676A1762AA284590490-->  <SEQNO><![CDATA[290]]></SEQNO>
+<!--20A0358265C94676A1762AA284590490-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--20A0358265C94676A1762AA284590490-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--20A0358265C94676A1762AA284590490-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--20A0358265C94676A1762AA284590490-->  <AD_ELEMENT_ID><![CDATA[6AFA9B0233204ABEAECEF50C444C5089]]></AD_ELEMENT_ID>
+<!--20A0358265C94676A1762AA284590490-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--20A0358265C94676A1762AA284590490-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--20A0358265C94676A1762AA284590490-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--20A0358265C94676A1762AA284590490-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--20A0358265C94676A1762AA284590490-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--20A0358265C94676A1762AA284590490-->  <POSITION><![CDATA[26]]></POSITION>
+<!--20A0358265C94676A1762AA284590490-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--20A0358265C94676A1762AA284590490-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--20A0358265C94676A1762AA284590490-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--20A0358265C94676A1762AA284590490-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--20A0358265C94676A1762AA284590490-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--20A0358265C94676A1762AA284590490--></AD_COLUMN>
+
 <!--21091EE7A7F347FDB16350A429EBDEB8--><AD_COLUMN>
 <!--21091EE7A7F347FDB16350A429EBDEB8-->  <AD_COLUMN_ID><![CDATA[21091EE7A7F347FDB16350A429EBDEB8]]></AD_COLUMN_ID>
 <!--21091EE7A7F347FDB16350A429EBDEB8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -224239,7 +224273,7 @@
 <!--29292D14E1CA4C2E9F1219D50AF35491-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--29292D14E1CA4C2E9F1219D50AF35491-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--29292D14E1CA4C2E9F1219D50AF35491-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--29292D14E1CA4C2E9F1219D50AF35491-->  <POSITION><![CDATA[33]]></POSITION>
+<!--29292D14E1CA4C2E9F1219D50AF35491-->  <POSITION><![CDATA[34]]></POSITION>
 <!--29292D14E1CA4C2E9F1219D50AF35491-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--29292D14E1CA4C2E9F1219D50AF35491-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--29292D14E1CA4C2E9F1219D50AF35491-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -225478,7 +225512,7 @@
 <!--379FB64EDAE34511BF519A46C721394C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--379FB64EDAE34511BF519A46C721394C-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--379FB64EDAE34511BF519A46C721394C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--379FB64EDAE34511BF519A46C721394C-->  <POSITION><![CDATA[26]]></POSITION>
+<!--379FB64EDAE34511BF519A46C721394C-->  <POSITION><![CDATA[28]]></POSITION>
 <!--379FB64EDAE34511BF519A46C721394C-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--379FB64EDAE34511BF519A46C721394C-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--379FB64EDAE34511BF519A46C721394C-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -244970,8 +245004,8 @@
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <HELP><![CDATA[Old data overwritten in the field]]></HELP>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <COLUMNNAME><![CDATA[OLD_Value]]></COLUMNNAME>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <AD_TABLE_ID><![CDATA[D728885674EB49DA9595AD66A26B2D28]]></AD_TABLE_ID>
-<!--65EA81B55C274DA39C0494ADB2EDC583-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
-<!--65EA81B55C274DA39C0494ADB2EDC583-->  <FIELDLENGTH><![CDATA[4000]]></FIELDLENGTH>
+<!--65EA81B55C274DA39C0494ADB2EDC583-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
+<!--65EA81B55C274DA39C0494ADB2EDC583-->  <FIELDLENGTH><![CDATA[3000000]]></FIELDLENGTH>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
@@ -244987,7 +245021,7 @@
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--65EA81B55C274DA39C0494ADB2EDC583-->  <POSITION><![CDATA[27]]></POSITION>
+<!--65EA81B55C274DA39C0494ADB2EDC583-->  <POSITION><![CDATA[29]]></POSITION>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--65EA81B55C274DA39C0494ADB2EDC583-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -251384,6 +251418,40 @@
 <!--77237543C384C8DCE040007F0101413D-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--77237543C384C8DCE040007F0101413D--></AD_COLUMN>
 
+<!--7726089C96324BC584724F357816507A--><AD_COLUMN>
+<!--7726089C96324BC584724F357816507A-->  <AD_COLUMN_ID><![CDATA[7726089C96324BC584724F357816507A]]></AD_COLUMN_ID>
+<!--7726089C96324BC584724F357816507A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7726089C96324BC584724F357816507A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7726089C96324BC584724F357816507A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7726089C96324BC584724F357816507A-->  <NAME><![CDATA[New Text]]></NAME>
+<!--7726089C96324BC584724F357816507A-->  <DESCRIPTION><![CDATA[New Text value]]></DESCRIPTION>
+<!--7726089C96324BC584724F357816507A-->  <COLUMNNAME><![CDATA[NEW_Text]]></COLUMNNAME>
+<!--7726089C96324BC584724F357816507A-->  <AD_TABLE_ID><![CDATA[A1E2D02EE8154BD59FA6747C9E85A928]]></AD_TABLE_ID>
+<!--7726089C96324BC584724F357816507A-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
+<!--7726089C96324BC584724F357816507A-->  <FIELDLENGTH><![CDATA[3000000]]></FIELDLENGTH>
+<!--7726089C96324BC584724F357816507A-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--7726089C96324BC584724F357816507A-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--7726089C96324BC584724F357816507A-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--7726089C96324BC584724F357816507A-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--7726089C96324BC584724F357816507A-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--7726089C96324BC584724F357816507A-->  <SEQNO><![CDATA[270]]></SEQNO>
+<!--7726089C96324BC584724F357816507A-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--7726089C96324BC584724F357816507A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7726089C96324BC584724F357816507A-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--7726089C96324BC584724F357816507A-->  <AD_ELEMENT_ID><![CDATA[56AA1B2F03784AD69252399FE09DE7DE]]></AD_ELEMENT_ID>
+<!--7726089C96324BC584724F357816507A-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--7726089C96324BC584724F357816507A-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--7726089C96324BC584724F357816507A-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--7726089C96324BC584724F357816507A-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--7726089C96324BC584724F357816507A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7726089C96324BC584724F357816507A-->  <POSITION><![CDATA[27]]></POSITION>
+<!--7726089C96324BC584724F357816507A-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--7726089C96324BC584724F357816507A-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--7726089C96324BC584724F357816507A-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--7726089C96324BC584724F357816507A-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--7726089C96324BC584724F357816507A-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--7726089C96324BC584724F357816507A--></AD_COLUMN>
+
 <!--772B8E632F564E74BCF3A6BFC28977D3--><AD_COLUMN>
 <!--772B8E632F564E74BCF3A6BFC28977D3-->  <AD_COLUMN_ID><![CDATA[772B8E632F564E74BCF3A6BFC28977D3]]></AD_COLUMN_ID>
 <!--772B8E632F564E74BCF3A6BFC28977D3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -252695,7 +252763,7 @@
 <!--7891269C83E2655DE040007F010155CE-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
 <!--7891269C83E2655DE040007F010155CE-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
 <!--7891269C83E2655DE040007F010155CE-->  <AD_ELEMENT_ID><![CDATA[800632]]></AD_ELEMENT_ID>
-<!--7891269C83E2655DE040007F010155CE-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--7891269C83E2655DE040007F010155CE-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
 <!--7891269C83E2655DE040007F010155CE-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--7891269C83E2655DE040007F010155CE-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--7891269C83E2655DE040007F010155CE-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
@@ -269396,6 +269464,43 @@
 <!--876F71FBE61F4C7CE040007F01000A4A-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--876F71FBE61F4C7CE040007F01000A4A--></AD_COLUMN>
 
+<!--87731FFC3B7145BABDD2C6A030450A99--><AD_COLUMN>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <AD_COLUMN_ID><![CDATA[87731FFC3B7145BABDD2C6A030450A99]]></AD_COLUMN_ID>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <NAME><![CDATA[Image]]></NAME>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <DESCRIPTION><![CDATA[A visual picture used to describe an item.]]></DESCRIPTION>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <HELP><![CDATA[Defines a system image]]></HELP>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <COLUMNNAME><![CDATA[AD_Image_ID]]></COLUMNNAME>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <AD_TABLE_ID><![CDATA[114]]></AD_TABLE_ID>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <AD_REFERENCE_ID><![CDATA[4AA6C3BE9D3B4D84A3B80489505A23E5]]></AD_REFERENCE_ID>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <SEQNO><![CDATA[111]]></SEQNO>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <AD_ELEMENT_ID><![CDATA[1639]]></AD_ELEMENT_ID>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <POSITION><![CDATA[39]]></POSITION>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <IMAGESIZEVALUESACTION><![CDATA[RESIZE_ASPECTRATIONL]]></IMAGESIZEVALUESACTION>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <IMAGEWIDTH><![CDATA[200]]></IMAGEWIDTH>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <IMAGEHEIGHT><![CDATA[200]]></IMAGEHEIGHT>
+<!--87731FFC3B7145BABDD2C6A030450A99-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--87731FFC3B7145BABDD2C6A030450A99--></AD_COLUMN>
+
 <!--877E2F50EE6CF24BE040007F01006114--><AD_COLUMN>
 <!--877E2F50EE6CF24BE040007F01006114-->  <AD_COLUMN_ID><![CDATA[877E2F50EE6CF24BE040007F01006114]]></AD_COLUMN_ID>
 <!--877E2F50EE6CF24BE040007F01006114-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -276071,7 +276176,7 @@
 <!--9C7C878101214039A2BEAE25ED564B4B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--9C7C878101214039A2BEAE25ED564B4B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--9C7C878101214039A2BEAE25ED564B4B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--9C7C878101214039A2BEAE25ED564B4B-->  <POSITION><![CDATA[32]]></POSITION>
+<!--9C7C878101214039A2BEAE25ED564B4B-->  <POSITION><![CDATA[33]]></POSITION>
 <!--9C7C878101214039A2BEAE25ED564B4B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--9C7C878101214039A2BEAE25ED564B4B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--9C7C878101214039A2BEAE25ED564B4B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -277062,7 +277167,7 @@
 <!--9FFD173571C74908A5F48C4C44C5E8C1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--9FFD173571C74908A5F48C4C44C5E8C1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--9FFD173571C74908A5F48C4C44C5E8C1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--9FFD173571C74908A5F48C4C44C5E8C1-->  <POSITION><![CDATA[34]]></POSITION>
+<!--9FFD173571C74908A5F48C4C44C5E8C1-->  <POSITION><![CDATA[35]]></POSITION>
 <!--9FFD173571C74908A5F48C4C44C5E8C1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--9FFD173571C74908A5F48C4C44C5E8C1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--9FFD173571C74908A5F48C4C44C5E8C1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -277807,7 +277912,7 @@
 <!--A58DFDE11BF342779F8FAF40B84E8899-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A58DFDE11BF342779F8FAF40B84E8899-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A58DFDE11BF342779F8FAF40B84E8899-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--A58DFDE11BF342779F8FAF40B84E8899-->  <POSITION><![CDATA[36]]></POSITION>
+<!--A58DFDE11BF342779F8FAF40B84E8899-->  <POSITION><![CDATA[37]]></POSITION>
 <!--A58DFDE11BF342779F8FAF40B84E8899-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A58DFDE11BF342779F8FAF40B84E8899-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A58DFDE11BF342779F8FAF40B84E8899-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -285927,6 +286032,42 @@
 <!--C0FF55F981BB47279B6BA18A2D811482-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--C0FF55F981BB47279B6BA18A2D811482--></AD_COLUMN>
 
+<!--C1DE4479A025001AE040007F01000C7E--><AD_COLUMN>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_COLUMN_ID><![CDATA[C1DE4479A025001AE040007F01000C7E]]></AD_COLUMN_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1DE4479A025001AE040007F01000C7E-->  <NAME><![CDATA[Status]]></NAME>
+<!--C1DE4479A025001AE040007F01000C7E-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--C1DE4479A025001AE040007F01000C7E-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--C1DE4479A025001AE040007F01000C7E-->  <COLUMNNAME><![CDATA[Status]]></COLUMNNAME>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_TABLE_ID><![CDATA[DC63963AB3F1489BAAB5A9A7EFD1B407]]></AD_TABLE_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_REFERENCE_VALUE_ID><![CDATA[575BCB88A4694C27BC013DE9C73E6FE7]]></AD_REFERENCE_VALUE_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--C1DE4479A025001AE040007F01000C7E-->  <SEQNO><![CDATA[430]]></SEQNO>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_ELEMENT_ID><![CDATA[800630]]></AD_ELEMENT_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--C1DE4479A025001AE040007F01000C7E-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--C1DE4479A025001AE040007F01000C7E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C1DE4479A025001AE040007F01000C7E-->  <POSITION><![CDATA[31]]></POSITION>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--C1DE4479A025001AE040007F01000C7E-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--C1DE4479A025001AE040007F01000C7E-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--C1DE4479A025001AE040007F01000C7E-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--C1DE4479A025001AE040007F01000C7E--></AD_COLUMN>
+
 <!--C228CBC21EC74A0D8785A309736F0446--><AD_COLUMN>
 <!--C228CBC21EC74A0D8785A309736F0446-->  <AD_COLUMN_ID><![CDATA[C228CBC21EC74A0D8785A309736F0446]]></AD_COLUMN_ID>
 <!--C228CBC21EC74A0D8785A309736F0446-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -288071,6 +288212,40 @@
 <!--E0386DBA300149B88800B0FF94AB44C3-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--E0386DBA300149B88800B0FF94AB44C3--></AD_COLUMN>
 
+<!--E038922AECAE441F92CE2889B985FDC1--><AD_COLUMN>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <AD_COLUMN_ID><![CDATA[E038922AECAE441F92CE2889B985FDC1]]></AD_COLUMN_ID>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <NAME><![CDATA[Old Text]]></NAME>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <DESCRIPTION><![CDATA[Old Text value]]></DESCRIPTION>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <COLUMNNAME><![CDATA[OLD_Text]]></COLUMNNAME>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <AD_TABLE_ID><![CDATA[A1E2D02EE8154BD59FA6747C9E85A928]]></AD_TABLE_ID>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <FIELDLENGTH><![CDATA[3000000]]></FIELDLENGTH>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <SEQNO><![CDATA[260]]></SEQNO>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <AD_ELEMENT_ID><![CDATA[6AFA9B0233204ABEAECEF50C444C5089]]></AD_ELEMENT_ID>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <POSITION><![CDATA[26]]></POSITION>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--E038922AECAE441F92CE2889B985FDC1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--E038922AECAE441F92CE2889B985FDC1--></AD_COLUMN>
+
 <!--E092F3E378934B72BECEE695DE1BD9C0--><AD_COLUMN>
 <!--E092F3E378934B72BECEE695DE1BD9C0-->  <AD_COLUMN_ID><![CDATA[E092F3E378934B72BECEE695DE1BD9C0]]></AD_COLUMN_ID>
 <!--E092F3E378934B72BECEE695DE1BD9C0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -288809,6 +288984,40 @@
 <!--EA08CC350401425D83DD1EBE52311306-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--EA08CC350401425D83DD1EBE52311306--></AD_COLUMN>
 
+<!--EA41590A5EF24F7388E0354B3A10432C--><AD_COLUMN>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <AD_COLUMN_ID><![CDATA[EA41590A5EF24F7388E0354B3A10432C]]></AD_COLUMN_ID>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <NAME><![CDATA[New Text]]></NAME>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <DESCRIPTION><![CDATA[New Text value]]></DESCRIPTION>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <COLUMNNAME><![CDATA[NEW_Text]]></COLUMNNAME>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <AD_TABLE_ID><![CDATA[D728885674EB49DA9595AD66A26B2D28]]></AD_TABLE_ID>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <FIELDLENGTH><![CDATA[3000000]]></FIELDLENGTH>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <SEQNO><![CDATA[300]]></SEQNO>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <AD_ELEMENT_ID><![CDATA[56AA1B2F03784AD69252399FE09DE7DE]]></AD_ELEMENT_ID>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <POSITION><![CDATA[27]]></POSITION>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--EA41590A5EF24F7388E0354B3A10432C-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--EA41590A5EF24F7388E0354B3A10432C--></AD_COLUMN>
+
 <!--EAEDB737C7AD4AE8B656B3EE9E7673A1--><AD_COLUMN>
 <!--EAEDB737C7AD4AE8B656B3EE9E7673A1-->  <AD_COLUMN_ID><![CDATA[EAEDB737C7AD4AE8B656B3EE9E7673A1]]></AD_COLUMN_ID>
 <!--EAEDB737C7AD4AE8B656B3EE9E7673A1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -289465,8 +289674,8 @@
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <HELP><![CDATA[New data entered in the field]]></HELP>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <COLUMNNAME><![CDATA[NEW_Value]]></COLUMNNAME>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <AD_TABLE_ID><![CDATA[D728885674EB49DA9595AD66A26B2D28]]></AD_TABLE_ID>
-<!--F298A824BEAB4A2EAC14C68E770940DA-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
-<!--F298A824BEAB4A2EAC14C68E770940DA-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--F298A824BEAB4A2EAC14C68E770940DA-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
+<!--F298A824BEAB4A2EAC14C68E770940DA-->  <FIELDLENGTH><![CDATA[3000000]]></FIELDLENGTH>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
@@ -289482,7 +289691,7 @@
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--F298A824BEAB4A2EAC14C68E770940DA-->  <POSITION><![CDATA[28]]></POSITION>
+<!--F298A824BEAB4A2EAC14C68E770940DA-->  <POSITION><![CDATA[30]]></POSITION>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--F298A824BEAB4A2EAC14C68E770940DA-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -22429,6 +22429,19 @@
 <!--569E6FC0F94B0180E040007F01002FC1-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--569E6FC0F94B0180E040007F01002FC1--></AD_ELEMENT>
 
+<!--56AA1B2F03784AD69252399FE09DE7DE--><AD_ELEMENT>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <AD_ELEMENT_ID><![CDATA[56AA1B2F03784AD69252399FE09DE7DE]]></AD_ELEMENT_ID>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <COLUMNNAME><![CDATA[NEW_Text]]></COLUMNNAME>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <NAME><![CDATA[New Text]]></NAME>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <PRINTNAME><![CDATA[New Text]]></PRINTNAME>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <DESCRIPTION><![CDATA[New Text value]]></DESCRIPTION>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--56AA1B2F03784AD69252399FE09DE7DE-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--56AA1B2F03784AD69252399FE09DE7DE--></AD_ELEMENT>
+
 <!--56EB0A0CAC4CB232E040007F01001BD8--><AD_ELEMENT>
 <!--56EB0A0CAC4CB232E040007F01001BD8-->  <AD_ELEMENT_ID><![CDATA[56EB0A0CAC4CB232E040007F01001BD8]]></AD_ELEMENT_ID>
 <!--56EB0A0CAC4CB232E040007F01001BD8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -24331,6 +24344,19 @@
 <!--6ABF02FADF664959E040007F010125A8-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--6ABF02FADF664959E040007F010125A8--></AD_ELEMENT>
 
+<!--6AFA9B0233204ABEAECEF50C444C5089--><AD_ELEMENT>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <AD_ELEMENT_ID><![CDATA[6AFA9B0233204ABEAECEF50C444C5089]]></AD_ELEMENT_ID>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <COLUMNNAME><![CDATA[OLD_Text]]></COLUMNNAME>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <NAME><![CDATA[Old Text]]></NAME>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <PRINTNAME><![CDATA[Old Text]]></PRINTNAME>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <DESCRIPTION><![CDATA[Old Text value]]></DESCRIPTION>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6AFA9B0233204ABEAECEF50C444C5089-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--6AFA9B0233204ABEAECEF50C444C5089--></AD_ELEMENT>
+
 <!--6B5BB3889D8ABA07E040007F0101404E--><AD_ELEMENT>
 <!--6B5BB3889D8ABA07E040007F0101404E-->  <AD_ELEMENT_ID><![CDATA[6B5BB3889D8ABA07E040007F0101404E]]></AD_ELEMENT_ID>
 <!--6B5BB3889D8ABA07E040007F0101404E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -9001,7 +9001,7 @@
 <!--681-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--681-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--681-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--681-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--681-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
 <!--681-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--681-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--681-->  <GRID_SEQNO><![CDATA[60]]></GRID_SEQNO>
@@ -10690,7 +10690,7 @@
 <!--884-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--884-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--884-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--884-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--884-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
 <!--884-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--884-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--884-->  <GRID_SEQNO><![CDATA[40]]></GRID_SEQNO>
@@ -27101,7 +27101,7 @@
 <!--2312-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--2312-->  <AD_TAB_ID><![CDATA[239]]></AD_TAB_ID>
 <!--2312-->  <AD_COLUMN_ID><![CDATA[2712]]></AD_COLUMN_ID>
-<!--2312-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--2312-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
 <!--2312-->  <DISPLAYLOGIC><![CDATA[@Discontinued@='Y']]></DISPLAYLOGIC>
 <!--2312-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--2312-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
@@ -27109,7 +27109,7 @@
 <!--2312-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--2312-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--2312-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--2312-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--2312-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
 <!--2312-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--2312-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--2312-->  <GRID_SEQNO><![CDATA[200]]></GRID_SEQNO>
@@ -39133,7 +39133,8 @@
 <!--3269-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3269-->  <NAME><![CDATA[Open/Close All]]></NAME>
 <!--3269-->  <DESCRIPTION><![CDATA[Open/Close all Base Document Types]]></DESCRIPTION>
-<!--3269-->  <HELP><![CDATA[Open/Close all Base Document Types]]></HELP>
+<!--3269-->  <HELP><![CDATA[Open/Close all Base Document Types.
+NOTE: You will not be able to close the fiscal year if you close all its periods permanently. Maybe you should close it before changing the last period from closed to permanently closed.]]></HELP>
 <!--3269-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--3269-->  <AD_TAB_ID><![CDATA[130]]></AD_TAB_ID>
 <!--3269-->  <AD_COLUMN_ID><![CDATA[5944]]></AD_COLUMN_ID>
@@ -58291,14 +58292,14 @@
 <!--4721-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--4721-->  <AD_TAB_ID><![CDATA[160]]></AD_TAB_ID>
 <!--4721-->  <AD_COLUMN_ID><![CDATA[5952]]></AD_COLUMN_ID>
-<!--4721-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--4721-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
 <!--4721-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--4721-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--4721-->  <SEQNO><![CDATA[120]]></SEQNO>
 <!--4721-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--4721-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--4721-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--4721-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--4721-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
 <!--4721-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--4721-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4721-->  <GRID_SEQNO><![CDATA[120]]></GRID_SEQNO>
@@ -115874,10 +115875,9 @@
 <!--801458-->  <AD_TAB_ID><![CDATA[800078]]></AD_TAB_ID>
 <!--801458-->  <AD_COLUMN_ID><![CDATA[801065]]></AD_COLUMN_ID>
 <!--801458-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--801458-->  <DISPLAYLOGIC><![CDATA[@IsDepreciated@='Y']]></DISPLAYLOGIC>
 <!--801458-->  <DISPLAYLENGTH><![CDATA[44]]></DISPLAYLENGTH>
 <!--801458-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--801458-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--801458-->  <SEQNO><![CDATA[69]]></SEQNO>
 <!--801458-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--801458-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--801458-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -170942,6 +170942,7 @@
 <!--160BE6DD63804000834ECFA55A53A789-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--160BE6DD63804000834ECFA55A53A789-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--160BE6DD63804000834ECFA55A53A789-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--160BE6DD63804000834ECFA55A53A789-->  <EM_OBUIAPP_ROWSPAN><![CDATA[3]]></EM_OBUIAPP_ROWSPAN>
 <!--160BE6DD63804000834ECFA55A53A789-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--160BE6DD63804000834ECFA55A53A789--></AD_FIELD>
 
@@ -184283,7 +184284,8 @@
 <!--58D503FCDDB0D53FE040007F01016BBB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--58D503FCDDB0D53FE040007F01016BBB-->  <NAME><![CDATA[Open/Close All]]></NAME>
 <!--58D503FCDDB0D53FE040007F01016BBB-->  <DESCRIPTION><![CDATA[Open/Close all Base Document Types]]></DESCRIPTION>
-<!--58D503FCDDB0D53FE040007F01016BBB-->  <HELP><![CDATA[Open/Close all Base Document Types]]></HELP>
+<!--58D503FCDDB0D53FE040007F01016BBB-->  <HELP><![CDATA[Open/Close all Base Document Types.
+NOTE: You will not be able to close the fiscal year if you close all its periods permanently. Maybe you should close it before changing the last period from closed to permanently closed.]]></HELP>
 <!--58D503FCDDB0D53FE040007F01016BBB-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--58D503FCDDB0D53FE040007F01016BBB-->  <AD_TAB_ID><![CDATA[4DE17FC05C3843C4959166BB67967486]]></AD_TAB_ID>
 <!--58D503FCDDB0D53FE040007F01016BBB-->  <AD_COLUMN_ID><![CDATA[58D503FCDD9ED53FE040007F01016BBB]]></AD_COLUMN_ID>
@@ -184343,7 +184345,6 @@
 <!--58E0AFDC8162B4CCE040007F01006F95-->  <AD_TAB_ID><![CDATA[F53E35A11C564F20BE4082A7B8CFF6B7]]></AD_TAB_ID>
 <!--58E0AFDC8162B4CCE040007F01006F95-->  <AD_COLUMN_ID><![CDATA[58E097397CD55976E040007F010065CF]]></AD_COLUMN_ID>
 <!--58E0AFDC8162B4CCE040007F01006F95-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--58E0AFDC8162B4CCE040007F01006F95-->  <DISPLAYLOGIC><![CDATA[@IsTranslationRequired@='Y' | @IsTranslationModule@='Y']]></DISPLAYLOGIC>
 <!--58E0AFDC8162B4CCE040007F01006F95-->  <DISPLAYLENGTH><![CDATA[6]]></DISPLAYLENGTH>
 <!--58E0AFDC8162B4CCE040007F01006F95-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--58E0AFDC8162B4CCE040007F01006F95-->  <SEQNO><![CDATA[110]]></SEQNO>
@@ -191410,6 +191411,7 @@
 <!--729C53E68ECF429CB3EC782316BA3182-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--729C53E68ECF429CB3EC782316BA3182-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--729C53E68ECF429CB3EC782316BA3182-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--729C53E68ECF429CB3EC782316BA3182-->  <EM_OBUIAPP_ROWSPAN><![CDATA[3]]></EM_OBUIAPP_ROWSPAN>
 <!--729C53E68ECF429CB3EC782316BA3182-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--729C53E68ECF429CB3EC782316BA3182--></AD_FIELD>
 
@@ -220110,6 +220112,62 @@
 <!--C1CA9C4D5BC449638782C967224D4F92-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--C1CA9C4D5BC449638782C967224D4F92--></AD_FIELD>
 
+<!--C1DE57A2C130C846E040007F01000CC6--><AD_FIELD>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <AD_FIELD_ID><![CDATA[C1DE57A2C130C846E040007F01000CC6]]></AD_FIELD_ID>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <NAME><![CDATA[Status]]></NAME>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <AD_TAB_ID><![CDATA[AF4090093DB91431E040007F010048A5]]></AD_TAB_ID>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <AD_COLUMN_ID><![CDATA[C1DE4479A025001AE040007F01000C7E]]></AD_COLUMN_ID>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <SEQNO><![CDATA[220]]></SEQNO>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C1DE57A2C130C846E040007F01000CC6-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C1DE57A2C130C846E040007F01000CC6--></AD_FIELD>
+
+<!--C1DE57A2C139C846E040007F01000CC6--><AD_FIELD>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <AD_FIELD_ID><![CDATA[C1DE57A2C139C846E040007F01000CC6]]></AD_FIELD_ID>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <NAME><![CDATA[Status]]></NAME>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <AD_TAB_ID><![CDATA[FA619778CCD24476BD89873D139824BB]]></AD_TAB_ID>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <AD_COLUMN_ID><![CDATA[C1DE4479A025001AE040007F01000C7E]]></AD_COLUMN_ID>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <SEQNO><![CDATA[220]]></SEQNO>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C1DE57A2C139C846E040007F01000CC6-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C1DE57A2C139C846E040007F01000CC6--></AD_FIELD>
+
 <!--C26AACCF70DB454F9E85AAD694D719A7--><AD_FIELD>
 <!--C26AACCF70DB454F9E85AAD694D719A7-->  <AD_FIELD_ID><![CDATA[C26AACCF70DB454F9E85AAD694D719A7]]></AD_FIELD_ID>
 <!--C26AACCF70DB454F9E85AAD694D719A7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -225272,6 +225330,34 @@
 <!--F22BF11BC60748D985EE13ADA11DBA73-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--F22BF11BC60748D985EE13ADA11DBA73--></AD_FIELD>
 
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3--><AD_FIELD>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <AD_FIELD_ID><![CDATA[F2A3E9CCA3724925B1FCE8565BC75BC3]]></AD_FIELD_ID>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <NAME><![CDATA[Image]]></NAME>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <DESCRIPTION><![CDATA[A visual picture used to describe an item.]]></DESCRIPTION>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <HELP><![CDATA[Defines a system image]]></HELP>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <AD_TAB_ID><![CDATA[118]]></AD_TAB_ID>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <AD_COLUMN_ID><![CDATA[87731FFC3B7145BABDD2C6A030450A99]]></AD_COLUMN_ID>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <SEQNO><![CDATA[290]]></SEQNO>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--F2A3E9CCA3724925B1FCE8565BC75BC3--></AD_FIELD>
+
 <!--F36C5360FCA7427AA77D5543BE7B0C46--><AD_FIELD>
 <!--F36C5360FCA7427AA77D5543BE7B0C46-->  <AD_FIELD_ID><![CDATA[F36C5360FCA7427AA77D5543BE7B0C46]]></AD_FIELD_ID>
 <!--F36C5360FCA7427AA77D5543BE7B0C46-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MENU.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_MENU.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -96,8 +96,8 @@
 <!--109-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--109-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--109-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--109-->  <NAME><![CDATA[Country Region and City]]></NAME>
-<!--109-->  <DESCRIPTION><![CDATA[Define countries with regions and cities to be used in the application.]]></DESCRIPTION>
+<!--109-->  <NAME><![CDATA[Country and Region]]></NAME>
+<!--109-->  <DESCRIPTION><![CDATA[Define countries with regions to be used in the application.]]></DESCRIPTION>
 <!--109-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
 <!--109-->  <ACTION><![CDATA[W]]></ACTION>
 <!--109-->  <AD_WINDOW_ID><![CDATA[122]]></AD_WINDOW_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -15572,6 +15572,17 @@
 <!--2CB71A652AB845D3A8A6477359C66451-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--2CB71A652AB845D3A8A6477359C66451--></AD_MESSAGE>
 
+<!--2CC0075FE85F40F7BC29540659E993AE--><AD_MESSAGE>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <AD_MESSAGE_ID><![CDATA[2CC0075FE85F40F7BC29540659E993AE]]></AD_MESSAGE_ID>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <VALUE><![CDATA[NotAllowedDBColumnName]]></VALUE>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <MSGTEXT><![CDATA[Not allowed DB column name]]></MSGTEXT>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--2CC0075FE85F40F7BC29540659E993AE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2CC0075FE85F40F7BC29540659E993AE--></AD_MESSAGE>
+
 <!--2D16D614EF1C414F8B391F4C5BE8C74F--><AD_MESSAGE>
 <!--2D16D614EF1C414F8B391F4C5BE8C74F-->  <AD_MESSAGE_ID><![CDATA[2D16D614EF1C414F8B391F4C5BE8C74F]]></AD_MESSAGE_ID>
 <!--2D16D614EF1C414F8B391F4C5BE8C74F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -16559,6 +16570,17 @@
 <!--570FBA13196A4136A3E36AFC0EFF0948-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--570FBA13196A4136A3E36AFC0EFF0948--></AD_MESSAGE>
 
+<!--578C1D171D154C2DA8391762646E1D25--><AD_MESSAGE>
+<!--578C1D171D154C2DA8391762646E1D25-->  <AD_MESSAGE_ID><![CDATA[578C1D171D154C2DA8391762646E1D25]]></AD_MESSAGE_ID>
+<!--578C1D171D154C2DA8391762646E1D25-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--578C1D171D154C2DA8391762646E1D25-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--578C1D171D154C2DA8391762646E1D25-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--578C1D171D154C2DA8391762646E1D25-->  <VALUE><![CDATA[NegativeBOMProductionQty]]></VALUE>
+<!--578C1D171D154C2DA8391762646E1D25-->  <MSGTEXT><![CDATA[There exists negative or equal to zero Production Quantities in the Production Plan]]></MSGTEXT>
+<!--578C1D171D154C2DA8391762646E1D25-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--578C1D171D154C2DA8391762646E1D25-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--578C1D171D154C2DA8391762646E1D25--></AD_MESSAGE>
+
 <!--57901FDF810046F3A5C6DFCC31C0665E--><AD_MESSAGE>
 <!--57901FDF810046F3A5C6DFCC31C0665E-->  <AD_MESSAGE_ID><![CDATA[57901FDF810046F3A5C6DFCC31C0665E]]></AD_MESSAGE_ID>
 <!--57901FDF810046F3A5C6DFCC31C0665E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -17400,6 +17422,17 @@
 <!--785509D8468543F4AF2FE440D9511CF1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--785509D8468543F4AF2FE440D9511CF1--></AD_MESSAGE>
 
+<!--7872761C619E485182E19AD8B06AA2F9--><AD_MESSAGE>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <AD_MESSAGE_ID><![CDATA[7872761C619E485182E19AD8B06AA2F9]]></AD_MESSAGE_ID>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <VALUE><![CDATA[NotAllowedFieldName]]></VALUE>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <MSGTEXT><![CDATA[Not allowed field name]]></MSGTEXT>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--7872761C619E485182E19AD8B06AA2F9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7872761C619E485182E19AD8B06AA2F9--></AD_MESSAGE>
+
 <!--788D557BF85D47B2A8C0365C0C14B004--><AD_MESSAGE>
 <!--788D557BF85D47B2A8C0365C0C14B004-->  <AD_MESSAGE_ID><![CDATA[788D557BF85D47B2A8C0365C0C14B004]]></AD_MESSAGE_ID>
 <!--788D557BF85D47B2A8C0365C0C14B004-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -18307,6 +18340,17 @@
 <!--98A052B862994F0BB4AA32BC78434C07-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--98A052B862994F0BB4AA32BC78434C07--></AD_MESSAGE>
 
+<!--99F2343EA0D34540AEE18D182EBBCD67--><AD_MESSAGE>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <AD_MESSAGE_ID><![CDATA[99F2343EA0D34540AEE18D182EBBCD67]]></AD_MESSAGE_ID>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <VALUE><![CDATA[NotAllowedElementName]]></VALUE>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <MSGTEXT><![CDATA[Not allowed element name]]></MSGTEXT>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--99F2343EA0D34540AEE18D182EBBCD67-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--99F2343EA0D34540AEE18D182EBBCD67--></AD_MESSAGE>
+
 <!--9A6B5D3A2FC544C79ABB21C6029DC24D--><AD_MESSAGE>
 <!--9A6B5D3A2FC544C79ABB21C6029DC24D-->  <AD_MESSAGE_ID><![CDATA[9A6B5D3A2FC544C79ABB21C6029DC24D]]></AD_MESSAGE_ID>
 <!--9A6B5D3A2FC544C79ABB21C6029DC24D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -18545,7 +18589,7 @@
 <!--A5C632E407314617A785DE0694514998-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A5C632E407314617A785DE0694514998-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A5C632E407314617A785DE0694514998-->  <VALUE><![CDATA[InsertOrphanNoTaxFoundForProduct]]></VALUE>
-<!--A5C632E407314617A785DE0694514998-->  <MSGTEXT><![CDATA[With current product configuration and order it is not possible to found a valid tax for product @product@. Please change the tax and product configuration or select a tax when inserting the new orphan line.]]></MSGTEXT>
+<!--A5C632E407314617A785DE0694514998-->  <MSGTEXT><![CDATA[With current product configuration and order it is not possible to find a valid tax for product @product@. Please change the tax and product configuration or select a tax when inserting the new orphan line.]]></MSGTEXT>
 <!--A5C632E407314617A785DE0694514998-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
 <!--A5C632E407314617A785DE0694514998-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--A5C632E407314617A785DE0694514998--></AD_MESSAGE>
@@ -19589,6 +19633,17 @@
 <!--CDC6BD44302C4CF2A44293957B34CB0F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--CDC6BD44302C4CF2A44293957B34CB0F--></AD_MESSAGE>
 
+<!--CE2380BA90DB49B682AF5B333EA8BFE9--><AD_MESSAGE>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <AD_MESSAGE_ID><![CDATA[CE2380BA90DB49B682AF5B333EA8BFE9]]></AD_MESSAGE_ID>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <VALUE><![CDATA[GLJournalHasNoLines]]></VALUE>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <MSGTEXT><![CDATA[G/L Journal cannot be processed/posted because it has no lines. Document no:]]></MSGTEXT>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CE2380BA90DB49B682AF5B333EA8BFE9--></AD_MESSAGE>
+
 <!--CF72BCDFFF044C1D8007B907D8B64DF3--><AD_MESSAGE>
 <!--CF72BCDFFF044C1D8007B907D8B64DF3-->  <AD_MESSAGE_ID><![CDATA[CF72BCDFFF044C1D8007B907D8B64DF3]]></AD_MESSAGE_ID>
 <!--CF72BCDFFF044C1D8007B907D8B64DF3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -19688,6 +19743,17 @@
 <!--D3FE17DEC49F4FC3BAE381FDAAA00D52-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--D3FE17DEC49F4FC3BAE381FDAAA00D52--></AD_MESSAGE>
 
+<!--D40805953F4042C293C2390B6B36034E--><AD_MESSAGE>
+<!--D40805953F4042C293C2390B6B36034E-->  <AD_MESSAGE_ID><![CDATA[D40805953F4042C293C2390B6B36034E]]></AD_MESSAGE_ID>
+<!--D40805953F4042C293C2390B6B36034E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D40805953F4042C293C2390B6B36034E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D40805953F4042C293C2390B6B36034E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D40805953F4042C293C2390B6B36034E-->  <VALUE><![CDATA[NoTaxFoundForProduct]]></VALUE>
+<!--D40805953F4042C293C2390B6B36034E-->  <MSGTEXT><![CDATA[With current product configuration and order it is not possible to find a valid tax for product @product@. Please change the tax and product configuration.]]></MSGTEXT>
+<!--D40805953F4042C293C2390B6B36034E-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--D40805953F4042C293C2390B6B36034E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D40805953F4042C293C2390B6B36034E--></AD_MESSAGE>
+
 <!--D4208AC7E8B348D08F0D621DB273F257--><AD_MESSAGE>
 <!--D4208AC7E8B348D08F0D621DB273F257-->  <AD_MESSAGE_ID><![CDATA[D4208AC7E8B348D08F0D621DB273F257]]></AD_MESSAGE_ID>
 <!--D4208AC7E8B348D08F0D621DB273F257-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -20216,7 +20282,7 @@
 <!--E8C906D6A45D45B18631B7631A1BD8BD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--E8C906D6A45D45B18631B7631A1BD8BD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--E8C906D6A45D45B18631B7631A1BD8BD-->  <VALUE><![CDATA[ModuleMustBeProvided]]></VALUE>
-<!--E8C906D6A45D45B18631B7631A1BD8BD-->  <MSGTEXT><![CDATA[An accounting module must be selected, and will be processed whith the rest of reference data]]></MSGTEXT>
+<!--E8C906D6A45D45B18631B7631A1BD8BD-->  <MSGTEXT><![CDATA[An accounting module must be selected, and will be processed with the rest of reference data]]></MSGTEXT>
 <!--E8C906D6A45D45B18631B7631A1BD8BD-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
 <!--E8C906D6A45D45B18631B7631A1BD8BD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--E8C906D6A45D45B18631B7631A1BD8BD--></AD_MESSAGE>
--- a/src-db/database/sourcedata/AD_MODULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_MODULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -6,7 +6,7 @@
 <!--0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--0-->  <NAME><![CDATA[Core]]></NAME>
-<!--0-->  <VERSION><![CDATA[3.0.16746]]></VERSION>
+<!--0-->  <VERSION><![CDATA[3.0.16854]]></VERSION>
 <!--0-->  <DESCRIPTION><![CDATA[Core module is the base one]]></DESCRIPTION>
 <!--0-->  <HELP><![CDATA[Core module is the base one, all developments in core are included as part of the standard Openbravo ERP.]]></HELP>
 <!--0-->  <URL><![CDATA[www.openbravo.com]]></URL>
@@ -22,7 +22,7 @@
 <!--0-->  <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
 <!--0-->  <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
 <!--0-->  <REFERENCEDATAINFO><![CDATA[Standard document types for orders, invoices, etc. and settings]]></REFERENCEDATAINFO>
-<!--0-->  <VERSION_LABEL><![CDATA[MP12]]></VERSION_LABEL>
+<!--0-->  <VERSION_LABEL><![CDATA[CI]]></VERSION_LABEL>
 <!--0-->  <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
 <!--0--></AD_MODULE>
 
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -1040,7 +1040,8 @@
 <!--167-->  <VALUE><![CDATA[C_Period_Process]]></VALUE>
 <!--167-->  <NAME><![CDATA[Open/Close All]]></NAME>
 <!--167-->  <DESCRIPTION><![CDATA[Open/Close all Base Document Types]]></DESCRIPTION>
-<!--167-->  <HELP><![CDATA[Open/Close all Base Document Types]]></HELP>
+<!--167-->  <HELP><![CDATA[Open/Close all Base Document Types.
+NOTE: You will not be able to close the fiscal year if you close all its periods permanently. Maybe you should close it before changing the last period from closed to permanently closed.]]></HELP>
 <!--167-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
 <!--167-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
 <!--167-->  <PROCEDURENAME><![CDATA[C_Period_Process]]></PROCEDURENAME>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -4191,7 +4191,7 @@
 <!--16EC6DF4A59747749FDF256B7FBBB058-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--16EC6DF4A59747749FDF256B7FBBB058-->  <ISBASEREFERENCE><![CDATA[Y]]></ISBASEREFERENCE>
 <!--16EC6DF4A59747749FDF256B7FBBB058-->  <MODEL_IMPL><![CDATA[org.openbravo.base.model.domaintype.EncryptedStringDomainType]]></MODEL_IMPL>
-<!--16EC6DF4A59747749FDF256B7FBBB058-->  <WAD_IMPL><![CDATA[org.openbravo.wad.controls.WADString]]></WAD_IMPL>
+<!--16EC6DF4A59747749FDF256B7FBBB058-->  <WAD_IMPL><![CDATA[org.openbravo.wad.controls.WADPassword]]></WAD_IMPL>
 <!--16EC6DF4A59747749FDF256B7FBBB058-->  <UI_IMPL><![CDATA[org.openbravo.reference.ui.UIString]]></UI_IMPL>
 <!--16EC6DF4A59747749FDF256B7FBBB058-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--16EC6DF4A59747749FDF256B7FBBB058--></AD_REFERENCE>
@@ -4968,7 +4968,7 @@
 <!--C5C21C28B39E4683A91779F16C112E40-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C5C21C28B39E4683A91779F16C112E40-->  <ISBASEREFERENCE><![CDATA[Y]]></ISBASEREFERENCE>
 <!--C5C21C28B39E4683A91779F16C112E40-->  <MODEL_IMPL><![CDATA[org.openbravo.base.model.domaintype.HashedStringDomainType]]></MODEL_IMPL>
-<!--C5C21C28B39E4683A91779F16C112E40-->  <WAD_IMPL><![CDATA[org.openbravo.wad.controls.WADString]]></WAD_IMPL>
+<!--C5C21C28B39E4683A91779F16C112E40-->  <WAD_IMPL><![CDATA[org.openbravo.wad.controls.WADPassword]]></WAD_IMPL>
 <!--C5C21C28B39E4683A91779F16C112E40-->  <UI_IMPL><![CDATA[org.openbravo.reference.ui.UIString]]></UI_IMPL>
 <!--C5C21C28B39E4683A91779F16C112E40-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--C5C21C28B39E4683A91779F16C112E40--></AD_REFERENCE>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -8456,9 +8456,10 @@
 <!--3946D07DF63C47E7A11BFADCF160D6B6-->  <AD_REF_LIST_ID><![CDATA[3946D07DF63C47E7A11BFADCF160D6B6]]></AD_REF_LIST_ID>
 <!--3946D07DF63C47E7A11BFADCF160D6B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--3946D07DF63C47E7A11BFADCF160D6B6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--3946D07DF63C47E7A11BFADCF160D6B6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3946D07DF63C47E7A11BFADCF160D6B6-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
 <!--3946D07DF63C47E7A11BFADCF160D6B6-->  <VALUE><![CDATA[R]]></VALUE>
 <!--3946D07DF63C47E7A11BFADCF160D6B6-->  <NAME><![CDATA[Reactivate]]></NAME>
+<!--3946D07DF63C47E7A11BFADCF160D6B6-->  <DESCRIPTION><![CDATA[This option will reactivate the payment and remove its Details and amounts.]]></DESCRIPTION>
 <!--3946D07DF63C47E7A11BFADCF160D6B6-->  <AD_REFERENCE_ID><![CDATA[36972531DA994BB38ECB91993058282F]]></AD_REFERENCE_ID>
 <!--3946D07DF63C47E7A11BFADCF160D6B6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3946D07DF63C47E7A11BFADCF160D6B6--></AD_REF_LIST>
@@ -9207,6 +9208,18 @@
 <!--83E7ED16C71F43558DA8404D21D0B63B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--83E7ED16C71F43558DA8404D21D0B63B--></AD_REF_LIST>
 
+<!--846C98032A894F1BB2F0991CF6D767F3--><AD_REF_LIST>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <AD_REF_LIST_ID><![CDATA[846C98032A894F1BB2F0991CF6D767F3]]></AD_REF_LIST_ID>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <VALUE><![CDATA[RE]]></VALUE>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <NAME><![CDATA[Reactivate]]></NAME>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <DESCRIPTION><![CDATA[This option will reactivate the payment and will keep details and amounts for a later edition.]]></DESCRIPTION>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <AD_REFERENCE_ID><![CDATA[36972531DA994BB38ECB91993058282F]]></AD_REFERENCE_ID>
+<!--846C98032A894F1BB2F0991CF6D767F3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--846C98032A894F1BB2F0991CF6D767F3--></AD_REF_LIST>
+
 <!--855D3B08CF8248ADB9BB84CF8D3FD9C5--><AD_REF_LIST>
 <!--855D3B08CF8248ADB9BB84CF8D3FD9C5-->  <AD_REF_LIST_ID><![CDATA[855D3B08CF8248ADB9BB84CF8D3FD9C5]]></AD_REF_LIST_ID>
 <!--855D3B08CF8248ADB9BB84CF8D3FD9C5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -12791,6 +12791,17 @@
 <!--02E4CF0415C84120B759B7E2E5146558-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--02E4CF0415C84120B759B7E2E5146558--></AD_TEXTINTERFACES>
 
+<!--03FF12EC8B584FE093B398181957431A--><AD_TEXTINTERFACES>
+<!--03FF12EC8B584FE093B398181957431A-->  <AD_TEXTINTERFACES_ID><![CDATA[03FF12EC8B584FE093B398181957431A]]></AD_TEXTINTERFACES_ID>
+<!--03FF12EC8B584FE093B398181957431A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--03FF12EC8B584FE093B398181957431A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--03FF12EC8B584FE093B398181957431A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--03FF12EC8B584FE093B398181957431A-->  <TEXT><![CDATA[Show P&L Closing Entries]]></TEXT>
+<!--03FF12EC8B584FE093B398181957431A-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--03FF12EC8B584FE093B398181957431A-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--03FF12EC8B584FE093B398181957431A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--03FF12EC8B584FE093B398181957431A--></AD_TEXTINTERFACES>
+
 <!--043304C07CB44C50B8FE73C57A3D157F--><AD_TEXTINTERFACES>
 <!--043304C07CB44C50B8FE73C57A3D157F-->  <AD_TEXTINTERFACES_ID><![CDATA[043304C07CB44C50B8FE73C57A3D157F]]></AD_TEXTINTERFACES_ID>
 <!--043304C07CB44C50B8FE73C57A3D157F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -14055,6 +14066,17 @@
 <!--50AAFE528283409E997BA000F7C61ABF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--50AAFE528283409E997BA000F7C61ABF--></AD_TEXTINTERFACES>
 
+<!--518C5EF886394397BDE1550839DED433--><AD_TEXTINTERFACES>
+<!--518C5EF886394397BDE1550839DED433-->  <AD_TEXTINTERFACES_ID><![CDATA[518C5EF886394397BDE1550839DED433]]></AD_TEXTINTERFACES_ID>
+<!--518C5EF886394397BDE1550839DED433-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--518C5EF886394397BDE1550839DED433-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--518C5EF886394397BDE1550839DED433-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--518C5EF886394397BDE1550839DED433-->  <TEXT><![CDATA[Show Closing Entries]]></TEXT>
+<!--518C5EF886394397BDE1550839DED433-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--518C5EF886394397BDE1550839DED433-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--518C5EF886394397BDE1550839DED433-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--518C5EF886394397BDE1550839DED433--></AD_TEXTINTERFACES>
+
 <!--520A3E4E01744392BBBD82F6DD1D8A7E--><AD_TEXTINTERFACES>
 <!--520A3E4E01744392BBBD82F6DD1D8A7E-->  <AD_TEXTINTERFACES_ID><![CDATA[520A3E4E01744392BBBD82F6DD1D8A7E]]></AD_TEXTINTERFACES_ID>
 <!--520A3E4E01744392BBBD82F6DD1D8A7E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -19036,39 +19058,6 @@
 <!--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>
@@ -20004,6 +19993,17 @@
 <!--C6D6BFADC651498BB0631E37EC566961-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C6D6BFADC651498BB0631E37EC566961--></AD_TEXTINTERFACES>
 
+<!--C769FCC281B14F768BB5E4D5F9721B20--><AD_TEXTINTERFACES>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <AD_TEXTINTERFACES_ID><![CDATA[C769FCC281B14F768BB5E4D5F9721B20]]></AD_TEXTINTERFACES_ID>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <TEXT><![CDATA[Show Opening Entries]]></TEXT>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.html]]></FILENAME>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--C769FCC281B14F768BB5E4D5F9721B20-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C769FCC281B14F768BB5E4D5F9721B20--></AD_TEXTINTERFACES>
+
 <!--C78656AD3E214640B3AF6ECA1A4BEEA1--><AD_TEXTINTERFACES>
 <!--C78656AD3E214640B3AF6ECA1A4BEEA1-->  <AD_TEXTINTERFACES_ID><![CDATA[C78656AD3E214640B3AF6ECA1A4BEEA1]]></AD_TEXTINTERFACES_ID>
 <!--C78656AD3E214640B3AF6ECA1A4BEEA1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_WINDOW.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/AD_WINDOW.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -330,8 +330,8 @@
 <!--122-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--122-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--122-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--122-->  <NAME><![CDATA[Country Region and City]]></NAME>
-<!--122-->  <DESCRIPTION><![CDATA[Define countries with regions and cities to be used in the application.]]></DESCRIPTION>
+<!--122-->  <NAME><![CDATA[Country and Region]]></NAME>
+<!--122-->  <DESCRIPTION><![CDATA[Define countries with regions to be used in the application.]]></DESCRIPTION>
 <!--122-->  <HELP><![CDATA[Countries and regions are basic settings to share within Openbravo.]]></HELP>
 <!--122-->  <WINDOWTYPE><![CDATA[M]]></WINDOWTYPE>
 <!--122-->  <ISSOTRX><![CDATA[Y]]></ISSOTRX>
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -31,7 +31,7 @@
 <!--082C760C3435477B9A20B9990749F6C7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--082C760C3435477B9A20B9990749F6C7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--082C760C3435477B9A20B9990749F6C7-->  <NAME><![CDATA[Location]]></NAME>
-<!--082C760C3435477B9A20B9990749F6C7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--082C760C3435477B9A20B9990749F6C7-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--082C760C3435477B9A20B9990749F6C7-->  <SORT><![CDATA[Y]]></SORT>
 <!--082C760C3435477B9A20B9990749F6C7-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--082C760C3435477B9A20B9990749F6C7-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -52,7 +52,7 @@
 <!--1A3CADEA9ED94D039A6667599E0E63C0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--1A3CADEA9ED94D039A6667599E0E63C0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1A3CADEA9ED94D039A6667599E0E63C0-->  <NAME><![CDATA[Vendor]]></NAME>
-<!--1A3CADEA9ED94D039A6667599E0E63C0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--1A3CADEA9ED94D039A6667599E0E63C0-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--1A3CADEA9ED94D039A6667599E0E63C0-->  <SORT><![CDATA[Y]]></SORT>
 <!--1A3CADEA9ED94D039A6667599E0E63C0-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--1A3CADEA9ED94D039A6667599E0E63C0-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -162,7 +162,7 @@
 <!--348E946313BF4336ABDA800BA68829CF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--348E946313BF4336ABDA800BA68829CF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--348E946313BF4336ABDA800BA68829CF-->  <NAME><![CDATA[Category]]></NAME>
-<!--348E946313BF4336ABDA800BA68829CF-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--348E946313BF4336ABDA800BA68829CF-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--348E946313BF4336ABDA800BA68829CF-->  <SORT><![CDATA[Y]]></SORT>
 <!--348E946313BF4336ABDA800BA68829CF-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--348E946313BF4336ABDA800BA68829CF-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -183,7 +183,7 @@
 <!--36B5DC1CD166494D8221B493042D7CCF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--36B5DC1CD166494D8221B493042D7CCF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--36B5DC1CD166494D8221B493042D7CCF-->  <NAME><![CDATA[Credit Line available]]></NAME>
-<!--36B5DC1CD166494D8221B493042D7CCF-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--36B5DC1CD166494D8221B493042D7CCF-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--36B5DC1CD166494D8221B493042D7CCF-->  <SORT><![CDATA[Y]]></SORT>
 <!--36B5DC1CD166494D8221B493042D7CCF-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--36B5DC1CD166494D8221B493042D7CCF-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -204,7 +204,7 @@
 <!--38075EEC36C24E3CAB44D1B33D2CE637-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--38075EEC36C24E3CAB44D1B33D2CE637-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--38075EEC36C24E3CAB44D1B33D2CE637-->  <NAME><![CDATA[identifier]]></NAME>
-<!--38075EEC36C24E3CAB44D1B33D2CE637-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--38075EEC36C24E3CAB44D1B33D2CE637-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--38075EEC36C24E3CAB44D1B33D2CE637-->  <SORT><![CDATA[Y]]></SORT>
 <!--38075EEC36C24E3CAB44D1B33D2CE637-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--38075EEC36C24E3CAB44D1B33D2CE637-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -224,7 +224,7 @@
 <!--3C4C59A1AB77437A959F10D42D32FDE7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--3C4C59A1AB77437A959F10D42D32FDE7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3C4C59A1AB77437A959F10D42D32FDE7-->  <NAME><![CDATA[location identifier]]></NAME>
-<!--3C4C59A1AB77437A959F10D42D32FDE7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--3C4C59A1AB77437A959F10D42D32FDE7-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--3C4C59A1AB77437A959F10D42D32FDE7-->  <SORT><![CDATA[Y]]></SORT>
 <!--3C4C59A1AB77437A959F10D42D32FDE7-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--3C4C59A1AB77437A959F10D42D32FDE7-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -245,7 +245,7 @@
 <!--4028E61131FB4B1B0131FB53BDDB0012-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB53BDDB0012-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB53BDDB0012-->  <NAME><![CDATA[Contact]]></NAME>
-<!--4028E61131FB4B1B0131FB53BDDB0012-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB53BDDB0012-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB53BDDB0012-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB53BDDB0012-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB53BDDB0012-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -266,7 +266,7 @@
 <!--4028E61131FB4B1B0131FB542B790018-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB542B790018-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB542B790018-->  <NAME><![CDATA[Value]]></NAME>
-<!--4028E61131FB4B1B0131FB542B790018-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB542B790018-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB542B790018-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB542B790018-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB542B790018-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
@@ -287,7 +287,7 @@
 <!--4028E61131FB4B1B0131FB54A1B0001E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB54A1B0001E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB54A1B0001E-->  <NAME><![CDATA[Credit Line available]]></NAME>
-<!--4028E61131FB4B1B0131FB54A1B0001E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB54A1B0001E-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB54A1B0001E-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB54A1B0001E-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB54A1B0001E-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -308,7 +308,7 @@
 <!--4028E61131FB4B1B0131FB550A2A0024-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB550A2A0024-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB550A2A0024-->  <NAME><![CDATA[location identifier]]></NAME>
-<!--4028E61131FB4B1B0131FB550A2A0024-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB550A2A0024-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB550A2A0024-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB550A2A0024-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB550A2A0024-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -329,7 +329,7 @@
 <!--4028E61131FB4B1B0131FB555EB6002A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB555EB6002A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB555EB6002A-->  <NAME><![CDATA[contact identifier]]></NAME>
-<!--4028E61131FB4B1B0131FB555EB6002A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB555EB6002A-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB555EB6002A-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB555EB6002A-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB555EB6002A-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -350,7 +350,7 @@
 <!--4028E61131FB4B1B0131FB55C5640030-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB55C5640030-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB55C5640030-->  <NAME><![CDATA[Customer Balance]]></NAME>
-<!--4028E61131FB4B1B0131FB55C5640030-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB55C5640030-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB55C5640030-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB55C5640030-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB55C5640030-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -371,7 +371,7 @@
 <!--4028E61131FB4B1B0131FB5625760036-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB5625760036-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB5625760036-->  <NAME><![CDATA[Name]]></NAME>
-<!--4028E61131FB4B1B0131FB5625760036-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB5625760036-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB5625760036-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB5625760036-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB5625760036-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
@@ -392,7 +392,7 @@
 <!--4028E61131FB4B1B0131FB569247003C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB569247003C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB569247003C-->  <NAME><![CDATA[Customer]]></NAME>
-<!--4028E61131FB4B1B0131FB569247003C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB569247003C-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB569247003C-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB569247003C-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB569247003C-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -413,7 +413,7 @@
 <!--4028E61131FB4B1B0131FB5711430042-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB5711430042-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB5711430042-->  <NAME><![CDATA[identifier]]></NAME>
-<!--4028E61131FB4B1B0131FB5711430042-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB5711430042-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB5711430042-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB5711430042-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB5711430042-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -433,7 +433,7 @@
 <!--4028E61131FB4B1B0131FB5774570048-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB5774570048-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB5774570048-->  <NAME><![CDATA[Location]]></NAME>
-<!--4028E61131FB4B1B0131FB5774570048-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB5774570048-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB5774570048-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB5774570048-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB5774570048-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -454,7 +454,7 @@
 <!--4028E61131FB4B1B0131FB57E44B004E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB57E44B004E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB57E44B004E-->  <NAME><![CDATA[Vendor]]></NAME>
-<!--4028E61131FB4B1B0131FB57E44B004E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB57E44B004E-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB57E44B004E-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB57E44B004E-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB57E44B004E-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -475,7 +475,7 @@
 <!--4028E61131FB4B1B0131FB5844630054-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4028E61131FB4B1B0131FB5844630054-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--4028E61131FB4B1B0131FB5844630054-->  <NAME><![CDATA[income]]></NAME>
-<!--4028E61131FB4B1B0131FB5844630054-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4028E61131FB4B1B0131FB5844630054-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--4028E61131FB4B1B0131FB5844630054-->  <SORT><![CDATA[Y]]></SORT>
 <!--4028E61131FB4B1B0131FB5844630054-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--4028E61131FB4B1B0131FB5844630054-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -517,7 +517,7 @@
 <!--5545248A63EC4FB1833AB17C07C5542C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--5545248A63EC4FB1833AB17C07C5542C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5545248A63EC4FB1833AB17C07C5542C-->  <NAME><![CDATA[Value]]></NAME>
-<!--5545248A63EC4FB1833AB17C07C5542C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--5545248A63EC4FB1833AB17C07C5542C-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--5545248A63EC4FB1833AB17C07C5542C-->  <SORT><![CDATA[Y]]></SORT>
 <!--5545248A63EC4FB1833AB17C07C5542C-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--5545248A63EC4FB1833AB17C07C5542C-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
@@ -558,7 +558,7 @@
 <!--63507B832CF94D8BB30286ED4369E55B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--63507B832CF94D8BB30286ED4369E55B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--63507B832CF94D8BB30286ED4369E55B-->  <NAME><![CDATA[Credit Line available]]></NAME>
-<!--63507B832CF94D8BB30286ED4369E55B-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--63507B832CF94D8BB30286ED4369E55B-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--63507B832CF94D8BB30286ED4369E55B-->  <SORT><![CDATA[Y]]></SORT>
 <!--63507B832CF94D8BB30286ED4369E55B-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--63507B832CF94D8BB30286ED4369E55B-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -629,7 +629,7 @@
 <!--7CA7330BA4864D2FB1FED44CDB88A622-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--7CA7330BA4864D2FB1FED44CDB88A622-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--7CA7330BA4864D2FB1FED44CDB88A622-->  <NAME><![CDATA[Name]]></NAME>
-<!--7CA7330BA4864D2FB1FED44CDB88A622-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--7CA7330BA4864D2FB1FED44CDB88A622-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--7CA7330BA4864D2FB1FED44CDB88A622-->  <SORT><![CDATA[Y]]></SORT>
 <!--7CA7330BA4864D2FB1FED44CDB88A622-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--7CA7330BA4864D2FB1FED44CDB88A622-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
@@ -693,7 +693,7 @@
 <!--8AB5D5043894438B8AFDBC8491C8F692-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8AB5D5043894438B8AFDBC8491C8F692-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8AB5D5043894438B8AFDBC8491C8F692-->  <NAME><![CDATA[Customer Balance]]></NAME>
-<!--8AB5D5043894438B8AFDBC8491C8F692-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--8AB5D5043894438B8AFDBC8491C8F692-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--8AB5D5043894438B8AFDBC8491C8F692-->  <SORT><![CDATA[Y]]></SORT>
 <!--8AB5D5043894438B8AFDBC8491C8F692-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--8AB5D5043894438B8AFDBC8491C8F692-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -736,7 +736,7 @@
 <!--8E80548AE96B4932A482852994C13D4A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8E80548AE96B4932A482852994C13D4A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8E80548AE96B4932A482852994C13D4A-->  <NAME><![CDATA[Customer Balance]]></NAME>
-<!--8E80548AE96B4932A482852994C13D4A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--8E80548AE96B4932A482852994C13D4A-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--8E80548AE96B4932A482852994C13D4A-->  <SORT><![CDATA[Y]]></SORT>
 <!--8E80548AE96B4932A482852994C13D4A-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--8E80548AE96B4932A482852994C13D4A-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -825,7 +825,7 @@
 <!--9835921A3AA54B8D8D0126B3696F8354-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--9835921A3AA54B8D8D0126B3696F8354-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9835921A3AA54B8D8D0126B3696F8354-->  <NAME><![CDATA[Name]]></NAME>
-<!--9835921A3AA54B8D8D0126B3696F8354-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--9835921A3AA54B8D8D0126B3696F8354-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--9835921A3AA54B8D8D0126B3696F8354-->  <SORT><![CDATA[Y]]></SORT>
 <!--9835921A3AA54B8D8D0126B3696F8354-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--9835921A3AA54B8D8D0126B3696F8354-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
@@ -846,7 +846,7 @@
 <!--9D9998D878F2442BB240A5872C8D6A8E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--9D9998D878F2442BB240A5872C8D6A8E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9D9998D878F2442BB240A5872C8D6A8E-->  <NAME><![CDATA[Value]]></NAME>
-<!--9D9998D878F2442BB240A5872C8D6A8E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--9D9998D878F2442BB240A5872C8D6A8E-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--9D9998D878F2442BB240A5872C8D6A8E-->  <SORT><![CDATA[Y]]></SORT>
 <!--9D9998D878F2442BB240A5872C8D6A8E-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--9D9998D878F2442BB240A5872C8D6A8E-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
@@ -867,7 +867,7 @@
 <!--A246D4AC538E42BE9F0CD8182A558712-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A246D4AC538E42BE9F0CD8182A558712-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--A246D4AC538E42BE9F0CD8182A558712-->  <NAME><![CDATA[Customer]]></NAME>
-<!--A246D4AC538E42BE9F0CD8182A558712-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A246D4AC538E42BE9F0CD8182A558712-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--A246D4AC538E42BE9F0CD8182A558712-->  <SORT><![CDATA[Y]]></SORT>
 <!--A246D4AC538E42BE9F0CD8182A558712-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--A246D4AC538E42BE9F0CD8182A558712-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -889,7 +889,7 @@
 <!--A70124FC61904F7BAD6F8BDF436931B4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A70124FC61904F7BAD6F8BDF436931B4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--A70124FC61904F7BAD6F8BDF436931B4-->  <NAME><![CDATA[contact identifier]]></NAME>
-<!--A70124FC61904F7BAD6F8BDF436931B4-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A70124FC61904F7BAD6F8BDF436931B4-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--A70124FC61904F7BAD6F8BDF436931B4-->  <SORT><![CDATA[Y]]></SORT>
 <!--A70124FC61904F7BAD6F8BDF436931B4-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--A70124FC61904F7BAD6F8BDF436931B4-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -953,7 +953,7 @@
 <!--B103893820FC4080809A97FABD49D8AF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--B103893820FC4080809A97FABD49D8AF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--B103893820FC4080809A97FABD49D8AF-->  <NAME><![CDATA[identifier]]></NAME>
-<!--B103893820FC4080809A97FABD49D8AF-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B103893820FC4080809A97FABD49D8AF-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--B103893820FC4080809A97FABD49D8AF-->  <SORT><![CDATA[Y]]></SORT>
 <!--B103893820FC4080809A97FABD49D8AF-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--B103893820FC4080809A97FABD49D8AF-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -1017,7 +1017,7 @@
 <!--C8D400B2F068460C882BB44977BEAAEF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C8D400B2F068460C882BB44977BEAAEF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C8D400B2F068460C882BB44977BEAAEF-->  <NAME><![CDATA[Income]]></NAME>
-<!--C8D400B2F068460C882BB44977BEAAEF-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C8D400B2F068460C882BB44977BEAAEF-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--C8D400B2F068460C882BB44977BEAAEF-->  <SORT><![CDATA[Y]]></SORT>
 <!--C8D400B2F068460C882BB44977BEAAEF-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--C8D400B2F068460C882BB44977BEAAEF-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -1038,7 +1038,7 @@
 <!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <NAME><![CDATA[Customer]]></NAME>
-<!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <SORT><![CDATA[Y]]></SORT>
 <!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--CA8DF8BBBDA34D5AB299E14E86320BC6-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -1319,7 +1319,7 @@
 <!--F91FD25B57A74BD587AEDB091A0FD53D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--F91FD25B57A74BD587AEDB091A0FD53D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--F91FD25B57A74BD587AEDB091A0FD53D-->  <NAME><![CDATA[Vendor]]></NAME>
-<!--F91FD25B57A74BD587AEDB091A0FD53D-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F91FD25B57A74BD587AEDB091A0FD53D-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--F91FD25B57A74BD587AEDB091A0FD53D-->  <SORT><![CDATA[Y]]></SORT>
 <!--F91FD25B57A74BD587AEDB091A0FD53D-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--F91FD25B57A74BD587AEDB091A0FD53D-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
@@ -1341,7 +1341,7 @@
 <!--FB43216FCC1A473AA41E051E567D9490-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--FB43216FCC1A473AA41E051E567D9490-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FB43216FCC1A473AA41E051E567D9490-->  <NAME><![CDATA[Contact]]></NAME>
-<!--FB43216FCC1A473AA41E051E567D9490-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--FB43216FCC1A473AA41E051E567D9490-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
 <!--FB43216FCC1A473AA41E051E567D9490-->  <SORT><![CDATA[Y]]></SORT>
 <!--FB43216FCC1A473AA41E051E567D9490-->  <FILTER><![CDATA[Y]]></FILTER>
 <!--FB43216FCC1A473AA41E051E567D9490-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
--- a/src-db/database/sourcedata/referencedData/AD_ALERTRULE.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-db/database/sourcedata/referencedData/AD_ALERTRULE.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -495,15 +495,17 @@
         now() as updated,
         0 as updatedBy
   from c_order o
-where o.processed = 'Y'
+ where o.processed = 'Y'
   and trunc(datepromised) <= trunc(now())
   and issotrx='N'
-  and not exists (select 1
-                from c_orderline ol
-              where o.c_order_id = ol.c_order_id
-                and qtydelivered !=0)
-and 0 != (select sum(qtyordered) 
-              from c_orderline ol
+  and not exists (select 1 
+                from C_ORDERLINE l left join M_MATCHPO m on l.C_OrderLine_ID=m.C_OrderLine_ID
+                and  m.M_InOutLine_ID is not null 
+                where l.C_ORDER_ID = o.C_ORDER_ID
+                group by l.C_OrderLine_ID, l.QtyOrdered
+                having (l.QtyOrdered-SUM(COALESCE(m.Qty,0))) = 0)
+  and 0 != (select sum(qtyordered)
+              from c_orderline ol
              where o.c_order_id = ol.c_order_id)]]></SQL>
 <!--1000021-->  <TYPE><![CDATA[D]]></TYPE>
 <!--1000021--></AD_ALERTRULE>
--- a/src-test/org/openbravo/test/AllAntTaskTests.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-test/org/openbravo/test/AllAntTaskTests.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,7 +11,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) 2009-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -30,6 +30,7 @@
 import org.openbravo.test.dal.DalFilterTest;
 import org.openbravo.test.dal.DalPerformanceInventoryLineTest;
 import org.openbravo.test.dal.DalPerformanceProductTest;
+import org.openbravo.test.dal.DalPerformanceProxyTest;
 import org.openbravo.test.dal.DalQueryTest;
 import org.openbravo.test.dal.DalStoredProcedureTest;
 import org.openbravo.test.dal.DalTest;
@@ -86,6 +87,7 @@
     suite.addTestSuite(DalComplexQueryTestOrderLine.class);
     suite.addTestSuite(DalPerformanceInventoryLineTest.class);
     suite.addTestSuite(DalPerformanceProductTest.class);
+    suite.addTestSuite(DalPerformanceProxyTest.class);
     suite.addTestSuite(DalQueryTest.class);
     suite.addTestSuite(DalFilterTest.class);
     suite.addTestSuite(DalTest.class);
--- a/src-test/org/openbravo/test/AllQuickAntTaskTests.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-test/org/openbravo/test/AllQuickAntTaskTests.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,7 +11,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) 2009-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -26,6 +26,7 @@
 import org.openbravo.test.dal.AdminContextTest;
 import org.openbravo.test.dal.DalConnectionProviderTest;
 import org.openbravo.test.dal.DalFilterTest;
+import org.openbravo.test.dal.DalPerformanceProxyTest;
 import org.openbravo.test.dal.DalStoredProcedureTest;
 import org.openbravo.test.dal.DalTest;
 import org.openbravo.test.dal.DalUtilTest;
@@ -72,6 +73,7 @@
     // suite.addTestSuite(DalPerformanceInventoryLineTest.class);
     // suite.addTestSuite(DalPerformanceProductTest.class);
     // suite.addTestSuite(DalQueryTest.class);
+    suite.addTestSuite(DalPerformanceProxyTest.class);
     suite.addTestSuite(DalTest.class);
     suite.addTestSuite(DalFilterTest.class);
     suite.addTestSuite(DalUtilTest.class);
--- a/src-test/org/openbravo/test/AllTests.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-test/org/openbravo/test/AllTests.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,7 +11,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) 2008-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -26,6 +26,7 @@
 import org.openbravo.test.dal.DalConnectionProviderTest;
 import org.openbravo.test.dal.DalCopyTest;
 import org.openbravo.test.dal.DalFilterTest;
+import org.openbravo.test.dal.DalPerformanceProxyTest;
 import org.openbravo.test.dal.DalQueryTest;
 import org.openbravo.test.dal.DalStoredProcedureTest;
 import org.openbravo.test.dal.DalTest;
@@ -79,6 +80,7 @@
     suite.addTestSuite(DalCopyTest.class);
     suite.addTestSuite(DalStoredProcedureTest.class);
     suite.addTestSuite(ReadByNameTest.class);
+    suite.addTestSuite(DalPerformanceProxyTest.class);
 
     // model
     suite.addTestSuite(RuntimeModelTest.class);
--- a/src-test/org/openbravo/test/AntTaskTests.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-test/org/openbravo/test/AntTaskTests.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,7 +11,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) 2009-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -29,6 +29,7 @@
 import org.openbravo.test.dal.DalCopyTest;
 import org.openbravo.test.dal.DalPerformanceInventoryLineTest;
 import org.openbravo.test.dal.DalPerformanceProductTest;
+import org.openbravo.test.dal.DalPerformanceProxyTest;
 import org.openbravo.test.dal.DalQueryTest;
 import org.openbravo.test.dal.DalStoredProcedureTest;
 import org.openbravo.test.dal.DalTest;
@@ -86,6 +87,7 @@
     suite.addTestSuite(DalComplexQueryTestOrderLine.class);
     suite.addTestSuite(DalPerformanceInventoryLineTest.class);
     suite.addTestSuite(DalPerformanceProductTest.class);
+    suite.addTestSuite(DalPerformanceProxyTest.class);
     suite.addTestSuite(DalQueryTest.class);
     suite.addTestSuite(DalConnectionProviderTest.class);
     suite.addTestSuite(DalTest.class);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/dal/DalPerformanceCriteriaTest.java	Mon Jun 25 19:58:29 2012 +0200
@@ -0,0 +1,461 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * 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 
+ * 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) 2012 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.dal;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.UUID;
+
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
+import org.hibernate.criterion.Restrictions;
+import org.hibernate.engine.SessionImplementor;
+import org.junit.Assert;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.structure.BaseOBObject;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
+import org.openbravo.model.ad.datamodel.Table;
+import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.businesspartner.Category;
+import org.openbravo.model.common.currency.Currency;
+import org.openbravo.model.common.plm.Product;
+import org.openbravo.model.materialmgmt.transaction.MaterialTransaction;
+import org.openbravo.test.base.BaseTest;
+
+/**
+ * Test case to try and test proxy loading or stateless sessions.
+ * 
+ * @author mtaal
+ */
+
+public class DalPerformanceCriteriaTest extends BaseTest {
+
+  private static final int CNT = 1000;
+
+  public void testPerformance() {
+    createManyBPs();
+
+    doTestCriteriaPerformance(new QueryTest1(false));
+    doTestCriteriaPerformance(new QueryTest2(false));
+    doTestCriteriaPerformance(new QueryTest3(false));
+    doTestCriteriaPerformance(new QueryTest4(false));
+    doTestCriteriaPerformance(new QueryTest5(false));
+    doTestCriteriaPerformance(new QueryTest1(true));
+    doTestCriteriaPerformance(new QueryTest2(true));
+    doTestCriteriaPerformance(new QueryTest3(true));
+    doTestCriteriaPerformance(new QueryTest4(true));
+    doTestCriteriaPerformance(new QueryTest5(true));
+  }
+
+  public void doTestCriteriaPerformance(QueryTest queryTest) {
+    OBDal.getInstance().commitAndClose();
+
+    // usefull when printing
+    if (true) {
+      // warmup
+      queryTest.doCriteriaQry();
+      // show sql
+      queryTest.doCriteriaQry();
+      queryTest.doHqlQry();
+    }
+
+    // warmup
+    for (int i = 0; i < 10; i++) {
+      queryTest.doCriteriaQry();
+    }
+
+    long t1 = System.currentTimeMillis();
+    int v1 = -1;
+    for (int i = 0; i < CNT; i++) {
+      int v2 = queryTest.doCriteriaQry();
+      Assert.assertTrue(i == 0 || v1 == v2);
+      v1 = v2;
+      OBDal.getInstance().getSession().clear();
+    }
+    OBDal.getInstance().commitAndClose();
+    t1 = System.currentTimeMillis() - t1;
+
+    // warmup
+    for (int i = 0; i < 10; i++) {
+      queryTest.doHqlQry();
+    }
+
+    long t2 = System.currentTimeMillis();
+    for (int i = 0; i < CNT; i++) {
+      int v2 = queryTest.doHqlQry();
+      // same output as previous criteria/hql queries
+      Assert.assertTrue(v1 == v2);
+      v1 = v2;
+      OBDal.getInstance().getSession().clear();
+    }
+    OBDal.getInstance().commitAndClose();
+    t2 = System.currentTimeMillis() - t2;
+    int percentage = (int) ((100 * (t1 - t2)) / t2);
+    System.err.println("HQL is " + percentage + "% faster - (resultCount: " + v1 + ") - "
+        + (queryTest.isDoScroll() ? "SCROLL - Query: " : "Query: ") + queryTest.getId()
+        + " - HQL time: " + t1 + "ms");
+  }
+
+  private abstract class QueryTest {
+    public abstract int doCriteriaQry();
+
+    public abstract int doHqlQry();
+
+    public abstract String getId();
+
+    public abstract boolean isDoScroll();
+
+  }
+
+  public void testCriteriaScrollable() {
+
+    OBCriteria<BusinessPartner> c = OBDal.getInstance().createCriteria(BusinessPartner.class);
+    ScrollableResults iterator = c.scroll(ScrollMode.FORWARD_ONLY);
+    iterator.next();
+  }
+
+  private class QueryTest1 extends QueryTest {
+
+    private String qryStr = "";
+    private boolean doScroll = false;
+
+    public QueryTest1(boolean doScroll) {
+      this.doScroll = doScroll;
+    }
+
+    public int doCriteriaQry() {
+      final OBCriteria<Currency> obc = OBDal.getInstance().createCriteria(Currency.class);
+      obc.add(Restrictions.eq(Currency.PROPERTY_ISOCODE, "USD"));
+      if (doScroll) {
+        final ScrollableResults r = obc.scroll(ScrollMode.FORWARD_ONLY);
+        int cnt = 0;
+        while (r.next()) {
+          cnt++;
+        }
+        return cnt;
+      }
+      final List<Currency> cs = obc.list();
+      return cs.size();
+    }
+
+    public int doHqlQry() {
+      final OBQuery<Currency> obq = OBDal.getInstance()
+          .createQuery(Currency.class, "iSOCode='USD'");
+      final List<Currency> cs = obq.list();
+      qryStr = "Currency with " + obq.getWhereAndOrderBy();
+      return cs.size();
+    }
+
+    public String getId() {
+      return qryStr;
+    }
+
+    public boolean isDoScroll() {
+      return doScroll;
+    }
+  }
+
+  private class QueryTest2 extends QueryTest {
+    private String qryStr;
+    private boolean doScroll = false;
+
+    public QueryTest2(boolean doScroll) {
+      this.doScroll = doScroll;
+    }
+
+    public int doCriteriaQry() {
+      final OBCriteria<Currency> obc = OBDal.getInstance().createCriteria(Currency.class);
+      if (doScroll) {
+        final ScrollableResults r = obc.scroll(ScrollMode.FORWARD_ONLY);
+        int cnt = 0;
+        while (r.next()) {
+          cnt++;
+        }
+        return cnt;
+      }
+      final List<Currency> cs = obc.list();
+      return cs.size();
+    }
+
+    public int doHqlQry() {
+      final OBQuery<Currency> obq = OBDal.getInstance().createQuery(Currency.class, "");
+      final List<Currency> cs = obq.list();
+      qryStr = "Currency";
+      return cs.size();
+    }
+
+    public String getId() {
+      return qryStr;
+    }
+
+    public boolean isDoScroll() {
+      return doScroll;
+    }
+  }
+
+  private class QueryTest3 extends QueryTest {
+    private String qryStr;
+    private boolean doScroll = false;
+
+    public QueryTest3(boolean doScroll) {
+      this.doScroll = doScroll;
+    }
+
+    public int doCriteriaQry() {
+      final OBCriteria<MaterialTransaction> obc = OBDal.getInstance().createCriteria(
+          MaterialTransaction.class);
+      obc.add(Restrictions.isNotNull(MaterialTransaction.PROPERTY_UOM));
+      obc.addOrderBy(MaterialTransaction.PROPERTY_PRODUCT + "." + Product.PROPERTY_NAME, false);
+      obc.setMaxResults(10);
+      obc.setFirstResult(0);
+      if (doScroll) {
+        final ScrollableResults r = obc.scroll(ScrollMode.FORWARD_ONLY);
+        int cnt = 0;
+        while (r.next()) {
+          cnt++;
+        }
+        return cnt;
+      }
+      final List<MaterialTransaction> cs = obc.list();
+      return cs.size();
+    }
+
+    public int doHqlQry() {
+      final OBQuery<MaterialTransaction> obq = OBDal.getInstance().createQuery(
+          MaterialTransaction.class, " uOM <> null order by product.name desc");
+      obq.setMaxResult(10);
+      obq.setFirstResult(0);
+      final List<MaterialTransaction> cs = obq.list();
+      qryStr = "MaterialTransaction with " + obq.getWhereAndOrderBy();
+      return cs.size();
+    }
+
+    public String getId() {
+      return qryStr;
+    }
+
+    public boolean isDoScroll() {
+      return doScroll;
+    }
+  }
+
+  private class QueryTest4 extends QueryTest {
+    private String qryStr;
+    private boolean doScroll = false;
+
+    public QueryTest4(boolean doScroll) {
+      this.doScroll = doScroll;
+    }
+
+    public int doCriteriaQry() {
+      OBCriteria<Table> c = OBDal.getInstance().createCriteria(Table.class);
+      c.add(Restrictions.eq(Table.PROPERTY_ID, "100"));
+      if (doScroll) {
+        final ScrollableResults r = c.scroll(ScrollMode.FORWARD_ONLY);
+        int cnt = 0;
+        while (r.next()) {
+          cnt++;
+        }
+        return cnt;
+      }
+      final List<Table> cs = c.list();
+      return cs.size();
+    }
+
+    public int doHqlQry() {
+      OBQuery<Table> q = OBDal.getInstance().createQuery(Table.class, "id = :id");
+      q.setNamedParameter("id", "100");
+      final List<Table> cs = q.list();
+      qryStr = "Table with id=100";
+      return cs.size();
+    }
+
+    public String getId() {
+      return qryStr;
+    }
+
+    public boolean isDoScroll() {
+      return doScroll;
+    }
+  }
+
+  private class QueryTest5 extends QueryTest {
+    private String qryStr;
+    private boolean doScroll = false;
+
+    public QueryTest5(boolean doScroll) {
+      this.doScroll = doScroll;
+    }
+
+    public int doCriteriaQry() {
+      OBCriteria<BusinessPartner> c = OBDal.getInstance().createCriteria(BusinessPartner.class);
+      c.setFilterOnActive(false);
+      c.setFilterOnReadableClients(false);
+      c.setFilterOnReadableOrganization(false);
+      c.setMaxResults(1000);
+      if (doScroll) {
+        final ScrollableResults r = c.scroll(ScrollMode.FORWARD_ONLY);
+        int cnt = 0;
+        while (r.next()) {
+          cnt++;
+        }
+        return cnt;
+      }
+      final List<BusinessPartner> cs = c.list();
+      return cs.size();
+    }
+
+    public int doHqlQry() {
+      OBQuery<BusinessPartner> q = OBDal.getInstance().createQuery(BusinessPartner.class, "");
+      q.setFilterOnActive(false);
+      q.setFilterOnReadableClients(false);
+      q.setFilterOnReadableOrganization(false);
+      q.setMaxResult(1000);
+      qryStr = "All BusinessPartners";
+      if (doScroll) {
+        int cnt = 0;
+        ScrollableResults scroller = q.scroll(ScrollMode.FORWARD_ONLY);
+        while (scroller.next()) {
+          cnt++;
+        }
+        return cnt;
+      }
+      final List<BusinessPartner> cs = q.list();
+      return cs.size();
+    }
+
+    public String getId() {
+      return qryStr;
+    }
+
+    public boolean isDoScroll() {
+      return doScroll;
+    }
+  }
+
+  private void createManyBPs() {
+    try {
+      setTestAdminContext();
+
+      final OBQuery<BusinessPartner> bps = OBDal.getInstance().createQuery(BusinessPartner.class,
+          "");
+      bps.setFilterOnActive(false);
+      bps.setFilterOnReadableClients(false);
+      bps.setFilterOnReadableOrganization(false);
+      System.err.println(bps.count());
+      if (bps.count() > 10000) {
+        return;
+      }
+
+      OBDal.getInstance().commitAndClose();
+
+      for (int i = 0; i < 10000; i++) {
+        BusinessPartner bp = OBProvider.getInstance().get(BusinessPartner.class);
+
+        // Generating random strings for testing
+        UUID name = UUID.randomUUID();
+        UUID key = UUID.randomUUID();
+
+        bp.setName(name.toString());
+        bp.setSearchKey(key.toString());
+
+        final Category category = (Category) getProxy(Category.ENTITY_NAME, TEST_BP_CATEGORY_ID);
+        bp.setBusinessPartnerCategory(category);
+
+        OBDal.getInstance().save(bp);
+        if ((i % 100) == 0) {
+          OBDal.getInstance().flush();
+        }
+        // this all works
+        // OBDal.getInstance().refresh(bp);
+        // Assert.assertTrue(bp.getId() != null);
+
+        // check that if really loading that still the proxy object is returned
+        // Assert.assertTrue(category == OBDal.getInstance().get(Category.ENTITY_NAME,
+        // TEST_BP_CATEGORY_ID));
+      }
+      OBDal.getInstance().commitAndClose();
+    } catch (Exception e) {
+      throw new OBException(e);
+    }
+  }
+
+  /**
+   * Will return a non-loaded hibernate proxy if the object was not already loaded by hibernate.
+   * 
+   * NOTE/BEWARE: this method will not check if the object actually exists in the database. This
+   * will detected when persisting a referencing object or when this proxy gets initialized!
+   * 
+   * This method differs from other get methods in this class, these methods will always eagerly
+   * load the object and thereby also immediately check the existence of these referenced objects.
+   * 
+   * @param entityName
+   *          the type of object to search for
+   * @param id
+   *          the id of the object
+   * @return the object, or null if none found
+   */
+  private BaseOBObject getProxy(String entityName, Object id) {
+    return (BaseOBObject) ((SessionImplementor) OBDal.getInstance().getSession()).internalLoad(
+        entityName, (Serializable) id, false, false);
+  }
+
+  /*
+   * List<FIN_PaymentSchedule> lQuery, lReturn = new ArrayList<FIN_PaymentSchedule>();
+   * OBCriteria<FIN_PaymentSchedule> obcPS = OBDal.getInstance().createCriteria(
+   * FIN_PaymentSchedule.class); obcPS.add(Restrictions.eq(FIN_PaymentSchedule.PROPERTY_INVOICE,
+   * invoice)); lQuery = obcPS.list();
+   * 
+   * // 1) Remove not paid payment schedule detail lines OBCriteria<FIN_PaymentScheduleDetail>
+   * obcPSD = OBDal.getInstance().createCriteria( FIN_PaymentScheduleDetail.class);
+   * obcPSD.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_INVOICEPAYMENTSCHEDULE,
+   * invoicePS));
+   * obcPSD.add(Restrictions.isNull(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS));
+   * 
+   * OBCriteria<FIN_PaymentScheduleDetail> orderedPSDs = OBDal.getInstance().createCriteria(
+   * FIN_PaymentScheduleDetail.class);
+   * orderedPSDs.add(Restrictions.in(FIN_PaymentScheduleDetail.PROPERTY_ID, psdSet));
+   * orderedPSDs.addOrderBy(FIN_PaymentScheduleDetail.PROPERTY_AMOUNT, true);
+   * 
+   * OBCriteria<FinAccPaymentMethod> psdFilter = OBDal.getInstance().createCriteria(
+   * FinAccPaymentMethod.class); psdFilter.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_ACCOUNT,
+   * finAcc)); psdFilter.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD,
+   * finPmtMethod));
+   * 
+   * OBCriteria<FIN_Payment> obcPayment = OBDal.getInstance().createCriteria(FIN_Payment.class);
+   * obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_BUSINESSPARTNER, bp));
+   * obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_RECEIPT, isReceipt));
+   * obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_GENERATEDCREDIT, BigDecimal.ZERO));
+   * obcPayment.add(Restrictions.ne(FIN_Payment.PROPERTY_USEDCREDIT, BigDecimal.ZERO));
+   * obcPayment.addOrderBy(FIN_Payment.PROPERTY_PAYMENTDATE, false);
+   * obcPayment.addOrderBy(FIN_Payment.PROPERTY_DOCUMENTNO, false); return obcPayment.list();
+   * 
+   * final OBCriteria<RoleOrganization> roleOrgs = OBDal.getInstance().createCriteria(
+   * RoleOrganization.class); roleOrgs.add(Restrictions.eq(RoleOrganization.PROPERTY_ROLE, role));
+   * roleOrgs.add(Restrictions.eq(RoleOrganization.PROPERTY_ORGADMIN, true));
+   * 
+   * OBCriteria<ModuleInstall> qModInstall = OBDal.getInstance().createCriteria(
+   * ModuleInstall.class);
+   */
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/dal/DalPerformanceExampleTest.java	Mon Jun 25 19:58:29 2012 +0200
@@ -0,0 +1,279 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * 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 
+ * 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) 2012 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.dal;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.hibernate.Query;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
+import org.hibernate.collection.PersistentBag;
+import org.hibernate.proxy.HibernateProxy;
+import org.junit.Assert;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
+import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.businesspartner.Category;
+import org.openbravo.model.common.order.Order;
+import org.openbravo.model.common.order.OrderLine;
+import org.openbravo.model.common.plm.Product;
+import org.openbravo.test.base.BaseTest;
+
+/**
+ * Contains examples used to explain Data Access Layer performance.
+ * 
+ * http://wiki.openbravo.com/wiki/Data_Access_Layer_Performance
+ * 
+ * @author mtaal
+ */
+
+public class DalPerformanceExampleTest extends BaseTest {
+
+  /**
+   * Simple query for all products.
+   */
+  public void testSimpleQuery() {
+    setTestUserContext();
+
+    final OBCriteria<Product> productCriteria = OBDal.getInstance().createCriteria(Product.class);
+    for (Product product : productCriteria.list()) {
+      System.err.println(product.getId());
+    }
+
+    final OBQuery<Product> productQuery = OBDal.getInstance().createQuery(Product.class, "");
+    for (Product product : productQuery.list()) {
+      System.err.println(product.getId());
+    }
+  }
+
+  /**
+   * Scrollable results
+   */
+  public void testSimpleScrollQuery() {
+    setTestUserContext();
+
+    final OBCriteria<Product> productCriteria = OBDal.getInstance().createCriteria(Product.class);
+    // 1000 is normally a good fetch size
+    productCriteria.setFetchSize(1000);
+    final ScrollableResults productScroller1 = productCriteria.scroll(ScrollMode.FORWARD_ONLY);
+    int i = 0;
+    while (productScroller1.next()) {
+      final Product product = (Product) productScroller1.get()[0];
+      System.err.println(product.getId());
+      // clear the session every 100 records
+      if ((i % 100) == 0) {
+        OBDal.getInstance().getSession().clear();
+      }
+      i++;
+    }
+
+    i = 0;
+    final OBQuery<Product> productQuery = OBDal.getInstance().createQuery(Product.class, "");
+    // 1000 is normally a good fetch size
+    productQuery.setFetchSize(1000);
+    final ScrollableResults productScroller2 = productQuery.scroll(ScrollMode.FORWARD_ONLY);
+    while (productScroller2.next()) {
+      final Product product = (Product) productScroller2.get()[0];
+      System.err.println(product.getId());
+      // clear the session every 100 records
+      if ((i % 100) == 0) {
+        OBDal.getInstance().getSession().clear();
+      }
+      i++;
+    }
+  }
+
+  /**
+   * Scrollable results
+   */
+  public void testInsertBPs() {
+    setTestUserContext();
+    final int cnt = 100;
+    final String[] names = new String[cnt];
+    for (int i = 0; i < cnt; i++) {
+      names[i] = UUID.randomUUID().toString();
+    }
+    int i = 0;
+    for (String name : names) {
+      BusinessPartner bp = OBProvider.getInstance().get(BusinessPartner.class);
+
+      bp.setName(name);
+      bp.setSearchKey(name);
+
+      final Category category = (Category) OBDal.getInstance().getProxy(Category.ENTITY_NAME,
+          TEST_BP_CATEGORY_ID);
+      bp.setBusinessPartnerCategory(category);
+      OBDal.getInstance().save(bp);
+      if ((i % 100) == 0) {
+        OBDal.getInstance().flush();
+        OBDal.getInstance().getSession().clear();
+        System.err.println(i);
+      }
+      i++;
+    }
+    OBDal.getInstance().commitAndClose();
+  }
+
+  /**
+   * Proxy
+   */
+  public void testShowProxy() {
+    setTestUserContext();
+
+    final OBQuery<BusinessPartner> bpQuery = OBDal.getInstance().createQuery(BusinessPartner.class,
+        "");
+    bpQuery.setMaxResult(1);
+    // read one business partner
+    final BusinessPartner bp = bpQuery.list().get(0);
+    final Category category = bp.getBusinessPartnerCategory();
+
+    // this category is an uninitialized proxy
+    Assert.assertTrue(category instanceof HibernateProxy);
+    Assert.assertTrue(((HibernateProxy) category).getHibernateLazyInitializer().isUninitialized());
+
+    // get the id and entityname in a way which does not load the object
+    final Object id = DalUtil.getId(category);
+    final String entityName = DalUtil.getEntityName(category);
+
+    // still unloaded
+    Assert.assertTrue(((HibernateProxy) category).getHibernateLazyInitializer().isUninitialized());
+
+    // now call a method directly on the object
+    final Object id2 = category.getId();
+
+    // now it is loaded!
+    Assert.assertFalse(((HibernateProxy) category).getHibernateLazyInitializer().isUninitialized());
+
+    // and the id's are the same ofcourse
+    Assert.assertEquals(id, id2);
+  }
+
+  /**
+   * Show object graph loading
+   */
+  public void testShowObjectGraph() {
+    setTestUserContext();
+
+    final OBQuery<BusinessPartner> bpQuery = OBDal.getInstance().createQuery(BusinessPartner.class,
+        "");
+    bpQuery.setMaxResult(1);
+    // read one business partner
+    final BusinessPartner bp = bpQuery.list().get(0);
+    final Category category = bp.getBusinessPartnerCategory();
+
+    // now load the category directly
+    final OBQuery<Category> categoryQuery = OBDal.getInstance().createQuery(Category.class,
+        "id=:id");
+    categoryQuery.setFilterOnActive(false);
+    categoryQuery.setFilterOnReadableClients(false);
+    categoryQuery.setFilterOnReadableOrganization(false);
+    categoryQuery.setNamedParameter("id", category.getId());
+    final Category category2 = categoryQuery.list().get(0);
+
+    // category2 and category are the same object:
+    Assert.assertTrue(category == category2);
+  }
+
+  /**
+   * Show collection loading
+   */
+  public void testShowCollectionLoading() {
+    setTestUserContext();
+
+    final OBQuery<Order> orderQuery = OBDal.getInstance().createQuery(Order.class, "");
+    orderQuery.setMaxResult(1);
+    Order order = orderQuery.uniqueResult();
+    final List<OrderLine> orderLineList = order.getOrderLineList();
+
+    // is a hibernate special thing
+    Assert.assertTrue(orderLineList instanceof PersistentBag);
+
+    // this will load the list, all OrderLines are loaded in Memory
+    System.err.println(orderLineList.size());
+  }
+
+  /**
+   * Show explicit joining of referenced objects
+   */
+  public void testJoinReferencedObjects() {
+    setTestUserContext();
+    {
+      int i = 0;
+      final OBQuery<BusinessPartner> bpQuery = OBDal.getInstance().createQuery(
+          BusinessPartner.class, "");
+      bpQuery.setMaxResult(1000);
+      final ScrollableResults scroller = bpQuery.scroll(ScrollMode.FORWARD_ONLY);
+      while (scroller.next()) {
+        final BusinessPartner bp = (BusinessPartner) scroller.get()[0];
+
+        // this will load the category object with a separate query
+        System.err.println(bp.getBusinessPartnerCategory().getIdentifier());
+
+        // clear the session every 100 records
+        if ((i % 10) == 0) {
+          OBDal.getInstance().getSession().clear();
+        }
+        i++;
+      }
+    }
+
+    // start with an empty session
+    OBDal.getInstance().getSession().clear();
+
+    {
+      int i = 0;
+      // for joining referenced objects we can't use OBQuery, but have to
+      // use a direct Hibernate query object
+      final String queryStr = "from BusinessPartner as bp left join bp.businessPartnerCategory where bp.organization.id "
+          + OBDal.getInstance().getReadableOrganizationsInClause();
+
+      final Query qry = OBDal.getInstance().getSession().createQuery(queryStr);
+      qry.setMaxResults(1000);
+      final ScrollableResults scroller = qry.scroll(ScrollMode.FORWARD_ONLY);
+      while (scroller.next()) {
+        final BusinessPartner bp = (BusinessPartner) scroller.get()[0];
+
+        // the category is already loaded, so this won't fire a query
+        System.err.println(bp.getBusinessPartnerCategory().getIdentifier());
+
+        // clear the session every 100 records
+        if ((i % 100) == 0) {
+          OBDal.getInstance().getSession().clear();
+        }
+        i++;
+      }
+    }
+  }
+
+  /**
+   * DML Style operations
+   */
+  public void testDML() {
+    // for example add an a to all categories
+    String hqlVersionedUpdate = "update BusinessPartnerCategory set name = CONCAT(name, 'a') where name <> null";
+    int updatedEntities = OBDal.getInstance().getSession().createQuery(hqlVersionedUpdate)
+        .executeUpdate();
+    System.err.println(updatedEntities);
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/dal/DalPerformanceProxyTest.java	Mon Jun 25 19:58:29 2012 +0200
@@ -0,0 +1,146 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * 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 
+ * 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) 2012 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.dal;
+
+import java.util.Date;
+import java.util.UUID;
+
+import org.hibernate.StatelessSession;
+import org.hibernate.proxy.HibernateProxy;
+import org.junit.Assert;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.session.SessionFactoryController;
+import org.openbravo.base.structure.BaseOBObject;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.ad.access.User;
+import org.openbravo.model.ad.system.Client;
+import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.businesspartner.Category;
+import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.test.base.BaseTest;
+
+/**
+ * Test case to try and test proxy loading or stateless sessions.
+ * 
+ * @author mtaal
+ */
+
+public class DalPerformanceProxyTest extends BaseTest {
+
+  private static final int CNT = 10;
+
+  public void testProxyBPCreate() {
+    try {
+      setTestAdminContext();
+
+      OBDal.getInstance().commitAndClose();
+
+      for (int i = 0; i < CNT; i++) {
+        BusinessPartner bp = OBProvider.getInstance().get(BusinessPartner.class);
+
+        // Generating random strings for testing
+        UUID name = UUID.randomUUID();
+        UUID key = UUID.randomUUID();
+
+        bp.setName(name.toString());
+        bp.setSearchKey(key.toString());
+
+        final Category category = (Category) OBDal.getInstance().getProxy(Category.ENTITY_NAME,
+            TEST_BP_CATEGORY_ID);
+        bp.setBusinessPartnerCategory(category);
+
+        // should not be initialized
+        // only check the first time as after the first loop
+        // the category is loaded because of the refresh below.
+        if (i == 0) {
+          Assert.assertTrue(((HibernateProxy) category).getHibernateLazyInitializer()
+              .isUninitialized());
+        } else {
+          Assert.assertFalse(((HibernateProxy) category).getHibernateLazyInitializer()
+              .isUninitialized());
+        }
+
+        OBDal.getInstance().save(bp);
+        if ((i % 100) == 0) {
+          OBDal.getInstance().flush();
+          System.err.println(i);
+          // this all works
+          // note: this loads the category proxy
+          OBDal.getInstance().refresh(bp);
+          Assert.assertTrue(bp.getId() != null);
+
+          // check that if really loading that still the proxy object is returned
+          Assert.assertTrue(category == OBDal.getInstance().get(Category.ENTITY_NAME,
+              TEST_BP_CATEGORY_ID));
+        }
+      }
+      OBDal.getInstance().commitAndClose();
+    } catch (Exception e) {
+      throw new OBException(e);
+    }
+  }
+
+  public void testStatelessBPCreate() {
+    try {
+      setTestAdminContext();
+
+      final StatelessSession session = SessionFactoryController.getInstance().getSessionFactory()
+          .openStatelessSession();
+      session.beginTransaction();
+      for (int i = 0; i < CNT; i++) {
+        BusinessPartner bp = OBProvider.getInstance().get(BusinessPartner.class);
+
+        // Generating random strings for testing
+        UUID name = UUID.randomUUID();
+        UUID key = UUID.randomUUID();
+
+        bp.setName(name.toString());
+        bp.setSearchKey(key.toString());
+
+        bp.setBusinessPartnerCategory(createReferencedObject(Category.class, TEST_BP_CATEGORY_ID));
+
+        // note the following things are currently done in the OBInterceptor
+        // it is quite easy to add a util method which can do this in a generic
+        // way for any business object
+        bp.setOrganization(createReferencedObject(Organization.class, TEST_ORG_ID));
+        bp.setClient(createReferencedObject(Client.class, TEST_CLIENT_ID));
+        bp.setCreatedBy(createReferencedObject(User.class, "100"));
+        bp.setCreationDate(new Date());
+        bp.setUpdatedBy(createReferencedObject(User.class, "100"));
+        bp.setUpdated(new Date());
+
+        session.insert(BusinessPartner.ENTITY_NAME, bp);
+        // session.refresh(BusinessPartner.ENTITY_NAME, bp);
+        Assert.assertTrue(bp.getId() != null);
+      }
+      session.getTransaction().commit();
+    } catch (Exception e) {
+      throw new OBException(e);
+    }
+  }
+
+  public <T extends BaseOBObject> T createReferencedObject(Class<T> clz, String id) {
+    final T instance = OBProvider.getInstance().get(clz);
+    instance.setId(id);
+    return instance;
+  }
+
+}
\ No newline at end of file
--- a/src-test/org/openbravo/test/dal/IssuesTest.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-test/org/openbravo/test/dal/IssuesTest.java	Mon Jun 25 19:58:29 2012 +0200
@@ -35,10 +35,13 @@
 import org.dom4j.io.SAXReader;
 import org.hibernate.Query;
 import org.hibernate.SQLQuery;
+import org.hibernate.ScrollMode;
+import org.hibernate.ScrollableResults;
 import org.hibernate.Session;
 import org.hibernate.criterion.Restrictions;
 import org.hibernate.dialect.function.StandardSQLFunction;
 import org.hibernate.type.StandardBasicTypes;
+import org.junit.Assert;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Reference;
 import org.openbravo.base.model.domaintype.LongDomainType;
@@ -65,6 +68,7 @@
 import org.openbravo.model.ad.ui.Form;
 import org.openbravo.model.ad.ui.FormTrl;
 import org.openbravo.model.ad.ui.Message;
+import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.businesspartner.Category;
 import org.openbravo.model.common.businesspartner.Location;
 import org.openbravo.model.common.enterprise.Organization;
@@ -132,6 +136,8 @@
  * 
  * https://issues.openbravo.com/view.php?id=18688: Ability to call database functions from HQL query
  * 
+ * https://issues.openbravo.com/view.php?id=20611: OBCriteria doesn't support ScrollabeResults
+ * 
  * @author mtaal
  * @author iperdomo
  */
@@ -718,4 +724,25 @@
     assertFalse(writableOrganizations2.isEmpty());
   }
 
+  public void test20611() {
+    OBCriteria<BusinessPartner> c = OBDal.getInstance().createCriteria(BusinessPartner.class);
+    ScrollableResults iterator = c.scroll(ScrollMode.FORWARD_ONLY);
+    Assert.assertTrue(iterator.next());
+  }
+
+  /**
+   * Testing issue 0020659. Tests that if an invalid organization id is provided, getChildOrg
+   * returns an empty set instead of null.
+   */
+  public void test20659() {
+    setTestAdminContext();
+    String nonExistentOrg = "-123ZXY";
+
+    final String clientId = OBContext.getOBContext().getCurrentClient().getId();
+    final OrganizationStructureProvider osp = OBContext.getOBContext()
+        .getOrganizationStructureProvider(clientId);
+    final Set<String> childOrg = osp.getChildOrg(nonExistentOrg);
+    assertTrue(childOrg.isEmpty());
+  }
+
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADPassword.java	Mon Jun 25 19:58:29 2012 +0200
@@ -0,0 +1,32 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * 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 
+ * 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) 2012 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.wad.controls;
+
+/**
+ * Provides UI support for new 3.0 password reference fields. To be used within process parameter
+ * windows. It does not encrypt password when sending it to the process.
+ * 
+ * @author asier
+ * 
+ */
+public class WADPassword extends WADString {
+  public WADPassword() {
+    type = "password";
+  }
+}
--- a/src-wad/src/org/openbravo/wad/controls/WADString.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADString.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,7 +11,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-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -27,6 +27,7 @@
 
 public class WADString extends WADControl {
   private WADControl button;
+  protected String type = "text";
 
   public WADString() {
   }
@@ -94,6 +95,7 @@
     } else {
       xmlDocument = getReportEngine().readXmlTemplate("org/openbravo/wad/controls/WADString",
           discard).createXmlDocument();
+      xmlDocument.setParameter("type", type);
     }
 
     xmlDocument.setParameter("columnName", getData("ColumnName"));
--- a/src-wad/src/org/openbravo/wad/controls/WADString.xml	Thu Jun 21 04:45:38 2012 +0000
+++ b/src-wad/src/org/openbravo/wad/controls/WADString.xml	Mon Jun 25 19:58:29 2012 +0200
@@ -12,7 +12,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-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -33,6 +33,7 @@
   <PARAMETER id="xx" name="required" attribute="required"/>
   <PARAMETER id="xx" name="requiredClass" attribute="class" replace="xx"/>
   <PARAMETER id="xx" name="callout" attribute="onchange" replace="xx();"/>
+  <PARAMETER id="xx" name="type" attribute="type" default="text"/>
   <PARAMETER id="xxmissingSpan" name="columnName" attribute="id" replace="xx"/>
   <PARAMETER id="xxmissingSpanText" name="columnName" attribute="id" replace="xx"/>
 
--- a/src/index.jsp	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/index.jsp	Mon Jun 25 19:58:29 2012 +0200
@@ -4,6 +4,7 @@
 <%@ page import="org.openbravo.base.util.OBClassLoader" %>
 <%@ page import="org.openbravo.authentication.AuthenticationManager" %>
 <%@ page import="org.openbravo.client.kernel.KernelUtils" %>
+<%@ page import="org.openbravo.client.kernel.KernelConstants" %>
 <%@ page import="org.openbravo.dal.core.OBContext" %>
 <%@ page import="org.openbravo.model.ad.module.Module" %>
 <%@ page import="org.apache.log4j.Logger" %>
@@ -30,15 +31,10 @@
 
 Logger log = Logger.getLogger(org.openbravo.authentication.AuthenticationManager.class); 
 
-HttpBaseServlet s = new HttpBaseServlet(); // required for ConnectionProvider
-s.init(getServletConfig());
-s.initialize(request, response);
-
-AuthenticationManager authManager = AuthenticationManager.getAuthenticationManager(s);
-    
-authManager.init(s);
+AuthenticationManager authManager = AuthenticationManager.getAuthenticationManager(this);
 
 String userId = authManager.authenticate(request, response);
+
 if(userId == null){
   return;
 }
@@ -91,7 +87,7 @@
 <meta name="keywords" content="openbravo">
 <meta name="description" content="Openbravo S.L.U.">
 <link rel="shortcut icon" href="./web/images/favicon.ico" />
-<link rel="stylesheet" type="text/css" href="./org.openbravo.client.kernel/OBCLKER_Kernel/StyleSheetResources?_mode=3.00&_skinVersion=Default&_cssDataUri=<%=(!isMSIE || (isMSIE && verMSIE >=8))%>"/>
+<link rel="stylesheet" type="text/css" href="./org.openbravo.client.kernel/OBCLKER_Kernel/StyleSheetResources?_appName=OB3&_skinVersion=Default&_cssDataUri=<%=(!isMSIE || (isMSIE && verMSIE >=8))%>"/>
 
 <title>Openbravo</title>
 <script src="./web/org.openbravo.client.kernel/js/scopeleaks.min.js"></script>
@@ -150,6 +146,14 @@
 </div>
 <!-- load the rest -->
 <script>
+// Bootstrap error handling: Shows an alert to the user when an error occurs loading static resources
+// This error handler gets removed at the end of static resources
+window.onerror = function <%=KernelConstants.BOOTSTRAP_ERROR_HANDLER_NAME%> (errorMsg, url, lineNumber) {
+  var msg = errorMsg + ' - ' + url + ':' + lineNumber;
+  document.body.removeChild(document.getElementById('OBLoadingDiv'));
+  alert(msg);
+};
+
 $LAB.setGlobalDefaults({AppendTo: 'body'});
 
 var isomorphicDir='./web/org.openbravo.userinterface.smartclient/isomorphic/';
@@ -177,7 +181,7 @@
 </script>
 <script src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined<%=(uncompSC ? ".uncompressed" : "")%>.js"></script>
 <script src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History<%=(uncompSC ? ".uncompressed" : "")%>.js"></script>
-<script src="./org.openbravo.client.kernel/OBCLKER_Kernel/StaticResources?_mode=3.00&_skinVersion=Default"></script>
+<script src="./org.openbravo.client.kernel/OBCLKER_Kernel/StaticResources?_appName=OB3&_skinVersion=Default"></script>
 <iframe name="background_target" id="background_target" height="0" width="0" style="display:none;"></iframe>
 <form name="OBGlobalHiddenForm" method="post" action="blank.html" target="background_target">
 </form>
--- a/src/org/openbravo/authentication/AuthenticationManager.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/authentication/AuthenticationManager.java	Mon Jun 25 19:58:29 2012 +0200
@@ -82,6 +82,7 @@
       log4j
           .error("Defined authentication manager cannot be loaded. Verify the 'authentication.class' entry in Openbravo.properties");
       authManager = new DefaultAuthenticationManager(s);
+      authManager.init(s);
     }
     return authManager;
   }
@@ -144,8 +145,15 @@
       setDBSession(request, userId, SUCCESS_SESSION_STANDARD, true);
     }
 
+    // A restricted resource can define a custom login URL
+    // It just need to set an the attribute loginURL in the request
+    final String customLoginURL = (String) request.getAttribute("loginURL");
+
+    final String loginURL = localAdress
+        + (customLoginURL == null || "".equals(customLoginURL) ? defaultServletUrl : customLoginURL);
+
     if (userId == null && !response.isCommitted()) {
-      response.sendRedirect(localAdress + defaultServletUrl);
+      response.sendRedirect(loginURL);
       return null;
     }
 
--- a/src/org/openbravo/base/model/domaintype/BaseForeignKeyDomainType.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/base/model/domaintype/BaseForeignKeyDomainType.java	Mon Jun 25 19:58:29 2012 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.base.model.domaintype;
 
+import java.lang.reflect.Field;
+
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.BaseOBObjectDef;
 import org.openbravo.base.model.Column;
@@ -123,8 +125,14 @@
     }
 
     final BaseOBObjectDef obObject = (BaseOBObjectDef) value;
+
     // note object equalness is required!
-    if (getReferedEntity(property) != null && obObject.getEntity() != getReferedEntity(property)) {
+    // use a special way to get the entity name
+    // to prevent proxy loading
+    final String entityName = getEntityName(obObject);
+    final Entity entity = ModelProvider.getInstance().getEntity(entityName);
+
+    if (getReferedEntity(property) != null && entity != getReferedEntity(property)) {
       final ValidationException ve = new ValidationException();
       ve.addMessage(property,
           "Property " + property + " only allows entity: " + getReferedEntity(property)
@@ -134,6 +142,22 @@
     return;
   }
 
+  // Note can't use DalUtil.getEntityName as then we get compile time
+  // dependencies on generated classes.
+  private String getEntityName(BaseOBObjectDef o) {
+    if (o instanceof org.hibernate.proxy.HibernateProxy) {
+      try {
+        final Class<?> clz = ((org.hibernate.proxy.HibernateProxy) o).getHibernateLazyInitializer()
+            .getPersistentClass();
+        final Field fld = clz.getField("ENTITY_NAME");
+        return (String) fld.get(null);
+      } catch (final Exception e) {
+        throw new OBException(e);
+      }
+    }
+    return o.getEntity().getName();
+  }
+
   /**
    * Returns the entity refered to by this foreign key domain type. Note that for TableDir domain
    * types this method always returns null.
--- a/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java	Mon Jun 25 19:58:29 2012 +0200
@@ -38,6 +38,7 @@
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.order.Order;
@@ -193,6 +194,12 @@
           parameters.add("Y");
 
           taxId = (String) CallStoredProcedure.getInstance().call("C_Gettax", parameters, null);
+          if (taxId == null || "".equals(taxId)) {
+            Map<String, String> errorParameters = new HashMap<String, String>();
+            errorParameters.put("product", product.getName());
+            String message = OBMessageUtils.messageBD("NoTaxFoundForProduct");
+            throw new OBException(OBMessageUtils.parseTranslation(message, errorParameters));
+          }
         }
         TaxRate tax = OBDal.getInstance().get(TaxRate.class, taxId);
 
@@ -252,12 +259,14 @@
         if (isDefultPriceList) {
           throw new OBException("NoDefaultPriceList");
         } else {
-          // If pl was the Business Partner's price list, there was no fit price list for it so take
+          // If pl was the Business Partner's price list, there was no fit price list for it so
+          // take
           // the default price list.
-          pl = getDefaultPriceList(o.getClient().getId(), o.getOrganization().getId(), isSalesPL);
-          earliestPlv = getEarliestPriceListVersion(pl, orderDate);
-          // There is no fit price list version.
-          if (earliestPlv == null) {
+          try {
+            pl = getDefaultPriceList(o.getClient().getId(), o.getOrganization().getId(), isSalesPL);
+            earliestPlv = getEarliestPriceListVersion(pl, orderDate);
+          } catch (Exception e) {
+            // There is no fit price list version.
             throw new OBException("NoDefaultPriceList");
           }
         }
@@ -270,19 +279,20 @@
         } else if (prices != null) {
           return prices;
         } else {
-          pl = getDefaultPriceList(o.getClient().getId(), o.getOrganization().getId(), isSalesPL);
-          earliestPlv = getEarliestPriceListVersion(pl, orderDate);
-          if (earliestPlv == null) {
+          try {
+            pl = getDefaultPriceList(o.getClient().getId(), o.getOrganization().getId(), isSalesPL);
+            earliestPlv = getEarliestPriceListVersion(pl, orderDate);
+          } catch (Exception e) {
             throw new OBException("NoDefaultPriceList");
+          }
+          prices = getProductPricesFromPLV(strProductId, earliestPlv);
+          if (prices == null) {
+            throw new OBException("NoProductInDefaultPriceList");
           } else {
-            prices = getProductPricesFromPLV(strProductId, earliestPlv);
-            if (prices == null) {
-              throw new OBException("NoProductInDefaultPriceList");
-            } else {
-              return prices;
-            }
+            return prices;
           }
         }
+
       }
       return null;
     } finally {
--- a/src/org/openbravo/dal/core/TriggerHandler.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/dal/core/TriggerHandler.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,7 +11,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) 2008-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -19,6 +19,10 @@
 
 package org.openbravo.dal.core;
 
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
 import org.apache.log4j.Logger;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.util.Check;
@@ -74,6 +78,41 @@
     }
   }
 
+  public void disableSql() {
+    Connection con = OBDal.getInstance().getConnection();
+    PreparedStatement ps = null;
+    try {
+      ps = con
+          .prepareStatement("INSERT INTO AD_SESSION_STATUS VALUES (get_uuid(), '0', '0', 'Y', now(), '0', now(), '0', 'Y')");
+      ps.executeUpdate();
+    } catch (Exception e) {
+      log.error("Couldn't disable triggers: ", e);
+    } finally {
+      try {
+        ps.close();
+      } catch (SQLException e) {
+      }
+    }
+
+  }
+
+  public void enableSql() {
+    Connection con = OBDal.getInstance().getConnection();
+    PreparedStatement ps = null;
+    try {
+      ps = con.prepareStatement("DELETE FROM AD_SESSION_STATUS");
+      ps.executeUpdate();
+    } catch (Exception e) {
+      log.error("Couldn't enable triggers: ", e);
+    } finally {
+      try {
+        ps.close();
+      } catch (SQLException e) {
+      }
+    }
+
+  }
+
   /**
    * @return true if the database triggers are disabled, false in other cases.
    */
--- a/src/org/openbravo/dal/security/OrganizationStructureProvider.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/dal/security/OrganizationStructureProvider.java	Mon Jun 25 19:58:29 2012 +0200
@@ -268,7 +268,11 @@
     if (childByOrganizationID.get(orgId) == null) {
       reInitialize();
     }
-    return new HashSet<String>(childByOrganizationID.get(orgId));
+    if (childByOrganizationID.get(orgId) == null) {
+      return new HashSet<String>();
+    } else {
+      return new HashSet<String>(childByOrganizationID.get(orgId));
+    }
   }
 
   class OrgNode {
--- a/src/org/openbravo/dal/service/OBCriteria.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/dal/service/OBCriteria.java	Mon Jun 25 19:58:29 2012 +0200
@@ -29,7 +29,6 @@
 import org.hibernate.HibernateException;
 import org.hibernate.ScrollMode;
 import org.hibernate.ScrollableResults;
-import org.hibernate.criterion.CriteriaSpecification;
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
@@ -159,7 +158,7 @@
       if (orderOn.indexOf(".") != -1) {
         final String orderJoin = orderOn.substring(0, orderOn.lastIndexOf("."));
         final String alias = "order_ob_" + j;
-        createCriteria(orderJoin, alias, CriteriaSpecification.LEFT_JOIN);
+        createAlias(orderJoin, alias);
         orderOn = alias + "." + orderOn.substring(orderOn.lastIndexOf(".") + 1);
       }
 
--- a/src/org/openbravo/dal/service/OBDal.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/dal/service/OBDal.java	Mon Jun 25 19:58:29 2012 +0200
@@ -19,6 +19,7 @@
 
 package org.openbravo.dal.service;
 
+import java.io.Serializable;
 import java.sql.Connection;
 import java.util.ArrayList;
 import java.util.List;
@@ -302,6 +303,26 @@
   }
 
   /**
+   * Will return a non-loaded hibernate proxy if the object was not already loaded by hibernate.
+   * 
+   * NOTE/BEWARE: this method will not check if the object actually exists in the database. This
+   * will detected when persisting a referencing object or when this proxy gets initialized!
+   * 
+   * This method differs from other get methods in this class, these methods will always eagerly
+   * load the object and thereby also immediately check the existence of these referenced objects.
+   * 
+   * @param entityName
+   *          the type of object to search for
+   * @param id
+   *          the id of the object
+   * @return the object, or null if none found
+   */
+  public BaseOBObject getProxy(String entityName, Object id) {
+    return (BaseOBObject) ((SessionImplementor) getSession()).internalLoad(entityName,
+        (Serializable) id, false, false);
+  }
+
+  /**
    * Create a OBQuery object using a class and a specific where and order by clause.
    * 
    * @param fromClz
@@ -380,8 +401,9 @@
    */
   public <T extends BaseOBObject> OBCriteria<T> createCriteria(Class<T> clz) {
     checkReadAccess(clz);
-    final OBCriteria<T> obCriteria = new OBCriteria<T>(clz.getName());
-    obCriteria.setEntity(ModelProvider.getInstance().getEntity(clz));
+    final Entity entity = ModelProvider.getInstance().getEntity(clz);
+    final OBCriteria<T> obCriteria = new OBCriteria<T>(entity.getName());
+    obCriteria.setEntity(entity);
     return obCriteria;
   }
 
@@ -396,8 +418,9 @@
    */
   public <T extends BaseOBObject> OBCriteria<T> createCriteria(Class<T> clz, String alias) {
     checkReadAccess(clz);
-    final OBCriteria<T> obCriteria = new OBCriteria<T>(clz.getName(), alias);
-    obCriteria.setEntity(ModelProvider.getInstance().getEntity(clz));
+    final Entity entity = ModelProvider.getInstance().getEntity(clz);
+    final OBCriteria<T> obCriteria = new OBCriteria<T>(entity.getName(), alias);
+    obCriteria.setEntity(entity);
     return obCriteria;
   }
 
--- a/src/org/openbravo/dal/service/OBQuery.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/dal/service/OBQuery.java	Mon Jun 25 19:58:29 2012 +0200
@@ -69,6 +69,7 @@
   private boolean filterOnActive = true;
   private int firstResult = -1;
   private int maxResult = -1;
+  private int fetchSize = -1;
 
   // package visible
   OBQuery() {
@@ -226,6 +227,9 @@
     try {
       final Query qry = getSession().createQuery(qryStr);
       setParameters(qry);
+      if (fetchSize > -1) {
+        qry.setFetchSize(fetchSize);
+      }
       if (firstResult > -1) {
         qry.setFirstResult(firstResult);
       }
@@ -606,4 +610,12 @@
   public void setMaxResult(int maxResult) {
     this.maxResult = maxResult;
   }
+
+  public int getFetchSize() {
+    return fetchSize;
+  }
+
+  public void setFetchSize(int fetchSize) {
+    this.fetchSize = fetchSize;
+  }
 }
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Thu Jun 21 04:45:38 2012 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Mon Jun 25 19:58:29 2012 +0200
@@ -11,9 +11,9 @@
  * 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 portions are Copyright (C) 2001-2012 Openbravo SLU
  * All Rights Reserved.
- * Contributor(s):  ______________________________________.
+ * Contributor(s):  Cheli Pineda__________________________.
  ************************************************************************
  */
 package org.openbravo.erpCommon.ad_actionButton;
@@ -1532,14 +1532,20 @@
             BigDecimal LineNetAmt = (new BigDecimal(priceActual)).multiply(new BigDecimal(
                 data[i].id));