[Warehouse]Merge with pi revision 9ffe9a076990
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Wed, 31 Oct 2012 17:54:25 +0100
changeset 18475 6e0919c35fa7
parent 18474 99d5ebf99228 (current diff)
parent 18388 e28f59d8ece5 (diff)
child 18476 d61bef9a7c79
[Warehouse]Merge with pi revision 9ffe9a076990
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_DATASET_TABLE.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MENU.xml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/AD_TREENODE.xml
src-db/database/sourcedata/AD_WINDOW.xml
--- a/.hgsigs	Thu Oct 25 18:06:48 2012 +0200
+++ b/.hgsigs	Wed Oct 31 17:54:25 2012 +0100
@@ -81,6 +81,7 @@
 6476bb0e9da298f7adb7759265f784d9eb28884d 0 iEYEABECAAYFAlBkPuAACgkQCX/oGf+2qkMUxgCgglb7oUz6aO/2IC55x7u2xRy65HoAnj83lJHvsqrlllOquMxoLJ2UkTkO
 3ef42df4953f5813543c5d1cb2b323d13c8c0359 0 iEYEABECAAYFAlA/cv4ACgkQCX/oGf+2qkMT3gCgjbewzyw3X/1MOZjn6V5P3HqrQtoAoPdsUsBzwVelyg7jpbUhhzGW5Vbz
 d221450bb4d5334f101e6d0fe5d2e941bb714f0a 0 iEYEABECAAYFAlBqvAsACgkQCX/oGf+2qkNIogCfTU6AVwlfmEH2DZUjGkiE1zzo25MAoOkIN46+PHwWKslqp5lxFShVzVTd
+18d1c926f607a207a86f39f4cb0477d7abaea231 0 iEYEABECAAYFAlCITCEACgkQCX/oGf+2qkMxggCg0SsDTC/8I/S7f7HTRlKS8ZtABzwAoOiVWjBJkbhwi7ZxJDEVQA1E/6aH
 7643bde3a4855fc35ddf7269a221ba0e77863a75 0 iEYEABECAAYFAlBgQyAACgkQCX/oGf+2qkNE2ACfb7Xzd4dq5VTeUnFo9VSsPqoQHtsAn063Puz1dhXpBsvhgkpbDV7fXiR6
 2680cddd9aca96f87a83156d3ca27935a692dfb3 0 iEYEABECAAYFAlBsebEACgkQCX/oGf+2qkMexACdFPyyCM6bMSTiXilJF9M61iXNBQ4AnAwzonIXgFkr4tyY1WHa+PGw3caA
 aee16f41346874b9e355af6007df8df57b7f0266 0 iEYEABECAAYFAlBut3kACgkQCX/oGf+2qkPE8gCaAyk5dQSNyoOSpzPeOEtOLBhrF0MAn3XWPPVJ1Pb7vCei3oE3aQ8Ctj9o
--- a/.hgtags	Thu Oct 25 18:06:48 2012 +0200
+++ b/.hgtags	Wed Oct 31 17:54:25 2012 +0100
@@ -92,6 +92,7 @@
 141c70bce6606bca6bf2b8422b9c27fbf19e7ede 3.0MP13.2
 35168ddf12d33e94aeb18d2c79c6d9255a26c742 3.0MP14
 6861c9689350eae52de16fad01f78b37f5164c9e 3.0MP14.1
+91fb79467af4f71728e776b69dd1092dab8b2b5f 3.0MP14.2
 bf2e6628cebd62b56796fe8433c35378d516e375 3.0MP15
 fa0e90f7e9eed2e99536b6c372a15a2448c03d06 3.0MP15.1
 1cd80d4b32bbafca742ca1406fee082f97f5f254 3.0MP16
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -1342,8 +1342,8 @@
 <!--3F41C500ECEB40D09089FEA4C3793F29-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--3F41C500ECEB40D09089FEA4C3793F29-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3F41C500ECEB40D09089FEA4C3793F29-->  <NAME><![CDATA[Accounting Schema]]></NAME>
-<!--3F41C500ECEB40D09089FEA4C3793F29-->  <DESCRIPTION><![CDATA[The structure used in accounting including costing methods, currencies, and the calendar.]]></DESCRIPTION>
-<!--3F41C500ECEB40D09089FEA4C3793F29-->  <HELP><![CDATA[An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar]]></HELP>
+<!--3F41C500ECEB40D09089FEA4C3793F29-->  <DESCRIPTION><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></DESCRIPTION>
+<!--3F41C500ECEB40D09089FEA4C3793F29-->  <HELP><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></HELP>
 <!--3F41C500ECEB40D09089FEA4C3793F29-->  <COLUMNNAME><![CDATA[C_Acctschema_ID]]></COLUMNNAME>
 <!--3F41C500ECEB40D09089FEA4C3793F29-->  <AD_TABLE_ID><![CDATA[FF80808130BB89090130BB8E3D7E0012]]></AD_TABLE_ID>
 <!--3F41C500ECEB40D09089FEA4C3793F29-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
@@ -4926,8 +4926,8 @@
 <!--96221416E24540059B9BEFEC5F09D3FF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--96221416E24540059B9BEFEC5F09D3FF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--96221416E24540059B9BEFEC5F09D3FF-->  <NAME><![CDATA[Accounting Schema]]></NAME>
-<!--96221416E24540059B9BEFEC5F09D3FF-->  <DESCRIPTION><![CDATA[The structure used in accounting including costing methods, currencies, and the calendar.]]></DESCRIPTION>
-<!--96221416E24540059B9BEFEC5F09D3FF-->  <HELP><![CDATA[An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar]]></HELP>
+<!--96221416E24540059B9BEFEC5F09D3FF-->  <DESCRIPTION><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></DESCRIPTION>
+<!--96221416E24540059B9BEFEC5F09D3FF-->  <HELP><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></HELP>
 <!--96221416E24540059B9BEFEC5F09D3FF-->  <COLUMNNAME><![CDATA[C_Acctschema_ID]]></COLUMNNAME>
 <!--96221416E24540059B9BEFEC5F09D3FF-->  <AD_TABLE_ID><![CDATA[1BAA61D216CB4A62838AA785658EE092]]></AD_TABLE_ID>
 <!--96221416E24540059B9BEFEC5F09D3FF-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -143,9 +143,9 @@
 <!--0244498E99414EA6A709CD3D5A7951D1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--0244498E99414EA6A709CD3D5A7951D1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--0244498E99414EA6A709CD3D5A7951D1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--0244498E99414EA6A709CD3D5A7951D1-->  <NAME><![CDATA[Accounting Schema]]></NAME>
-<!--0244498E99414EA6A709CD3D5A7951D1-->  <DESCRIPTION><![CDATA[The structure used in accounting including costing methods, currencies, and the calendar.]]></DESCRIPTION>
-<!--0244498E99414EA6A709CD3D5A7951D1-->  <HELP><![CDATA[An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar]]></HELP>
+<!--0244498E99414EA6A709CD3D5A7951D1-->  <NAME><![CDATA[General Ledger]]></NAME>
+<!--0244498E99414EA6A709CD3D5A7951D1-->  <DESCRIPTION><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></DESCRIPTION>
+<!--0244498E99414EA6A709CD3D5A7951D1-->  <HELP><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></HELP>
 <!--0244498E99414EA6A709CD3D5A7951D1-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--0244498E99414EA6A709CD3D5A7951D1-->  <AD_TAB_ID><![CDATA[FF80808130BB89090130BB9A3A2B0043]]></AD_TAB_ID>
 <!--0244498E99414EA6A709CD3D5A7951D1-->  <AD_COLUMN_ID><![CDATA[3F41C500ECEB40D09089FEA4C3793F29]]></AD_COLUMN_ID>
@@ -6291,9 +6291,9 @@
 <!--804882C210C03922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--804882C210C03922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--804882C210C03922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C03922E040007F01004FC0-->  <NAME><![CDATA[Accounting Schema]]></NAME>
-<!--804882C210C03922E040007F01004FC0-->  <DESCRIPTION><![CDATA[The structure used in accounting including costing methods, currencies, and the calendar.]]></DESCRIPTION>
-<!--804882C210C03922E040007F01004FC0-->  <HELP><![CDATA[An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar]]></HELP>
+<!--804882C210C03922E040007F01004FC0-->  <NAME><![CDATA[General Ledger]]></NAME>
+<!--804882C210C03922E040007F01004FC0-->  <DESCRIPTION><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></DESCRIPTION>
+<!--804882C210C03922E040007F01004FC0-->  <HELP><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></HELP>
 <!--804882C210C03922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--804882C210C03922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
 <!--804882C210C03922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0EC1126E040007F01004F9E]]></AD_COLUMN_ID>
@@ -15150,9 +15150,9 @@
 <!--EDD729A0C5F448F0AE9749490A293571-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--EDD729A0C5F448F0AE9749490A293571-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--EDD729A0C5F448F0AE9749490A293571-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--EDD729A0C5F448F0AE9749490A293571-->  <NAME><![CDATA[Accounting Schema]]></NAME>
-<!--EDD729A0C5F448F0AE9749490A293571-->  <DESCRIPTION><![CDATA[The structure used in accounting including costing methods, currencies, and the calendar.]]></DESCRIPTION>
-<!--EDD729A0C5F448F0AE9749490A293571-->  <HELP><![CDATA[An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar]]></HELP>
+<!--EDD729A0C5F448F0AE9749490A293571-->  <NAME><![CDATA[General Ledger]]></NAME>
+<!--EDD729A0C5F448F0AE9749490A293571-->  <DESCRIPTION><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></DESCRIPTION>
+<!--EDD729A0C5F448F0AE9749490A293571-->  <HELP><![CDATA[The book containing all financial transactions recorded for the legal entity.]]></HELP>
 <!--EDD729A0C5F448F0AE9749490A293571-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--EDD729A0C5F448F0AE9749490A293571-->  <AD_TAB_ID><![CDATA[2A9BA5FDA0F8470D881F8EA9DEDCC598]]></AD_TAB_ID>
 <!--EDD729A0C5F448F0AE9749490A293571-->  <AD_COLUMN_ID><![CDATA[96221416E24540059B9BEFEC5F09D3FF]]></AD_COLUMN_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.18385]]></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>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.18385]]></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.18258]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.18385]]></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_REFERENCE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -108,6 +108,19 @@
 <!--B8C833E4F0A44A2DA5FC7606F3CD9439-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--B8C833E4F0A44A2DA5FC7606F3CD9439--></AD_REFERENCE>
 
+<!--C1B4345A1F8841C2B1ADD403CA733D75--><AD_REFERENCE>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <AD_REFERENCE_ID><![CDATA[C1B4345A1F8841C2B1ADD403CA733D75]]></AD_REFERENCE_ID>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <NAME><![CDATA[Transaction Type AddTransaction]]></NAME>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <DESCRIPTION><![CDATA[List of options for transaction type in Add Transaction popup]]></DESCRIPTION>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--C1B4345A1F8841C2B1ADD403CA733D75-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--C1B4345A1F8841C2B1ADD403CA733D75--></AD_REFERENCE>
+
 <!--DB71FC312327430EAEACF42918405BF9--><AD_REFERENCE>
 <!--DB71FC312327430EAEACF42918405BF9-->  <AD_REFERENCE_ID><![CDATA[DB71FC312327430EAEACF42918405BF9]]></AD_REFERENCE_ID>
 <!--DB71FC312327430EAEACF42918405BF9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -1,5 +1,17 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--298F4C20A76B4B30860330F188BD7AEA--><AD_REF_LIST>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <AD_REF_LIST_ID><![CDATA[298F4C20A76B4B30860330F188BD7AEA]]></AD_REF_LIST_ID>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <VALUE><![CDATA[F]]></VALUE>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <NAME><![CDATA[Fee]]></NAME>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <AD_REFERENCE_ID><![CDATA[C1B4345A1F8841C2B1ADD403CA733D75]]></AD_REFERENCE_ID>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--298F4C20A76B4B30860330F188BD7AEA-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--298F4C20A76B4B30860330F188BD7AEA--></AD_REF_LIST>
+
 <!--2C29C3C687FC403A802A15DEAF9E0D26--><AD_REF_LIST>
 <!--2C29C3C687FC403A802A15DEAF9E0D26-->  <AD_REF_LIST_ID><![CDATA[2C29C3C687FC403A802A15DEAF9E0D26]]></AD_REF_LIST_ID>
 <!--2C29C3C687FC403A802A15DEAF9E0D26-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -153,6 +165,18 @@
 <!--B481A754BB024A1BA57D3DF852386B87-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--B481A754BB024A1BA57D3DF852386B87--></AD_REF_LIST>
 
+<!--BABE6BF881DD471BB18BF1AD764A3B78--><AD_REF_LIST>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <AD_REF_LIST_ID><![CDATA[BABE6BF881DD471BB18BF1AD764A3B78]]></AD_REF_LIST_ID>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <VALUE><![CDATA[GL]]></VALUE>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <NAME><![CDATA[GL Item]]></NAME>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <AD_REFERENCE_ID><![CDATA[C1B4345A1F8841C2B1ADD403CA733D75]]></AD_REFERENCE_ID>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--BABE6BF881DD471BB18BF1AD764A3B78-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--BABE6BF881DD471BB18BF1AD764A3B78--></AD_REF_LIST>
+
 <!--C5D1596D065545B49156C1F9426C9E14--><AD_REF_LIST>
 <!--C5D1596D065545B49156C1F9426C9E14-->  <AD_REF_LIST_ID><![CDATA[C5D1596D065545B49156C1F9426C9E14]]></AD_REF_LIST_ID>
 <!--C5D1596D065545B49156C1F9426C9E14-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -164,6 +188,18 @@
 <!--C5D1596D065545B49156C1F9426C9E14-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--C5D1596D065545B49156C1F9426C9E14--></AD_REF_LIST>
 
+<!--E047F81FACD0440EACB0EE63EB18A4EE--><AD_REF_LIST>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <AD_REF_LIST_ID><![CDATA[E047F81FACD0440EACB0EE63EB18A4EE]]></AD_REF_LIST_ID>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <VALUE><![CDATA[P]]></VALUE>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <NAME><![CDATA[Payment In/Out]]></NAME>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <AD_REFERENCE_ID><![CDATA[C1B4345A1F8841C2B1ADD403CA733D75]]></AD_REFERENCE_ID>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--E047F81FACD0440EACB0EE63EB18A4EE-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--E047F81FACD0440EACB0EE63EB18A4EE--></AD_REF_LIST>
+
 <!--FF8080812E443491012E443C4ED60020--><AD_REF_LIST>
 <!--FF8080812E443491012E443C4ED60020-->  <AD_REF_LIST_ID><![CDATA[FF8080812E443491012E443C4ED60020]]></AD_REF_LIST_ID>
 <!--FF8080812E443491012E443C4ED60020-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -583,17 +583,6 @@
 <!--4E68CD319FF945578CCF11CF38E0C58C-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--4E68CD319FF945578CCF11CF38E0C58C--></AD_TEXTINTERFACES>
 
-<!--4F85512699C241C58A3E7AD76FC4B4C6--><AD_TEXTINTERFACES>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <AD_TEXTINTERFACES_ID><![CDATA[4F85512699C241C58A3E7AD76FC4B4C6]]></AD_TEXTINTERFACES_ID>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <TEXT><![CDATA[GL Item]]></TEXT>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <FILENAME><![CDATA[/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.html]]></FILENAME>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <ISUSED><![CDATA[Y]]></ISUSED>
-<!--4F85512699C241C58A3E7AD76FC4B4C6-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--4F85512699C241C58A3E7AD76FC4B4C6--></AD_TEXTINTERFACES>
-
 <!--549D43D3510845D1965ACD2697B007FA--><AD_TEXTINTERFACES>
 <!--549D43D3510845D1965ACD2697B007FA-->  <AD_TEXTINTERFACES_ID><![CDATA[549D43D3510845D1965ACD2697B007FA]]></AD_TEXTINTERFACES_ID>
 <!--549D43D3510845D1965ACD2697B007FA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2673,17 +2662,6 @@
 <!--D2238E00427F496CB8D5A0F24935D4DB-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--D2238E00427F496CB8D5A0F24935D4DB--></AD_TEXTINTERFACES>
 
-<!--D355AEFFF148477FBBA0711575E575F2--><AD_TEXTINTERFACES>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <AD_TEXTINTERFACES_ID><![CDATA[D355AEFFF148477FBBA0711575E575F2]]></AD_TEXTINTERFACES_ID>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <TEXT><![CDATA[Fee]]></TEXT>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <FILENAME><![CDATA[/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.html]]></FILENAME>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <ISUSED><![CDATA[Y]]></ISUSED>
-<!--D355AEFFF148477FBBA0711575E575F2-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--D355AEFFF148477FBBA0711575E575F2--></AD_TEXTINTERFACES>
-
 <!--D516788B09FF4747BECF206430E96AA4--><AD_TEXTINTERFACES>
 <!--D516788B09FF4747BECF206430E96AA4-->  <AD_TEXTINTERFACES_ID><![CDATA[D516788B09FF4747BECF206430E96AA4]]></AD_TEXTINTERFACES_ID>
 <!--D516788B09FF4747BECF206430E96AA4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -33,7 +33,7 @@
 <!--9FAD469CE4414A25974CF45C0AD22D35-->  <FILTER_EXPRESSION><![CDATA[OB.getFilterExpression("org.openbravo.advpaymentmngt.ad_actionbutton.GLItemSelectorFilterExpression")]]></FILTER_EXPRESSION>
 <!--9FAD469CE4414A25974CF45C0AD22D35-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--9FAD469CE4414A25974CF45C0AD22D35-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--9FAD469CE4414A25974CF45C0AD22D35-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--9FAD469CE4414A25974CF45C0AD22D35-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--9FAD469CE4414A25974CF45C0AD22D35-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--9FAD469CE4414A25974CF45C0AD22D35-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--9FAD469CE4414A25974CF45C0AD22D35--></OBUISEL_SELECTOR>
@@ -49,7 +49,7 @@
 <!--A98899B1C75A4F4EBD3414F1B654EFAB-->  <FILTER_EXPRESSION><![CDATA["e.active=true"]]></FILTER_EXPRESSION>
 <!--A98899B1C75A4F4EBD3414F1B654EFAB-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--A98899B1C75A4F4EBD3414F1B654EFAB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--A98899B1C75A4F4EBD3414F1B654EFAB-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--A98899B1C75A4F4EBD3414F1B654EFAB-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--A98899B1C75A4F4EBD3414F1B654EFAB-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--A98899B1C75A4F4EBD3414F1B654EFAB-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--A98899B1C75A4F4EBD3414F1B654EFAB--></OBUISEL_SELECTOR>
@@ -65,7 +65,7 @@
 <!--FF808181312D569C01312D8C1EC40036-->  <AD_COLUMN_ID><![CDATA[3457]]></AD_COLUMN_ID>
 <!--FF808181312D569C01312D8C1EC40036-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--FF808181312D569C01312D8C1EC40036-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--FF808181312D569C01312D8C1EC40036-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--FF808181312D569C01312D8C1EC40036-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D8C1EC40036-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D8C1EC40036-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--FF808181312D569C01312D8C1EC40036--></OBUISEL_SELECTOR>
@@ -81,7 +81,7 @@
 <!--FF808181312D569C01312D8DCCD50045-->  <AD_COLUMN_ID><![CDATA[2570]]></AD_COLUMN_ID>
 <!--FF808181312D569C01312D8DCCD50045-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--FF808181312D569C01312D8DCCD50045-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--FF808181312D569C01312D8DCCD50045-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--FF808181312D569C01312D8DCCD50045-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D8DCCD50045-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D8DCCD50045-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--FF808181312D569C01312D8DCCD50045--></OBUISEL_SELECTOR>
@@ -97,7 +97,7 @@
 <!--FF808181312D569C01312D8EE5430054-->  <AD_COLUMN_ID><![CDATA[1823]]></AD_COLUMN_ID>
 <!--FF808181312D569C01312D8EE5430054-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--FF808181312D569C01312D8EE5430054-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--FF808181312D569C01312D8EE5430054-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--FF808181312D569C01312D8EE5430054-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D8EE5430054-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D8EE5430054-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--FF808181312D569C01312D8EE5430054--></OBUISEL_SELECTOR>
@@ -113,7 +113,7 @@
 <!--FF808181312D569C01312D90408D005D-->  <AD_COLUMN_ID><![CDATA[1349]]></AD_COLUMN_ID>
 <!--FF808181312D569C01312D90408D005D-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--FF808181312D569C01312D90408D005D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--FF808181312D569C01312D90408D005D-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--FF808181312D569C01312D90408D005D-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D90408D005D-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--FF808181312D569C01312D90408D005D-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--FF808181312D569C01312D90408D005D--></OBUISEL_SELECTOR>
@@ -131,7 +131,7 @@
 <!--FF808181312DA8D801312DDE869B000C-->  <FILTER_EXPRESSION><![CDATA[OB.getFilterExpression("org.openbravo.erpCommon.info.RMProductSelectorFilterExpression")]]></FILTER_EXPRESSION>
 <!--FF808181312DA8D801312DDE869B000C-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--FF808181312DA8D801312DDE869B000C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--FF808181312DA8D801312DDE869B000C-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--FF808181312DA8D801312DDE869B000C-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
 <!--FF808181312DA8D801312DDE869B000C-->  <POPUPTEXTMATCHSTYLE><![CDATA[startsWith]]></POPUPTEXTMATCHSTYLE>
 <!--FF808181312DA8D801312DDE869B000C-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--FF808181312DA8D801312DDE869B000C--></OBUISEL_SELECTOR>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html	Wed Oct 31 17:54:25 2012 +0100
@@ -1114,7 +1114,7 @@
                   <tr>
                     <td style="padding-top: 0px;">
                       <script>var sc_C_Bpartner_ID = null;</script>
-                      <input type="hidden" name="inpcBpartnerId" id="C_Bpartner_ID" value="" onreset="sc_C_Bpartner_ID.resetSelector();" onchange="openbravo.Utilities.updateSmartClientComponentValue(this, sc_C_Bpartner_ID.selectorField);"></input>
+                      <input type="hidden" name="inpcBpartnerId" id="C_Bpartner_ID" identifier="" value="" onreset="sc_C_Bpartner_ID.resetSelector();" onchange="openbravo.Utilities.updateSmartClientComponentValue(this, sc_C_Bpartner_ID.selectorField);"></input>
                       <script id="selectorLink" src="../org.openbravo.client.kernel/OBUISEL_Selector/A98899B1C75A4F4EBD3414F1B654EFAB?columnName=C_Bpartner_ID&disabled=false&CssSize=TwoCells&DisplayLength=45.0&callOut=onchangeBPartner&required=false&filterClass=org.openbravo.userinterface.selector.SelectorDataSourceFilter&_selectorDefinitionId=A98899B1C75A4F4EBD3414F1B654EFAB"></script>
                     </td>
                   </tr>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.java	Wed Oct 31 17:54:25 2012 +0100
@@ -383,13 +383,16 @@
         OBCriteria<BusinessPartner> obcBP = OBDal.getInstance().createCriteria(
             BusinessPartner.class);
         obcBP.add(Restrictions.eq(BusinessPartner.PROPERTY_NAME, bsline.getBpartnername()));
+        obcBP.setMaxResults(1);
         if (obcBP.list() != null && obcBP.list().size() > 0) {
-          xmlDocument.setParameter("businessPartner", obcBP.list().get(0).getIdentifier());
+          xmlDocument.setParameter("businessPartner", obcBP.list().get(0).getId());
+          xmlDocument.setParameter("businessPartnerName", obcBP.list().get(0).getName());
           defaultPaymentMethod = (obcBP.list().get(0).getPaymentMethod() != null) ? obcBP.list()
               .get(0).getPaymentMethod().getId() : "";
         }
       } else {
-        xmlDocument.setParameter("businessPartner", bsline.getBusinessPartner().getIdentifier());
+        xmlDocument.setParameter("businessPartner", bsline.getBusinessPartner().getId());
+        xmlDocument.setParameter("businessPartnerName", bsline.getBusinessPartner().getName());
       }
     }
     // Take payment date from the add transaction popup
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -45,6 +45,7 @@
     <PARAMETER id="paramExpectedConverted" name="expectedConverted" attribute="value" format="euroEdition"/>
     <PARAMETER id="paramActualConverted" name="actualConverted" attribute="value" format="euroEdition" default="0"/>
     <PARAMETER id="C_Bpartner_ID" name="businessPartner" attribute="value"/>
+    <PARAMETER id="C_Bpartner_ID" name="businessPartnerName" attribute="identifier"/>
     <PARAMETER id="paramCredit" name="credit" attribute="value" format="euroEdition"/>
     <PARAMETER id="fieldReceipt" name="isReceipt" attribute="value"/>
     <PARAMETER id="fieldIsSoTrx" name="isSoTrx" attribute="value"/>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.html	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.html	Wed Oct 31 17:54:25 2012 +0100
@@ -143,6 +143,7 @@
     displayLogicElement('client_middle', true);
     autoDisplayLogicDimensions(false);
     loadGrid();
+    resizeAreaCreateFrom();
   } else if (opt == 'GL') {
     displayLogicElement('FeeSection1', false);
     displayLogicElement('FeeSection2', false);
@@ -336,7 +337,6 @@
       onloadFunctions();
     } catch (e) {}
     showHideLayers();
-    resizeAreaCreateFrom();
   }
 
   function onResizeDo(){
@@ -538,13 +538,11 @@
               <!-- <td class="Combo_ContentCell" colspan="2"><select name="inpTransactionType" id="paramTransactionType" class="dojoValidateValid required Combo Combo_TwoCells_width">
                 <div id="reportTransactionType"></div></select>
               </td> -->
-              <td class="Combo_ContentCell" colspan="2">
-                <select id="paramTransactionType" name="inpTransactionType" class="ComboKey Combo_TwoCells_width required" onchange="showHideLayers();">
-                  <option value="P" selected="selected">Payment In/Out</option>
-                  <option value="GL">GL Item</option>
-                  <option value="F">Fee</option>
-                </select>
-              </td>
+              <td class="Combo_ContentCell"> 
+                <select  name="inpTransactionType" id="inpTransactionType" class="ComboKey Combo_TwoCells_width required" required="true" onchange="showHideLayers(); return true;">
+                  <option value=""> <div id="reportTransactionType"></div></option>
+                </select></td>
+
               <td class="TitleCell"><span class="LabelText">Transaction Date</span></td>
               <td class="TextBox_btn_ContentCell">
                 <table border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
@@ -729,7 +727,7 @@
                   <tr>
                     <td style="padding-top: 0px;">
                       <script>var sc_C_Glitem_ID = null;</script>
-                      <input type="hidden" name="inpGLItemId" id="C_Glitem_ID" value="" onreset="sc_C_Glitem_ID.resetSelector();" onchange="openbravo.Utilities.updateSmartClientComponentValue(this, sc_C_Glitem_ID.selectorField);"></input>
+                      <input type="hidden" name="inpGLItemId" id="C_Glitem_ID" value="" identifier="" onreset="sc_C_Glitem_ID.resetSelector();" onchange="openbravo.Utilities.updateSmartClientComponentValue(this, sc_C_Glitem_ID.selectorField);"></input>
                       <script id="selectorLink" src="../org.openbravo.client.kernel/OBUISEL_Selector/9FAD469CE4414A25974CF45C0AD22D35?columnName=C_Glitem_ID&disabled=false&CssSize=TwoCells&DisplayLength=45.0&required=true"></script>
                     </td>
                   </tr>
@@ -877,7 +875,7 @@
                   <tr>
                     <td style="padding-top: 0px;">
                       <script>var sc_C_BPartner_ID = null;</script>
-                      <input type="hidden" name="inpCBPartnerId" id="C_BPartner_ID" value="" onreset="sc_C_BPartner_ID.resetSelector();" onchange="openbravo.Utilities.updateSmartClientComponentValue(this, sc_C_BPartner_ID.selectorField);"></input>
+                      <input type="hidden" name="inpCBPartnerId" identifier="" id="C_BPartner_ID" value="" onreset="sc_C_BPartner_ID.resetSelector();" onchange="openbravo.Utilities.updateSmartClientComponentValue(this, sc_C_BPartner_ID.selectorField);"></input>
                       <script id="selectorLink" src="../org.openbravo.client.kernel/OBUISEL_Selector/A98899B1C75A4F4EBD3414F1B654EFAB?columnName=C_BPartner_ID&disabled=false&CssSize=TwoCells&DisplayLength=45.0&required=false"></script>
                     </td>
                   </tr>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.java	Wed Oct 31 17:54:25 2012 +0100
@@ -48,6 +48,7 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.data.FieldProvider;
 import org.openbravo.database.ConnectionProvider;
+import org.openbravo.erpCommon.utility.ComboTableData;
 import org.openbravo.erpCommon.utility.DateTimeData;
 import org.openbravo.erpCommon.utility.FieldProviderFactory;
 import org.openbravo.erpCommon.utility.OBError;
@@ -300,6 +301,7 @@
     xmlDocument.setParameter("orgId", strOrgId);
     xmlDocument.setParameter("finFinancialAccountId", strFinancialAccountId);
     xmlDocument.setParameter("finBankStatementLineId", strBankStatementLineId);
+    String transactionType = "P";
     if (!"".equals(strBankStatementLineId)) {
       FIN_BankStatementLine bsl = OBDal.getInstance().get(FIN_BankStatementLine.class,
           strBankStatementLineId);
@@ -312,14 +314,42 @@
       xmlDocument.setParameter("depositAmountGLItem", bsl.getCramount().toString());
       xmlDocument.setParameter("paymentAmountGLItem", bsl.getDramount().toString());
       xmlDocument.setParameter("mainDate", dateFormater.format(bsl.getTransactionDate()));
-
+      String bslDescription = !"".equals(bsl) ? bsl.getDescription() : "";
+      String strDescription = !"".equals(bsl.getBpartnername()) ? bsl.getBpartnername() + "\n"
+          + bslDescription : bslDescription;
+      xmlDocument.setParameter("GLItemDescription", strDescription);
+      xmlDocument.setParameter("FeeDescription", strDescription);
+      if (bsl.getGLItem() != null) {
+        transactionType = "GL";
+        xmlDocument.setParameter("GLItemID", bsl.getGLItem().getId());
+        xmlDocument.setParameter("GLItemName", bsl.getGLItem().getIdentifier());
+      }
+      if (bsl.getBusinessPartner() != null) {
+        xmlDocument.setParameter("BPartnerID", bsl.getBusinessPartner().getId());
+        xmlDocument.setParameter("BPartnerName", bsl.getBusinessPartner().getIdentifier());
+      }
     } else {
       xmlDocument.setParameter("depositAmount", BigDecimal.ZERO.toString());
       xmlDocument.setParameter("paymentAmount", BigDecimal.ZERO.toString());
       xmlDocument.setParameter("depositAmountGLItem", BigDecimal.ZERO.toString());
       xmlDocument.setParameter("paymentAmountGLItem", BigDecimal.ZERO.toString());
+      xmlDocument.setParameter("GLItemDescription", "");
+      xmlDocument.setParameter("FeeDescription", "");
+
     }
-
+    try {
+      String Transaction_Type_AddTransaction_Reference_ID = "C1B4345A1F8841C2B1ADD403CA733D75";
+      ComboTableData comboTableData = new ComboTableData(vars, this, "LIST", "",
+          Transaction_Type_AddTransaction_Reference_ID, "", Utility.getContext(this, vars,
+              "#AccessibleOrgTree", "AddTransaction"), Utility.getContext(this, vars,
+              "#User_Client", "AddTransaction"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "AddTransaction", "");
+      xmlDocument.setData("reportTransactionType", "liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
+    xmlDocument.setParameter("transactionType", transactionType);
     // Accounting Dimensions
     final String strElement_BP = Utility.getContext(this, vars, "$Element_BP", strWindowId);
     final String strElement_PR = Utility.getContext(this, vars, "$Element_PR", strWindowId);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddTransaction.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -32,6 +32,12 @@
     <PARAMETER id="paramMainDate" name="dateDisplayFormat" attribute="saveformat" replace="yy"/>
     <PARAMETER id="paramDepositAmount" name="depositAmount" attribute="value" format="euroEdition"/>
     <PARAMETER id="paramPaymentAmount" name="paymentAmount" attribute="value" format="euroEdition"/>
+    <PARAMETER id="C_Glitem_ID" name="GLItemID" attribute="value"/>
+    <PARAMETER id="C_Glitem_ID" name="GLItemName" attribute="identifier"/>
+    <PARAMETER id="paramGLItemDescription" name="GLItemDescription"/>
+    <PARAMETER id="paramFeeDescription" name="FeeDescription"/>
+    <PARAMETER id="C_BPartner_ID" name="BPartnerID" attribute="value"/>
+    <PARAMETER id="C_BPartner_ID" name="BPartnerName" attribute="identifier"/>
     <PARAMETER id="paramDepositAmountGLItem" name="depositAmountGLItem" attribute="value" format="euroEdition"/>
     <PARAMETER id="paramPaymentAmountGLItem" name="paymentAmountGLItem" attribute="value" format="euroEdition"/>
     <PARAMETER id="paramDateFrom" name="dateDisplayFormat" attribute="displayformat" replace="xx"/>
@@ -57,8 +63,11 @@
     <PARAMETER id="paramDocument" name="document"/>
     
     <!-- Transaction Type -->
-    <PARAMETER id="paramTransactionType" name="transactionType" attribute="value"/>
-    
+    <PARAMETER id="paramTransactionType" name="transactionType"/>
+      <SUBREPORT id="reportTransactionType" name="reportTransactionType" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected" withId="paramTransactionType"/>
+      </SUBREPORT>
+
     <DISCARD id="discard"/>
     
 </REPORT>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.html	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.html	Wed Oct 31 17:54:25 2012 +0100
@@ -137,6 +137,7 @@
     document.getElementById("inpFinancialTransactionId_" + bankStatementLineId).value = "";
     document.getElementById("inpMatchStyle_" + bankStatementLineId).style.backgroundColor = "white";
     document.getElementById("inpMatchingType_" + bankStatementLineId).value = "";
+    document.getElementById("inpExecuteMatching").value = "N";
     sendActionToServer("UNMATCH");
   }
   else {
@@ -351,6 +352,7 @@
   <input type="hidden" name="inpfinFinancialAccountId" value="" id="fieldfinFinancialAccountId"/>
   <input type="hidden" name="inpfinReconciliationId" value="" id="fieldfinReconciliationId"/>
   <input type="hidden" name="inpdateto" value="" id="fieldDateTo"/>
+  <input type="hidden" name="inpExecuteMatching" id="inpExecuteMatching" value="Y"/>
   <input type="hidden" name="inpFinBankStatementLineId" value=""/>
   <input type="hidden" name="inpSelectedFindTransactionId" value=""/>
   <input type="hidden" name="isFirstLoad" value="true"/>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Wed Oct 31 17:54:25 2012 +0100
@@ -147,6 +147,7 @@
           "MatchTransaction.paymentTypeFilter");
       String strShowCleared = vars.getRequestGlobalVariable("inpShowCleared",
           "MatchTransaction.showCleared");
+      String executeMatching = vars.getStringParameter("inpExecuteMatching", "Y");
       if (strShowCleared.equals("")) {
         strShowCleared = "N";
         vars.setSessionValue("MatchTransaction.showCleared", strShowCleared);
@@ -161,7 +162,7 @@
       vars.setSessionValue("AddTransaction|ShowJSMessage", "N");
 
       printGrid(response, vars, strPaymentTypeFilter, strFinancialAccountId, strReconciliationId,
-          strShowCleared, strHideDate, showJSMessage);
+          strShowCleared, strHideDate, showJSMessage, "Y".equals(executeMatching));
     } else if (vars.commandIn("UNMATCH")) {
       String strUnmatchBankStatementLineId = vars
           .getRequiredStringParameter("inpFinBankStatementLineId");
@@ -199,6 +200,18 @@
               FIN_BankStatementLine.class, strRecordsChecked);
 
           for (FIN_BankStatementLine item : items) {
+            if (item.getFinancialAccountTransaction() != null) {
+              // Unmatch Transaction
+              FIN_FinaccTransaction oldTransaction = item.getFinancialAccountTransaction();
+              final String DEPOSITED_NOT_CLEARED = "RDNC";
+              final String WITHDRAWN_NOT_CLEARED = "PWNC";
+              oldTransaction
+                  .setStatus(oldTransaction.getDepositAmount()
+                      .subtract(oldTransaction.getPaymentAmount()).signum() == 1 ? DEPOSITED_NOT_CLEARED
+                      : WITHDRAWN_NOT_CLEARED);
+              oldTransaction.setReconciliation(null);
+              OBDal.getInstance().save(oldTransaction);
+            }
             String strTransaction = vars.getStringParameter(
                 "inpFinancialTransactionId_" + item.getId(), "");
             String strMatchingType = vars.getStringParameter("inpMatchingType_" + item.getId(),
@@ -404,8 +417,8 @@
 
   private void printGrid(HttpServletResponse response, VariablesSecureApp vars,
       String strPaymentTypeFilter, String strFinancialAccountId, String strReconciliationId,
-      String strShowCleared, String strHideDate, String showJSMessage) throws IOException,
-      ServletException {
+      String strShowCleared, String strHideDate, String showJSMessage, boolean executeMatching)
+      throws IOException, ServletException {
     log4j.debug("Output: Grid Match using imported Bank Statement Lines");
 
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
@@ -415,7 +428,7 @@
     try {
       OBContext.setAdminMode(true);
       data = getMatchedBankStatementLinesData(vars, strFinancialAccountId, strReconciliationId,
-          strPaymentTypeFilter, strShowCleared, strHideDate);
+          strPaymentTypeFilter, strShowCleared, strHideDate, executeMatching);
     } catch (Exception e) {
       log4j.debug("Output: Exception ocurred while retrieving Bank Statement Lines.");
     } finally {
@@ -464,7 +477,7 @@
 
   private FieldProvider[] getMatchedBankStatementLinesData(VariablesSecureApp vars,
       String strFinancialAccountId, String strReconciliationId, String strPaymentTypeFilter,
-      String strShowCleared, String strHideDate) throws ServletException {
+      String strShowCleared, String strHideDate, boolean executeMatching) throws ServletException {
     FIN_FinancialAccount financial = new AdvPaymentMngtDao().getObject(FIN_FinancialAccount.class,
         strFinancialAccountId);
     MatchingAlgorithm ma = financial.getMatchingAlgorithm();
@@ -495,7 +508,7 @@
         String matchingType = FIN_BankStatementLines[i].getMatchingtype();
         FIN_FinaccTransaction transaction = FIN_BankStatementLines[i]
             .getFinancialAccountTransaction();
-        if (transaction == null) {
+        if (transaction == null && executeMatching) {
           FIN_MatchedTransaction matched = matchingTransaction.match(FIN_BankStatementLines[i],
               excluded);
           // When hide flag checked then exclude matchings for transactions out of date range
@@ -508,6 +521,18 @@
           transaction = matched.getTransaction();
           if (transaction != null && FIN_MatchedTransaction.STRONG.equals(matched.getMatchLevel())) {
             FIN_BankStatementLine bsl = FIN_BankStatementLines[i];
+            if (bsl.getFinancialAccountTransaction() != null) {
+              // Unmatch Transaction
+              FIN_FinaccTransaction oldTransaction = bsl.getFinancialAccountTransaction();
+              final String DEPOSITED_NOT_CLEARED = "RDNC";
+              final String WITHDRAWN_NOT_CLEARED = "PWNC";
+              oldTransaction
+                  .setStatus(oldTransaction.getDepositAmount()
+                      .subtract(oldTransaction.getPaymentAmount()).signum() == 1 ? DEPOSITED_NOT_CLEARED
+                      : WITHDRAWN_NOT_CLEARED);
+              oldTransaction.setReconciliation(null);
+              OBDal.getInstance().save(oldTransaction);
+            }
             bsl.setFinancialAccountTransaction(transaction);
             bsl.setMatchingtype(matched.getMatchLevel());
             transaction.setStatus("RPPC");
@@ -577,16 +602,21 @@
                       transaction.getTransactionDate().compareTo(reconciliation.getEndingDate()) > 0 ? reconciliation
                           .getEndingDate() : transaction.getTransactionDate(), vars
                           .getJavaDateFormat()));
-          FieldProviderFactory.setField(data[i], "matchedDocument", !transaction
-              .isCreatedByAlgorithm() ? MATCHED_AGAINST_TRANSACTION : (!transaction.getFinPayment()
-              .isCreatedByAlgorithm() ? MATCHED_AGAINST_PAYMENT : (transaction.getFinPayment()
-              .getFINPaymentDetailList().get(0).getFINPaymentScheduleDetailList().get(0)
-              .getInvoicePaymentSchedule() == null && transaction.getFinPayment()
-              .getFINPaymentDetailList().get(0).getFINPaymentScheduleDetailList().get(0)
-              .getOrderPaymentSchedule() == null) ? MATCHED_AGAINST_CREDIT
-              : (isInvoiceMatch(transaction) ? MATCHED_AGAINST_INVOICE : MATCHED_AGAINST_ORDER)));
-          String bpName = "";
-          if (transaction.getFinPayment() != null) {
+          FieldProviderFactory
+              .setField(
+                  data[i],
+                  "matchedDocument",
+                  (!transaction.isCreatedByAlgorithm() || transaction.getFinPayment() == null) ? MATCHED_AGAINST_TRANSACTION
+                      : (!transaction.getFinPayment().isCreatedByAlgorithm() ? MATCHED_AGAINST_PAYMENT
+                          : (transaction.getFinPayment().getFINPaymentDetailList().get(0)
+                              .getFINPaymentScheduleDetailList().get(0).getInvoicePaymentSchedule() == null && transaction
+                              .getFinPayment().getFINPaymentDetailList().get(0)
+                              .getFINPaymentScheduleDetailList().get(0).getOrderPaymentSchedule() == null) ? MATCHED_AGAINST_CREDIT
+                              : (isInvoiceMatch(transaction) ? MATCHED_AGAINST_INVOICE
+                                  : MATCHED_AGAINST_ORDER)));
+          String bpName = transaction.getBusinessPartner() != null ? transaction
+              .getBusinessPartner().getName() : "";
+          if ("".equals(bpName) && transaction.getFinPayment() != null) {
             if (transaction.getFinPayment().getBusinessPartner() != null) {
               bpName = transaction.getFinPayment().getBusinessPartner().getName();
             }
@@ -762,6 +792,8 @@
       FIN_FinaccTransaction finTrans = bsline.getFinancialAccountTransaction();
       if (finTrans != null) {
         finTrans.setReconciliation(null);
+        finTrans.setStatus((finTrans.getDepositAmount().subtract(finTrans.getPaymentAmount())
+            .signum() == 1) ? "RDNC" : "PWNC");
         bsline.setFinancialAccountTransaction(null);
         OBDal.getInstance().save(finTrans);
         OBDal.getInstance().flush();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Wed Oct 31 17:54:25 2012 +0100
@@ -1241,8 +1241,29 @@
         obc.add(Restrictions.eq(FIN_PaymentMethod.PROPERTY_PAYOUTALLOW, true));
       }
     }
+    obc.addOrderBy(FIN_PaymentMethod.PROPERTY_NAME, true);
+    return obc.list();
+  }
 
-    return obc.list();
+  public String getDefaultPaymentMethodId(FIN_FinancialAccount account, boolean paymentIn) {
+    final OBCriteria<FinAccPaymentMethod> obc = OBDal.getInstance().createCriteria(
+        FinAccPaymentMethod.class);
+    obc.createAlias(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD, "pm");
+    obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_ACCOUNT, account));
+    obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_DEFAULT, true));
+    if (paymentIn) {
+      obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYINALLOW, true));
+    } else {
+      obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYOUTALLOW, true));
+    }
+    obc.addOrder(org.hibernate.criterion.Order.asc("pm." + FIN_PaymentMethod.PROPERTY_NAME));
+    obc.setFilterOnReadableOrganization(false);
+    List<FinAccPaymentMethod> defaults = obc.list();
+    if (defaults.size() > 0) {
+      return obc.list().get(0).getPaymentMethod().getId();
+    } else {
+      return "";
+    }
   }
 
   private void addPaymentMethodList(OBCriteria obc, List<String> paymentMethods) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java	Wed Oct 31 17:54:25 2012 +0100
@@ -40,6 +40,7 @@
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.enterprise.DocumentType;
+import org.openbravo.model.financialmgmt.gl.GLItem;
 import org.openbravo.model.financialmgmt.payment.FIN_BankStatement;
 import org.openbravo.model.financialmgmt.payment.FIN_BankStatementLine;
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
@@ -326,6 +327,41 @@
     return result;
   }
 
+  public static List<FIN_FinaccTransaction> getMatchingGLItemTransaction(
+      String strFinancialAccountId, GLItem glItem, Date transactionDate, BigDecimal amount,
+      List<FIN_FinaccTransaction> excluded) {
+    final StringBuilder whereClause = new StringBuilder();
+    final List<Object> parameters = new ArrayList<Object>();
+
+    whereClause.append(" as ft ");
+    whereClause.append(" where ft.").append(FIN_FinaccTransaction.PROPERTY_ACCOUNT);
+    whereClause.append(".id = '").append(strFinancialAccountId).append("'");
+    whereClause.append("   and ft.").append(FIN_FinaccTransaction.PROPERTY_RECONCILIATION);
+    whereClause.append(" is null");
+    whereClause.append("   and ft.").append(FIN_FinaccTransaction.PROPERTY_PROCESSED)
+        .append(" = true");
+    whereClause.append("   and ft.").append(FIN_FinaccTransaction.PROPERTY_GLITEM);
+    whereClause.append(" = ?");
+    parameters.add(glItem);
+    whereClause.append("   and ft.").append(FIN_FinaccTransaction.PROPERTY_STATUS);
+    whereClause.append(" <> 'RPPC' ");
+    whereClause.append("   and (ft.").append(FIN_FinaccTransaction.PROPERTY_DEPOSITAMOUNT);
+    whereClause.append(" - ").append(FIN_FinaccTransaction.PROPERTY_PAYMENTAMOUNT).append(")");
+    whereClause.append(" = ?");
+    parameters.add(amount);
+    if (transactionDate != null) {
+      whereClause.append("   and ft.").append(FIN_FinaccTransaction.PROPERTY_TRANSACTIONDATE);
+      whereClause.append(" <= ?");
+      parameters.add(transactionDate);
+    }
+    final OBQuery<FIN_FinaccTransaction> obData = OBDal.getInstance().createQuery(
+        FIN_FinaccTransaction.class, whereClause.toString());
+    obData.setParameters(parameters);
+    List<FIN_FinaccTransaction> result = obData.list();
+    result.removeAll(excluded);
+    return result;
+  }
+
   public static List<FIN_FinaccTransaction> getMatchingFinancialTransaction(
       String strFinancialAccountId, BigDecimal amount, List<FIN_FinaccTransaction> excluded) {
     return getMatchingFinancialTransaction(strFinancialAccountId, null, amount, excluded);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_PaymentEventListener.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_PaymentEventListener.java	Wed Oct 31 17:54:25 2012 +0100
@@ -54,7 +54,7 @@
     if (pdList.size() > 0) {
       String language = OBContext.getOBContext().getLanguage().getLanguage();
       ConnectionProvider conn = new DalConnectionProvider(false);
-      throw new OBException(Utility.messageBD(conn, "APRM_PaymentCanNotBeDeleted", language));
+      throw new OBException(Utility.messageBD(conn, "ForeignKeyViolation", language));
     }
   }
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Wed Oct 31 17:54:25 2012 +0100
@@ -141,7 +141,7 @@
 
     // If no previous bank statement is found get the ending date of the last reconciliation
     FIN_Reconciliation rec = org.openbravo.advpaymentmngt.dao.TransactionsDao
-        .getLastReconciliation(account, null);
+        .getLastReconciliation(account, "Y");
     org.openbravo.dal.core.OBContext.setAdminMode(true);
     try {
       return (rec == null) ? null : rec.getEndingDate();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Wed Oct 31 17:54:25 2012 +0100
@@ -24,17 +24,20 @@
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.StringTokenizer;
 
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.lang.StringUtils;
+import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.process.FIN_AddPayment;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.security.OrganizationStructureProvider;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.database.ConnectionProvider;
@@ -43,6 +46,9 @@
 import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.enterprise.DocumentType;
 import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.model.financialmgmt.gl.GLItem;
+import org.openbravo.model.financialmgmt.payment.BankFileException;
+import org.openbravo.model.financialmgmt.payment.BankFileFormat;
 import org.openbravo.model.financialmgmt.payment.FIN_BankStatement;
 import org.openbravo.model.financialmgmt.payment.FIN_BankStatementLine;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
@@ -53,9 +59,10 @@
   OBError myError = null;
   String filename = "";
 
-  /** TALONES - REINTEGROS */
   public static final String DOCUMENT_BankStatementFile = "BSF";
 
+  ArrayList<String> stringExceptions = null;
+
   public FIN_BankStatementImport(FIN_FinancialAccount _financialAccount) {
     setFinancialAccount(_financialAccount);
   }
@@ -131,7 +138,8 @@
     List<FIN_BankStatementLine> bankStatementLines = new ArrayList<FIN_BankStatementLine>();
     int previousNumberofLines = 0;
     int numberOfLines = 0;
-
+    BankFileFormat bff = getBankFileFormat();
+    stringExceptions = loadExceptions(bff);
     try {
       file = getFile(vars);
     } catch (IOException e) {
@@ -202,19 +210,34 @@
     BigDecimal crAmount;
     BigDecimal drAmount;
     for (FIN_BankStatementLine bankStatementLine : bankStatementLines) {
-      BusinessPartner businessPartner;
+      BusinessPartner businessPartner = null;
+      GLItem glItem = null;
       crAmount = bankStatementLine.getCramount();
       drAmount = bankStatementLine.getDramount();
       if (!(crAmount.compareTo(BigDecimal.ZERO) == 0)
           || !(drAmount.compareTo(BigDecimal.ZERO) == 0)) {
-        try {
-          businessPartner = matchBusinessPartner(bankStatementLine.getBpartnername(),
-              bankStatementLine.getOrganization(), bankStatementLine.getBankStatement()
-                  .getAccount());
-        } catch (Exception e) {
-          businessPartner = null;
+        // Try finding Previous matches
+        HashMap<String, String> previous = matchPreviousBSL(bankStatementLine.getBpartnername(),
+            bankStatementLine.getOrganization(), bankStatementLine.getBankStatement().getAccount());
+        if (!"".equals(previous.get("BPartnerID"))) {
+          businessPartner = OBDal.getInstance().get(BusinessPartner.class,
+              previous.get("BPartnerID"));
+        }
+        if (!"".equals(previous.get("GLItemID"))) {
+          glItem = OBDal.getInstance().get(GLItem.class, previous.get("GLItemID"));
+        }
+        // if no previous BSL is found, try match BP Name
+        if (businessPartner == null) {
+          try {
+            businessPartner = matchBusinessPartner(bankStatementLine.getBpartnername(),
+                bankStatementLine.getOrganization(), bankStatementLine.getBankStatement()
+                    .getAccount());
+          } catch (Exception e) {
+            businessPartner = null;
+          }
         }
         bankStatementLine.setBusinessPartner(businessPartner);
+        bankStatementLine.setGLItem(glItem);
         bankStatementLine.setLineNo(new Long((counter + 1) * 10));
         OBDal.getInstance().save(bankStatementLine);
         counter++;
@@ -249,18 +272,18 @@
   private BusinessPartner matchBusinessPartner(String partnername, Organization organization,
       FIN_FinancialAccount account) {
     // TODO extend with other matching methods. It will make it easier to later reconcile
-    BusinessPartner bp = matchBusinessPartnerByName(partnername, organization, account);
-    if (bp == null) {
-      bp = finBPByName(partnername, organization);
-    }
+    BusinessPartner bp = finBPByName(partnername, organization);
     if (bp == null) {
       bp = matchBusinessPartnerByNameTokens(partnername, organization);
     }
     return bp;
   }
 
-  private BusinessPartner matchBusinessPartnerByName(String partnername, Organization organization,
+  private HashMap<String, String> matchPreviousBSL(String partnername, Organization organization,
       FIN_FinancialAccount account) {
+    HashMap<String, String> result = new HashMap<String, String>();
+    result.put("BPartnerID", "");
+    result.put("GLItemID", "");
     if (partnername == null || "".equals(partnername.trim())) {
       return null;
     }
@@ -269,10 +292,11 @@
     OBContext.setAdminMode();
     try {
       whereClause.append(" as bsl ");
-      whereClause.append(" where bsl." + FIN_BankStatementLine.PROPERTY_BPARTNERNAME + " = ?");
+      whereClause.append(" where translate(bsl." + FIN_BankStatementLine.PROPERTY_BPARTNERNAME
+          + ",'0123456789', '          ') = translate( ?,'0123456789', '          ')");
       parameters.add(partnername);
-      whereClause.append(" and bsl." + FIN_BankStatementLine.PROPERTY_BUSINESSPARTNER
-          + " is not null");
+      whereClause.append(" and (bsl." + FIN_BankStatementLine.PROPERTY_BUSINESSPARTNER
+          + " is not null or bsl." + FIN_BankStatementLine.PROPERTY_GLITEM + " is not null)");
       whereClause.append(" and bsl." + FIN_BankStatementLine.PROPERTY_BANKSTATEMENT + ".");
       whereClause.append(FIN_BankStatement.PROPERTY_ACCOUNT + ".id = ?");
       parameters.add(account.getId());
@@ -284,12 +308,20 @@
       final OBQuery<FIN_BankStatementLine> bsl = OBDal.getInstance().createQuery(
           FIN_BankStatementLine.class, whereClause.toString(), parameters);
       bsl.setFilterOnReadableOrganization(false);
-      List<FIN_BankStatementLine> matchedLines = bsl.list();
-      if (matchedLines.size() == 0)
-        return null;
-      else
-        return matchedLines.get(0).getBusinessPartner();
-
+      // Just look in las 10 matches
+      bsl.setMaxResult(10);
+      for (FIN_BankStatementLine line : bsl.list()) {
+        if (line.getGLItem() != null && "".equals(result.get("GLItemID"))) {
+          result.put("GLItemID", line.getGLItem().getId());
+        }
+        if (line.getBusinessPartner() != null && "".equals(result.get("BPartnerID"))) {
+          result.put("BPartnerID", line.getBusinessPartner().getId());
+        }
+        if (!"".equals(result.get("BPartnerID")) && !"".equals(result.get("GLItemID"))) {
+          return result;
+        }
+      }
+      return result;
     } finally {
       OBContext.restorePreviousMode();
     }
@@ -332,7 +364,12 @@
     if (partnername == null || "".equals(partnername.trim())) {
       return null;
     }
-    StringTokenizer st = new StringTokenizer(partnername);
+    String parsedPartnername = partnername.toLowerCase();
+    // Remove exceptions
+    for (String eliminate : stringExceptions) {
+      parsedPartnername = parsedPartnername.replaceAll(eliminate.toLowerCase(), "");
+    }
+    StringTokenizer st = new StringTokenizer(parsedPartnername);
     List<String> list = new ArrayList<String>();
     while (st.hasMoreTokens()) {
       String token = st.nextToken();
@@ -378,22 +415,65 @@
     BusinessPartner targetBusinessPartner = businessPartners.get(0);
     int distance = StringUtils.getLevenshteinDistance(partnername, businessPartners.get(0)
         .getName());
+    String parsedPartnername = partnername.toLowerCase();
+    // Remove exceptions
+    for (String eliminate : stringExceptions) {
+      parsedPartnername = parsedPartnername.replaceAll(eliminate.toLowerCase(), "");
+    }
+    // Remove Numeric characters
+    char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
+    for (char character : digits) {
+      parsedPartnername = parsedPartnername.replace(character, ' ');
+      parsedPartnername = parsedPartnername.trim();
+    }
+
     for (BusinessPartner bp : businessPartners) {
       // Calculates distance between two strings meaning number of changes required for a string to
       // convert in another string
-      int bpDistance = StringUtils.getLevenshteinDistance(partnername, bp.getName());
+      int bpDistance = StringUtils.getLevenshteinDistance(partnername, bp.getName().toLowerCase());
       if (bpDistance < distance) {
         distance = bpDistance;
         targetBusinessPartner = bp;
       }
     }
-    // Tolerance: discard business partners where number of changes needed to match is higher than
-    // half of its length
-    if (distance > (partnername.length() / 2)) {
-      return null;
-    } else {
-      return targetBusinessPartner;
-    }
+    return targetBusinessPartner;
   }
 
+  private BankFileFormat getBankFileFormat() {
+    List<BankFileFormat> bankFileFormat = new ArrayList<BankFileFormat>();
+    OBContext.setAdminMode();
+    final String JAVACLASSNAME = this.getClass().getName();
+    try {
+      OBCriteria<BankFileFormat> obc = OBDal.getInstance().createCriteria(BankFileFormat.class);
+      obc.add(Restrictions.eq(BankFileFormat.PROPERTY_JAVACLASSNAME, JAVACLASSNAME));
+      obc.setMaxResults(1);
+      bankFileFormat = obc.list();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return bankFileFormat.size() > 0 ? bankFileFormat.get(0) : null;
+  }
+
+  ArrayList<String> loadExceptions(BankFileFormat bankFileFormat) {
+    ArrayList<String> exceptions = new ArrayList<String>();
+    List<BankFileException> bankFileExceptions = new ArrayList<BankFileException>();
+    OBContext.setAdminMode();
+    try {
+      OBCriteria<BankFileException> obc = OBDal.getInstance().createCriteria(
+          BankFileException.class);
+      obc.createAlias(BankFileException.PROPERTY_BANKFILEFORMAT, "BFF");
+      obc.add(Restrictions.eq("BFF." + BankFileFormat.PROPERTY_JAVACLASSNAME,
+          bankFileFormat.getJavaClassName()));
+      obc.add(Restrictions.or(
+          Restrictions.eq(BankFileException.PROPERTY_FINANCIALACCOUNT, financialAccount),
+          Restrictions.isNull(BankFileException.PROPERTY_FINANCIALACCOUNT)));
+      bankFileExceptions = obc.list();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    for (BankFileException ex : bankFileExceptions) {
+      exceptions.add(ex.getTextToExclude());
+    }
+    return exceptions;
+  }
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Wed Oct 31 17:54:25 2012 +0100
@@ -422,11 +422,16 @@
       String strFinancialAccountId, String strOrgId, boolean isMandatory,
       boolean excludePaymentMethodWithoutAccount, boolean isInPayment) {
     dao = new AdvPaymentMngtDao();
+    String selectedPaymentMethodId = strPaymentMethodId;
     List<FIN_PaymentMethod> paymentMethods = dao.getFilteredPaymentMethods(strFinancialAccountId,
         strOrgId, excludePaymentMethodWithoutAccount,
         isInPayment ? AdvPaymentMngtDao.PaymentDirection.IN
             : AdvPaymentMngtDao.PaymentDirection.OUT);
-    String options = getOptionsList(paymentMethods, strPaymentMethodId, isMandatory);
+    if ("".equals(selectedPaymentMethodId) && !"".equals(strFinancialAccountId)) {
+      selectedPaymentMethodId = dao.getDefaultPaymentMethodId(
+          OBDal.getInstance().get(FIN_FinancialAccount.class, strFinancialAccountId), isInPayment);
+    }
+    String options = getOptionsList(paymentMethods, selectedPaymentMethodId, isMandatory);
     return options;
   }
 
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.18385]]></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>
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.18385]]></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 Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  <VERSION><![CDATA[2.1.18385]]></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>
--- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--15D7CE8D95D043189162DBABA54A1F61-->  <STARTVERSION><![CDATA[2.1.18385]]></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.18258]]></STARTVERSION>
+<!--60A170212F36499D83B8AD38D01F46B3-->  <STARTVERSION><![CDATA[2.1.18385]]></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.18258]]></STARTVERSION>
+<!--824D60CB352E4099B1D8C903CA139DAE-->  <STARTVERSION><![CDATA[3.0.18385]]></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.18258]]></STARTVERSION>
+<!--E8FD820AFE3D4FE08C02FC47769026AD-->  <STARTVERSION><![CDATA[8.1.18385]]></STARTVERSION>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME>
 <!--E8FD820AFE3D4FE08C02FC47769026AD-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/GeneralLedgerOrganizationHandler.java	Wed Oct 31 17:54:25 2012 +0100
@@ -0,0 +1,101 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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.client.application.event;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.event.Observes;
+
+import org.apache.log4j.Logger;
+import org.hibernate.criterion.Restrictions;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
+import org.openbravo.client.kernel.event.EntityUpdateEvent;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.model.common.enterprise.OrganizationAcctSchema;
+import org.openbravo.model.financialmgmt.accounting.coa.AcctSchema;
+
+public class GeneralLedgerOrganizationHandler extends EntityPersistenceEventObserver {
+
+  private static Entity[] entities = { ModelProvider.getInstance().getEntity(
+      Organization.ENTITY_NAME) };
+  protected Logger logger = Logger.getLogger(this.getClass());
+
+  @Override
+  protected Entity[] getObservedEntities() {
+    return entities;
+  }
+
+  public void onSave(@Observes
+  EntityUpdateEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+
+    final Organization organization = (Organization) event.getTargetInstance();
+    if (organization != null) {
+      final AcctSchema generalLedger = organization.getGeneralLedger();
+
+      OBCriteria<OrganizationAcctSchema> orgSchema = OBDal.getInstance().createCriteria(
+          OrganizationAcctSchema.class);
+      orgSchema.setFilterOnReadableOrganization(false);
+      orgSchema.setFilterOnActive(false);
+      orgSchema.add(Restrictions.eq(OrganizationAcctSchema.PROPERTY_ORGANIZATION, organization));
+      List<OrganizationAcctSchema> orgSchemalist = orgSchema.list();
+      ArrayList<String> idlist = new ArrayList<String>();
+
+      boolean exist = false;
+
+      for (OrganizationAcctSchema oas : orgSchemalist) {
+        idlist.add(oas.getId());
+      }
+      for (String ids : idlist) {
+        OrganizationAcctSchema orgAcctSchema = OBDal.getInstance().get(
+            OrganizationAcctSchema.class, ids);
+        if (generalLedger != null
+            && generalLedger.getId() == orgAcctSchema.getAccountingSchema().getId()) {
+          orgAcctSchema.setActive(true);
+          exist = true;
+          continue;
+        }
+        if (orgAcctSchema.getOrganizationClosingList().size() == 0) {
+          OBDal.getInstance().remove(orgAcctSchema);
+        } else {
+          orgAcctSchema.setActive(false);
+          OBDal.getInstance().save(orgAcctSchema);
+        }
+      }
+
+      if ((generalLedger != null) && !exist) {
+        final OrganizationAcctSchema orgAcctSchema = OBProvider.getInstance().get(
+            OrganizationAcctSchema.class);
+        orgAcctSchema.setOrganization(organization);
+        orgAcctSchema.setAccountingSchema(generalLedger);
+        OBDal.getInstance().save(orgAcctSchema);
+      }
+
+    }
+  }
+}
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-tab.js.ftl	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-tab.js.ftl	Wed Oct 31 17:54:25 2012 +0100
@@ -154,6 +154,7 @@
     initWidget: function() {
         this.prepareFields();
         this.dataSource = ${tabComponent.dataSourceJavaScript};
+        this.dataSource.potentiallyShared = true;
         this.viewForm = isc.OBViewForm.create(isc.clone(OB.ViewFormProperties), ${tabComponent.viewForm}); 
         this.viewGrid = ${tabComponent.viewGrid};
         this.Super('initWidget', arguments);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js	Wed Oct 31 17:54:25 2012 +0100
@@ -65,6 +65,13 @@
     return canvas;
   },
 
+  destroy: function () {
+    if (this.canvas && this.form) {
+      this.canvas.ignore(this.form, 'itemChanged');
+    }
+    return this.Super('destroy', arguments);
+  },
+
   redrawing: function () {
     if (this.canvas.redrawingItem) {
       this.canvas.redrawingItem();
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Wed Oct 31 17:54:25 2012 +0100
@@ -27,6 +27,7 @@
   allowExpressions: false,
   showOptionsFromDataSource: true,
   selectOnFocus: false,
+  validateOnExit: true,
 
   multiple: true,
   multipleAppearance: 'picklist',
@@ -133,6 +134,9 @@
 
     this.Super('init', arguments);
 
+    // don't validate for FK filtering, any value is allowed
+    this.validators = [];
+
     // listen to data arrival in the grid
     // if data arrived we have to reload also
     this.observe(grid, "dataArrived", "observer.setForceReload()");
@@ -140,6 +144,29 @@
     this.multipleValueSeparator = ' or ';
   },
 
+  destroy: function () {
+    var grid = this.form && this.form.grid && this.form.grid.sourceWidget;
+    if (grid) {
+      this.ignore(grid, 'dataArrived');
+    }
+    return this.Super('destroy', arguments);
+  },
+
+  // note: can't override changed as it is used by the filter editor 
+  // itself, see the RecordEditor source code and the changed event
+  change: function (form, item, value, oldValue) {
+    this._hasChanged = true;
+    this.Super('change', arguments);
+  },
+
+  blur: function () {
+    if (this._hasChanged) {
+      this.form.grid.performAction();
+    }
+    delete this._hasChanged;
+    this.Super('blur', arguments);
+  },
+
   // overridden otherwise the picklist fields from the grid field
   // are being used
   getPickListFields: function () {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Wed Oct 31 17:54:25 2012 +0100
@@ -965,7 +965,7 @@
       // handle the case that the FIC returns a null value as a string
       // should be repaired in the FIC
       // note: do not use clearvalue as this removes the value from the form
-      this.setValue(field.name, null);
+      this.setItemValue(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 === 'time');
       isDateTime = field.type && isc.SimpleType.getType(field.type).inheritsFrom === 'datetime';
@@ -1010,7 +1010,7 @@
     } else {
       // note: do not use clearvalue as this removes the value from the form
       // which results it to not be sent to the server anymore
-      this.setValue(field.name, null);
+      this.setItemValue(field.name, null);
       if (this.getValue(field.name + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER)) {
         this.setItemValue(field.name + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER, null);
       }
@@ -1022,7 +1022,7 @@
 
     // store the textualvalue so that it is correctly send back to the server
     typeInstance = isc.SimpleType.getType(field.type);
-    if (columnValue.classicValue && typeInstance.decSeparator) {
+    if ((columnValue.classicValue || columnValue.classicValue === '') && typeInstance.decSeparator) {
       this.setTextualValue(field.name, assignClassicValue, typeInstance);
     }
   },
@@ -1095,7 +1095,7 @@
       // Adjust to formatting if exists value and classicValue.
       assignClassicValue = (field.typeInstance && field.typeInstance.parseInput && field.typeInstance.editFormatter) ? field.typeInstance.editFormatter(field.typeInstance.parseInput(columnValue.classicValue)) : columnValue.classicValue;
       typeInstance = isc.SimpleType.getType(field.type);
-      if (columnValue.classicValue && typeInstance.decSeparator) {
+      if ((columnValue.classicValue || columnValue.classicValue === '') && typeInstance.decSeparator) {
         this.setTextualValue(field.name, assignClassicValue, typeInstance, gridEditInformation);
       }
     }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Wed Oct 31 17:54:25 2012 +0100
@@ -220,6 +220,17 @@
       }
     },
 
+    // always return false otherwise sc switches to local mode
+    // which does not work correctly for when doing inserts in form mode
+    // at that point the grid.data.allRows is being used which results 
+    // in mismatches with grid.data.localData, returning false here
+    // prevents allRows from being used. In our case we never really
+    // want to have all rows cached locally as we do all filtering
+    // server side.
+    allRowsCached: function () {
+      return false;
+    },
+
     transformData: function (newData, dsResponse) {
       var i, length, timeFields;
 
@@ -732,6 +743,11 @@
         editorProperties, len = fields.length,
         ds, dataSources = [];
 
+    if (this.getDataSource()) {
+      // will get destroyed in the super class then
+      this.getDataSource().potentiallyShared = false;
+    }
+
     for (i = 0; i < len; i++) {
       field = fields[i];
       editorProperties = field && field.editorProperties;
@@ -1447,7 +1463,7 @@
   dataArrived: function (startRow, endRow) {
     // do this now, to replace the loading message
     // TODO: add dynamic part of readonly (via setWindowSettings: see issue 17441)
-    if (this.uiPattern === 'SR' || this.uiPattern === 'RO' || this.uiPattern !== 'ED') {
+    if (this.uiPattern === 'SR' || this.uiPattern === 'RO' || this.uiPattern === 'ED') {
       this.noDataEmptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_NoDataInGrid') + '</span>';
     } else {
       this.noDataEmptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridNoRecords') + '</span>' + '<span onclick="this.onclick = new Function(); setTimeout(function() { window[\'' + this.ID + '\'].view.newRow(); }, 50); return false;" class="' + this.emptyMessageLinkStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne') + '</span>';
@@ -2085,7 +2101,7 @@
         }
       });
     }
-    if (this.view.isDeleteableTable && recordsSelected && !this.view.readOnly && !this.view.singleRecord && this.allSelectedRecordsWritable()) {
+    if (this.view.isDeleteableTable && recordsSelected && !this.view.readOnly && !this.view.singleRecord && this.allSelectedRecordsWritable() && (this.view.standardWindow.allowDelete !== 'N')) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_Delete'),
         keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text', 'ToolBar_Eliminate', 'id'),
@@ -2433,6 +2449,9 @@
       }
     }
 
+    // make sure that we are visible    
+    this.scrollRecordIntoView(rowNum);
+
     ret = this.Super('startEditing', [rowNum, colNum, suppressFocus, eCe, suppressWarning]);
 
     this.recomputeCanvasComponents(rowNum);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js	Wed Oct 31 17:54:25 2012 +0100
@@ -55,6 +55,10 @@
   // in the window
   dirtyEditForm: null,
 
+  allowDelete: 'Y',
+
+  allowAttachment: 'Y',
+
   initWidget: function () {
     var me = this,
         callback;
@@ -91,6 +95,8 @@
       this.viewProperties.allowDefaultEditMode = false;
     }
     this.viewState = OB.PropertyStore.get('OBUIAPP_GridConfiguration', this.windowId);
+    this.allowDelete = OB.PropertyStore.get("AllowDelete", this.windowId);
+    this.allowAttachment = OB.PropertyStore.get("AllowAttachment", this.windowId);
     this.view = isc.OBStandardView.create(this.viewProperties);
     this.addView(this.view);
     this.windowLayout.addMember(this.view);
@@ -211,7 +217,7 @@
           if (prevFocusedItem) {
             var myInterval;
             myInterval = setInterval(function () {
-              if (prevFocusedItem === isc.EH.getFocusCanvas()) {
+              if (me.children && prevFocusedItem === isc.EH.getFocusCanvas()) {
                 if (me.children[3] && me.children[3].items[0] && me.children[3].items[0].firstFocusedItem) {
                   me.children[3].items[0].firstFocusedItem.focus();
                 } else {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js	Wed Oct 31 17:54:25 2012 +0100
@@ -1139,7 +1139,7 @@
   // sets information about the current personalization record
   // in the status bar
   setStatusBarInformation: function () {
-    this.toolBar.updateButtonState();
+    this.toolBar.updateButtonState(false, false, true);
 
     var statusBarFields = null,
         barFieldValues = [],
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Wed Oct 31 17:54:25 2012 +0100
@@ -172,9 +172,9 @@
         }
       }
       if (view.isShowingForm) {
-        this.setDisabled(form.isSaving || form.readOnly || view.singleRecord || !view.hasValidState() || form.isNew || OB.PropertyStore.get("AllowDelete", this.view.standardWindow.windowId) === 'N');
+        this.setDisabled(form.isSaving || form.readOnly || view.singleRecord || !view.hasValidState() || form.isNew || (view.standardWindow.allowDelete === 'N'));
       } else {
-        this.setDisabled(view.readOnly || view.singleRecord || !view.hasValidState() || !grid.getSelectedRecords() || grid.getSelectedRecords().length === 0 || OB.PropertyStore.get("AllowDelete", this.view.standardWindow.windowId) === 'N');
+        this.setDisabled(view.readOnly || view.singleRecord || !view.hasValidState() || !grid.getSelectedRecords() || grid.getSelectedRecords().length === 0 || (view.standardWindow.allowDelete === 'N'));
       }
     },
     keyboardShortcutId: 'ToolBar_Eliminate'
@@ -362,7 +362,7 @@
       if (this.view.viewForm.readOnly && !this.view.attachmentExists) {
         this.setDisabled(true);
       }
-      if (OB.PropertyStore.get("AllowAttachment", this.view.standardWindow.windowId) === 'N') {
+      if (this.view.standardWindow.allowAttachment === 'N') {
         this.view.viewForm.enableAttachmentsSection(false);
         this.setDisabled(true);
       }
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--D393BE6F22BB44B7B728259B34FC795A-->  <VERSION><![CDATA[1.0.18385]]></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>
--- a/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--DCE798FBC5B648F7A3C81A6941720A57-->  <STARTVERSION><![CDATA[2.1.18385]]></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 Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--4B828F4D03264080AA1D2057B13F613C-->  <VERSION><![CDATA[2.1.18385]]></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>
--- a/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--26B041893E844A53AFA58BC326C4F0D7-->  <STARTVERSION><![CDATA[3.0.18385]]></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.18258]]></STARTVERSION>
+<!--3AB045DA35ED4CA58EF7EB5BF04CDE3F-->  <STARTVERSION><![CDATA[1.1.18385]]></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.18258]]></STARTVERSION>
+<!--D7BA4BB0844942C58DC46B9E23CF8E67-->  <STARTVERSION><![CDATA[2.0.18385]]></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-db/database/sourcedata/AD_TREENODE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_TREENODE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -8,7 +8,7 @@
 <!--3E38D7EEF9CF48E5B223D6D71DF7EA05-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--3E38D7EEF9CF48E5B223D6D71DF7EA05-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--3E38D7EEF9CF48E5B223D6D71DF7EA05-->  <PARENT_ID><![CDATA[153]]></PARENT_ID>
-<!--3E38D7EEF9CF48E5B223D6D71DF7EA05-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--3E38D7EEF9CF48E5B223D6D71DF7EA05-->  <SEQNO><![CDATA[149]]></SEQNO>
 <!--3E38D7EEF9CF48E5B223D6D71DF7EA05--></AD_TREENODE>
 
 <!--EEDE9E704B114114BB8AF2A5453F3D77--><AD_TREENODE>
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--2758CD25B2704AF6BBAD10365FC82C06-->  <VERSION><![CDATA[2.1.18385]]></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>
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--15F51F03882F444CAB6593B4566DC929-->  <STARTVERSION><![CDATA[2.1.18385]]></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.18258]]></STARTVERSION>
+<!--E71B28FC949D481D9F59C17D01E46EF9-->  <STARTVERSION><![CDATA[3.0.18385]]></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.myob/web/org.openbravo.client.myob/js/ob-url-widget.js	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-url-widget.js	Wed Oct 31 17:54:25 2012 +0100
@@ -32,6 +32,10 @@
       this.contentSource = document.location.protocol + this.contentSource.substring(this.contentSource.indexOf('//'));
     }
 
+    if (this.contentSource.indexOf('google.com/calendar') !== -1) {
+      this.contentSource = this.contentSource.replace("account", OB.User.email);
+    }
+
     return isc.HTMLFlow.create({
       contentsType: 'page',
       contentsURL: this.contentSource,
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--0A060B2AF1974E8EAA8DB61388E9AECC-->  <VERSION><![CDATA[1.0.18385]]></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>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--26558497C31140BFAB067BA4BC47D799-->  <STARTVERSION><![CDATA[2.1.18385]]></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.widgets/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--FF8080812D842086012D844F3CC0003E-->  <VERSION><![CDATA[0.0.18385]]></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>
--- a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--FF8080812D842086012D845002070046-->  <STARTVERSION><![CDATA[2.1.18385]]></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.client.widgets/src-db/database/sourcedata/OBKMO_WIDGET_URL.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBKMO_WIDGET_URL.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -33,7 +33,7 @@
 <!--4769EE83CE8B472987A1648C8CDD6803-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--4769EE83CE8B472987A1648C8CDD6803-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--4769EE83CE8B472987A1648C8CDD6803-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[DEEFF28410DD488E9EF2EB28DCD6ADA1]]></OBKMO_WIDGET_CLASS_ID>
-<!--4769EE83CE8B472987A1648C8CDD6803-->  <URL><![CDATA[https://www.google.com/calendar/ig?up_calendarFeeds&up_calendarColors&up_firstDay=0&up_dateFormat=0&up_timeFormat=1:00pm&up_showDatepicker=0&up_hideAgenda=0&up_showEmptyDays=0&up_showExpiredEvents=1&lang=en&country=us&.lang=en&.country=us&synd=ig&mid=95&ifpctok=-1351080279927728270&exp_rpc_js=1&exp_track_js=1&exp_ids=17259&parent=http://www.google.com&libs=7ndonz73vUA/lib/liberror_tracker.js,iHKb-4mKuMY/lib/librpc.js,ebbdPN3h-1s/lib/libcore.js,OqjxSeEKc8o/lib/libdynamic-height.js,a5j4V1JuNVE/lib/libsetprefs.js,WTy6QrAxdtg/lib/libviews.js&view=home&is_signedin=1&gsessionid=OK]]></URL>
+<!--4769EE83CE8B472987A1648C8CDD6803-->  <URL><![CDATA[https://www.google.com/calendar/embed?src=account]]></URL>
 <!--4769EE83CE8B472987A1648C8CDD6803--></OBKMO_WIDGET_URL>
 
 <!--8A6B99392E2B4192012E2B54616F0041--><OBKMO_WIDGET_URL>
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--2A5EE903D7974AC298C0504FBC4501A7-->  <VERSION><![CDATA[3.0.18385]]></VERSION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <DESCRIPTION><![CDATA[Payment Report]]></DESCRIPTION>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <URL><![CDATA[http://forge.openbravo.com/projects/paymentreport]]></URL>
 <!--2A5EE903D7974AC298C0504FBC4501A7-->  <TYPE><![CDATA[M]]></TYPE>
--- a/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--A3B449C4D5FE4D688CC58236FE33B802-->  <STARTVERSION><![CDATA[3.0.18385]]></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 Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--3A3A943684D64DEF9EC39F588A656848-->  <VERSION><![CDATA[1.1.18385]]></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>
--- a/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--64060E9EE9EC408BBFFD0CC2DE25C86F-->  <STARTVERSION><![CDATA[3.0.18385]]></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 Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--A44B9BA75C354D8FB2E3F7D6EB6BFDC4-->  <VERSION><![CDATA[2.1.18385]]></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>
--- a/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--0BA071C783CC4984AC9C03BB7CAA87C7-->  <STARTVERSION><![CDATA[1.1.18385]]></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.18258]]></STARTVERSION>
+<!--3E531F0CD0A54130996F5AF3B6A2D01B-->  <STARTVERSION><![CDATA[2.0.18385]]></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.18258]]></STARTVERSION>
+<!--4FCE95802A854F7E8623AFF7C33D13EE-->  <STARTVERSION><![CDATA[3.0.18385]]></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.18258]]></STARTVERSION>
+<!--54AF8B39C55E4E7496902893ECD82786-->  <STARTVERSION><![CDATA[2.1.18385]]></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.18258]]></STARTVERSION>
+<!--D03C56D8A4E14F45A5466350E05C631F-->  <STARTVERSION><![CDATA[8.1.18385]]></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 Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--FF8080813129ADA401312CA1222A0005-->  <VERSION><![CDATA[0.1.18385]]></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.
--- a/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--FF8080813141B198013141BA0F7D0012-->  <STARTVERSION><![CDATA[0.1.18385]]></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.18258]]></STARTVERSION>
+<!--FF8080813151AEE1013151C4ACE6001B-->  <STARTVERSION><![CDATA[2.1.18385]]></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.google/src/org/openbravo/service/integration/google/GoogleAuthServlet.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.google/src/org/openbravo/service/integration/google/GoogleAuthServlet.java	Wed Oct 31 17:54:25 2012 +0100
@@ -32,6 +32,7 @@
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.client.kernel.KernelUtils;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -158,8 +159,12 @@
         vars.setSessionValue("#LOGGINGIN", "Y");
       }
 
-      resp.sendRedirect(strDireccion + "/security/Menu.html");
-
+      if (Utility.isMobileBrowser(req)
+          && KernelUtils.getInstance().isModulePresent(Utility.OB_MOBILE_JAVAPACKAGE)) {
+        resp.sendRedirect("../web/org.openbravo.client.mobile/");
+      } else {
+        resp.sendRedirect(strDireccion + "/security/Menu.html");
+      }
     } catch (Exception e) {
       log.error("Error processing return of Google Auth Service:" + e.getMessage(), e);
       this.getServletContext().getRequestDispatcher(loginPageURL).forward(req, resp);
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--FF8080813141B198013141B86DD70003-->  <VERSION><![CDATA[0.1.18385]]></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.
--- a/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--FF8080813141B198013141B8B21B0006-->  <STARTVERSION><![CDATA[3.0.18385]]></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 Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></VERSION>
+<!--F8D1B3ECB3474E8DA5C216473C840DF1-->  <VERSION><![CDATA[2.0.18385]]></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>
--- a/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Wed Oct 31 17:54:25 2012 +0100
@@ -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.18258]]></STARTVERSION>
+<!--9E3E7B42DB16405FB794496D309D7044-->  <STARTVERSION><![CDATA[3.0.18385]]></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 Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java	Wed Oct 31 17:54:25 2012 +0100
@@ -985,10 +985,11 @@
       int index = localWhereClause.toLowerCase().indexOf(key.toLowerCase());
       if (index != -1) {
         while (index != -1) {
+          final Object value = filterParameters.get(key);
           // substitute all occurrences of paramater
           localWhereClause = localWhereClause.substring(0, index) + getTypedParameterAlias() + " "
               + localWhereClause.substring(index + key.length());
-          typedParameters.add(filterParameters.get(key));
+          typedParameters.add("null".equals(value) ? null : value);
           index = localWhereClause.toLowerCase().indexOf(key.toLowerCase());
         }
       }
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Thu Oct 25 18:06:48 2012 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Wed Oct 31 17:54:25 2012 +0100
@@ -18,6 +18,7 @@
  */
 package org.openbravo.service.json;
 
+import java.sql.BatchUpdateException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -546,6 +547,19 @@
         }
         OBDal.getInstance().flush();
 
+        // business event handlers can change the data
+        // flush again before refreshing, refreshing can
+        // potentially remove any in-memory changes
+        int countFlushes = 0;
+        while (OBDal.getInstance().getSession().isDirty()) {
+          OBDal.getInstance().flush();
+          countFlushes++;
+          // arbitrary point to give up...
+          if (countFlushes > 100) {
+            throw new OBException("Infinite loop in flushing when persisting json: " + content);
+          }
+        }
+
         // refresh the objects from the db as they can have changed
         for (BaseOBObject bob : bobs) {
           OBDal.getInstance().getSession().refresh(bob);
@@ -584,9 +598,15 @@